Skip to content

Separate output from particle output frequency#298

Open
streeve wants to merge 2 commits into
ORNL:mainfrom
streeve:particle_output_steps
Open

Separate output from particle output frequency#298
streeve wants to merge 2 commits into
ORNL:mainfrom
streeve:particle_output_steps

Conversation

@streeve

@streeve streeve commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

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()

@streeve streeve requested a review from pabloseleson March 6, 2026 16:14
@streeve streeve self-assigned this Mar 6, 2026
Comment thread src/CabanaPD_Input.hpp

void setupOutput()
{
if ( !inputs.contains( "output_frequency" ) )

@pabloseleson pabloseleson Mar 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if not set up, we would output only the last frame?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line below sets the frequency to the total number of steps - so we wouldn't output at all

@pabloseleson pabloseleson May 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this comment need a check?

Comment thread src/CabanaPD_Solver.hpp
computeStress( force_model, *force, particles, *neighbor );

particles.output( step / output_frequency, step * dt,
particles.output( step / particle_output_frequency, step * dt,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants