* object.
*/
std::size_t memory_consumption () const;
+
+ /**
+ * Read or write the data of this object to or from a stream for the
+ * purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive &ar,
+ const unsigned int version);
};
* object.
*/
std::size_t memory_consumption () const;
+
+ /**
+ * Read or write the data of this object to or from a stream for the
+ * purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive &ar,
+ const unsigned int version);
};
/**
* object.
*/
std::size_t memory_consumption () const;
+
+ /**
+ * Read or write the data of this object to or from a stream for the
+ * purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive &ar,
+ const unsigned int version);
};
/**
* object.
*/
std::size_t memory_consumption () const;
+
+ /**
+ * Read or write the data of this object to or from a stream for the
+ * purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive &ar,
+ const unsigned int version);
};
// --------------------- inline and template functions ------------------
+ template <class Archive>
+ void DoFIndicesOnFaces<1>::serialize(Archive &,
+ const unsigned int)
+ {}
+
+
+ template <class Archive>
+ void DoFIndicesOnFaces<2>::serialize(Archive &ar,
+ const unsigned int)
+ {
+ ar &lines;
+ }
+
+
+ template <class Archive>
+ void DoFIndicesOnFaces<3>::serialize(Archive &ar,
+ const unsigned int)
+ {
+ ar &lines &quads;
+ }
template <int structdim>
template <int dim, int spacedim>
}
}
+ template <int structdim>
+ template <class Archive>
+ void DoFIndicesOnFacesOrEdges<structdim>::serialize(Archive &ar,
+ const unsigned int)
+ {
+ ar &dofs;
+ ar &dof_offsets;
+ }
+
} // namespace hp
*/
virtual std::size_t memory_consumption () const;
+ /**
+ * Write the data of this object to a stream for the purpose of
+ * serialization.
+ */
+ template <class Archive>
+ void save(Archive &ar, const unsigned int version) const;
+
+ /**
+ * Read the data of this object from a stream for the purpose of
+ * serialization.
+ */
+ template <class Archive>
+ void load(Archive &ar, const unsigned int version);
+
+ BOOST_SERIALIZATION_SPLIT_MEMBER()
+
/**
* Exception
*/
/* ----------------------- Inline functions ---------------------------------- */
+ template <int dim, int spacedim>
+ template <class Archive>
+ void DoFHandler<dim, spacedim>::save(Archive &ar, unsigned int) const
+ {
+ ar &vertex_dofs;
+ ar &vertex_dofs_offsets;
+ ar &number_cache;
+ ar &levels;
+ ar &faces;
+ ar &has_children;
+
+ // write out the number of triangulation cells and later check during
+ // loading that this number is indeed correct;
+ unsigned int n_cells = tria->n_cells();
+
+ ar &n_cells;
+ }
+
+ template <int dim, int spacedim>
+ template <class Archive>
+ void DoFHandler<dim, spacedim>::load(Archive &ar, unsigned int)
+ {
+ ar &vertex_dofs;
+ ar &vertex_dofs_offsets;
+ ar &number_cache;
+
+ // boost::serialization can restore pointers just fine, but if the
+ // pointer object still points to something useful, that object is not
+ // destroyed and we end up with a memory leak. consequently, first delete
+ // previous content before re-loading stuff
+ for (unsigned int i = 0; i<levels.size(); ++i)
+ delete levels[i];
+ for (unsigned int i = 0; i<has_children.size(); ++i)
+ delete has_children[i];
+ levels.resize(0);
+ has_children.resize(0);
+ delete faces;
+ faces = 0;
+
+ ar &levels;
+ ar &faces;
+ ar &has_children;
+
+ // these are the checks that correspond to the last block in the save()
+ // function
+ unsigned int n_cells;
+
+ ar &n_cells;
+
+ AssertThrow(n_cells == tria->n_cells(),
+ ExcMessage("The object being loaded into does not match the triangulation "
+ "that has been stored previously."));
+ }
+
template <int dim, int spacedim>
inline
types::global_dof_index
*/
std::size_t memory_consumption () const;
+ /**
+ * Read or write the data of this object to or from a stream for the
+ * purpose of serialization
+ */
+ template <class Archive>
+ void serialize(Archive &ar,
+ const unsigned int version);
+
private:
/**
* Compress the arrays that store dof indices by using a variant of run-
return &cell_dof_indices_cache[cell_cache_offsets[obj_index]];
}
+
+ template <class Archive>
+ inline
+ void
+ DoFLevel::serialize(Archive &ar,
+ const unsigned int)
+ {
+ ar &this->active_fe_indices;
+ ar &this->cell_cache_offsets;
+ ar &this->cell_dof_indices_cache;
+ ar &this->dof_indices;
+ ar &this->dof_offsets;
+ }
} // namespace hp
} // namespace internal