Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

NodeQuadCFInterp2 Class Reference

Class to interpolate quadratically at coarse/fine interface when refinement ratio is 2. More...

#include <NodeQuadCFInterp2.H>

List of all members.

Public Methods

 NodeQuadCFInterp2 ()
 {\bf constructors, destructor and defines}

 NodeQuadCFInterp2 (const DisjointBoxLayout &a_grids, const Box &a_domain, const LayoutData< NodeCFIVS > *const a_loCFIVS, const LayoutData< NodeCFIVS > *const a_hiCFIVS, bool a_interfaceOnly, int a_interpolationDegree, int a_ncomp=1)
 NodeQuadCFInterp2 (const DisjointBoxLayout &a_grids, const ProblemDomain &a_domain, const LayoutData< NodeCFIVS > *const a_loCFIVS, const LayoutData< NodeCFIVS > *const a_hiCFIVS, bool a_interfaceOnly, int a_interpolationDegree, int a_ncomp=1)
 ~NodeQuadCFInterp2 ()
void define (const DisjointBoxLayout &a_grids, const Box &a_domain, const LayoutData< NodeCFIVS > *const a_loCFIVS, const LayoutData< NodeCFIVS > *const a_hiCFIVS, bool a_interfaceOnly, int a_interpolationDegree, int a_ncomp=1)
void define (const DisjointBoxLayout &a_grids, const ProblemDomain &a_domain, const LayoutData< NodeCFIVS > *const a_loCFIVS, const LayoutData< NodeCFIVS > *const a_hiCFIVS, bool a_interfaceOnly, int a_interpolationDegree, int a_ncomp=1)
bool isDefined () const
void coarseFineInterp (LevelData< NodeFArrayBox > &a_phi, const LevelData< NodeFArrayBox > &a_phiCoarse)
 {\bf data modification functions}


Protected Attributes

DisjointBoxLayout m_grids
ProblemDomain m_domain
Box m_domainCoarseNodes
DisjointBoxLayout m_coarsenedGrids
LevelData< NodeFArrayBoxm_coarseCopy
bool m_interfaceOnly
int m_interpolationDegree
int m_ncomp
bool m_isDefined
const LayoutData< NodeCFIVS > * m_loCFIVS
const LayoutData< NodeCFIVS > * m_hiCFIVS


Detailed Description

Class to interpolate quadratically at coarse/fine interface when refinement ratio is 2.

Class to interpolate quadratically at interface between this level and next coarser level, when the refinement ratio is 2. This class should be considered internal to NodeQuadCFInterp.

{\bf Long Description:} \

The interface has codimension one. If a fine node coincides with a coarse node, then we merely project from the coarse node to the fine node. Otherwise, we take the mean of the neighboring coarse nodes and subtract 1/8 * dx^2 times the sum of the second derivatives in the appropriate directions.\

The interpolation is performed in function coarseFineInterp().\ The constructor computes m_loCFIVS and m_hiCFIVS to determine the fine nodes at the interface with the coarse level.\

The constructor also takes m_loCFIVS and m_hiCFIVS to determine the fine nodes at the interface with the coarse level. Calling getFineIVS() on m_loCFIVS[idir][dit()] gives us the IntVectSet of nodes of m_grids[dit()] on the face in the low direction in dimension idir, that lie on the interface with the coarser level. Similarly with m_hiCFIVS[idir][dit()] for the opposite face, in the high direction in dimension idir.\

{\bf 2-D Description:} \

In the 2-D problem, the interface is 1-D. Between coarse nodes at 0 and 1, we approximate the value at the fine node by \ f(1/2) ~ (f(0) + f(1))/2 - 1/8 * f''(1/2) \ where we estimate the second derivative f''(1/2) from the coarse values f(0), f(1), and either f(-1) or f(2) or both.\

If the points -1 and 2 are both on the grid: \begin{verbatim} o---o-x-o---o -1 0 1 2 \end{verbatim} then we use f''(1/2) ~ (f(-1) - f(0) - f(1) + f(2))/2. \

If the point -1 is on the grid but 2 is not: \begin{verbatim} o---o-x-o o -1 0 1 2 \end{verbatim} then we approximate f''(1/2) by f''(0) and use f''(0) ~ (f(-1) - 2 * f(0) + f(1)). \

If the point 2 is on the grid but -1 is not: \begin{verbatim} o o-x-o---o -1 0 1 2 \end{verbatim} then we approximate f''(1/2) by f''(1) and use f''(1) ~ (f(0) - 2 * f(1) + f(2)). \

{\bf 3-D Description:} \

In the 3-D problem, the interface is 2-D. For any given fine node along the interface, look at its three coordinates. At least one of the coordinates is divisible by 2, meaning that it lies on a plane of coarse nodes. If all of the coordinates are even, then the fine node coincides with a coarse node, and we project the value. If only one coordinate is odd, then this reduces to the problem of a 1-D interface described above in the 2-D case. \

We are left with the problem of interpolating f(1/2, 1/2). \begin{verbatim} (0,1) (1,1) o-------o | | | x | | | o-------o (0,0) (1,0) \end{verbatim} We use \ f(1/2,1/2) ~ (f(0,0) + f(0,1) + f(1,0) + f(1,1))/4 - 1/8 * ( d^2 f/dx^2 (1/2,1/2) + d^2 f/dy^2 (1/2,1/2)) \ where the second derivatives are estimated from the four neighboring coarse nodes and their neighbors. \

