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

A prefabricated Robin boundary condition coefficients with an interface like the old Poisson solvers. More...

#include <SimpleCellRobinBcCoefs.h>

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

Public Member Functions

 SimpleCellRobinBcCoefs (const std::string &object_name=std::string())
 Constructor. More...
 
virtual ~SimpleCellRobinBcCoefs ()
 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 setHierarchy (tbox::Pointer< hier::PatchHierarchy< DIM > >, const int ln_min=-1, const int ln_max=-1)
 Set the hierarchy where boundary data associated with the hierarchy is found. More...
 
void setBoundaries (const std::string &boundary_type, const int fluxes=-1, const int flags=-1, int *bdry_types=NULL)
 Specify the boundary conditions that are to be used at the physical domain boundary. More...
 
void cacheDirichletData (int dirichlet_data_id)
 Cache data providing Dirichlet boundary values. More...
 
void restoreDirichletData (int dirichlet_data_id)
 Copy cached Dirichlet data into ghost cells. More...
 
void setDiffusionCoefId (int diffusion_coef_id)
 Set the patch data index of the diffusion coefficient used in Neumann boundary fluxes. More...
 
void setDiffusionCoefConstant (double diffusion_coef_value)
 Set the value of the diffusion coefficient used in Neumann boundary fluxes to a constant. 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...
 
tbox::Pointer< hier::PatchHierarchy< DIM > > d_hierarchy
 
int d_ln_min
 
int d_ln_max
 
int d_bdry_types [2 *DIM]
 array of boundary type on each side More...
 
int d_flux_id
 patch index for fluxes More...
 
int d_flag_id
 patch index for flags More...
 
int d_dirichlet_data_id
 patch index for Dirichlet values. More...
 
int d_diffusion_coef_id
 patch index for diffusion coefficients if it is variable. More...
 
double d_diffusion_coef_constant
 value of for diffusion coefficients if it is constant. More...
 
tbox::Array< tbox::Pointer< pdat::ArrayData< DIM, double > > > d_dirichlet_data
 Cached ghost cell value used in Dirichlet bc. More...
 
tbox::Array< tbox::Array< int > > d_dirichlet_data_pos
 Position of cached boundary boxes of ghost cell data. More...
 
tbox::Pointer< tbox::Timert_set_bc_coefs
 Timers for performance measurement. More...
 

Detailed Description

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

This class is intended to make it easy for users of the old Poisson solver to adapt to the new solver by providing an interface similar to that of the old solver. Underneath, the boundary condition is converted to Robin bc coefficients used by the new solver.

This class refers to some grid-based outerside or ghost cell data touching patch outer sides when providing the Robin bc coefficients. In the most general case, it is unable to provide coefficients for patches outside the grid on which that data is provided. It is also unable to provide coefficients for boundary boxes that extend past the edge or corner of a patch. This may limit this class from being used when certain features of the Poisson solver is enabled.

Constructor & Destructor Documentation

◆ SimpleCellRobinBcCoefs()

template<int DIM>
SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::SimpleCellRobinBcCoefs ( const std::string &  object_name = std::string())

◆ ~SimpleCellRobinBcCoefs()

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

Member Function Documentation

◆ setBcCoefs()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< 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() uses information specified by the call to setBoundaries() to determine the coefficients.

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::SimpleCellRobinBcCoefs< DIM >::numberOfExtensionsFillable ( ) const
virtual

◆ setHierarchy()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::setHierarchy ( tbox::Pointer< hier::PatchHierarchy< DIM > >  ,
const int  ln_min = -1,
const int  ln_max = -1 
)

This class requires you to specify some grid data associated with a hierarchy, such as the Dirichlet boundary values, the flux or the Dirichlet/Neumann flag. That hierarchy and the range of relevant patch levels is specified by calling this function.

◆ setBoundaries()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::setBoundaries ( const std::string &  boundary_type,
const int  fluxes = -1,
const int  flags = -1,
int bdry_types = NULL 
)

The boundary conditions specified as the string argument "boundary_type." The boundary type argument can be "Dirichlet", "Neumann", or "Mixed".

If using Dirichlet boundary conditions, then before the solver is called, the storage for the unknown u must have a layer of ghost cells at least one cell wide that includes the Dirichlet boundary values.

