IBAMR  IBAMR version 0.19.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SAMRAI::solv::GhostCellRobinBcCoefs< DIM > Class Template Reference

A prefabricated Robin boundary condition coefficients for the case where cell-centered data is fixed at the first ghost-cell centers. More...

#include <GhostCellRobinBcCoefs.h>

Inheritance diagram for SAMRAI::solv::GhostCellRobinBcCoefs< DIM >:
Inheritance graph
[legend]

Public Member Functions

 GhostCellRobinBcCoefs (std::string object_name="")
 Constructor. More...
 
virtual ~GhostCellRobinBcCoefs ()
 Destructor. More...
 
void setBcCoefs (tbox::Pointer< pdat::ArrayData< DIM, double > > &acoef_data, tbox::Pointer< pdat::ArrayData< DIM, double > > &bcoef_data, tbox::Pointer< pdat::ArrayData< DIM, double > > &gcoef_data, const tbox::Pointer< hier::Variable< DIM > > &variable, const hier::Patch< DIM > &patch, const hier::BoundaryBox< DIM > &bdry_box, double fill_time=0.0) const
 Function to fill arrays of Robin boundary condition coefficients at a patch boundary. More...
 
hier::IntVector< DIM > numberOfExtensionsFillable () const
 
void setGhostDataId (int ghost_data_id, hier::IntVector< DIM > extensions_fillable=hier::IntVector< DIM >(0))
 Set the patch data index of the data providing ghost cell values. More...
 

Private Member Functions

hier::Box< DIM > makeSideBoundaryBox (const hier::BoundaryBox< DIM > &boundary_box) const
 Return box describing the index space of surfaces defined by a boundary box. More...
 

Private Attributes

std::string d_object_name
 Object name. More...
 
int d_ghost_data_id
 
hier::IntVector< DIM > d_extensions_fillable
 
tbox::Pointer< tbox::Timert_set_bc_coefs
 

Detailed Description

template<int DIM>
class SAMRAI::solv::GhostCellRobinBcCoefs< DIM >

This class is intended to make the use of the Robin boundary condition utterly trivial for users who who already have the correct values set in the ghost cells. The motivation for this seemingly needless task is to interpret the requirement that solution is fixed at ghost cell centers to solvers that do not operate directly on the ghost cell values. An example is linear solvers that operate on Ax=b and require that the boundary condition be written as changes to A and b.

This implementation of the strategy class RobinBcCoefStrategy<DIM> can be used when ghost cell values are known and have been written to the ghost cells of the data being set. You provide the patch data index to the cell-centered data, defined with a non-zero ghost cell width, where the ghost cell values can be found.

This implementation corresponds to a specific discretization of the Robin formula described in RobinBcCoefStrategy<DIM>. It assumes a linear variation of the data between the first interior and first ghost cells. It sets up the coefficients such that this linear extrapolation gives the correct value at the ghost cell center. This results in the coefficient a being 1.0/(1+0.5*h) and g being the a times the ghost cell value. h is the grid spacing normal to the boundary.

Constructor & Destructor Documentation

◆ GhostCellRobinBcCoefs()

template<int DIM>
SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::GhostCellRobinBcCoefs ( std::string  object_name = "")
Parameters
object_nameName of object for output purposes.

◆ ~GhostCellRobinBcCoefs()

template<int DIM>
virtual SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::~GhostCellRobinBcCoefs ( )
virtual

Member Function Documentation

◆ setBcCoefs()

template<int DIM>
void SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::setBcCoefs ( tbox::Pointer< pdat::ArrayData< DIM, double > > &  acoef_data,
tbox::Pointer< pdat::ArrayData< DIM, double > > &  bcoef_data,
tbox::Pointer< pdat::ArrayData< DIM, double > > &  gcoef_data,
const tbox::Pointer< hier::Variable< DIM > > &  variable,
const hier::Patch< DIM > &  patch,
const hier::BoundaryBox< DIM > &  bdry_box,
double  fill_time = 0.0 
) const
virtual

This implementation of the virtual function RobinBcCoefStrategy<DIM>::setBcCoefs() sets up the coefficients as described in the above notes.

Parameters
acoef_databoundary coefficient data. This is defined to include index range for the boundary faces on the boundary box bdry_box. If this is a null pointer, then the calling function is not interested in a, and you can disregard it.
bcoef_databoundary coefficient data. This is defined to include index range for the boundary faces on the boundary box bdry_box.
gcoef_databoundary coefficient data. This is defined to include index range for the boundary faces on the boundary box bdry_box.
variablevariable to set the coefficients for.
patchpatch requiring bc coefficients
bdry_boxboundary box showing where on the boundary the coefficient data is needed.
fill_timesolution time corresponding to filling, for use when coefficients are time-dependent.

Implements SAMRAI::solv::RobinBcCoefStrategy< DIM >.

◆ numberOfExtensionsFillable()

template<int DIM>
hier::IntVector<DIM> SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::numberOfExtensionsFillable ( ) const
virtual

◆ setGhostDataId()

template<int DIM>
void SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::setGhostDataId ( int  ghost_data_id,
hier::IntVector< DIM >  extensions_fillable = hier::IntVector< DIM >(0) 
)

The index must correspond to cell-centered double data with the given ghost width.

Parameters
ghost_data_idpatch data index of ghost data
extensions_fillablethe number of extensions past edge of a patch that has valid ghost cell values.

◆ makeSideBoundaryBox()

template<int DIM>
hier::Box<DIM> SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::makeSideBoundaryBox ( const hier::BoundaryBox< DIM > &  boundary_box) const
private

Define a box describing the indices of the surfaces corresponding to the input boundary box. A surface is a face in 3D and an edge in 2D. These surfaces lie on the boundary itself.

The input boundary_box must be of type 1 (see hier::BoundaryBox::getBoundaryType()).

This is a utility function for working with the surface indices coresponding to a boundary box.

Parameters
boundary_boxinput boundary box
Returns
a box to define the face indices corresponding to boundary_box

Member Data Documentation

◆ d_object_name

template<int DIM>
std::string SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::d_object_name
private

◆ d_ghost_data_id

template<int DIM>
int SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::d_ghost_data_id
private

◆ d_extensions_fillable

template<int DIM>
hier::IntVector<DIM> SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::d_extensions_fillable
private

◆ t_set_bc_coefs

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::solv::GhostCellRobinBcCoefs< DIM >::t_set_bc_coefs
private

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