In particular, d^2 f/dx^2 (1/2,1/2) is approximated by the mean of d^2 f/dx^2 (1/2, 0) and d^2 f/dx^2 (1/2, 1). These second derivatives are estimated in the same way as described above for the 1-D interface in the 2-D case.


Constructor & Destructor Documentation

NodeQuadCFInterp2::NodeQuadCFInterp2  
 

{\bf constructors, destructor and defines}

Default constructor. User must subsequently call define().

NodeQuadCFInterp2::NodeQuadCFInterp2 const DisjointBoxLayout &    a_grids,
const Box &    a_domain,
const LayoutData< NodeCFIVS > *const    a_loCFIVS,
const LayoutData< NodeCFIVS > *const    a_hiCFIVS,
bool    a_interfaceOnly,
int    a_interpolationDegree,
int    a_ncomp = 1
 

Constructor calls setDefaultValues() and then calls define() with the same arguments.

NodeQuadCFInterp2::NodeQuadCFInterp2 const DisjointBoxLayout &    a_grids,
const ProblemDomain &    a_domain,
const LayoutData< NodeCFIVS > *const    a_loCFIVS,
const LayoutData< NodeCFIVS > *const    a_hiCFIVS,
bool    a_interfaceOnly,
int    a_interpolationDegree,
int    a_ncomp = 1
 

Constructor calls setDefaultValues() and then calls define() with the same arguments.

NodeQuadCFInterp2::~NodeQuadCFInterp2  
 

Destructor.


Member Function Documentation

void NodeQuadCFInterp2::coarseFineInterp LevelData< NodeFArrayBox > &    a_phi,
const LevelData< NodeFArrayBox > &    a_phiCoarse
 

{\bf data modification functions}

Coarse / Fine (inhomogeneous) interpolation operator. Fill the nodes of a_phi on the coarse/fine interface with interpolated data from a_phiCoarse.

{\bf Arguments:}\ a_phi (modified): the data at this level.\ a_phiCoarse (not modified): the data at the next coarser level.\

void NodeQuadCFInterp2::define const DisjointBoxLayout &    a_grids,
const ProblemDomain &    a_domain,
const LayoutData< NodeCFIVS > *const    a_loCFIVS,
const LayoutData< NodeCFIVS > *const    a_hiCFIVS,
bool    a_interfaceOnly,
int    a_interpolationDegree,
int    a_ncomp = 1
 

Full define function. Makes all coarse-fine information and sets internal variables. The current level is taken to be the fine level.

{\bf Arguments:}\ a_grids: domain of this level.\ a_domain: CELL-centered physical domain at this level.\ a_loCFIVS, a_hiCFIVS: pointers to objects used for figuring out which nodes lie on interface with the next coarser level. \ a_interfaceOnly: interpolating from interface only?\ a_interpolationDegree: 1 for (bi)linear, 2 for (bi)quadratic\ a_ncomp: number of components.\

void NodeQuadCFInterp2::define const DisjointBoxLayout &    a_grids,
const Box &    a_domain,
const LayoutData< NodeCFIVS > *const    a_loCFIVS,
const LayoutData< NodeCFIVS > *const    a_hiCFIVS,
bool    a_interfaceOnly,
int    a_interpolationDegree,
int    a_ncomp = 1
 

Full define function. Makes all coarse-fine information and sets internal variables. The current level is taken to be the fine level.

{\bf Arguments:}\ a_grids: domain of this level.\ a_domain: CELL-centered physical domain at this level.\ a_loCFIVS, a_hiCFIVS: pointers to objects used for figuring out which nodes lie on interface with the next coarser level. \ a_interfaceOnly: interpolating from interface only?\ a_interpolationDegree: 1 for (bi)linear, 2 for (bi)quadratic\ a_ncomp: number of components.\

bool NodeQuadCFInterp2::isDefined   const
 

Returns true if this object was created with the defining constructor or if define() has been called.


Member Data Documentation

LevelData<NodeFArrayBox> NodeQuadCFInterp2::m_coarseCopy [protected]
 

DisjointBoxLayout NodeQuadCFInterp2::m_coarsenedGrids [protected]
 

ProblemDomain NodeQuadCFInterp2::m_domain [protected]
 

Box NodeQuadCFInterp2::m_domainCoarseNodes [protected]
 

DisjointBoxLayout NodeQuadCFInterp2::m_grids [protected]
 

const LayoutData<NodeCFIVS>* NodeQuadCFInterp2::m_hiCFIVS [protected]
 

bool NodeQuadCFInterp2::m_interfaceOnly [protected]
 

int NodeQuadCFInterp2::m_interpolationDegree [protected]
 

bool NodeQuadCFInterp2::m_isDefined [protected]
 

const LayoutData<NodeCFIVS>* NodeQuadCFInterp2::m_loCFIVS [protected]
 

int NodeQuadCFInterp2::m_ncomp [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue Apr 15 18:34:55 2003 for AMRNodeElliptic by doxygen1.2.16