IBAMR  IBAMR version 0.19.
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
SAMRAI::appu::CartesianBoundaryUtilities3 Struct Reference

Class CartesianBoundaryUtilities2 is a utility class that simplifies the implementation of simple physical boundary data in 3 spatial dimensions. It contains routines for reading boundary data information from input files, applying those boundary conditions, and error checking boundary data. These routines apply to the case of cell-centered double data only. One may use all of these capabilities, or use the input reading, boundary setting, and error checking routines independently. More...

#include <CartesianBoundaryUtilities3.h>

Static Public Member Functions

static void readBoundaryInput (BoundaryUtilityStrategy *bdry_strategy, tbox::Pointer< tbox::Database > bdry_db, tbox::Array< int > &face_conds, tbox::Array< int > &edge_conds, tbox::Array< int > &node_conds, const hier::IntVector< 3 > &periodic)
 
static void fillFaceBoundaryData (const std::string &varname, tbox::Pointer< pdat::CellData< 3, double > > &vardata, const hier::Patch< 3 > &patch, const hier::IntVector< 3 > &ghost_width_to_fill, const tbox::Array< int > &bdry_face_conds, const tbox::Array< double > &bdry_face_values)
 
static void fillEdgeBoundaryData (const std::string &varname, tbox::Pointer< pdat::CellData< 3, double > > &vardata, const hier::Patch< 3 > &patch, const hier::IntVector< 3 > &ghost_width_to_fill, const tbox::Array< int > &bdry_edge_conds, const tbox::Array< double > &bdry_face_values)
 
static void fillNodeBoundaryData (const std::string &varname, tbox::Pointer< pdat::CellData< 3, double > > &vardata, const hier::Patch< 3 > &patch, const hier::IntVector< 3 > &ghost_width_to_fill, const tbox::Array< int > &bdry_node_conds, const tbox::Array< double > &bdry_face_values)
 
static int getFaceLocationForEdgeBdry (int edge_loc, int edge_btype)
 
static int getFaceLocationForNodeBdry (int node_loc, int node_btype)
 
static int checkBdryData (const std::string &varname, const hier::Patch< 3 > &patch, int data_id, int depth, const hier::IntVector< 3 > &gcw_to_check, const hier::BoundaryBox< 3 > &bbox, int bcase, double bstate)
 

Static Private Member Functions

static void read3dBdryFaces (BoundaryUtilityStrategy *bdry_strategy, tbox::Pointer< tbox::Database > bdry_db, tbox::Array< int > &face_conds, const hier::IntVector< 3 > &periodic)
 
static void read3dBdryEdges (tbox::Pointer< tbox::Database > bdry_db, const tbox::Array< int > &face_conds, tbox::Array< int > &edge_conds, const hier::IntVector< 3 > &periodic)
 
static void read3dBdryNodes (tbox::Pointer< tbox::Database > bdry_db, const tbox::Array< int > &face_conds, tbox::Array< int > &node_conds, const hier::IntVector< 3 > &periodic)
 
static void get3dBdryDirectionCheckValues (int &idir, int &offsign, int btype, int bloc, int bcase)
 
static void stuff3dBdryFortConst ()
 

Static Private Attributes

static bool s_fortran_constants_stuffed
 

Detailed Description

To use the boundary condition input reading capabilities, the format of the input file section containing the boundary information must be as described next. Boundary face, node, and edge entries are only required for those that are not filled automatically when periodic conditions apply.

The boundary condition for face "*" is provided in a section as follows:

* 
*    boundary_face_* {   
*       boundary_condition  = ...  // boundary condition string identifier
*       // Any problem-specific boundary data read by user routines 
*       // is placed here...
*    }
*
* Allowable face identifiers (i.e., values for "*") are:
*       xlo, xhi, ylo, yhi, zlo, zhi
* Supported face boundary_condition string values are: 
*       "FLOW", "REFLECT", "DIRICHLET", "NEUMANN" 
*
* 

The boundary condition for edge "*" is provided in a section as follows:

*
*    boundary_edge_* {   
*       boundary_condition  = ...  // boundary condition string identifier
*    }
* 
* Allowable edge identifiers (i.e., values for "*") are:
*       ylo_zlo, yhi_zlo, ylo_zhi, yhi_zhi,
*       xlo_zlo, xlo_zhi, xhi_zlo, xhi_zhi,
*       xlo_ylo, xhi_ylo, xlo_yhi, xhi_yhi
* Supported edge boundary_condition string values are:  
*       "XFLOW", "YFLOW", "ZFLOW",
*       "XREFLECT", "YREFLECT", "ZREFLECT",
*       "XDIRICHLET", "YDIRICHLET", "ZDIRICHLET"
*       "XNEUMANN", "YNEUMANN", "ZNEUMANN"
*
* 

Note that edge conditions must be consistent with adjacent face conditions.

