PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
singleboundary.cpp
Go to the documentation of this file.
1
8// here goes headers from our PetIBM
14
15namespace petibm
16{
17namespace boundary
18{
19PetscErrorCode createSingleBoundary(const type::Mesh &mesh,
20 const type::BCLoc &loc,
21 const type::Field &field,
22 const PetscReal &value,
23 const type::BCType &bcType,
24 type::SingleBoundary &singleBd)
25{
26 PetscFunctionBeginUser;
27
28 switch (bcType)
29 {
31 SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_ARG_WRONG,
32 "NOBC does not make sense here!");
33 break;
35 singleBd = std::make_shared<SingleBoundaryPeriodic>(mesh, loc,
36 field, value);
37 break;
39 singleBd = std::make_shared<SingleBoundaryDirichlet>(mesh, loc,
40 field, value);
41 break;
43 singleBd = std::make_shared<SingleBoundaryNeumann>(mesh, loc, field,
44 value);
45 break;
47 singleBd = std::make_shared<SingleBoundaryConvective>(mesh, loc,
48 field, value);
49 break;
50 }
51
52 PetscFunctionReturn(0);
53} // createSingleBoundary
54
55} // end of namespace boundary
56} // end of namespace petibm
std::shared_ptr< boundary::SingleBoundaryBase > SingleBoundary
Definition of type petibm::type::SingleBoundary.
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.
Definition: mesh.h:348
Field
Legal fields.
Definition: type.h:80
BCType
Type of boundary conditions.
Definition: type.h:94
BCLoc
Location of a boundary.
Definition: type.h:108
@ PERIODIC
Definition: type.h:96
@ CONVECTIVE
Definition: type.h:99
@ NOBC
Definition: type.h:95
@ DIRICHLET
Definition: type.h:97
@ NEUMANN
Definition: type.h:98
A toolbox for building flow solvers.
Definition: bodypack.h:52
Definition of the class SingleBoundaryBase.
Definition of the class SingleBoundaryConvective.
Definition of the class SingleBoundaryDirichlet.
Definition of the class SingleBoundaryNeumann.
Definition of the class SingleBoundaryPeriodic.