abarret / multiphase-stokes

Solver a mixture of fluids based on IBAMR
1 stars 0 forks source link

Make things work with advanceHierarchy() #28

Closed abarret closed 1 year ago

abarret commented 1 year ago

There are a few significant changes here.

  1. State variables (pressure, velocity) are now created with the registerVariable interface, which sets them up to be reinitialized on regridding.
  2. You can retrieve patch indices for state variables with the VariableDatabase<NDIM> and with getCurrentContext(), getNewContext(), and getScratchContext(). The current context holds the current values.
  3. There are side and cell centered math objects d_hier_[s|c]c_data_manager to do any kind of copying/vector operations on patch indices.
  4. Solvers and vectors are created in preprocessHierarchyIntegrator. All integrateHierarchy does now is solve the system.

The function that decides when to regrid is not implemented in this class. It is atRegridPointSpecialized for which a default implementation is provided in the base class HierarchyIntegrator. The default implementation regrids after a set number of time steps provided by the input database option regrid_interval.

abarret commented 1 year ago

@bindi-nagda Take a look now. I replaced the two separate variables with one variable with a depth of NDIM. It also reads in tolerances from the input file.

bindi-nagda commented 1 year ago

Okay, looks good to me. By the way, why don't we need to allocate patch data for grad_thn_idx?

abarret commented 1 year ago

Okay, looks good to me. By the way, why don't we need to allocate patch data for grad_thn_idx?

Variables registered with getCurrentContext() are always allocated. They represent "state" data that is always maintained on the patch hierarchy.

bindi-nagda commented 1 year ago

Ok, I see. Should I go ahead and merge this PR?

abarret commented 1 year ago

Let's go ahead and merge. We need to test this more, but we can do that later.