Closed abarret closed 1 year ago
@abarret How do the CartGridFunctions _d_un_initfcn etc get initialized?
Also, I thought that the initial values for the state variables were being set to 0 in integrateHierarchy
, so do we still need to set the initial data using the above functions?
@abarret How do the CartGridFunctions _d_un_initfcn etc get initialized?
This isn't set up yet. We should add a setter in the class.
Also, I thought that the initial values for the state variables were being set to 0 in
integrateHierarchy
, so do we still need to set the initial data using the above functions?
Yes. You are correct that we don't need the CartGridFunction
to initialize the data (although this will set the initial condition to something other than zero). But we do need to allocate the data. If you allocate and deallocate data in integrateHierarchy
, then there's no way to maintain state variables. This allocates in the function that gets called when the patch hierarchy is created.
This removes a bunch of unused code and updates the initialization process. The important part is the second commit.
@bindi-nagda don't merge this until you understand what the code is doing. In particular, the process of integrating the hierarchy will follow the process
INSVCTwoFluidStaggeredHierarchyIntegrator
object.initializePatchHierarchy()
to create the patch hierarchy and initialize data.initializePatchHierarchy()
will callinitializeHierarchyIntegrator()
andinitializeLevelDataSpecialized()
as needed.advanceHierarch()
orintegrateHierarchy()
to advance a single time step.