]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
check dimensions
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Aug 2011 06:04:31 +0000 (06:04 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Aug 2011 06:04:31 +0000 (06:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@24104 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/numerics/mesh_worker_output.h

index 26fd5e6a9a92656c0a81d67e3062001043fbaf5a..89ac3713dd98057fc1e9eded52127f523aba433e 100644 (file)
@@ -124,7 +124,15 @@ namespace MeshWorker
                                          */
         void write_endl () const;
 
+                                        /**
+                                         * The number of output
+                                         * components in each point.
+                                         */
        unsigned int n_vectors;
+                                        /**
+                                         * The number of points in
+                                         * one direction.
+                                         */
        unsigned int n_points;
 
        /**
@@ -198,12 +206,15 @@ namespace MeshWorker
       const unsigned int nv = info.n_quadrature_values();
       const unsigned int patch_dim = (info.face_number == numbers::invalid_unsigned_int)
                                     ? dim : (dim-1);
-      const unsigned int row_length = static_cast<unsigned int>(std::pow(np, 1./patch_dim)+.5);
-      
+      const unsigned int row_length = n_points;
                                       // If patches are 1D, end the
                                       // patch after a row, else and
                                       // it after a square
       const unsigned int row_length2 = (patch_dim==1) ? row_length : (row_length*row_length);
+
+      AssertDimension(np, Utilities::fixed_power<dim>(n_points));
+      AssertDimension(nv, n_vectors+dim);
+      
       
       for (unsigned int k=0; k<np; ++k)
        {

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.