From: wolf Date: Tue, 10 Aug 1999 14:48:47 +0000 (+0000) Subject: Implement load_user_flags. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab9cd917d8b5cb020556014d372dfcbd1722b62b;p=dealii-svn.git Implement load_user_flags. git-svn-id: https://svn.dealii.org/trunk@1660 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 7d1fb653c5..d4946164bc 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -1508,6 +1508,9 @@ void Triangulation::save_user_flags (ostream &out) const { if (dim>=3) save_user_flags_hex (out); + + if (dim >= 4) + Assert (false, ExcNotImplemented()); }; @@ -1534,6 +1537,62 @@ void Triangulation::save_user_flags (vector &v) const { save_user_flags_hex (tmp); v.insert (v.end(), tmp.begin(), tmp.end()); }; + + if (dim >= 4) + Assert (false, ExcNotImplemented()); +}; + + + +template +void Triangulation::load_user_flags (istream &in) +{ + load_user_flags_line (in); + + if (dim>=2) + load_user_flags_quad (in); + + if (dim>=3) + load_user_flags_hex (in); + + if (dim >= 4) + Assert (false, ExcNotImplemented()); +}; + + + +template +void Triangulation::load_user_flags (const vector &v) +{ + Assert (v.size() == n_lines()+n_quads()+n_hexs(), ExcInternalError()); + vector tmp; + + // first extract the flags belonging + // to lines + Assert (v.size() > n_lines(), ExcInternalError()); + tmp.insert (tmp.end(), + v.begin(), v.begin()+n_lines()); + // and set the lines + load_user_flags_line (tmp); + tmp.clear (); + + if (dim >= 2) + { + Assert (v.size() > n_lines()+n_quads(), ExcInternalError()); + tmp.insert (tmp.end(), + v.begin()+n_lines(), v.begin()+n_lines()+n_quads()); + load_user_flags_quad (tmp); + }; + + if (dim >= 3) + { + tmp.insert (tmp.end(), + v.begin()+n_lines()+n_quads(), v.begin()+n_lines()+n_quads()+n_hexs()); + load_user_flags_hex (tmp); + }; + + if (dim >= 4) + Assert (false, ExcNotImplemented()); };