PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
type.h
Go to the documentation of this file.
1
8#pragma once
9
10// here goes C++ STL
11#include <map>
12#include <string>
13#include <vector>
14
15// here goes PETSc
16#include <petscmat.h>
17#include <petscsys.h>
18
58namespace petibm
59{
64namespace type
65{
67enum Dir
68{
69 x = 0,
71 z
72};
74extern std::map<std::string, Dir> str2dir;
76extern std::map<Dir, std::string> dir2str;
77
80{
81 u = 0,
85 vertex
86};
88extern std::map<std::string, Field> str2fd;
90extern std::map<Field, std::string> fd2str;
91
94{
95 NOBC = 0,
102extern std::map<std::string, BCType> str2bt;
104extern std::map<BCType, std::string> bt2str;
105
108{
114 ZPLUS
117extern std::map<std::string, BCLoc> str2bl;
119extern std::map<BCLoc, std::string> bl2str;
120
123{
124 POINT = 0,
127 VOLUME
128}; // ProbeType
130extern std::map<std::string, ProbeType> str2ProbeType;
131
133typedef std::vector<PetscInt> IntVec1D;
135typedef std::vector<IntVec1D> IntVec2D;
137typedef std::vector<IntVec2D> IntVec3D;
138
140typedef std::vector<PetscReal> RealVec1D;
142typedef std::vector<RealVec1D> RealVec2D;
144typedef std::vector<RealVec2D> RealVec3D;
145
147typedef std::vector<PetscBool> BoolVec1D;
149typedef std::vector<BoolVec1D> BoolVec2D;
151typedef std::vector<BoolVec2D> BoolVec3D;
152
154typedef std::vector<PetscReal*> GhostedVec2D;
157typedef std::vector<GhostedVec2D> GhostedVec3D;
158
161{
162 PetscInt
164 MatStencil targetStencil;
166 PetscInt targetPackedId;
168 PetscReal area;
169 PetscReal dL;
171 PetscReal a0;
172 PetscReal a1;
173 PetscReal value;
174};
175
177typedef std::map<MatStencil, GhostPointInfo> GhostPointsList;
178
185{
186 PetscInt row;
187 PetscReal coeff;
188};
189
195typedef std::vector<std::map<MatStencil, RowModifier>> MatrixModifier;
196
197} // end of namespace type
198} // end of namespace petibm
std::vector< IntVec1D > IntVec2D
2D std::vector holding PetscInt.
Definition: type.h:135
std::vector< BoolVec2D > BoolVec3D
3D std::vector holding PetscBool.
Definition: type.h:151
Field
Legal fields.
Definition: type.h:80
std::map< BCLoc, std::string > bl2str
Mapping between BCLoc and std::string.
Definition: type.cpp:48
std::vector< PetscBool > BoolVec1D
1D std::vector holding PetscBool.
Definition: type.h:147
BCType
Type of boundary conditions.
Definition: type.h:94
std::vector< PetscReal * > GhostedVec2D
a vector of pointers to mimic ghosted 1D vectors.
Definition: type.h:154
Dir
Legal physical directions.
Definition: type.h:68
std::map< std::string, ProbeType > str2ProbeType
Mapping between std::string and ProbeType.
Definition: type.cpp:53
std::vector< BoolVec1D > BoolVec2D
2D std::vector holding PetscBool.
Definition: type.h:149
ProbeType
Type of probe for monitoring solution.
Definition: type.h:123
std::map< MatStencil, GhostPointInfo > GhostPointsList
A map between MatStencil and GhostPointInfo.
Definition: type.h:177
std::map< Field, std::string > fd2str
Mapping between Field and std::string.
Definition: type.cpp:24
std::map< std::string, BCLoc > str2bl
Mapping between std::string and BCLoc.
Definition: type.cpp:41
std::vector< std::map< MatStencil, RowModifier > > MatrixModifier
A type that holds necessary info for a matrix modifier that modifies matrix coefficient based on BCs.
Definition: type.h:195
std::map< std::string, BCType > str2bt
Mapping between std::string and BCType.
Definition: type.cpp:28
std::vector< RealVec1D > RealVec2D
2D std::vector holding PetscReal.
Definition: type.h:142
std::vector< PetscInt > IntVec1D
1D std::vector holding PetscInt.
Definition: type.h:133
BCLoc
Location of a boundary.
Definition: type.h:108
std::map< Dir, std::string > dir2str
Mapping between Dir and std::string.
Definition: type.cpp:18
std::map< BCType, std::string > bt2str
mapping between BCType and std::string.
Definition: type.cpp:34
std::map< std::string, Dir > str2dir
Mapping between std::string and Dir.
Definition: type.cpp:16
std::vector< PetscReal > RealVec1D
1D std::vector holding PetscReal.
Definition: type.h:140
std::map< std::string, Field > str2fd
Mapping between std::string and Field.
Definition: type.cpp:21
std::vector< RealVec2D > RealVec3D
3D std::vector holding PetscReal.
Definition: type.h:144
std::vector< IntVec2D > IntVec3D
3D std::vector holding PetscInt.
Definition: type.h:137
@ vertex
Definition: type.h:85
@ 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
@ VOLUME
Definition: type.h:127
@ SURFACE
Definition: type.h:126
@ ZMINUS
Definition: type.h:113
@ XMINUS
Definition: type.h:109
@ YMINUS
Definition: type.h:111
std::vector< GhostedVec2D > GhostedVec3D
a vector of vector pointers to mimic ghosted 2D vectors. type
Definition: type.h:157
A toolbox for building flow solvers.
Definition: bodypack.h:52
A data structure for a single ghost point.
Definition: type.h:161
MatStencil targetStencil
Definition: type.h:164
PetscInt lclId
the index in a local velocity vector of this ghost point
Definition: type.h:163
PetscReal value
the value of this ghost point
Definition: type.h:173
PetscReal area
the flux area of this ghost point
Definition: type.h:168
PetscReal a0
the coefficient of the velocity at the target point
Definition: type.h:171
PetscReal a1
the constant coefficient
Definition: type.h:172
A struct holding information about which row in a matrix should be modified based on BCs.
Definition: type.h:185
PetscInt row
the global index of a row in a Mat
Definition: type.h:186
PetscReal coeff
coefficient
Definition: type.h:187