From: bangerth Date: Fri, 7 Oct 2011 21:12:03 +0000 (+0000) Subject: Use numbers::invalid_unsigned_int instead of -1 to indicate invalid X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1de3d7ecb207af37bfd9a3b4b3ecb7828c9b8e39;p=dealii-svn.git Use numbers::invalid_unsigned_int instead of -1 to indicate invalid default arguments. git-svn-id: https://svn.dealii.org/trunk@24559 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/meshworker/simple.h b/deal.II/include/deal.II/meshworker/simple.h index 1235a338d1..3cb08550f3 100644 --- a/deal.II/include/deal.II/meshworker/simple.h +++ b/deal.II/include/deal.II/meshworker/simple.h @@ -57,7 +57,7 @@ namespace MeshWorker public: void initialize(NamedData& results); /** - * Initialize the constraints. + * Initialize the constraints. */ void initialize(const ConstraintMatrix& constraints); /** @@ -73,14 +73,14 @@ namespace MeshWorker */ template void initialize_info(DOFINFO& info, bool face) const; - + /** * Assemble the local residuals * into the global residuals. */ template void assemble(const DOFINFO& info); - + /** * Assemble both local residuals * into the global residuals. @@ -99,7 +99,7 @@ namespace MeshWorker */ SmartPointer > constraints; }; - + /** * Assemble local matrices into a single global matrix without using * block structure. @@ -127,14 +127,14 @@ namespace MeshWorker * the matrix. */ MatrixSimple(double threshold = 1.e-12); - + /** * Store the result matrix * for later assembling. */ void initialize(MATRIX& m); /** - * Initialize the constraints. + * Initialize the constraints. */ void initialize(const ConstraintMatrix& constraints); /** @@ -152,7 +152,7 @@ namespace MeshWorker */ template void initialize_info(DOFINFO& info, bool face) const; - + /** * Assemble the matrix * DoFInfo::M1[0] @@ -160,7 +160,7 @@ namespace MeshWorker */ template void assemble(const DOFINFO& info); - + /** * Assemble both local * matrices in the info @@ -178,7 +178,7 @@ namespace MeshWorker void assemble(const FullMatrix& M, const std::vector& i1, const std::vector& i2); - + /** * The global matrix being * assembled. @@ -188,7 +188,7 @@ namespace MeshWorker * A pointer to the object containing constraints. */ SmartPointer > constraints; - + /** * The smallest positive * number that will be @@ -199,10 +199,10 @@ namespace MeshWorker * not be assembled. */ const double threshold; - + }; - - + + /** * Assemble local matrices into level matrices without using * block structure. @@ -225,7 +225,7 @@ namespace MeshWorker * the matrix. */ MGMatrixSimple(double threshold = 1.e-12); - + /** * Store the result matrix * for later assembling. @@ -234,7 +234,7 @@ namespace MeshWorker /** * Initialize the multilevel - * constraints. + * constraints. */ void initialize(const MGConstrainedDoFs& mg_constrained_dofs); @@ -247,7 +247,7 @@ namespace MeshWorker */ void initialize_fluxes(MGLevelObject& flux_up, MGLevelObject& flux_down); - + /** * Initialize the matrices * #interface_in and #interface_out @@ -273,7 +273,7 @@ namespace MeshWorker */ template void initialize_info(DOFINFO& info, bool face) const; - + /** * Assemble the matrix * DoFInfo::M1[0] @@ -281,7 +281,7 @@ namespace MeshWorker */ template void assemble(const DOFINFO& info); - + /** * Assemble both local * matrices in the info @@ -310,7 +310,7 @@ namespace MeshWorker const std::vector& i1, const std::vector& i2, const unsigned int level); - + /** * Assemble a single matrix * into a global matrix. @@ -320,7 +320,7 @@ namespace MeshWorker const FullMatrix& M, const std::vector& i1, const std::vector& i2, - const unsigned int level = -1); + const unsigned int level = numbers::invalid_unsigned_int); /** * Assemble a single matrix * into a global matrix. @@ -330,7 +330,7 @@ namespace MeshWorker const FullMatrix& M, const std::vector& i1, const std::vector& i2, - const unsigned int level = -1); + const unsigned int level = numbers::invalid_unsigned_int); /** * Assemble a single matrix @@ -341,7 +341,7 @@ namespace MeshWorker const FullMatrix& M, const std::vector& i1, const std::vector& i2, - const unsigned int level = -1); + const unsigned int level = numbers::invalid_unsigned_int); /** * Assemble a single matrix @@ -352,14 +352,14 @@ namespace MeshWorker const FullMatrix& M, const std::vector& i1, const std::vector& i2, - const unsigned int level = -1); - + const unsigned int level = numbers::invalid_unsigned_int); + /** * The global matrix being * assembled. */ SmartPointer,MGMatrixSimple > matrix; - + /** * The matrix used for face * flux terms across the @@ -367,7 +367,7 @@ namespace MeshWorker * coarse to fine. */ SmartPointer,MGMatrixSimple > flux_up; - + /** * The matrix used for face * flux terms across the @@ -384,7 +384,7 @@ namespace MeshWorker * coarse to fine. */ SmartPointer,MGMatrixSimple > interface_in; - + /** * The matrix used for face * contributions for continuous @@ -397,7 +397,7 @@ namespace MeshWorker * A pointer to the object containing constraints. */ SmartPointer > mg_constrained_dofs; - + /** * The smallest positive * number that will be @@ -408,10 +408,10 @@ namespace MeshWorker * not be assembled. */ const double threshold; - + }; - - + + /** * Assemble a simple matrix and a simple right hand side at once. We * use a combination of MatrixSimple and ResidualSimple to achieve @@ -440,7 +440,7 @@ namespace MeshWorker * is assembled into. */ void initialize(MATRIX& m, VECTOR& rhs); - + /** * Initialize the local data * in the @@ -456,7 +456,7 @@ namespace MeshWorker */ template void initialize_info(DOFINFO& info, bool face) const; - + /** * Assemble the matrix * DoFInfo::M1[0] @@ -464,7 +464,7 @@ namespace MeshWorker */ template void assemble(const DOFINFO& info); - + /** * Assemble both local * matrices in the info @@ -476,7 +476,7 @@ namespace MeshWorker const DOFINFO& info2); }; - + //----------------------------------------------------------------------// template @@ -493,7 +493,7 @@ namespace MeshWorker constraints = &c; } - + template template inline void @@ -502,7 +502,7 @@ namespace MeshWorker info.initialize_vectors(residuals.size()); } - + template template inline void @@ -521,7 +521,7 @@ namespace MeshWorker } } - + template template inline void @@ -547,7 +547,7 @@ namespace MeshWorker } } - + //----------------------------------------------------------------------// template @@ -556,8 +556,8 @@ namespace MeshWorker : threshold(threshold) {} - - + + template inline void MatrixSimple::initialize(MATRIX& m) @@ -572,7 +572,7 @@ namespace MeshWorker { constraints = &c; } - + template template @@ -592,9 +592,9 @@ namespace MeshWorker { AssertDimension(M.m(), i1.size()); AssertDimension(M.n(), i2.size()); - + if(constraints == 0) - { + { for (unsigned int j=0; j= threshold) @@ -604,8 +604,8 @@ namespace MeshWorker constraints->distribute_local_to_global( M, i1, i2, *matrix); } - - + + template template inline void @@ -613,7 +613,7 @@ namespace MeshWorker { assemble(info.matrix(0,false).matrix, info.indices, info.indices); } - + template template @@ -626,8 +626,8 @@ namespace MeshWorker assemble(info2.matrix(0,false).matrix, info2.indices, info2.indices); assemble(info2.matrix(0,true).matrix, info2.indices, info1.indices); } - - + + //----------------------------------------------------------------------// template @@ -636,15 +636,15 @@ namespace MeshWorker : threshold(threshold) {} - - + + template inline void MGMatrixSimple::initialize(MGLevelObject& m) { matrix = &m; } - + template inline void MGMatrixSimple::initialize(const MGConstrainedDoFs& c) @@ -660,7 +660,7 @@ namespace MeshWorker flux_up = &up; flux_down = &down; } - + template inline void @@ -691,7 +691,7 @@ namespace MeshWorker { AssertDimension(M.m(), i1.size()); AssertDimension(M.n(), i2.size()); - + if(mg_constrained_dofs == 0) { for (unsigned int j=0; j inline void MGMatrixSimple::assemble_up( @@ -767,7 +767,7 @@ namespace MeshWorker { AssertDimension(M.n(), i1.size()); AssertDimension(M.m(), i2.size()); - + if(mg_constrained_dofs == 0) { for (unsigned int j=0; j inline void MGMatrixSimple::assemble_out( @@ -870,7 +870,7 @@ namespace MeshWorker { AssertDimension(M.n(), i1.size()); AssertDimension(M.m(), i2.size()); - + if(mg_constrained_dofs == 0) { for (unsigned int j=0; jset_boundary_values()) { if((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && - !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) + !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) || (mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) && @@ -901,8 +901,8 @@ namespace MeshWorker } } } - - + + template template inline void @@ -917,7 +917,7 @@ namespace MeshWorker assemble_out((*interface_out)[level],info.matrix(0,false).matrix, info.indices, info.indices, level); } } - + template template @@ -927,7 +927,7 @@ namespace MeshWorker { const unsigned int level1 = info1.cell->level(); const unsigned int level2 = info2.cell->level(); - + if (level1 == level2) { if(mg_constrained_dofs == 0) @@ -977,12 +977,12 @@ namespace MeshWorker NamedData data; VECTOR* p = &rhs; data.add(p, "right hand side"); - + MatrixSimple::initialize(m); ResidualSimple::initialize(data); } - + template template inline void @@ -1012,7 +1012,7 @@ namespace MeshWorker { MatrixSimple::assemble(info1, info2); ResidualSimple::assemble(info1, info2); - } + } } }