From: kanschat Date: Wed, 17 Aug 2011 06:04:31 +0000 (+0000) Subject: check dimensions X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67a13991c3f73be5ad42ea1379d4b2797909631a;p=dealii-svn.git check dimensions git-svn-id: https://svn.dealii.org/trunk@24104 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/numerics/mesh_worker_output.h b/deal.II/include/deal.II/numerics/mesh_worker_output.h index 26fd5e6a9a..89ac3713dd 100644 --- a/deal.II/include/deal.II/numerics/mesh_worker_output.h +++ b/deal.II/include/deal.II/numerics/mesh_worker_output.h @@ -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(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(n_points)); + AssertDimension(nv, n_vectors+dim); + for (unsigned int k=0; k