On Wed, 13 Jul 2016, John Peterson wrote:

> On Wed, Jul 13, 2016 at 12:04 PM, Salazar De Troya, Miguel <
> salazardet...@llnl.gov> wrote:
>
>> I have tried the following: Add an ExplicitSystem pointer to
>> PoissonSystem and add this system in the PoissonSystem constructor:
>>
>>    densities = &(es.add_system<ExplicitSystem>("Densities"));
>
> It's possible there is a simple programming error that would explain the
> issues you are having...

I suspect that adding a system in the constructor for another system
*is* the programming error.  EquationSystems::add_system() is what
calls that constructor in the first place, and I don't think anybody's
ever troubled to make sure that add_system() is a reentrant function.

Hmm... that looks like the problem.  The add_system<PoissonSystem>()
passes this->n_systems() (i.e. 0, if this is the first addition) to
the PoissonSystem constructor.. but before it has a chance to get to
_systems.insert(), add_system<ExplicitSystem>() gets called, and it
*also* sees this->n_systems() == 0, so now we've got two systems added
with overlapping ids.
---
Roy

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to