IBAMR  IBAMR version 0.19.
List of all members
IBTK::PETScMatUtilities Class Reference

Class PETScMatUtilities provides utility functions for PETSc Mat objects.

#include <ibtk/PETScMatUtilities.h>

Methods acting on SAMRAI::hier::PatchLevel and

SAMRAI::hier::Variable objects.

static const int ib_4_interp_stencil = 4
 
static const int pwl_interp_stencil = 2
 
static void constructPatchLevelCCLaplaceOp (Mat &mat, const SAMRAI::solv::PoissonSpecifications &poisson_spec, SAMRAI::solv::RobinBcCoefStrategy< NDIM > *bc_coef, double data_time, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level)
 Construct a parallel PETSc Mat object corresponding to the cell-centered Laplacian of a cell-centered variable restricted to a single SAMRAI::hier::PatchLevel. More...
 
static void constructPatchLevelCCLaplaceOp (Mat &mat, const SAMRAI::solv::PoissonSpecifications &poisson_spec, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &bc_coefs, double data_time, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level)
 Construct a parallel PETSc Mat object corresponding to the cell-centered Laplacian of a cell-centered variable restricted to a single SAMRAI::hier::PatchLevel. More...
 
static void constructPatchLevelSCLaplaceOp (Mat &mat, const SAMRAI::solv::PoissonSpecifications &poisson_spec, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &bc_coefs, double data_time, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level)
 Construct a parallel PETSc Mat object corresponding to the side-centered Laplacian of a side-centered variable restricted to a single SAMRAI::hier::PatchLevel. More...
 
static void constructPatchLevelVCSCViscousOp (Mat &mat, const SAMRAI::solv::PoissonSpecifications &poisson_spec, double alpha, double beta, const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &bc_coefs, double data_time, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, VCInterpType mu_interp_type=VC_HARMONIC_INTERP)
 Construct a parallel PETSc Mat object corresponding to the side-centered viscous operator of a side-centered velocity variable restricted to a single SAMRAI::hier::PatchLevel. More...
 
static void constructPatchLevelSCInterpOp (Mat &mat, void(*interp_fcn)(double r_lower, double *w), int interp_stencil, Vec &X_vec, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level)
 Construct a parallel PETSc Mat object corresponding to the side-centered IB interpolation operator for the provided kernel function. More...
 
static void ib_4_interp_fcn (const double r, double *const w)
 Standard one-dimensional Peskin 4-pt delta function. More...
 
static void pwl_interp_fcn (const double r, double *const w)
 Standard one-dimensional Piecewise linear interpolation function. More...
 
static void constructProlongationOp (Mat &mat, const std::string &op_type, int dof_index_idx, const std::vector< int > &num_fine_dofs_per_proc, const std::vector< int > &num_coarse_dofs_per_proc, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > fine_patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > coarse_patch_level, const AO &coarse_level_ao, const int coarse_ao_offset=0)
 Construct a parallel PETSc Mat object corresponding to data prolongation from a coarser level to a finer level. More...
 
static void constructRestrictionScalingOp (Mat &P, Vec &L)
 Construct a diagonal matrix that scales the rows of adjoint (transpose) of prolongation matrix to get a suitable restriction matrix. More...
 
static void constructPatchLevelASMSubdomains (std::vector< IS > &is_overlap, std::vector< IS > &is_nonoverlap, const SAMRAI::hier::IntVector< NDIM > &box_size, const SAMRAI::hier::IntVector< NDIM > &overlap_size, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > > cf_boundary)
 Partition the patch level into subdomains suitable to be used for additive Schwarz method. More...
 
 PETScMatUtilities ()=delete
 Default constructor. More...
 
 PETScMatUtilities (const PETScMatUtilities &from)=delete
 Copy constructor. More...
 
PETScMatUtilitiesoperator= (const PETScMatUtilities &that)=delete
 Assignment operator. More...
 
static void constructConservativeProlongationOp_cell (Mat &mat, int dof_index_idx, const std::vector< int > &num_fine_dofs_per_proc, const std::vector< int > &num_coarse_dofs_per_proc, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > fine_patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > coarse_patch_level, const AO &coarse_level_ao, const int coarse_ao_offset)
 Construct a parallel PETSc Mat object corresponding to cc-data and conservative prolongation from a coarser level to a finer level. More...
 
