14#include <petscdmcomposite.h>
17#include <yaml-cpp/yaml.h>
41 virtual PetscErrorCode
destroy();
47 virtual PetscErrorCode
write(
const std::string &filePath)
const;
50 virtual PetscErrorCode
getLocalIndex(
const PetscInt &f,
const MatStencil &s,
54 virtual PetscErrorCode
getLocalIndex(
const PetscInt &f,
const PetscInt &i,
55 const PetscInt &j,
const PetscInt &k,
64 virtual PetscErrorCode
getNaturalIndex(
const PetscInt &f,
const PetscInt &i,
65 const PetscInt &j,
const PetscInt &k,
74 virtual PetscErrorCode
getGlobalIndex(
const PetscInt &f,
const PetscInt &i,
75 const PetscInt &j,
const PetscInt &k,
92 PetscErrorCode
init(
const MPI_Comm &world,
const YAML::Node &node);
Class of composite staggered Cartesian mesh.
type::IntVec1D UPackNLocalAllProcs
Number of local packed velocity points (without ghost points) for all processes.
virtual PetscErrorCode getNaturalIndex(const PetscInt &f, const MatStencil &s, PetscInt &idx) const
Get the natural index of a point by providing MatStencil.
type::RealVec3D dLTrue
Underlying data for mesh point spacing.
PetscErrorCode createSingleDMDA(const PetscInt &i)
Function for creating a single DMDA.
virtual PetscErrorCode getGlobalIndex(const PetscInt &f, const MatStencil &s, PetscInt &idx) const
Get the global index of a point in unpacked DM by providing MatStencil.
virtual PetscErrorCode write(const std::string &filePath) const
Write the mesh object into a HDF5 file.
virtual PetscErrorCode getPackedGlobalIndex(const PetscInt &f, const MatStencil &s, PetscInt &idx) const
Get the global index of a point in packed DM by providing MatStencil.
PetscErrorCode initDMDA()
Initialize DMDAs.
type::RealVec3D coordTrue
Underlying data for mesh point coordinates.
type::IntVec1D offsetsPackAllProcs
Offsets of packed velocity points in packed DM.
PetscErrorCode addLocalInfoString(std::stringstream &ss)
Gather info of parallel distribution and add to info string.
virtual ~CartesianMesh()
Default destructor.
PetscErrorCode createVelocityMesh()
Create velocity mesh information.
std::vector< AO > ao
References to underlying AO objects of velocity DMs.
PetscErrorCode createPressureDMDA()
Create DMDA for pressure.
virtual PetscErrorCode getLocalIndex(const PetscInt &f, const MatStencil &s, PetscInt &idx) const
Get the local index of a point by providing MatStencil.
type::IntVec2D UNLocalAllProcs
Number of local velocity points (without ghost points) for all processes and all velocity fields.
virtual PetscErrorCode destroy()
Manually destroy data.
PetscErrorCode init(const MPI_Comm &world, const YAML::Node &node)
Initialization.
PetscErrorCode createPressureMesh()
Create pressure mesh information.
PetscErrorCode createVertexMesh()
Create vertex information.
PetscErrorCode createInfoString()
Create a string of information.
virtual PetscBool isPointOnLocalProc(const type::RealVec1D &point, const type::Field &field)
CartesianMesh(const MPI_Comm &world, const YAML::Node &node)
Constructor.
type::IntVec2D offsetsAllProcs
Offsets of velocity points in unpacked DMs for all processes and all velocity field.
PetscErrorCode createVelocityPack()
Create DMDAs for velocity fields and make a DMComposite.
Base (abstract) class of mesh.
std::vector< IntVec1D > IntVec2D
2D std::vector holding PetscInt.
std::vector< PetscInt > IntVec1D
1D std::vector holding PetscInt.
std::vector< PetscReal > RealVec1D
1D std::vector holding PetscReal.
std::vector< RealVec2D > RealVec3D
3D std::vector holding PetscReal.
Prototype of mesh::MeshBase, type::Mesh, and factory function.
A toolbox for building flow solvers.
Definition of user-defined types for convenience.