#include <source/apputils/boundary/CartesianBoundaryUtilities2.h>
Static Public Member Functions | |
static void | readBoundaryInput (BoundaryUtilityStrategy *bdry_strategy, tbox::Pointer< tbox::Database > bdry_db, tbox::Array< int > &edge_conds, tbox::Array< int > &node_conds, const hier::IntVector< 2 > &periodic) |
static void | fillEdgeBoundaryData (const std::string &varname, tbox::Pointer< pdat::CellData< 2, double > > &vardata, const hier::Patch< 2 > &patch, const hier::IntVector< 2 > &ghost_width_to_fill, const tbox::Array< int > &bdry_edge_conds, const tbox::Array< double > &bdry_edge_values) |
static void | fillNodeBoundaryData (const std::string &varname, tbox::Pointer< pdat::CellData< 2, double > > &vardata, const hier::Patch< 2 > &patch, const hier::IntVector< 2 > &ghost_width_to_fill, const tbox::Array< int > &bdry_node_conds, const tbox::Array< double > &bdry_edge_values) |
static int | getEdgeLocationForNodeBdry (int node_loc, int node_btype) |
static int | checkBdryData (const std::string &varname, const hier::Patch< 2 > &patch, int data_id, int depth, const hier::IntVector< 2 > &gcw_to_check, const hier::BoundaryBox< 2 > &bbox, int bcase, double bstate) |
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 node and edge entries are only required for those that are not filled automatically when periodic conditions apply.
The boundary condition for edge "*" is provided in a section as follows:
* * boundary_edge_* { * boundary_condition = ... // boundary condition string identifier * // Any problem-specific boundary data read by user routines * // is placed here... * } * * Allowable edge identifiers (i.e., values for "*") are: * xlo, xhi, ylo, yhi * Supported edge boundary_condition strin values are: * "FLOW", "REFLECT", "DIRICHLET", "NEUMANN" * *
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: * xlo_ylo, xhi_ylo, xlo_yhi, xhi_yhi * Supported node boundary_condition string values are: * "XFLOW", "YFLOW", * "XREFLECT", "YREFLECT", * "XDIRICHLET", "YDIRICHLET", * "XNEUMANN", "YNEUMANN" * *
Note that node conditions must be consistent with adjacent edge 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 cartbdryparams2d.i for details.
void SAMRAI::appu::CartesianBoundaryUtilities2::readBoundaryInput | ( | BoundaryUtilityStrategy * | bdry_strategy, | |
tbox::Pointer< tbox::Database > | bdry_db, | |||
tbox::Array< int > & | edge_conds, | |||
tbox::Array< int > & | node_conds, | |||
const hier::IntVector< 2 > & | periodic | |||
) | [static] |
Function to read 2d 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 edge or node entries are not required from input. Error checking requires that node boundary conditions are consistent with those specified for the edges.
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.
bdry_strategy | user-defined object that reads DIRICHLET or NEUMANN conditions | |
bdry_db | input database containing all boundary data | |
edge_conds | array into which integer edge boundary condition types are read | |
node_conds | array into which integer node boundary condition types are read | |
periodic | integer vector specifying which coordinate directions are periodic (e.g., value returned from GridGeometry2::getPeriodicShift()) |
void SAMRAI::appu::CartesianBoundaryUtilities2::fillEdgeBoundaryData | ( | const std::string & | varname, | |
tbox::Pointer< pdat::CellData< 2, double > > & | vardata, | |||
const hier::Patch< 2 > & | patch, | |||
const hier::IntVector< 2 > & | ghost_width_to_fill, | |||
const tbox::Array< int > & | bdry_edge_conds, | |||
const tbox::Array< double > & | bdry_edge_values | |||
) | [static] |
Function to fill 2d 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.
varname | String name of variable (for error reporting). | |
vardata | Cell-centered patch data object to fill. | |
patch | hier::Patch on which data object lives. | |
ghost_width_to_fill | Width of ghost region to fill. | |
bdry_edge_conds | tbox::Array of boundary condition types for patch edges. | |
bdry_edge_values | tbox::Array of boundary values for patch edges. |
void SAMRAI::appu::CartesianBoundaryUtilities2::fillNodeBoundaryData | ( | const std::string & | varname, | |
tbox::Pointer< pdat::CellData< 2, double > > & | vardata, | |||
const hier::Patch< 2 > & | patch, | |||
const hier::IntVector< 2 > & | ghost_width_to_fill, | |||
const tbox::Array< int > & | bdry_node_conds, | |||
const tbox::Array< double > & | bdry_edge_values | |||
) | [static] |
Function to fill 2d 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.
varname | String name of variable (for error reporting). | |
vardata | Cell-centered patch data object to fill. | |
patch | hier::Patch on which data object lives. | |
ghost_width_to_fill | Width of ghost region to fill. | |
bdry_node_conds | tbox::Array of boundary condition types for patch nodes. | |
bdry_edge_values | tbox::Array of boundary values for patch edges. |
int SAMRAI::appu::CartesianBoundaryUtilities2::getEdgeLocationForNodeBdry | ( | int | node_loc, | |
int | node_btype | |||
) | [static] |
Function that returns the integer edge 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.
node_loc | Integer location for node. | |
node_btype | Integer boundary condition type for node. |
int SAMRAI::appu::CartesianBoundaryUtilities2::checkBdryData | ( | const std::string & | varname, | |
const hier::Patch< 2 > & | patch, | |||
int | data_id, | |||
int | depth, | |||
const hier::IntVector< 2 > & | gcw_to_check, | |||
const hier::BoundaryBox< 2 > & | bbox, | |||
int | bcase, | |||
double | bstate | |||
) | [static] |
Function to check 2d 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.
varname | String name of variable (for error reporting). | |
patch | hier::Patch on which data object lives. | |
data_id | hier::Patch data index for data on patch. | |
depth | Depth index of patch data to check. | |
gcw_to_check | Width of ghost region to check. | |
bbox | Boundary box to check. | |
bcase | Boundary condition type for given edge or node. | |
bstate | Boundary value that applies in DIRICHLET or NEUMANN case. |