On Fri, 26 Jul 2013, Michael Povolotskyi wrote:

> It seems to me that I'm doing something wrong with libmesh.

Not "wrong", exactly, just unexpected.  The original libMesh design
didn't all you to add_anything() after initialization (except as you
discovered, accidentally) and we've been fixing that piecemeal as
developers discover need to.

> EquationSystems es(mesh);
> es.add_system(...); //add fist system
> es.init();
> /* do domething with the first system*/
>
> es.add_system(...); //ad second system
> es.init();
> /* do domething with the second system*/
>
> this used to work in the old version, but now what happens is that the
> second system has 2 times more DOFs than it should.
> I modified my code in such a way that instead of initializing es, I'm
> initializing just the newly created system.
> This seems to work.
>
> My question:
> when it is appropriate to initialize the System object, and when one has
> to initialize the EquationSystems object?

I believe the current behavior is exactly as you discovered: each
System and EquationSystems needs be initialized only once, nothing but
init() does that for you, and the EquationSystems object is only
capable of passing down the initialization call to systems it already
knows about.

The proper behavior (based on our other fixed add_foo() APIs) would be
for add_system() to check whether the EquationSystems is already
initialized, and if so to initialize the new system at that time.  I
don't have time to work on that at the moment, but we'd love a patch
implementing it (or if you're pressed for time too, just a simple unit
test which verifies the current behavior so we don't accidentally
regress it for you further in the future).
---
Roy

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to