From 8e85d078e990a16b84d47f786a6db16ef3a36b9f Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 13 Dec 1999 15:38:48 +0000 Subject: [PATCH] Move two functions (make_hanging_nodes_constraints and interpolate_cell_to_dof) from DoFHandler to DoFTools. git-svn-id: https://svn.dealii.org/trunk@2053 0785d39b-7218-0410-832d-ea1e28bc413d --- .../Attic/examples/convergence/convergence.cc | 19 +- .../deal.II/Attic/examples/dof/dof_test.cc | 2 +- .../error-estimation/error-estimation.cc | 27 +- .../Attic/examples/multigrid/multigrid.cc | 12 +- deal.II/deal.II/include/dofs/dof_handler.h | 167 ++------ deal.II/deal.II/include/dofs/dof_tools.h | 104 +++++ deal.II/deal.II/source/dofs/dof_handler.cc | 343 +---------------- .../deal.II/source/dofs/dof_renumbering.cc | 2 +- deal.II/deal.II/source/dofs/dof_tools.cc | 357 +++++++++++++++++- deal.II/deal.II/source/numerics/base.cc | 2 +- tests/big-tests/convergence/convergence.cc | 19 +- tests/big-tests/dof/dof_test.cc | 2 +- .../error-estimation/error-estimation.cc | 27 +- tests/big-tests/multigrid/multigrid.cc | 12 +- tests/deal.II/Makefile | 9 + tests/deal.II/dof_test.cc | 2 +- tests/deal.II/wave-test-3.cc | 8 +- 17 files changed, 579 insertions(+), 535 deletions(-) diff --git a/deal.II/deal.II/Attic/examples/convergence/convergence.cc b/deal.II/deal.II/Attic/examples/convergence/convergence.cc index b95a2e8dc6..40ec20423f 100644 --- a/deal.II/deal.II/Attic/examples/convergence/convergence.cc +++ b/deal.II/deal.II/Attic/examples/convergence/convergence.cc @@ -3,12 +3,13 @@ #include -#include #include -#include #include #include +#include +#include #include +#include #include #include #include @@ -387,13 +388,13 @@ int PoissonProblem::run (const unsigned int level) { Vector linfty_error_per_dof(dof->n_dofs()); Vector h1_seminorm_error_per_dof(dof->n_dofs()); Vector h1_error_per_dof(dof->n_dofs()); - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, - linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell, - h1_seminorm_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, + linfty_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell, + h1_seminorm_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); // Vector projected_solution; // ConstraintMatrix constraints; diff --git a/deal.II/deal.II/Attic/examples/dof/dof_test.cc b/deal.II/deal.II/Attic/examples/dof/dof_test.cc index 594c1c0842..5fe5ecf078 100644 --- a/deal.II/deal.II/Attic/examples/dof/dof_test.cc +++ b/deal.II/deal.II/Attic/examples/dof/dof_test.cc @@ -376,7 +376,7 @@ void TestCases::run (ParameterHandler &prm) { // computing constraints cout << " Computing constraints..." << endl; ConstraintMatrix constraints; - dof->make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof, constraints); constraints.close (); constraints.condense (sparsity); diff --git a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc index 308df10603..9d6b65fdbe 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc +++ b/deal.II/deal.II/Attic/examples/error-estimation/error-estimation.cc @@ -2,20 +2,21 @@ /* Copyright W. Bangerth, University of Heidelberg, 1998 */ +#include +#include +#include +#include +#include #include -#include #include -#include -#include #include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -559,11 +560,11 @@ void PoissonProblem::run (ParameterHandler &prm) { Vector l2_error_per_dof(dof->n_dofs()), linfty_error_per_dof(dof->n_dofs()); Vector h1_error_per_dof(dof->n_dofs()), estimated_error_per_dof(dof->n_dofs()); Vector error_ratio (dof->n_dofs()); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); - dof->distribute_cell_to_dof_vector (estimated_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, estimated_error_per_cell, estimated_error_per_dof); error_ratio.ratio (h1_error_per_dof, estimated_error_per_dof); diff --git a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc index 9e13e94fd2..a862bdda17 100644 --- a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc +++ b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc @@ -353,7 +353,7 @@ void PoissonProblem::assemble (const Equation &equation, // make up sparsity pattern and // compress with constraints constraints.clear (); - dof->DoFHandler::make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof, constraints); constraints.close (); DoFTools::make_sparsity_pattern (*dof, system_sparsity); constraints.condense (system_sparsity); @@ -557,13 +557,13 @@ int PoissonProblem::run (const unsigned int level) { Vector linfty_error_per_dof (dof->DoFHandler::n_dofs()); Vector h1_seminorm_error_per_dof (dof->DoFHandler::n_dofs()); Vector h1_error_per_dof (dof->DoFHandler::n_dofs()); - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell, h1_seminorm_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); // Vector projected_solution; // ConstraintMatrix constraints; diff --git a/deal.II/deal.II/include/dofs/dof_handler.h b/deal.II/deal.II/include/dofs/dof_handler.h index 07c191c117..2fbf020ec6 100644 --- a/deal.II/deal.II/include/dofs/dof_handler.h +++ b/deal.II/deal.II/include/dofs/dof_handler.h @@ -145,10 +145,6 @@ class DoFDimensionInfo<3> { * degrees of freedom only. The actual layout of storage of the indices * is described in the \Ref{DoFLevel} class documentation. * - * Additionally, the DoFHandler is able to generate the condensation - * matrix which connects constrained and unconstrained matrices and - * vectors. - * * Finally it offers a starting point for the assemblage of the matrices * by offering #begin()# and #end()# functions which return iterators * to walk on the DoF structures as well as the triangulation data. @@ -334,28 +330,38 @@ class DoFHandler : public Subscriptor, * according to the given distribution * method. * - * The additional optional parameter #offset# - * allows you to reserve space for a finite number - * of additional vector entries in the beginning - * of all discretization vectors. + * The additional optional + * parameter #offset# allows you + * to reserve space for a finite + * number of additional vector + * entries in the beginning of + * all discretization vectors, by + * starting the enumeration of + * degrees of freedom on the grid + * at a nonzero value. By + * default, this value is of + * course zero. * - * A pointer of the transferred finite - * element is stored. Therefore, the - * lifetime of the finite element object - * shall be longer than that of this - * object. If you don't want this - * behaviour, you may want to call - * the #clear# member function which also - * releases the lock of this object to the - * finite element. + * A pointer of the transferred + * finite element is + * stored. Therefore, the + * lifetime of the finite element + * object shall be longer than + * that of this object. If you + * don't want this behaviour, you + * may want to call the #clear# + * member function which also + * releases the lock of this + * object to the finite element. * - * This function uses the user flags of the - * triangulation object, so make sure you - * don't need them after calling this + * This function uses the user + * flags of the triangulation + * object, so make sure you don't + * need them after calling this * function, or if so store them. */ - virtual void distribute_dofs (const FiniteElement &, - unsigned int offset = 0); + virtual void distribute_dofs (const FiniteElement &fe, + const unsigned int offset = 0); /** * Clear all data of this object and @@ -386,43 +392,6 @@ class DoFHandler : public Subscriptor, */ void renumber_dofs (const vector &new_numbers); - /** - * Make up the constraints which - * is result from the use of hanging - * nodes. The object into which these - * are inserted is later - * used to condensate the global - * system matrices and to prolong - * the solution vectors from the true - * degrees of freedom also to the - * constraint nodes. - * - * Since this method does not make sense in - * one dimension, the function returns - * immediately. The object is not cleared - * before use, so you should make sure - * it containts only constraints you still - * want; otherwise call the #clear# - * function. - * - * To condense a given sparsity pattern, - * use #ConstraintMatrix::condense#. - * Before doing so, you need to close - * the constraint object, which must be - * done after all constraints are entered. - * This function does not close the object - * since you may want to enter other - * constraints later on yourself. - * - * This function uses the user flags for - * the faces. If you need the user flags, - * store them beforehand. - */ - void make_hanging_node_constraints (ConstraintMatrix &) const; - - - - /** * Return the maximum number of * degrees of freedom a degree of freedom @@ -459,54 +428,6 @@ class DoFHandler : public Subscriptor, * dimension less. */ unsigned int max_couplings_between_boundary_dofs () const; - - /** - * Take a vector of values which live on - * cells (e.g. an error per cell) and - * distribute it to the dofs in such a - * way that a finite element field results, - * which can then be further processed, - * e.g. for output. You should note that - * the resulting field will not be - * continuous at hanging nodes. This can, - * however, easily be arranged by calling - * the appropraite #distribute# function - * of a #ConstraintMatrix# object created - * for this #DoFHandler# object. - * - * It is assumed that the number of - * elements in #cell_data# equals the - * number of active cells. The size of - * #dof_data# is adjusted to the right - * size. - * - * Note that the input vector may be - * a vector of any data type as long - * as it is convertible to #double#. - * The output vector, being a data - * vector on the grid, always consists - * of elements of type #double#. - * - * In case the finite element used by - * this DoFHandler consists of more than - * one component, you should give which - * component in the output vector should - * be used to store the finite element - * field in; the default is zero (no other - * value is allowed if the finite element - * consists only of one component). All - * other components of the vector remain - * untouched, i.e. their contents are - * not changed. - * - * It is assumed that the output vector - * #dof_data# already has the right size, - * i.e. #n_dofs()# elements. - */ - template - void distribute_cell_to_dof_vector (const Vector &cell_data, - Vector &dof_data, - const unsigned int component = 0) const; /** * Create a mapping from degree of freedom @@ -1160,10 +1081,6 @@ class DoFHandler : public Subscriptor, /** * Exception */ - DeclException0 (ExcInternalError); - /** - * Exception - */ DeclException1 (ExcMatrixHasWrongSize, int, << "The matrix has the wrong dimension " << arg1); @@ -1174,26 +1091,10 @@ class DoFHandler : public Subscriptor, /** * Exception */ - DeclException2 (ExcWrongSize, - int, int, - << "The dimension " << arg1 << " of the vector is wrong. " - << "It should be " << arg2); - /** - * Exception - */ DeclException1 (ExcNewNumbersNotConsecutive, int, << "The given list of new dof indices is not consecutive: " << "the index " << arg1 << " does not exist."); - /** - * Exception - */ - DeclException2 (ExcInvalidComponent, - int, int, - << "The component you gave (" << arg1 << ") " - << "is invalid with respect to the number " - << "of components in the finite element " - << "(" << arg2 << ")"); protected: @@ -1320,7 +1221,17 @@ class DoFHandler : public Subscriptor, template inline -const FiniteElement & DoFHandler::get_fe () const { +unsigned int DoFHandler::n_dofs () const +{ + return used_dofs; +}; + + + +template +inline +const FiniteElement & DoFHandler::get_fe () const +{ return *selected_fe; }; diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h index b34836d55a..49c05b3676 100644 --- a/deal.II/deal.II/include/dofs/dof_tools.h +++ b/deal.II/deal.II/include/dofs/dof_tools.h @@ -219,6 +219,93 @@ class DoFTools static void make_flux_sparsity_pattern (const DoFHandler &dof_handler, SparseMatrixStruct &sparsity_pattern); + /** + * Make up the constraints which + * is result from the use of hanging + * nodes. The object into which these + * are inserted is later + * used to condensate the global + * system matrices and to prolong + * the solution vectors from the true + * degrees of freedom also to the + * constraint nodes. + * + * Since this method does not make sense in + * one dimension, the function returns + * immediately. The object is not cleared + * before use, so you should make sure + * it containts only constraints you still + * want; otherwise call the #clear# + * function. + * + * To condense a given sparsity pattern, + * use #ConstraintMatrix::condense#. + * Before doing so, you need to close + * the constraint object, which must be + * done after all constraints are entered. + * This function does not close the object + * since you may want to enter other + * constraints later on yourself. + * + * This function uses the user flags for + * the faces. If you need the user flags, + * store them beforehand. + */ + template + static void + make_hanging_node_constraints (const DoFHandler &dof_handler, + ConstraintMatrix &constraints); + + /** + * Take a vector of values which live on + * cells (e.g. an error per cell) and + * distribute it to the dofs in such a + * way that a finite element field results, + * which can then be further processed, + * e.g. for output. You should note that + * the resulting field will not be + * continuous at hanging nodes. This can, + * however, easily be arranged by calling + * the appropraite #distribute# function + * of a #ConstraintMatrix# object created + * for this #DoFHandler# object. + * + * It is assumed that the number of + * elements in #cell_data# equals the + * number of active cells. The size of + * #dof_data# is adjusted to the right + * size. + * + * Note that the input vector may be + * a vector of any data type as long + * as it is convertible to #double#. + * The output vector, being a data + * vector on the grid, always consists + * of elements of type #double#. + * + * In case the finite element used by + * this DoFHandler consists of more than + * one component, you should give which + * component in the output vector should + * be used to store the finite element + * field in; the default is zero (no other + * value is allowed if the finite element + * consists only of one component). All + * other components of the vector remain + * untouched, i.e. their contents are + * not changed. + * + * It is assumed that the output vector + * #dof_data# already has the right size, + * i.e. #n_dofs()# elements. + */ + template + static void + distribute_cell_to_dof_vector (const DoFHandler &dof_handler, + const Vector &cell_data, + Vector &dof_data, + const unsigned int component = 0); + /** * Extract the indices of the degrees * of freedom belonging to certain @@ -249,6 +336,23 @@ class DoFTools const MGDoFHandler &dof, const vector &select, vector &selected_dofs); + + /** + * Exception + */ + DeclException2 (ExcWrongSize, + int, int, + << "The dimension " << arg1 << " of the vector is wrong. " + << "It should be " << arg2); + /** + * Exception + */ + DeclException2 (ExcInvalidComponent, + int, int, + << "The component you gave (" << arg1 << ") " + << "is invalid with respect to the number " + << "of components in the finite element " + << "(" << arg2 << ")"); }; diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index 1a2b242a79..edc8009d4d 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1,27 +1,22 @@ /* $Id$ */ -/* Copyright W. Bangerth, University of Heidelberg, 1998 */ +/* Copyright W. Bangerth, University of Heidelberg, 1998, 1999 */ #include #include #include -#include -#include #include #include +#include #include #include #include -#include -#include -#include #include #include - template DoFHandler::DoFHandler (Triangulation *tria) : tria(tria), @@ -1287,13 +1282,6 @@ DoFHandler::last_active_hex () const { -template -unsigned int DoFHandler::n_dofs () const { - return used_dofs; -}; - - - #if deal_II_dimension == 1 template <> @@ -1374,7 +1362,7 @@ const Triangulation & DoFHandler::get_tria () const { template void DoFHandler::distribute_dofs (const FiniteElement &ff, - unsigned int offset) + const unsigned int offset) { Assert (tria->n_levels() > 0, ExcInvalidTriangulation()); @@ -1731,254 +1719,6 @@ void DoFHandler<3>::renumber_dofs (const vector &new_numbers) { -#if deal_II_dimension == 1 - -template <> -void DoFHandler<1>::make_hanging_node_constraints (ConstraintMatrix &) const {}; - -#endif - - - -#if deal_II_dimension == 2 - -template <> -void DoFHandler<2>::make_hanging_node_constraints (ConstraintMatrix &constraints) const { - const unsigned int dim = 2; - - // first mark all faces which are subject - // to constraints. We do so by looping - // over all active cells and checking - // whether any of the faces are refined - // which can only be from the neighboring - // cell because this one is active. In that - // case, the face is subject to constraints - tria->clear_user_flags (); - Triangulation::active_cell_iterator cell = tria->begin_active(), - endc = tria->end(); - for (; cell!=endc; ++cell) - for (unsigned int face=0; face::faces_per_cell; ++face) - if (cell->face(face)->has_children()) - cell->face(face)->set_user_flag(); - - - - - line_iterator line = begin_line(), - endl = end_line(); - // loop over all lines; only on lines - // there can be constraints. - for (; line != endl; ++line) - // if dofs on this line are subject - // to constraints - if (line->user_flag_set() == true) - { - // reserve space to gather - // the dof numbers. We could - // get them when we need them, - // but it seems easier to gather - // them only once. - vector dofs_on_mother; - vector dofs_on_children; - dofs_on_mother.reserve (2*selected_fe->dofs_per_vertex+ - selected_fe->dofs_per_line); - dofs_on_children.reserve (selected_fe->dofs_per_vertex+ - 2*selected_fe->dofs_per_line); - - Assert(2*selected_fe->dofs_per_vertex+selected_fe->dofs_per_line == - selected_fe->constraints().n(), - ExcDimensionMismatch(2*selected_fe->dofs_per_vertex+ - selected_fe->dofs_per_line, - selected_fe->constraints().n())); - Assert(selected_fe->dofs_per_vertex+2*selected_fe->dofs_per_line == - selected_fe->constraints().m(), - ExcDimensionMismatch(3*selected_fe->dofs_per_vertex+ - 2*selected_fe->dofs_per_line, - selected_fe->constraints().m())); - - // fill the dofs indices. Use same - // enumeration scheme as in - // #FiniteElement::constraints()# - for (unsigned int vertex=0; vertex<2; ++vertex) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof) - dofs_on_mother.push_back (line->vertex_dof_index(vertex,dof)); - for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof) - dofs_on_mother.push_back (line->dof_index(dof)); - - for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof) - dofs_on_children.push_back (line->child(0)->vertex_dof_index(1,dof)); - for (unsigned int child=0; child<2; ++child) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof) - dofs_on_children.push_back (line->child(child)->dof_index(dof)); - - // for each row in the constraint - // matrix for this line: - for (unsigned int row=0; row!=dofs_on_children.size(); ++row) - { - constraints.add_line (dofs_on_children[row]); - for (unsigned int i=0; i!=dofs_on_mother.size(); ++i) - constraints.add_entry (dofs_on_children[row], - dofs_on_mother[i], - selected_fe->constraints()(row,i)); - }; - }; -}; - -#endif - - - -#if deal_II_dimension == 3 - -template <> -void DoFHandler<3>::make_hanging_node_constraints (ConstraintMatrix &constraints) const { - const unsigned int dim = 3; - - // first mark all faces which are subject - // to constraints. We do so by looping - // over all active cells and checking - // whether any of the faces are refined - // which can only be from the neighboring - // cell because this one is active. In that - // case, the face is subject to constraints - tria->clear_user_flags (); - Triangulation::active_cell_iterator cell = tria->begin_active(), - endc = tria->end(); - for (; cell!=endc; ++cell) - for (unsigned int face=0; face::faces_per_cell; ++face) - if (cell->face(face)->has_children()) - cell->face(face)->set_user_flag(); - - - - - face_iterator face = begin_face(), - endf = end_face(); - // loop over all faces; only on faces - // there can be constraints. - for (; face != endf; ++face) - // if dofs on this line are subject - // to constraints - if (face->user_flag_set() == true) - { - // reserve space to gather - // the dof numbers. We could - // get them when we need them, - // but it seems easier to gather - // them only once. - vector dofs_on_mother; - vector dofs_on_children; - dofs_on_mother.reserve (4*selected_fe->dofs_per_vertex+ - 4*selected_fe->dofs_per_line+ - selected_fe->dofs_per_quad); - dofs_on_children.reserve (5*selected_fe->dofs_per_vertex+ - 12*selected_fe->dofs_per_line+ - 4*selected_fe->dofs_per_quad); - - Assert(4*selected_fe->dofs_per_vertex+ - 4*selected_fe->dofs_per_line+ - selected_fe->dofs_per_quad - == - selected_fe->constraints().n(), - ExcDimensionMismatch(4*selected_fe->dofs_per_vertex+ - 4*selected_fe->dofs_per_line+ - selected_fe->dofs_per_quad, - selected_fe->constraints().n())); - Assert(5*selected_fe->dofs_per_vertex+ - 12*selected_fe->dofs_per_line+ - 4*selected_fe->dofs_per_quad - == - selected_fe->constraints().m(), - ExcDimensionMismatch(5*selected_fe->dofs_per_vertex+ - 12*selected_fe->dofs_per_line+ - 4*selected_fe->dofs_per_quad, - selected_fe->constraints().m())); - - // fill the dofs indices. Use same - // enumeration scheme as in - // #FiniteElement::constraints()# - for (unsigned int vertex=0; vertex<4; ++vertex) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof) - dofs_on_mother.push_back (face->vertex_dof_index(vertex,dof)); - for (unsigned int line=0; line<4; ++line) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof) - dofs_on_mother.push_back (face->line(line)->dof_index(dof)); - for (unsigned int dof=0; dof!=selected_fe->dofs_per_quad; ++dof) - dofs_on_mother.push_back (face->dof_index(dof)); - - // dof numbers on vertex at the center - // of the face, which is vertex 2 of - // child zero, or vertex 3 of child 1 - // or vertex 0 of child 2 or vertex 1 - // of child 3. We're a bit cautious and - // check this (also an additional safety - // check for the internal states of the - // library) - Assert ((face->child(0)->vertex_dof_index(2,0) == - face->child(1)->vertex_dof_index(3,0)) && - (face->child(0)->vertex_dof_index(2,0) == - face->child(2)->vertex_dof_index(0,0)) && - (face->child(0)->vertex_dof_index(2,0) == - face->child(3)->vertex_dof_index(1,0)), - ExcInternalError()); - for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof) - dofs_on_children.push_back (face->child(0)->vertex_dof_index(2,dof)); - - // dof numbers on the centers of - // the lines bounding this face - for (unsigned int line=0; line<4; ++line) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_vertex; ++dof) - dofs_on_children.push_back (face->line(line)->child(0)->vertex_dof_index(1,dof)); - - // next the dofs on the lines interior - // to the face; the order of these - // lines is laid down in the - // FiniteElement class documentation - for (unsigned int dof=0; dofdofs_per_line; ++dof) - dofs_on_children.push_back (face->child(0)->line(1)->dof_index(dof)); - for (unsigned int dof=0; dofdofs_per_line; ++dof) - dofs_on_children.push_back (face->child(1)->line(2)->dof_index(dof)); - for (unsigned int dof=0; dofdofs_per_line; ++dof) - dofs_on_children.push_back (face->child(2)->line(3)->dof_index(dof)); - for (unsigned int dof=0; dofdofs_per_line; ++dof) - dofs_on_children.push_back (face->child(3)->line(0)->dof_index(dof)); - - // dofs on the bordering lines - for (unsigned int line=0; line<4; ++line) - for (unsigned int child=0; child<2; ++child) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_line; ++dof) - dofs_on_children.push_back (face->line(line)->child(child)->dof_index(dof)); - - // finally, for the dofs interior - // to the four child faces - for (unsigned int child=0; child<4; ++child) - for (unsigned int dof=0; dof!=selected_fe->dofs_per_quad; ++dof) - dofs_on_children.push_back (face->child(child)->dof_index(dof)); - - Assert (dofs_on_children.size() == - selected_fe->constraints().m(), - ExcDimensionMismatch(dofs_on_children.size(), - selected_fe->constraints().m())); - Assert (dofs_on_mother.size() == - selected_fe->constraints().n(), - ExcDimensionMismatch(dofs_on_mother.size(), - selected_fe->constraints().n())); - - // for each row in the constraint - // matrix for this line: - for (unsigned int row=0; row!=dofs_on_children.size(); ++row) - { - constraints.add_line (dofs_on_children[row]); - for (unsigned int i=0; i!=dofs_on_mother.size(); ++i) - constraints.add_entry (dofs_on_children[row], - dofs_on_mother[i], - selected_fe->constraints()(row,i)); - }; - }; -}; - -#endif - #if deal_II_dimension == 1 @@ -2125,71 +1865,6 @@ unsigned int DoFHandler<3>::max_couplings_between_boundary_dofs () const { -template -template -void DoFHandler::distribute_cell_to_dof_vector (const Vector &cell_data, - Vector &dof_data, - const unsigned int component) const { - Assert (cell_data.size()==tria->n_active_cells(), - ExcWrongSize (cell_data.size(), tria->n_active_cells())); - Assert (dof_data.size()==n_dofs(), ExcWrongSize (dof_data.size(), n_dofs())); - Assert (component < selected_fe->n_components(), - ExcInvalidComponent(component, selected_fe->n_components())); - - // store a flag whether we should care - // about different components. this is - // just a simplification, we could ask - // for this at every single place - // equally well - const bool consider_components = (selected_fe->n_components() != 1); - - // count how often we have added a value - // in the sum for each dof - vector touch_count (n_dofs(), 0); - - active_cell_iterator cell = begin_active(), - endc = end(); - unsigned int present_cell = 0; - const unsigned int dofs_per_cell = selected_fe->dofs_per_cell; - vector dof_indices (dofs_per_cell); - - for (; cell!=endc; ++cell, ++present_cell) - { - cell->get_dof_indices (dof_indices); - for (unsigned int i=0; isystem_to_component_index(i).first == component)) - { - // sum up contribution of the - // present_cell to this dof - dof_data(dof_indices[i]) += cell_data(present_cell); - // note that we added another - // summand - ++touch_count[dof_indices[i]]; - }; - }; - - // compute the mean value on all the - // dofs by dividing with the number - // of summands. - for (unsigned int i=0; i::clear_space () { /*-------------- Explicit Instantiations -------------------------------*/ template class DoFHandler; -template -void -DoFHandler::distribute_cell_to_dof_vector (const Vector &cell_data, - Vector &dof_data) const; - -template -void -DoFHandler::distribute_cell_to_dof_vector (const Vector &cell_data, - Vector &dof_data) const; - - - diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index 97c537e6e7..4e7ff00d39 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -29,7 +29,7 @@ void DoFRenumbering::Cuthill_McKee (DoFHandler &dof_handler, if (use_constraints) { ConstraintMatrix constraints; - dof_handler.make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (dof_handler, constraints); constraints.close (); constraints.condense (sparsity); }; diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index 13d44ab753..bf6eca3726 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -1,15 +1,18 @@ // $Id$ -// Copyright Guido Kanschat, 1999 + +#include +#include #include #include #include #include -#include +#include #include #include #include #include +#include #include @@ -257,6 +260,342 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler& dof, +#if deal_II_dimension == 1 + +template <> +void DoFTools::make_hanging_node_constraints (const DoFHandler<1> &, + ConstraintMatrix &) +{ + // nothing to be done here +}; + +#endif + + + +#if deal_II_dimension == 2 + +template <> +void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &dof_handler, + ConstraintMatrix &constraints) +{ + const unsigned int dim = 2; + const Triangulation &tria = dof_handler.get_tria(); + const FiniteElement &fe = dof_handler.get_fe(); + + // first mark all faces which are subject + // to constraints. We do so by looping + // over all active cells and checking + // whether any of the faces are refined + // which can only be from the neighboring + // cell because this one is active. In that + // case, the face is subject to constraints + DoFHandler::line_iterator line = dof_handler.begin_line(), + endl = dof_handler.end_line(); + for (; line!=endl; ++line) + line->clear_user_flag (); + + Triangulation::active_cell_iterator cell = tria.begin_active(), + endc = tria.end(); + for (; cell!=endc; ++cell) + for (unsigned int face=0; face::faces_per_cell; ++face) + if (cell->face(face)->has_children()) + cell->face(face)->set_user_flag(); + + + + + // loop over all lines; only on lines + // there can be constraints. + for (line = dof_handler.begin_line(); line != endl; ++line) + // if dofs on this line are subject + // to constraints + if (line->user_flag_set() == true) + { + // reserve space to gather + // the dof numbers. We could + // get them when we need them, + // but it seems easier to gather + // them only once. + vector dofs_on_mother; + vector dofs_on_children; + dofs_on_mother.reserve (2*fe.dofs_per_vertex+ + fe.dofs_per_line); + dofs_on_children.reserve (fe.dofs_per_vertex+ + 2*fe.dofs_per_line); + + Assert(2*fe.dofs_per_vertex+fe.dofs_per_line == + fe.constraints().n(), + ExcDimensionMismatch(2*fe.dofs_per_vertex+ + fe.dofs_per_line, + fe.constraints().n())); + Assert(fe.dofs_per_vertex+2*fe.dofs_per_line == + fe.constraints().m(), + ExcDimensionMismatch(3*fe.dofs_per_vertex+ + 2*fe.dofs_per_line, + fe.constraints().m())); + + // fill the dofs indices. Use same + // enumeration scheme as in + // #FiniteElement::constraints()# + for (unsigned int vertex=0; vertex<2; ++vertex) + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) + dofs_on_mother.push_back (line->vertex_dof_index(vertex,dof)); + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_mother.push_back (line->dof_index(dof)); + + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) + dofs_on_children.push_back (line->child(0)->vertex_dof_index(1,dof)); + for (unsigned int child=0; child<2; ++child) + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_children.push_back (line->child(child)->dof_index(dof)); + + // for each row in the constraint + // matrix for this line: + for (unsigned int row=0; row!=dofs_on_children.size(); ++row) + { + constraints.add_line (dofs_on_children[row]); + for (unsigned int i=0; i!=dofs_on_mother.size(); ++i) + constraints.add_entry (dofs_on_children[row], + dofs_on_mother[i], + fe.constraints()(row,i)); + }; + }; +}; + +#endif + + + +#if deal_II_dimension == 3 + +template <> +void DoFTools::make_hanging_node_constraints (const DoFHandler<3> &dof_handler, + ConstraintMatrix &constraints) +{ + const unsigned int dim = 3; + const Triangulation &tria = dof_handler.get_tria(); + const FiniteElement &fe = dof_handler.get_fe(); + + // first mark all faces which are subject + // to constraints. We do so by looping + // over all active cells and checking + // whether any of the faces are refined + // which can only be from the neighboring + // cell because this one is active. In that + // case, the face is subject to constraints + DoFHandler::face_iterator face = dof_handler.begin_face(), + endf = dof_handler.end_face(); + for (; face!=endf; ++face) + face->clear_user_flag (); + + Triangulation::active_cell_iterator cell = tria.begin_active(), + endc = tria.end(); + for (; cell!=endc; ++cell) + for (unsigned int face=0; face::faces_per_cell; ++face) + if (cell->face(face)->has_children()) + cell->face(face)->set_user_flag(); + + + // loop over all faces; only on faces + // there can be constraints. + for (face=dof_handler.begin_face(); face != endf; ++face) + // if dofs on this line are subject + // to constraints + if (face->user_flag_set() == true) + { + // reserve space to gather + // the dof numbers. We could + // get them when we need them, + // but it seems easier to gather + // them only once. + vector dofs_on_mother; + vector dofs_on_children; + dofs_on_mother.reserve (4*fe.dofs_per_vertex+ + 4*fe.dofs_per_line+ + fe.dofs_per_quad); + dofs_on_children.reserve (5*fe.dofs_per_vertex+ + 12*fe.dofs_per_line+ + 4*fe.dofs_per_quad); + + Assert(4*fe.dofs_per_vertex+ + 4*fe.dofs_per_line+ + fe.dofs_per_quad + == + fe.constraints().n(), + ExcDimensionMismatch(4*fe.dofs_per_vertex+ + 4*fe.dofs_per_line+ + fe.dofs_per_quad, + fe.constraints().n())); + Assert(5*fe.dofs_per_vertex+ + 12*fe.dofs_per_line+ + 4*fe.dofs_per_quad + == + fe.constraints().m(), + ExcDimensionMismatch(5*fe.dofs_per_vertex+ + 12*fe.dofs_per_line+ + 4*fe.dofs_per_quad, + fe.constraints().m())); + + // fill the dofs indices. Use same + // enumeration scheme as in + // #FiniteElement::constraints()# + for (unsigned int vertex=0; vertex<4; ++vertex) + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) + dofs_on_mother.push_back (face->vertex_dof_index(vertex,dof)); + for (unsigned int line=0; line<4; ++line) + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_mother.push_back (face->line(line)->dof_index(dof)); + for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof) + dofs_on_mother.push_back (face->dof_index(dof)); + + // dof numbers on vertex at the center + // of the face, which is vertex 2 of + // child zero, or vertex 3 of child 1 + // or vertex 0 of child 2 or vertex 1 + // of child 3. We're a bit cautious and + // check this (also an additional safety + // check for the internal states of the + // library) + Assert ((face->child(0)->vertex_dof_index(2,0) == + face->child(1)->vertex_dof_index(3,0)) && + (face->child(0)->vertex_dof_index(2,0) == + face->child(2)->vertex_dof_index(0,0)) && + (face->child(0)->vertex_dof_index(2,0) == + face->child(3)->vertex_dof_index(1,0)), + ExcInternalError()); + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) + dofs_on_children.push_back (face->child(0)->vertex_dof_index(2,dof)); + + // dof numbers on the centers of + // the lines bounding this face + for (unsigned int line=0; line<4; ++line) + for (unsigned int dof=0; dof!=fe.dofs_per_vertex; ++dof) + dofs_on_children.push_back (face->line(line)->child(0)->vertex_dof_index(1,dof)); + + // next the dofs on the lines interior + // to the face; the order of these + // lines is laid down in the + // FiniteElement class documentation + for (unsigned int dof=0; dofchild(0)->line(1)->dof_index(dof)); + for (unsigned int dof=0; dofchild(1)->line(2)->dof_index(dof)); + for (unsigned int dof=0; dofchild(2)->line(3)->dof_index(dof)); + for (unsigned int dof=0; dofchild(3)->line(0)->dof_index(dof)); + + // dofs on the bordering lines + for (unsigned int line=0; line<4; ++line) + for (unsigned int child=0; child<2; ++child) + for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) + dofs_on_children.push_back (face->line(line)->child(child)->dof_index(dof)); + + // finally, for the dofs interior + // to the four child faces + for (unsigned int child=0; child<4; ++child) + for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof) + dofs_on_children.push_back (face->child(child)->dof_index(dof)); + + Assert (dofs_on_children.size() == + fe.constraints().m(), + ExcDimensionMismatch(dofs_on_children.size(), + fe.constraints().m())); + Assert (dofs_on_mother.size() == + fe.constraints().n(), + ExcDimensionMismatch(dofs_on_mother.size(), + fe.constraints().n())); + + // for each row in the constraint + // matrix for this line: + for (unsigned int row=0; row!=dofs_on_children.size(); ++row) + { + constraints.add_line (dofs_on_children[row]); + for (unsigned int i=0; i!=dofs_on_mother.size(); ++i) + constraints.add_entry (dofs_on_children[row], + dofs_on_mother[i], + fe.constraints()(row,i)); + }; + }; +}; + +#endif + + + + +template +void DoFTools::distribute_cell_to_dof_vector (const DoFHandler &dof_handler, + const Vector &cell_data, + Vector &dof_data, + const unsigned int component) +{ + const Triangulation &tria = dof_handler.get_tria(); + const FiniteElement &fe = dof_handler.get_fe(); + + Assert (cell_data.size()==tria.n_active_cells(), + ExcWrongSize (cell_data.size(), tria.n_active_cells())); + Assert (dof_data.size()==dof_handler.n_dofs(), + ExcWrongSize (dof_data.size(), dof_handler.n_dofs())); + Assert (component < fe.n_components(), + ExcInvalidComponent(component, fe.n_components())); + + // store a flag whether we should care + // about different components. this is + // just a simplification, we could ask + // for this at every single place + // equally well + const bool consider_components = (fe.n_components() != 1); + + // count how often we have added a value + // in the sum for each dof + vector touch_count (dof_handler.n_dofs(), 0); + + DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), + endc = dof_handler.end(); + unsigned int present_cell = 0; + const unsigned int dofs_per_cell = fe.dofs_per_cell; + vector dof_indices (dofs_per_cell); + + for (; cell!=endc; ++cell, ++present_cell) + { + cell->get_dof_indices (dof_indices); + for (unsigned int i=0; i void DoFTools::extract_dofs(const DoFHandler &dof, @@ -348,6 +687,20 @@ DoFTools::make_sparsity_pattern (const DoFHandler& dof, const vector > &mask, SparseMatrixStruct &sparsity); +template +void +DoFTools::distribute_cell_to_dof_vector (const DoFHandler &dof_handler, + const Vector &cell_data, + Vector &dof_data) const; + +template +void +DoFTools::distribute_cell_to_dof_vector (const DoFHandler &dof_handler, + const Vector &cell_data, + Vector &dof_data) const; + + + template void DoFTools::extract_dofs(const DoFHandler& dof, const vector& local_select, vector& selected_dofs); diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index 30c7516540..67db86386e 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -88,7 +88,7 @@ void ProblemBase::assemble (const Equation &equation, // make up sparsity pattern and // compress with constraints constraints.clear (); - dof_handler->make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof_handler, constraints); constraints.close (); DoFTools::make_sparsity_pattern (*dof_handler, system_sparsity); constraints.condense (system_sparsity); diff --git a/tests/big-tests/convergence/convergence.cc b/tests/big-tests/convergence/convergence.cc index b95a2e8dc6..40ec20423f 100644 --- a/tests/big-tests/convergence/convergence.cc +++ b/tests/big-tests/convergence/convergence.cc @@ -3,12 +3,13 @@ #include -#include #include -#include #include #include +#include +#include #include +#include #include #include #include @@ -387,13 +388,13 @@ int PoissonProblem::run (const unsigned int level) { Vector linfty_error_per_dof(dof->n_dofs()); Vector h1_seminorm_error_per_dof(dof->n_dofs()); Vector h1_error_per_dof(dof->n_dofs()); - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, - linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell, - h1_seminorm_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, + linfty_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell, + h1_seminorm_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); // Vector projected_solution; // ConstraintMatrix constraints; diff --git a/tests/big-tests/dof/dof_test.cc b/tests/big-tests/dof/dof_test.cc index 594c1c0842..5fe5ecf078 100644 --- a/tests/big-tests/dof/dof_test.cc +++ b/tests/big-tests/dof/dof_test.cc @@ -376,7 +376,7 @@ void TestCases::run (ParameterHandler &prm) { // computing constraints cout << " Computing constraints..." << endl; ConstraintMatrix constraints; - dof->make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof, constraints); constraints.close (); constraints.condense (sparsity); diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index 308df10603..9d6b65fdbe 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -2,20 +2,21 @@ /* Copyright W. Bangerth, University of Heidelberg, 1998 */ +#include +#include +#include +#include +#include #include -#include #include -#include -#include #include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -559,11 +560,11 @@ void PoissonProblem::run (ParameterHandler &prm) { Vector l2_error_per_dof(dof->n_dofs()), linfty_error_per_dof(dof->n_dofs()); Vector h1_error_per_dof(dof->n_dofs()), estimated_error_per_dof(dof->n_dofs()); Vector error_ratio (dof->n_dofs()); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); - dof->distribute_cell_to_dof_vector (estimated_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, estimated_error_per_cell, estimated_error_per_dof); error_ratio.ratio (h1_error_per_dof, estimated_error_per_dof); diff --git a/tests/big-tests/multigrid/multigrid.cc b/tests/big-tests/multigrid/multigrid.cc index 9e13e94fd2..a862bdda17 100644 --- a/tests/big-tests/multigrid/multigrid.cc +++ b/tests/big-tests/multigrid/multigrid.cc @@ -353,7 +353,7 @@ void PoissonProblem::assemble (const Equation &equation, // make up sparsity pattern and // compress with constraints constraints.clear (); - dof->DoFHandler::make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof, constraints); constraints.close (); DoFTools::make_sparsity_pattern (*dof, system_sparsity); constraints.condense (system_sparsity); @@ -557,13 +557,13 @@ int PoissonProblem::run (const unsigned int level) { Vector linfty_error_per_dof (dof->DoFHandler::n_dofs()); Vector h1_seminorm_error_per_dof (dof->DoFHandler::n_dofs()); Vector h1_error_per_dof (dof->DoFHandler::n_dofs()); - dof->distribute_cell_to_dof_vector (l1_error_per_cell, l1_error_per_dof); - dof->distribute_cell_to_dof_vector (l2_error_per_cell, l2_error_per_dof); - dof->distribute_cell_to_dof_vector (linfty_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, l1_error_per_cell, l1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, l2_error_per_cell, l2_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, linfty_error_per_cell, linfty_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_seminorm_error_per_cell, + DoFTools::distribute_cell_to_dof_vector (*dof, h1_seminorm_error_per_cell, h1_seminorm_error_per_dof); - dof->distribute_cell_to_dof_vector (h1_error_per_cell, h1_error_per_dof); + DoFTools::distribute_cell_to_dof_vector (*dof, h1_error_per_cell, h1_error_per_dof); // Vector projected_solution; // ConstraintMatrix constraints; diff --git a/tests/deal.II/Makefile b/tests/deal.II/Makefile index a28e9fa1cb..5b38fb1744 100644 --- a/tests/deal.II/Makefile +++ b/tests/deal.II/Makefile @@ -44,6 +44,15 @@ libdeal1d = -ldeal_II_1d flags = $(CXXFLAGS.o) $(CXXFLAGS) endif + +%.go : %.cc Makefile + @echo =====debug========= $< + @$(CXX) $(flags) -c $< -o $@ +%.o : %.cc Makefile + @echo =====optimized===== $< + @$(CXX) $(flags) -c $< -o $@ + + all: grid_test.check dof_test.check fe_tables.check gradients.check \ constraints.check mg.check mglocal.check wave-test-3.check second_derivatives.check diff --git a/tests/deal.II/dof_test.cc b/tests/deal.II/dof_test.cc index 76c56ed1d9..fcf5b1d58a 100644 --- a/tests/deal.II/dof_test.cc +++ b/tests/deal.II/dof_test.cc @@ -313,7 +313,7 @@ void TestCases::run (const unsigned int test_case) // computing constraints deallog << " Computing constraints..." << endl; ConstraintMatrix constraints; - dof->make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof, constraints); constraints.close (); constraints.condense (sparsity); diff --git a/tests/deal.II/wave-test-3.cc b/tests/deal.II/wave-test-3.cc index bb0d86d318..a3b4da9777 100644 --- a/tests/deal.II/wave-test-3.cc +++ b/tests/deal.II/wave-test-3.cc @@ -5338,7 +5338,7 @@ void TimeStep_Wave::wake_up (const unsigned int wakeup_level) constraints.clear (); - dof_handler->make_hanging_node_constraints (constraints); + DoFTools::make_hanging_node_constraints (*dof_handler, constraints); constraints.close (); sweep_info->get_timers().grid_generation.stop(); @@ -7944,9 +7944,9 @@ void TimeStep_Postprocess::postprocess_timestep () else { estimated_error.reinit (get_timestep_primal().dof_handler->n_dofs()); - get_timestep_primal().dof_handler - ->distribute_cell_to_dof_vector (estimated_error_per_cell, - estimated_error); + DoFTools::distribute_cell_to_dof_vector (*get_timestep_primal().dof_handler, + estimated_error_per_cell, + estimated_error); }; out.add_data_vector (estimated_error, "est_error"); -- 2.39.5