Peano
Loading...
Searching...
No Matches
PatchToDoubleArrayWithSmartPointer.template.h
Go to the documentation of this file.
1//
2// Peano4 data file
3// Generated by Peano's Python API
4// www.peano-framework.org
5// This is generated. Be careful with adding your own stuff
6//
7#pragma once
8
9
10
11#include <string>
12#include <memory>
13
14
15#include "tarch/la/Vector.h"
16#include "tarch/mpi/mpi.h"
17
20
25
34{% if FLOAT_TYPE=="std::float16_t" or FLOAT_TYPE=="std::bfloat16_t" %}
35#include <stdfloat>
36{% endif %}
37
38
39{% for item in NAMESPACE -%}
40 namespace {{ item }} {
41{%- endfor %}
42
43 class {{CLASSNAME}};
44
45{% for item in NAMESPACE -%}
46 }
47{%- endfor %}
48
49
50{{INCLUDES}}
51
52
53
54struct {{NAMESPACE | join("::")}}::{{CLASSNAME}} {
55 private:
56 #if Parallel
57 static MPI_Datatype Datatype;
58 #endif
59
60 #if PeanoDebug>=1
63 #endif
64
75 std::shared_ptr< {{FLOAT_TYPE}}[] > _dataSmartPointer;
76 public:
77 typedef {{FLOAT_TYPE}} DoFType;
78
82 enum ObjectConstruction {
83 NoData
84 };
85
86 #if Dimensions==2
87 static constexpr int Cardinality = {{CARDINALITY_2D}};
88 #else
89 static constexpr int Cardinality = {{CARDINALITY_3D}};
90 #endif
91
92 #if PeanoDebug>=1
93 void setDebugX( const tarch::la::Vector<Dimensions,double>& data );
94 void setDebugH( const tarch::la::Vector<Dimensions,double>& data );
97 #endif
98
106 {{FLOAT_TYPE}}* value;
107
136 {{CLASSNAME}}();
137
146 {{CLASSNAME}}( ObjectConstruction );
147
152 ~{{CLASSNAME}}() = default;
153
167 {{CLASSNAME}}(const {{CLASSNAME}}& other);
168
190 void clone(const {{CLASSNAME}}& other);
191
196 #if not defined(GPUOffloadingOff)
197 void reallocateOnDevice(int deviceNumber);
198 #endif
199
200 std::shared_ptr< {{FLOAT_TYPE}}[] > getSmartPointer() const;
201
205 {{CLASSNAME}}& operator=(const {{CLASSNAME}}& other);
206
207 std::string toString() const;
208
209 {% if DATA_ASSOCIATION == 1 -%}
210 void merge(peano4::grid::TraversalObserver::SendReceiveContext context, const {{CLASSNAME}}& neighbour, const peano4::datamanagement::VertexMarker& marker, int spacetreeId);
211 bool send(
213 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
214 ) const;
215 bool receiveAndMerge(
217 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
218 ) const;
219 static ::peano4::grid::LoadStoreComputeFlag loadStoreComputeFlag(
221 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
222 );
223 {% endif -%}
224
225 {% if DATA_ASSOCIATION == 2 -%}
226 void merge(peano4::grid::TraversalObserver::SendReceiveContext context, const {{CLASSNAME}}& neighbour, const peano4::datamanagement::FaceMarker& marker, int spacetreeId);
227 bool send(
229 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
230 ) const;
231 bool receiveAndMerge(
233 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
234 ) const;
235 static ::peano4::grid::LoadStoreComputeFlag loadStoreComputeFlag(
237 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
238 );
239 {% endif -%}
240
241 {% if DATA_ASSOCIATION == 3 -%}
242 void merge(peano4::grid::TraversalObserver::SendReceiveContext context, const {{CLASSNAME}}& neighbour, const peano4::datamanagement::CellMarker& marker, int spacetreeId);
243 bool send(
245 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
246 ) const;
247 bool receiveAndMerge(
249 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
250 ) const;
251 static ::peano4::grid::LoadStoreComputeFlag loadStoreComputeFlag(
253 {% for arg in ADDITIONAL_LOAD_STORE_ARGUMENTS %}, const {{arg[1]}}& {{arg[2]}} {% endfor %}
254 );
255 {% endif -%}
256
262 tarch::la::Vector< Cardinality, {{FLOAT_TYPE}} > get() const;
263
264 {{FLOAT_TYPE}} get(int index) const;
265
270 void set( const tarch::la::Vector< Cardinality, {{FLOAT_TYPE}} >& );
271
272 void set(int index, {{FLOAT_TYPE}} value);
273
274 #ifdef Parallel
278 static void initDatatype();
279
283 static void shutdownDatatype();
284
289 static MPI_Datatype getForkDatatype();
290 static MPI_Datatype getJoinDatatype();
291 static MPI_Datatype getBoundaryExchangeDatatype();
292 static MPI_Datatype getMultiscaleDataExchangeDatatype();
293 static MPI_Datatype getGlobalCommunciationDatatype();
294 #endif
295};
296
std::string toString(exahype2::RefinementCommand value)
SendReceiveContext
There are three different scenarios when we merge data:
std::vector< GridControlEvent > merge(std::vector< GridControlEvent > events, const double Tolerance=0.1)
Merge set of refinement/coarsening commands.
Provide information about selected face.
Definition FaceMarker.h:35
Vertex marker to provide information about selected vertex.
Simple vector class.
Definition Vector.h:159