1#include "{{CLASSNAME}}.h"
8const double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::QuadraturePointsInUnitInterval[] = {
9 {{QUADRATURE_POINTS_IN_UNIT_INTERVAL| join(
", ")}}
12const double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::GaussianIntegrationPoints[] = {
13 {{GAUSSIAN_INTEGRATION_POINTS| join(
", ")}}
16const double {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::GaussianIntegrationWeights[] = {
17 {{GAUSSIAN_INTEGRATION_WEIGHTS| join(
", ")}}
20{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::{{CLASSNAME}}():
21 _localToGlobalMap( ::
petsc::LocalToGlobalMap::RankGlobalTreeNumber ) {
25{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::~{{CLASSNAME}}() {
30 return _localToGlobalMap;
35 return _linearEquationSystem;
39void {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::finishAssembly() {
43{%
if CELL_CELL_LHS_MATRIX!=[] %}
44tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getLhsMatrix(
48 static tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > result = {
49 {{CELL_CELL_LHS_MATRIX[0]| join(
", ")}}
50 {%
for ROW in CELL_CELL_LHS_MATRIX[1:] %}
55 {%
if CELL_CELL_LHS_MATRIX_SCALING >= 0 %}
56 for (
int i=0;
i<{{CELL_CELL_LHS_MATRIX_SCALING}};
i++) {
59 for (
int i=0;
i<(-1)*{{CELL_CELL_LHS_MATRIX_SCALING}};
i++) {
63 return scaling * result;
68{%
if CELL_CELL_RHS_MATRIX!=[] %}
69tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getRhsMatrix(
73 static tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > result = {
74 {{CELL_CELL_RHS_MATRIX[0]| join(
", ")}}
75 {%
for ROW in CELL_CELL_RHS_MATRIX[1:] %}
80 {%
if CELL_CELL_RHS_MATRIX_SCALING >= 0 %}
81 for (
int i=0;
i<{{CELL_CELL_RHS_MATRIX_SCALING}};
i++) {
84 for (
int i=0;
i<(-1)*{{CELL_CELL_RHS_MATRIX_SCALING}};
i++) {
88 return scaling * result;
102{%
if CELL_TO_FACE_MATRIX!=[] %}
103tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FacesPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getProjectionOfCellDataOntoFace(
107 static tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FacesPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell,
double > result = {
108 {{CELL_TO_FACE_MATRIX[0]| join(
", ")}}
109 {%
for ROW in CELL_TO_FACE_MATRIX[1:] %}
110 ,{{ROW | join(
", ")}}
113 double scaling = 1.0;
115 {%
if CELL_TO_FACE_MATRIX_SCALING is none %}
120 {% elif CELL_TO_FACE_MATRIX_SCALING >= 0 %}
121 for (
int i=0;
i<{{CELL_TO_FACE_MATRIX_SCALING}};
i++) {
124 return scaling * result;
125 {% elif CELL_TO_FACE_MATRIX_SCALING < 0 %}
126 for (
int i=0;
i<(-1)*{{CELL_TO_FACE_MATRIX_SCALING}};
i++) {
129 return scaling * result;
144{%
if FACE_TO_CELL_MATRIX!=[] %}
145tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FacesPerCell,
double > {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getProjectionOfRiemannSolutionOntoCell(
149 static tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::DoFsPerCell, {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FacesPerCell,
double > result = {
150 {{FACE_TO_CELL_MATRIX[0]| join(
", ")}}
151 {%
for ROW in FACE_TO_CELL_MATRIX[1:] %}
152 ,{{ROW | join(
", ")}}
155 double scaling = 1.0;
156 {%
if FACE_TO_CELL_MATRIX_SCALING is none %}
161 {% elif FACE_TO_CELL_MATRIX_SCALING >= 0 %}
162 for (
int i=0;
i<{{FACE_TO_CELL_MATRIX_SCALING}};
i++) {
165 return scaling * result;
166 {% elif FACE_TO_CELL_MATRIX_SCALING < 0 %}
167 for (
int i=0;
i<(-1)*{{FACE_TO_CELL_MATRIX_SCALING}};
i++) {
170 return scaling * result;
176{%
if FACE_FACE_RIEMANN_PROBLEM_MATRIX!=[] %}
177tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns, 2*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns,
double > {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getRiemannSolver(
181 static tarch::la::Matrix< {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns, 2*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::NodesPerFace*{{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::FaceUnknowns,
double > result = {
182 {{FACE_FACE_RIEMANN_PROBLEM_MATRIX[0]| join(
", ")}}
183 {%
for ROW in FACE_FACE_RIEMANN_PROBLEM_MATRIX[1:] %}
184 ,{{ROW | join(
", ")}}
193{{NAMESPACE | join(
"::")}}::vertexdata::{{SOLVER_NAME}}PETScData::Type {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getVertexType(
197 return vertexdata::{{SOLVER_NAME}}PETScData::Type::Outside;
201{{NAMESPACE | join(
"::")}}::facedata::{{SOLVER_NAME}}PETScData::Type {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getFaceType(
206 bool isOnBoundary =
false;
207 for (
int d=0;
d<Dimensions;
d++) {
214 return isOnBoundary(x) ? facedata::{{SOLVER_NAME}}PETScData::Type::Boundary : facedata::{{SOLVER_NAME}}PETScData::Type::Interior;
218{{NAMESPACE | join(
"::")}}::celldata::{{SOLVER_NAME}}PETScData::Type {{NAMESPACE | join(
"::")}}::{{CLASSNAME}}::getCellType(
222 return celldata::{{SOLVER_NAME}}PETScData::Type::Interior;
Class to capture all of the PETSc objects needed by some experiements.
tarch::logging::Log _log("exahype2::fv")
bool greaterEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool smallerEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)