Separate output from particle output frequency#298
Conversation
|
|
||
| void setupOutput() | ||
| { | ||
| if ( !inputs.contains( "output_frequency" ) ) |
There was a problem hiding this comment.
So, if not set up, we would output only the last frame?
There was a problem hiding this comment.
The line below sets the frequency to the total number of steps - so we wouldn't output at all
There was a problem hiding this comment.
I ran a case without "output_frequency" but with "particle_output_frequency" : {"value": 20}, Then, the screen output is:
Local particles: 30912, Maximum neighbors: 129
#Timestep/Total-steps Simulation-time
500/500 1.50e-04
and we get the particle outputs:
particles_0.h5 particles_0.xmf
particles_25.h5 particles_25.xmf
| "timestep" : {"value": 3.0e-7, "unit": "s"}, | ||
| "timestep_safety_factor" : {"value": 0.85}, | ||
| "output_frequency" : {"value": 200}, | ||
| "particle_output_frequency" : {"value": 400}, |
There was a problem hiding this comment.
I run a case with ""final_time" : {"value": 1.5e-4, "unit": "s"},"
When using "particle_output_frequency" : {"value": 200}, I get particles outputs:
particles_0.h5 particles_0.xmf
particles_1.h5 particles_1.xmf
particles_2.h5 particles_2.xmf
When using "particle_output_frequency" : {"value": 20},I get particle outputs:
particles_0.h5 particles_0.xmf
particles_10.h5 particles_10.xmf
particles_20.h5 particles_20.xmf
Shouldn't we get 10x more outputs?
| // Simulation run | ||
| // ==================================================== | ||
| solver.init( bc ); | ||
| solver.updateRegion( output_fx, output_fy, output_fz, output_yl, |
There was a problem hiding this comment.
Is this to output the initial condition?
| double dt = inputs["timestep"]; | ||
| double freq = inputs["output_frequency"]; | ||
| int output_steps = static_cast<int>( time / dt / freq ); | ||
| // May or may not need an extra index for the initial state. |
There was a problem hiding this comment.
Does this comment need a check?
| computeStress( force_model, *force, particles, *neighbor ); | ||
|
|
||
| particles.output( step / output_frequency, step * dt, | ||
| particles.output( step / particle_output_frequency, step * dt, |
There was a problem hiding this comment.
I believe this line should not be inside the following:
// Print output.
if ( step % output_frequency == 0 )
{
...
particles.output( step / particle_output_frequency, step * dt,
output_reference );
...
}
to allow more particle_output_frequency < output_frequency.
Particle output frequency defaults to the main output frequency, but is now separable with a new input.
Also add indexing fix to enable initial region output - could also be done inside
solver.init()