Peano
Loading...
Searching...
No Matches
ParticleSet_MemoryPool.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#include <list>
11
12#include "tarch/logging/Log.h"
13#include "tarch/la/Vector.h"
14#include "tarch/mpi/mpi.h"
15
19
23
24// Template: python/peano4/toolbox/particles/ParticleSet_MemoryPool.template.h
25
26{% for item in NAMESPACE -%}
27 {% if not loop.last %}
28 namespace {{ item }} {
29 {% endif %}
30{%- endfor %}
31
32 namespace globaldata {
33 class {{PARTICLE_TYPE}};
34 }
35{% for item in NAMESPACE -%}
36 {% if not loop.last %}
37 }
38 {% endif %}
39{%- endfor %}
40
41
42
43{% for item in NAMESPACE -%}
44 namespace {{ item }} {
45{%- endfor %}
46
47
48 class {{CLASSNAME}}: public toolbox::particles::ParticleSet< {% for item in NAMESPACE -%}{% if not loop.last %}{{ item }}::{% endif %}{%- endfor %}globaldata::{{PARTICLE_TYPE}} >
49 {
50 public:
51 using Base = toolbox::particles::ParticleSet< {% for item in NAMESPACE -%}{% if not loop.last %}{{ item }}::{% endif %}{%- endfor %}globaldata::{{PARTICLE_TYPE}} >;
52 using MemoryPool = {{MEMORY_POOL_TYPE}}< {% for item in NAMESPACE -%}{% if not loop.last %}{{ item }}::{% endif %}{%- endfor %}globaldata::{{PARTICLE_TYPE}} >;
53
59 typedef MemoryPool::Container Container;
60
64 typedef typename Container::value_type value_type;
65 typedef typename Container::iterator iterator;
66 typedef typename Container::const_iterator const_iterator;
67
68 {{CLASSNAME}}() = default;
69
70
71 enum ObjectConstruction {
72 NoData
73 };
74
75 {{CLASSNAME}}( ObjectConstruction ):
76 {{CLASSNAME}}() {}
77
88 {{CLASSNAME}}( const {{CLASSNAME}}& ) = default;
89
101 void merge(::peano4::grid::TraversalObserver::SendReceiveContext context, {{CLASSNAME}}& neighbour, const peano4::datamanagement::VertexMarker& marker, int spacetreeId);
102
103 static bool send(const peano4::datamanagement::VertexMarker& marker);
104 static bool receiveAndMerge(const peano4::datamanagement::VertexMarker& marker);
105 static ::peano4::grid::LoadStoreComputeFlag loadStoreComputeFlag(const peano4::datamanagement::VertexMarker& marker);
106
119 void clone( const {{CLASSNAME}}& otherSet );
120
121 std::string toString() const;
122
132 void particlesCanNotBeLiftedLocally();
133
152 void clear();
153
160 Container::iterator particleCanNotBeLiftedLocally( const Container::iterator& particle );
161
162 void particlesCanNotBeDroppedLocallySoRollOverForNextMeshSweep(DoFType* particle);
163
170 void deleteParticles();
171
182 Container::iterator begin();
183 Container::iterator end();
184 Container::const_iterator begin() const;
185 Container::const_iterator end() const;
186 int size() const;
187 bool empty() const;
188
204 void addParticle(DoFType* particle);
205
213 bool isValid() const;
214
220 void grabParticles({{CLASSNAME}}& sourceParticleSet);
221
234 Container::iterator grabParticle(
235 Container::iterator particle,
236 {{CLASSNAME}}& sourceParticleSet
237 );
238
259 Container::iterator deleteParticle( Container::iterator particle );
260
268 void gather();
269
277 void scatter();
278
285 bool isGathered() const;
286
303 void mergeWithParticle(
304 DoFType* neighbourParticle,
306 int spacetreeId
307 );
308 private:
310
311 MemoryPool _memoryPool;
312};
313
314{% for item in NAMESPACE -%}
315}
316{%- endfor %}
317
318
std::string toString(exahype2::RefinementCommand value)
SendReceiveContext
There are three different scenarios when we merge data:
Log Device.
Definition Log.h:517
Abstract base class for all flavours of particle sets.
Definition ParticleSet.h:66
bool isValid(Invariant policy, bool workOnParticle, bool particleIsLocal, int numberOfUpdates, int numberOfMaskOuts)
Is current state that's to be updated valid.
void clear(GridStatistics &statistics, bool isGlobalMasterTree)
The term clear() is not 100% correct, as the number of stationary traversals is not reset to a dummy ...
std::vector< GridControlEvent > merge(std::vector< GridControlEvent > events, const double Tolerance=0.1)
Merge set of refinement/coarsening commands.
bool empty() const
True if at least one dimension is empty.
Vertex marker to provide information about selected vertex.