Peano
Loading...
Searching...
No Matches
Variable.cpp
Go to the documentation of this file.
1#include "Variable.h"
2#include "tarch/Assertions.h"
4
5
6convert::data::Variable::Variable(std::string name_, int dofsPerAxis_, int unknowns_, PeanoDataType type_, int dimensions_):
7 name(name_),
8 dofsPerAxis(dofsPerAxis_),
9 unknowns(unknowns_),
10 type(type_),
11 dimensions(dimensions_) {
14}
15
16
18 return name<rhs.name;
19}
20
21
23 return name==rhs.name;
24}
25
26
28 return unknowns * getTotalNumberOfDofsPerPatch();
29}
30
31
33 return tarch::la::aPowI(dimensions,dofsPerAxis);
34}
35
36
39 return dofsPerAxis+1;
40 }
41 else {
42 return dofsPerAxis;
43 }
44}
45
46
48 return tarch::la::aPowI(dimensions,getVerticesPerAxisInCartesianMesh());
49}
50
51
53 return tarch::la::aPowI(dimensions,getVerticesPerAxisInCartesianMesh()-1);
54}
55
56
58 std::ostringstream msg;
59
60 msg << "(name:" << name
61 << ",dofs-per-axis:" << dofsPerAxis
62 << ",unknowns:" << unknowns
63 << ",type:" << (type==convert::data::PeanoDataType::Cell_Values ? "cell-values" : "vertex-values" )
64 << ",dim:" << dimensions
65 << ")";
66
67 return msg.str();
68}
#define assertion1(expr, param)
Represents one variable that is subsequently attached to the patches of a file.
Definition Variable.h:18
const int unknowns
If this unknown holds 1, it is scalar, for d it is vector data, and so forth.
Definition Variable.h:30
bool operator==(const convert::data::Variable &rhs) const
Definition Variable.cpp:22
bool operator<(const convert::data::Variable &rhs) const
Definition Variable.cpp:17
int getVerticesPerAxisInCartesianMesh() const
Definition Variable.cpp:37
Variable(std::string name_, int dofsPerAxis_, int unknowns_, PeanoDataType type_, int dimensions_)
Definition Variable.cpp:6
int getTotalNumberOfVerticesInCartesianMesh() const
Definition Variable.cpp:47
std::string toString() const
Definition Variable.cpp:57
int getTotalNumberOfDofsPerPatch() const
Definition Variable.cpp:32
int getTotalNumberOfQuantitiesPerPatch() const
This is getTotalNumberOfDofsPerPatch() times the number of unknowns per dof.
Definition Variable.cpp:27
int getTotalNumberOfCellsInCartesianMesh() const
Definition Variable.cpp:52
int aPowI(int i, int a)
Computes the i-th power of a in integer arithmetic.