19 PetscFunctionBeginUser;
24 ierr = PetscFinalized(&finalized); CHKERRV(ierr);
25 if (finalized)
return;
27 for (
int f = 0; f <
dim; ++f)
29 ierr = DMDestroy(&
da[f]); CHKERRV(ierr);
31 ierr = DMDestroy(&
da[3]); CHKERRV(ierr);
32 ierr = DMDestroy(&
da[4]); CHKERRV(ierr);
33 ierr = DMDestroy(&
UPack); CHKERRV(ierr);
40 PetscFunctionBeginUser;
44 for (
int f = 0; f <
dim; ++f)
46 ierr = DMDestroy(&
da[f]); CHKERRQ(ierr);
48 ierr = DMDestroy(&
da[3]); CHKERRQ(ierr);
49 ierr = DMDestroy(&
da[4]); CHKERRQ(ierr);
50 ierr = DMDestroy(&
UPack); CHKERRQ(ierr);
71 PetscFunctionReturn(0);
77 PetscFunctionBeginUser;
82 PetscFunctionReturn(0);
86PetscErrorCode
createMesh(
const MPI_Comm &comm,
const YAML::Node &node,
89 PetscFunctionBeginUser;
91 mesh = std::make_shared<CartesianMesh>(comm, node);
93 PetscFunctionReturn(0);
Definition of class mesh::CartesianMesh.
type::RealVec1D max
Maximum coordinates of boundaries in all directions.
type::IntVec2D n
Total number of points of all fields and in all directions.
virtual PetscErrorCode destroy()
Manually destroy data.
DM UPack
DMComposte of velocity DMs.
MPI_Comm comm
Communicator.
type::IntVec2D ed
The ending index of all fields in all directions of this process.
std::string info
A string for printing information.
PetscMPIInt mpiRank
Rank of this process.
type::IntVec2D bg
The beginning index of all fields in all directions of this process.
PetscInt UNLocal
Total number of velocity points local to this process.
type::IntVec1D nProc
Number of processes in all directions.
type::GhostedVec3D coord
Coordinates of mesh points of all fields and in all directions.
virtual ~MeshBase()
Default destructor.
PetscErrorCode printInfo() const
Print information to standard output.
PetscInt UN
Total number of velocity points.
type::GhostedVec3D dL
Spacings of mesh points of all fields and in all directions.
PetscMPIInt mpiSize
Total number of processes.
PetscInt pNLocal
Total number of pressure points local to this process.
std::vector< DM > da
A vector of DMs of all fields.
type::RealVec1D min
Minimum coordinates of boundaries in all directions.
type::BoolVec2D periodic
Bools indicating if any direction is periodic.
PetscInt pN
Total number of pressure points.
type::IntVec2D m
The number of points of all fields in all directions of this process.
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
PetscErrorCode createMesh(const MPI_Comm &comm, const YAML::Node &node, type::Mesh &mesh)
Factory function for creating a Mesh object.
PetscErrorCode print(const std::string &info)
Print information of a parallel object to standard output.
std::vector< IntVec1D > IntVec2D
2D std::vector holding PetscInt.
std::vector< BoolVec1D > BoolVec2D
2D std::vector holding PetscBool.
std::vector< PetscInt > IntVec1D
1D std::vector holding PetscInt.
std::vector< PetscReal > RealVec1D
1D std::vector holding PetscReal.
Prototypes of I/O functions.
Prototype of mesh::MeshBase, type::Mesh, and factory function.
std::vector< GhostedVec2D > GhostedVec3D
a vector of vector pointers to mimic ghosted 2D vectors. type
A toolbox for building flow solvers.