Skip to content

Commit c2babcc

Browse files
committed
Adapt PatchRecordComponent
1 parent 5711ac1 commit c2babcc

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ OPENPMD_private
9898

9999
using RecordComponent::flush;
100100

101+
// This differs from RecordComponent::read() such that unitSI is not
102+
// required
103+
void read();
104+
101105
// clang-format off
102106
OPENPMD_protected
103107
// clang-format on

src/backend/PatchRecordComponent.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "openPMD/RecordComponent.hpp"
2323
#include "openPMD/auxiliary/Memory.hpp"
2424
#include "openPMD/backend/BaseRecord.hpp"
25+
#include "openPMD/backend/ScientificDefaults.hpp"
2526

2627
#include <algorithm>
2728

@@ -59,10 +60,16 @@ PatchRecordComponent::PatchRecordComponent(
5960
static_cast<RecordComponent &>(*this).operator=(baseRecord);
6061
}
6162

63+
void PatchRecordComponent::read()
64+
{
65+
readBase();
66+
internal::ScientificDefaults<PatchRecordComponent>::readDefaults(
67+
IOHandler()->m_standard);
68+
}
69+
6270
PatchRecordComponent::PatchRecordComponent() : RecordComponent(NoInit())
6371
{
6472
setData(std::make_shared<Data_t>());
65-
setUnitSI(1);
6673
}
6774

6875
PatchRecordComponent::PatchRecordComponent(NoInit) : RecordComponent(NoInit())

0 commit comments

Comments
 (0)