PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
singleboundaryperiodic.cpp
Go to the documentation of this file.
1
9
10namespace petibm
11{
12namespace boundary
13{
15 const type::BCLoc &inLoc,
16 const type::Field &inField,
17 const PetscReal &inValue)
18{
19 // for Periodic, though we don't have to implement anything,
20 // we still setup some basic values
21
22 // create a shared pointer to mesh; bad practice...
23 mesh = inMesh;
24
25 // obtain MPI information from CartesianMesh object
26 comm = mesh->comm;
27 mpiSize = mesh->mpiSize;
28 mpiRank = mesh->mpiRank;
29
30 // set dim
31 dim = mesh->dim;
32
33 // set the location
34 loc = inLoc;
35
36 // set field
37 field = inField;
38
39 // set type
41
42 // set value
43 value = inValue;
44
45 // set normal
46 normal = ((int(loc) % 2) == 0) ? -1.0 : 1.0;
47} // SingleBoundaryPeriodic
48
50 const PetscReal &targetValue, type::GhostPointInfo &p)
51{
52 PetscFunctionBeginUser;
53 // for Periodic BC, do nothing. Let PETSc handle that.
54 PetscFunctionReturn(0);
55} // setGhostICsKernel
56
58 const PetscReal &targetValue, const PetscReal &dt, type::GhostPointInfo &p)
59{
60 PetscFunctionBeginUser;
61 // for Periodic BC, do nothing. Let PETSc handle that.
62 PetscFunctionReturn(0);
63} // updateEqsKernel
64
65} // end of namespace boundary
66} // end of namespace petibm
type::BCType type
The type of boundary conditions.
type::Field field
The field of which the ghost points represent.
PetscReal normal
The direction of normal vector.
type::BCLoc loc
The location of this boundary.
type::Mesh mesh
The corresponding Mesh object.
PetscReal value
A constant value representing BC value.
PetscMPIInt mpiSize
The size of the MPI communicator.
MPI_Comm comm
MPI communicator.
PetscMPIInt mpiRank
The rank of this process.
SingleBoundaryPeriodic(const type::Mesh &mesh, const type::BCLoc &loc, const type::Field &field, const PetscReal &value)
Constructor.
virtual PetscErrorCode setGhostICsKernel(const PetscReal &targetValue, type::GhostPointInfo &p)
The underlying kernel for setting initial values and equations.
virtual PetscErrorCode updateEqsKernel(const PetscReal &targetValue, const PetscReal &dt, type::GhostPointInfo &p)
Underlying kernel for updating the coefficients of the equation.
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
Definition: mesh.h:348
Field
Legal fields.
Definition: type.h:80
BCLoc
Location of a boundary.
Definition: type.h:108
@ PERIODIC
Definition: type.h:96
A toolbox for building flow solvers.
Definition: bodypack.h:52
Definition of the class SingleBoundaryPeriodic.
A data structure for a single ghost point.
Definition: type.h:161