|
IBAMR
IBAMR version 0.19.
|
Class muParserRobinBcCoefs is an implementation of the strategy class SAMRAI::solv::RobinBcCoefStrategy that allows for the run-time specification of (possibly spatially- and temporally-varying) Robin boundary conditions. More...
#include <ibtk/muParserRobinBcCoefs.h>

Public Member Functions | |
| muParserRobinBcCoefs (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > grid_geom) | |
| Constructor. More... | |
Implementation of SAMRAI::solv::RobinBcCoefStrategy interface. | |
| double | d_parser_time = 0.0 |
| Point | d_parser_posn |
| SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > | d_grid_geom |
| std::map< std::string, double > | d_constants |
| std::vector< std::string > | d_acoef_function_strings |
| std::vector< std::string > | d_bcoef_function_strings |
| std::vector< std::string > | d_gcoef_function_strings |
| std::array< mu::Parser, 2 *NDIM > | d_acoef_parsers |
| std::array< mu::Parser, 2 *NDIM > | d_bcoef_parsers |
| std::array< mu::Parser, 2 *NDIM > | d_gcoef_parsers |
| void | setBcCoefs (SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &acoef_data, SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &bcoef_data, SAMRAI::tbox::Pointer< SAMRAI::pdat::ArrayData< NDIM, double > > &gcoef_data, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > &variable, const SAMRAI::hier::Patch< NDIM > &patch, const SAMRAI::hier::BoundaryBox< NDIM > &bdry_box, double fill_time=0.0) const override |
| Function to fill arrays of Robin boundary condition coefficients at a patch boundary. More... | |
| SAMRAI::hier::IntVector< NDIM > | numberOfExtensionsFillable () const override |
| muParserRobinBcCoefs ()=delete | |
| Default constructor. More... | |
| muParserRobinBcCoefs (const muParserRobinBcCoefs &from)=delete | |
| Copy constructor. More... | |
| muParserRobinBcCoefs & | operator= (const muParserRobinBcCoefs &that)=delete |
| Assignment operator. More... | |
This class uses the muParser library to parse strings into mathematical functions. This class is the most common method to specify boundary conditions uses in the examples. The database in the input file contains strings for each coefficient ( \(a\), \(b\), and \(g\)) at each face of the physical boundary. Strings ending in 0 and 1 are for the \(x\)-faces, 2 and 3 are for the \(y\)-faces, and 4 and 5 are for the \(z\)-faces. These strings can contain spatial and temporal variables using the variable names X_0, X_1, X_2, and t. These strings can also contain if statements using the conditional operator condition ? result_if_true : result_if_false. For more exotic boundary conditions, one would need to create an extension of the class RobinBcCoefStrategy.
| IBTK::muParserRobinBcCoefs::muParserRobinBcCoefs | ( | const std::string & | object_name, |
| SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > | input_db, | ||
| SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > | grid_geom | ||
| ) |
|
privatedelete |
|
privatedelete |
| from | The value to copy to this object. |
|
override |
| acoef_data | Boundary coefficient data. The array will have been defined to include index range for corresponding to the boundary box bdry_box and appropriate for the alignment of the given variable. If this is a null pointer, then the calling function is not interested in a, and you can disregard it. |
| bcoef_data | Boundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the b coefficient. |
| gcoef_data | Boundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the g coefficient. |
| variable | Variable to set the coefficients for. If implemented for multiple variables, this parameter can be used to determine which variable's coefficients are being sought. |
| patch | Patch requiring bc coefficients. |
| bdry_box | Boundary box showing where on the boundary the coefficient data is needed. |
| fill_time | Solution time corresponding to filling, for use when coefficients are time-dependent. |
|
override |
|
privatedelete |
| that | The value to assign to this object. |
|
pure virtualinherited |
This class specifies the Robin boundary condition coefficients at discrete locations on the patch boundary. Though these locations are defined by boundary box object, they do not necessarily coincide with the centers of the cells referred to by those boxes. These locations typically coincide with the nodes or face centers which do lie on the patch boundary. Accordingly, you use this function to provide the boundary coefficients at those locations by filling an array at indices corresponding to those locations.
When setting the values of the boundary condition coefficients it is useful to note that for any cell (i,j,k), the indices of the sides, edges and nodes are easily determined. The index on the lower side of the cell is the same as the index of the cell, whereas the index on the upper side of the cell has the next higher value. In 2D, the cell and its surrounding nodes and faces has the following indices:
* * (i,j+1)----(i,j+1)---(i+1,j+1) * | | * | | * | | * | | * (i,j) (i,j) (i+1,j) * | | * | | * | | * | | * (i,j)------(i,j)-----(i+1,j) * *
Once this is understood, translation between the index in the boundary box index space to the index of things on the boundary is simple.
The boundary condition coefficients should be placed in the pdat::ArrayData<DIM> objects, acoef_data and gcoef_data (see argument list), which are dimensioned to contain the indices of the points alligned with variable and lying on the the boundary defined by bdry_box.
This function is only used with type-1 boundary boxes, such as faces in 3D. Other types of boundaries do not have a well-defined surface normal.
The parameter variable is passed through to tell the implementation of this function what variable to set the coefficients for. You may wish to ignore it if your implementation is intended for a specific variable.
| acoef_data | boundary coefficient data. The array will have been defined to include index range for corresponding to the boundary box bdry_box and appropriate for the alignment of the given variable. If this is a null pointer, then the calling function is not interested in a, and you can disregard it. |
| bcoef_data | boundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the b coefficient. |
| gcoef_data | boundary coefficient data. This array is exactly like acoef_data, except that it is to be filled with the g coefficient. |
| variable | variable to set the coefficients for. If implemented for multiple variables, this parameter can be used to determine which variable's coefficients are being sought. |
| patch | patch requiring bc coefficients |
| bdry_box | boundary box showing where on the boundary the coefficient data is needed. |
| fill_time | solution time corresponding to filling, for use when coefficients are time-dependent. |
|
pure virtualinherited |
|
mutableprivate |
Current time value used by the mu::Parser instances.
This value is mutable since the mu::Parser objects each store a pointer to it but its specific value (the present time) changes during each call to muParserRobinBcCoefs::setBcCoefs. The alternative would be to rebuild the mu::Parser objects during each call to muParserRobinBcCoefs::setBcCoefs, which is much more expensive. Since this variable is only written to and subsequently read from in that function this is reasonable.
|
mutableprivate |
Current space point used by the mu::Parser instances.
This value is mutable for the same reasons that muParserRobinBcCoefs::d_parser_time is mutable.
|
private |
The Cartesian grid geometry object provides the extents of the computational domain.
|
private |
User-provided constants specified in the input file.
|
private |
The strings providing the data-setting functions which are evaluated by the mu::Parser objects.
|
private |
|
private |
|
private |
The mu::Parser objects which evaluate the data-setting functions.
|
private |
|
private |
1.8.17