static void constructRT0ProlongationOp_side (Mat &mat, int dof_index_idx, const std::vector< int > &num_fine_dofs_per_proc, const std::vector< int > &num_coarse_dofs_per_proc, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > fine_patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > coarse_patch_level, const AO &coarse_level_ao, const int coarse_ao_offset)
 Construct a parallel PETSc Mat object corresponding to sc-data and RT0 prolongation from a coarser level to a finer level. More...
 
static void constructLinearProlongationOp_side (Mat &mat, int dof_index_idx, const std::vector< int > &num_fine_dofs_per_proc, const std::vector< int > &num_coarse_dofs_per_proc, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > fine_patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > coarse_patch_level, const AO &coarse_level_ao, const int coarse_ao_offset)
 Construct a parallel PETSc Mat object corresponding to sc-data and linear prolongation from a coarser level to a finer level. More...
 
static void constructPatchLevelASMSubdomains_cell (std::vector< IS > &is_overlap, std::vector< IS > &is_nonoverlap, const SAMRAI::hier::IntVector< NDIM > &box_size, const SAMRAI::hier::IntVector< NDIM > &overlap_size, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > > cf_boundary)
 Partition the patch level into subdomains suitable to be used for additive Schwarz method for a cc-variable. More...
 
static void constructPatchLevelASMSubdomains_side (std::vector< IS > &is_overlap, std::vector< IS > &is_nonoverlap, const SAMRAI::hier::IntVector< NDIM > &box_size, const SAMRAI::hier::IntVector< NDIM > &overlap_size, const std::vector< int > &num_dofs_per_proc, int dof_index_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level, SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > > cf_boundary)
 Partition the patch level into subdomains suitable to be used for additive Schwarz method for a sc-variable. More...
 

Constructor & Destructor Documentation

◆ PETScMatUtilities() [1/2]

IBTK::PETScMatUtilities::PETScMatUtilities ( )
privatedelete
Note
This constructor is not implemented and should not be used.

◆ PETScMatUtilities() [2/2]

