Skip to content

Commit ddf9557

Browse files
committed
Push down the functionality to serialize plugins to the InterfaceBase level.
1 parent 216f50f commit ddf9557

File tree

8 files changed

+49
-159
lines changed

8 files changed

+49
-159
lines changed

include/aspect/mesh_deformation/interface.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -119,45 +119,6 @@ namespace aspect
119119
compute_velocity_constraints_on_boundary(const DoFHandler<dim> &mesh_deformation_dof_handler,
120120
AffineConstraints<double> &mesh_velocity_constraints,
121121
const std::set<types::boundary_id> &boundary_ids) const;
122-
123-
124-
/**
125-
* Save the state of this object to the argument given to this
126-
* function. This function is in support of checkpoint/restart
127-
* functionality.
128-
*
129-
* Derived classes can implement this function and should store their
130-
* state in a string that is deposited under a key in the map through
131-
* which the respective class can later find the status again when the
132-
* program is restarted. A legitimate key to store data under is
133-
* <code>typeid(*this).name()</code>. It is up to derived classes to
134-
* decide how they want to encode their state.
135-
*
136-
* The default implementation of this function does nothing, i.e., it
137-
* represents a stateless object for which nothing needs to be stored
138-
* at checkpoint time and nothing needs to be restored at restart
139-
* time.
140-
*
141-
* @param[in,out] status_strings The object into which implementations
142-
* in derived classes can place their status under a key that they can
143-
* use to retrieve the data.
144-
*/
145-
virtual
146-
void save (std::map<std::string, std::string> &status_strings) const;
147-
148-
/**
149-
* Restore the state of the object by looking up a description of the
150-
* state in the passed argument under the same key under which it was
151-
* previously stored.
152-
*
153-
* The default implementation does nothing.
154-
*
155-
* @param[in] status_strings The object from which the status will be
156-
* restored by looking up the value for a key specific to this derived
157-
* class.
158-
*/
159-
virtual
160-
void load (const std::map<std::string, std::string> &status_strings);
161122
};
162123

163124

include/aspect/plugins.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,44 @@ namespace aspect
184184
virtual
185185
void
186186
parse_parameters (ParameterHandler &prm);
187+
188+
/**
189+
* Save the state of this object to the argument given to this
190+
* function. This function is in support of checkpoint/restart
191+
* functionality.
192+
*
193+
* Derived classes can implement this function and should store their
194+
* state in a string that is deposited under a key in the map through
195+
* which the respective class can later find the status again when the
196+
* program is restarted. A legitimate key to store data under is
197+
* <code>typeid(*this).name()</code>. It is up to derived classes to
198+
* decide how they want to encode their state.
199+
*
200+
* The default implementation of this function does nothing, i.e., it
201+
* represents a stateless object for which nothing needs to be stored
202+
* at checkpoint time and nothing needs to be restored at restart
203+
* time.
204+
*
205+
* @param[in,out] status_strings The object into which implementations
206+
* in derived classes can place their status under a key that they can
207+
* use to retrieve the data.
208+
*/
209+
virtual
210+
void save (std::map<std::string, std::string> &status_strings) const;
211+
212+
/**
213+
* Restore the state of the object by looking up a description of the
214+
* state in the passed argument under the same key under which it was
215+
* previously stored.
216+
*
217+
* The default implementation does nothing.
218+
*
219+
* @param[in] status_strings The object from which the status will be
220+
* restored by looking up the value for a key specific to this derived
221+
* class.
222+
*/
223+
virtual
224+
void load (const std::map<std::string, std::string> &status_strings);
187225
};
188226

189227

include/aspect/postprocess/interface.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -115,51 +115,10 @@ namespace aspect
115115
virtual
116116
std::list<std::string>
117117
required_other_postprocessors () const;
118-
119-
/**
120-
* Save the state of this object to the argument given to this
121-
* function. This function is in support of checkpoint/restart
122-
* functionality.
123-
*
124-
* Derived classes can implement this function and should store their
125-
* state in a string that is deposited under a key in the map through
126-
* which the respective class can later find the status again when the
127-
* program is restarted. A legitimate key to store data under is
128-
* <code>typeid(*this).name()</code>. It is up to derived classes to
129-
* decide how they want to encode their state.
130-
*
131-
* The default implementation of this function does nothing, i.e., it
132-
* represents a stateless object for which nothing needs to be stored
133-
* at checkpoint time and nothing needs to be restored at restart
134-
* time.
135-
*
136-
* @param[in,out] status_strings The object into which implementations
137-
* in derived classes can place their status under a key that they can
138-
* use to retrieve the data.
139-
*/
140-
virtual
141-
void save (std::map<std::string, std::string> &status_strings) const;
142-
143-
/**
144-
* Restore the state of the object by looking up a description of the
145-
* state in the passed argument under the same key under which it was
146-
* previously stored.
147-
*
148-
* The default implementation does nothing.
149-
*
150-
* @param[in] status_strings The object from which the status will be
151-
* restored by looking up the value for a key specific to this derived
152-
* class.
153-
*/
154-
virtual
155-
void load (const std::map<std::string, std::string> &status_strings);
156118
};
157119

