Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
bbc7e78
Base structure for scientific defaults
franzpoeschel Jan 12, 2026
2c10afc
Start adding defaults
franzpoeschel Jan 12, 2026
a84c715
debugging output
franzpoeschel Jan 12, 2026
09805c6
Fixes
franzpoeschel Jan 12, 2026
965fcad
BaseRecord --> unitDimension
franzpoeschel Jan 12, 2026
47dd320
nunja hehe
franzpoeschel Jan 12, 2026
7f49637
Fixes
franzpoeschel Jan 12, 2026
5d68a68
Further fixes
franzpoeschel Jan 13, 2026
0735fdd
further fixes
franzpoeschel Jan 13, 2026
d861aba
tests temporarily passing :D
franzpoeschel Jan 13, 2026
83c9c76
Cleanup
franzpoeschel Jan 13, 2026
a4d163d
UnitDimension for position/positionOffset
franzpoeschel Jan 13, 2026
1cd7c0d
WIP: RecordComponent stuff
franzpoeschel Jan 13, 2026
615a00d
Fix coretests
franzpoeschel Jan 14, 2026
a3bcd7d
Clean up Iteration finalizing logic
franzpoeschel Jan 14, 2026
f027f5b
Add defaults for Iteration class
franzpoeschel Jan 14, 2026
a469f94
Fix variadic template template parameters
franzpoeschel Jan 15, 2026
24de416
Remove flush-time check for populized components
franzpoeschel Jan 16, 2026
61abebd
Make the default specification more flexible
franzpoeschel Jan 16, 2026
17be0a7
WIP
franzpoeschel Jan 20, 2026
aed4574
continue
franzpoeschel Jan 20, 2026
105a09b
Split this into internal and public header
franzpoeschel Jan 21, 2026
d397399
Distinguish writing from reading
franzpoeschel Jan 21, 2026
a681895
Tests now working again
franzpoeschel Jan 21, 2026
6b50b2d
Mostly move Mesh reading to ScientificDefaults
franzpoeschel Jan 21, 2026
4dae283
Fix type conversions between char and string
franzpoeschel Jan 21, 2026
1ffc588
Somewhat working Mesh reading
franzpoeschel Jan 21, 2026
aa5407d
Fix little parent call bug
franzpoeschel Jan 22, 2026
1a6f171
Mention expected datatypes in attribute reading error messages
franzpoeschel Jan 22, 2026
1091274
Move Iteration reading to ScientificDefaults class
franzpoeschel Jan 22, 2026
068e019
Introduce genericsetter, use for unitDimension
franzpoeschel Jan 22, 2026
2e9efae
Record / BaseRecord Reading
franzpoeschel Jan 22, 2026
3c63b16
Readers for everything now except version-dependent stuff
franzpoeschel Jan 22, 2026
ffa9304
Add gridUnitDimension in ScientificDefaults
franzpoeschel Jan 23, 2026
b7a7849
Do not use templates for defaults setter
franzpoeschel Jan 26, 2026
bfe954f
Wew NewAttributeReader
franzpoeschel Jan 27, 2026
5c4cff0
Fixes
franzpoeschel Jan 27, 2026
b01d16b
Fixes
franzpoeschel Jan 27, 2026
5c27f43
Defaults for patchRecord
franzpoeschel Jan 27, 2026
ed4473c
Adapt PatchRecordComponent
franzpoeschel Jan 27, 2026
df14a37
Fixes
franzpoeschel Jan 27, 2026
0d3664b
Cleanup
franzpoeschel Jan 28, 2026
59e1eaa
Cleanup
franzpoeschel Jan 28, 2026
d3c7a5b
Avoid overcomplex attribute type conversions
franzpoeschel Jan 28, 2026
c720b59
reduce binary size a bit
franzpoeschel Jan 28, 2026
75c697e
Try further reducing amount of lambdas...
franzpoeschel Jan 28, 2026
f235b68
Annotate MB sizes
franzpoeschel Jan 28, 2026
3ac1455
Reduce implementation sizes for RequireScalar / RequireVector
franzpoeschel Jan 29, 2026
210e286
vibe-coded suggestions for size optimization
franzpoeschel Jan 29, 2026
78018fa
Avoid using lambdas for require_type
franzpoeschel Jan 29, 2026
8ace899
Change code order
franzpoeschel Jan 29, 2026
a222056
Replace if constexpr with SFINAE
franzpoeschel Jan 30, 2026
8200e23
Fix nvhpc/msvc builds
franzpoeschel Jan 30, 2026
f5750fb
doxygen fix
franzpoeschel Feb 2, 2026
54d58ef
Cleanup
franzpoeschel Feb 4, 2026
7bb30c2
scientificdefaults_internal.cpp
franzpoeschel Feb 24, 2026
fc35899
Add visitor pattern
franzpoeschel Feb 24, 2026
4e41fdf
wip: ScientificDefaults without CRT
franzpoeschel Feb 24, 2026
8153d1f
Move defaults impl to classes
franzpoeschel Feb 24, 2026
7cd0031
Fix visitHierarchy
franzpoeschel Feb 24, 2026
04821d8
Fix visithierarchy
franzpoeschel Feb 24, 2026
02cf91c
Compiles
franzpoeschel Feb 24, 2026
895fb50
Fix inheritance issue
franzpoeschel Feb 25, 2026
35ec8ae
Cleanup
franzpoeschel Mar 3, 2026
3502c46
Move files
franzpoeschel Mar 3, 2026
4bb6d5c
Split files
franzpoeschel Mar 3, 2026
eb385ed
Cleanup, documentation
franzpoeschel Mar 3, 2026
07d1096
Fix JSON backend bug when missing attributes
franzpoeschel Mar 3, 2026
a00d87e
Fix bug with metadata set too late
franzpoeschel Mar 20, 2026
867ee9a
Write defaults upon flush, thats good enough actually
franzpoeschel Mar 25, 2026
23e378d
... wip visitor without templates ...
franzpoeschel Mar 20, 2026
8f55bfe
somewhat compiles
franzpoeschel Mar 20, 2026
0e47c03
Clean up visitHierarchy API
franzpoeschel Mar 20, 2026
48d4465
Further cleanup
franzpoeschel Mar 20, 2026
14740bf
Implement lambda visitor in terms of explicit visitor
franzpoeschel Mar 20, 2026
110abeb
Fix Python bindings
franzpoeschel Mar 20, 2026
8c34387
populateDefaultMetadata -> commitStructuralSetup
franzpoeschel Mar 25, 2026
a432bd6
Cleanup
franzpoeschel Mar 25, 2026
ac59e11
Documentation
franzpoeschel Mar 25, 2026
2c60cae
Postfix traversal, document visitHierarchy
franzpoeschel Mar 25, 2026
5ec174b
commitStructuralSetup --> populateMissingMetadata(bool recursive)
franzpoeschel Apr 7, 2026
afcf608
CI fixes
franzpoeschel Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ set(CORE_SOURCE
src/backend/PatchRecord.cpp
src/backend/PatchRecordComponent.cpp
src/backend/Writable.cpp
src/backend/scientific_defaults/ScientificDefaults.cpp
src/backend/scientific_defaults/ScientificDefaults_auxiliary.cpp
src/backend/scientific_defaults/ProcessParsedAttribute.cpp
src/backend/scientific_defaults/AttributeReader.cpp
src/backend/scientific_defaults/ConfigAttribute.cpp
src/auxiliary/OneDimensionalBlockSlicer.cpp
src/helper/list_series.cpp
src/snapshots/ContainerImpls.cpp
Expand Down
38 changes: 34 additions & 4 deletions include/openPMD/Iteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "openPMD/auxiliary/Variant.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <cstdint>
#include <deque>
Expand Down Expand Up @@ -145,13 +147,28 @@ namespace internal
std::optional<DeferredParseAccess> m_deferredParseAccess{};
};
} // namespace internal