The boundary condition for node "*" is provided in a section as follows:

*
*    boundary_node_* {
*       boundary_condition  = ...  // boundary condition string identifier
*    }
*
* Allowable node identifiers (i.e., values for "*") are:
*       ylo_zlo, yhi_zlo, ylo_zhi, yhi_zhi,
*       xlo_zlo, xlo_zhi, xhi_zlo, xhi_zhi,
*       xlo_ylo, xhi_ylo, xlo_yhi, xhi_yhi
* Supported node boundary_condition values are:   
*       "XFLOW", "YFLOW", "ZFLOW",
*       "XREFLECT", "YREFLECT", "ZREFLECT",
*       "XDIRICHLET", "YDIRICHLET", "ZDIRICHLET"
*       "XNEUMANN", "YNEUMANN", "ZNEUMANN"
*
* 

Note that node conditions must be consistent with adjacent face conditions.

See the include file CartesianBoundaryDefines.h for integer constant definitions that apply for the various boundary types, locations, and boundary conditions. If you choose to use the input reading capabilities only and write your own boundary condition routines in FORTRAN, you should note that the integer constants for the various boundary condition types and locations are automatically "stuffed" into FORTRAN common blocks. This avoids potential problems with inconsistencies between C++ and FORTRAN usage. Please see the FORTRAN include file cartbdryparams3d.i for details.

See also
appu::BoundaryUtilityStrategy3

Member Function Documentation

◆ readBoundaryInput()

static void SAMRAI::appu::CartesianBoundaryUtilities3::readBoundaryInput ( BoundaryUtilityStrategy bdry_strategy,
tbox::Pointer< tbox::Database bdry_db,
tbox::Array< int > &  face_conds,
tbox::Array< int > &  edge_conds,
tbox::Array< int > &  node_conds,
const hier::IntVector< 3 > &  periodic 
)
static

Function to read 3d boundary data from input database. The integer boundary condition types are placed in the integer arrays supplied by the caller (typically, the concrete BoundaryUtilityStrategy object provided). When DIRICHLET or NEUMANN conditions are specified, control is passed to the BoundaryUtilityStrategy to read the boundary state data specific to the problem.

Errors will be reported and the program will abort whenever necessary boundary condition information is missing in the input database, or when the data read in is either unknown or inconsistent. The periodic domain information is used to determine which boundary face, edge, or node entries are not required from input. Error checking requires that node and edge boundary conditions are consistent with those specified for the faces.

When assertion checking is active, assertions will result when any of the pointer arguments is null, or an array is passed in with the the wrong size.

Parameters
bdry_strategyuser-defined object that reads DIRICHLET or NEUMANN conditions
bdry_dbinput database containing all boundary data
face_condsarray into which integer face boundary condition types are read
edge_condsarray into which integer edge boundary condition types are read
node_condsarray into which integer node boundary condition types are read
periodicinteger vector specifying which coordinate directions are periodic (e.g., value returned from GridGeometry2::getPeriodicShift())

◆ fillFaceBoundaryData()

static void SAMRAI::appu::CartesianBoundaryUtilities3::fillFaceBoundaryData ( const std::string &  varname,
tbox::Pointer< pdat::CellData< 3, double > > &  vardata,
const hier::Patch< 3 > &  patch,
const hier::IntVector< 3 > &  ghost_width_to_fill,
const tbox::Array< int > &  bdry_face_conds,
const tbox::Array< double > &  bdry_face_values 
)
static

Function to fill 3d face boundary values for a patch.

When assertion checking is active, assertions will result when any of the pointer arguments is null, or an array is passed in with the the wrong size.

Parameters
varnameString name of variable (for error reporting).
vardataCell-centered patch data object to fill.
patchhier::Patch on which data object lives.
ghost_width_to_fillWidth of ghost region to fill.
bdry_face_condstbox::Array of boundary condition types for patch faces.
bdry_face_valuestbox::Array of boundary values for patch faces.

◆ fillEdgeBoundaryData()

static void SAMRAI::appu::CartesianBoundaryUtilities3::fillEdgeBoundaryData ( const std::string &  varname,
tbox::Pointer< pdat::CellData< 3, double > > &  vardata,
const hier::Patch< 3 > &  patch,
const hier::IntVector< 3 > &  ghost_width_to_fill,
const tbox::Array< int > &  bdry_edge_conds,
const tbox::Array< double > &  bdry_face_values 
)
static

Function to fill 3d edge boundary values for a patch.

When assertion checking is active, assertions will result when any of the pointer arguments is null, or an array is passed in with the the wrong size.

Parameters
varnameString name of variable (for error reporting).
vardataCell-centered patch data object to fill.
patchhier::Patch on which data object lives.
ghost_width_to_fillWidth of ghost region to fill.
bdry_edge_condstbox::Array of boundary condition types for patch edges.
bdry_face_valuestbox::Array of boundary values for patch faces.

