chombo-discharge
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CoarseInterpQuadCF Class Reference

Class for computing the required Taylor terms for doing the orthogonal extrapolation to the ghost cell position. This is used in conjuction with EBLeastSquaresMultigridInterpolator.H, and should be understood in that context only. More...

#include <CD_CoarseInterpQuadCF.H>

Public Member Functions

 CoarseInterpQuadCF () noexcept
 Default constructor. Must subsequently call the define function.
 
virtual ~CoarseInterpQuadCF () noexcept
 Destructor.
 
virtual void define (const DisjointBoxLayout &a_dblFine, const ProblemDomain &a_domainCoar, const DataIndex &a_dit, const Box &a_fineGhostCells, const int a_refRat, const int a_ignoreDir) noexcept
 Define function. Puts object in usable state. More...
 
virtual Real computeFirstDeriv (const FArrayBox &a_coarPhi, const IntVect &a_ivCoar, const int a_dir, const int a_coarVar) const noexcept
 Compute first-derivative Taylor term in direction a_dir. More...
 
virtual Real computeSecondDeriv (const FArrayBox &a_coarPhi, const IntVect &a_ivCoar, const int a_dir, const int a_coarVar) const noexcept
 Compute second-derivative Taylor term in direction a_dir. More...
 
virtual Real computeMixedDeriv (const FArrayBox &a_coarPhi, const IntVect &a_ivCoar, const int a_coarVar) const noexcept
 Compute mixed-derivative Taylor term in directions orthogonal m_ignoreDir. More...
 

Protected Types

enum class  FirstDerivStencil : unsigned short {
  Centered2 , Backward2 , Forward2 , Backward1 ,
  Forward1
}
 Simple enum for holding stencil types for the first derivative.
 
enum class  SecondDerivStencil : unsigned short { Centered2 , Backward1 , Forward1 }
 Simple enum for holding stencil types for the second derivative.
 
enum class  MixedDerivStencil : unsigned short { Standard , Explicit }
 Simple enum for holding stencil types for the mixed derivative.
 

Protected Member Functions

virtual void defineStencils () noexcept
 Compute all first-derivative stencils in the coarse grid cells. More...
 
virtual void defineMixedDerivStencils () noexcept
 Compute all second-derivative stencils in the coarse grid cells. More...
 

Protected Attributes

bool m_isDefined
 Is defined or not.
 
DisjointBoxLayout m_dblFine
 Fine grids.
 
ProblemDomain m_domainCoar
 Coarse domain.
 
DataIndex m_dit
 Data index in the fine grid.
 
int m_ignoreDir
 Interpolation direction to ignore.
 
int m_tanDir1
 One tangential direction.
 
int m_tanDir2
 One tangential direction.
 
int m_refRat
 Refinement factor to coarse.
 
Box m_stencilBox
 Coarse-grid cells corresponding to the fine-grid ghost cells. More...
 
BaseFab< FirstDerivStencilm_firstDerivStencils [SpaceDim]
 Stencil types for first derivative.
 
BaseFab< SecondDerivStencilm_secondDerivStencils [SpaceDim]
 Second-derivative stencils (in all directions except m_dir)
 
BaseFab< MixedDerivStencilm_mixedDerivStencils
 Identifier for whether or not we should use a standard or explicit mixed derivative stencil.
 
BaseFab< DerivStencil > m_explicitMixedDerivStencils
 Mixed-derivative stencil. Only defined in 3D.
 

Detailed Description

Class for computing the required Taylor terms for doing the orthogonal extrapolation to the ghost cell position. This is used in conjuction with EBLeastSquaresMultigridInterpolator.H, and should be understood in that context only.

This should be defined over the fine grid. It will store stencils for computing the various required terms in the Taylor series, and the user can call various functions for getting those terms.

Member Function Documentation

◆ computeFirstDeriv()

Real CoarseInterpQuadCF::computeFirstDeriv ( const FArrayBox &  a_coarPhi,
const IntVect &  a_ivCoar,
const int  a_dir,
const int  a_coarVar 
) const
virtualnoexcept

Compute first-derivative Taylor term in direction a_dir.

Parameters
[in]a_coarPhiCoarse-side phi.
[in]a_ivCoarCell where we compute.
[in]a_dirDirection of derivative. Must be different from m_ignoreDir
[in]a_coarVara_dir Direction of derivative. Must be different from m_ignoreDir

◆ computeMixedDeriv()

Real CoarseInterpQuadCF::computeMixedDeriv ( const FArrayBox &  a_coarPhi,
const IntVect &  a_ivCoar,
const int  a_coarVar 
) const
virtualnoexcept

Compute mixed-derivative Taylor term in directions orthogonal m_ignoreDir.

Parameters
[in]a_coarPhiCoarse-side phi.
[in]a_ivCoarCell where we compute.
[in]a_coarVara_dir Direction of derivative. Must be different from m_ignoreDir

◆ computeSecondDeriv()

Real CoarseInterpQuadCF::computeSecondDeriv ( const FArrayBox &  a_coarPhi,
const IntVect &  a_ivCoar,
const int  a_dir,
const int  a_coarVar 
) const
virtualnoexcept

Compute second-derivative Taylor term in direction a_dir.

Parameters
[in]a_coarPhiCoarse-side phi.
[in]a_ivCoarCell where we compute.
[in]a_dirDirection of derivative. Must be different from m_ignoreDir
[in]a_coarVara_dir Direction of derivative. Must be different from m_ignoreDir

◆ define()

void CoarseInterpQuadCF::define ( const DisjointBoxLayout &  a_dblFine,
const ProblemDomain &  a_domainCoar,
const DataIndex &  a_dit,
const Box &  a_fineGhostCells,
const int  a_refRat,
const int  a_ignoreDir 
)
virtualnoexcept

Define function. Puts object in usable state.

Parameters
[in]a_dblFineFine grids
[in]a_domainCoarCoarse domain
[in]a_ditData index on the fine grid
[in]a_fineGhostCellsGhost cells to interpolate (on the fine level)
[in]a_refRatRefinement factor between coarse and fine
[in]a_ignoreDirCoordinate to ignore when doing the interpolation. I.e., we interpolate in all coordinates except this one.

◆ defineMixedDerivStencils()

void CoarseInterpQuadCF::defineMixedDerivStencils ( )
protectedvirtualnoexcept

Compute all second-derivative stencils in the coarse grid cells.

This only needs to accurate to O(h).

◆ defineStencils()

void CoarseInterpQuadCF::defineStencils ( )
protectedvirtualnoexcept

Compute all first-derivative stencils in the coarse grid cells.

Note
Must be accurate to O(h^2).

Member Data Documentation

◆ m_stencilBox

Box CoarseInterpQuadCF::m_stencilBox
protected

Coarse-grid cells corresponding to the fine-grid ghost cells.

Note
This is the coarsened box of the fine-grid ghost cell layer, and is where we've defined all our stencils.

The documentation for this class was generated from the following files: