/**
* Same as above, but store the flags to
* a bitvector rather than to a file.
+ * The output vector is resized if
+ * necessary.
*/
void save_user_flags (vector<bool> &v) const;
/**
* Same as above, but store the flags to
* a bitvector rather than to a file.
+ * The output vector is resized if
+ * necessary.
*/
void save_user_flags_line (vector<bool> &v) const;
/**
* Same as above, but store the flags to
* a bitvector rather than to a file.
+ * The output vector is resized if
+ * necessary.
*/
void save_user_flags_quad (vector<bool> &v) const;
/**
* Same as above, but store the flags to
* a bitvector rather than to a file.
+ * The output vector is resized if
+ * necessary.
*/
void save_user_flags_hex (vector<bool> &v) const;
cell->clear_user_flag ();
};
-
-
-template <>
-void Triangulation<1>::save_user_flags (ostream &out) const {
- save_user_flags_line (out);
-};
-
-
-
-template <>
-void Triangulation<1>::save_user_flags (vector<bool> &v) const {
- save_user_flags_line (v);
-};
-
#endif
};
-
-template <>
-void Triangulation<2>::save_user_flags (ostream &out) const {
- save_user_flags_line (out);
- save_user_flags_quad (out);
-};
-
-
-
-template <>
-void Triangulation<2>::save_user_flags (vector<bool> &v) const {
- save_user_flags_line (v);
- save_user_flags_quad (v);
-};
-
-
#endif
};
+#endif
+
-template <>
-void Triangulation<3>::save_user_flags (ostream &out) const {
+
+
+template <int dim>
+void Triangulation<dim>::save_user_flags (ostream &out) const {
save_user_flags_line (out);
- save_user_flags_quad (out);
- save_user_flags_hex (out);
+
+ if (dim>=2)
+ save_user_flags_quad (out);
+
+ if (dim>=3)
+ save_user_flags_hex (out);
};
-template <>
-void Triangulation<3>::save_user_flags (vector<bool> &v) const {
- save_user_flags_line (v);
- save_user_flags_quad (v);
- save_user_flags_hex (v);
-};
+template <int dim>
+void Triangulation<dim>::save_user_flags (vector<bool> &v) const {
+ // clear vector and append
+ // all the stuff later on
+ v.clear ();
+ vector<bool> tmp;
-#endif
+ save_user_flags_line (tmp);
+ v.insert (v.end(), tmp.begin(), tmp.end());
+
+ if (dim >= 2)
+ {
+ save_user_flags_quad (tmp);
+ v.insert (v.end(), tmp.begin(), tmp.end());
+ };
+
+ if (dim >= 3)
+ {
+ save_user_flags_hex (tmp);
+ v.insert (v.end(), tmp.begin(), tmp.end());
+ };
+};