Peano
Loading...
Searching...
No Matches
PatchUtils.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6#include <vector>
7
8#include "tarch/la/Vector.h"
10
13
15
16
17namespace exahype2 {
18 namespace fd {
24 int numberOfGridCellsPerPatchPerAxis
25 )
26 //InlineMethod
27 {
28 return ::exahype2::fv::getVolumeSize(h,numberOfGridCellsPerPatchPerAxis);
29 }
30
31
34 int numberOfGridCellsPerPatchPerAxis
35 )
36 //InlineMethod
37 {
38 return ::exahype2::fv::getVolumeSize(h,numberOfGridCellsPerPatchPerAxis);
39 }
40
41
44 int numberOfGridCellsPerPatchPerAxis
45 )
46 //InlineMethod
47 {
48 return ::exahype2::fv::getFaceSize(h,numberOfGridCellsPerPatchPerAxis);
49 }
50
51
54 int numberOfGridCellsPerPatchPerAxis
55 )
56 //InlineMethod
57 {
58 return ::exahype2::fv::getFaceSize(h,numberOfGridCellsPerPatchPerAxis);
59 }
60
61
80 int numberOfGridCellsPerPatchPerAxis,
81 const tarch::la::Vector<2,int>& index
82 )
83 //InlineMethod
84 {
85 return ::exahype2::fv::getVolumeCentre(x,h,numberOfGridCellsPerPatchPerAxis,index);
86 }
87
88
92 int numberOfGridCellsPerPatchPerAxis,
93 const tarch::la::Vector<3,int>& index
94 )
95 //InlineMethod
96 {
97 return ::exahype2::fv::getVolumeCentre(x,h,numberOfGridCellsPerPatchPerAxis,index);
98 }
99
100
104 int numberOfGridCellsPerPatchPerAxis,
105 int overlap,
106 int normal,
107 const tarch::la::Vector<2,int>& index
108 )
109 //InlineMethod
110 {
111 return ::exahype2::fv::getFaceCentre(x,h,numberOfGridCellsPerPatchPerAxis,overlap,normal,index);
112 }
113
114
118 int numberOfGridCellsPerPatchPerAxis,
119 int overlap,
120 int normal,
121 const tarch::la::Vector<3,int>& index
122 )
123 //InlineMethod
124 {
125 return ::exahype2::fv::getFaceCentre(x,h,numberOfGridCellsPerPatchPerAxis,overlap,normal,index);
126 }
127
128
135 std::string plotGridCell(
136 const double* __restrict__ Q,
137 int unknowns
138 );
139
153 void validatePatch(
154 const double* __restrict__ Q,
155 int unknowns,
156 int auxiliaryVariables,
157 int numberOfGridCellsPerPatchPerAxis,
158 int haloSize,
159 const std::string& location = "",
160 bool triggerNonCriticalAssertion = true,
161 double* minValues = nullptr,
162 double* maxValues = nullptr
163 );
164
172 std::string plotPatch(
173 const double* __restrict__ Q,
174 int unknowns,
175 int auxiliaryVariables,
176 int numberOfGridCellsPerPatchPerAxis,
177 int haloSize,
178 bool prettyPrint = false
179 );
180
181
182 std::string plotPatchOverlap(
183 const double* __restrict__ Q,
184 int unknowns,
185 int auxiliaryVariables,
186 int numberOfGridCellsPerPatchPerAxis,
187 int haloSize,
188 int normal,
189 bool prettyPrint = false
190 );
191 }
192}
193
static tarch::la::Vector< 2, double > getGridFaceCentre(const tarch::la::Vector< 2, double > &x, const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis, int overlap, int normal, const tarch::la::Vector< 2, int > &index)
Definition PatchUtils.h:101
static tarch::la::Vector< 2, double > getGridFaceSize(const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis)
Definition PatchUtils.h:42
static tarch::la::Vector< 2, double > getGridCellCentre(const tarch::la::Vector< 2, double > &x, const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis, const tarch::la::Vector< 2, int > &index)
In ExaHyPE's Finite Volume setup, a cell hosts a patch of Finite Volumes.
Definition PatchUtils.h:77
void validatePatch(const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, const std::string &location="", bool triggerNonCriticalAssertion=true, double *minValues=nullptr, double *maxValues=nullptr)
Just runs over the patch and ensures that no entry is non or infinite.
std::string plotGridCell(const double *__restrict__ Q, int unknowns)
Helper routine that I need in the log statements.
std::string plotPatch(const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, bool prettyPrint=false)
Plot patch.
static tarch::la::Vector< 2, double > getGridCellSize(const tarch::la::Vector< 2, double > &h, int numberOfGridCellsPerPatchPerAxis)
Definition PatchUtils.h:22
std::string plotPatchOverlap(const double *__restrict__ Q, int unknowns, int auxiliaryVariables, int numberOfGridCellsPerPatchPerAxis, int haloSize, int normal, bool prettyPrint=false)
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
Simple vector class.
Definition Vector.h:150