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