Peano
Loading...
Searching...
No Matches
InsertParticlesAlongCartesianMesh.py
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
3from peano4.api.solversteps.ActionSet import ActionSet
4
5import jinja2
6
8
9
10
12 """
13
14 Basically superclass, though we add these numbers.
15
16 """
17
18
19 def __init__(self,
20 particle_set,
21 distance_between_particles,
22 computational_domain_offset,
23 noise=True,
24 additional_includes="",
25 guard="true"
26 ):
27 """
28
29 See superclass
30
31 """
32 super( InsertParticlesAlongCartesianMesh,self ).__init__(self,
33 particle_set,
34 distance_between_particles,
35 computational_domain_offset,
36 f"""
37 particle->setNumber(0,_spacetreeId);
38 particle->setNumber(1,_particleNumberOnThisTree);
39 particle->setMoveState(globaldata::{particle_set.particle_model.name}::MoveState::NotMovedYet);
40
41 _particleNumberOnThisTree++;
42
43 logInfo( "touchVertexFirstTime(...)", "insert particle " << particle->getX() );
44 """, # initialisation_call,
45 noise,
46 additional_includes + """
47#include "Constants.h"
48""",
49 guard
50 )
51
52
54 return __name__.replace(".py", "").replace(".", "_")
55
56
58 return super( InsertParticlesAlongCartesianMesh ).get_constructor_body() + """
59 _particleNumberOnThisTree = 0;
60 _spacetreeId = treeNumber;
61"""
62
63
64 def get_attributes(self):
65 return super( InsertParticlesAlongCartesianMesh ).get_attributes() + """
66 int _particleNumberOnThisTree;
67 int _spacetreeId;
68"""
69
70
Default superclass for any data model in Peano which is stored within the grid.
Definition DaStGen2.py:188
Action set (reactions to events)
Definition ActionSet.py:6
get_attributes(self)
Return attributes as copied and pasted into the generated class.
__init__(self, particle_set, distance_between_particles, computational_domain_offset, noise=True, additional_includes="", guard="true")
See superclass.