class Meshes : public Container<Mesh>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};

class Particles : public Container<ParticleSpecies>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};

/** @brief Logical compilation of data from one snapshot (e.g. a single
* simulation cycle).
*
* @see
* https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#required-attributes-for-the-basepath
*/
class Iteration : public Attributable
class Iteration
: public Attributable
, internal::ScientificDefaults
{
template <typename T, typename T_key, typename T_container>
friend class Container;
Expand All @@ -164,6 +181,8 @@ class Iteration : public Attributable
friend class StatefulSnapshotsContainer;
template <typename>
friend struct traits::GenerationPolicy;
friend class internal::ScientificDefaults;
friend class Attributable;

public:
Iteration(Iteration const &) = default;
Expand Down Expand Up @@ -279,8 +298,10 @@ class Iteration : public Attributable
[[deprecated("This attribute is no longer set by the openPMD-api.")]] bool
closedByWriter() const;

Container<Mesh> meshes{};
Container<ParticleSpecies> particles{}; // particleSpecies?
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

Meshes meshes{};
Particles particles{};

virtual ~Iteration() = default;

Expand Down Expand Up @@ -442,14 +463,17 @@ class Iteration : public Attributable
*
* @param w The Writable representing the parent.
*/
virtual void linkHierarchy(Writable &w);
void linkHierarchy(Writable &w) override;

/**
* @brief Access an iteration in read mode that has potentially not been
* parsed yet.
*
*/
void runDeferredParseAccess();

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
}; // Iteration

namespace traits
Expand Down Expand Up @@ -513,4 +537,10 @@ class IndexedIteration : public Iteration
: Iteration(std::forward<Iteration_t>(it)), iterationIndex(index)
{}
};

class Iterations : public Container<Iteration, Iteration::IterationIndex_t>
{
public:
void visitHierarchy(HierarchyVisitor &v, bool recursive) override;
};
} // namespace openPMD
10 changes: 10 additions & 0 deletions include/openPMD/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "openPMD/UnitDimension.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/BaseRecord.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/MeshRecordComponent.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <ostream>
#include <string>
Expand All @@ -41,6 +43,8 @@ class Mesh : public BaseRecord<MeshRecordComponent>
{
friend class Container<Mesh>;
friend class Iteration;
friend class internal::ScientificDefaults;
friend class Attributable;

public:
Mesh(Mesh const &) = default;
Expand Down Expand Up @@ -322,12 +326,18 @@ class Mesh : public BaseRecord<MeshRecordComponent>
typename = std::enable_if_t<std::is_floating_point<T>::value>>
Mesh &setTimeOffset(T timeOffset);

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
Mesh();

void
flush_impl(std::string const &, internal::FlushParams const &) override;
void read();
auto retrieveDimensionality() const -> uint64_t;

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
}; // Mesh

template <typename T>
Expand Down
2 changes: 2 additions & 0 deletions include/openPMD/ParticlePatches.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ParticlePatches : public Container<PatchRecord>
size_t numPatches() const;
~ParticlePatches() override = default;

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
ParticlePatches() = default;
void read();
Expand Down
13 changes: 12 additions & 1 deletion include/openPMD/ParticleSpecies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,31 @@
#include "openPMD/Record.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <string>

namespace openPMD
{

class ParticleSpecies : public Container<Record>
class ParticleSpecies
: public Container<Record>
, internal::ScientificDefaults
{
friend class Container<ParticleSpecies>;
friend class Container<Record>;
friend class Iteration;
template <typename T>
friend T &internal::makeOwning(T &self, Series);
friend class internal::ScientificDefaults;
friend class Attributable;

public:
ParticlePatches particlePatches;

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
ParticleSpecies();

Expand All @@ -53,6 +61,9 @@ class ParticleSpecies : public Container<Record>
{
return m_containerData;
}

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
};

namespace traits
Expand Down
7 changes: 7 additions & 0 deletions include/openPMD/Record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "openPMD/RecordComponent.hpp"
#include "openPMD/UnitDimension.hpp"
#include "openPMD/backend/BaseRecord.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

#include <string>
#include <type_traits>
Expand All @@ -34,6 +35,7 @@ class Record : public BaseRecord<RecordComponent>
friend class Container<Record>;
friend class Iteration;
friend class ParticleSpecies;
friend class internal::ScientificDefaults;

public:
Record(Record const &) = default;
Expand All @@ -48,13 +50,18 @@ class Record : public BaseRecord<RecordComponent>
template <typename T>
Record &setTimeOffset(T);

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

private:
Record();

void
flush_impl(std::string const &, internal::FlushParams const &) override;

[[nodiscard]] internal::HomogenizeExtents read();

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
}; // Record

template <typename T>
Expand Down
17 changes: 14 additions & 3 deletions include/openPMD/RecordComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "openPMD/auxiliary/UniquePtr.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/BaseRecordComponent.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/scientific_defaults/ScientificDefaults.hpp"

// comment to prevent this include from being moved by clang-format
#include "openPMD/DatatypeMacros.hpp"
Expand Down Expand Up @@ -110,7 +112,9 @@ namespace internal
template <typename>
class BaseRecord;

class RecordComponent : public BaseRecordComponent
class RecordComponent
: public BaseRecordComponent
, protected internal::ScientificDefaults
{
template <typename T, typename T_key, typename T_container>
friend class Container;
Expand All @@ -128,6 +132,8 @@ class RecordComponent : public BaseRecordComponent
friend class MeshRecordComponent;
template <typename T>
friend T &internal::makeOwning(T &self, Series);
friend class internal::ScientificDefaults;
friend class Attributable;

public:
enum class Allocation
Expand Down Expand Up @@ -482,11 +488,13 @@ class RecordComponent : public BaseRecordComponent
auto visit(Args &&...args) -> decltype(Visitor::template call<char>(
std::declval<RecordComponent &>(), std::forward<Args>(args)...));

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

static constexpr char const *const SCALAR = "\vScalar";

protected:
void flush(std::string const &, internal::FlushParams const &);
void read(bool require_unit_si);
void read();

private:
/**
Expand Down Expand Up @@ -534,12 +542,15 @@ OPENPMD_protected
BaseRecordComponent::setData(m_recordComponentData);
}

void readBase(bool require_unit_si);
void readBase();

template <typename T>
void verifyChunk(Offset const &, Extent const &) const;

void verifyChunk(Datatype, Offset const &, Extent const &) const;

protected:
void scientificDefaults_impl(bool write, OpenpmdStandard) override;
}; // RecordComponent

namespace internal
Expand Down
10 changes: 6 additions & 4 deletions include/openPMD/Series.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "openPMD/auxiliary/Variant.hpp"
#include "openPMD/backend/Attributable.hpp"
#include "openPMD/backend/Container.hpp"
#include "openPMD/backend/HierarchyVisitor.hpp"
#include "openPMD/backend/ParsePreference.hpp"
#include "openPMD/config.hpp"
#include "openPMD/snapshots/Snapshots.hpp"
Expand Down Expand Up @@ -64,7 +65,6 @@ namespace openPMD
class ReadIterations;
class StatefulIterator;
class Series;
class Series;

namespace internal
{
Expand Down Expand Up @@ -100,8 +100,8 @@ namespace internal
SeriesData &operator=(SeriesData &&) = delete;

using IterationIndex_t = Iteration::IterationIndex_t;
using IterationsContainer_t = Container<Iteration, IterationIndex_t>;
IterationsContainer_t iterations{};
using IterationsContainer_t = Iterations;
Iterations iterations{};

/**
* Series::readIterations() returns an iterator type that modifies the
Expand Down Expand Up @@ -385,7 +385,7 @@ class Series : public Attributable
* Type for a container of Iterations indexed by IterationIndex_t.
*/
using IterationsContainer_t = internal::SeriesData::IterationsContainer_t;
IterationsContainer_t iterations;
Iterations iterations;

/**
* @brief Is this a usable Series object?
Expand Down Expand Up @@ -778,6 +778,8 @@ class Series : public Attributable
*/
void close();

void visitHierarchy(HierarchyVisitor &v, bool recursive) override;

/**
* This overrides Attributable::iterationFlush() which will fail on Series.
*/
Expand Down
Loading
Loading