PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
boundary.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <memory>
11
12#include <petibm/mesh.h>
14#include <petibm/solution.h>
15
64namespace petibm
65{
71namespace boundary
72{
79{
80public:
82 PetscInt dim;
83
85 std::vector<std::vector<type::SingleBoundary>> bds;
86
88 BoundaryBase() = default;
89
96 BoundaryBase(const type::Mesh &mesh, const YAML::Node &node);
97
99 virtual ~BoundaryBase();
100
102 virtual PetscErrorCode destroy();
103
109 virtual PetscErrorCode setGhostICs(const type::Solution &soln) = 0;
110
120 virtual PetscErrorCode updateEqs(const type::Solution &soln,
121 const PetscReal &dt) = 0;
122
128 virtual PetscErrorCode updateGhostValues(const type::Solution &soln) = 0;
129
136 virtual PetscErrorCode copyValues2LocalVecs(
137 std::vector<Vec> &lclVecs) const = 0;
138
139protected:
146 virtual PetscErrorCode init(const type::Mesh &mesh,
147 const YAML::Node &node) = 0;
148
150 MPI_Comm comm;
151
153 PetscMPIInt mpiSize;
154
156 PetscMPIInt mpiRank;
157
160
161}; // BoundaryBase
162
163} // end of namespace boundary
164
165namespace type
166{
175typedef std::shared_ptr<boundary::BoundaryBase> Boundary;
176
177} // end of namespace type
178
179namespace boundary
180{
191PetscErrorCode createBoundary(const type::Mesh &mesh, const YAML::Node &node,
192 type::Boundary &boundary);
193
194} // end of namespace boundary
195
196} // end of namespace petibm
Base (abstract) class for the whole boundary.
Definition: boundary.h:79
PetscMPIInt mpiSize
Size of MPI communicator.
Definition: boundary.h:153
MPI_Comm comm
MPI communicator.
Definition: boundary.h:150
type::Mesh mesh
A shared_ptr to underlying mesh.
Definition: boundary.h:159
BoundaryBase(const type::Mesh &mesh, const YAML::Node &node)
Construct a boundary object based on a given mesh object.
virtual ~BoundaryBase()
Default destructor.
Definition: boundary.cpp:16
virtual PetscErrorCode copyValues2LocalVecs(std::vector< Vec > &lclVecs) const =0
Copy values of ghost points to a vector of local PETSc Vec objects.
virtual PetscErrorCode updateGhostValues(const type::Solution &soln)=0
Update the values of ghost points.
PetscInt dim
Dimension.
Definition: boundary.h:82
virtual PetscErrorCode destroy()
Manually destroy data.
Definition: boundary.cpp:28
BoundaryBase()=default
Default constructor.
virtual PetscErrorCode setGhostICs(const type::Solution &soln)=0
Set the initial values of ghost points.
std::vector< std::vector< type::SingleBoundary > > bds
A 2D vector holding all single boundaries.
Definition: boundary.h:85
virtual PetscErrorCode updateEqs(const type::Solution &soln, const PetscReal &dt)=0
Update the equations between ghost and boundary points.
virtual PetscErrorCode init(const type::Mesh &mesh, const YAML::Node &node)=0
Underlying initialization function.
PetscMPIInt mpiRank
The rank of this process.
Definition: boundary.h:156
PetscErrorCode createBoundary(const type::Mesh &mesh, const YAML::Node &node, type::Boundary &boundary)
Create a Boundary object.
Definition: boundary.cpp:41
std::shared_ptr< boundary::BoundaryBase > Boundary
Type definition of petibm::type::Boundary.
Definition: boundary.h:175
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
Definition: mesh.h:348
std::shared_ptr< solution::SolutionBase > Solution
Type definition of solution object.
Definition: solution.h:210
Prototype of mesh::MeshBase, type::Mesh, and factory function.
A toolbox for building flow solvers.
Definition: bodypack.h:52
Definition of the class SingleBoundaryBase.
Definition of the class petibm::solution::SolutionBase, the type definition petibm::type::Solution,...