}
+namespace internal
+{
+ /**
+ * returns a string representing the dynamic type of the given argument. This is
+ * basically the same what typeid(...).name() does, but it turns out this is broken
+ * on Intel 13+.
+ */
+ template<int dim, int spacedim>
+ std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase<dim,spacedim> & policy)
+ {
+ std::string policy_name;
+ if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::Sequential<dim,spacedim>*>(&policy))
+ policy_name = "Policy::Sequential<";
+ else
+ if (dynamic_cast<const typename dealii::internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>*>(&policy))
+ policy_name = "Policy::ParallelDistributed<";
+ else
+ AssertThrow(false, ExcNotImplemented());
+ policy_name += Utilities::int_to_string(dim)+
+ ","+Utilities::int_to_string(spacedim)+">";
+ return policy_name;
+ }
+
+}
+
+
template <int dim, int spacedim>
template <class Archive>
void DoFHandler<dim,spacedim>::save (Archive &ar,
// identifies the FE and the policy
unsigned int n_cells = tria->n_cells();
std::string fe_name = selected_fe->get_name();
- std::string policy_name = policy->to_string();
+ std::string policy_name = internal::policy_to_string(*policy);
ar &n_cells &fe_name &policy_name;
}
AssertThrow (fe_name == selected_fe->get_name(),
ExcMessage ("The finite element associated with this DoFHandler does not match "
"the one that was associated with the DoFHandler previously stored."));
- AssertThrow (policy_name == policy->to_string(),
+ AssertThrow (policy_name == internal::policy_to_string(*policy),
ExcMessage (std::string ("The policy currently associated with this DoFHandler (")
- + policy->to_string()
+ + internal::policy_to_string(*policy)
+std::string(") does not match the one that was associated with the "
"DoFHandler previously stored (")
+ policy_name
*/
virtual ~PolicyBase ();
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const = 0;
-
/**
* Distribute degrees of freedom on
* the object given as last argument.
virtual
NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler) const;
-
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const;
-
/**
* Distribute multigrid DoFs.
NumberCache
distribute_dofs (dealii::DoFHandler<dim,spacedim> &dof_handler) const;
- /**
- * Convert type of policy to a string. This is used as a
- * workaround in serialization because the intel compiler can
- * not handle typeid correctly.
- */
- virtual std::string to_string () const;
-
/**
* Distribute multigrid DoFs.
*/
PolicyBase<dim,spacedim>::~PolicyBase ()
{}
- /* --------------------- class Sequential ---------------- */
-
- template <int dim, int spacedim>
- std::string
- Sequential<dim,spacedim>::to_string () const
- {
- return "Policy::Sequential<"+Utilities::int_to_string(dim)+
- ","+Utilities::int_to_string(spacedim)+">";
- }
+ /* --------------------- class Sequential ---------------- */
template <int dim, int spacedim>
#endif // DEAL_II_WITH_P4EST
- template <int dim, int spacedim>
- std::string
- ParallelDistributed<dim,spacedim>::to_string () const
- {
- return "Policy::ParallelDistributed<"+Utilities::int_to_string(dim)+
- ","+Utilities::int_to_string(spacedim)+">";
- }
template <int dim, int spacedim>