26 const YAML::Node &node)
28 PetscFunctionBeginUser;
50 for (PetscInt f = 0; f <
dim; ++f)
54 for (PetscInt b = 0; b <
dim * 2; ++b)
63 PetscFunctionReturn(0);
69 PetscFunctionBeginUser;
77 ierr = bd->setGhostICs(soln->UGlobal); CHKERRQ(ierr);
81 ierr = MPI_Barrier(
comm); CHKERRQ(ierr);
83 PetscFunctionReturn(0);
90 PetscFunctionBeginUser;
98 ierr = bd->updateEqs(soln->UGlobal, dt); CHKERRQ(ierr);
102 ierr = MPI_Barrier(
comm); CHKERRQ(ierr);
104 PetscFunctionReturn(0);
110 PetscFunctionBeginUser;
114 for (
auto &fbd :
bds)
118 ierr = bd->updateGhostValues(soln->UGlobal); CHKERRQ(ierr);
122 ierr = MPI_Barrier(
comm); CHKERRQ(ierr);
124 PetscFunctionReturn(0);
129 std::vector<Vec> &lclVecs)
const
131 PetscFunctionBeginUser;
135 for (PetscInt f = 0; f <
dim; ++f)
137 for (
auto &bd :
bds[f])
139 ierr = bd->copyValues2LocalVec(lclVecs[f]); CHKERRQ(ierr);
143 ierr = MPI_Barrier(
comm); CHKERRQ(ierr);
145 PetscFunctionReturn(0);
Definition of boundary::BoundarySimple.
PetscMPIInt mpiSize
Size of MPI communicator.
MPI_Comm comm
MPI communicator.
type::Mesh mesh
A shared_ptr to underlying mesh.
std::vector< std::vector< type::SingleBoundary > > bds
A 2D vector holding all single boundaries.
PetscMPIInt mpiRank
The rank of this process.
BoundarySimple(const type::Mesh &mesh, const YAML::Node &node)
Construct a boundary object based on a given mesh object.
virtual PetscErrorCode copyValues2LocalVecs(std::vector< Vec > &lclVecs) const
Copy values of ghost points to a vector of local PETSc Vec objects.
virtual PetscErrorCode init(const type::Mesh &mesh, const YAML::Node &node)
Underlying initialization function.
virtual PetscErrorCode updateGhostValues(const type::Solution &soln)
Update the values of ghost points.
virtual PetscErrorCode setGhostICs(const type::Solution &soln)
Set the initial values of ghost points.
virtual PetscErrorCode updateEqs(const type::Solution &soln, const PetscReal &dt)
Update the equations between ghost and boundary points.
PetscErrorCode createSingleBoundary(const type::Mesh &mesh, const type::BCLoc &loc, const type::Field &field, const PetscReal &value, const type::BCType &bcType, type::SingleBoundary &singleBd)
Factory function for creating a SingleBoundary object.
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
PetscErrorCode parseBCs(const YAML::Node &node, type::IntVec2D &bcTypes, type::RealVec2D &bcValues)
Parse boundary conditions from a YAML node.
std::shared_ptr< solution::SolutionBase > Solution
Type definition of solution object.
std::vector< IntVec1D > IntVec2D
2D std::vector holding PetscInt.
BCType
Type of boundary conditions.
std::vector< RealVec1D > RealVec2D
2D std::vector holding PetscReal.
BCLoc
Location of a boundary.
A toolbox for building flow solvers.
Prototypes of parser functions.