PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
petibm::operators Namespace Reference

Collections of factory functions of operators. More...

Typedefs

typedef std::function< PetscReal(const PetscInt &, const PetscInt &, const PetscInt &)> KernelType
 a short name for the signatures of kernels. More...
 
typedef std::vector< MatStencil > StencilVec
 STL vector holding MatStencil. More...
 
typedef std::function< StencilVec(const PetscInt &, const PetscInt &, const PetscInt &)> GetNeighborFunc
 a function type for functions returning neighbors' stencils. More...
 
typedef std::function< type::RealVec1D(const PetscInt &, const PetscInt &, const PetscInt &)> Kernel
 a function type for functions computing matrix entries' values. More...
 

Functions

PetscErrorCode createR (const type::Mesh &mesh, Mat &R)
 Create a matrix of flux areas, $R$. More...
 
PetscErrorCode createRInv (const type::Mesh &mesh, Mat &RInv)
 Create a matrix of inversed flux areas, $R^{-1}$. More...
 
PetscErrorCode createMHead (const type::Mesh &mesh, Mat &MHead)
 Create a matrix of cell widths of velocity points, $\hat{M}$. More...
 
PetscErrorCode createM (const type::Mesh &mesh, Mat &M)
 Create a matrix $M=\hat{M}R^{-1}$. More...
 
PetscErrorCode createIdentity (const type::Mesh &mesh, Mat &I)
 Create an identity matrix $I$ for velocity fields. More...
 
PetscErrorCode createGradient (const type::Mesh &mesh, Mat &G, const PetscBool &normalize=PETSC_TRUE)
 Create a gradient operator, $G$, for pressure field. More...
 
PetscErrorCode createDivergence (const type::Mesh &mesh, const type::Boundary &bc, Mat &D, Mat &DCorrection, const PetscBool &normalize=PETSC_TRUE)
 Create a divergence operator, $D$, and corresponding boundary correction, $D_{bc}$, for velocity fields. More...
 
PetscErrorCode createLaplacian (const type::Mesh &mesh, const type::Boundary &bc, Mat &L, Mat &LCorrection)
 Create a Laplacian operator, $L$, and boundary correction, $L_{bc}$ for velocity fields. More...
 
PetscErrorCode createConvection (const type::Mesh &mesh, const type::Boundary &bc, Mat &H)
 Create a matrix-free Mat for convection operator, $H$. More...
 
PetscErrorCode createBnHead (const Mat &Op, const PetscReal &dt, const PetscReal &coeff, const PetscInt &n, Mat &BnHead)
 Create non-normalized matrix of approximated $A^{-1}$, $B_n$. More...
 
PetscErrorCode createBn (const Mat &Op, const Mat &R, const Mat &MHead, const PetscReal &dt, const PetscReal &coeff, const PetscInt &n, Mat &Bn)
 Create normalized matrix of approximated $A^{-1}$, $B_n$. More...
 
PetscErrorCode createBn (const Mat &Op, const Mat &M, const PetscReal &dt, const PetscReal &coeff, const PetscInt &n, Mat &Bn)
 Create normalized matrix of approximated $A^{-1}$, $B_n$. More...
 
PetscErrorCode createDelta (const type::Mesh &mesh, const type::Boundary &bc, const type::BodyPack &bodies, const delta::DeltaKernel &kernel, const PetscInt &kernelSize, Mat &Op)
 Create a Delta operator, $Delta$. More...
 
PetscErrorCode getEulerianNeighbors (const type::Mesh &mesh, const PetscInt &dof, const type::IntVec1D &IJK, const std::vector< bool > &periodic, const PetscInt &window, type::IntVec2D &ijk, type::RealVec2D &xyz)
 
PetscErrorCode createDiagMatrix (const type::Mesh &mesh, const std::vector< KernelType > &kernels, Mat &M)
 a function to create diagonal matrix according to input kernel. More...
 

Detailed Description

Collections of factory functions of operators.

Typedef Documentation

◆ GetNeighborFunc

typedef std::function<StencilVec(const PetscInt &, const PetscInt &, const PetscInt &)> petibm::operators::GetNeighborFunc

a function type for functions returning neighbors' stencils.

Definition at line 28 of file creategradient.cpp.

◆ Kernel

typedef std::function<type::RealVec1D(const PetscInt &, const PetscInt &, const PetscInt &)> petibm::operators::Kernel

a function type for functions computing matrix entries' values.

Definition at line 33 of file creategradient.cpp.

◆ KernelType

typedef std::function<PetscReal(const PetscInt &, const PetscInt &, const PetscInt &)> petibm::operators::KernelType

a short name for the signatures of kernels.

A kernel is a function that can be used to calculate the diagonal values according to a given set of i, j, k index

Definition at line 29 of file creatediagmatrix.cpp.

◆ StencilVec

typedef std::vector<MatStencil> petibm::operators::StencilVec

STL vector holding MatStencil.

Definition at line 23 of file creategradient.cpp.

Function Documentation

◆ createDiagMatrix()

PetscErrorCode petibm::operators::createDiagMatrix ( const type::Mesh mesh,
const std::vector< KernelType > &  kernels,
Mat &  M 
)

a function to create diagonal matrix according to input kernel.

Parameters
meshan instance of CartesianMesh.
kernelsa length 3 STL vector holding KernelType.
Mthe returned matrix.

This is not designed for public use. It's only valid for the functions defined in this source file.

Returns
PetscErrorCode

Definition at line 43 of file creatediagmatrix.cpp.

◆ getEulerianNeighbors()

PetscErrorCode petibm::operators::getEulerianNeighbors ( const type::Mesh mesh,
const PetscInt &  dof,
const type::IntVec1D IJK,
const std::vector< bool > &  periodic,
const PetscInt &  window,
type::IntVec2D ijk,
type::RealVec2D xyz 
)

Definition at line 171 of file createdelta.cpp.