On Tue, 7 Feb 2012, water force wrote:

> I have a couple of meshes, each with the same linear equations and boundary
> conditions. Then I tried to solve them in a loop in the following way:
>
> for (int i = 0; i < number_of_meshes; i++)
> {
>    EquationSystems es( mesh[i] );
>    es.add_system<LinearImplicitSystem>(sys_name);
>    es.get_system(sys_name).add_variable("u", FIRST);
>    es.get_system(sys_name).attach_assemble_function(assemble_func);
>    es.init();
>    es.get_system(sys_name).solve();
> }
>
> But it always gives a segmentation fault if the number of meshes is more
> than one. I guess it might be due to the declaration of an equation system
> in the loop. Could you give me any suggestions? Thanks!

This is an uncommon sort of algorithm (and possibly very inefficient:
if you've got the same linear equations you shouldn't need to assemble
the same matrices and preconditioners over and over again just to
handle different forcing functions) but I don't see anything actually
*incorrect* here; there's either a bug in your assemble_func or in the
library.  Have you run with METHOD=dbg or at least METHOD=devel to see
if you can hit an assertion failure before you hit a segmentation
fault?
---
Roy

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to