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

Smoke tests for PartBunch::computeSelfFields() with and without particle binning enabled. More...

#include <gtest/gtest.h>
#include <cmath>
#include <memory>
#include <random>
#include <string>
#include "AbstractObjects/OpalData.h"
#include "Attributes/Attributes.h"
#include "Ippl.h"
#include "PartBunch/PartBunch.h"
#include "Structure/Beam.h"
#include "Structure/BinningCmd.h"
#include "Structure/DataSink.h"
#include "Structure/FieldSolverCmd.h"
#include "Utilities/Options.h"
#include "Utility/Inform.h"
Include dependency graph for TestBinnedFieldSolver.cpp:

Go to the source code of this file.

Detailed Description

Smoke tests for PartBunch::computeSelfFields() with and without particle binning enabled.

This file validates that the self-field computation pathway is stable across the "legacy" (no binning attached) and "binned" (adaptive bins attached) execution paths.

The tests construct a small PartBunch<double,3> with a minimal FieldSolverCmd configuration (type "NONE" and periodic FFT boundary conditions), populate a set of particles with deterministic random initial conditions, and then invoke PartBunch::computeSelfFields().

Key behaviors verified:

  • computeSelfFields() does not throw for a non-binned bunch.
  • computeSelfFields() does not throw when adaptive binning is attached.
  • When using solver type "NONE", the per-particle electric field E remains finite and (near) zero after the call.
  • When binning is active, the current bin count is sane (between 1 and the configured maximum).

Notes:

  • The fixture initializes IPPL and disables HDF5 output to keep the tests lightweight.
  • The goal is a robustness/smoke check (no physics validation of non-trivial fields, since this would require way more computational resources).

Definition in file TestBinnedFieldSolver.cpp.