158120

159121

160-
161-
162-
163122
/**
164123
* A class that manages all objects that provide functionality to
165124
* postprocess solutions. It declares run time parameters for input files,

include/aspect/postprocess/visualization.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -178,44 +178,6 @@ namespace aspect
178178
std::list<std::string>
179179
required_other_postprocessors () const;
180180

181-
/**
182-
* Save the state of this object to the argument given to this
183-
* function. This function is in support of checkpoint/restart
184-
* functionality.
185-
*
186-
* Derived classes can implement this function and should store
187-
* their state in a string that is deposited under a key in the map
188-
* through which the respective class can later find the status
189-
* again when the program is restarted. A legitimate key to store
190-
* data under is <code>typeid(*this).name()</code>. It is up to
191-
* derived classes to decide how they want to encode their state.
192-
*
193-
* The default implementation of this function does nothing, i.e.,
194-
* it represents a stateless object for which nothing needs to be
195-
* stored at checkpoint time and nothing needs to be restored at
196-
* restart time.
197-
*
198-
* @param[in,out] status_strings The object into which
199-
* implementations in derived classes can place their status under a
200-
* key that they can use to retrieve the data.
201-
*/
202-
virtual
203-
void save (std::map<std::string, std::string> &status_strings) const;
204-
205-
/**
206-
* Restore the state of the object by looking up a description of
207-
* the state in the passed argument under the same key under which
208-
* it was previously stored.
209-
*
210-
* The default implementation does nothing.
211-
*
212-
* @param[in] status_strings The object from which the status will
213-
* be restored by looking up the value for a key specific to this
214-
* derived class.
215-
*/
216-
virtual
217-
void load (const std::map<std::string, std::string> &status_strings);
218-
219181
private:
220182
/**
221183
* The physical units encoded by this visualization postprocessor.

source/mesh_deformation/interface.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,6 @@ namespace aspect
176176

177177

178178

179-
template <int dim>
180-
void
181-
Interface<dim>::save (std::map<std::string,std::string> &) const
182-
{}
183-
184-
185-
186-
template <int dim>
187-
void
188-
Interface<dim>::load (const std::map<std::string,std::string> &)
189-
{}
190-
191-
192-
193179
template <int dim>
194180
Tensor<1,dim>
195181
Interface<dim>::

source/plugins.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,16 @@ namespace aspect
4646
void
4747
InterfaceBase::parse_parameters (dealii::ParameterHandler &)
4848
{}
49+
50+
51+
void
52+
InterfaceBase::save (std::map<std::string,std::string> &) const
53+
{}
54+
55+
56+
57+
void
58+
InterfaceBase::load (const std::map<std::string,std::string> &)
59+
{}
4960
}
5061
}

source/postprocess/interface.cc

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,6 @@ namespace aspect
4040

4141

4242

43-
template <int dim>
44-
void
45-
Interface<dim>::save (std::map<std::string,std::string> &) const
46-
{}
47-
48-
49-
50-
template <int dim>
51-
void
52-
Interface<dim>::load (const std::map<std::string,std::string> &)
53-
{}
54-
55-
56-
5743
// ------------------------------ Manager -----------------------------
5844

5945

source/postprocess/visualization.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -261,19 +261,6 @@ namespace aspect
261261

262262

263263

264-
template <int dim>
265-
void
266-
Interface<dim>::save (std::map<std::string,std::string> &) const
267-
{}
268-
269-
270-
template <int dim>
271-
void
272-
Interface<dim>::load (const std::map<std::string,std::string> &)
273-
{}
274-
275-
276-
277264
template <int dim>
278265
CellDataVectorCreator<dim>::CellDataVectorCreator (const std::string &physical_units)
279266
:

0 commit comments

Comments
 (0)