Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ead1538
Base structure for scientific defaults
franzpoeschel Jan 12, 2026
b47a523
Start adding defaults
franzpoeschel Jan 12, 2026
466fd6b
debugging output
franzpoeschel Jan 12, 2026
b40f72d
Fixes
franzpoeschel Jan 12, 2026
4455407
BaseRecord --> unitDimension
franzpoeschel Jan 12, 2026
6b7c067
nunja hehe
franzpoeschel Jan 12, 2026
f109fe4
Fixes
franzpoeschel Jan 12, 2026
af02f70
Further fixes
franzpoeschel Jan 13, 2026
4a6f59f
further fixes
franzpoeschel Jan 13, 2026
c324adb
tests temporarily passing :D
franzpoeschel Jan 13, 2026
5a5bb23
Cleanup
franzpoeschel Jan 13, 2026
1ab164d
UnitDimension for position/positionOffset
franzpoeschel Jan 13, 2026
78d3fe8
WIP: RecordComponent stuff
franzpoeschel Jan 13, 2026
4f0fab2
Fix coretests
franzpoeschel Jan 14, 2026
9bbf9bb
Clean up Iteration finalizing logic
franzpoeschel Jan 14, 2026
500b180
Add defaults for Iteration class
franzpoeschel Jan 14, 2026
a1ce9c6
Fix variadic template template parameters
franzpoeschel Jan 15, 2026
07900f3
Remove flush-time check for populized components
franzpoeschel Jan 16, 2026
7cac3f6
Make the default specification more flexible
franzpoeschel Jan 16, 2026
0c75d70
WIP
franzpoeschel Jan 20, 2026
bca7adf
continue
franzpoeschel Jan 20, 2026
7475bb9
Split this into internal and public header
franzpoeschel Jan 21, 2026
1672e7d
Distinguish writing from reading
franzpoeschel Jan 21, 2026
c355532
Tests now working again
franzpoeschel Jan 21, 2026
de4c6e5
Mostly move Mesh reading to ScientificDefaults
franzpoeschel Jan 21, 2026
a90620c
Fix type conversions between char and string
franzpoeschel Jan 21, 2026
bea68bf
Somewhat working Mesh reading
franzpoeschel Jan 21, 2026
ae095e8
Fix little parent call bug
franzpoeschel Jan 22, 2026
f874f35
Mention expected datatypes in attribute reading error messages
franzpoeschel Jan 22, 2026
3e47cce
Move Iteration reading to ScientificDefaults class
franzpoeschel Jan 22, 2026
2030f7f
Introduce genericsetter, use for unitDimension
franzpoeschel Jan 22, 2026
edb658b
Record / BaseRecord Reading
franzpoeschel Jan 22, 2026
2413bad
Readers for everything now except version-dependent stuff
franzpoeschel Jan 22, 2026
cc659a9
Add gridUnitDimension in ScientificDefaults
franzpoeschel Jan 23, 2026
381c5b0
Do not use templates for defaults setter
franzpoeschel Jan 26, 2026
d2d0323
Wew NewAttributeReader
franzpoeschel Jan 27, 2026
1468650
Fixes
franzpoeschel Jan 27, 2026
31cc55f
Fixes
franzpoeschel Jan 27, 2026
f1e57bc
Defaults for patchRecord
franzpoeschel Jan 27, 2026
41fbd85
Adapt PatchRecordComponent
franzpoeschel Jan 27, 2026
70cd8fe
Fixes
franzpoeschel Jan 27, 2026
84d6670
Cleanup
franzpoeschel Jan 28, 2026
8ed1589
Cleanup
franzpoeschel Jan 28, 2026
7c92e50
Avoid overcomplex attribute type conversions
franzpoeschel Jan 28, 2026
0bf2125
reduce binary size a bit
franzpoeschel Jan 28, 2026
9318ec6
Try further reducing amount of lambdas...
franzpoeschel Jan 28, 2026
ed0903c
Annotate MB sizes
franzpoeschel Jan 28, 2026
7238096
Reduce implementation sizes for RequireScalar / RequireVector
franzpoeschel Jan 29, 2026
6088d4f
vibe-coded suggestions for size optimization
franzpoeschel Jan 29, 2026
3787df7
Avoid using lambdas for require_type
franzpoeschel Jan 29, 2026
e220218
Change code order
franzpoeschel Jan 29, 2026
f0a072c
Replace if constexpr with SFINAE
franzpoeschel Jan 30, 2026
271ff08
Fix nvhpc/msvc builds
franzpoeschel Jan 30, 2026
f6f7eca
doxygen fix
franzpoeschel Feb 2, 2026
99258a3
Cleanup
franzpoeschel Feb 4, 2026
82546ec
scientificdefaults_internal.cpp
franzpoeschel Feb 24, 2026
20ec8a0
Add visitor pattern
franzpoeschel Feb 24, 2026
cacc211
wip: ScientificDefaults without CRT
franzpoeschel Feb 24, 2026
f164cbd
Move defaults impl to classes
franzpoeschel Feb 24, 2026
5586297
Fix visitHierarchy
franzpoeschel Feb 24, 2026
94adc70
Fix visithierarchy
franzpoeschel Feb 24, 2026
7b83855
Compiles
franzpoeschel Feb 24, 2026
a85c082
Fix inheritance issue
franzpoeschel Feb 25, 2026
d5c3af5
Cleanup
franzpoeschel Mar 3, 2026
94701e6
Move files
franzpoeschel Mar 3, 2026
d414164
Split files
franzpoeschel Mar 3, 2026
26c1d90
Cleanup, documentation
franzpoeschel Mar 3, 2026
92a5908
Fix JSON backend bug when missing attributes
franzpoeschel Mar 3, 2026
97cf8e1
Fix bug with metadata set too late
franzpoeschel Mar 20, 2026
4434d70
Write defaults upon flush, thats good enough actually
franzpoeschel Mar 25, 2026
7b92e74
... wip visitor without templates ...
franzpoeschel Mar 20, 2026
cb39019
somewhat compiles
franzpoeschel Mar 20, 2026
74f37cc
Clean up visitHierarchy API
franzpoeschel Mar 20, 2026
97cf733
Further cleanup
franzpoeschel Mar 20, 2026
fa9e501
Implement lambda visitor in terms of explicit visitor
franzpoeschel Mar 20, 2026
3a30d96
Fix Python bindings
franzpoeschel Mar 20, 2026
3318fa9
populateDefaultMetadata -> commitStructuralSetup
franzpoeschel Mar 25, 2026
acb4568
Cleanup
franzpoeschel Mar 25, 2026
3e9502c
Documentation
franzpoeschel Mar 25, 2026
11267e4
Postfix traversal, document visitHierarchy
franzpoeschel Mar 25, 2026
e40cfc2
commitStructuralSetup --> populateMissingMetadata(bool recursive)
franzpoeschel Apr 7, 2026
0a763ef
CI fixes
franzpoeschel Apr 8, 2026
6e3af81
Default values only upon ::close
franzpoeschel Apr 14, 2026
fee2db1
Documentation and cleanup
franzpoeschel Apr 28, 2026
54c2a15
Review fixes
franzpoeschel Apr 29, 2026
711bdc0
Review fixes
franzpoeschel Apr 29, 2026
ed7e1b5
Fix dirty handling
franzpoeschel Apr 29, 2026
367219d
Fix forward declaration
franzpoeschel Apr 29, 2026
790357a
Fix dirty handling
franzpoeschel Apr 30, 2026
c7299f5
Review fixes
franzpoeschel May 12, 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
39 changes: 35 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,18 @@ 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(
internal::WriteOrRead, OpenpmdStandard) override;
}; // Iteration

namespace traits
Expand Down Expand Up @@ -513,4 +538,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
12 changes: 12 additions & 0 deletions include/openPMD/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#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 "openPMD/backend/scientific_defaults/ScientificDefaults_auxiliary.hpp"

#include <ostream>
#include <string>
Expand All @@ -41,6 +44,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 +327,19 @@ 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(
internal::WriteOrRead, 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
15 changes: 14 additions & 1 deletion include/openPMD/ParticleSpecies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,32 @@
#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 "openPMD/backend/scientific_defaults/ScientificDefaults_auxiliary.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 +62,10 @@ class ParticleSpecies : public Container<Record>
{
return m_containerData;
}

protected:
void scientificDefaults_impl(
internal::WriteOrRead, OpenpmdStandard) override;
};

namespace traits
Expand Down
8 changes: 8 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,19 @@ 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(
internal::WriteOrRead, OpenpmdStandard) override;
}; // Record

template <typename T>
Expand Down
18 changes: 15 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,16 @@ 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(
internal::WriteOrRead, 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