◆ fillNodeBoundaryData()

static void SAMRAI::appu::CartesianBoundaryUtilities3::fillNodeBoundaryData ( const std::string &  varname,
tbox::Pointer< pdat::CellData< 3, double > > &  vardata,
const hier::Patch< 3 > &  patch,
const hier::IntVector< 3 > &  ghost_width_to_fill,
const tbox::Array< int > &  bdry_node_conds,
const tbox::Array< double > &  bdry_face_values 
)
static

Function to fill 3d node boundary values for a patch.

When assertion checking is active, assertions will result when any of the pointer arguments is null, or an array is passed in with the the wrong size.

Parameters
varnameString name of variable (for error reporting).
vardataCell-centered patch data object to fill.
patchhier::Patch on which data object lives.
ghost_width_to_fillWidth of ghost region to fill.
bdry_node_condstbox::Array of boundary condition types for patch nodes.
bdry_face_valuestbox::Array of boundary values for patch faces.

◆ getFaceLocationForEdgeBdry()

static int SAMRAI::appu::CartesianBoundaryUtilities3::getFaceLocationForEdgeBdry ( int  edge_loc,
int  edge_btype 
)
static

Function that returns the integer face boundary location corresponding to the given edge location and edge boundary condition.

If the edge boundary condition type or edge location are unknown, or the boundary condition type is inconsistant with the edge location an error results.

Returns
Integer face location for edge location and boundary condition type.
Parameters
edge_locInteger location for edge.
edge_btypeInteger boundary condition type for edge.

◆ getFaceLocationForNodeBdry()

static int SAMRAI::appu::CartesianBoundaryUtilities3::getFaceLocationForNodeBdry ( int  node_loc,
int  node_btype 
)
static

Function that returns the integer face boundary location corresponding to the given node location and node boundary condition.

If the node boundary condition type or node location are unknown, or the boundary condition type is inconsistant with the node location an error results.

Returns
Integer face location for node location and boundary condition type.
Parameters
node_locInteger location for node.
node_btypeInteger boundary condition type for node.

◆ checkBdryData()

static int SAMRAI::appu::CartesianBoundaryUtilities3::checkBdryData ( const std::string &  varname,
const hier::Patch< 3 > &  patch,
int  data_id,
int  depth,
const hier::IntVector< 3 > &  gcw_to_check,
const hier::BoundaryBox< 3 > &  bbox,
int  bcase,
double  bstate 
)
static

Function to check 3d boundary data for a patch data quantity on a patch after it is set. A warning message will be sent to log file for each bad boundary value that is found.

When assertion checking is active, assertions will result when any of the pointer arguments is null, or an array is passed in with the the wrong size.

Returns
Integer number of bad boundary values found.
Parameters
varnameString name of variable (for error reporting).
patchhier::Patch on which data object lives.
data_idhier::Patch data index for data on patch.
depthDepth index of patch data to check.
gcw_to_checkWidth of ghost region to check.
bboxBoundary box to check.
bcaseBoundary condition type for given edge or node.
bstateBoundary value that applies in DIRICHLET or NEUMANN case.

◆ read3dBdryFaces()

static void SAMRAI::appu::CartesianBoundaryUtilities3::read3dBdryFaces ( BoundaryUtilityStrategy bdry_strategy,
tbox::Pointer< tbox::Database bdry_db,
tbox::Array< int > &  face_conds,
const hier::IntVector< 3 > &  periodic 
)
staticprivate

◆ read3dBdryEdges()

static void SAMRAI::appu::CartesianBoundaryUtilities3::read3dBdryEdges ( tbox::Pointer< tbox::Database bdry_db,
const tbox::Array< int > &  face_conds,
tbox::Array< int > &  edge_conds,
const hier::IntVector< 3 > &  periodic 
)
staticprivate

◆ read3dBdryNodes()

static void SAMRAI::appu::CartesianBoundaryUtilities3::read3dBdryNodes ( tbox::Pointer< tbox::Database bdry_db,
const tbox::Array< int > &  face_conds,
tbox::Array< int > &  node_conds,
const hier::IntVector< 3 > &  periodic 
)
staticprivate

◆ get3dBdryDirectionCheckValues()

static void SAMRAI::appu::CartesianBoundaryUtilities3::get3dBdryDirectionCheckValues ( int idir,
int offsign,
int  btype,
int  bloc,
int  bcase 
)
staticprivate

◆ stuff3dBdryFortConst()

static void SAMRAI::appu::CartesianBoundaryUtilities3::stuff3dBdryFortConst ( )
staticprivate

Member Data Documentation

◆ s_fortran_constants_stuffed

bool SAMRAI::appu::CartesianBoundaryUtilities3::s_fortran_constants_stuffed
staticprivate

The documentation for this struct was generated from the following file: