Peano 4
Loading...
Searching...
No Matches
InsertParticlesAlongCartesianGrid.py
Go to the documentation of this file.
1# This file is part of the Swift2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
4
5
8):
10 self,
11 particle_set,
12 distance_between_particles_along_one_axis,
13 initialisation_call,
14 additional_includes="",
15 ):
16 """!
17
18 Wrapper around toolbox tying it to Swift's global properties
19
20 Very simplistic wrapper around generic factory mechanism from
21 the toolbox. The script adds references to DomainOffset[2] and
22 DomainSize[2] for example which are defined in Constants.h. This
23 constants file is something that's specific to Swift and not to
24 the particles toolbox.
25
26 We do not care at this point, if entries like DomainOffset[2]
27 do exist, i.e. if we run a 3d simulation. These are just inserted
28 into the generated C++ code which then in turn masks entries like
29 DomainSize[2] out if we work with Dimensions==2.
30
31 """
32 super(InsertParticlesAlongCartesianGrid, self).__init__(
33 particle_set=particle_set,
34 distance_between_particles=distance_between_particles_along_one_axis,
35 initialisation_call=initialisation_call,
36 noise=False,
37 computational_domain_offset=[
38 "DomainOffset[0]",
39 "DomainOffset[1]",
40 "DomainOffset[2]",
41 ],
42 computational_domain_size=[
43 "DomainSize[0]",
44 "DomainSize[1]",
45 "DomainSize[2]",
46 ],
47 additional_includes=additional_includes
48 + """
49#include "Constants.h"
50""",
51 )
52
54 return __name__.replace(".py", "").replace(".", "_")
__init__(self, particle_set, distance_between_particles_along_one_axis, initialisation_call, additional_includes="")
Wrapper around toolbox tying it to Swift's global properties.