LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
178 stars 33 forks source link

Reevaluate where time is getting stored #713

Closed white238 closed 2 years ago

white238 commented 2 years ago

Having time stored in BasePhysics is confusing once you get past more than one physics. For example, ThermalSolid has three time_ member variables, ThermalSolid::time_, Solid::time_, and ThermalConduction::time_. This seems like it would continue to be a headache to keep in sync.

Can we store time in StateManager and keep that as the one source of truth?

jamiebramwell commented 2 years ago

This is a great idea.

samuelpmishLLNL commented 2 years ago

Some other thoughts to consider: depending on your physics and time integrator, solution fields may not all be specified at the same point in time (e.g. velocity is often recorded at the half-step). That being said, it would still make more sense to put the time on the FiniteElementState than the physics in this case.

In a multiphysics simulation, having the time on the BasePhysics might make some sense, since the different physics could be integrated through time in some nonuniform way.

samuelpmishLLNL commented 2 years ago

There should still be one source of truth now: the time on the highest-level physics module (e.g. ThermalSolid::time_ in your example)