OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
DirichletPlaneWriter Class Reference

Writes dirichlet-plane potential snapshots to ASCII files. More...

#include <DirichletPlaneWriter.h>

Collaboration diagram for DirichletPlaneWriter:
Collaboration graph

Classes

struct  PlaneDiagnostics
 

Public Member Functions

 DirichletPlaneWriter (const std::string &outputDirectory)
 Create a writer that emits files into outputDirectory.
 
void writePlane (long long step, double time, double zPlane, const std::vector< double > &xCoords, const std::vector< double > &yCoords, const std::vector< double > &phiValues, std::size_t nx, std::size_t ny, const std::string &solveTag)
 Write one plane snapshot.
 
template<typename FieldType >
PlaneDiagnostics dumpInterpolatedPlane (long long step, double time, double zPlane, const FieldType &field, const std::string &solveTag)
 Interpolate a z-plane from a 3D field on device and write it to disk.
 

Private Attributes

std::filesystem::path outputDirectory_m
 

Detailed Description

Writes dirichlet-plane potential snapshots to ASCII files.

One file is generated per dump call inside a configured output directory. Each file stores metadata and one row per sampled (x, y) point.

Definition at line 39 of file DirichletPlaneWriter.h.


Class Documentation

◆ DirichletPlaneWriter::PlaneDiagnostics

struct DirichletPlaneWriter::PlaneDiagnostics

Definition at line 41 of file DirichletPlaneWriter.h.

Collaboration diagram for DirichletPlaneWriter::PlaneDiagnostics:
Collaboration graph
Class Members
double mean = 0.0
size_t sampleCount = 0
double variance = 0.0

Constructor & Destructor Documentation

◆ DirichletPlaneWriter()

DirichletPlaneWriter::DirichletPlaneWriter ( const std::string &  outputDirectory)
explicit

Create a writer that emits files into outputDirectory.

Definition at line 29 of file DirichletPlaneWriter.cpp.

References outputDirectory_m.

Member Function Documentation

◆ dumpInterpolatedPlane()

template<typename FieldType >
DirichletPlaneWriter::PlaneDiagnostics DirichletPlaneWriter::dumpInterpolatedPlane ( long long  step,
double  time,
double  zPlane,
const FieldType &  field,
const std::string &  solveTag 
)

Interpolate a z-plane from a 3D field on device and write it to disk.

The interpolation follows IPPL's cell-centered convention used by scatter/gather, i.e. cell center coordinates are origin + (i + 0.5) * dx.

Template Parameters
FieldTypeIPPL field type with getView(), getLayout(), getNghost(), and mesh accessors.
Parameters
stepGlobal tracking step.
timeAbsolute simulation time (seconds).
zPlanePhysical z position to sample (meters).
fieldInput scalar field to interpolate from.
solveTagLabel for output file naming.
Returns
Mean/variance statistics of the sampled plane.

Definition at line 82 of file DirichletPlaneWriter.h.

References DirichletPlaneWriter::PlaneDiagnostics::mean, DirichletPlaneWriter::PlaneDiagnostics::sampleCount, DirichletPlaneWriter::PlaneDiagnostics::variance, and writePlane().

Here is the call graph for this function:

◆ writePlane()

void DirichletPlaneWriter::writePlane ( long long  step,
double  time,
double  zPlane,
const std::vector< double > &  xCoords,
const std::vector< double > &  yCoords,
const std::vector< double > &  phiValues,
std::size_t  nx,
std::size_t  ny,
const std::string &  solveTag 
)

Write one plane snapshot.

Definition at line 45 of file DirichletPlaneWriter.cpp.

References outputDirectory_m.

Referenced by dumpInterpolatedPlane(), TEST_F(), and TEST_F().

Member Data Documentation

◆ outputDirectory_m

std::filesystem::path DirichletPlaneWriter::outputDirectory_m
private

Definition at line 78 of file DirichletPlaneWriter.h.

Referenced by DirichletPlaneWriter(), and writePlane().


The documentation for this class was generated from the following files: