From: wolf Date: Mon, 29 Mar 1999 12:59:05 +0000 (+0000) Subject: Commit a larger patch which removes some arguments from many functions, namely Bounda... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a1df88091a2364935ad308f331c217218735d33;p=dealii-svn.git Commit a larger patch which removes some arguments from many functions, namely Boundary and FiniteElement references. These pointers can be obtained from the DoFHandler object in a safer way, so we should prefer it. Apart from the constructor of FE[[Sub]Face]Values objects, only arguments were dropped. git-svn-id: https://svn.dealii.org/trunk@1061 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/Attic/examples/convergence/convergence.cc b/deal.II/deal.II/Attic/examples/convergence/convergence.cc index ea60055883..294eddeadd 100644 --- a/deal.II/deal.II/Attic/examples/convergence/convergence.cc +++ b/deal.II/deal.II/Attic/examples/convergence/convergence.cc @@ -324,7 +324,7 @@ int PoissonProblem::run (const unsigned int level) { ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc); + assemble (equation, *quadrature, update_flags, dirichlet_bc); cout << " Solving..." << endl; solve (); 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 d7f3b25264..93d58e28cc 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 @@ -466,7 +466,7 @@ void PoissonProblem::run (ParameterHandler &prm) { ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = solution_function; - assemble (*equation, quadrature, fe, update_flags, dirichlet_bc); + assemble (*equation, quadrature, update_flags, dirichlet_bc); // if we have an old solution lying // around, use it to preset the solution @@ -524,7 +524,7 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << " Estimating H1 error... "; KellyErrorEstimator ee; QSimpson eq; - ee.estimate_error (*dof, eq, fe, *boundary, + ee.estimate_error (*dof, eq, KellyErrorEstimator::FunctionMap(), solution, estimated_error_per_cell, diff --git a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc index b48010db69..6270ca3864 100644 --- a/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc +++ b/deal.II/deal.II/Attic/examples/multigrid/multigrid.cc @@ -104,10 +104,8 @@ class PoissonProblem { */ virtual void assemble (const Equation &equation, const Quadrature &q, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc = FunctionMap(), - const Boundary &boundary = StraightBoundary()); + const FunctionMap &dirichlet_bc = FunctionMap()); int run (unsigned int level); void print_history (string filename) const; @@ -326,10 +324,8 @@ void PoissonProblem::create_new () { template void PoissonProblem::assemble (const Equation &equation, const Quadrature &quadrature, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc, - const Boundary &boundary) { + const FunctionMap &dirichlet_bc) { Assert ((tria!=0) && (dof!=0), ExcNoTriaSelected()); system_sparsity.reinit (dof->DoFHandler::n_dofs(), @@ -356,9 +352,7 @@ void PoissonProblem::assemble (const Equation &equation, system_matrix, right_hand_side, quadrature, - fe, - update_flags, - boundary); + update_flags); active_assemble_iterator assembler (tria, tria->begin_active()->level(), tria->begin_active()->index(), @@ -379,7 +373,7 @@ void PoissonProblem::assemble (const Equation &equation, // apply Dirichlet bc as described // in the docs map boundary_value_list; - VectorTools::interpolate_boundary_values (*dof, dirichlet_bc, boundary, + VectorTools::interpolate_boundary_values (*dof, dirichlet_bc, boundary_value_list); MatrixTools::apply_boundary_values (boundary_value_list, system_matrix, solution, @@ -480,7 +474,7 @@ int PoissonProblem::run (const unsigned int level) { map*> dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc); + assemble (equation, *quadrature, update_flags, dirichlet_bc); cout << " Solving..." << endl; solve (); diff --git a/deal.II/deal.II/Attic/examples/nonlinear/fixed-point-iteration/nonlinear.cc b/deal.II/deal.II/Attic/examples/nonlinear/fixed-point-iteration/nonlinear.cc index 429a101ed6..357accccd6 100644 --- a/deal.II/deal.II/Attic/examples/nonlinear/fixed-point-iteration/nonlinear.cc +++ b/deal.II/deal.II/Attic/examples/nonlinear/fixed-point-iteration/nonlinear.cc @@ -200,7 +200,7 @@ void NonlinearProblem::run () { assemble (equation, quadrature, fe, UpdateFlags(update_gradients | update_JxW_values | update_q_points), - dirichlet_bc, boundary); + dirichlet_bc); cout << " Solving..." << endl; solve (); @@ -227,7 +227,7 @@ void NonlinearProblem::run () { Vector error_indicator; KellyErrorEstimator ee; QSimpson eq; - ee.estimate_error (*dof, eq, fe, boundary, + ee.estimate_error (*dof, eq, fe, KellyErrorEstimator::FunctionMap(), solution, error_indicator); diff --git a/deal.II/deal.II/Attic/examples/poisson/problem.cc b/deal.II/deal.II/Attic/examples/poisson/problem.cc index 5355fd04f9..331505ad78 100644 --- a/deal.II/deal.II/Attic/examples/poisson/problem.cc +++ b/deal.II/deal.II/Attic/examples/poisson/problem.cc @@ -540,10 +540,10 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << " Assembling matrices..." << endl; ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, quadrature, fe, + assemble (equation, quadrature, UpdateFlags(update_gradients | update_JxW_values | update_q_points), - dirichlet_bc, *boundary); + dirichlet_bc); cout << " Solving..." << endl; solve (); diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index 96756519f8..540908a18a 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -896,7 +896,8 @@ class FiniteElement : public FiniteElementBase * This function is more or less an * interface to the #FEValues# class and * should not be used by users unless - * absolutely needed. */ + * absolutely needed. + */ virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, const vector > &unit_points, vector > &jacobians, @@ -908,8 +909,7 @@ class FiniteElement : public FiniteElementBase vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_grads_transform, - const Boundary &boundary) const; + const vector > > &shape_grads_transform) const; /** * Do the same thing that the other @@ -1032,8 +1032,7 @@ class FiniteElement : public FiniteElementBase vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const vector > > &shape_grads_transform, - const Boundary &boundary) const; + const vector > > &shape_grads_transform) const; /** * This function does almost the same as @@ -1079,8 +1078,7 @@ class FiniteElement : public FiniteElementBase vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const vector > > &shape_grads_transform, - const Boundary &boundary) const; + const vector > > &shape_grads_transform) const; /** * Return the support points of the @@ -1127,9 +1125,18 @@ class FiniteElement : public FiniteElementBase * equidistant off-points on the unit * line. For all other dimensions, an * overwritten function has to be provided. + * + * For higher order transformations than + * the common (bi-, tri-)linear one, + * information about the boundary is + * needed, rather than only the readily + * available information on the location + * of the vertices. If necessary, we + * therefore rely on the boundary object + * of which a pointer is stored by the + * triangulation. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, vector > &support_points) const; /** @@ -1171,9 +1178,15 @@ class FiniteElement : public FiniteElementBase * dimension would be senseless, all * derived classes should throw an error * when called with #dim==1#. + * + * Regarding information about the + * boundary, which is necessary for + * higher order transformations than + * the usual (bi-, tri-)linear ones, + * refer to the #get_support_points# + * function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const =0; /** @@ -1188,9 +1201,15 @@ class FiniteElement : public FiniteElementBase * dimension would be senseless, all * derived classes should throw an error * when called with #dim==1#. + * + * Regarding information about the + * boundary, which is necessary for + * higher order transformations than + * the usual (bi-, tri-)linear ones, + * refer to the #get_support_points# + * function. */ virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const Boundary &boundary, const vector > &unit_points, vector &face_jacobi_determinants) const =0; @@ -1223,10 +1242,16 @@ class FiniteElement : public FiniteElementBase * dimension would be senseless, all * derived classes should throw an error * when called with #dim==1#. + * + * Regarding information about the + * boundary, which is necessary for + * higher order transformations than + * the usual (bi-, tri-)linear ones, + * refer to the #get_support_points# + * function. */ virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, const unsigned int face_no, - const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const =0; @@ -1347,9 +1372,15 @@ class FiniteElement : public FiniteElementBase * classes not implementing this function * are assumed to state this in their * documentation. + * + * Regarding information about the + * boundary, which is necessary for + * higher order transformations than + * the usual (bi-, tri-)linear ones, + * refer to the #get_support_points# + * function. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const =0; /** diff --git a/deal.II/deal.II/include/fe/fe_lib.criss_cross.h b/deal.II/deal.II/include/fe/fe_lib.criss_cross.h index 6381a946ff..a0cf2ea66c 100644 --- a/deal.II/deal.II/include/fe/fe_lib.criss_cross.h +++ b/deal.II/deal.II/include/fe/fe_lib.criss_cross.h @@ -211,7 +211,6 @@ class FECrissCross : public FiniteElement { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, vector > &support_points) const; /** @@ -219,7 +218,6 @@ class FECrissCross : public FiniteElement { * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** @@ -227,7 +225,6 @@ class FECrissCross : public FiniteElement { * information on this function. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; /** @@ -260,7 +257,6 @@ class FECrissCross : public FiniteElement { * simply returns the length of the face. */ virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const Boundary &boundary, const vector > &unit_points, vector &face_jacobi_determinants) const; @@ -293,7 +289,6 @@ class FECrissCross : public FiniteElement { */ virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, const unsigned int face_no, - const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; @@ -326,10 +321,7 @@ class FECrissCross : public FiniteElement { * function simply passes through to * the one implemented in the base class. * For higher dimensional finite elements - * we use linear mappings and therefore - * the boundary object is ignored since - * the boundary is approximated using - * piecewise multilinear boundary segments. + * we use multilinear mappings. */ virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, const vector > &unit_points, @@ -342,8 +334,7 @@ class FECrissCross : public FiniteElement { vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_grad_transform, - const Boundary &boundary) const; + const vector > > &shape_grad_transform) const; DeclException0 (ExcNotUseful); }; diff --git a/deal.II/deal.II/include/fe/fe_lib.dg.h b/deal.II/deal.II/include/fe/fe_lib.dg.h index 7b8c787804..03b996dc34 100644 --- a/deal.II/deal.II/include/fe/fe_lib.dg.h +++ b/deal.II/deal.II/include/fe/fe_lib.dg.h @@ -59,7 +59,6 @@ class FEDGConstant : public FELinearMapping { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, vector > &support_points) const; /** @@ -67,7 +66,6 @@ class FEDGConstant : public FELinearMapping { * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** @@ -75,7 +73,6 @@ class FEDGConstant : public FELinearMapping { * information on this function. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; /** @@ -133,7 +130,6 @@ class FEDGLinear : public FELinear{ * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; @@ -180,7 +176,6 @@ class FEDGQuadraticSub : public FEQuadraticSub{ * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** @@ -227,7 +222,6 @@ class FEDGCubicSub : public FECubicSub{ * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** @@ -273,7 +267,6 @@ class FEDGQuarticSub : public FEQuarticSub{ * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** diff --git a/deal.II/deal.II/include/fe/fe_lib.lagrange.h b/deal.II/deal.II/include/fe/fe_lib.lagrange.h index cabbf3d545..5114f9b90d 100644 --- a/deal.II/deal.II/include/fe/fe_lib.lagrange.h +++ b/deal.II/deal.II/include/fe/fe_lib.lagrange.h @@ -84,16 +84,14 @@ class FELinear : public FELinearMapping { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed @@ -109,7 +107,6 @@ class FELinear : public FELinearMapping { * is thrown instead. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; private: @@ -265,16 +262,14 @@ class FEQuadraticSub : public FELinearMapping { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed @@ -290,7 +285,6 @@ class FEQuadraticSub : public FELinearMapping { * is thrown instead. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; private: @@ -390,16 +384,14 @@ class FECubicSub : public FELinearMapping { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed @@ -415,7 +407,6 @@ class FECubicSub : public FELinearMapping { * is thrown instead. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; private: @@ -516,16 +507,14 @@ class FEQuarticSub : public FELinearMapping { * information on this function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, - vector > &support_points) const; + vector > &support_points) const; /** * Refer to the base class for detailed @@ -541,7 +530,6 @@ class FEQuarticSub : public FELinearMapping { * is thrown instead. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; private: diff --git a/deal.II/deal.II/include/fe/fe_linear_mapping.h b/deal.II/deal.II/include/fe/fe_linear_mapping.h index 67cd6426e2..0ce48ecdd2 100644 --- a/deal.II/deal.II/include/fe/fe_linear_mapping.h +++ b/deal.II/deal.II/include/fe/fe_linear_mapping.h @@ -65,7 +65,6 @@ class FELinearMapping : public FiniteElement { * simply returns the length of the face. */ virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const Boundary &boundary, const vector > &unit_points, vector &face_jacobi_determinants) const; @@ -98,7 +97,6 @@ class FELinearMapping : public FiniteElement { */ virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, const unsigned int face_no, - const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; @@ -131,10 +129,7 @@ class FELinearMapping : public FiniteElement { * function simply passes through to * the one implemented in the base class. * For higher dimensional finite elements - * we use linear mappings and therefore - * the boundary object is ignored since - * the boundary is approximated using - * piecewise multilinear boundary segments. + * we use multilinear mappings. */ virtual void fill_fe_values (const DoFHandler::cell_iterator &cell, const vector > &unit_points, @@ -147,8 +142,7 @@ class FELinearMapping : public FiniteElement { vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_grad_transform, - const Boundary &boundary) const; + const vector > > &shape_grad_transform) const; /** * Compute the jacobian matrices diff --git a/deal.II/deal.II/include/fe/fe_system.h b/deal.II/deal.II/include/fe/fe_system.h index 98d77ad4a1..90514ccccf 100644 --- a/deal.II/deal.II/include/fe/fe_system.h +++ b/deal.II/deal.II/include/fe/fe_system.h @@ -185,7 +185,6 @@ class FESystem // * refer to the #shape_value# function. */ virtual void get_support_points (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, vector > &support_points) const; /** @@ -193,7 +192,6 @@ class FESystem // * information on this function. */ virtual void get_face_support_points (const DoFHandler::face_iterator &face, - const Boundary &boundary, vector > &support_points) const; /** @@ -233,7 +231,6 @@ class FESystem // * information on this function. */ virtual void get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &boundary, FullMatrix &local_mass_matrix) const; /** @@ -270,7 +267,6 @@ class FESystem // * underlying object. */ virtual void get_face_jacobians (const DoFHandler::face_iterator &face, - const Boundary &boundary, const vector > &unit_points, vector &face_jacobi_determinants) const; @@ -306,7 +302,6 @@ class FESystem // */ virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, const unsigned int face_no, - const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; @@ -345,8 +340,7 @@ class FESystem // vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_grad_transform, - const Boundary &boundary) const; + const vector > > &shape_grad_transform) const; /** * Number of different base diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 72a0f6393b..4bee616711 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -248,7 +249,8 @@ class FEValuesBase { const unsigned int n_transform_functions, const unsigned int n_values_array, const UpdateFlags update_flags, - const FiniteElement &fe); + const FiniteElement &fe, + const Boundary &boundary); /** @@ -691,7 +693,12 @@ class FEValuesBase { /** * Store the finite element for later use. */ - SmartPointer > fe; + const SmartPointer > fe; + + /** + * Store the boundary for later use. + */ + const SmartPointer > boundary; }; @@ -735,15 +742,6 @@ class FEValues : public FEValuesBase { * gradients, true quadrature points, etc.) * need to be initialized using the * #reinit# function. - */ - FEValues (const FiniteElement &, - const Quadrature &, - const UpdateFlags); - - /** - * Reinitialize the gradients, Jacobi - * determinants, etc for the given cell - * and the given finite element. * * This function needs a boundary object * passed, since this class needs to know @@ -758,8 +756,17 @@ class FEValues : public FEValuesBase { * segments, but higher order elements * may use other ways.) */ - void reinit (const typename DoFHandler::cell_iterator &, - const Boundary &); + FEValues (const FiniteElement &fe, + const Quadrature &quadrature, + const UpdateFlags update_flags, + const Boundary &boundary); + + /** + * Reinitialize the gradients, Jacobi + * determinants, etc for the given cell + * and the given finite element. + */ + void reinit (const typename DoFHandler::cell_iterator &); private: /** @@ -897,7 +904,8 @@ class FEFaceValuesBase : public FEValuesBase { const unsigned int n_transform_functions, const unsigned int n_faces_or_subfaces, const UpdateFlags update_flags, - const FiniteElement &fe); + const FiniteElement &fe, + const Boundary &boundary); /** * Return the outward normal vector to @@ -1025,18 +1033,8 @@ class FEFaceValues : public FEFaceValuesBase { * gradients, true quadrature points, etc.) * need to be initialized using the * #reinit# function. - */ - FEFaceValues (const FiniteElement &, - const Quadrature &, - const UpdateFlags); - - /** - * Reinitialize the gradients, Jacobi - * determinants, etc for the face with - * number #face_no# of #cell# - * and the given finite element. * - * The constructor needs a boundary object + * This function needs a boundary object * passed, since this class needs to know * how to handle faces which are located * on the boundary of the domain. In that @@ -1049,9 +1047,19 @@ class FEFaceValues : public FEFaceValuesBase { * segments, but higher order elements * may use other ways.) */ + FEFaceValues (const FiniteElement &, + const Quadrature &, + const UpdateFlags, + const Boundary &); + + /** + * Reinitialize the gradients, Jacobi + * determinants, etc for the face with + * number #face_no# of #cell# + * and the given finite element. + */ void reinit (const typename DoFHandler::cell_iterator &cell, - const unsigned int face_no, - const Boundary &boundary); + const unsigned int face_no); }; @@ -1176,33 +1184,20 @@ class FESubfaceValues : public FEFaceValuesBase { * need to be initialized using the * #reinit# function. */ - FESubfaceValues (const FiniteElement &, - const Quadrature &, - const UpdateFlags); + FESubfaceValues (const FiniteElement &fe, + const Quadrature &face_quadrature, + const UpdateFlags update_flags, + const Boundary &boundary); /** * Reinitialize the gradients, Jacobi * determinants, etc for the face with * number #face_no# of #cell# * and the given finite element. - * - * The constructor needs a boundary object - * passed, since this class needs to know - * how to handle faces which are located - * on the boundary of the domain. In that - * case, faces may be curved and the - * calculation of quadrature points, - * gradients and the like may need - * additional effort, depending on the - * mapping from the unit to the real cell - * (linear mappings use straight boundary - * segments, but higher order elements - * may use other ways.) */ void reinit (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const unsigned int subface_no, - const Boundary &boundary); + const unsigned int subface_no); /** * Exception diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index f3c2538cf6..6116968413 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1508,6 +1508,28 @@ class Triangulation : public TriaDimensionInfo, public Subscriptor { */ void set_boundary (const Boundary *boundary_object); + /** + * Return a constant reference to the boundary + * object used for this triangulation. This + * is necessary for a host of applications + * that need to use the exact shape of the + * boundary. Since the boundary used by all + * these applications, it is useful to ask + * the triangulation rather than asking + * for another parameter for each of these + * functions. + * + * If you need to store a pointer to the + * boundary somewhere, for example + * in the constructor of an object, for + * later use in the member functions, + * you should consider calling #subscribe# + * on the boundary to guarantee that the + * boundary object is still alive during + * the lifetime of your object. + */ + const Boundary & get_boundary () const; + /** * Copy a triangulation. This operation is * not cheap, so you should be careful diff --git a/deal.II/deal.II/include/numerics/assembler.h b/deal.II/deal.II/include/numerics/assembler.h index d7d12350e0..f7fd813519 100644 --- a/deal.II/deal.II/include/numerics/assembler.h +++ b/deal.II/deal.II/include/numerics/assembler.h @@ -142,9 +142,7 @@ struct AssemblerData { SparseMatrix &matrix, Vector &rhs_vector, const Quadrature &quadrature, - const FiniteElement &fe, - const UpdateFlags &update_flags, - const Boundary &boundary); + const UpdateFlags &update_flags); /** * Pointer to the dof handler object @@ -182,29 +180,12 @@ struct AssemblerData { */ const Quadrature &quadrature; - /** - * Use this FE type for the assemblage - * process. The FE object must match that - * used to construct the #DoFHandler# - * object. - */ - const FiniteElement &fe; - /** * Store which of the fields of the * FEValues object need to be reinitialized * on each cell. */ const UpdateFlags update_flags; - - /** - * Store a pointer to the object describing - * the boundary of the domain. This is - * necessary, since we may want to use - * curved faces of cells at the boundary - * when using higher order elements. - */ - const Boundary &boundary; }; @@ -304,36 +285,11 @@ class Assembler : public DoFCellAccessor { */ Vector &rhs_vector; - /** - * Pointer to the finite element used for - * the assemblage process. We store a - * pointer to the finite element, not a - * copy, but this is not a problem, since - * #Assembler# objects are usually created - * and deleted by the - * #ProblemBase::assemble# routine, which - * itself gets passed the finite element; - * the lifetime of the #Assembler# object - * is thus less than the lifetime of the - * finite element object and storing - * a pointer is not risky. - */ - const FiniteElement &fe; - /** * The finite element evaluated at the * quadrature points. */ FEValues fe_values; - - /** - * Store a pointer to the object describing - * the boundary of the domain. This is - * necessary, since we may want to use - * curved faces of cells at the boundary - * when using higher order elements. - */ - const Boundary &boundary; }; diff --git a/deal.II/deal.II/include/numerics/base.h b/deal.II/deal.II/include/numerics/base.h index df6bacb1cb..e3d159272c 100644 --- a/deal.II/deal.II/include/numerics/base.h +++ b/deal.II/deal.II/include/numerics/base.h @@ -150,10 +150,8 @@ class ProblemBase { */ virtual void assemble (const Equation &equation, const Quadrature &q, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc = FunctionMap(), - const Boundary &boundary = StraightBoundary()); + const FunctionMap &dirichlet_bc = FunctionMap()); /** * Solve the system of equations. This uses diff --git a/deal.II/deal.II/include/numerics/error_estimator.h b/deal.II/deal.II/include/numerics/error_estimator.h index 32c8bdbd4e..b188e0af5d 100644 --- a/deal.II/deal.II/include/numerics/error_estimator.h +++ b/deal.II/deal.II/include/numerics/error_estimator.h @@ -112,6 +112,8 @@ * * \item No other boundary conditions are considered. * \end{itemize} + * The object describing the boundary conditions is obtained from the + * triangulation. * * Thanks go to Franz-Theo Suttmeier for clarifications about boundary * conditions. @@ -166,8 +168,6 @@ class KellyErrorEstimator { */ static void estimate_error (const DoFHandler &dof, const Quadrature &quadrature, - const FiniteElement &fe, - const Boundary &boundary, const FunctionMap &neumann_bc, const Vector &solution, Vector &error, @@ -221,8 +221,6 @@ class KellyErrorEstimator { */ static void integrate_over_regular_face (const active_cell_iterator &cell, const unsigned int face_no, - const FiniteElement &fe, - const Boundary &boundary, const FunctionMap &neumann_bc, const unsigned int n_q_points, FEFaceValues &fe_face_values_cell, @@ -241,8 +239,6 @@ class KellyErrorEstimator { */ static void integrate_over_irregular_face (const active_cell_iterator &cell, const unsigned int face_no, - const FiniteElement &fe, - const Boundary &boundary, const unsigned int n_q_points, FEFaceValues &fe_face_values, FESubfaceValues &fe_subface_values, diff --git a/deal.II/deal.II/include/numerics/matrices.h b/deal.II/deal.II/include/numerics/matrices.h index 4156e0ede4..035520209b 100644 --- a/deal.II/deal.II/include/numerics/matrices.h +++ b/deal.II/deal.II/include/numerics/matrices.h @@ -117,6 +117,8 @@ * pattern, which can be created using the * #DoFHandler<>::make_boundary_sparsity_pattern# function. * + * The object describing the exact form of the boundary is obtained from the + * triangulation object. * * \subsection{Right hand sides} * @@ -183,7 +185,6 @@ class MatrixCreator { */ static void create_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function *a = 0); @@ -206,7 +207,6 @@ class MatrixCreator { */ static void create_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, @@ -232,7 +232,6 @@ class MatrixCreator { * for more information. */ static void create_mass_matrix (const DoFHandler &dof, - const Boundary &boundary, SparseMatrix &matrix); /** @@ -252,7 +251,6 @@ class MatrixCreator { */ static void create_boundary_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const FunctionMap &rhs, Vector &rhs_vector, @@ -269,7 +267,6 @@ class MatrixCreator { */ static void create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function *a = 0); @@ -284,7 +281,6 @@ class MatrixCreator { */ static void create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index 4607d270ba..37582b53b2 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -77,7 +77,7 @@ enum NormType { * the projection. * * In order to get proper results, it may necessary to treat boundary - * conditions right. Below are listed some cases wher this may be needed. + * conditions right. Below are listed some cases where this may be needed. * If needed, this is done by $L_2$-projection of the trace of the * given function onto the finite element space restricted to the boundary * of the domain, then taking this information and using it to eliminate @@ -238,7 +238,9 @@ enum NormType { * \end{itemize} * * All functions use the finite element given to the #DoFHandler# object the last - * time that the degrees of freedom were distributed over the triangulation. + * time that the degrees of freedom were distributed over the triangulation. Also, + * if access to an object describing the exact form of the boundary is needed, the + * pointer stored within the triangulation object is accessed. * * @author Wolfgang Bangerth, 1998 */ @@ -277,7 +279,6 @@ class VectorTools // * class for further information. */ static void interpolate (const DoFHandler &dof, - const Boundary &boundary, const Function &function, Vector &vec); @@ -317,7 +318,6 @@ class VectorTools // */ static void project (const DoFHandler &dof, const ConstraintMatrix &constraints, - const Boundary &boundary, const Quadrature &q, const Function &function, Vector &vec, @@ -333,7 +333,6 @@ class VectorTools // */ static void create_right_hand_side (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, const Function &rhs, Vector &rhs_vector); @@ -354,7 +353,6 @@ class VectorTools // */ static void interpolate_boundary_values (const DoFHandler &dof, const FunctionMap &dirichlet_bc, - const Boundary &boundary, map &boundary_values); /** @@ -364,7 +362,6 @@ class VectorTools // */ static void interpolate_boundary_values (const DoFHandler &dof, const VectorFunctionMap &dirichlet_bc, - const Boundary &boundary, map &boundary_values); /** @@ -383,7 +380,6 @@ class VectorTools // static void project_boundary_values (const DoFHandler &dof, const FunctionMap &boundary_functions, const Quadrature &q, - const Boundary &boundary, map &boundary_values); /** @@ -411,21 +407,18 @@ class VectorTools // const Function &exact_solution, Vector &difference, const Quadrature &q, - const NormType &norm, - const Boundary &boundary=StraightBoundary()); + const NormType &norm); /** * Compute the error for the solution of a system. * See the other #integrate_difference#. */ - static void integrate_difference (const DoFHandler &dof, + static void integrate_difference (const DoFHandler &dof, const Vector &fe_function, const VectorFunction&exact_solution, Vector &difference, const Quadrature &q, - const FiniteElement &fe, - const NormType &norm, - const Boundary &boundary); + const NormType &norm); /** diff --git a/deal.II/deal.II/source/fe/fe.cc b/deal.II/deal.II/source/fe/fe.cc index f4dbb5fdde..cf7ab66623 100644 --- a/deal.II/deal.II/source/fe/fe.cc +++ b/deal.II/deal.II/source/fe/fe.cc @@ -242,7 +242,6 @@ FiniteElement::FiniteElement (const FiniteElementData &fe_data) : template <> void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, vector > &support_points) const; @@ -258,8 +257,7 @@ void FiniteElement<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cell, vector > &q_points, const bool compute_q_points, const FullMatrix &, - const vector > > &, - const Boundary<1> &boundary) const { + const vector > > &) const { Assert ((!compute_jacobians) || (jacobians.size() == unit_points.size()), ExcWrongFieldDimension(jacobians.size(), unit_points.size())); Assert ((!compute_jacobians_grad) || (jacobians_grad.size() == unit_points.size()), @@ -294,7 +292,7 @@ void FiniteElement<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cell, // to vertex two, all following are // equally spaced along the line if (compute_support_points) - get_support_points (cell, boundary, support_points); + get_support_points (cell, support_points); }; @@ -317,8 +315,7 @@ void FiniteElement<1>::fill_fe_face_values (const DoFHandler<1>::cell_iterator & vector > &, const bool, const FullMatrix &, - const vector > > &, - const Boundary<1> &) const { + const vector > > &) const { Assert (false, ExcNotImplemented()); }; @@ -340,8 +337,7 @@ void FiniteElement<1>::fill_fe_subface_values (const DoFHandler<1>::cell_iterato vector > &, const bool, const FullMatrix &, - const vector > > &, - const Boundary<1> &) const { + const vector > > &) const { Assert (false, ExcNotImplemented()); }; @@ -371,7 +367,6 @@ void FiniteElement<1>::get_unit_support_points (vector > &support_point template <> void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension(support_points.size(), total_dofs)); @@ -409,8 +404,7 @@ void FiniteElement::fill_fe_values (const DoFHandler::cell_iterator &, vector > &, const bool, const FullMatrix &, - const vector > > &, - const Boundary &) const { + const vector > > &) const { Assert (false, ExcPureFunctionCalled()); }; @@ -434,8 +428,7 @@ void FiniteElement::fill_fe_face_values (const DoFHandler::cell_iterat vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const vector > > &shape_gradients_transform, - const Boundary &boundary) const { + const vector > > &shape_gradients_transform) const { Assert (jacobians.size() == unit_points.size(), ExcWrongFieldDimension(jacobians.size(), unit_points.size())); Assert (q_points.size() == unit_points.size(), @@ -451,19 +444,18 @@ void FiniteElement::fill_fe_face_values (const DoFHandler::cell_iterat jacobians_grad, compute_jacobians_grad, dummy, false, q_points, compute_q_points, - shape_values_transform, shape_gradients_transform, - boundary); + shape_values_transform, shape_gradients_transform); if (compute_support_points) - get_face_support_points (cell->face(face_no), boundary, support_points); + get_face_support_points (cell->face(face_no), support_points); if (compute_face_jacobians) - get_face_jacobians (cell->face(face_no), boundary, - unit_points, face_jacobi_determinants); + get_face_jacobians (cell->face(face_no), + unit_points, + face_jacobi_determinants); if (compute_normal_vectors) - get_normal_vectors (cell, face_no, boundary, - unit_points, normal_vectors); + get_normal_vectors (cell, face_no, unit_points, normal_vectors); }; @@ -486,8 +478,7 @@ void FiniteElement::fill_fe_subface_values (const DoFHandler::cell_ite vector > &normal_vectors, const bool compute_normal_vectors, const FullMatrix &shape_values_transform, - const vector > > &shape_gradients_transform, - const Boundary &boundary) const { + const vector > > &shape_gradients_transform) const { Assert (jacobians.size() == unit_points.size(), ExcWrongFieldDimension(jacobians.size(), unit_points.size())); Assert (q_points.size() == unit_points.size(), @@ -501,8 +492,7 @@ void FiniteElement::fill_fe_subface_values (const DoFHandler::cell_ite jacobians_grad, compute_jacobians_grad, dummy, false, q_points, compute_q_points, - shape_values_transform, shape_gradients_transform, - boundary); + shape_values_transform, shape_gradients_transform); if (compute_face_jacobians) get_subface_jacobians (cell->face(face_no), subface_no, @@ -527,7 +517,6 @@ FiniteElement::get_unit_support_points (vector > &) const template void FiniteElement::get_support_points (const DoFHandler::cell_iterator &, - const Boundary &, vector > &) const { Assert (false, ExcPureFunctionCalled()); diff --git a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc index c5c3562e7e..eb0c56b093 100644 --- a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc +++ b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc @@ -350,7 +350,6 @@ void FECrissCross<1>::get_unit_support_points (vector >&) const { template <> void FECrissCross<1>::get_support_points (const DoFHandler<1>::cell_iterator &, - const Boundary<1> &, vector > &) const { Assert (false, ExcNotUseful()); }; @@ -359,7 +358,6 @@ void FECrissCross<1>::get_support_points (const DoFHandler<1>::cell_iterator &, template <> void FECrissCross<1>::get_face_support_points (const DoFHandler<1>::face_iterator &, - const Boundary<1> &, vector > &) const { Assert (false, ExcNotUseful()); }; @@ -368,7 +366,6 @@ void FECrissCross<1>::get_face_support_points (const DoFHandler<1>::face_iterato template <> void FECrissCross<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &, - const Boundary<1> &, FullMatrix &) const { Assert (false, ExcNotUseful()); }; @@ -395,7 +392,6 @@ Tensor<1,1> FECrissCross<1>::shape_grad_transform (const unsigned int, template <> void FECrissCross<1>::get_face_jacobians (const DoFHandler<1>::face_iterator &, - const Boundary<1> &, const vector > &, vector &) const { Assert (false, ExcNotUseful()); @@ -416,7 +412,6 @@ void FECrissCross<1>::get_subface_jacobians (const DoFHandler<1>::face_iterator template <> void FECrissCross<1>::get_normal_vectors (const DoFHandler<1>::cell_iterator &, const unsigned int, - const Boundary<1> &, const vector > &, vector > &) const { Assert (false, ExcNotUseful()); @@ -447,8 +442,7 @@ void FECrissCross<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &, vector > &, const bool , const FullMatrix &, - const vector > > &, - const Boundary<1> &) const { + const vector > > &) const { Assert (false, ExcNotUseful()); }; @@ -601,7 +595,6 @@ void FECrissCross<2>::get_unit_support_points (vector > &unit_points) c template <> void FECrissCross<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, vector > &support_points) const { const unsigned int dim = 2; @@ -639,7 +632,6 @@ void FECrissCross<2>::get_support_points (const DoFHandler<2>::cell_iterator &ce template <> void FECrissCross<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face, - const Boundary<2> &, vector > &support_points) const { const unsigned int dim = 2; @@ -656,7 +648,6 @@ void FECrissCross<2>::get_face_support_points (const DoFHandler<2>::face_iterato template <> void FECrissCross<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, FullMatrix &mass_matrix) const { Assert (mass_matrix.n() == total_dofs, ExcWrongFieldDimension(mass_matrix.n(),total_dofs)); @@ -818,7 +809,6 @@ Tensor<1,2> FECrissCross<2>::shape_grad_transform (const unsigned int i, template <> void FECrissCross<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face, - const Boundary<2> &, const vector > &unit_points, vector &face_jacobians) const { // more or less copied from the linear @@ -865,7 +855,6 @@ void FECrissCross<2>::get_subface_jacobians (const DoFHandler<2>::face_iterator template <> void FECrissCross<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell, const unsigned int face_no, - const Boundary<2> &, const vector > &unit_points, vector > &normal_vectors) const { // more or less copied from the linear @@ -943,8 +932,7 @@ void FECrissCross::fill_fe_values (const DoFHandler::cell_iterator &ce vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &/*shape_grad_transform*/, - const Boundary &boundary) const { + const vector > > &/*shape_grad_transform*/) const { Assert (jacobians.size() == unit_points.size(), ExcWrongFieldDimension(jacobians.size(), unit_points.size())); Assert (q_points.size() == unit_points.size(), @@ -958,7 +946,7 @@ void FECrissCross::fill_fe_values (const DoFHandler::cell_iterator &ce // we need the support points in any // way, wanted or not by the user if (compute_support_points) - get_support_points (cell, boundary, support_points); + get_support_points (cell, support_points); if (compute_q_points) { diff --git a/deal.II/deal.II/source/fe/fe_lib.cubic.cc b/deal.II/deal.II/source/fe/fe_lib.cubic.cc index 916ab0829e..a11e2c5178 100644 --- a/deal.II/deal.II/source/fe/fe_lib.cubic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.cubic.cc @@ -182,16 +182,14 @@ void FECubicSub<1>::get_unit_support_points (vector > &unit_points) con template <> void FECubicSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &boundary, - vector > &support_points) const { - FiniteElement<1>::get_support_points (cell, boundary, support_points); + vector > &support_points) const { + FiniteElement<1>::get_support_points (cell, support_points); }; template <> void FECubicSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, - const Boundary<1> &, vector > &) const { Assert (false, ExcInternalError()); }; @@ -200,8 +198,7 @@ void FECubicSub<1>::get_face_support_points (const typename DoFHandler<1>::face_ template <> void FECubicSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, - FullMatrix &local_mass_matrix) const { + FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); Assert (local_mass_matrix.m() == total_dofs, @@ -922,8 +919,7 @@ FECubicSub<2>::shape_grad_grad (const unsigned int i, template <> void FECubicSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, - FullMatrix &local_mass_matrix) const { + FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); Assert (local_mass_matrix.m() == total_dofs, @@ -1510,8 +1506,7 @@ void FECubicSub<2>::get_unit_support_points (vector > &unit_points) con template <> void FECubicSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell, - const Boundary<2>&, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -1585,8 +1580,7 @@ void FECubicSub<2>::get_support_points (const typename DoFHandler<2>::cell_itera template <> void FECubicSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face, - const Boundary<2> &, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == dofs_per_face, ExcWrongFieldDimension (support_points.size(), dofs_per_face)); @@ -11395,9 +11389,10 @@ return_value[2][2] = 2.0*(729.0/2.0*xi-1458.0*xi*xi+2187.0/2.0*xi*xi*xi)*eta+2.0 template <> -void FECubicSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, - const Boundary<3> &, - FullMatrix &local_mass_matrix) const { +void +FECubicSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, + FullMatrix &local_mass_matrix) const +{ Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); Assert (local_mass_matrix.m() == total_dofs, @@ -11482,8 +11477,7 @@ void FECubicSub<3>::get_unit_support_points (vector > &unit_points) con template <> void FECubicSub<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell, - const Boundary<3>&, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -11861,7 +11855,6 @@ void FECubicSub<3>::get_support_points (const typename DoFHandler<3>::cell_itera template <> void FECubicSub<3>::get_face_support_points (const typename DoFHandler<3>::face_iterator &face, - const Boundary<3> &, vector > &support_points) const { Assert (support_points.size() == dofs_per_face, ExcWrongFieldDimension (support_points.size(), dofs_per_face)); diff --git a/deal.II/deal.II/source/fe/fe_lib.dg.cc b/deal.II/deal.II/source/fe/fe_lib.dg.cc index 8bea4b7628..4936b59682 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dg.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dg.cc @@ -29,7 +29,6 @@ FEDGQuarticSub::FEDGQuarticSub(): template void FEDGLinear::get_face_support_points (const typename DoFHandler::face_iterator &, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == 0), ExcWrongFieldDimension (support_points.size(),0)); @@ -48,7 +47,6 @@ FEDGLinear::restrict (const unsigned int child) const { template void FEDGQuadraticSub::get_face_support_points (const typename DoFHandler::face_iterator &, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == 0), ExcWrongFieldDimension (support_points.size(),0)); @@ -67,7 +65,6 @@ FEDGQuadraticSub::restrict (const unsigned int child) const { template void FEDGCubicSub::get_face_support_points (const typename DoFHandler::face_iterator &, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == 0), ExcWrongFieldDimension (support_points.size(),0)); @@ -87,7 +84,6 @@ FEDGCubicSub::restrict (const unsigned int child) const { template void FEDGQuarticSub::get_face_support_points (const typename DoFHandler::face_iterator &, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == 0), ExcWrongFieldDimension (support_points.size(),0)); diff --git a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc index 91f3a231ad..10ced322ca 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc @@ -44,8 +44,8 @@ FEDGConstant<1>::FEDGConstant () : template <> -void FEDGConstant<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, - const Boundary<1> &, +void +FEDGConstant<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, vector > &) const { Assert (false, ExcInternalError()); }; @@ -126,7 +126,6 @@ FEDGConstant::shape_grad_grad (const unsigned int i, template void FEDGConstant::get_local_mass_matrix (const DoFHandler::cell_iterator &cell, - const Boundary &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -151,7 +150,6 @@ FEDGConstant::get_unit_support_points (vector > &unit_points) co template void FEDGConstant::get_support_points (const typename DoFHandler::cell_iterator &cell, - const Boundary &, vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -163,7 +161,6 @@ FEDGConstant::get_support_points (const typename DoFHandler::cell_iter template void FEDGConstant::get_face_support_points (const typename DoFHandler::face_iterator &, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == 0), ExcWrongFieldDimension (support_points.size(),0)); diff --git a/deal.II/deal.II/source/fe/fe_lib.linear.cc b/deal.II/deal.II/source/fe/fe_lib.linear.cc index 89cc701118..bf351038ff 100644 --- a/deal.II/deal.II/source/fe/fe_lib.linear.cc +++ b/deal.II/deal.II/source/fe/fe_lib.linear.cc @@ -127,16 +127,14 @@ void FELinear<1>::get_unit_support_points (vector > &support_points) c template <> void FELinear<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &boundary, - vector > &support_points) const { - FiniteElement<1>::get_support_points (cell, boundary, support_points); + vector > &support_points) const { + FiniteElement<1>::get_support_points (cell, support_points); }; template <> void FELinear<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, - const Boundary<1> &, vector > &) const { Assert (false, ExcInternalError()); }; @@ -145,7 +143,6 @@ void FELinear<1>::get_face_support_points (const typename DoFHandler<1>::face_it template <> void FELinear<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -313,7 +310,6 @@ FELinear<2>::shape_grad_grad (const unsigned int i, template <> void FELinear<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -849,7 +845,6 @@ FELinear<3>::shape_grad_grad (const unsigned int i, template <> void FELinear<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, - const Boundary<3> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -884,7 +879,6 @@ void FELinear<3>::get_unit_support_points (vector > &unit_points) const template void FELinear::get_support_points (const typename DoFHandler::cell_iterator &cell, - const Boundary &, vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -898,7 +892,6 @@ FELinear::get_support_points (const typename DoFHandler::cell_iterator template void FELinear::get_face_support_points (const typename DoFHandler::face_iterator &face, - const Boundary &, vector > &support_points) const { Assert ((support_points.size() == dofs_per_face) && (support_points.size() == GeometryInfo::vertices_per_face), diff --git a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc index f56c40959c..f7795e06a4 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc @@ -193,17 +193,15 @@ void FEQuadraticSub<1>::get_unit_support_points (vector > &unit_points) template <> void FEQuadraticSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &boundary, - vector > &support_points) const { - FiniteElement<1>::get_support_points (cell, boundary, support_points); + vector > &support_points) const { + FiniteElement<1>::get_support_points (cell, support_points); }; template <> void FEQuadraticSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, - const Boundary<1> &, - vector > &) const { + vector > &) const { Assert (false, ExcInternalError()); }; @@ -211,7 +209,6 @@ void FEQuadraticSub<1>::get_face_support_points (const typename DoFHandler<1>::f template <> void FEQuadraticSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -786,7 +783,6 @@ FEQuadraticSub<2>::shape_grad_grad (const unsigned int i, template <> void FEQuadraticSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -1080,7 +1076,6 @@ void FEQuadraticSub<2>::get_unit_support_points (vector > &unit_points) template <> void FEQuadraticSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell, - const Boundary<2>&, vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -1109,8 +1104,7 @@ void FEQuadraticSub<2>::get_support_points (const typename DoFHandler<2>::cell_i template <> void FEQuadraticSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face, - const Boundary<2> &, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == dofs_per_face, ExcWrongFieldDimension (support_points.size(), dofs_per_face)); @@ -2776,7 +2770,6 @@ return_value[2][2] = 2.0*(-64.0*xi+64.0*xi*xi)*eta+2.0*(64.0*xi-64.0*xi*xi)*eta* template <> void FEQuadraticSub<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, - const Boundary<3> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -2826,7 +2819,6 @@ void FEQuadraticSub<3>::get_unit_support_points (vector > &unit_points) template <> void FEQuadraticSub<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell, - const Boundary<3>&, vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -2927,7 +2919,6 @@ void FEQuadraticSub<3>::get_support_points (const typename DoFHandler<3>::cell_i template <> void FEQuadraticSub<3>::get_face_support_points (const typename DoFHandler<3>::face_iterator &face, - const Boundary<3> &, vector > &support_points) const { Assert (support_points.size() == dofs_per_face, ExcWrongFieldDimension (support_points.size(), dofs_per_face)); diff --git a/deal.II/deal.II/source/fe/fe_lib.quartic.cc b/deal.II/deal.II/source/fe/fe_lib.quartic.cc index 6d2264ab12..6aa559b062 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quartic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quartic.cc @@ -149,17 +149,15 @@ void FEQuarticSub<1>::get_unit_support_points (vector > &unit_points) c template <> void FEQuarticSub<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &boundary, - vector > &support_points) const { - FiniteElement<1>::get_support_points (cell, boundary, support_points); + vector > &support_points) const { + FiniteElement<1>::get_support_points (cell, support_points); }; template <> void FEQuarticSub<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &, - const Boundary<1> &, - vector > &) const { + vector > &) const { Assert (false, ExcInternalError()); }; @@ -167,7 +165,6 @@ void FEQuarticSub<1>::get_face_support_points (const typename DoFHandler<1>::fac template <> void FEQuarticSub<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, - const Boundary<1> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -1340,7 +1337,6 @@ FEQuarticSub<2>::shape_grad_grad (const unsigned int i, template <> void FEQuarticSub<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, - const Boundary<2> &, FullMatrix &local_mass_matrix) const { Assert (local_mass_matrix.n() == total_dofs, ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs)); @@ -2641,8 +2637,7 @@ void FEQuarticSub<2>::get_unit_support_points (vector > &unit_points) c template <> void FEQuarticSub<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell, - const Boundary<2>&, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == total_dofs, ExcWrongFieldDimension (support_points.size(), total_dofs)); @@ -2751,8 +2746,7 @@ void FEQuarticSub<2>::get_support_points (const typename DoFHandler<2>::cell_ite template <> void FEQuarticSub<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face, - const Boundary<2> &, - vector > &support_points) const { + vector > &support_points) const { Assert (support_points.size() == dofs_per_face, ExcWrongFieldDimension (support_points.size(), dofs_per_face)); diff --git a/deal.II/deal.II/source/fe/fe_linear_mapping.cc b/deal.II/deal.II/source/fe/fe_linear_mapping.cc index 8bd04122be..54d1b81514 100644 --- a/deal.II/deal.II/source/fe/fe_linear_mapping.cc +++ b/deal.II/deal.II/source/fe/fe_linear_mapping.cc @@ -6,7 +6,6 @@ #include #include #include -#include #include @@ -72,7 +71,6 @@ FELinearMapping<1>::shape_grad_transform(const unsigned int i, template <> void FELinearMapping<1>::get_face_jacobians (const DoFHandler<1>::face_iterator &, - const Boundary<1> &, const vector > &, vector &) const { Assert (false, ExcInternalError()); @@ -93,7 +91,6 @@ void FELinearMapping<1>::get_subface_jacobians (const DoFHandler<1>::face_iterat template <> void FELinearMapping<1>::get_normal_vectors (const DoFHandler<1>::cell_iterator &, const unsigned int, - const Boundary<1> &, const vector > &, vector > &) const { Assert (false, ExcInternalError()); @@ -123,16 +120,14 @@ void FELinearMapping<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cel vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_gradients_transform, - const Boundary<1> &boundary) const { + const vector > > &shape_gradients_transform) const { // simply pass down FiniteElement<1>::fill_fe_values (cell, unit_points, jacobians, compute_jacobians, jacobians_grad, compute_jacobians_grad, support_points, compute_support_points, q_points, compute_q_points, - shape_values_transform, shape_gradients_transform, - boundary); + shape_values_transform, shape_gradients_transform); }; @@ -200,7 +195,6 @@ FELinearMapping<2>::shape_grad_transform (const unsigned int i, template <> void FELinearMapping<2>::get_face_jacobians (const DoFHandler<2>::face_iterator &face, - const Boundary<2> &, const vector > &unit_points, vector &face_jacobians) const { // more or less copied from the linear @@ -247,7 +241,6 @@ void FELinearMapping<2>::get_subface_jacobians (const DoFHandler<2>::face_iterat template <> void FELinearMapping<2>::get_normal_vectors (const DoFHandler<2>::cell_iterator &cell, const unsigned int face_no, - const Boundary<2> &, const vector > &unit_points, vector > &normal_vectors) const { // more or less copied from the linear @@ -397,7 +390,6 @@ FELinearMapping<3>::shape_grad_transform (const unsigned int i, template <> void FELinearMapping<3>::get_face_jacobians (const DoFHandler<3>::face_iterator &face, - const Boundary<3> &, const vector > &unit_points, vector &face_jacobians) const { Assert (unit_points.size() == face_jacobians.size(), @@ -482,7 +474,6 @@ void FELinearMapping<3>::get_subface_jacobians (const DoFHandler<3>::face_iterat template <> void FELinearMapping<3>::get_normal_vectors (const DoFHandler<3>::cell_iterator &cell, const unsigned int face_no, - const Boundary<3> &, const vector > &unit_points, vector > &normal_vectors) const { Assert (unit_points.size() == normal_vectors.size(), @@ -566,8 +557,7 @@ void FELinearMapping::fill_fe_values (const DoFHandler::cell_iterator vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &/*shape_grad_transform*/, - const Boundary &boundary) const + const vector > > &/*shape_grad_transform*/) const { Assert ((!compute_jacobians) || (jacobians.size() == unit_points.size()), ExcWrongFieldDimension(jacobians.size(), unit_points.size())); @@ -726,7 +716,7 @@ void FELinearMapping::fill_fe_values (const DoFHandler::cell_iterator compute_jacobian_gradients (cell, unit_points, jacobians_grad); if (compute_support_points) - get_support_points (cell, boundary, support_points); + get_support_points (cell, support_points); }; diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 20c0b9c5d5..cd83811a90 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -463,7 +463,6 @@ void FESystem::get_unit_support_points (vector > &/*support_poin template void FESystem::get_support_points (const DoFHandler::cell_iterator &/*cell*/, - const Boundary &/*boundary*/, vector > &/*support_points*/) const { Assert(false, ExcNotImplemented()); @@ -472,7 +471,7 @@ void FESystem::get_support_points (const DoFHandler::cell_iterator &/* ExcWrongFieldDimension (support_points.size(), total_dofs)); vector > base_support_points (base_element->total_dofs); - base_element->get_support_points (cell, boundary, base_support_points); + base_element->get_support_points (cell, base_support_points); for (unsigned int i=0; itotal_dofs; ++i) for (unsigned int n=0; n::get_support_points (const DoFHandler::cell_iterator &/* template void FESystem::get_face_support_points (const DoFHandler::face_iterator & face, - const Boundary & boundary, vector > & support_points) const { Assert (support_points.size() == dofs_per_face, @@ -495,7 +493,7 @@ void FESystem::get_face_support_points (const DoFHandler::face_iterato for (unsigned int base=0 ; base::get_face_support_points (const DoFHandler::face_iterato template void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator &/*cell*/, - const Boundary &/*boundary*/, FullMatrix &/*local_mass_matrix*/) const { Assert(false, ExcNotImplemented()); @@ -527,7 +524,7 @@ void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator // the base object FullMatrix base_mass_matrix (base_element.total_dofs, base_element.total_dofs); - base_element.get_local_mass_matrix (cell, boundary, base_mass_matrix); + base_element.get_local_mass_matrix (cell, base_mass_matrix); // now distribute it to the mass matrix @@ -562,12 +559,11 @@ Tensor<1,dim> FESystem::shape_grad_transform (const unsigned int i, template void FESystem::get_face_jacobians (const DoFHandler::face_iterator &face, - const Boundary &boundary, const vector > &unit_points, vector &face_jacobi_determinants) const { - base_elements[0].first->get_face_jacobians (face, boundary, unit_points, - face_jacobi_determinants); + base_elements[0].first->get_face_jacobians (face, unit_points, + face_jacobi_determinants); }; @@ -588,11 +584,10 @@ void FESystem::get_subface_jacobians (const DoFHandler::face_iterator template void FESystem::get_normal_vectors (const DoFHandler::cell_iterator &cell, const unsigned int face_no, - const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const { - base_elements[0].first->get_normal_vectors (cell, face_no, boundary, unit_points, + base_elements[0].first->get_normal_vectors (cell, face_no, unit_points, normal_vectors); }; @@ -623,8 +618,7 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, vector > &q_points, const bool compute_q_points, const FullMatrix &shape_values_transform, - const vector > > &shape_grad_transform, - const Boundary &boundary) const + const vector > > &shape_grad_transform) const { vector > supp(base_elements[0].first->total_dofs); @@ -632,7 +626,7 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, jacobians_grad, compute_jacobians_grad, support_points, compute_support_points, q_points, compute_q_points, - shape_values_transform, shape_grad_transform, boundary); + shape_values_transform, shape_grad_transform); if (compute_support_points) { @@ -651,7 +645,7 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, jacobians_grad, false, supp, true, q_points, false, - shape_values_transform, shape_grad_transform, boundary); + shape_values_transform, shape_grad_transform); for (unsigned m=0 ; m < element_multiplicity(base) ; ++ m) { diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index 41f4dec039..7dc5311a6c 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -22,7 +22,8 @@ FEValuesBase::FEValuesBase (const unsigned int n_q_points, const unsigned int n_transform_functions, const unsigned int n_values_arrays, const UpdateFlags update_flags, - const FiniteElement &fe) : + const FiniteElement &fe, + const Boundary &boundary) : n_quadrature_points (n_q_points), total_dofs (total_dofs), n_transform_functions (n_transform_functions), @@ -40,7 +41,9 @@ FEValuesBase::FEValuesBase (const unsigned int n_q_points, n_quadrature_points)), selected_dataset (0), update_flags (update_flags), - fe(&fe) {}; + fe(&fe), + boundary(&boundary) +{}; @@ -274,14 +277,16 @@ double FEValuesBase::JxW (const unsigned int i) const { template FEValues::FEValues (const FiniteElement &fe, const Quadrature &quadrature, - const UpdateFlags update_flags) : + const UpdateFlags update_flags, + const Boundary &boundary) : FEValuesBase (quadrature.n_quadrature_points, fe.total_dofs, fe.total_dofs, fe.n_transform_functions, 1, update_flags, - fe), + fe, + boundary), unit_shape_gradients(fe.total_dofs, vector >(quadrature.n_quadrature_points)), unit_shape_2nd_derivatives(fe.total_dofs, @@ -322,8 +327,7 @@ FEValues::FEValues (const FiniteElement &fe, template -void FEValues::reinit (const typename DoFHandler::cell_iterator &cell, - const Boundary &boundary) { +void FEValues::reinit (const typename DoFHandler::cell_iterator &cell) { present_cell = cell; // fill jacobi matrices and real // quadrature points @@ -346,8 +350,7 @@ void FEValues::reinit (const typename DoFHandler::cell_iterator &cell, update_flags & update_support_points, quadrature_points, update_flags & update_q_points, - shape_values_transform[0], unit_shape_gradients_transform, - boundary); + shape_values_transform[0], unit_shape_gradients_transform); // compute gradients on real element if // requested @@ -417,14 +420,16 @@ FEFaceValuesBase::FEFaceValuesBase (const unsigned int n_q_points, const unsigned int n_transform_functions, const unsigned int n_faces_or_subfaces, const UpdateFlags update_flags, - const FiniteElement &fe) : + const FiniteElement &fe, + const Boundary &boundary) : FEValuesBase (n_q_points, n_support_points, total_dofs, n_transform_functions, n_faces_or_subfaces, update_flags, - fe), + fe, + boundary), unit_shape_gradients (n_faces_or_subfaces, vector > >(total_dofs, vector >(n_q_points))), @@ -464,14 +469,16 @@ FEFaceValuesBase::normal_vector (const unsigned int i) const { template FEFaceValues::FEFaceValues (const FiniteElement &fe, const Quadrature &quadrature, - const UpdateFlags update_flags) : + const UpdateFlags update_flags, + const Boundary &boundary) : FEFaceValuesBase (quadrature.n_quadrature_points, fe.dofs_per_face, fe.total_dofs, fe.n_transform_functions, GeometryInfo::faces_per_cell, update_flags, - fe) + fe, + boundary) { unit_face_quadrature_points = quadrature.get_quad_points(); weights = quadrature.get_weights (); @@ -511,8 +518,7 @@ FEFaceValues::FEFaceValues (const FiniteElement &fe, template void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &cell, - const unsigned int face_no, - const Boundary &boundary) { + const unsigned int face_no) { present_cell = cell; selected_dataset = face_no; // fill jacobi matrices and real @@ -545,8 +551,7 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c normal_vectors, update_flags & update_normal_vectors, shape_values_transform[face_no], - unit_shape_gradients_transform[face_no], - boundary); + unit_shape_gradients_transform[face_no]); // compute gradients on real element if // requested @@ -616,14 +621,16 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c template FESubfaceValues::FESubfaceValues (const FiniteElement &fe, const Quadrature &quadrature, - const UpdateFlags update_flags) : + const UpdateFlags update_flags, + const Boundary &boundary) : FEFaceValuesBase (quadrature.n_quadrature_points, 0, fe.total_dofs, fe.n_transform_functions, GeometryInfo::faces_per_cell * GeometryInfo::subfaces_per_face, update_flags, - fe) + fe, + boundary) { Assert ((update_flags & update_support_points) == false, ExcInvalidUpdateFlag()); @@ -685,8 +692,7 @@ FESubfaceValues::FESubfaceValues (const FiniteElement &fe, template void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator &cell, const unsigned int face_no, - const unsigned int subface_no, - const Boundary &boundary) { + const unsigned int subface_no) { Assert (cell->face(face_no)->at_boundary() == false, ExcReinitCalledWithBoundaryFace()); @@ -720,8 +726,7 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator normal_vectors, update_flags & update_normal_vectors, shape_values_transform[selected_dataset], - unit_shape_gradients_transform[selected_dataset], - boundary); + unit_shape_gradients_transform[selected_dataset]); // compute gradients on real element if // requested diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 95f4062de8..a9acc7b694 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -73,6 +73,16 @@ void Triangulation::set_boundary (const Boundary *boundary_object) { +template +const Boundary & +Triangulation::get_boundary () const +{ + return *boundary; +}; + + + + /*--------- Put the next functions a bit out-or-order to avoid use before --------- explicit specialization, which is not allowed. */ diff --git a/deal.II/deal.II/source/numerics/assembler.cc b/deal.II/deal.II/source/numerics/assembler.cc index c1dbc9ba70..ed7ac2a37a 100644 --- a/deal.II/deal.II/source/numerics/assembler.cc +++ b/deal.II/deal.II/source/numerics/assembler.cc @@ -53,18 +53,15 @@ AssemblerData::AssemblerData (const DoFHandler &dof, SparseMatrix &matrix, Vector &rhs_vector, const Quadrature &quadrature, - const FiniteElement &fe, - const UpdateFlags &update_flags, - const Boundary &boundary) : + const UpdateFlags &update_flags) : dof(dof), assemble_matrix(assemble_matrix), assemble_rhs(assemble_rhs), matrix(matrix), rhs_vector(rhs_vector), quadrature(quadrature), - fe(fe), - update_flags(update_flags), - boundary(boundary) {}; + update_flags(update_flags) +{}; @@ -81,18 +78,15 @@ Assembler::Assembler (Triangulation *tria, assemble_rhs (local_data->assemble_rhs), matrix(local_data->matrix), rhs_vector(local_data->rhs_vector), - fe(local_data->fe), - fe_values (local_data->fe, + fe_values (dof_handler->get_fe(), local_data->quadrature, - local_data->update_flags), - boundary(local_data->boundary) + local_data->update_flags, + tria->get_boundary()) { Assert (!assemble_matrix || (matrix.m() == dof_handler->n_dofs()), ExcInvalidData()); Assert (!assemble_matrix || (matrix.n() == dof_handler->n_dofs()), ExcInvalidData()); - Assert (((AssemblerData*)local_data)->fe == dof_handler->get_fe(), - ExcInvalidData()); Assert (!assemble_rhs || (rhs_vector.size()==dof_handler->n_dofs()), ExcInvalidData()); }; @@ -102,11 +96,7 @@ Assembler::Assembler (Triangulation *tria, template void Assembler::assemble (const Equation &equation) { // re-init fe values for this cell - fe_values.reinit (DoFHandler::cell_iterator (tria, - present_level, - present_index, - dof_handler), - boundary); + fe_values.reinit (DoFHandler::cell_iterator (*this)); const unsigned int n_dofs = dof_handler->get_fe().total_dofs; if (assemble_matrix) diff --git a/deal.II/deal.II/source/numerics/base.cc b/deal.II/deal.II/source/numerics/base.cc index afa767ca69..3f25d01f2c 100644 --- a/deal.II/deal.II/source/numerics/base.cc +++ b/deal.II/deal.II/source/numerics/base.cc @@ -72,10 +72,8 @@ ProblemBase::~ProblemBase () {}; template void ProblemBase::assemble (const Equation &equation, const Quadrature &quadrature, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc, - const Boundary &boundary) { + const FunctionMap &dirichlet_bc) { Assert ((tria!=0) && (dof_handler!=0), ExcNoTriaSelected()); system_sparsity.reinit (dof_handler->n_dofs(), @@ -102,9 +100,7 @@ void ProblemBase::assemble (const Equation &equation, system_matrix, right_hand_side, quadrature, - fe, - update_flags, - boundary); + update_flags); active_assemble_iterator assembler (tria, tria->begin_active()->level(), tria->begin_active()->index(), @@ -125,8 +121,7 @@ void ProblemBase::assemble (const Equation &equation, // apply Dirichlet bc as described // in the docs map boundary_value_list; - VectorTools::interpolate_boundary_values (*dof_handler, - dirichlet_bc, boundary, + VectorTools::interpolate_boundary_values (*dof_handler, dirichlet_bc, boundary_value_list); MatrixTools::apply_boundary_values (boundary_value_list, system_matrix, solution, diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index f2d42eef6d..1d71bb6a07 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -595,8 +594,8 @@ void DataOut::write_gnuplot (ostream &out, unsigned int accuracy) const QIteratedTrapez points(accuracy); - FEValues fe(dofs->get_fe(), points, UpdateFlags(update_q_points)); - const StraightBoundary boundary; + FEValues fe(dofs->get_fe(), points, UpdateFlags(update_q_points), + dofs->get_tria().get_boundary()); vector< vector > > values (dof_data.size(), vector< vector >(points.n_quadrature_points, @@ -606,7 +605,7 @@ void DataOut::write_gnuplot (ostream &out, unsigned int accuracy) const unsigned int cell_index=0; for (cell=dofs->begin_active(); cell!=endc; ++cell, ++cell_index) { - fe.reinit(cell, boundary); + fe.reinit(cell); for (unsigned i=0; i void KellyErrorEstimator<1>::estimate_error (const DoFHandler<1> &, const Quadrature<0> &, - const FiniteElement<1> &, - const Boundary<1> &, const FunctionMap &, const Vector &, Vector &, @@ -45,8 +43,6 @@ void KellyErrorEstimator<1>::estimate_error (const DoFHandler<1> &, template void KellyErrorEstimator::estimate_error (const DoFHandler &dof, const Quadrature &quadrature, - const FiniteElement &fe, - const Boundary &boundary, const FunctionMap &neumann_bc, const Vector &solution, Vector &error, @@ -81,15 +77,18 @@ void KellyErrorEstimator::estimate_error (const DoFHandler &dof, // need not compute all values on the // neighbor cells, so using two objects // gives us a performance gain). - FEFaceValues fe_face_values_cell (fe, quadrature, + FEFaceValues fe_face_values_cell (dof.get_fe(), quadrature, UpdateFlags(update_gradients | update_JxW_values | ((!neumann_bc.empty() || (coefficient != 0)) ? update_q_points : 0) | - update_normal_vectors)); - FEFaceValues fe_face_values_neighbor (fe, quadrature, update_gradients); - FESubfaceValues fe_subface_values (fe, quadrature, update_gradients); + update_normal_vectors), + dof.get_tria().get_boundary()); + FEFaceValues fe_face_values_neighbor (dof.get_fe(), quadrature, update_gradients, + dof.get_tria().get_boundary()); + FESubfaceValues fe_subface_values (dof.get_fe(), quadrature, update_gradients, + dof.get_tria().get_boundary()); // loop over all cells const active_cell_iterator endc = dof.end(); @@ -137,8 +136,7 @@ void KellyErrorEstimator::estimate_error (const DoFHandler &dof, // is the same as that of this side, // then handle the integration of // these both cases together - integrate_over_regular_face (cell, face_no, fe, - boundary, neumann_bc, + integrate_over_regular_face (cell, face_no, neumann_bc, n_q_points, fe_face_values_cell, fe_face_values_neighbor, @@ -150,7 +148,7 @@ void KellyErrorEstimator::estimate_error (const DoFHandler &dof, // special computations which do // not fit into the framework of // the above function - integrate_over_irregular_face (cell, face_no, fe, boundary, + integrate_over_irregular_face (cell, face_no, n_q_points, fe_face_values_cell, fe_subface_values, @@ -190,8 +188,6 @@ void KellyErrorEstimator::estimate_error (const DoFHandler &dof, template <> void KellyErrorEstimator<1>::integrate_over_regular_face (const active_cell_iterator &, const unsigned int , - const FiniteElement<1> &, - const Boundary<1> &, const FunctionMap &, const unsigned int , FEFaceValues<1> &, @@ -208,8 +204,6 @@ template <> void KellyErrorEstimator<1>:: integrate_over_irregular_face (const active_cell_iterator &, const unsigned int , - const FiniteElement<1> &, - const Boundary<1> &, const unsigned int , FEFaceValues<1> &, FESubfaceValues<1> &, @@ -227,8 +221,6 @@ template void KellyErrorEstimator:: integrate_over_regular_face (const active_cell_iterator &cell, const unsigned int face_no, - const FiniteElement &, - const Boundary &boundary, const FunctionMap &neumann_bc, const unsigned int n_q_points, FEFaceValues &fe_face_values_cell, @@ -240,7 +232,7 @@ integrate_over_regular_face (const active_cell_iterator &cell, // initialize data of the restriction // of this cell to the present face - fe_face_values_cell.reinit (cell, face_no, boundary); + fe_face_values_cell.reinit (cell, face_no); // set up a vector of the gradients // of the finite element function @@ -278,7 +270,7 @@ integrate_over_regular_face (const active_cell_iterator &cell, // get restriction of finite element // function of #neighbor# to the // common face. - fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor, boundary); + fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor); // get a list of the gradients of // the finite element solution @@ -382,8 +374,6 @@ template void KellyErrorEstimator:: integrate_over_irregular_face (const active_cell_iterator &cell, const unsigned int face_no, - const FiniteElement &, - const Boundary &boundary, const unsigned int n_q_points, FEFaceValues &fe_face_values, FESubfaceValues &fe_subface_values, @@ -431,14 +421,14 @@ integrate_over_irregular_face (const active_cell_iterator &cell, // present cell to the subface and // store the gradient of the solution // in psi - fe_subface_values.reinit (cell, face_no, subface_no, boundary); + fe_subface_values.reinit (cell, face_no, subface_no); fe_subface_values.get_function_grads (solution, psi); // restrict the finite element on the // neighbor cell to the common #subface#. // store the gradient in #neighbor_psi# vector > neighbor_psi (n_q_points); - fe_face_values.reinit (neighbor_child, neighbor_neighbor, boundary); + fe_face_values.reinit (neighbor_child, neighbor_neighbor); fe_face_values.get_function_grads (solution, neighbor_psi); // compute the jump in the gradients diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index e0cf9b03e1..6b237b7d43 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -22,11 +22,8 @@ template void MatrixCreator::create_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function * const a) { - const FiniteElement &fe = dof.get_fe(); - Vector dummy; // no entries, should give an error if accessed UpdateFlags update_flags = update_JxW_values; if (a != 0) @@ -34,7 +31,7 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, const AssemblerData data (dof, true, false, // assemble matrix but not rhs matrix, dummy, - q, fe, update_flags, boundary); + q, update_flags); TriaActiveIterator > assembler (const_cast*>(&dof.get_tria()), dof.get_tria().begin_active()->level(), @@ -54,19 +51,16 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, template void MatrixCreator::create_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, const Function * const a) { - const FiniteElement &fe = dof.get_fe(); - UpdateFlags update_flags = UpdateFlags(update_q_points | update_JxW_values); const AssemblerData data (dof, true, true, matrix, rhs_vector, - q, fe, update_flags, boundary); + q, update_flags); TriaActiveIterator > assembler (const_cast*>(&dof.get_tria()), dof.get_tria().begin_active()->level(), @@ -84,7 +78,6 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, template void MatrixCreator::create_mass_matrix (const DoFHandler &dof, - const Boundary &boundary, SparseMatrix &matrix) { const FiniteElement &fe = dof.get_fe(); @@ -98,7 +91,7 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, for (; cell!=endc; ++cell) { cell->get_dof_indices (dofs_on_this_cell); - fe.get_local_mass_matrix (cell, boundary, local_mass_matrix); + fe.get_local_mass_matrix (cell, local_mass_matrix); for (unsigned int i=0; i::create_mass_matrix (const DoFHandler &dof, template <> void MatrixCreator<1>::create_boundary_mass_matrix (const DoFHandler<1> &, const Quadrature<0> &, - const Boundary<1> &, SparseMatrix &, const FunctionMap &, Vector &, @@ -130,7 +122,6 @@ void MatrixCreator<1>::create_boundary_mass_matrix (const DoFHandler<1> &, template void MatrixCreator::create_boundary_mass_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const FunctionMap &rhs, Vector &rhs_vector, @@ -155,7 +146,7 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & UpdateFlags update_flags = UpdateFlags (update_JxW_values | update_q_points); - FEFaceValues fe_values (fe, q, update_flags); + FEFaceValues fe_values (fe, q, update_flags, dof.get_tria().get_boundary()); DoFHandler::active_cell_iterator cell = dof.begin_active (), endc = dof.end (); @@ -168,7 +159,7 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & cell_matrix.clear (); cell_vector.clear (); - fe_values.reinit (cell, face, boundary); + fe_values.reinit (cell, face); const FullMatrix &values = fe_values.get_shape_values (); const vector &weights = fe_values.get_JxW_values (); @@ -325,11 +316,8 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & template void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function * const a) { - const FiniteElement &fe = dof.get_fe(); - Vector dummy; // no entries, should give an error if accessed UpdateFlags update_flags = UpdateFlags(update_gradients | update_JxW_values); @@ -338,7 +326,7 @@ void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, const AssemblerData data (dof, true, false, // assemble matrix but not rhs matrix, dummy, - q, fe, update_flags, boundary); + q, update_flags); TriaActiveIterator > assembler (const_cast*>(&dof.get_tria()), dof.get_tria().begin_active()->level(), @@ -357,22 +345,17 @@ void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, template void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, SparseMatrix &matrix, const Function &rhs, Vector &rhs_vector, const Function * const a) { - const FiniteElement &fe = dof.get_fe(); - UpdateFlags update_flags = UpdateFlags(update_q_points | update_gradients | update_JxW_values); const AssemblerData data (dof, true, true, matrix, rhs_vector, - q, fe, - update_flags, - boundary); + q, update_flags); TriaActiveIterator > assembler (const_cast*>(&dof.get_tria()), dof.get_tria().begin_active()->level(), diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index 558a91cb38..55b7902904 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -44,7 +44,6 @@ inline double sqr_point (const Tensor<1,dim> &p) { template void VectorTools::interpolate (const DoFHandler &dof, - const Boundary &boundary, const Function &function, Vector &vec) { @@ -60,7 +59,7 @@ void VectorTools::interpolate (const DoFHandler &dof, // for each cell: // get location of finite element // off-points - fe.get_support_points (cell, boundary, support_points); + fe.get_support_points (cell, support_points); // get function values at these points function.value_list (support_points, dof_values_on_cell); // get indices of the dofs on this cell @@ -100,7 +99,6 @@ VectorTools::interpolate(const DoFHandler &high_dof, template <> void VectorTools<1>::project (const DoFHandler<1> &, const ConstraintMatrix &, - const Boundary<1> &, const Quadrature<1> &, const Function<1> &, Vector &, @@ -124,7 +122,6 @@ void VectorTools<1>::project (const DoFHandler<1> &, template void VectorTools::project (const DoFHandler &dof, const ConstraintMatrix &constraints, - const Boundary &boundary, const Quadrature &q, const Function &function, Vector &vec, @@ -167,7 +164,7 @@ void VectorTools::project (const DoFHandler &dof, for (unsigned char c=0; c<255; ++c) boundary_functions[c] = &function; project_boundary_values (dof, boundary_functions, q_boundary, - boundary, boundary_values); + boundary_values); }; @@ -182,9 +179,8 @@ void VectorTools::project (const DoFHandler &dof, SparseMatrix mass_matrix (sparsity); Vector tmp (mass_matrix.n()); - MatrixCreator::create_mass_matrix (dof, boundary, mass_matrix); - VectorTools::create_right_hand_side (dof, q, boundary, - function, tmp); + MatrixCreator::create_mass_matrix (dof, mass_matrix); + VectorTools::create_right_hand_side (dof, q, function, tmp); constraints.condense (mass_matrix); constraints.condense (tmp); @@ -207,18 +203,15 @@ void VectorTools::project (const DoFHandler &dof, template void VectorTools::create_right_hand_side (const DoFHandler &dof, const Quadrature &q, - const Boundary &boundary, const Function &rhs, Vector &rhs_vector) { - const FiniteElement &fe = dof.get_fe(); - UpdateFlags update_flags = UpdateFlags(update_q_points | update_JxW_values); SparseMatrix dummy; const AssemblerData data (dof, false, true, dummy, rhs_vector, - q, fe, update_flags, boundary); + q, update_flags); TriaActiveIterator > assembler (const_cast*>(&dof.get_tria()), dof.get_tria().begin_active()->level(), @@ -240,7 +233,6 @@ template <> void VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &, const FunctionMap &, - const Boundary<1> &, map &) { Assert (false, ExcNotImplemented()); @@ -249,7 +241,6 @@ VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &, template <> void VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &, const VectorFunctionMap&, - const Boundary<1>&, map&) { Assert (false, ExcNotImplemented()); @@ -263,7 +254,6 @@ template void VectorTools::interpolate_boundary_values (const DoFHandler &dof, const FunctionMap &dirichlet_bc, - const Boundary &boundary, map &boundary_values) { Assert (dirichlet_bc.find(255) == dirichlet_bc.end(), ExcInvalidBoundaryIndicator()); @@ -293,7 +283,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, // boundary values of dofs on this // face face->get_dof_indices (face_dofs); - fe.get_face_support_points (face, boundary, dof_locations); + fe.get_face_support_points (face, dof_locations); function_ptr->second->value_list (dof_locations, dof_values); // enter into list @@ -306,7 +296,6 @@ template void VectorTools::interpolate_boundary_values (const DoFHandler &dof, const VectorFunctionMap &dirichlet_bc, - const Boundary &boundary, map &boundary_values) { Assert (dirichlet_bc.find(255) == dirichlet_bc.end(), @@ -337,7 +326,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, // boundary values of dofs on this // face face->get_dof_indices (face_dofs); - fe.get_face_support_points (face, boundary, dof_locations); + fe.get_face_support_points (face, dof_locations); function_ptr->second->value_list (dof_locations, dof_values); // enter into list @@ -359,7 +348,6 @@ void VectorTools::project_boundary_values (const DoFHandler &dof, const FunctionMap &boundary_functions, const Quadrature &q, - const Boundary &boundary, map &boundary_values) { vector dof_to_boundary_mapping; dof.map_dof_to_boundary_indices (boundary_functions, dof_to_boundary_mapping); @@ -395,7 +383,7 @@ VectorTools::project_boundary_values (const DoFHandler &dof, Vector rhs(sparsity.n_rows()); - MatrixTools::create_boundary_mass_matrix (dof, q, boundary, + MatrixTools::create_boundary_mass_matrix (dof, q, mass_matrix, boundary_functions, rhs, dof_to_boundary_mapping); @@ -435,8 +423,7 @@ void VectorTools::integrate_difference (const DoFHandler &dof, const Function &exact_solution, Vector &difference, const Quadrature &q, - const NormType &norm, - const Boundary &boundary) { + const NormType &norm) { const FiniteElement &fe = dof.get_fe(); difference.reinit (dof.get_tria().n_active_cells()); @@ -445,7 +432,7 @@ void VectorTools::integrate_difference (const DoFHandler &dof, update_JxW_values); if ((norm==H1_seminorm) || (norm==H1_norm)) update_flags = UpdateFlags (update_flags | update_gradients); - FEValues fe_values(fe, q, update_flags); + FEValues fe_values(fe, q, update_flags, dof.get_tria().get_boundary()); // loop over all cells DoFHandler::active_cell_iterator cell = dof.begin_active(), @@ -454,7 +441,7 @@ void VectorTools::integrate_difference (const DoFHandler &dof, { double diff=0; // initialize for this cell - fe_values.reinit (cell, boundary); + fe_values.reinit (cell); switch (norm) { @@ -620,35 +607,33 @@ void VectorTools::integrate_difference (const DoFHandler &dof, template void -VectorTools::integrate_difference (const DoFHandler &dof, +VectorTools::integrate_difference (const DoFHandler &dof, const Vector &fe_function, const VectorFunction&exact_solution, Vector &difference, const Quadrature &q, - const FiniteElement &fe, - const NormType &norm, - const Boundary &boundary) + const NormType &norm) { - Assert (fe == dof.get_fe(), ExcInvalidFE()); + const FiniteElement &fe = dof.get_fe(); - difference.reinit (dof.get_tria().n_active_cells()); + difference.reinit (dof.get_tria().n_active_cells()); - UpdateFlags update_flags = UpdateFlags (update_q_points | + UpdateFlags update_flags = UpdateFlags (update_q_points | update_JxW_values); - if ((norm==H1_seminorm) || (norm==H1_norm)) - update_flags = UpdateFlags (update_flags | update_gradients); - FEValues fe_values(fe, q, update_flags); + if ((norm==H1_seminorm) || (norm==H1_norm)) + update_flags = UpdateFlags (update_flags | update_gradients); + FEValues fe_values(fe, q, update_flags, dof.get_tria().get_boundary()); // loop over all cells - DoFHandler::active_cell_iterator cell = dof.begin_active(), + DoFHandler::active_cell_iterator cell = dof.begin_active(), endc = dof.end(); - for (unsigned int index=0; cell != endc; ++cell, ++index) - { - double diff=0; + for (unsigned int index=0; cell != endc; ++cell, ++index) + { + double diff=0; // initialize for this cell - fe_values.reinit (cell, boundary); - - switch (norm) + fe_values.reinit (cell); + + switch (norm) { case mean: case L1_norm: @@ -691,9 +676,9 @@ VectorTools::integrate_difference (const DoFHandler &dof, fe_values.get_function_values (fe_function, function_values); /* transform (psi.begin(), psi.end(), - function_values.begin(), - psi.begin(), - minus()); + function_values.begin(), + psi.begin(), + minus()); */ }; // for L1_norm and Linfty_norm: @@ -769,7 +754,7 @@ VectorTools::integrate_difference (const DoFHandler &dof, // in praxi: first compute // exact fe_function vector /* exact_solution.gradient_list (fe_values.get_quadrature_points(), - psi); + psi); */ // then subtract finite element // fe_function @@ -779,9 +764,9 @@ VectorTools::integrate_difference (const DoFHandler &dof, fe_values.get_function_grads (fe_function, function_grads); /* transform (psi.begin(), psi.end(), - function_grads.begin(), - psi.begin(), - minus >()); + function_grads.begin(), + psi.begin(), + minus >()); */ }; // take square of integrand vector psi_square (psi.size(), 0.0); @@ -791,8 +776,8 @@ VectorTools::integrate_difference (const DoFHandler &dof, // add seminorm to L_2 norm or // to zero /* diff += inner_product (psi_square.begin(), psi_square.end(), - fe_values.get_JxW_values().begin(), - 0.0); + fe_values.get_JxW_values().begin(), + 0.0); diff = sqrt(diff); */ break; @@ -805,9 +790,9 @@ VectorTools::integrate_difference (const DoFHandler &dof, // append result of this cell // to the end of the vector - difference(index) = diff; - }; - }; + difference(index) = diff; + }; +}; template VectorTools; diff --git a/tests/big-tests/convergence/convergence.cc b/tests/big-tests/convergence/convergence.cc index ea60055883..294eddeadd 100644 --- a/tests/big-tests/convergence/convergence.cc +++ b/tests/big-tests/convergence/convergence.cc @@ -324,7 +324,7 @@ int PoissonProblem::run (const unsigned int level) { ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc); + assemble (equation, *quadrature, update_flags, dirichlet_bc); cout << " Solving..." << endl; solve (); diff --git a/tests/big-tests/error-estimation/error-estimation.cc b/tests/big-tests/error-estimation/error-estimation.cc index d7f3b25264..93d58e28cc 100644 --- a/tests/big-tests/error-estimation/error-estimation.cc +++ b/tests/big-tests/error-estimation/error-estimation.cc @@ -466,7 +466,7 @@ void PoissonProblem::run (ParameterHandler &prm) { ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = solution_function; - assemble (*equation, quadrature, fe, update_flags, dirichlet_bc); + assemble (*equation, quadrature, update_flags, dirichlet_bc); // if we have an old solution lying // around, use it to preset the solution @@ -524,7 +524,7 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << " Estimating H1 error... "; KellyErrorEstimator ee; QSimpson eq; - ee.estimate_error (*dof, eq, fe, *boundary, + ee.estimate_error (*dof, eq, KellyErrorEstimator::FunctionMap(), solution, estimated_error_per_cell, diff --git a/tests/big-tests/multigrid/multigrid.cc b/tests/big-tests/multigrid/multigrid.cc index b48010db69..6270ca3864 100644 --- a/tests/big-tests/multigrid/multigrid.cc +++ b/tests/big-tests/multigrid/multigrid.cc @@ -104,10 +104,8 @@ class PoissonProblem { */ virtual void assemble (const Equation &equation, const Quadrature &q, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc = FunctionMap(), - const Boundary &boundary = StraightBoundary()); + const FunctionMap &dirichlet_bc = FunctionMap()); int run (unsigned int level); void print_history (string filename) const; @@ -326,10 +324,8 @@ void PoissonProblem::create_new () { template void PoissonProblem::assemble (const Equation &equation, const Quadrature &quadrature, - const FiniteElement &fe, const UpdateFlags update_flags, - const FunctionMap &dirichlet_bc, - const Boundary &boundary) { + const FunctionMap &dirichlet_bc) { Assert ((tria!=0) && (dof!=0), ExcNoTriaSelected()); system_sparsity.reinit (dof->DoFHandler::n_dofs(), @@ -356,9 +352,7 @@ void PoissonProblem::assemble (const Equation &equation, system_matrix, right_hand_side, quadrature, - fe, - update_flags, - boundary); + update_flags); active_assemble_iterator assembler (tria, tria->begin_active()->level(), tria->begin_active()->index(), @@ -379,7 +373,7 @@ void PoissonProblem::assemble (const Equation &equation, // apply Dirichlet bc as described // in the docs map boundary_value_list; - VectorTools::interpolate_boundary_values (*dof, dirichlet_bc, boundary, + VectorTools::interpolate_boundary_values (*dof, dirichlet_bc, boundary_value_list); MatrixTools::apply_boundary_values (boundary_value_list, system_matrix, solution, @@ -480,7 +474,7 @@ int PoissonProblem::run (const unsigned int level) { map*> dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, *quadrature, *fe, update_flags, dirichlet_bc); + assemble (equation, *quadrature, update_flags, dirichlet_bc); cout << " Solving..." << endl; solve (); diff --git a/tests/big-tests/nonlinear/fixed-point-iteration/nonlinear.cc b/tests/big-tests/nonlinear/fixed-point-iteration/nonlinear.cc index 429a101ed6..357accccd6 100644 --- a/tests/big-tests/nonlinear/fixed-point-iteration/nonlinear.cc +++ b/tests/big-tests/nonlinear/fixed-point-iteration/nonlinear.cc @@ -200,7 +200,7 @@ void NonlinearProblem::run () { assemble (equation, quadrature, fe, UpdateFlags(update_gradients | update_JxW_values | update_q_points), - dirichlet_bc, boundary); + dirichlet_bc); cout << " Solving..." << endl; solve (); @@ -227,7 +227,7 @@ void NonlinearProblem::run () { Vector error_indicator; KellyErrorEstimator ee; QSimpson eq; - ee.estimate_error (*dof, eq, fe, boundary, + ee.estimate_error (*dof, eq, fe, KellyErrorEstimator::FunctionMap(), solution, error_indicator); diff --git a/tests/big-tests/poisson/problem.cc b/tests/big-tests/poisson/problem.cc index 5355fd04f9..331505ad78 100644 --- a/tests/big-tests/poisson/problem.cc +++ b/tests/big-tests/poisson/problem.cc @@ -540,10 +540,10 @@ void PoissonProblem::run (ParameterHandler &prm) { cout << " Assembling matrices..." << endl; ProblemBase::FunctionMap dirichlet_bc; dirichlet_bc[0] = boundary_values; - assemble (equation, quadrature, fe, + assemble (equation, quadrature, UpdateFlags(update_gradients | update_JxW_values | update_q_points), - dirichlet_bc, *boundary); + dirichlet_bc); cout << " Solving..." << endl; solve (); diff --git a/tests/deal.II/fe_tables.cc b/tests/deal.II/fe_tables.cc index 0f0e9e3578..725e6743f9 100644 --- a/tests/deal.II/fe_tables.cc +++ b/tests/deal.II/fe_tables.cc @@ -45,7 +45,7 @@ print_fe_statistics(const FiniteElement& fe) // fe.get_unit_support_points(unit_points); // fe.get_support_points(cell, boundary, support_points); - fe.get_face_support_points(face, boundary, face_support_points); + fe.get_face_support_points(face, face_support_points); deallog << "total_dofs" << " " << fe.total_dofs; deallog << ": vertex" << " " << fe.dofs_per_vertex; diff --git a/tests/deal.II/gradients.cc b/tests/deal.II/gradients.cc index 867793bc5d..079c65442f 100644 --- a/tests/deal.II/gradients.cc +++ b/tests/deal.II/gradients.cc @@ -34,10 +34,9 @@ int main () { DoFHandler<2> dof(&tria); dof.distribute_dofs(fe); - StraightBoundary<2> b; QTrapez<2> q; - FEValues<2> fevalues(fe,q,update_gradients); - fevalues.reinit (dof.begin_active(),b); + FEValues<2> fevalues(fe,q,update_gradients,tria.get_boundary()); + fevalues.reinit (dof.begin_active()); Vector val(4); diff --git a/tests/deal.II/second_derivatives.cc b/tests/deal.II/second_derivatives.cc index c968838e2c..df675fb3c8 100644 --- a/tests/deal.II/second_derivatives.cc +++ b/tests/deal.II/second_derivatives.cc @@ -27,7 +27,7 @@ int main () { StraightBoundary<2> b; QTrapez<2> q; - FEValues<2> fevalues(fe,q,update_second_derivatives); + FEValues<2> fevalues(fe,q,update_second_derivatives,b); Vector val(4); @@ -48,7 +48,7 @@ int main () { // move one vertex of the only cell if (loop==1) tria.begin_active()->vertex(2)(0) = 2; - fevalues.reinit (dof.begin_active(),b); + fevalues.reinit (dof.begin_active()); for (unsigned int vertex=0; vertex<4; ++vertex) {