IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
List of all members
IBTK::PETScMatUtilities Class Reference

Class PETScMatUtilities provides utility functions for PETSc Mat objects. More...

#include </home/runner/work/IBAMR/IBAMR/ibtk/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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Detailed Description

Class PETScMatUtilities provides utility functions for PETSc Mat objects.

Member Function Documentation

◆ constructPatchLevelSCInterpOp()

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

Construct a parallel PETSc Mat object corresponding to the side-centered IB interpolation operator for the provided kernel function.

Warning
This routine does not properly handle delta functions for which interp_stencil is odd, nor does it properly handle physical boundary conditions.

◆ constructPatchLevelVCSCViscousOp()

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

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.

Note
The scaling factors of $ C $ and $ D $ variables in the PoissonSpecification object are passed separately and are denoted by $ \beta $ and $ \alpha $, respectively.

◆ constructRestrictionScalingOp()

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

Construct a diagonal matrix that scales the rows of adjoint (transpose) of prolongation matrix to get a suitable restriction matrix.

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

◆ ib_4_interp_fcn()

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

Standard one-dimensional Peskin 4-pt delta function.

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.

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