[CIG-MC] When should particles be generated?
gassmoeller at math.tamu.edu
Fri Jan 15 08:43:31 PST 2016
The function in the particle generator interface you mentioned does only
control 'how' the particles are generated, but not 'when', so for your
purpose you would need to think about when this function is called, and
not what is in that function.
When updating the particle code we did not specifically consider the
case of creating particles at a later model time than the beginning.
However, the generation of the particles is really only initiated by the
function Tracers::generate_and_initialize_particles() in
source/postprocess/tracers.cc:58. Therefore, for a quick hack you could
consider commenting the line which currently calls this function
(source/simulator/initial_conditions.cc:183-184), and put it in a place,
where you can check your conditions for tracer generation at every
timestep, e.g. when doing postprocessing of the tracers (e.g.
If others consider this a feature worth including in the main version,
we should do it in a less intrusive way. An option that comes to mind is
to run your model without tracers until your condition is matched
(checked by the termination criteria), write a checkpoint at that time,
and restart it with activated tracers. The only missing piece for this
would be an input parameter switch that would be called something like
"Generate and initialize particles on restart", and would be false by
default. This could be added to the list of tracer input parameters
(Tracers::declare_parameters, and Tracers::parse_parameters). If this
option is set, you could add the call of
generate_and_initialize_particles() to the Tracers::load() function that
controls the restart from a checkpoint.
In case you would like to discuss specifics about the implementation, I
would suggest to move this discussion to the ASPECT developer mailing
list (aspect-devel at geodynamics.org).
On 01/13/2016 07:45 PM, Harsha Lokavarapu wrote:
> With the new particle post-processing upgrade to ASPECT, I am working on a plugin that attempts to control when particles are generated during run time.
> There are two possible ideas that I am considering. Particles are placed:
> - at a specific user defined time step
> - or, if the derivative of the heat flux with respect to time across all of the boundary surfaces is less than a, user defined, tolerance level.
> The aspect/particle/generator/interface.h contains the function
> virtual void generate_particles(…)
> which is implemented by multiple child classes. I am working on a proof of concept specifically for one child class, uniform_radial, at the moment. However, is it programmatically possible to generalize the solution to all child classes using some form of C++ magic (without source code modification)?
> CIG-MC mailing list
> CIG-MC at geodynamics.org
More information about the CIG-MC