]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement load_user_flags.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Aug 1999 14:48:47 +0000 (14:48 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Aug 1999 14:48:47 +0000 (14:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@1660 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/tria.cc

index 7d1fb653c543188aefe847cf4e6b9d2caab8a921..d4946164bc789d137dfeffbd98fc0e489d02f922 100644 (file)
@@ -1508,6 +1508,9 @@ void Triangulation<dim>::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<dim>::save_user_flags (vector<bool> &v) const {
       save_user_flags_hex (tmp);
       v.insert (v.end(), tmp.begin(), tmp.end());
     };      
+
+  if (dim >= 4)
+    Assert (false, ExcNotImplemented());
+};
+
+
+
+template <int dim>
+void Triangulation<dim>::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 <int dim>
+void Triangulation<dim>::load_user_flags (const vector<bool> &v)
+{
+  Assert (v.size() == n_lines()+n_quads()+n_hexs(), ExcInternalError());
+  vector<bool> 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());
 };
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.