If using Neumann boundary conditions, then before the solver is called, the outerface boundary flux data must be set for the Neumann conditions. The fluxes argument gives the patch data index of this flux data.

The mixed boundary type is for a mixture of Dirichlet and Neumann boundary conditions are used at the physical domain boundary. The fluxes argument gives the patch data index of the outerface data that specifies the flux data for the Neumann conditions. The flags array is an outerface data array of integer flags that specifies whether Dirichlet (flag == zero) or Neumann (flag == one) conditions are to be used at a particular cell boundary face. Note that the flag data must be set before the matrix entries can be computed and the flux data must be set before the solver is called. The bdry_types argument can be used if the boundary conditions are mixed but one or more of the faces of the physical boundary are entirely either Dirichlet or Neumann boundaries. The bdry_types argument should be an array of 2*DIM integers, specifying the boundary conditions on each side of the physical domain. It should be ordered {x_lo, x_hi, y_lo, y_hi, z_lo, z_hi}, with the values for each face being 0 for Dirichlet conditions, 1 for Neumann conditions, and 2 for mixed boundary conditions. The bdry_type argument is never required, but if used it can sometimes make the PoissonHYPRESolver class more efficient.

◆ cacheDirichletData()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::cacheDirichletData ( int  dirichlet_data_id)

This function makes a private copy of the relevant ghost cell data that it later uses provide the coefficient g on Dirichlet boundaries. The index must correspond to cell-centered double data with non-zero ghost width.

Functions setHierarchy() and setBoundaries() should be called before this one. This function should be called each time the hierarchy or Dirichlet data changes.

Parameters
dirichlet_data_idpatch data id of the source cell data for copy.

◆ restoreDirichletData()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::restoreDirichletData ( int  dirichlet_data_id)

Reverse action of cacheDirichletData by copying cached data back into the ghost cells.

The cached data is not dallocated.

Parameters
dirichlet_data_idpatch data id of the destination cell data for copy.

◆ setDiffusionCoefId()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::setDiffusionCoefId ( int  diffusion_coef_id)

The diffusion coefficient, along with the prescribed flux, is used to set the gradient of the solution normal to the boundary. By default, the diffusion coefficient is assumed to be 1. If used, the diffusion coefficient data id must be set before asking for the coefficient g, which depends on it. The index must correspond to side-centered double data.

This function overrides the effect of setDiffusionCoefConstant().

◆ setDiffusionCoefConstant()

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::setDiffusionCoefConstant ( double  diffusion_coef_value)

This function is similar to setDiffusionCoefId() but is used when the diffusion coefficient is a constant.

This function overrides the effect of setDiffusionCoefId().

◆ makeSideBoundaryBox()

template<int DIM>
hier::Box<DIM> SAMRAI::solv::SimpleCellRobinBcCoefs< 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::SimpleCellRobinBcCoefs< DIM >::d_object_name
private

◆ d_hierarchy

template<int DIM>
tbox::Pointer< hier::PatchHierarchy<DIM> > SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_hierarchy
private

◆ d_ln_min

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_ln_min
private

◆ d_ln_max

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_ln_max
private

◆ d_bdry_types

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_bdry_types[2 *DIM]
private

◆ d_flux_id

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_flux_id
private

◆ d_flag_id

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_flag_id
private

◆ d_dirichlet_data_id

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_dirichlet_data_id
private

◆ d_diffusion_coef_id

template<int DIM>
int SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_diffusion_coef_id
private

◆ d_diffusion_coef_constant

template<int DIM>
double SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_diffusion_coef_constant
private

◆ d_dirichlet_data

template<int DIM>
tbox::Array<tbox::Pointer<pdat::ArrayData<DIM,double> > > SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_dirichlet_data
private

Cached boundary box ghost cell data are stored in this 1D array. For the position of a particular box, see d_dirichlet_data_position.

◆ d_dirichlet_data_pos

template<int DIM>
tbox::Array<tbox::Array<int> > SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::d_dirichlet_data_pos
private

The position of the cached boundary box bn of patch pn of level ln is d_dirichlet_data_pos[ln][pn]+bn.

◆ t_set_bc_coefs

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

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