IBTK::PETScMatUtilities::PETScMatUtilities ( const PETScMatUtilities from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ constructPatchLevelCCLaplaceOp() [1/2]

static void IBTK::PETScMatUtilities::constructPatchLevelCCLaplaceOp ( Mat &  mat,
const SAMRAI::solv::PoissonSpecifications poisson_spec,
SAMRAI::solv::RobinBcCoefStrategy< NDIM > *  bc_coef,
double  data_time,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level 
)
static

◆ constructPatchLevelCCLaplaceOp() [2/2]

static void IBTK::PETScMatUtilities::constructPatchLevelCCLaplaceOp ( Mat &  mat,
const SAMRAI::solv::PoissonSpecifications poisson_spec,
const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &  bc_coefs,
double  data_time,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level 
)
static

◆ constructPatchLevelSCLaplaceOp()

static void IBTK::PETScMatUtilities::constructPatchLevelSCLaplaceOp ( Mat &  mat,
const SAMRAI::solv::PoissonSpecifications poisson_spec,
const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &  bc_coefs,
double  data_time,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level 
)
static

◆ constructPatchLevelVCSCViscousOp()

static void IBTK::PETScMatUtilities::constructPatchLevelVCSCViscousOp ( Mat &  mat,
const SAMRAI::solv::PoissonSpecifications poisson_spec,
double  alpha,
double  beta,
const std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > &  bc_coefs,
double  data_time,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
VCInterpType  mu_interp_type = VC_HARMONIC_INTERP 
)
static
Note
The scaling factors of \( C \) and \( D \) variables in the PoissonSpecification object are passed separately and are denoted by \( \beta \) and \( \alpha \), respectively.

◆ constructPatchLevelSCInterpOp()

static void IBTK::PETScMatUtilities::constructPatchLevelSCInterpOp ( Mat &  mat,
void(*)(double r_lower, double *w)  interp_fcn,
int  interp_stencil,
Vec &  X_vec,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level 
)
static
Warning
This routine does not properly handle delta functions for which interp_stencil is odd, nor does it properly handle physical boundary conditions.

◆ ib_4_interp_fcn()

static void IBTK::PETScMatUtilities::ib_4_interp_fcn ( const double  r,
double *const  w 
)
inlinestatic
Parameters
rNormalized distance (by grid space h) between the IB point and the lowermost stencil location.
wWeights as a function of (normalized) distance between the IB point and stencil locations. The first entry corresponds to the distance \( r_0 = r \) between the IB point and lowermost stencil location. The next normalized distance is taken as \( r_1 = r_0 + 1 \) and so on.

◆ pwl_interp_fcn()

static void IBTK::PETScMatUtilities::pwl_interp_fcn ( const double  r,
double *const  w 
)
inlinestatic

◆ constructProlongationOp()

static void IBTK::PETScMatUtilities::constructProlongationOp ( Mat &  mat,
const std::string &  op_type,
int  dof_index_idx,
const std::vector< int > &  num_fine_dofs_per_proc,
const std::vector< int > &  num_coarse_dofs_per_proc,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  fine_patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  coarse_patch_level,
const AO &  coarse_level_ao,
const int  coarse_ao_offset = 0 
)
static

◆ constructRestrictionScalingOp()

static void IBTK::PETScMatUtilities::constructRestrictionScalingOp ( Mat &  P,
Vec &  L 
)
static

\NOTE We store the diagonal enteries into a Vec rather than a Mat.

◆ constructPatchLevelASMSubdomains()

static void IBTK::PETScMatUtilities::constructPatchLevelASMSubdomains ( std::vector< IS > &  is_overlap,
std::vector< IS > &  is_nonoverlap,
const SAMRAI::hier::IntVector< NDIM > &  box_size,
const SAMRAI::hier::IntVector< NDIM > &  overlap_size,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > >  cf_boundary 
)
static

◆ operator=()

PETScMatUtilities& IBTK::PETScMatUtilities::operator= ( const PETScMatUtilities that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ constructConservativeProlongationOp_cell()

static void IBTK::PETScMatUtilities::constructConservativeProlongationOp_cell ( Mat &  mat,
int  dof_index_idx,
const std::vector< int > &  num_fine_dofs_per_proc,
const std::vector< int > &  num_coarse_dofs_per_proc,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  fine_patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  coarse_patch_level,
const AO &  coarse_level_ao,
const int  coarse_ao_offset 
)
staticprivate

◆ constructRT0ProlongationOp_side()

static void IBTK::PETScMatUtilities::constructRT0ProlongationOp_side ( Mat &  mat,
int  dof_index_idx,
const std::vector< int > &  num_fine_dofs_per_proc,
const std::vector< int > &  num_coarse_dofs_per_proc,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  fine_patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  coarse_patch_level,
const AO &  coarse_level_ao,
const int  coarse_ao_offset 
)
staticprivate

◆ constructLinearProlongationOp_side()

static void IBTK::PETScMatUtilities::constructLinearProlongationOp_side ( Mat &  mat,
int  dof_index_idx,
const std::vector< int > &  num_fine_dofs_per_proc,
const std::vector< int > &  num_coarse_dofs_per_proc,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  fine_patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  coarse_patch_level,
const AO &  coarse_level_ao,
const int  coarse_ao_offset 
)
staticprivate

◆ constructPatchLevelASMSubdomains_cell()

static void IBTK::PETScMatUtilities::constructPatchLevelASMSubdomains_cell ( std::vector< IS > &  is_overlap,
std::vector< IS > &  is_nonoverlap,
const SAMRAI::hier::IntVector< NDIM > &  box_size,
const SAMRAI::hier::IntVector< NDIM > &  overlap_size,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > >  cf_boundary 
)
staticprivate

◆ constructPatchLevelASMSubdomains_side()

static void IBTK::PETScMatUtilities::constructPatchLevelASMSubdomains_side ( std::vector< IS > &  is_overlap,
std::vector< IS > &  is_nonoverlap,
const SAMRAI::hier::IntVector< NDIM > &  box_size,
const SAMRAI::hier::IntVector< NDIM > &  overlap_size,
const std::vector< int > &  num_dofs_per_proc,
int  dof_index_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level,
SAMRAI::tbox::Pointer< SAMRAI::hier::CoarseFineBoundary< NDIM > >  cf_boundary 
)
staticprivate

Member Data Documentation

◆ ib_4_interp_stencil

const int IBTK::PETScMatUtilities::ib_4_interp_stencil = 4
static

◆ pwl_interp_stencil

const int IBTK::PETScMatUtilities::pwl_interp_stencil = 2
static

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