Peano
Loading...
Searching...
No Matches
TracingAPI.h
Go to the documentation of this file.
1// This file is part of the Peano 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 "tarch/la/Vector.h"
7
8namespace toolbox {
9 namespace particles {
41 namespace assignmentchecks {
42
46 std::string sweepHistory();
47
53 void startMeshSweep(const std::string& meshSweepName);
54
63 const std::string& particleName,
65 const int particleID,
66 bool isLocal,
69 int treeId,
70 const std::string& trace
71 );
72
97 const std::string& particleName,
98 const tarch::la::Vector<Dimensions, double>& oldParticleX,
99 const tarch::la::Vector<Dimensions, double>& newParticleX,
100 const int particleID,
103 int treeId,
104 const std::string& trace
105 );
106
225 const std::string& particleName,
227 const int particleID,
228 bool isLocal,
231 int treeId,
232 const std::string& trace,
233 const tarch::la::Vector<Dimensions, double>& prevVertexX,
234 const tarch::la::Vector<Dimensions, double>& prevVertexH,
235 bool particleIsNew = false,
236 bool reassignmentOnSameTreeDepthAllowed = false
237 );
238
239
248 const std::string& particleName,
250 const int particleID,
251 bool isLocal,
254 int treeId,
255 const std::string& trace
256 );
257
266 const std::string& particleName,
268 const int particleID,
269 bool isLocal,
272 int treeId,
273 const std::string& trace
274 );
275
289 template <typename Particle> std::string pruneTypeName() {
290 std::string result = typeid(Particle).name();
291 std::size_t lastDigit = result.find_last_of("0123456789");
292 if (lastDigit != std::string::npos) {
293 result = result.substr(lastDigit + 1);
294 }
295 assertion2(result.size() > 1, typeid(Particle).name(), result);
296 return result.size() > 1 ? result.substr(0, result.size() - 1) : result;
297 }
298
321
331
333
337 template <typename ParticleContainer>
338 std::vector<ParticlePosition> recordParticlePositions(
339 const ParticleContainer& container
340 );
341
367 template <typename ParticleContainer>
369 const ParticleContainer& container,
370 const std::vector<ParticlePosition>& recordedPositions,
373 int spacetreeId
374 );
375
376 } // namespace assignmentchecks
377 } // namespace particles
378} // namespace toolbox
379
380
381#include "TracingAPI.cpph"
#define assertion2(expr, param0, param1)
void assignParticleToVertex(const std::string &particleName, const tarch::la::Vector< Dimensions, double > &particleX, const int particleID, bool isLocal, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int treeId, const std::string &trace, const tarch::la::Vector< Dimensions, double > &prevVertexX, const tarch::la::Vector< Dimensions, double > &prevVertexH, bool particleIsNew=false, bool reassignmentOnSameTreeDepthAllowed=false)
Assign a particle to a vertex.
std::string sweepHistory()
Get the history of stored sweeps.
void detachParticleFromVertex(const std::string &particleName, const tarch::la::Vector< Dimensions, double > &particleX, const int particleID, bool isLocal, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int treeId, const std::string &trace)
Remove particle from vertex.
void eliminateExistingParticles()
Eliminate existing particles, so only those that are "forgotten" remain.
void assignParticleToSieveSet(const std::string &particleName, const tarch::la::Vector< Dimensions, double > &particleX, const int particleID, bool isLocal, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int treeId, const std::string &trace)
Assign a particle to a sieve set.
std::string pruneTypeName()
Find out particle name.
Definition TracingAPI.h:289
std::vector< ParticlePosition > recordParticlePositions(const ParticleContainer &container)
Record the current particle positions in a vector.
void ensureDatabaseIsEmpty()
Ensure that database is empty.
void moveParticle(const std::string &particleName, const tarch::la::Vector< Dimensions, double > &oldParticleX, const tarch::la::Vector< Dimensions, double > &newParticleX, const int particleID, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int treeId, const std::string &trace)
Record the movement of a particle.
void eraseParticle(const std::string &particleName, const tarch::la::Vector< Dimensions, double > &particleX, const int particleID, bool isLocal, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int treeId, const std::string &trace)
Log that a particle is erased.
void traceParticleMovements(const ParticleContainer &container, const std::vector< ParticlePosition > &recordedPositions, const tarch::la::Vector< Dimensions, double > &vertexX, const tarch::la::Vector< Dimensions, double > &vertexH, int spacetreeId)
Trace the particle movements.
void startMeshSweep(const std::string &meshSweepName)
Inform API that this is the end of a grid run-throuch.
Simple vector class.
Definition Vector.h:159