Weighted state redistribution (Berger and Giuliani, J. Comput. Phys. 428, 2021; Giuliani et al., J. Comput. Phys. 464, 2022), as an EBRedistribution.
More...
|
|
| EBStateRedistribution ()=delete |
| | Disallowed weak construction.
|
| | EBStateRedistribution (const Vector< RefCountedPtr< EBLevelGrid > > &a_eblg, const Vector< RefCountedPtr< EBLevelGrid > > &a_eblgCoFi, const Vector< int > &a_refinementRatios, const int a_finestLevel, const int a_order, const Real a_targetVolFrac, const Vector< RefCountedPtr< EBMassRedistribution > > &a_massRedistribution, const Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > &a_coveredByFiner, const Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > &a_coarseFineGhost) noexcept |
| | Constructor. Builds the neighbourhoods on all levels.
|
|
virtual | ~EBStateRedistribution () noexcept |
| | Destructor.
|
| void | redistribute (EBAMRCellData &a_divG, const EBAMRCellData &a_phi, const Real a_dt) noexcept override |
| | Turn kappa*D into the right-hand side of the update stabilized by state redistribution.
|
|
| EBRedistribution () noexcept |
| | Default constructor.
|
| | EBRedistribution (const EBRedistribution &a_other)=delete |
| | Disallowed copy constructor.
|
| | EBRedistribution (const EBRedistribution &&a_other)=delete |
| | Disallowed move constructor.
|
| EBRedistribution & | operator= (const EBRedistribution &a_other)=delete |
| | Disallowed copy assignment.
|
| EBRedistribution & | operator= (const EBRedistribution &&a_other)=delete |
| | Disallowed move assignment.
|
|
virtual | ~EBRedistribution () noexcept |
| | Destructor.
|
|
|
int | m_finestLevel |
| | Finest grid level.
|
|
int | m_order |
| | Order of the reconstruction: 0 or 2.
|
|
Real | m_targetVolFrac |
| | Target volume fraction.
|
|
Vector< RefCountedPtr< EBLevelGrid > > | m_eblg |
| | Grids on each level.
|
|
Vector< RefCountedPtr< EBLevelGrid > > | m_eblgCoFi |
| | Coarsening of the grids: entry l is the coarsening of the grids on level l + 1.
|
|
Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > | m_coveredByFiner |
| | Cells covered by the finer level, with s_numGhost ghost cells.
|
|
Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > | m_coarseFineGhost |
| | Cells inside the domain but outside the grids of the level, with s_numGhost ghost cells.
|
|
Vector< int > | m_refinementRatios |
| | Refinement ratios between levels.
|
|
Vector< RefCountedPtr< EBMassRedistribution > > | m_massRedistribution |
| | Mass redistribution operators on each level, which redistribute the corrections on refinement boundaries.
|
|
Vector< RefCountedPtr< LevelData< BaseFab< int > > > > | m_tracker |
| | Neighbourhoods. Component 0 is the number of merged neighbours of the cell, components 1, 2, ... are their offsets, as indices into the 3^D block around the cell (see offset()).
|
|
Vector< RefCountedPtr< LevelData< BaseFab< int > > > > | m_numNbhd |
| | Number of neighbourhoods that each cell is in, its own included.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_alpha |
| | Weights. Component 0 is alpha_0 of the cell, component 1 is alpha_1 of the neighbourhood of the cell.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_nbhdVol |
| | Volume of the neighbourhood of each cell.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_nbhdCentroid |
| | Centroid of the neighbourhood of each cell, relative to the cell centre in units of the cell size.
|
|
Vector< RefCountedPtr< LevelData< BaseFab< int > > > > | m_connected |
| | Neighbours in the 3^D block around each merged cell that are connected to it, as a bit mask over the offsets. Used in the slopes.
|
|
Vector< RefCountedPtr< LayoutData< bool > > > | m_activeBox |
| | Per box, true if the box has a cell whose state is changed by the redistribution.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_nbhdAverage |
| | Scratch: neighbourhood averages Q.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_slopes |
| | Scratch: limited slopes of the merged neighbourhoods.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_syncMass |
| | Scratch: corrections of the valid cells, as mass in units of the cell volume of the level.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_state |
| | Scratch: the provisional state U = phi - dt*D. In the ghost cells it is U of the coarse cell under the ghost cell.
|
|
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_ghostMass |
| | Scratch on the coarsening of the grids of a level, with one ghost cell, for data of the coarser level: U of the coarse cells, the corrections from the ghost cells of the level (as mass in units of the cell volume of the coarser level), and the corrections of the coarse cells covered by the level.
|
|
Vector< Copier > | m_ghostCopier |
| | Copiers that add m_ghostMass of a level, ghost cells included, to m_syncMass of the coarser level.
|
|
Vector< Copier > | m_coarseCopier |
| | Copiers from the coarser level to m_ghostMass of a level, ghost cells included.
|
|
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > | m_massDiff |
| | Scratch: the parts of the corrections that are redistributed with the mass redistribution, as rates.
|
Weighted state redistribution (Berger and Giuliani, J. Comput. Phys. 428, 2021; Giuliani et al., J. Comput. Phys. 464, 2022), as an EBRedistribution.
The algorithm follows the implementation in AMReX (AMReX_EB_StateRedistribute.cpp and the files it uses). A cut cell i with volume fraction kappa_i below the target volume fraction is merged with up to 2^D - 1 of its neighbours: first the neighbour in the direction of the largest component of the EB normal, then, while the merged volume is below the target or the normal components tie, the neighbours that complete a 2x2 (and in 3D a 2x2x2) block. Each cell r is in N_r neighbourhoods, its own included. The neighbourhood of i has the weights
alpha_1(i) = (target - kappa_i)/sum(kappa_r) on the merged neighbours r, alpha_0(r) = 1 - sum(alpha_1(i)/N_r) on each cell r, over the neighbourhoods that contain r,
the volume V_i = alpha_0(i)*kappa_i + sum(alpha_1(i)*kappa_r/N_r) and the centroid c_i (the same weighted average of the cell centroids). An update phi^{n+1} = phi^n - dt*D starts from the provisional state U = phi^n - dt*D, forms the neighbourhood averages Q_i with the same weights, a limited least-squares slope of Q over the neighbouring neighbourhoods, and gives each cell
phi_r^{n+1} = (alpha_0(r)*N_r*q_r(x_r) + sum(alpha_1(i)*q_i(x_r)))/N_r,
where q_i is the linear reconstruction of neighbourhood i and the sum runs over the merged neighbourhoods that contain r. The right-hand side returned by redistribute() is R = (phi^n - phi^{n+1})/dt, which depends on phi^n and dt. A cell in no merged neighbourhood keeps R = D.
The neighbourhoods reach one cell, and the slopes up to two cells, so the state and the divergence must have two ghost cells, filled on refinement boundaries. Cells near small cells must be single-valued.
On AMR hierarchies the redistribution follows Barrio Sanchez et al. (arXiv:2309.06372, 2023) and AMReX (ApplyMLRedistribution). Each level is redistributed separately. The neighbourhoods are centred on the valid cells of the level, those inside its grids and not covered by the finer level, but they can also contain cells that stand in for another level: cells covered by the finer level, and ghost cells outside the grids of the level, which overlay valid cells of the coarser level. The state of a ghost cell is that of the coarse cell under it. The stand-ins also enter the slopes and the limiter. The redistribution conserves mass in each neighbourhood. Its update is split into transfers between pairs of cells, the part from the slopes included, and the transfers between valid cells and stand-ins are moved to the cells that the stand-ins represent:
- a transfer to a ghost cell goes to the coarse cell under it. As in the paper, a coarse cell with volume fraction kappa takes the fraction kappa of it, and the rest is redistributed to its neighbours with the EBMassRedistribution operators.
- a transfer to a covered cell goes to the fine cells under it, as the same change of the state in each of them. The paper instead gives it back to the valid coarse cell, which undoes the stabilization of a small coarse cell whose neighbours are all covered.
The update is then conservative over the composite grid when the fluxes at refinement boundaries are consistent between the levels.