Thanks for your comments! A bug in my assemble function did result in the
segfault. Actually I used attach_assemble_object in my code but made a
mistake when passing the string sys_name to the constructor in the assembly
class. Yes this algorithm seems uncommon because the material properties
associated with these meshes are different. Is there any other elegant way
to do this?

Best
Jingjing

On Tue, Feb 7, 2012 at 5:29 PM, Roy Stogner <[email protected]>wrote:

>
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to