13 distance_between_particles,
14 computational_domain_offset,
15 computational_domain_size,
16 initialisation_call="",
18 additional_includes="",
28 I take this as particle set.
30 average_distance_between_particles: Float
31 Some positive floating point value.
33 initialisation_call: String (C code)
34 Within this code snippet, you have a variable particle which is a pointer to
35 your particle type. You can use it to set the particle attributes.
37 computational_domain_offset: [Float]
38 Has to be an array with Dimensions entries that specifies the global domain
39 offset. You can pass in an array of floats, and this is definitely the
40 default use case. However, you can also pass in an arbitrary array of
41 strings, as long as these strings make sense in the generated C++ code
42 and eventually return a double each.
44 computational_domain_size: [Float]
45 Defines size of domain.
47 guard: String (C code)
48 A simple boolean expression. You can decide if a particle is inserted or not.
50 initialisation_call: String (C++ code snippet)
51 Arbitrary code snippet which can work over a pointer particle. The object
52 to which this pointer points to is properly allocated, and its
53 coordinates are set. Furthermore, the object's search radius is
54 initialised with zero. You can alter the particle attributes now, i.e.
55 initialise the domain-specific data. Please also ensure you assign the
56 particle a proper search (interaction) radius if the radius is of
57 relevance for your application.
59 Please note that we create a lot of particles and then decide if we
60 actually insert them. Only those particles where we come to the
61 conclusion that we should insert them (as they overlap with the cell)
62 are actually then initialised through this code snippet.
65 super(InsertParticlesAlongCartesianLayoutIntoUnrefinedCells, self).
__init__(
66 descend_invocation_order=1, parallel=
False
70 self.
d[
"PARTICLE"] = particle_set.particle_model.name
71 self.
d[
"PARTICLES_CONTAINER"] = particle_set.name
72 self.
d[
"INITIALISATION_CALL"] = initialisation_call
73 self.
d[
"DOMAIN_OFFSET"] = computational_domain_offset
74 self.
d[
"DOMAIN_SIZE"] = computational_domain_size
75 self.
d[
"H"] = distance_between_particles
76 self.
d[
"GUARD"] = guard
78 self.
d[
"NOISE"] =
"true"
80 self.
d[
"NOISE"] =
"false"