File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ class Mesh
4545{
4646 friend class Container <Mesh>;
4747 friend class Iteration ;
48- friend class internal ::ScientificDefaults<Mesh>;
48+ template <typename >
49+ friend class internal ::ScientificDefaults;
4950
5051public:
5152 Mesh (Mesh const &) = default ;
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ class ParticleSpecies
4040 friend class Iteration ;
4141 template <typename T>
4242 friend T &internal::makeOwning (T &self, Series);
43- friend class internal ::ScientificDefaults<ParticleSpecies>;
43+ template <typename >
44+ friend class internal ::ScientificDefaults;
4445
4546public:
4647 ParticlePatches particlePatches;
Original file line number Diff line number Diff line change @@ -113,20 +113,12 @@ Iteration &Iteration::close(bool _flush)
113113 // yet keeps it re-openable)
114114 break ;
115115 }
116+
116117 {
117118 Access at = IOHandler ()->m_frontendAccess ;
118119 finalize (at);
119- for (auto &[_, mesh] : meshes)
120- {
121- (void )_;
122- mesh.internal ::ScientificDefaults<Mesh>::finalize (at);
123- }
124- for (auto &[_, ps] : particles)
125- {
126- (void )_;
127- ps.finalize (at);
128- }
129120 }
121+
130122 if (_flush)
131123 {
132124 if (flag == StepStatus::DuringStep)
Original file line number Diff line number Diff line change @@ -134,11 +134,26 @@ void ScientificDefaults<Child>::finalize(Access at)
134134 }
135135 }
136136 }
137+ // sic! no else
137138
138- if constexpr (std::is_same_v<Child, ParticleSpecies>)
139+ if constexpr (std::is_same_v<Child, Iteration>)
140+ {
141+ for (auto &[_, right] : asChild ().meshes )
142+ {
143+ (void )_;
144+ right.ScientificDefaults <Mesh>::finalize (at);
145+ }
146+ for (auto &[_, right] : asChild ().particles )
147+ {
148+ (void )_;
149+ right.ScientificDefaults <ParticleSpecies>::finalize (at);
150+ }
151+ }
152+ else if constexpr (std::is_same_v<Child, ParticleSpecies>)
139153 {
140154 for (auto &[_, right] : asChild ().particlePatches )
141155 {
156+ (void )_;
142157 right
143158 .ScientificDefaults <BaseRecord<PatchRecordComponent>>::finalize (
144159 at);
You can’t perform that action at this time.
0 commit comments