]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Initialize a member variable to invalid values. 3441/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Nov 2016 18:16:56 +0000 (12:16 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Nov 2016 18:16:56 +0000 (12:16 -0600)
source/grid/cell_id.cc

index fa42f4952abc8d77fe31abbd0310681271715b8e..2711c22b20323493375308d7d61d36820efe9af8 100644 (file)
@@ -26,7 +26,14 @@ CellId::CellId()
   :
   coarse_cell_id(numbers::invalid_unsigned_int),
   n_child_indices(numbers::invalid_unsigned_int)
-{}
+{
+  // initialize the child indices to invalid values
+  // (the only allowed values are between zero and
+  // GeometryInfo<dim>::max_children_per_cell)
+  for (unsigned int i=0; i<child_indices.size(); ++i)
+    child_indices[i] = std::numeric_limits<char>::max();
+
+}
 
 
 

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.