SAMRAI::solv::SimpleCellRobinBcCoefs< DIM > Class Template Reference

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

#include <source/solvers/poisson/SimpleCellRobinBcCoefs.h>

Inheritance diagram for SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 SimpleCellRobinBcCoefs (const std::string &object_name=std::string())
 Constructor.
virtual ~SimpleCellRobinBcCoefs (void)
 Destructor.
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.
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.
void cacheDirichletData (int dirichlet_data_id)
 Cache data providing Dirichlet boundary values.
void restoreDirichletData (int dirichlet_data_id)
 Copy cached Dirichlet data into ghost cells.
void setDiffusionCoefId (int diffusion_coef_id)
 Set the patch data index of the diffusion coefficient used in Neumann boundary fluxes.
void setDiffusionCoefConstant (double diffusion_coef_value)
 Set the value of the diffusion coefficient used in Neumann boundary fluxes to a constant.
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.
hier::IntVector< DIM > numberOfExtensionsFillable () const

Detailed Description

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

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

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

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

Constructor.

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

Destructor.


Member Function Documentation

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]

Function to fill arrays of Robin boundary condition coefficients at a patch boundary.

This implementation of the virtual function RobinBcCoefStrategy<DIM>::setBcCoefs() uses information specified by the call to setBoundaries() to determine the coefficients.

Parameters:
acoef_data boundary 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_data boundary coefficient data. This is defined to include index range for the boundary faces on the boundary box bdry_box.
gcoef_data boundary coefficient data. This is defined to include index range for the boundary faces on the boundary box bdry_box.
variable variable to set the coefficients for.
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.

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

template<int DIM>
hier::IntVector< DIM > SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::numberOfExtensionsFillable (  )  const [virtual]

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

template<int DIM>
void SAMRAI::solv::SimpleCellRobinBcCoefs< DIM >::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.

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.

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 
)

Specify the boundary conditions that are to be used at the physical domain boundary.

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.

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

Cache data providing Dirichlet boundary values.

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_id patch data id of the source cell data for copy.

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

Copy cached Dirichlet data into ghost cells.

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

The cached data is not dallocated.

Parameters:
dirichlet_data_id patch data id of the destination cell data for copy.

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

Set the patch data index of the diffusion coefficient used in Neumann boundary fluxes.

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().

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

Set the value of the diffusion coefficient used in Neumann boundary fluxes to a constant.

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

This function overrides the effect of setDiffusionCoefId().


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:57 2009 for SAMRAI by  doxygen 1.5.1