OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TestLossDataSink.cpp File Reference

Unit tests for LossDataSink statistics and bookkeeping. More...

#include <gtest/gtest.h>
#include "Ippl.h"
#include <cmath>
#include <cstddef>
#include <utility>
#include <vector>
#include "Structure/LossDataSink.h"
#include "Utilities/GeneralOpalException.h"
#include "Utilities/Options.h"
Include dependency graph for TestLossDataSink.cpp:

Go to the source code of this file.

Macros

#define private   public
 

Detailed Description

Unit tests for LossDataSink statistics and bookkeeping.

This test suite validates the core behavior of LossDataSink using:

  • small deterministic OpalParticle samples
  • direct access to internal bookkeeping where needed
  • a single-rank initialized IPPL/MPI environment

Coverage

  1. Particle bookkeeping
    • plain particles and turn/bunch particles cannot be mixed
    • inconsistent turn/bunch information is rejected
  2. Basic statistics
    • total particle count
    • centroids in position and momentum
    • RMS position and momentum
    • total charge and total mass
  3. Time statistics
    • mean particle time
    • RMS particle time
  4. Spatial extent statistics
    • rmin / rmax are computed correctly
    • maxR uses the maximum absolute position extent
  5. Energy statistics
    • mean kinetic energy is computed from particle momentum and mass
    • kinetic-energy RMS is stable for identical particle energies
  6. Set splitting
    • splitSets() clears stale state
    • split boundaries are monotonic
    • split boundaries cover all local particles

Notes

  • Options::computePercentiles is disabled in the fixture so these tests focus on the core LossDataSink statistics and do not depend on percentile histogram behavior.
  • The tests initialize IPPL in SetUpTestSuite(), because LossDataSink uses ippl::Comm reductions and barriers even in single-rank unit tests.
  • The private/public macro is used only to test internal set-splitting state and other bookkeeping that is not exposed through the public interface.

Definition in file TestLossDataSink.cpp.

Macro Definition Documentation

◆ private

#define private   public

Definition at line 65 of file TestLossDataSink.cpp.