Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

linear system

Please login with a confirmed email address before reporting spam

Hi,

I'd like to ask if is there a chance to get the resulting linear system after assembly (and perhaps preconditioning) out of the program to let it be solved on other machine with my own solver and then load the solution vector back to COMSOL for postprocessing.

Thnx,
Hans

9 Replies Last Post 2010/05/13 2:26 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/01/20 23:15 GMT-5
Hi

If you have the matlab link andyou study from the doc the comsol "fem" structure you can do about everything, within the RAM limits of your PC

Do an indexed search on your doc files, you will find many references

Good luck
Ivar
Hi If you have the matlab link andyou study from the doc the comsol "fem" structure you can do about everything, within the RAM limits of your PC Do an indexed search on your doc files, you will find many references Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/01/21 11:38 GMT-5

Hi

If you have the matlab link andyou study from the doc the comsol "fem" structure you can do about everything, within the RAM limits of your PC

Do an indexed search on your doc files, you will find many references

Good luck
Ivar

Yes, the assemble command assembles the stiffness matrix, right-hand side, mass matrix, damping matrix, and constraints of a PDE problem using a finite element discretization. You can output all these matrices or one or more selected matrices. Read more in the COMSOL Multiphysics MATLAB Interface Guide.
[QUOTE] Hi If you have the matlab link andyou study from the doc the comsol "fem" structure you can do about everything, within the RAM limits of your PC Do an indexed search on your doc files, you will find many references Good luck Ivar [/QUOTE] Yes, the [b]assemble[/b] command assembles the stiffness matrix, right-hand side, mass matrix, damping matrix, and constraints of a PDE problem using a finite element discretization. You can output all these matrices or one or more selected matrices. Read more in the [i]COMSOL Multiphysics MATLAB Interface Guide[/i].

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/01/23 5:10 GMT-5
Hi

Indeed this works very nicely for small and medium models. But for "true" engineering cases of some complexity the sizes of the matrices become too heavy to export and work with in Matlab.

There is a nice niche for COMSOL to explore the "superelement" and modal reduction approach. Something like what is implemented in "FEDEM" (from Trondheim www.fedem.no) for structural, or again differently in NASTRAN, but for COMSOL in a more generalised way.

Have a nice week-end
Ivar
Hi Indeed this works very nicely for small and medium models. But for "true" engineering cases of some complexity the sizes of the matrices become too heavy to export and work with in Matlab. There is a nice niche for COMSOL to explore the "superelement" and modal reduction approach. Something like what is implemented in "FEDEM" (from Trondheim www.fedem.no) for structural, or again differently in NASTRAN, but for COMSOL in a more generalised way. Have a nice week-end Ivar

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/01/23 5:58 GMT-5
Hi

yes there are, you have some similar discussions ongoing, see the eigenfrequency modal mass extraction of this months. Or just read through your doc on matlab exchange and "fem" structure.

It will take some time to get into the structure details, but afterwards you will have the knowledge to get to any variable. The main tricky thing is the indexing of elements and how to identify/reidentify, BC's and geoemtrical items.

Good luck
Ivar
Hi yes there are, you have some similar discussions ongoing, see the eigenfrequency modal mass extraction of this months. Or just read through your doc on matlab exchange and "fem" structure. It will take some time to get into the structure details, but afterwards you will have the knowledge to get to any variable. The main tricky thing is the indexing of elements and how to identify/reidentify, BC's and geoemtrical items. Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/02/09 11:53 GMT-5

Yes, the assemble command assembles the stiffness matrix, right-hand side, mass matrix, damping matrix, and constraints of a PDE problem using a finite element discretization. You can output all these matrices or one or more selected matrices. Read more in the COMSOL Multiphysics MATLAB Interface Guide.


Hi, I'd like to use stiffness matrix 'K' from assemble function and solve linear system of equations 'Kx=y', where I know 'y' vector. Which function should I use? I looked for femstatic function, but it only accepts fem structure.

thanks
peter

[QUOTE] Yes, the [b]assemble[/b] command assembles the stiffness matrix, right-hand side, mass matrix, damping matrix, and constraints of a PDE problem using a finite element discretization. You can output all these matrices or one or more selected matrices. Read more in the [i]COMSOL Multiphysics MATLAB Interface Guide[/i]. [/QUOTE] Hi, I'd like to use stiffness matrix 'K' from assemble function and solve linear system of equations 'Kx=y', where I know 'y' vector. Which function should I use? I looked for [b]femstatic[/b] function, but it only accepts fem structure. thanks peter

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/02/16 8:45 GMT-5
After reading more documentation I found function 'femlin' :

u = femlin('in',{'K' K 'L' L},'out','u') is equivalent to solving the linear system using u = K\L, with the important difference that you have access to all linear system solvers (except Geometric multigrid) using the Linsolver property.


Peter
After reading more documentation I found function 'femlin' : u = femlin('in',{'K' K 'L' L},'out','u') is equivalent to solving the linear system using u = K\L, with the important difference that you have access to all linear system solvers (except Geometric multigrid) using the Linsolver property. Peter

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/02/16 15:12 GMT-5
Hi Ivar,

You've mentioned "indexed search" on the doc files in several of your responses here. Could you remind us how to do that?

Thx.
Hi Ivar, You've mentioned "indexed search" on the doc files in several of your responses here. Could you remind us how to do that? Thx.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/12 17:47 GMT-4
I see on this chain that I can use Matlab to read the stiffness matrix out of COMSOL and then conceivably identify the error that is causing a residual to be NaN.

But where to begin? I can download a trial version of Matlab from Mathworks. Which modules do I need? Matlab presumably. How about Simulink? Any others? I guess the latest version of Matlab works with COMSOL 4.0?

Thanks, John
p.s. Is anyone else on COMSOL 4.0 having trouble seeing the equations?? Yes, I've clicked on show equations, and I click on "Update Equation View". But the only things to ever show up are the constraints. Once, on a k-e, I got loads of equations to show up on a boundary condition, but this is a rare event.
I see on this chain that I can use Matlab to read the stiffness matrix out of COMSOL and then conceivably identify the error that is causing a residual to be NaN. But where to begin? I can download a trial version of Matlab from Mathworks. Which modules do I need? Matlab presumably. How about Simulink? Any others? I guess the latest version of Matlab works with COMSOL 4.0? Thanks, John p.s. Is anyone else on COMSOL 4.0 having trouble seeing the equations?? Yes, I've clicked on show equations, and I click on "Update Equation View". But the only things to ever show up are the constraints. Once, on a k-e, I got loads of equations to show up on a boundary condition, but this is a rare event.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/05/13 2:26 GMT-4
Hi Davis and John

for the indexing, I'm just directing Microsoft indexer onto the doc files and run a normal MS search, but I would love to have the Google indexer (not in our company policy) as I find it better, and it opens the pdf doc directly at the right page, while with the MS you must rerun a "find" within the pdf.

For matlab normally you need only a simple standard matlab, not even Simulinl if you do not intend to control a system via Matlab + Simulink <=> Comsol

for the equation, the "upper level" is not yet implemented, but the "lower level" is there see file

Have fun Comsoling
Ivar
Hi Davis and John for the indexing, I'm just directing Microsoft indexer onto the doc files and run a normal MS search, but I would love to have the Google indexer (not in our company policy) as I find it better, and it opens the pdf doc directly at the right page, while with the MS you must rerun a "find" within the pdf. For matlab normally you need only a simple standard matlab, not even Simulinl if you do not intend to control a system via Matlab + Simulink Comsol for the equation, the "upper level" is not yet implemented, but the "lower level" is there see file Have fun Comsoling Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.