From: Martin Kronbichler Date: Sat, 10 Jul 2021 19:26:40 +0000 (+0200) Subject: Move all code of MappingQGeneric to MappingQ X-Git-Tag: v9.4.0-rc1~1147^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f286e62ea205701a1bbceb24a603ce0b18eebde;p=dealii.git Move all code of MappingQGeneric to MappingQ --- diff --git a/contrib/python-bindings/source/mapping_wrapper.cc b/contrib/python-bindings/source/mapping_wrapper.cc index f846d21630..2866bf90d5 100644 --- a/contrib/python-bindings/source/mapping_wrapper.cc +++ b/contrib/python-bindings/source/mapping_wrapper.cc @@ -30,8 +30,8 @@ namespace python void *cell_accessor_ptr, void *point_ptr) { - const MappingQGeneric *mapping = - static_cast *>(mapping_ptr); + const MappingQ *mapping = + static_cast *>(mapping_ptr); const CellAccessor *cell_accessor = static_cast *>(cell_accessor_ptr); @@ -61,8 +61,8 @@ namespace python void *cell_accessor_ptr, void *point_ptr) { - const MappingQGeneric *mapping = - static_cast *>(mapping_ptr); + const MappingQ *mapping = + static_cast *>(mapping_ptr); const CellAccessor *cell_accessor = static_cast *>(cell_accessor_ptr); @@ -93,8 +93,8 @@ namespace python const unsigned int face_no, void * point_ptr) { - const MappingQGeneric *mapping = - static_cast *>(mapping_ptr); + const MappingQ *mapping = + static_cast *>(mapping_ptr); const CellAccessor *cell_accessor = static_cast *>(cell_accessor_ptr); @@ -142,15 +142,15 @@ namespace python { if ((dim == 2) && (spacedim == 2)) { - mapping_ptr = new MappingQGeneric<2, 2>(degree); + mapping_ptr = new MappingQ<2, 2>(degree); } else if ((dim == 2) && (spacedim == 3)) { - mapping_ptr = new MappingQGeneric<2, 3>(degree); + mapping_ptr = new MappingQ<2, 3>(degree); } else if ((dim == 3) && (spacedim == 3)) { - mapping_ptr = new MappingQGeneric<3, 3>(degree); + mapping_ptr = new MappingQ<3, 3>(degree); } else AssertThrow(false, ExcMessage("Wrong dim-spacedim combination.")); @@ -170,15 +170,15 @@ namespace python if ((dim == 2) && (spacedim == 2)) { - mapping_ptr = new MappingQGeneric<2, 2>(other.degree); + mapping_ptr = new MappingQ<2, 2>(other.degree); } else if ((dim == 2) && (spacedim == 3)) { - mapping_ptr = new MappingQGeneric<2, 3>(other.degree); + mapping_ptr = new MappingQ<2, 3>(other.degree); } else if ((dim == 3) && (spacedim == 3)) { - mapping_ptr = new MappingQGeneric<3, 3>(other.degree); + mapping_ptr = new MappingQ<3, 3>(other.degree); } else AssertThrow(false, ExcMessage("Wrong dim-spacedim combination.")); @@ -194,20 +194,17 @@ namespace python { // We cannot call delete on a void pointer so cast the void pointer // back first. - MappingQGeneric<2, 2> *tmp = - static_cast *>(mapping_ptr); + MappingQ<2, 2> *tmp = static_cast *>(mapping_ptr); delete tmp; } else if ((dim == 2) && (spacedim == 3)) { - MappingQGeneric<2, 3> *tmp = - static_cast *>(mapping_ptr); + MappingQ<2, 3> *tmp = static_cast *>(mapping_ptr); delete tmp; } else { - MappingQGeneric<3, 3> *tmp = - static_cast *>(mapping_ptr); + MappingQ<3, 3> *tmp = static_cast *>(mapping_ptr); delete tmp; } diff --git a/contrib/python-bindings/source/triangulation_wrapper.cc b/contrib/python-bindings/source/triangulation_wrapper.cc index 9555af6436..ddc5c69a84 100644 --- a/contrib/python-bindings/source/triangulation_wrapper.cc +++ b/contrib/python-bindings/source/triangulation_wrapper.cc @@ -651,8 +651,8 @@ namespace python if (mapping_wrapper.get_mapping() != nullptr) { - const MappingQGeneric *mapping = - static_cast *>( + const MappingQ *mapping = + static_cast *>( mapping_wrapper.get_mapping()); auto cell_pair = @@ -682,8 +682,8 @@ namespace python const Quadrature *quad = static_cast *>( quadrature_wrapper.get_quadrature()); - const MappingQGeneric *mapping = - static_cast *>( + const MappingQ *mapping = + static_cast *>( mapping_wrapper.get_mapping()); auto aspect_ratios = diff --git a/examples/step-19/step-19.cc b/examples/step-19/step-19.cc index ebb49bbcd9..37ab1240ff 100644 --- a/examples/step-19/step-19.cc +++ b/examples/step-19/step-19.cc @@ -144,7 +144,7 @@ namespace Step19 void output_results() const; Triangulation triangulation; - MappingQGeneric mapping; + MappingQ mapping; FE_Q fe; DoFHandler dof_handler; AffineConstraints constraints; diff --git a/examples/step-49/doc/results.dox b/examples/step-49/doc/results.dox index 27ae172399..e14b2c5dae 100644 --- a/examples/step-49/doc/results.dox +++ b/examples/step-49/doc/results.dox @@ -28,7 +28,7 @@ to use a curved geometry. The way to do this requires three steps: - Create an object that describes the desired geometry. This object will be queried when refining the Triangulation for new point placement. It will also be used to calculate shape function values if a high degree mapping, like - MappingQ or MappingQGeneric, is used during system assembly. + MappingQ, is used during system assembly. In deal.II the Manifold class and classes inheriting from it (e.g., PolarManifold and FlatManifold) perform these calculations. - Notify the Triangulation object which Manifold classes to use. By default, a diff --git a/examples/step-6/doc/results.dox b/examples/step-6/doc/results.dox index 2927a0cab8..0c7bb638d9 100644 --- a/examples/step-6/doc/results.dox +++ b/examples/step-6/doc/results.dox @@ -254,7 +254,7 @@ curved. We can do this by making one change to the gnuplot part of std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot"); GridOutFlags::Gnuplot gnuplot_flags(false, 5, /*curved_interior_cells*/true); grid_out.set_flags(gnuplot_flags); - MappingQGeneric mapping(3); + MappingQ mapping(3); grid_out.write_gnuplot(triangulation, output, &mapping); } @endcode diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 858260b104..c34903c5fa 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -478,7 +478,7 @@ void Step6::output_results(const unsigned int cycle) const std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot"); GridOutFlags::Gnuplot gnuplot_flags(false, 5); grid_out.set_flags(gnuplot_flags); - MappingQGeneric mapping(3); + MappingQ mapping(3); grid_out.write_gnuplot(triangulation, output, &mapping); } diff --git a/examples/step-64/step-64.cu b/examples/step-64/step-64.cu index a1b4a8a516..20e06b3cb2 100644 --- a/examples/step-64/step-64.cu +++ b/examples/step-64/step-64.cu @@ -264,7 +264,7 @@ namespace Step64 const DoFHandler & dof_handler, const AffineConstraints &constraints) { - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); typename CUDAWrappers::MatrixFree::AdditionalData additional_data; additional_data.mapping_update_flags = update_values | update_gradients | diff --git a/examples/step-65/doc/intro.dox b/examples/step-65/doc/intro.dox index 32f8e52de4..ea3060baef 100644 --- a/examples/step-65/doc/intro.dox +++ b/examples/step-65/doc/intro.dox @@ -191,7 +191,7 @@ above. This class adheres to the general manifold interfaces, i.e., given any set of points within its domain of definition, it can compute weighted averages conforming to the manifold (using a formula that will be given in a minute). These weighted averages are used whenever the mesh is refined, or -when a higher order mapping (such as MappingQGeneric or MappingC1) +when a higher order mapping (such as MappingQ or MappingC1) is evaluated on a given cell subject to this manifold. Using this manifold on the shaded cells of the coarse grid of the disk (i.e., not only in the outer-most layer of @@ -374,7 +374,7 @@ curved mesh elements is the same as the degree of the polynomials for the numerical solution. If the degree of the geometry is higher or lower than the solution, one calls that a super- or sub-parametric geometry representation, respectively. In deal.II, the standard class for polynomial representation is -MappingQGeneric. If, for example, this class is used with polynomial degree $4$ in 3D, a +MappingQ. If, for example, this class is used with polynomial degree $4$ in 3D, a total of 125 (i.e., $(4+1)^3$) points are needed for the interpolation. Among these points, 8 are the cell's vertices and already available from the mesh, but the other 117 need to be provided by the @@ -447,6 +447,6 @@ linear system for solving the Poisson equation with a jumping coefficient, its solution with a simple iterative method, computation of some numerical error with VectorTools::integrate_difference() as well as an error estimator. We record timings for each section and run the code twice. In the first run, we -hand a MappingQGeneric object to each stage of the program separately, where +hand a MappingQ object to each stage of the program separately, where points get re-computed over and over again. In the second run, we use MappingQCache instead. diff --git a/examples/step-65/doc/results.dox b/examples/step-65/doc/results.dox index fd3e9389d2..f4e2920d8a 100644 --- a/examples/step-65/doc/results.dox +++ b/examples/step-65/doc/results.dox @@ -14,7 +14,7 @@ Scanning dependencies of target \step-65 [ 66%] Built target \step-65 [100%] Run \step-65 with Release configuration -====== Running with the basic MappingQGeneric class ====== +====== Running with the basic MappingQ class ====== Number of active cells: 6656 Number of degrees of freedom: 181609 @@ -83,7 +83,7 @@ impressive for a linear stationary problem, and cost savings would indeed be much more prominent for time-dependent and nonlinear problems where assembly is called several times. If we look into the individual components, we get a clearer picture of what is going on and why the cache is so efficient: In the -MappingQGeneric case, essentially every operation that involves a mapping take +MappingQ case, essentially every operation that involves a mapping take at least 5 seconds to run. The norm computation runs two VectorTools::integrate_difference() functions, which each take almost 5 seconds. (The computation of constraints is cheaper because it only evaluates @@ -91,9 +91,9 @@ the mapping in cells at the boundary for the interpolation of boundary conditions.) If we compare these 5 seconds to the time it takes to fill the MappingQCache, which is 5.2 seconds (for all cells, not just the active ones), it becomes obvious that the computation of the mapping support points -dominates over everything else in the MappingQGeneric case. Perhaps the most +dominates over everything else in the MappingQ case. Perhaps the most striking result is the time for the error estimator, labeled "Compute error -estimator", where the MappingQGeneric implementation takes 17.3 seconds and +estimator", where the MappingQ implementation takes 17.3 seconds and the MappingQCache variant less than 0.5 seconds. The reason why the former is so expensive (three times more expensive than the assembly, for instance) is that the error estimation involves evaluation of quantities over faces, where diff --git a/examples/step-65/step-65.cc b/examples/step-65/step-65.cc index 111086142d..a6e333025d 100644 --- a/examples/step-65/step-65.cc +++ b/examples/step-65/step-65.cc @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -582,7 +582,7 @@ namespace Step65 // solver chain, starting from the setup of the equations, the assembly of // the linear system, its solution with a simple iterative solver, and the // postprocessing discussed above. The two instances differ in the way they - // use the mapping. The first uses a conventional MappingQGeneric mapping + // use the mapping. The first uses a conventional MappingQ mapping // object which we initialize to a degree one more than we use for the // finite element – after all, we expect the geometry representation // to be the bottleneck as the analytic solution is only a quadratic @@ -600,11 +600,11 @@ namespace Step65 { std::cout << std::endl - << "====== Running with the basic MappingQGeneric class ====== " + << "====== Running with the basic MappingQ class ====== " << std::endl << std::endl; - MappingQGeneric mapping(fe.degree + 1); + MappingQ mapping(fe.degree + 1); setup_system(mapping); assemble_system(mapping); solve(); @@ -619,7 +619,7 @@ namespace Step65 // we want it to show the correct degree functionality in other contexts), // we fill the cache via the MappingQCache::initialize() function. At this // stage, we specify which mapping we want to use (obviously, the same - // MappingQGeneric as previously in order to repeat the same computations) + // MappingQ as previously in order to repeat the same computations) // for the cache, and then run through the same functions again, now // handing in the modified mapping. In the end, we again print the // accumulated wall times since the reset to see how the times compare to @@ -633,7 +633,7 @@ namespace Step65 MappingQCache mapping(fe.degree + 1); { TimerOutput::Scope scope(timer, "Initialize mapping cache"); - mapping.initialize(MappingQGeneric(fe.degree + 1), triangulation); + mapping.initialize(MappingQ(fe.degree + 1), triangulation); } std::cout << " Memory consumption cache: " << 1e-6 * mapping.memory_consumption() << " MB" << std::endl; diff --git a/examples/step-66/doc/intro.dox b/examples/step-66/doc/intro.dox index 7013ad2dca..1429a72988 100644 --- a/examples/step-66/doc/intro.dox +++ b/examples/step-66/doc/intro.dox @@ -279,6 +279,6 @@ As said in step-37, the matrix-free method gets more efficient if we choose a higher order finite element space. Since we want to solve the problem on the $d$-dimensional unit ball, it would be good to have an appropriate boundary approximation to overcome convergence issues. For this reason we use an -isoparametric approach with the MappingQGeneric class to recover the smooth +isoparametric approach with the MappingQ class to recover the smooth boundary as well as the mapping for inner cells. In addition, to get a good triangulation in total we make use of the TransfiniteInterpolationManifold. diff --git a/examples/step-66/step-66.cc b/examples/step-66/step-66.cc index fec47128e4..323be0ad0e 100644 --- a/examples/step-66/step-66.cc +++ b/examples/step-66/step-66.cc @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -403,13 +403,10 @@ namespace Step66 // SphericalManifold for boundary cells a TransfiniteInterpolationManifold // object for the mapping of the inner cells, which takes care of the inner // cells. In this example we use an isoparametric finite element approach - // and thus use the MappingQGeneric class. Note, that we could also create - // an instance of the MappingQ class and set the - // use_mapping_q_on_all_cells flags in the contructor call to - // true. For further details on the connection of MappingQ and - // MappingQGeneric you may read the detailed description of these classes. + // and thus use the MappingQ class. For further details you may read the + // detailed description of this class. parallel::distributed::Triangulation triangulation; - const MappingQGeneric mapping; + const MappingQ mapping; // As usual we then define the Lagrangian finite elements FE_Q and a diff --git a/examples/step-67/step-67.cc b/examples/step-67/step-67.cc index a7792f36b9..ed06de80d8 100644 --- a/examples/step-67/step-67.cc +++ b/examples/step-67/step-67.cc @@ -1776,9 +1776,9 @@ namespace Euler_DG Triangulation triangulation; #endif - FESystem fe; - MappingQGeneric mapping; - DoFHandler dof_handler; + FESystem fe; + MappingQ mapping; + DoFHandler dof_handler; TimerOutput timer; diff --git a/examples/step-76/step-76.cc b/examples/step-76/step-76.cc index 3ac15fb3c2..fb93b5ea49 100644 --- a/examples/step-76/step-76.cc +++ b/examples/step-76/step-76.cc @@ -1203,9 +1203,9 @@ namespace Euler_DG Triangulation triangulation; #endif - FESystem fe; - MappingQGeneric mapping; - DoFHandler dof_handler; + FESystem fe; + MappingQ mapping; + DoFHandler dof_handler; TimerOutput timer; diff --git a/examples/step-79/step-79.cc b/examples/step-79/step-79.cc index 19397f9710..ad580750d5 100644 --- a/examples/step-79/step-79.cc +++ b/examples/step-79/step-79.cc @@ -756,15 +756,15 @@ namespace SAND system_rhs = 0; - MappingQGeneric mapping(1); - QGauss quadrature_formula(fe.degree + 1); - QGauss face_quadrature_formula(fe.degree + 1); - FEValues fe_values(mapping, + MappingQ mapping(1); + QGauss quadrature_formula(fe.degree + 1); + QGauss face_quadrature_formula(fe.degree + 1); + FEValues fe_values(mapping, fe, quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); - FEFaceValues fe_face_values(mapping, + FEFaceValues fe_face_values(mapping, fe, face_quadrature_formula, update_values | update_quadrature_points | @@ -1304,7 +1304,7 @@ namespace SAND BlockVector test_rhs; test_rhs.reinit(system_rhs); - MappingQGeneric mapping(1); + MappingQ mapping(1); const QGauss quadrature_formula(fe.degree + 1); const QGauss face_quadrature_formula(fe.degree + 1); FEValues fe_values(mapping, @@ -1630,7 +1630,7 @@ namespace SAND // Start with computing the objective function: double objective_function_merit = 0; { - MappingQGeneric mapping(1); + MappingQ mapping(1); const QGauss quadrature_formula(fe.degree + 1); const QGauss face_quadrature_formula(fe.degree + 1); FEValues fe_values(mapping, diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index ef9c57c6aa..994f49c3c9 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -4022,7 +4022,7 @@ public: /** * Constructor. This constructor is equivalent to the other one except that * it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FEValues(const FiniteElement &fe, const Quadrature & quadrature, @@ -4282,7 +4282,7 @@ public: /** * Constructor. This constructor is equivalent to the other one except that * it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FEFaceValues(const FiniteElement &fe, const Quadrature & quadrature, @@ -4450,7 +4450,7 @@ public: /** * Constructor. This constructor is equivalent to the other one except that * it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FESubfaceValues(const FiniteElement &fe, const Quadrature & face_quadrature, diff --git a/include/deal.II/fe/mapping.h b/include/deal.II/fe/mapping.h index 1b2ef26749..6c38099873 100644 --- a/include/deal.II/fe/mapping.h +++ b/include/deal.II/fe/mapping.h @@ -395,8 +395,8 @@ public: * triangulation). * * For example, implementations in derived classes return @p true for - * MappingQ, MappingQGeneric, MappingCartesian, but @p false for - * MappingQEulerian, MappingQ1Eulerian, and MappingFEField. + * MappingQ, MappingCartesian, but @p false for MappingQEulerian, + * MappingQ1Eulerian, and MappingFEField. */ virtual bool preserves_vertex_locations() const = 0; @@ -468,7 +468,7 @@ public: * points and calling the Mapping::transform_real_to_unit_cell() function * for each point individually, but it can be much faster for certain * mappings that implement a more specialized version such as - * MappingQGeneric. The only difference in behavior is that this function + * MappingQ. The only difference in behavior is that this function * will never throw an ExcTransformationFailed() exception. If the * transformation fails for `real_points[i]`, the returned `unit_points[i]` * contains std::numeric_limits::infinity() as the first entry. diff --git a/include/deal.II/fe/mapping_c1.h b/include/deal.II/fe/mapping_c1.h index 621d4547d1..f66df033bf 100644 --- a/include/deal.II/fe/mapping_c1.h +++ b/include/deal.II/fe/mapping_c1.h @@ -28,14 +28,14 @@ DEAL_II_NAMESPACE_OPEN /** * Mapping class that uses C1 (continuously differentiable) cubic mappings of - * the boundary. This class is built atop of MappingQGeneric by simply + * the boundary. This class is built atop of MappingQ by simply * determining the interpolation points for a cubic mapping of the boundary * differently: MappingQ chooses them such that they interpolate the boundary, * while this class chooses them such that the discretized boundary is * globally continuously differentiable. */ template -class MappingC1 : public MappingQGeneric +class MappingC1 : public MappingQ { public: /** diff --git a/include/deal.II/fe/mapping_fe.h b/include/deal.II/fe/mapping_fe.h index 2ecca19ddb..2fba288dd5 100644 --- a/include/deal.II/fe/mapping_fe.h +++ b/include/deal.II/fe/mapping_fe.h @@ -46,7 +46,7 @@ DEAL_II_NAMESPACE_OPEN * discretization, one obtains an iso-parametric mapping. * * If one initializes this class with an FE_Q(degree) object, then this class is - * equivalent to MappingQGeneric(degree). Please note that no optimizations + * equivalent to MappingQ(degree). Please note that no optimizations * exploiting tensor-product structures of finite elements have been added here. * * @note Currently, only implemented for elements with tensor_degree==1 and diff --git a/include/deal.II/fe/mapping_q.h b/include/deal.II/fe/mapping_q.h index 5c8262aaa4..6dfe954b3a 100644 --- a/include/deal.II/fe/mapping_q.h +++ b/include/deal.II/fe/mapping_q.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2001 - 2021 by the deal.II authors +// Copyright (C) 2000 - 2021 by the deal.II authors // // This file is part of the deal.II library. // @@ -19,24 +19,103 @@ #include -#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include DEAL_II_NAMESPACE_OPEN +template +class MappingQ; + +template +class MappingQCache; + + /*!@addtogroup mapping */ /*@{*/ + /** - * A class that implements a polynomial mapping $Q_p$ of degree $p$ on all - * cells. This class is completely equivalent to the MappingQGeneric class. + * This class implements the functionality for polynomial mappings $Q_p$ of + * polynomial degree $p$ that will be used on all cells of the mesh. In order + * to get a genuine higher-order mapping for all cells, it is important to + * provide information about how interior edges and faces of the mesh should + * be curved. This is typically done by associating a Manifold with interior + * cells and edges. A simple example of this is discussed in the "Results" + * section of step-6; a full discussion of manifolds is provided in + * step-53. If manifolds are only attached to the boundaries of a domain, the + * current class with higher polynomial degrees will provide the same + * information as a mere MappingQ1 object. If you are working on meshes that + * describe a (curved) manifold embedded in higher space dimensions, i.e., if + * dim!=spacedim, then every cell is at the boundary of the domain you will + * likely already have attached a manifold object to all cells that can then + * also be used by the mapping classes for higher order mappings. + * + *

Behavior along curved boundaries and with different manifolds

+ * + * For a number of applications, one only knows a manifold description of a + * surface but not the interior of the computational domain. In such a case, a + * FlatManifold object will be assigned to the interior entities that + * describes a usual planar coordinate system where the additional points for + * the higher order mapping are placed exactly according to a bi-/trilinear + * mapping. When combined with a non-flat manifold on the boundary, for + * example a circle bulging into the interior of a square cell, the two + * manifold descriptions are in general incompatible. For example, a + * FlatManifold defined solely through the cell's vertices would put an + * interior point located at some small distance epsilon away from the + * boundary along a straight line and thus in general outside the concave part + * of a circle. If the polynomial degree of MappingQ is sufficiently high, the + * transformation from the reference cell to such a cell would in general + * contain inverted regions close to the boundary. + * + * In order to avoid this situation, this class applies an algorithm for + * making this transition smooth using a so-called transfinite interpolation + * that is essentially a linear blend between the descriptions along the + * surrounding entities. In the algorithm that computes additional points, the + * compute_mapping_support_points() method, all the entities of the cells are + * passed through hierarchically, starting from the lines to the quads and + * finally hexes. Points on objects higher up in the hierarchy are obtained + * from the manifold associated with that object, taking into account all the + * points previously computed by the manifolds associated with the + * lower-dimensional objects, not just the vertices. If only a line is + * assigned a curved boundary but the adjacent quad is on a flat manifold, the + * flat manifold on the quad will take the points on the deformed line into + * account when interpolating the position of the additional points inside the + * quad and thus always result in a well-defined transformation. + * + * The interpolation scheme used in this class makes sure that curved + * descriptions can go over to flat descriptions within a single layer of + * elements, maintaining the overall optimal convergence rates of the finite + * element interpolation. However, this only helps as long as opposite faces + * of a cell are far enough away from each other: If a curved part is indeed + * curved to the extent that it would come close or even intersect some of the + * other faces, as is often the case with long and sliver cells, the current + * approach still leads to bad mesh quality. Therefore, the recommended way is + * to spread the transition between curved boundaries and flat interior + * domains over a larger range as the mesh is refined. This is provided by the + * special manifold TransfiniteInterpolationManifold. */ template -class MappingQ : public MappingQGeneric +class MappingQ : public Mapping { public: /** * Constructor. @p polynomial_degree denotes the polynomial degree of the - * polynomials that are used to map cells boundary. + * polynomials that are used to map cells from the reference to the real + * cell. */ MappingQ(const unsigned int polynomial_degree); @@ -53,10 +132,805 @@ public: * Copy constructor. */ MappingQ(const MappingQ &mapping); + + // for documentation, see the Mapping base class + virtual std::unique_ptr> + clone() const override; + + /** + * Return the degree of the mapping, i.e. the value which was passed to the + * constructor. + */ + unsigned int + get_degree() const; + + /** + * Always returns @p true because the default implementation of functions in + * this class preserves vertex locations. + */ + virtual bool + preserves_vertex_locations() const override; + + // for documentation, see the Mapping base class + virtual BoundingBox + get_bounding_box(const typename Triangulation::cell_iterator + &cell) const override; + + virtual bool + is_compatible_with(const ReferenceCell &reference_cell) const override; + + /** + * @name Mapping points between reference and real cells + * @{ + */ + + // for documentation, see the Mapping base class + virtual Point + transform_unit_to_real_cell( + const typename Triangulation::cell_iterator &cell, + const Point &p) const override; + + // for documentation, see the Mapping base class + virtual Point + transform_real_to_unit_cell( + const typename Triangulation::cell_iterator &cell, + const Point &p) const override; + + // for documentation, see the Mapping base class + virtual void + transform_points_real_to_unit_cell( + const typename Triangulation::cell_iterator &cell, + const ArrayView> & real_points, + const ArrayView> &unit_points) const override; + + /** + * @} + */ + + /** + * @name Functions to transform tensors from reference to real coordinates + * @{ + */ + + // for documentation, see the Mapping base class + virtual void + transform(const ArrayView> & input, + const MappingKind kind, + const typename Mapping::InternalDataBase &internal, + const ArrayView> &output) const override; + + // for documentation, see the Mapping base class + virtual void + transform(const ArrayView> &input, + const MappingKind kind, + const typename Mapping::InternalDataBase &internal, + const ArrayView> &output) const override; + + // for documentation, see the Mapping base class + virtual void + transform(const ArrayView> & input, + const MappingKind kind, + const typename Mapping::InternalDataBase &internal, + const ArrayView> &output) const override; + + // for documentation, see the Mapping base class + virtual void + transform(const ArrayView> &input, + const MappingKind kind, + const typename Mapping::InternalDataBase &internal, + const ArrayView> &output) const override; + + // for documentation, see the Mapping base class + virtual void + transform(const ArrayView> & input, + const MappingKind kind, + const typename Mapping::InternalDataBase &internal, + const ArrayView> &output) const override; + + /** + * @} + */ + + /** + * @name Interface with FEValues and friends + * @{ + */ + + /** + * Storage for internal data of polynomial mappings. See + * Mapping::InternalDataBase for an extensive description. + * + * For the current class, the InternalData class stores data that is + * computed once when the object is created (in get_data()) as well as data + * the class wants to store from between the call to fill_fe_values(), + * fill_fe_face_values(), or fill_fe_subface_values() until possible later + * calls from the finite element to functions such as transform(). The + * latter class of member variables are marked as 'mutable'. + */ + class InternalData : public Mapping::InternalDataBase + { + public: + /** + * Constructor. The argument denotes the polynomial degree of the mapping + * to which this object will correspond. + */ + InternalData(const unsigned int polynomial_degree); + + /** + * Initialize the object's member variables related to cell data based on + * the given arguments. + * + * The function also calls compute_shape_function_values() to actually set + * the member variables related to the values and derivatives of the + * mapping shape functions. + */ + void + initialize(const UpdateFlags update_flags, + const Quadrature &quadrature, + const unsigned int n_original_q_points); + + /** + * Initialize the object's member variables related to cell and face data + * based on the given arguments. In order to initialize cell data, this + * function calls initialize(). + */ + void + initialize_face(const UpdateFlags update_flags, + const Quadrature &quadrature, + const unsigned int n_original_q_points); + + /** + * Compute the values and/or derivatives of the shape functions used for + * the mapping. + * + * Which values, derivatives, or higher order derivatives are computed is + * determined by which of the member arrays have nonzero sizes. They are + * typically set to their appropriate sizes by the initialize() and + * initialize_face() functions, which indeed call this function + * internally. However, it is possible (and at times useful) to do the + * resizing by hand and then call this function directly. An example is in + * a Newton iteration where we update the location of a quadrature point + * (e.g., in MappingQ::transform_real_to_uni_cell()) and need to re- + * compute the mapping and its derivatives at this location, but have + * already sized all internal arrays correctly. + */ + void + compute_shape_function_values(const std::vector> &unit_points); + + /** + * Shape function at quadrature point. Shape functions are in tensor + * product order, so vertices must be reordered to obtain transformation. + */ + const double & + shape(const unsigned int qpoint, const unsigned int shape_nr) const; + + /** + * Shape function at quadrature point. See above. + */ + double & + shape(const unsigned int qpoint, const unsigned int shape_nr); + + /** + * Gradient of shape function in quadrature point. See above. + */ + const Tensor<1, dim> & + derivative(const unsigned int qpoint, const unsigned int shape_nr) const; + + /** + * Gradient of shape function in quadrature point. See above. + */ + Tensor<1, dim> & + derivative(const unsigned int qpoint, const unsigned int shape_nr); + + /** + * Second derivative of shape function in quadrature point. See above. + */ + const Tensor<2, dim> & + second_derivative(const unsigned int qpoint, + const unsigned int shape_nr) const; + + /** + * Second derivative of shape function in quadrature point. See above. + */ + Tensor<2, dim> & + second_derivative(const unsigned int qpoint, const unsigned int shape_nr); + + /** + * third derivative of shape function in quadrature point. See above. + */ + const Tensor<3, dim> & + third_derivative(const unsigned int qpoint, + const unsigned int shape_nr) const; + + /** + * third derivative of shape function in quadrature point. See above. + */ + Tensor<3, dim> & + third_derivative(const unsigned int qpoint, const unsigned int shape_nr); + + /** + * fourth derivative of shape function in quadrature point. See above. + */ + const Tensor<4, dim> & + fourth_derivative(const unsigned int qpoint, + const unsigned int shape_nr) const; + + /** + * fourth derivative of shape function in quadrature point. See above. + */ + Tensor<4, dim> & + fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr); + + /** + * Return an estimate (in bytes) for the memory consumption of this object. + */ + virtual std::size_t + memory_consumption() const override; + + /** + * Values of shape functions. Access by function @p shape. + * + * Computed once. + */ + AlignedVector shape_values; + + /** + * Values of shape function derivatives. Access by function @p derivative. + * + * Computed once. + */ + AlignedVector> shape_derivatives; + + /** + * Values of shape function second derivatives. Access by function @p + * second_derivative. + * + * Computed once. + */ + AlignedVector> shape_second_derivatives; + + /** + * Values of shape function third derivatives. Access by function @p + * second_derivative. + * + * Computed once. + */ + AlignedVector> shape_third_derivatives; + + /** + * Values of shape function fourth derivatives. Access by function @p + * second_derivative. + * + * Computed once. + */ + AlignedVector> shape_fourth_derivatives; + + /** + * Unit tangential vectors. Used for the computation of boundary forms and + * normal vectors. + * + * This array has `(dim-1) * GeometryInfo::faces_per_cell` entries. The + * first GeometryInfo::faces_per_cell contain the vectors in the first + * tangential direction for each face; the second set of + * GeometryInfo::faces_per_cell entries contain the vectors in the second + * tangential direction (only in 3d, since there we have 2 tangential + * directions per face), etc. + * + * Filled once. + */ + std::array>, + GeometryInfo::faces_per_cell *(dim - 1)> + unit_tangentials; + + /** + * The polynomial degree of the mapping. Since the objects here are also + * used (with minor adjustments) by MappingQ, we need to store this. + */ + const unsigned int polynomial_degree; + + /** + * Number of shape functions. If this is a Q1 mapping, then it is simply + * the number of vertices per cell. However, since also derived classes + * use this class (e.g. the Mapping_Q() class), the number of shape + * functions may also be different. + * + * In general, it is $(p+1)^\text{dim}$, where $p$ is the polynomial + * degree of the mapping. + */ + const unsigned int n_shape_functions; + + /* + * The default line support points. Is used in when the shape function + * values are computed. + * + * The number of quadrature points depends on the degree of this + * class, and it matches the number of degrees of freedom of an + * FE_Q<1>(this->degree). + */ + QGaussLobatto<1> line_support_points; + + /** + * In case the quadrature rule given represents a tensor product + * we need to store the evaluations of the 1d polynomials at + * the 1d quadrature points. That is what this variable is for. + */ + internal::MatrixFreeFunctions::ShapeInfo> + shape_info; + + /** + * In case the quadrature rule given represents a tensor product + * we need to store temporary data in this object. + */ + mutable AlignedVector> scratch; + + /** + * In case the quadrature rule given represents a tensor product + * the values at the mapped support points are stored in this object. + */ + mutable AlignedVector> values_dofs; + + /** + * In case the quadrature rule given represents a tensor product + * the values at the quadrature points are stored in this object. + */ + mutable AlignedVector> values_quad; + + /** + * In case the quadrature rule given represents a tensor product + * the gradients at the quadrature points are stored in this object. + */ + mutable AlignedVector> gradients_quad; + + /** + * In case the quadrature rule given represents a tensor product + * the hessians at the quadrature points are stored in this object. + */ + mutable AlignedVector> hessians_quad; + + /** + * Indicates whether the given Quadrature object is a tensor product. + */ + bool tensor_product_quadrature; + + /** + * Tensors of covariant transformation at each of the quadrature points. + * The matrix stored is the Jacobian * G^{-1}, where G = Jacobian^{t} * + * Jacobian, is the first fundamental form of the map; if dim=spacedim + * then it reduces to the transpose of the inverse of the Jacobian matrix, + * which itself is stored in the @p contravariant field of this structure. + * + * Computed on each cell. + */ + mutable AlignedVector> covariant; + + /** + * Tensors of contravariant transformation at each of the quadrature + * points. The contravariant matrix is the Jacobian of the transformation, + * i.e. $J_{ij}=dx_i/d\hat x_j$. + * + * Computed on each cell. + */ + mutable AlignedVector> contravariant; + + /** + * Auxiliary vectors for internal use. + */ + mutable std::vector>> aux; + + /** + * Stores the support points of the mapping shape functions on the @p + * cell_of_current_support_points. + */ + mutable std::vector> mapping_support_points; + + /** + * Stores the cell of which the @p mapping_support_points are stored. + */ + mutable typename Triangulation::cell_iterator + cell_of_current_support_points; + + /** + * The determinant of the Jacobian in each quadrature point. Filled if + * #update_volume_elements. + */ + mutable AlignedVector volume_elements; + }; + + + // documentation can be found in Mapping::requires_update_flags() + virtual UpdateFlags + requires_update_flags(const UpdateFlags update_flags) const override; + + // documentation can be found in Mapping::get_data() + virtual std::unique_ptr::InternalDataBase> + get_data(const UpdateFlags, const Quadrature &quadrature) const override; + + using Mapping::get_face_data; + + // documentation can be found in Mapping::get_face_data() + virtual std::unique_ptr::InternalDataBase> + get_face_data(const UpdateFlags flags, + const hp::QCollection &quadrature) const override; + + // documentation can be found in Mapping::get_subface_data() + virtual std::unique_ptr::InternalDataBase> + get_subface_data(const UpdateFlags flags, + const Quadrature &quadrature) const override; + + // documentation can be found in Mapping::fill_fe_values() + virtual CellSimilarity::Similarity + fill_fe_values( + const typename Triangulation::cell_iterator &cell, + const CellSimilarity::Similarity cell_similarity, + const Quadrature & quadrature, + const typename Mapping::InternalDataBase & internal_data, + dealii::internal::FEValuesImplementation::MappingRelatedData + &output_data) const override; + + using Mapping::fill_fe_face_values; + + // documentation can be found in Mapping::fill_fe_face_values() + virtual void + fill_fe_face_values( + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const hp::QCollection & quadrature, + const typename Mapping::InternalDataBase & internal_data, + dealii::internal::FEValuesImplementation::MappingRelatedData + &output_data) const override; + + // documentation can be found in Mapping::fill_fe_subface_values() + virtual void + fill_fe_subface_values( + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const Quadrature & quadrature, + const typename Mapping::InternalDataBase & internal_data, + dealii::internal::FEValuesImplementation::MappingRelatedData + &output_data) const override; + + + /** + * As opposed to the other fill_fe_values() and fill_fe_face_values() + * functions that rely on pre-computed information of InternalDataBase, this + * function chooses the flexible evaluation path on the cell and points + * passed in to the current function. + * + * @param[in] cell The cell where to evaluate the mapping + * + * @param[in] unit_points The points in reference coordinates where the + * transformation (Jacobians, positions) should be computed. + * + * @param[in] update_flags The kind of information that should be computed. + * + * @param[out] output_data A struct containing the evaluated quantities such + * as the Jacobian resulting from application of the mapping on the given + * cell with its underlying manifolds. + */ + void + fill_mapping_data_for_generic_points( + const typename Triangulation::cell_iterator &cell, + const ArrayView> & unit_points, + const UpdateFlags update_flags, + dealii::internal::FEValuesImplementation::MappingRelatedData + &output_data) const; + + /** + * @} + */ + +protected: + /** + * The degree of the polynomials used as shape functions for the mapping of + * cells. + */ + const unsigned int polynomial_degree; + + /* + * The default line support points. These are used when computing the + * location in real space of the support points on lines and quads, which + * are needed by the Manifold class. + * + * The number of points depends on the degree of this class, and it matches + * the number of degrees of freedom of an FE_Q<1>(this->degree). + */ + const std::vector> line_support_points; + + /* + * The one-dimensional polynomials defined as Lagrange polynomials from the + * line support points. These are used for point evaluations and match the + * polynomial space of an FE_Q<1>(this->degree). + */ + const std::vector> polynomials_1d; + + /* + * The numbering from the lexicographic to the hierarchical ordering used + * when expanding the tensor product with the mapping support points (which + * come in hierarchical numbers). + */ + const std::vector renumber_lexicographic_to_hierarchic; + + /* + * The support points in reference coordinates. These are used for + * constructing approximations of the output of + * compute_mapping_support_points() when evaluating the mapping on the fly, + * rather than going through the FEValues interface provided by + * InternalData. + * + * The number of points depends on the degree of this class, and it matches + * the number of degrees of freedom of an FE_Q(this->degree). + */ + const std::vector> unit_cell_support_points; + + /** + * A vector of tables of weights by which we multiply the locations of the + * support points on the perimeter of an object (line, quad, hex) to get the + * location of interior support points. + * + * Access into this table is by @p [structdim-1], i.e., use 0 to access the + * support point weights on a line (i.e., the interior points of the + * GaussLobatto quadrature), use 1 to access the support point weights from + * to perimeter to the interior of a quad, and use 2 to access the support + * point weights from the perimeter to the interior of a hex. + * + * The table itself contains as many columns as there are surrounding points + * to a particular object (2 for a line, 4 + 4*(degree-1) for + * a quad, 8 + 12*(degree-1) + 6*(degree-1)*(degree-1) for a + * hex) and as many rows as there are strictly interior points. + * + * For the definition of this table see equation (8) of the `mapping' + * report. + */ + const std::vector> + support_point_weights_perimeter_to_interior; + + /** + * A table of weights by which we multiply the locations of the vertex + * points of the cell to get the location of all additional support points, + * both on lines, quads, and hexes (as appropriate). This data structure is + * used when we fill all support points at once, which is the case if the + * same manifold is attached to all sub-entities of a cell. This way, we can + * avoid some of the overhead in transforming data for mappings. + * + * The table has as many rows as there are vertices to the cell (2 in 1D, 4 + * in 2D, 8 in 3D), and as many rows as there are additional support points + * in the mapping, i.e., (degree+1)^dim - 2^dim. + */ + const Table<2, double> support_point_weights_cell; + + /** + * Return the locations of support points for the mapping. For example, for + * $Q_1$ mappings these are the vertices, and for higher order polynomial + * mappings they are the vertices plus interior points on edges, faces, and + * the cell interior that are placed in consultation with the Manifold + * description of the domain and its boundary. However, other classes may + * override this function differently. In particular, the MappingQ1Eulerian + * class does exactly this by not computing the support points from the + * geometry of the current cell but instead evaluating an externally given + * displacement field in addition to the geometry of the cell. + * + * The default implementation of this function is appropriate for most + * cases. It takes the locations of support points on the boundary of the + * cell from the underlying manifold. Interior support points (ie. support + * points in quads for 2d, in hexes for 3d) are then computed using an + * interpolation from the lower-dimensional entities (lines, quads) in order + * to make the transformation as smooth as possible without introducing + * additional boundary layers within the cells due to the placement of + * support points. + * + * The function works its way from the vertices (which it takes from the + * given cell) via the support points on the line (for which it calls the + * add_line_support_points() function) and the support points on the quad + * faces (in 3d, for which it calls the add_quad_support_points() function). + * It then adds interior support points that are either computed by + * interpolation from the surrounding points using weights for transfinite + * interpolation, or if dim> + compute_mapping_support_points( + const typename Triangulation::cell_iterator &cell) const; + + /** + * Transform the point @p p on the real cell to the corresponding point on + * the unit cell @p cell by a Newton iteration. + */ + Point + transform_real_to_unit_cell_internal( + const typename Triangulation::cell_iterator &cell, + const Point & p, + const Point &initial_p_unit) const; + + /** + * Append the support points of all shape functions located on bounding + * lines of the given cell to the vector @p a. Points located on the + * vertices of a line are not included. + * + * This function uses the underlying manifold object of the line (or, if + * none is set, of the cell) for the location of the requested points. This + * function is usually called by compute_mapping_support_points() function. + * + * This function is made virtual in order to allow derived classes to choose + * shape function support points differently than the present class, which + * chooses the points as interpolation points on the boundary. + */ + virtual void + add_line_support_points( + const typename Triangulation::cell_iterator &cell, + std::vector> & a) const; + + /** + * Append the support points of all shape functions located on bounding + * faces (quads in 3d) of the given cell to the vector @p a. This function + * is only defined for dim=3. Points located on the vertices or + * lines of a quad are not included. + * + * This function uses the underlying manifold object of the quad (or, if + * none is set, of the cell) for the location of the requested points. This + * function is usually called by compute_mapping_support_points(). + * + * This function is made virtual in order to allow derived classes to choose + * shape function support points differently than the present class, which + * chooses the points as interpolation points on the boundary. + */ + virtual void + add_quad_support_points( + const typename Triangulation::cell_iterator &cell, + std::vector> & a) const; + + // Make MappingQCache a friend since it needs to call the + // compute_mapping_support_points() function. + template + friend class MappingQCache; }; + + +/** + * A class that implements a polynomial mapping $Q_p$ of degree $p$ on all + * cells. This class is completely equivalent to the MappingQ class and there + * for backward compatibility. + */ +template +using MappingQGeneric = MappingQ; + /*@}*/ + +/*----------------------------------------------------------------------*/ + +#ifndef DOXYGEN + +template +inline const double & +MappingQ::InternalData::shape(const unsigned int qpoint, + const unsigned int shape_nr) const +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size()); + return shape_values[qpoint * n_shape_functions + shape_nr]; +} + + + +template +inline double & +MappingQ::InternalData::shape(const unsigned int qpoint, + const unsigned int shape_nr) +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size()); + return shape_values[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline const Tensor<1, dim> & +MappingQ::InternalData::derivative( + const unsigned int qpoint, + const unsigned int shape_nr) const +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_derivatives.size()); + return shape_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + + +template +inline Tensor<1, dim> & +MappingQ::InternalData::derivative(const unsigned int qpoint, + const unsigned int shape_nr) +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_derivatives.size()); + return shape_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline const Tensor<2, dim> & +MappingQ::InternalData::second_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) const +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_second_derivatives.size()); + return shape_second_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline Tensor<2, dim> & +MappingQ::InternalData::second_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_second_derivatives.size()); + return shape_second_derivatives[qpoint * n_shape_functions + shape_nr]; +} + +template +inline const Tensor<3, dim> & +MappingQ::InternalData::third_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) const +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_third_derivatives.size()); + return shape_third_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline Tensor<3, dim> & +MappingQ::InternalData::third_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_third_derivatives.size()); + return shape_third_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline const Tensor<4, dim> & +MappingQ::InternalData::fourth_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) const +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_fourth_derivatives.size()); + return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + +template +inline Tensor<4, dim> & +MappingQ::InternalData::fourth_derivative( + const unsigned int qpoint, + const unsigned int shape_nr) +{ + AssertIndexRange(qpoint * n_shape_functions + shape_nr, + shape_fourth_derivatives.size()); + return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr]; +} + + + +template +inline bool +MappingQ::preserves_vertex_locations() const +{ + return true; +} + +#endif // DOXYGEN + +/* -------------- declaration of explicit specializations ------------- */ + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/include/deal.II/fe/mapping_q1.h b/include/deal.II/fe/mapping_q1.h index dc9acd4ce0..cccdec4f27 100644 --- a/include/deal.II/fe/mapping_q1.h +++ b/include/deal.II/fe/mapping_q1.h @@ -19,7 +19,7 @@ #include -#include +#include #include @@ -40,7 +40,7 @@ DEAL_II_NAMESPACE_OPEN * polyhedral domains. It is also the mapping used throughout deal.II for many * functions that come in two variants, one that allows to pass a mapping * argument explicitly and one that simply falls back to the MappingQ1 class - * declared here. (Or, in fact, to an object of kind MappingQGeneric(1), which + * declared here. (Or, in fact, to an object of kind MappingQ(1), which * implements exactly the functionality of this class.) * * The shape functions for this mapping are the same as for the finite element @@ -48,10 +48,10 @@ DEAL_II_NAMESPACE_OPEN * isoparametric element. * * @note This class is, in all reality, nothing more than a different name for - * calling MappingQGeneric with a polynomial degree of one as argument. + * calling MappingQ with a polynomial degree of one as argument. */ template -class MappingQ1 : public MappingQGeneric +class MappingQ1 : public MappingQ { public: /** @@ -70,7 +70,7 @@ public: * Many places in the library by default use (bi-,tri-)linear mappings unless * users explicitly provide a different mapping to use. In these cases, the * called function has to create a $Q_1$ mapping object, i.e., an object of - * kind MappingQGeneric(1). This is costly. It would also be costly to create + * kind MappingQ(1). This is costly. It would also be costly to create * such objects as static objects in the affected functions, because static * objects are never destroyed throughout the lifetime of a program, even * though they only have to be created once the first time code runs through a @@ -94,7 +94,7 @@ struct StaticMappingQ1 * The static $Q_1$ mapping object discussed in the documentation of this * class. */ - static MappingQGeneric mapping; + static MappingQ mapping; }; diff --git a/include/deal.II/fe/mapping_q1_eulerian.h b/include/deal.II/fe/mapping_q1_eulerian.h index 4431a5bf80..1313d4aadf 100644 --- a/include/deal.II/fe/mapping_q1_eulerian.h +++ b/include/deal.II/fe/mapping_q1_eulerian.h @@ -90,7 +90,7 @@ class Vector; * the documentation of FiniteElement or the one of Triangulation. */ template , int spacedim = dim> -class MappingQ1Eulerian : public MappingQGeneric +class MappingQ1Eulerian : public MappingQ { public: /** @@ -164,7 +164,7 @@ protected: /** * Compute the support points of the mapping. For the current class, these * are the vertices, as obtained by calling Mapping::get_vertices(). See the - * documentation of MappingQGeneric::compute_mapping_support_points() for + * documentation of MappingQ::compute_mapping_support_points() for * more information. */ virtual std::vector> diff --git a/include/deal.II/fe/mapping_q_cache.h b/include/deal.II/fe/mapping_q_cache.h index 2a29154d4c..96cb198820 100644 --- a/include/deal.II/fe/mapping_q_cache.h +++ b/include/deal.II/fe/mapping_q_cache.h @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -42,14 +42,14 @@ class DoFHandler; /** * This class implements a caching strategy for objects of the MappingQ family - * in terms of the MappingQGeneric::compute_mapping_support_points() function, - * which is used in all operations of MappingQGeneric. The information of the + * in terms of the MappingQ::compute_mapping_support_points() function, + * which is used in all operations of MappingQ. The information of the * mapping is pre-computed by the MappingQCache::initialize() function. * * The use of this class is discussed extensively in step-65. */ template -class MappingQCache : public MappingQGeneric +class MappingQCache : public MappingQ { public: /** @@ -103,8 +103,8 @@ public: * @deprecated Use initialize() version above instead. */ DEAL_II_DEPRECATED void - initialize(const Triangulation & triangulation, - const MappingQGeneric &mapping); + initialize(const Triangulation &triangulation, + const MappingQ & mapping); /** * Initialize the data cache by letting the function given as an argument @@ -219,7 +219,7 @@ public: protected: /** - * This is the main function overridden from the base class MappingQGeneric. + * This is the main function overridden from the base class MappingQ. */ virtual std::vector> compute_mapping_support_points( diff --git a/include/deal.II/fe/mapping_q_eulerian.h b/include/deal.II/fe/mapping_q_eulerian.h index bd1a4686e6..dc34260652 100644 --- a/include/deal.II/fe/mapping_q_eulerian.h +++ b/include/deal.II/fe/mapping_q_eulerian.h @@ -90,7 +90,7 @@ class Vector; * of the vector can be specified as template parameter VectorType. */ template , int spacedim = dim> -class MappingQEulerian : public MappingQGeneric +class MappingQEulerian : public MappingQ { public: /** diff --git a/include/deal.II/fe/mapping_q_generic.h b/include/deal.II/fe/mapping_q_generic.h index bb8a58f4c9..67bd8edf2e 100644 --- a/include/deal.II/fe/mapping_q_generic.h +++ b/include/deal.II/fe/mapping_q_generic.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2000 - 2021 by the deal.II authors +// Copyright (C) 2001 - 2021 by the deal.II authors // // This file is part of the deal.II library. // @@ -19,930 +19,7 @@ #include -#include -#include -#include -#include -#include +#include -#include - -#include - -#include -#include - -#include -#include - -DEAL_II_NAMESPACE_OPEN - -template -class MappingQ; - -template -class MappingQCache; - - -/*!@addtogroup mapping */ -/*@{*/ - - -/** - * This class implements the functionality for polynomial mappings $Q_p$ of - * polynomial degree $p$ that will be used on all cells of the mesh. The - * MappingQ1 and MappingQ classes specialize this behavior slightly. - * - * The class is poorly named. It should really have been called MappingQ - * because it consistently uses $Q_p$ mappings on all cells of a - * triangulation. However, the name MappingQ was already taken when we rewrote - * the entire class hierarchy for mappings. One might argue that one should - * always use MappingQGeneric over the existing class MappingQ (which, unless - * explicitly specified during the construction of the object, only uses - * mappings of degree $p$ on cells at the boundary of the domain). On - * the other hand, there are good reasons to use MappingQ in many situations: - * in many situations, curved domains are only provided with information about - * how exactly edges at the boundary are shaped, but we do not know anything - * about internal edges. Thus, in the absence of other information, we can - * only assume that internal edges are straight lines, and in that case - * internal cells may as well be treated is bilinear quadrilaterals or - * trilinear hexahedra. (An example of how such meshes look is shown in step-1 - * already, but it is also discussed in the "Results" section of step-6.) - * Because bi-/trilinear mappings are significantly cheaper to compute than - * higher order mappings, it is advantageous in such situations to use the - * higher order mapping only on cells at the boundary of the domain -- i.e., - * the behavior of MappingQ. Of course, MappingQGeneric also uses bilinear - * mappings for interior cells as long as it has no knowledge about curvature - * of interior edges, but it implements this the expensive way: as a general - * $Q_p$ mapping where the mapping support points just happen to be - * arranged along linear or bilinear edges or faces. - * - * There are a number of special cases worth considering: - * - If you really want to use a higher order mapping for all cells, - * you can do this using the current class, but this only makes sense if you - * can actually provide information about how interior edges and faces of the - * mesh should be curved. This is typically done by associating a Manifold - * with interior cells and edges. A simple example of this is discussed in the - * "Results" section of step-6; a full discussion of manifolds is provided in - * step-53. - * - If you are working on meshes that describe a (curved) manifold - * embedded in higher space dimensions, i.e., if dim!=spacedim, then every - * cell is at the boundary of the domain you will likely already have attached - * a manifold object to all cells that can then also be used by the mapping - * classes for higher order mappings. - * - *

Behavior along curved boundaries and with different manifolds

- * - * As described above, one often only knows a manifold description of a - * surface but not the interior of the computational domain. In such a case, a - * FlatManifold object will be assigned to the interior entities that - * describes a usual planar coordinate system where the additional points for - * the higher order mapping are placed exactly according to a bi-/trilinear - * mapping. When combined with a non-flat manifold on the boundary, for - * example a circle bulging into the interior of a square cell, the two - * manifold descriptions are in general incompatible. For example, a - * FlatManifold defined solely through the cell's vertices would put an - * interior point located at some small distance epsilon away from the - * boundary along a straight line and thus in general outside the concave part - * of a circle. If the polynomial degree of MappingQ is sufficiently high, the - * transformation from the reference cell to such a cell would in general - * contain inverted regions close to the boundary. - * - * In order to avoid this situation, this class applies an algorithm for - * making this transition smooth using a so-called transfinite interpolation - * that is essentially a linear blend between the descriptions along the - * surrounding entities. In the algorithm that computes additional points, the - * compute_mapping_support_points() method, all the entities of the cells are - * passed through hierarchically, starting from the lines to the quads and - * finally hexes. Points on objects higher up in the hierarchy are obtained - * from the manifold associated with that object, taking into account all the - * points previously computed by the manifolds associated with the - * lower-dimensional objects, not just the vertices. If only a line is - * assigned a curved boundary but the adjacent quad is on a flat manifold, the - * flat manifold on the quad will take the points on the deformed line into - * account when interpolating the position of the additional points inside the - * quad and thus always result in a well-defined transformation. - * - * The interpolation scheme used in this class makes sure that curved - * descriptions can go over to flat descriptions within a single layer of - * elements, maintaining the overall optimal convergence rates of the finite - * element interpolation. However, one does often get better solution - * qualities if the transition between curved boundaries and flat interior - * domains is spread over a larger range as the mesh is refined. This is - * provided by the special manifold TransfiniteInterpolationManifold. - */ -template -class MappingQGeneric : public Mapping -{ -public: - /** - * Constructor. @p polynomial_degree denotes the polynomial degree of the - * polynomials that are used to map cells from the reference to the real - * cell. - */ - MappingQGeneric(const unsigned int polynomial_degree); - - /** - * Copy constructor. - */ - MappingQGeneric(const MappingQGeneric &mapping); - - // for documentation, see the Mapping base class - virtual std::unique_ptr> - clone() const override; - - /** - * Return the degree of the mapping, i.e. the value which was passed to the - * constructor. - */ - unsigned int - get_degree() const; - - /** - * Always returns @p true because the default implementation of functions in - * this class preserves vertex locations. - */ - virtual bool - preserves_vertex_locations() const override; - - // for documentation, see the Mapping base class - virtual BoundingBox - get_bounding_box(const typename Triangulation::cell_iterator - &cell) const override; - - virtual bool - is_compatible_with(const ReferenceCell &reference_cell) const override; - - /** - * @name Mapping points between reference and real cells - * @{ - */ - - // for documentation, see the Mapping base class - virtual Point - transform_unit_to_real_cell( - const typename Triangulation::cell_iterator &cell, - const Point &p) const override; - - // for documentation, see the Mapping base class - virtual Point - transform_real_to_unit_cell( - const typename Triangulation::cell_iterator &cell, - const Point &p) const override; - - // for documentation, see the Mapping base class - virtual void - transform_points_real_to_unit_cell( - const typename Triangulation::cell_iterator &cell, - const ArrayView> & real_points, - const ArrayView> &unit_points) const override; - - /** - * @} - */ - - /** - * @name Functions to transform tensors from reference to real coordinates - * @{ - */ - - // for documentation, see the Mapping base class - virtual void - transform(const ArrayView> & input, - const MappingKind kind, - const typename Mapping::InternalDataBase &internal, - const ArrayView> &output) const override; - - // for documentation, see the Mapping base class - virtual void - transform(const ArrayView> &input, - const MappingKind kind, - const typename Mapping::InternalDataBase &internal, - const ArrayView> &output) const override; - - // for documentation, see the Mapping base class - virtual void - transform(const ArrayView> & input, - const MappingKind kind, - const typename Mapping::InternalDataBase &internal, - const ArrayView> &output) const override; - - // for documentation, see the Mapping base class - virtual void - transform(const ArrayView> &input, - const MappingKind kind, - const typename Mapping::InternalDataBase &internal, - const ArrayView> &output) const override; - - // for documentation, see the Mapping base class - virtual void - transform(const ArrayView> & input, - const MappingKind kind, - const typename Mapping::InternalDataBase &internal, - const ArrayView> &output) const override; - - /** - * @} - */ - - /** - * @name Interface with FEValues and friends - * @{ - */ - - /** - * Storage for internal data of polynomial mappings. See - * Mapping::InternalDataBase for an extensive description. - * - * For the current class, the InternalData class stores data that is - * computed once when the object is created (in get_data()) as well as data - * the class wants to store from between the call to fill_fe_values(), - * fill_fe_face_values(), or fill_fe_subface_values() until possible later - * calls from the finite element to functions such as transform(). The - * latter class of member variables are marked as 'mutable'. - */ - class InternalData : public Mapping::InternalDataBase - { - public: - /** - * Constructor. The argument denotes the polynomial degree of the mapping - * to which this object will correspond. - */ - InternalData(const unsigned int polynomial_degree); - - /** - * Initialize the object's member variables related to cell data based on - * the given arguments. - * - * The function also calls compute_shape_function_values() to actually set - * the member variables related to the values and derivatives of the - * mapping shape functions. - */ - void - initialize(const UpdateFlags update_flags, - const Quadrature &quadrature, - const unsigned int n_original_q_points); - - /** - * Initialize the object's member variables related to cell and face data - * based on the given arguments. In order to initialize cell data, this - * function calls initialize(). - */ - void - initialize_face(const UpdateFlags update_flags, - const Quadrature &quadrature, - const unsigned int n_original_q_points); - - /** - * Compute the values and/or derivatives of the shape functions used for - * the mapping. - * - * Which values, derivatives, or higher order derivatives are computed is - * determined by which of the member arrays have nonzero sizes. They are - * typically set to their appropriate sizes by the initialize() and - * initialize_face() functions, which indeed call this function - * internally. However, it is possible (and at times useful) to do the - * resizing by hand and then call this function directly. An example is in - * a Newton iteration where we update the location of a quadrature point - * (e.g., in MappingQ::transform_real_to_uni_cell()) and need to re- - * compute the mapping and its derivatives at this location, but have - * already sized all internal arrays correctly. - */ - void - compute_shape_function_values(const std::vector> &unit_points); - - /** - * Shape function at quadrature point. Shape functions are in tensor - * product order, so vertices must be reordered to obtain transformation. - */ - const double & - shape(const unsigned int qpoint, const unsigned int shape_nr) const; - - /** - * Shape function at quadrature point. See above. - */ - double & - shape(const unsigned int qpoint, const unsigned int shape_nr); - - /** - * Gradient of shape function in quadrature point. See above. - */ - const Tensor<1, dim> & - derivative(const unsigned int qpoint, const unsigned int shape_nr) const; - - /** - * Gradient of shape function in quadrature point. See above. - */ - Tensor<1, dim> & - derivative(const unsigned int qpoint, const unsigned int shape_nr); - - /** - * Second derivative of shape function in quadrature point. See above. - */ - const Tensor<2, dim> & - second_derivative(const unsigned int qpoint, - const unsigned int shape_nr) const; - - /** - * Second derivative of shape function in quadrature point. See above. - */ - Tensor<2, dim> & - second_derivative(const unsigned int qpoint, const unsigned int shape_nr); - - /** - * third derivative of shape function in quadrature point. See above. - */ - const Tensor<3, dim> & - third_derivative(const unsigned int qpoint, - const unsigned int shape_nr) const; - - /** - * third derivative of shape function in quadrature point. See above. - */ - Tensor<3, dim> & - third_derivative(const unsigned int qpoint, const unsigned int shape_nr); - - /** - * fourth derivative of shape function in quadrature point. See above. - */ - const Tensor<4, dim> & - fourth_derivative(const unsigned int qpoint, - const unsigned int shape_nr) const; - - /** - * fourth derivative of shape function in quadrature point. See above. - */ - Tensor<4, dim> & - fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr); - - /** - * Return an estimate (in bytes) for the memory consumption of this object. - */ - virtual std::size_t - memory_consumption() const override; - - /** - * Values of shape functions. Access by function @p shape. - * - * Computed once. - */ - AlignedVector shape_values; - - /** - * Values of shape function derivatives. Access by function @p derivative. - * - * Computed once. - */ - AlignedVector> shape_derivatives; - - /** - * Values of shape function second derivatives. Access by function @p - * second_derivative. - * - * Computed once. - */ - AlignedVector> shape_second_derivatives; - - /** - * Values of shape function third derivatives. Access by function @p - * second_derivative. - * - * Computed once. - */ - AlignedVector> shape_third_derivatives; - - /** - * Values of shape function fourth derivatives. Access by function @p - * second_derivative. - * - * Computed once. - */ - AlignedVector> shape_fourth_derivatives; - - /** - * Unit tangential vectors. Used for the computation of boundary forms and - * normal vectors. - * - * This array has `(dim-1) * GeometryInfo::faces_per_cell` entries. The - * first GeometryInfo::faces_per_cell contain the vectors in the first - * tangential direction for each face; the second set of - * GeometryInfo::faces_per_cell entries contain the vectors in the second - * tangential direction (only in 3d, since there we have 2 tangential - * directions per face), etc. - * - * Filled once. - */ - std::array>, - GeometryInfo::faces_per_cell *(dim - 1)> - unit_tangentials; - - /** - * The polynomial degree of the mapping. Since the objects here are also - * used (with minor adjustments) by MappingQ, we need to store this. - */ - const unsigned int polynomial_degree; - - /** - * Number of shape functions. If this is a Q1 mapping, then it is simply - * the number of vertices per cell. However, since also derived classes - * use this class (e.g. the Mapping_Q() class), the number of shape - * functions may also be different. - * - * In general, it is $(p+1)^\text{dim}$, where $p$ is the polynomial - * degree of the mapping. - */ - const unsigned int n_shape_functions; - - /* - * The default line support points. Is used in when the shape function - * values are computed. - * - * The number of quadrature points depends on the degree of this - * class, and it matches the number of degrees of freedom of an - * FE_Q<1>(this->degree). - */ - QGaussLobatto<1> line_support_points; - - /** - * In case the quadrature rule given represents a tensor product - * we need to store the evaluations of the 1d polynomials at - * the 1d quadrature points. That is what this variable is for. - */ - internal::MatrixFreeFunctions::ShapeInfo> - shape_info; - - /** - * In case the quadrature rule given represents a tensor product - * we need to store temporary data in this object. - */ - mutable AlignedVector> scratch; - - /** - * In case the quadrature rule given represents a tensor product - * the values at the mapped support points are stored in this object. - */ - mutable AlignedVector> values_dofs; - - /** - * In case the quadrature rule given represents a tensor product - * the values at the quadrature points are stored in this object. - */ - mutable AlignedVector> values_quad; - - /** - * In case the quadrature rule given represents a tensor product - * the gradients at the quadrature points are stored in this object. - */ - mutable AlignedVector> gradients_quad; - - /** - * In case the quadrature rule given represents a tensor product - * the hessians at the quadrature points are stored in this object. - */ - mutable AlignedVector> hessians_quad; - - /** - * Indicates whether the given Quadrature object is a tensor product. - */ - bool tensor_product_quadrature; - - /** - * Tensors of covariant transformation at each of the quadrature points. - * The matrix stored is the Jacobian * G^{-1}, where G = Jacobian^{t} * - * Jacobian, is the first fundamental form of the map; if dim=spacedim - * then it reduces to the transpose of the inverse of the Jacobian matrix, - * which itself is stored in the @p contravariant field of this structure. - * - * Computed on each cell. - */ - mutable AlignedVector> covariant; - - /** - * Tensors of contravariant transformation at each of the quadrature - * points. The contravariant matrix is the Jacobian of the transformation, - * i.e. $J_{ij}=dx_i/d\hat x_j$. - * - * Computed on each cell. - */ - mutable AlignedVector> contravariant; - - /** - * Auxiliary vectors for internal use. - */ - mutable std::vector>> aux; - - /** - * Stores the support points of the mapping shape functions on the @p - * cell_of_current_support_points. - */ - mutable std::vector> mapping_support_points; - - /** - * Stores the cell of which the @p mapping_support_points are stored. - */ - mutable typename Triangulation::cell_iterator - cell_of_current_support_points; - - /** - * The determinant of the Jacobian in each quadrature point. Filled if - * #update_volume_elements. - */ - mutable AlignedVector volume_elements; - }; - - - // documentation can be found in Mapping::requires_update_flags() - virtual UpdateFlags - requires_update_flags(const UpdateFlags update_flags) const override; - - // documentation can be found in Mapping::get_data() - virtual std::unique_ptr::InternalDataBase> - get_data(const UpdateFlags, const Quadrature &quadrature) const override; - - using Mapping::get_face_data; - - // documentation can be found in Mapping::get_face_data() - virtual std::unique_ptr::InternalDataBase> - get_face_data(const UpdateFlags flags, - const hp::QCollection &quadrature) const override; - - // documentation can be found in Mapping::get_subface_data() - virtual std::unique_ptr::InternalDataBase> - get_subface_data(const UpdateFlags flags, - const Quadrature &quadrature) const override; - - // documentation can be found in Mapping::fill_fe_values() - virtual CellSimilarity::Similarity - fill_fe_values( - const typename Triangulation::cell_iterator &cell, - const CellSimilarity::Similarity cell_similarity, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase & internal_data, - dealii::internal::FEValuesImplementation::MappingRelatedData - &output_data) const override; - - using Mapping::fill_fe_face_values; - - // documentation can be found in Mapping::fill_fe_face_values() - virtual void - fill_fe_face_values( - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const hp::QCollection & quadrature, - const typename Mapping::InternalDataBase & internal_data, - dealii::internal::FEValuesImplementation::MappingRelatedData - &output_data) const override; - - // documentation can be found in Mapping::fill_fe_subface_values() - virtual void - fill_fe_subface_values( - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int subface_no, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase & internal_data, - dealii::internal::FEValuesImplementation::MappingRelatedData - &output_data) const override; - - - /** - * As opposed to the other fill_fe_values() and fill_fe_face_values() - * functions that rely on pre-computed information of InternalDataBase, this - * function chooses the flexible evaluation path on the cell and points - * passed in to the current function. - * - * @param[in] cell The cell where to evaluate the mapping - * - * @param[in] unit_points The points in reference coordinates where the - * transformation (Jacobians, positions) should be computed. - * - * @param[in] update_flags The kind of information that should be computed. - * - * @param[out] output_data A struct containing the evaluated quantities such - * as the Jacobian resulting from application of the mapping on the given - * cell with its underlying manifolds. - */ - void - fill_mapping_data_for_generic_points( - const typename Triangulation::cell_iterator &cell, - const ArrayView> & unit_points, - const UpdateFlags update_flags, - dealii::internal::FEValuesImplementation::MappingRelatedData - &output_data) const; - - /** - * @} - */ - -protected: - /** - * The degree of the polynomials used as shape functions for the mapping of - * cells. - */ - const unsigned int polynomial_degree; - - /* - * The default line support points. These are used when computing the - * location in real space of the support points on lines and quads, which - * are needed by the Manifold class. - * - * The number of points depends on the degree of this class, and it matches - * the number of degrees of freedom of an FE_Q<1>(this->degree). - */ - const std::vector> line_support_points; - - /* - * The one-dimensional polynomials defined as Lagrange polynomials from the - * line support points. These are used for point evaluations and match the - * polynomial space of an FE_Q<1>(this->degree). - */ - const std::vector> polynomials_1d; - - /* - * The numbering from the lexicographic to the hierarchical ordering used - * when expanding the tensor product with the mapping support points (which - * come in hierarchical numbers). - */ - const std::vector renumber_lexicographic_to_hierarchic; - - /* - * The support points in reference coordinates. These are used for - * constructing approximations of the output of - * compute_mapping_support_points() when evaluating the mapping on the fly, - * rather than going through the FEValues interface provided by - * InternalData. - * - * The number of points depends on the degree of this class, and it matches - * the number of degrees of freedom of an FE_Q(this->degree). - */ - const std::vector> unit_cell_support_points; - - /** - * A vector of tables of weights by which we multiply the locations of the - * support points on the perimeter of an object (line, quad, hex) to get the - * location of interior support points. - * - * Access into this table is by @p [structdim-1], i.e., use 0 to access the - * support point weights on a line (i.e., the interior points of the - * GaussLobatto quadrature), use 1 to access the support point weights from - * to perimeter to the interior of a quad, and use 2 to access the support - * point weights from the perimeter to the interior of a hex. - * - * The table itself contains as many columns as there are surrounding points - * to a particular object (2 for a line, 4 + 4*(degree-1) for - * a quad, 8 + 12*(degree-1) + 6*(degree-1)*(degree-1) for a - * hex) and as many rows as there are strictly interior points. - * - * For the definition of this table see equation (8) of the `mapping' - * report. - */ - const std::vector> - support_point_weights_perimeter_to_interior; - - /** - * A table of weights by which we multiply the locations of the vertex - * points of the cell to get the location of all additional support points, - * both on lines, quads, and hexes (as appropriate). This data structure is - * used when we fill all support points at once, which is the case if the - * same manifold is attached to all sub-entities of a cell. This way, we can - * avoid some of the overhead in transforming data for mappings. - * - * The table has as many rows as there are vertices to the cell (2 in 1D, 4 - * in 2D, 8 in 3D), and as many rows as there are additional support points - * in the mapping, i.e., (degree+1)^dim - 2^dim. - */ - const Table<2, double> support_point_weights_cell; - - /** - * Return the locations of support points for the mapping. For example, for - * $Q_1$ mappings these are the vertices, and for higher order polynomial - * mappings they are the vertices plus interior points on edges, faces, and - * the cell interior that are placed in consultation with the Manifold - * description of the domain and its boundary. However, other classes may - * override this function differently. In particular, the MappingQ1Eulerian - * class does exactly this by not computing the support points from the - * geometry of the current cell but instead evaluating an externally given - * displacement field in addition to the geometry of the cell. - * - * The default implementation of this function is appropriate for most - * cases. It takes the locations of support points on the boundary of the - * cell from the underlying manifold. Interior support points (ie. support - * points in quads for 2d, in hexes for 3d) are then computed using an - * interpolation from the lower-dimensional entities (lines, quads) in order - * to make the transformation as smooth as possible without introducing - * additional boundary layers within the cells due to the placement of - * support points. - * - * The function works its way from the vertices (which it takes from the - * given cell) via the support points on the line (for which it calls the - * add_line_support_points() function) and the support points on the quad - * faces (in 3d, for which it calls the add_quad_support_points() function). - * It then adds interior support points that are either computed by - * interpolation from the surrounding points using weights for transfinite - * interpolation, or if dim> - compute_mapping_support_points( - const typename Triangulation::cell_iterator &cell) const; - - /** - * Transform the point @p p on the real cell to the corresponding point on - * the unit cell @p cell by a Newton iteration. - */ - Point - transform_real_to_unit_cell_internal( - const typename Triangulation::cell_iterator &cell, - const Point & p, - const Point &initial_p_unit) const; - - /** - * Append the support points of all shape functions located on bounding - * lines of the given cell to the vector @p a. Points located on the - * vertices of a line are not included. - * - * This function uses the underlying manifold object of the line (or, if - * none is set, of the cell) for the location of the requested points. This - * function is usually called by compute_mapping_support_points() function. - * - * This function is made virtual in order to allow derived classes to choose - * shape function support points differently than the present class, which - * chooses the points as interpolation points on the boundary. - */ - virtual void - add_line_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector> & a) const; - - /** - * Append the support points of all shape functions located on bounding - * faces (quads in 3d) of the given cell to the vector @p a. This function - * is only defined for dim=3. Points located on the vertices or - * lines of a quad are not included. - * - * This function uses the underlying manifold object of the quad (or, if - * none is set, of the cell) for the location of the requested points. This - * function is usually called by compute_mapping_support_points(). - * - * This function is made virtual in order to allow derived classes to choose - * shape function support points differently than the present class, which - * chooses the points as interpolation points on the boundary. - */ - virtual void - add_quad_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector> & a) const; - - // Make MappingQ a friend since it needs to call the fill_fe_values() - // functions on its MappingQGeneric(1) sub-object. - template - friend class MappingQ; - - // Make MappingQCache a friend since it needs to call the - // compute_mapping_support_points() function. - template - friend class MappingQCache; -}; - - - -/*@}*/ - -/*----------------------------------------------------------------------*/ - -#ifndef DOXYGEN - -template -inline const double & -MappingQGeneric::InternalData::shape( - const unsigned int qpoint, - const unsigned int shape_nr) const -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size()); - return shape_values[qpoint * n_shape_functions + shape_nr]; -} - - - -template -inline double & -MappingQGeneric::InternalData::shape(const unsigned int qpoint, - const unsigned int shape_nr) -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size()); - return shape_values[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline const Tensor<1, dim> & -MappingQGeneric::InternalData::derivative( - const unsigned int qpoint, - const unsigned int shape_nr) const -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_derivatives.size()); - return shape_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - - -template -inline Tensor<1, dim> & -MappingQGeneric::InternalData::derivative( - const unsigned int qpoint, - const unsigned int shape_nr) -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_derivatives.size()); - return shape_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline const Tensor<2, dim> & -MappingQGeneric::InternalData::second_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) const -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_second_derivatives.size()); - return shape_second_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline Tensor<2, dim> & -MappingQGeneric::InternalData::second_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_second_derivatives.size()); - return shape_second_derivatives[qpoint * n_shape_functions + shape_nr]; -} - -template -inline const Tensor<3, dim> & -MappingQGeneric::InternalData::third_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) const -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_third_derivatives.size()); - return shape_third_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline Tensor<3, dim> & -MappingQGeneric::InternalData::third_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_third_derivatives.size()); - return shape_third_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline const Tensor<4, dim> & -MappingQGeneric::InternalData::fourth_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) const -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_fourth_derivatives.size()); - return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - -template -inline Tensor<4, dim> & -MappingQGeneric::InternalData::fourth_derivative( - const unsigned int qpoint, - const unsigned int shape_nr) -{ - AssertIndexRange(qpoint * n_shape_functions + shape_nr, - shape_fourth_derivatives.size()); - return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr]; -} - - - -template -inline bool -MappingQGeneric::preserves_vertex_locations() const -{ - return true; -} - -#endif // DOXYGEN - -/* -------------- declaration of explicit specializations ------------- */ - - -DEAL_II_NAMESPACE_CLOSE #endif diff --git a/include/deal.II/fe/mapping_q_internal.h b/include/deal.II/fe/mapping_q_internal.h index f714099256..3f432f3bcd 100644 --- a/include/deal.II/fe/mapping_q_internal.h +++ b/include/deal.II/fe/mapping_q_internal.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include @@ -200,11 +200,11 @@ namespace internal /** - * Internal namespace to implement methods of MappingQGeneric, such as the + * Internal namespace to implement methods of MappingQ, such as the * evaluation of the mapping and the transformation between real and unit * cell. */ - namespace MappingQGenericImplementation + namespace MappingQImplementation { /** * This function generates the reference cell support points from the 1d @@ -451,7 +451,7 @@ namespace internal template inline Point compute_mapped_location_of_point( - const typename dealii::MappingQGeneric::InternalData &data) + const typename dealii::MappingQ::InternalData &data) { AssertDimension(data.shape_values.size(), data.mapping_support_points.size()); @@ -725,8 +725,8 @@ namespace internal do_transform_real_to_unit_cell_internal_codim1( const typename dealii::Triangulation::cell_iterator &cell, const Point & p, - const Point &initial_p_unit, - typename dealii::MappingQGeneric::InternalData &mdata) + const Point & initial_p_unit, + typename dealii::MappingQ::InternalData &mdata) { const unsigned int spacedim = dim + 1; @@ -848,7 +848,7 @@ namespace internal * real to unit points by a least-squares fit along the mapping support * points. The least squares fit is special in the sense that the * approximation is constructed for the inverse function of a - * MappingQGeneric, which is generally a rational function. This allows + * MappingQ, which is generally a rational function. This allows * for a very cheap evaluation of the inverse map by a simple polynomial * interpolation, which can be used as a better initial guess for * transforming points from real to unit coordinates than an affine @@ -875,7 +875,7 @@ namespace internal * * @param real_support_points The position of the mapping support points * in real space, queried by - * MappingQGeneric::compute_mapping_support_points(). + * MappingQ::compute_mapping_support_points(). * * @param unit_support_points The location of the support points in * reference coordinates $[0, 1]^d$ that map to the mapping support @@ -1073,7 +1073,7 @@ namespace internal inline void maybe_update_q_points_Jacobians_and_grads_tensor( const CellSimilarity::Similarity cell_similarity, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> & quadrature_points, std::vector> &jacobian_grads) { @@ -1256,8 +1256,8 @@ namespace internal template inline void maybe_compute_q_points( - const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename QProjector::DataSetDescriptor data_set, + const typename dealii::MappingQ::InternalData &data, std::vector> &quadrature_points) { const UpdateFlags update_flags = data.update_each; @@ -1290,7 +1290,7 @@ namespace internal maybe_update_Jacobians( const CellSimilarity::Similarity cell_similarity, const typename dealii::QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data) + const typename dealii::MappingQ::InternalData &data) { const UpdateFlags update_flags = data.update_each; @@ -1369,7 +1369,7 @@ namespace internal maybe_update_jacobian_grads( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_grads) { const UpdateFlags update_flags = data.update_each; @@ -1416,7 +1416,7 @@ namespace internal maybe_update_jacobian_pushed_forward_grads( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_pushed_forward_grads) { const UpdateFlags update_flags = data.update_each; @@ -1490,7 +1490,7 @@ namespace internal maybe_update_jacobian_2nd_derivatives( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_2nd_derivatives) { const UpdateFlags update_flags = data.update_each; @@ -1546,7 +1546,7 @@ namespace internal maybe_update_jacobian_pushed_forward_2nd_derivatives( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_pushed_forward_2nd_derivatives) { const UpdateFlags update_flags = data.update_each; @@ -1647,7 +1647,7 @@ namespace internal maybe_update_jacobian_3rd_derivatives( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_3rd_derivatives) { const UpdateFlags update_flags = data.update_each; @@ -1706,7 +1706,7 @@ namespace internal maybe_update_jacobian_pushed_forward_3rd_derivatives( const CellSimilarity::Similarity cell_similarity, const typename QProjector::DataSetDescriptor data_set, - const typename dealii::MappingQGeneric::InternalData &data, + const typename dealii::MappingQ::InternalData &data, std::vector> &jacobian_pushed_forward_3rd_derivatives) { const UpdateFlags update_flags = data.update_each; @@ -1831,13 +1831,13 @@ namespace internal template inline void maybe_compute_face_data( - const dealii::MappingQGeneric &mapping, + const dealii::MappingQ &mapping, const typename dealii::Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int subface_no, - const unsigned int n_q_points, - const std::vector &weights, - const typename dealii::MappingQGeneric::InternalData &data, + const unsigned int face_no, + const unsigned int subface_no, + const unsigned int n_q_points, + const std::vector & weights, + const typename dealii::MappingQ::InternalData &data, internal::FEValuesImplementation::MappingRelatedData &output_data) { @@ -1987,21 +1987,21 @@ namespace internal /** - * Do the work of MappingQGeneric::fill_fe_face_values() and - * MappingQGeneric::fill_fe_subface_values() in a generic way, + * Do the work of MappingQ::fill_fe_face_values() and + * MappingQ::fill_fe_subface_values() in a generic way, * using the 'data_set' to differentiate whether we will * work on a face (and if so, which one) or subface. */ template inline void do_fill_fe_face_values( - const dealii::MappingQGeneric &mapping, + const dealii::MappingQ &mapping, const typename dealii::Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int subface_no, - const typename QProjector::DataSetDescriptor data_set, - const Quadrature & quadrature, - const typename dealii::MappingQGeneric::InternalData &data, + const unsigned int face_no, + const unsigned int subface_no, + const typename QProjector::DataSetDescriptor data_set, + const Quadrature & quadrature, + const typename dealii::MappingQ::InternalData &data, internal::FEValuesImplementation::MappingRelatedData &output_data) { @@ -2063,7 +2063,7 @@ namespace internal /** - * Implementation of MappingQGeneric::transform() for generic tensors. + * Implementation of MappingQ::transform() for generic tensors. */ template inline void @@ -2074,14 +2074,14 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert((dynamic_cast::InternalData *>( + Assert((dynamic_cast< + const typename dealii::MappingQ::InternalData *>( &mapping_data) != nullptr), ExcInternalError()); - const typename dealii::MappingQGeneric::InternalData - &data = - static_cast:: - InternalData &>(mapping_data); + const typename dealii::MappingQ::InternalData &data = + static_cast< + const typename dealii::MappingQ::InternalData &>( + mapping_data); switch (mapping_kind) { @@ -2141,7 +2141,7 @@ namespace internal /** - * Implementation of MappingQGeneric::transform() for gradients. + * Implementation of MappingQ::transform() for gradients. */ template inline void @@ -2152,14 +2152,14 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert((dynamic_cast::InternalData *>( + Assert((dynamic_cast< + const typename dealii::MappingQ::InternalData *>( &mapping_data) != nullptr), ExcInternalError()); - const typename dealii::MappingQGeneric::InternalData - &data = - static_cast:: - InternalData &>(mapping_data); + const typename dealii::MappingQ::InternalData &data = + static_cast< + const typename dealii::MappingQ::InternalData &>( + mapping_data); switch (mapping_kind) { @@ -2239,7 +2239,7 @@ namespace internal /** - * Implementation of MappingQGeneric::transform() for hessians. + * Implementation of MappingQ::transform() for hessians. */ template inline void @@ -2250,14 +2250,14 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert((dynamic_cast::InternalData *>( + Assert((dynamic_cast< + const typename dealii::MappingQ::InternalData *>( &mapping_data) != nullptr), ExcInternalError()); - const typename dealii::MappingQGeneric::InternalData - &data = - static_cast:: - InternalData &>(mapping_data); + const typename dealii::MappingQ::InternalData &data = + static_cast< + const typename dealii::MappingQ::InternalData &>( + mapping_data); switch (mapping_kind) { @@ -2405,7 +2405,7 @@ namespace internal /** - * Implementation of MappingQGeneric::transform() for DerivativeForm + * Implementation of MappingQ::transform() for DerivativeForm * arguments. */ template @@ -2417,14 +2417,14 @@ namespace internal const ArrayView> & output) { AssertDimension(input.size(), output.size()); - Assert((dynamic_cast::InternalData *>( + Assert((dynamic_cast< + const typename dealii::MappingQ::InternalData *>( &mapping_data) != nullptr), ExcInternalError()); - const typename dealii::MappingQGeneric::InternalData - &data = - static_cast:: - InternalData &>(mapping_data); + const typename dealii::MappingQ::InternalData &data = + static_cast< + const typename dealii::MappingQ::InternalData &>( + mapping_data); switch (mapping_kind) { @@ -2443,7 +2443,7 @@ namespace internal Assert(false, ExcNotImplemented()); } } - } // namespace MappingQGenericImplementation + } // namespace MappingQImplementation } // namespace internal DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/grid/grid_generator.h b/include/deal.II/grid/grid_generator.h index 0a8d29ce08..b76fb37852 100644 --- a/include/deal.II/grid/grid_generator.h +++ b/include/deal.II/grid/grid_generator.h @@ -1511,7 +1511,7 @@ namespace GridGenerator * to visualize GNUPLOT output) * * @code - * #include + * #include * * #include * #include @@ -1535,7 +1535,7 @@ namespace GridGenerator * GridOutFlags::Gnuplot gnuplot_flags(false, 10, true); * grid_out.set_flags(gnuplot_flags); * - * const MappingQGeneric<2> mapping(3); + * const MappingQ<2> mapping(3); * std::ofstream out("out.gpl"); * grid_out.write_gnuplot(triangulation, out, &mapping); * } diff --git a/include/deal.II/grid/grid_out.h b/include/deal.II/grid/grid_out.h index eaf4727d0f..7228bddc2d 100644 --- a/include/deal.II/grid/grid_out.h +++ b/include/deal.II/grid/grid_out.h @@ -354,7 +354,7 @@ namespace GridOutFlags * the vertices of the face. * * This number is only used if the mapping used is not simply the standard - * $Q_1$ mapping (i.e., an object of kind MappingQGeneric(1)) that may + * $Q_1$ mapping (i.e., an object of kind MappingQ(1)) that may * describe edges of cells as curved and that will then be approximated * using line segments with a number of intermediate points as described * by the current variable. diff --git a/include/deal.II/grid/manifold.h b/include/deal.II/grid/manifold.h index c7a10d1f29..99ed0b867d 100644 --- a/include/deal.II/grid/manifold.h +++ b/include/deal.II/grid/manifold.h @@ -378,7 +378,7 @@ public: * In its default implementation, this function simply calls get_new_point() * on each row of @p weights and writes those points into the output array * @p new_points. However, this function is more efficient if multiple new - * points need to be generated like in MappingQGeneric and the manifold does + * points need to be generated like in MappingQ and the manifold does * expensive transformations between a chart space and the physical space, * such as ChartManifold. For this function, the surrounding points need to * be transformed back to the chart sparse only once, rather than for every diff --git a/include/deal.II/grid/manifold_lib.h b/include/deal.II/grid/manifold_lib.h index ba1fe83e7b..105ccc3f93 100644 --- a/include/deal.II/grid/manifold_lib.h +++ b/include/deal.II/grid/manifold_lib.h @@ -29,7 +29,7 @@ DEAL_II_NAMESPACE_OPEN // forward declaration namespace internal { - namespace MappingQGenericImplementation + namespace MappingQImplementation { template class InverseQuadraticApproximation; @@ -863,7 +863,7 @@ private: * nature of the manifold that is originally contained in one coarse * mesh layer will be applied to more than one fine mesh layer once the * mesh gets refined. Note that the mechanisms of - * TransfiniteInterpolationManifold are also built into the MappingQGeneric + * TransfiniteInterpolationManifold are also built into the MappingQ * class when only a surface of a cell is subject to a curved description, * ensuring that even the default case without this manifold gets optimal * convergence rates when applying curved boundary descriptions. @@ -1148,7 +1148,7 @@ private: * A vector of quadratic approximations to the inverse map from real points * to chart points for each of the coarse mesh cells. */ - std::vector> quadratic_approximation; diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 41d53d6c64..65298d787d 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -163,7 +163,7 @@ public: /** * Return a default mapping of degree @p degree matching the current * reference cell. If this reference cell is a hypercube, then the returned - * mapping is a MappingQGeneric; otherwise, it is an object of type + * mapping is a MappingQ; otherwise, it is an object of type * MappingFE initialized with FE_SimplexP (if the reference cell is a * triangle or tetrahedron), with FE_PyramidP (if the reference * cell is a pyramid), or with FE_WedgeP (if the reference cell is diff --git a/include/deal.II/hp/fe_values.h b/include/deal.II/hp/fe_values.h index 0456fbddcd..b6f4b145d0 100644 --- a/include/deal.II/hp/fe_values.h +++ b/include/deal.II/hp/fe_values.h @@ -95,7 +95,7 @@ namespace hp /** * Constructor. This constructor is equivalent to the other one except * that it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FEValuesBase( const FECollection &fe_collection, @@ -332,7 +332,7 @@ namespace hp /** * Constructor. This constructor is equivalent to the other one except * that it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FEValues(const FECollection &fe_collection, const QCollection & q_collection, @@ -466,7 +466,7 @@ namespace hp /** * Constructor. This constructor is equivalent to the other one except * that it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FEFaceValues(const hp::FECollection &fe_collection, const hp::QCollection & q_collection, @@ -610,7 +610,7 @@ namespace hp /** * Constructor. This constructor is equivalent to the other one except * that it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ FESubfaceValues(const hp::FECollection &fe_collection, const hp::QCollection & q_collection, diff --git a/include/deal.II/hp/mapping_collection.h b/include/deal.II/hp/mapping_collection.h index 59814074bb..a78059e8f1 100644 --- a/include/deal.II/hp/mapping_collection.h +++ b/include/deal.II/hp/mapping_collection.h @@ -106,7 +106,7 @@ namespace hp * Many places in the library by default use (bi-,tri-)linear mappings * unless users explicitly provide a different mapping to use. In these * cases, the called function has to create a $Q_1$ mapping object, i.e., an - * object of kind MappingQGeneric(1). This is costly. It would also be + * object of kind MappingQ(1). This is costly. It would also be * costly to create such objects as static objects in the affected * functions, because static objects are never destroyed throughout the * lifetime of a program, even though they only have to be created once the diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index cff1d6c425..e13889563c 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -2687,7 +2687,7 @@ public: /** * Constructor for the reduced functionality. This constructor is equivalent * to the other one except that it makes the object use a $Q_1$ mapping - * (i.e., an object of type MappingQGeneric(1)) implicitly. + * (i.e., an object of type MappingQ(1)) implicitly. */ FEEvaluation(const FiniteElement &fe, const Quadrature<1> & quadrature, diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index f059e9b097..1c3c90c3ff 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -381,7 +381,7 @@ namespace internal * realizations, however, there is a much more efficient implementation that * avoids the memory allocation and other expensive start-up cost of * FEValues. Currently, the functionality is specialized for mappings derived - * from MappingQGeneric and for finite elements with tensor product structure + * from MappingQ and for finite elements with tensor product structure * that work with the @ref matrixfree module. In those cases, the cost implied * by this class is similar (or sometimes even somewhat lower) than using * `FEValues::reinit(cell)` followed by `FEValues::get_function_gradients`. @@ -572,10 +572,10 @@ private: SmartPointer> mapping; /** - * Pointer to MappingQGeneric class that enables the fast path of this + * Pointer to MappingQ class that enables the fast path of this * class. */ - const MappingQGeneric *mapping_q_generic; + const MappingQ *mapping_q; /** * Pointer to the FiniteElement object passed to the constructor. @@ -685,8 +685,7 @@ FEPointEvaluation::FEPointEvaluation( const UpdateFlags update_flags, const unsigned int first_selected_component) : mapping(&mapping) - , mapping_q_generic( - dynamic_cast *>(&mapping)) + , mapping_q(dynamic_cast *>(&mapping)) , fe(&fe) , update_flags(update_flags) , update_flags_mapping(update_default) @@ -708,7 +707,7 @@ FEPointEvaluation::FEPointEvaluation( } else component += fe.element_multiplicity(base_element_number); - if (mapping_q_generic != nullptr && + if (mapping_q != nullptr && internal::FEPointEvaluation::is_fast_path_supported( fe, base_element_number) && same_base_element) @@ -767,8 +766,10 @@ FEPointEvaluation::reinit( std::copy(unit_points.begin(), unit_points.end(), this->unit_points.begin()); if (!poly.empty()) - mapping_q_generic->fill_mapping_data_for_generic_points( - cell, unit_points, update_flags_mapping, mapping_data); + mapping_q->fill_mapping_data_for_generic_points(cell, + unit_points, + update_flags_mapping, + mapping_data); else { fe_values = std::make_shared>( @@ -1123,7 +1124,7 @@ inline const typename FEPointEvaluation:: { Assert(!poly.empty(), ExcMessage("Unit gradients are currently only implemented for tensor " - "product finite elements combined with MappingQGeneric " + "product finite elements combined with MappingQ " "mappings")); AssertIndexRange(point_index, unit_gradients.size()); return unit_gradients[point_index]; diff --git a/include/deal.II/matrix_free/mapping_data_on_the_fly.h b/include/deal.II/matrix_free/mapping_data_on_the_fly.h index d0d988497a..b1c7390090 100644 --- a/include/deal.II/matrix_free/mapping_data_on_the_fly.h +++ b/include/deal.II/matrix_free/mapping_data_on_the_fly.h @@ -77,7 +77,7 @@ namespace internal /** * Constructor. This constructor is equivalent to the other one except * that it makes the object use a $Q_1$ mapping (i.e., an object of type - * MappingQGeneric(1)) implicitly. + * MappingQ(1)) implicitly. */ MappingDataOnTheFly(const Quadrature<1> &quadrature, const UpdateFlags update_flags); diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 814213751f..b10c90a197 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -440,10 +440,10 @@ namespace internal } // In case we have no hp-adaptivity (active_fe_index is empty), we have - // cells, and the mapping is MappingQGeneric or a derived class, we can + // cells, and the mapping is MappingQ or a derived class, we can // use the fast method. if (active_fe_index.empty() && !cells.empty() && mapping->size() == 1 && - dynamic_cast *>(&mapping->operator[](0))) + dynamic_cast *>(&mapping->operator[](0))) compute_mapping_q(tria, cells, face_info.faces); else { @@ -481,7 +481,7 @@ namespace internal this->mapping = &mapping->operator[](0); if (active_fe_index.empty() && !cells.empty() && mapping->size() == 1 && - dynamic_cast *>(&mapping->operator[](0))) + dynamic_cast *>(&mapping->operator[](0))) compute_mapping_q(tria, cells, face_info.faces); else { @@ -1213,7 +1213,7 @@ namespace internal mapping_q_query_fe_values( const unsigned int begin_cell, const unsigned int end_cell, - const MappingQGeneric & mapping_q, + const MappingQ & mapping_q, const dealii::Triangulation & tria, const std::vector> &cell_array, const double jacobian_size, @@ -2695,12 +2695,11 @@ namespace internal const std::vector> &faces) { // step 1: extract quadrature point data with the data appropriate for - // MappingQGeneric + // MappingQ AssertDimension(this->mapping_collection->size(), 1); - const MappingQGeneric *mapping_q = - dynamic_cast *>( - &this->mapping_collection->operator[](0)); + const MappingQ *mapping_q = dynamic_cast *>( + &this->mapping_collection->operator[](0)); Assert(mapping_q != nullptr, ExcInternalError()); const unsigned int mapping_degree = mapping_q->get_degree(); diff --git a/include/deal.II/numerics/derivative_approximation.h b/include/deal.II/numerics/derivative_approximation.h index 9474ba5d8b..150de9193a 100644 --- a/include/deal.II/numerics/derivative_approximation.h +++ b/include/deal.II/numerics/derivative_approximation.h @@ -184,7 +184,7 @@ namespace DerivativeApproximation const unsigned int component = 0); /** - * Call the function above with mapping=MappingQGeneric@(1). + * Call the function above with mapping=MappingQ@(1). */ template void @@ -219,7 +219,7 @@ namespace DerivativeApproximation const unsigned int component = 0); /** - * Call the function above with mapping=MappingQGeneric@(1). + * Call the function above with mapping=MappingQ@(1). */ template void @@ -257,7 +257,7 @@ namespace DerivativeApproximation const unsigned int component = 0); /** - * Same as above, with mapping=MappingQGeneric@(1). + * Same as above, with mapping=MappingQ@(1). */ template void diff --git a/include/deal.II/numerics/error_estimator.h b/include/deal.II/numerics/error_estimator.h index e7e4bf2208..765065ee1a 100644 --- a/include/deal.II/numerics/error_estimator.h +++ b/include/deal.II/numerics/error_estimator.h @@ -355,7 +355,7 @@ public: /** * Call the @p estimate function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template static void @@ -407,7 +407,7 @@ public: /** * Call the @p estimate function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template static void @@ -641,7 +641,7 @@ public: /** * Call the @p estimate function, see above, with - * mapping=MappingQGeneric1<1>(). + * mapping=MappingQ1<1>(). */ template static void @@ -693,7 +693,7 @@ public: /** * Call the @p estimate function, see above, with - * mapping=MappingQGeneric1<1>(). + * mapping=MappingQ1<1>(). */ template static void diff --git a/include/deal.II/numerics/matrix_tools.h b/include/deal.II/numerics/matrix_tools.h index 32ab7006e0..21a0c2d25c 100644 --- a/include/deal.II/numerics/matrix_tools.h +++ b/include/deal.II/numerics/matrix_tools.h @@ -104,7 +104,7 @@ namespace TrilinosWrappers * There exist two versions of almost all functions, one that takes an * explicit Mapping argument and one that does not. The second one generally * calls the first with an implicit $Q_1$ argument (i.e., with an argument of - * kind MappingQGeneric(1)). If your intend your code to use a different + * kind MappingQ(1)). If your intend your code to use a different * mapping than a (bi-/tri-)linear one, then you need to call the functions * with mapping argument should be used. * @@ -258,7 +258,7 @@ namespace MatrixCreator /** * Call the create_mass_matrix() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -302,7 +302,7 @@ namespace MatrixCreator /** * Call the create_mass_matrix() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -412,7 +412,7 @@ namespace MatrixCreator /** * Call the create_boundary_mass_matrix() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -491,7 +491,7 @@ namespace MatrixCreator /** * Call the create_laplace_matrix() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -534,7 +534,7 @@ namespace MatrixCreator /** * Call the create_laplace_matrix() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index e8a1235ffb..f3624336cd 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -46,7 +46,7 @@ DEAL_II_NAMESPACE_OPEN * @note There exist two versions of almost all functions, one that takes an * explicit Mapping argument and one that does not. The second one generally * calls the first with an implicit $Q_1$ argument (i.e., with an argument of - * kind MappingQGeneric(1)). If your intend your code to use a different + * kind MappingQ(1)). If your intend your code to use a different * mapping than a (bi-/tri-)linear one, then you need to call the functions * with mapping argument should be used. * diff --git a/include/deal.II/numerics/vector_tools_boundary.h b/include/deal.II/numerics/vector_tools_boundary.h index 056d53c915..55d07a5ef1 100644 --- a/include/deal.II/numerics/vector_tools_boundary.h +++ b/include/deal.II/numerics/vector_tools_boundary.h @@ -194,7 +194,7 @@ namespace VectorTools /** * Call the other interpolate_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). The same comments + * mapping=MappingQ@(1). The same comments * apply as for the previous function, in particular about the use of the * component mask and the requires size of the function object. * @@ -213,7 +213,7 @@ namespace VectorTools /** * Call the other interpolate_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). The same comments + * mapping=MappingQ@(1). The same comments * apply as for the previous function, in particular about the use of the * component mask and the requires size of the function object. */ @@ -316,7 +316,7 @@ namespace VectorTools /** * Call the other interpolate_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). The same comments + * mapping=MappingQ@(1). The same comments * apply as for the previous function, in particular about the use of the * component mask and the requires size of the function object. * @@ -337,7 +337,7 @@ namespace VectorTools /** * Call the other interpolate_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). The same comments + * mapping=MappingQ@(1). The same comments * apply as for the previous function, in particular about the use of the * component mask and the requires size of the function object. * @@ -443,7 +443,7 @@ namespace VectorTools /** * Call the project_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -471,7 +471,7 @@ namespace VectorTools /** * Call the project_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -534,7 +534,7 @@ namespace VectorTools /** * Call the project_boundary_values() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). * * @ingroup constraints */ diff --git a/include/deal.II/numerics/vector_tools_constraints.h b/include/deal.II/numerics/vector_tools_constraints.h index d890b1a7d0..ff7b6a7a3c 100644 --- a/include/deal.II/numerics/vector_tools_constraints.h +++ b/include/deal.II/numerics/vector_tools_constraints.h @@ -136,7 +136,7 @@ namespace VectorTools *

* * Here, we have two cells that use a bilinear mapping (i.e., - * MappingQGeneric(1)). Consequently, for each of the cells, the normal + * MappingQ(1)). Consequently, for each of the cells, the normal * vector is perpendicular to the straight edge. If the two edges at the top * and right are meant to approximate a curved boundary (as indicated by the * dashed line), then neither of the two computed normal vectors are equal diff --git a/include/deal.II/numerics/vector_tools_integrate_difference.h b/include/deal.II/numerics/vector_tools_integrate_difference.h index 5420516083..64248847ed 100644 --- a/include/deal.II/numerics/vector_tools_integrate_difference.h +++ b/include/deal.II/numerics/vector_tools_integrate_difference.h @@ -151,7 +151,7 @@ namespace VectorTools /** * Call the integrate_difference() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -183,7 +183,7 @@ namespace VectorTools /** * Call the integrate_difference() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void diff --git a/include/deal.II/numerics/vector_tools_interpolate.h b/include/deal.II/numerics/vector_tools_interpolate.h index 3e5e63754c..c0c00718fb 100644 --- a/include/deal.II/numerics/vector_tools_interpolate.h +++ b/include/deal.II/numerics/vector_tools_interpolate.h @@ -87,7 +87,7 @@ namespace VectorTools /** * Call the @p interpolate() function above with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void diff --git a/include/deal.II/numerics/vector_tools_mean_value.h b/include/deal.II/numerics/vector_tools_mean_value.h index bade75be1b..15a45479c8 100644 --- a/include/deal.II/numerics/vector_tools_mean_value.h +++ b/include/deal.II/numerics/vector_tools_mean_value.h @@ -120,7 +120,7 @@ namespace VectorTools /** * Call the other compute_mean_value() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template typename VectorType::value_type diff --git a/include/deal.II/numerics/vector_tools_project.h b/include/deal.II/numerics/vector_tools_project.h index 5f2eba5186..f9d7a2395a 100644 --- a/include/deal.II/numerics/vector_tools_project.h +++ b/include/deal.II/numerics/vector_tools_project.h @@ -152,7 +152,7 @@ namespace VectorTools /** * Call the project() function above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void diff --git a/include/deal.II/numerics/vector_tools_rhs.h b/include/deal.II/numerics/vector_tools_rhs.h index 18a06632f7..07dd0f421a 100644 --- a/include/deal.II/numerics/vector_tools_rhs.h +++ b/include/deal.II/numerics/vector_tools_rhs.h @@ -67,7 +67,7 @@ namespace VectorTools /** * Call the create_right_hand_side() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). */ template void @@ -128,7 +128,7 @@ namespace VectorTools /** * Call the create_boundary_right_hand_side() function, see above, with - * mapping=MappingQGeneric@(1). + * mapping=MappingQ@(1). * * @see * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" diff --git a/source/fe/CMakeLists.txt b/source/fe/CMakeLists.txt index 7cbd87bb87..f3a9205deb 100644 --- a/source/fe/CMakeLists.txt +++ b/source/fe/CMakeLists.txt @@ -55,10 +55,12 @@ SET(_unity_include_src fe_simplex_p.cc fe_simplex_p_bubbles.cc fe_trace.cc + fe_values_extractors.cc fe_wedge_p.cc mapping_c1.cc mapping_cartesian.cc mapping.cc + mapping_fe.cc mapping_q1.cc mapping_q.cc mapping_q_cache.cc @@ -67,7 +69,6 @@ SET(_unity_include_src SET(_separate_src fe_values.cc - fe_values_extractors.cc fe_values_inst2.cc fe_values_inst3.cc fe_values_inst4.cc @@ -78,8 +79,6 @@ SET(_separate_src fe_tools.cc fe_tools_interpolate.cc fe_tools_extrapolate.cc - mapping_fe.cc - mapping_q_generic.cc mapping_q1_eulerian.cc mapping_q_eulerian.cc ) @@ -141,7 +140,6 @@ SET(_inst mapping.inst.in mapping_fe.inst.in mapping_fe_field.inst.in - mapping_q_generic.inst.in mapping_q1_eulerian.inst.in mapping_q1.inst.in mapping_q_cache.inst.in diff --git a/source/fe/mapping_c1.cc b/source/fe/mapping_c1.cc index d5165e3887..14bb90181f 100644 --- a/source/fe/mapping_c1.cc +++ b/source/fe/mapping_c1.cc @@ -29,7 +29,7 @@ DEAL_II_NAMESPACE_OPEN template MappingC1::MappingC1() - : MappingQGeneric(3) + : MappingQ(3) { Assert(dim > 1, ExcImpossibleInDim(dim)); } diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index aaf181dd8f..2f4c30aeb4 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2001 - 2021 by the deal.II authors +// Copyright (C) 2000 - 2021 by the deal.II authors // // This file is part of the deal.II library. // @@ -13,51 +13,1795 @@ // // --------------------------------------------------------------------- + #include +#include #include -#include +#include #include #include +#include #include -#include - -#include -#include +#include +#include #include #include +#include +#include +#include +#include #include -#include +DEAL_II_DISABLE_EXTRA_DIAGNOSTICS +#include +DEAL_II_ENABLE_EXTRA_DIAGNOSTICS +#include +#include +#include #include #include + DEAL_II_NAMESPACE_OPEN template -MappingQ::MappingQ(const unsigned int degree) - : MappingQGeneric(degree) +MappingQ::InternalData::InternalData( + const unsigned int polynomial_degree) + : polynomial_degree(polynomial_degree) + , n_shape_functions(Utilities::fixed_power(polynomial_degree + 1)) + , line_support_points(QGaussLobatto<1>(polynomial_degree + 1)) + , tensor_product_quadrature(false) {} template -MappingQ::MappingQ(const unsigned int degree, const bool) - : MappingQGeneric(degree) -{} +std::size_t +MappingQ::InternalData::memory_consumption() const +{ + return ( + Mapping::InternalDataBase::memory_consumption() + + MemoryConsumption::memory_consumption(shape_values) + + MemoryConsumption::memory_consumption(shape_derivatives) + + MemoryConsumption::memory_consumption(covariant) + + MemoryConsumption::memory_consumption(contravariant) + + MemoryConsumption::memory_consumption(unit_tangentials) + + MemoryConsumption::memory_consumption(aux) + + MemoryConsumption::memory_consumption(mapping_support_points) + + MemoryConsumption::memory_consumption(cell_of_current_support_points) + + MemoryConsumption::memory_consumption(volume_elements) + + MemoryConsumption::memory_consumption(polynomial_degree) + + MemoryConsumption::memory_consumption(n_shape_functions)); +} + + + +template +void +MappingQ::InternalData::initialize( + const UpdateFlags update_flags, + const Quadrature &q, + const unsigned int n_original_q_points) +{ + // store the flags in the internal data object so we can access them + // in fill_fe_*_values() + this->update_each = update_flags; + + const unsigned int n_q_points = q.size(); + + const bool needs_higher_order_terms = + this->update_each & + (update_jacobian_pushed_forward_grads | update_jacobian_2nd_derivatives | + update_jacobian_pushed_forward_2nd_derivatives | + update_jacobian_3rd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives); + + if (this->update_each & update_covariant_transformation) + covariant.resize(n_original_q_points); + + if (this->update_each & update_contravariant_transformation) + contravariant.resize(n_original_q_points); + + if (this->update_each & update_volume_elements) + volume_elements.resize(n_original_q_points); + + tensor_product_quadrature = q.is_tensor_product(); + + // use of MatrixFree only for higher order elements and with more than one + // point where tensor products do not make sense + if (polynomial_degree < 2 || n_q_points == 1) + tensor_product_quadrature = false; + + if (dim > 1) + { + // find out if the one-dimensional formula is the same + // in all directions + if (tensor_product_quadrature) + { + const std::array, dim> quad_array = + q.get_tensor_basis(); + for (unsigned int i = 1; i < dim && tensor_product_quadrature; ++i) + { + if (quad_array[i - 1].size() != quad_array[i].size()) + { + tensor_product_quadrature = false; + break; + } + else + { + const std::vector> &points_1 = + quad_array[i - 1].get_points(); + const std::vector> &points_2 = + quad_array[i].get_points(); + const std::vector &weights_1 = + quad_array[i - 1].get_weights(); + const std::vector &weights_2 = + quad_array[i].get_weights(); + for (unsigned int j = 0; j < quad_array[i].size(); ++j) + { + if (std::abs(points_1[j][0] - points_2[j][0]) > 1.e-10 || + std::abs(weights_1[j] - weights_2[j]) > 1.e-10) + { + tensor_product_quadrature = false; + break; + } + } + } + } + + if (tensor_product_quadrature) + { + // use a 1D FE_DGQ and adjust the hierarchic -> lexicographic + // numbering manually (building an FE_Q is relatively + // expensive due to constraints) + const FE_DGQ<1> fe(polynomial_degree); + shape_info.reinit(q.get_tensor_basis()[0], fe); + shape_info.lexicographic_numbering = + FETools::lexicographic_to_hierarchic_numbering( + polynomial_degree); + shape_info.n_q_points = q.size(); + shape_info.dofs_per_component_on_cell = + Utilities::pow(polynomial_degree + 1, dim); + } + } + } + + // Only fill the big arrays on demand in case we cannot use the tensor + // product quadrature code path + if (dim == 1 || !tensor_product_quadrature || needs_higher_order_terms) + { + // see if we need the (transformation) shape function values + // and/or gradients and resize the necessary arrays + if (this->update_each & update_quadrature_points) + shape_values.resize(n_shape_functions * n_q_points); + + if (this->update_each & + (update_covariant_transformation | + update_contravariant_transformation | update_JxW_values | + update_boundary_forms | update_normal_vectors | update_jacobians | + update_jacobian_grads | update_inverse_jacobians | + update_jacobian_pushed_forward_grads | + update_jacobian_2nd_derivatives | + update_jacobian_pushed_forward_2nd_derivatives | + update_jacobian_3rd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives)) + shape_derivatives.resize(n_shape_functions * n_q_points); + + if (this->update_each & + (update_jacobian_grads | update_jacobian_pushed_forward_grads)) + shape_second_derivatives.resize(n_shape_functions * n_q_points); + + if (this->update_each & (update_jacobian_2nd_derivatives | + update_jacobian_pushed_forward_2nd_derivatives)) + shape_third_derivatives.resize(n_shape_functions * n_q_points); + + if (this->update_each & (update_jacobian_3rd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives)) + shape_fourth_derivatives.resize(n_shape_functions * n_q_points); + + // now also fill the various fields with their correct values + compute_shape_function_values(q.get_points()); + } +} + + + +template +void +MappingQ::InternalData::initialize_face( + const UpdateFlags update_flags, + const Quadrature &q, + const unsigned int n_original_q_points) +{ + initialize(update_flags, q, n_original_q_points); + + if (dim > 1 && tensor_product_quadrature) + { + constexpr unsigned int facedim = dim - 1; + const FE_DGQ<1> fe(polynomial_degree); + shape_info.reinit(q.get_tensor_basis()[0], fe); + shape_info.lexicographic_numbering = + FETools::lexicographic_to_hierarchic_numbering( + polynomial_degree); + shape_info.n_q_points = n_original_q_points; + shape_info.dofs_per_component_on_cell = + Utilities::pow(polynomial_degree + 1, dim); + } + + if (dim > 1) + { + if (this->update_each & + (update_boundary_forms | update_normal_vectors | update_jacobians | + update_JxW_values | update_inverse_jacobians)) + { + aux.resize(dim - 1, + AlignedVector>(n_original_q_points)); + + // Compute tangentials to the unit cell. + for (const unsigned int i : GeometryInfo::face_indices()) + { + unit_tangentials[i].resize(n_original_q_points); + std::fill(unit_tangentials[i].begin(), + unit_tangentials[i].end(), + GeometryInfo::unit_tangential_vectors[i][0]); + if (dim > 2) + { + unit_tangentials[GeometryInfo::faces_per_cell + i] + .resize(n_original_q_points); + std::fill( + unit_tangentials[GeometryInfo::faces_per_cell + i] + .begin(), + unit_tangentials[GeometryInfo::faces_per_cell + i] + .end(), + GeometryInfo::unit_tangential_vectors[i][1]); + } + } + } + } +} + + + +template +void +MappingQ::InternalData::compute_shape_function_values( + const std::vector> &unit_points) +{ + const unsigned int n_points = unit_points.size(); + + // Construct the tensor product polynomials used as shape functions for + // the Qp mapping of cells at the boundary. + const TensorProductPolynomials tensor_pols( + Polynomials::generate_complete_Lagrange_basis( + line_support_points.get_points())); + Assert(n_shape_functions == tensor_pols.n(), ExcInternalError()); + + // then also construct the mapping from lexicographic to the Qp shape + // function numbering + const std::vector renumber = + FETools::hierarchic_to_lexicographic_numbering(polynomial_degree); + + std::vector values; + std::vector> grads; + if (shape_values.size() != 0) + { + Assert(shape_values.size() == n_shape_functions * n_points, + ExcInternalError()); + values.resize(n_shape_functions); + } + if (shape_derivatives.size() != 0) + { + Assert(shape_derivatives.size() == n_shape_functions * n_points, + ExcInternalError()); + grads.resize(n_shape_functions); + } + + std::vector> grad2; + if (shape_second_derivatives.size() != 0) + { + Assert(shape_second_derivatives.size() == n_shape_functions * n_points, + ExcInternalError()); + grad2.resize(n_shape_functions); + } + + std::vector> grad3; + if (shape_third_derivatives.size() != 0) + { + Assert(shape_third_derivatives.size() == n_shape_functions * n_points, + ExcInternalError()); + grad3.resize(n_shape_functions); + } + + std::vector> grad4; + if (shape_fourth_derivatives.size() != 0) + { + Assert(shape_fourth_derivatives.size() == n_shape_functions * n_points, + ExcInternalError()); + grad4.resize(n_shape_functions); + } + + + if (shape_values.size() != 0 || shape_derivatives.size() != 0 || + shape_second_derivatives.size() != 0 || + shape_third_derivatives.size() != 0 || + shape_fourth_derivatives.size() != 0) + for (unsigned int point = 0; point < n_points; ++point) + { + tensor_pols.evaluate( + unit_points[point], values, grads, grad2, grad3, grad4); + + if (shape_values.size() != 0) + for (unsigned int i = 0; i < n_shape_functions; ++i) + shape(point, i) = values[renumber[i]]; + + if (shape_derivatives.size() != 0) + for (unsigned int i = 0; i < n_shape_functions; ++i) + derivative(point, i) = grads[renumber[i]]; + + if (shape_second_derivatives.size() != 0) + for (unsigned int i = 0; i < n_shape_functions; ++i) + second_derivative(point, i) = grad2[renumber[i]]; + + if (shape_third_derivatives.size() != 0) + for (unsigned int i = 0; i < n_shape_functions; ++i) + third_derivative(point, i) = grad3[renumber[i]]; + + if (shape_fourth_derivatives.size() != 0) + for (unsigned int i = 0; i < n_shape_functions; ++i) + fourth_derivative(point, i) = grad4[renumber[i]]; + } +} + + + +template +MappingQ::MappingQ(const unsigned int p) + : polynomial_degree(p) + , line_support_points( + QGaussLobatto<1>(this->polynomial_degree + 1).get_points()) + , polynomials_1d( + Polynomials::generate_complete_Lagrange_basis(line_support_points)) + , renumber_lexicographic_to_hierarchic( + FETools::lexicographic_to_hierarchic_numbering(p)) + , unit_cell_support_points( + internal::MappingQImplementation::unit_support_points( + line_support_points, + renumber_lexicographic_to_hierarchic)) + , support_point_weights_perimeter_to_interior( + internal::MappingQImplementation:: + compute_support_point_weights_perimeter_to_interior( + this->polynomial_degree, + dim)) + , support_point_weights_cell( + internal::MappingQImplementation::compute_support_point_weights_cell( + this->polynomial_degree)) +{ + Assert(p >= 1, + ExcMessage("It only makes sense to create polynomial mappings " + "with a polynomial degree greater or equal to one.")); +} + + + +template +MappingQ::MappingQ(const unsigned int p, const bool) + : polynomial_degree(p) + , line_support_points( + QGaussLobatto<1>(this->polynomial_degree + 1).get_points()) + , polynomials_1d( + Polynomials::generate_complete_Lagrange_basis(line_support_points)) + , renumber_lexicographic_to_hierarchic( + FETools::lexicographic_to_hierarchic_numbering(p)) + , unit_cell_support_points( + internal::MappingQImplementation::unit_support_points( + line_support_points, + renumber_lexicographic_to_hierarchic)) + , support_point_weights_perimeter_to_interior( + internal::MappingQImplementation:: + compute_support_point_weights_perimeter_to_interior( + this->polynomial_degree, + dim)) + , support_point_weights_cell( + internal::MappingQImplementation::compute_support_point_weights_cell( + this->polynomial_degree)) +{ + Assert(p >= 1, + ExcMessage("It only makes sense to create polynomial mappings " + "with a polynomial degree greater or equal to one.")); +} template MappingQ::MappingQ(const MappingQ &mapping) - : MappingQGeneric(mapping) + : polynomial_degree(mapping.polynomial_degree) + , line_support_points(mapping.line_support_points) + , polynomials_1d(mapping.polynomials_1d) + , renumber_lexicographic_to_hierarchic( + mapping.renumber_lexicographic_to_hierarchic) + , support_point_weights_perimeter_to_interior( + mapping.support_point_weights_perimeter_to_interior) + , support_point_weights_cell(mapping.support_point_weights_cell) {} -// explicit instantiations + +template +std::unique_ptr> +MappingQ::clone() const +{ + return std::make_unique>(*this); +} + + + +template +unsigned int +MappingQ::get_degree() const +{ + return polynomial_degree; +} + + + +template +Point +MappingQ::transform_unit_to_real_cell( + const typename Triangulation::cell_iterator &cell, + const Point & p) const +{ + return Point(internal::evaluate_tensor_product_value_and_gradient( + polynomials_1d, + this->compute_mapping_support_points(cell), + p, + polynomials_1d.size() == 2, + renumber_lexicographic_to_hierarchic) + .first); +} + + +// In the code below, GCC tries to instantiate MappingQ<3,4> when +// seeing which of the overloaded versions of +// do_transform_real_to_unit_cell_internal() to call. This leads to bad +// error messages and, generally, nothing very good. Avoid this by ensuring +// that this class exists, but does not have an inner InternalData +// type, thereby ruling out the codim-1 version of the function +// below when doing overload resolution. +template <> +class MappingQ<3, 4> +{}; + + + +// visual studio freaks out when trying to determine if +// do_transform_real_to_unit_cell_internal with dim=3 and spacedim=4 is a good +// candidate. So instead of letting the compiler pick the correct overload, we +// use template specialization to make sure we pick up the right function to +// call: + +template +Point +MappingQ::transform_real_to_unit_cell_internal( + const typename Triangulation::cell_iterator &, + const Point &, + const Point &) const +{ + // default implementation (should never be called) + Assert(false, ExcInternalError()); + return {}; +} + + + +template <> +Point<1> +MappingQ<1, 1>::transform_real_to_unit_cell_internal( + const Triangulation<1, 1>::cell_iterator &cell, + const Point<1> & p, + const Point<1> & initial_p_unit) const +{ + // dispatch to the various specializations for spacedim=dim, + // spacedim=dim+1, etc + return internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal<1>( + p, + initial_p_unit, + this->compute_mapping_support_points(cell), + polynomials_1d, + renumber_lexicographic_to_hierarchic); +} + + + +template <> +Point<2> +MappingQ<2, 2>::transform_real_to_unit_cell_internal( + const Triangulation<2, 2>::cell_iterator &cell, + const Point<2> & p, + const Point<2> & initial_p_unit) const +{ + return internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal<2>( + p, + initial_p_unit, + this->compute_mapping_support_points(cell), + polynomials_1d, + renumber_lexicographic_to_hierarchic); +} + + + +template <> +Point<3> +MappingQ<3, 3>::transform_real_to_unit_cell_internal( + const Triangulation<3, 3>::cell_iterator &cell, + const Point<3> & p, + const Point<3> & initial_p_unit) const +{ + return internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal<3>( + p, + initial_p_unit, + this->compute_mapping_support_points(cell), + polynomials_1d, + renumber_lexicographic_to_hierarchic); +} + + + +template <> +Point<1> +MappingQ<1, 2>::transform_real_to_unit_cell_internal( + const Triangulation<1, 2>::cell_iterator &cell, + const Point<2> & p, + const Point<1> & initial_p_unit) const +{ + const int dim = 1; + const int spacedim = 2; + + const Quadrature point_quadrature(initial_p_unit); + + UpdateFlags update_flags = update_quadrature_points | update_jacobians; + if (spacedim > dim) + update_flags |= update_jacobian_grads; + auto mdata = Utilities::dynamic_unique_cast( + get_data(update_flags, point_quadrature)); + + mdata->mapping_support_points = this->compute_mapping_support_points(cell); + + // dispatch to the various specializations for spacedim=dim, + // spacedim=dim+1, etc + return internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal_codim1<1>(cell, + p, + initial_p_unit, + *mdata); +} + + + +template <> +Point<2> +MappingQ<2, 3>::transform_real_to_unit_cell_internal( + const Triangulation<2, 3>::cell_iterator &cell, + const Point<3> & p, + const Point<2> & initial_p_unit) const +{ + const int dim = 2; + const int spacedim = 3; + + const Quadrature point_quadrature(initial_p_unit); + + UpdateFlags update_flags = update_quadrature_points | update_jacobians; + if (spacedim > dim) + update_flags |= update_jacobian_grads; + auto mdata = Utilities::dynamic_unique_cast( + get_data(update_flags, point_quadrature)); + + mdata->mapping_support_points = this->compute_mapping_support_points(cell); + + // dispatch to the various specializations for spacedim=dim, + // spacedim=dim+1, etc + return internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal_codim1<2>(cell, + p, + initial_p_unit, + *mdata); +} + +template <> +Point<1> +MappingQ<1, 3>::transform_real_to_unit_cell_internal( + const Triangulation<1, 3>::cell_iterator &, + const Point<3> &, + const Point<1> &) const +{ + Assert(false, ExcNotImplemented()); + return {}; +} + + + +template +Point +MappingQ::transform_real_to_unit_cell( + const typename Triangulation::cell_iterator &cell, + const Point & p) const +{ + // Use an exact formula if one is available. this is only the case + // for Q1 mappings in 1d, and in 2d if dim==spacedim + if (this->preserves_vertex_locations() && (polynomial_degree == 1) && + ((dim == 1) || ((dim == 2) && (dim == spacedim)))) + { + // The dimension-dependent algorithms are much faster (about 25-45x in + // 2D) but fail most of the time when the given point (p) is not in the + // cell. The dimension-independent Newton algorithm given below is + // slower, but more robust (though it still sometimes fails). Therefore + // this function implements the following strategy based on the + // p's dimension: + // + // * In 1D this mapping is linear, so the mapping is always invertible + // (and the exact formula is known) as long as the cell has non-zero + // length. + // * In 2D the exact (quadratic) formula is called first. If either the + // exact formula does not succeed (negative discriminant in the + // quadratic formula) or succeeds but finds a solution outside of the + // unit cell, then the Newton solver is called. The rationale for the + // second choice is that the exact formula may provide two different + // answers when mapping a point outside of the real cell, but the + // Newton solver (if it converges) will only return one answer. + // Otherwise the exact formula successfully found a point in the unit + // cell and that value is returned. + // * In 3D there is no (known to the authors) exact formula, so the Newton + // algorithm is used. + const auto vertices_ = this->get_vertices(cell); + + std::array, GeometryInfo::vertices_per_cell> + vertices; + for (unsigned int i = 0; i < vertices.size(); ++i) + vertices[i] = vertices_[i]; + + try + { + switch (dim) + { + case 1: + { + // formula not subject to any issues in 1d + if (spacedim == 1) + return internal::MappingQ1::transform_real_to_unit_cell( + vertices, p); + else + break; + } + + case 2: + { + const Point point = + internal::MappingQ1::transform_real_to_unit_cell(vertices, + p); + + // formula not guaranteed to work for points outside of + // the cell. only take the computed point if it lies + // inside the reference cell + const double eps = 1e-15; + if (-eps <= point(1) && point(1) <= 1 + eps && + -eps <= point(0) && point(0) <= 1 + eps) + { + return point; + } + else + break; + } + + default: + { + // we should get here, based on the if-condition at the top + Assert(false, ExcInternalError()); + } + } + } + catch ( + const typename Mapping::ExcTransformationFailed &) + { + // simply fall through and continue on to the standard Newton code + } + } + else + { + // we can't use an explicit formula, + } + + + // Find the initial value for the Newton iteration by a normal + // projection to the least square plane determined by the vertices + // of the cell + Point initial_p_unit; + if (this->preserves_vertex_locations()) + { + initial_p_unit = cell->real_to_unit_cell_affine_approximation(p); + // in 1d with spacedim > 1 the affine approximation is exact + if (dim == 1 && polynomial_degree == 1) + return initial_p_unit; + } + else + { + // else, we simply use the mid point + for (unsigned int d = 0; d < dim; ++d) + initial_p_unit[d] = 0.5; + } + + // perform the Newton iteration and return the result. note that this + // statement may throw an exception, which we simply pass up to the caller + const Point p_unit = + this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit); + if (p_unit[0] == std::numeric_limits::infinity()) + AssertThrow(false, + (typename Mapping::ExcTransformationFailed())); + return p_unit; +} + + + +template +void +MappingQ::transform_points_real_to_unit_cell( + const typename Triangulation::cell_iterator &cell, + const ArrayView> & real_points, + const ArrayView> & unit_points) const +{ + // Go to base class functions for dim < spacedim because it is not yet + // implemented with optimized code. + if (dim < spacedim) + { + Mapping::transform_points_real_to_unit_cell(cell, + real_points, + unit_points); + return; + } + + AssertDimension(real_points.size(), unit_points.size()); + const std::vector> support_points = + this->compute_mapping_support_points(cell); + + // From the given (high-order) support points, now only pick the first + // 2^dim points and construct an affine approximation from those. + internal::MappingQImplementation::InverseQuadraticApproximation + inverse_approximation(support_points, unit_cell_support_points); + + const unsigned int n_points = real_points.size(); + const unsigned int n_lanes = VectorizedArray::size(); + + // Use the more heavy VectorizedArray code path if there is more than + // one point left to compute + for (unsigned int i = 0; i < n_points; i += n_lanes) + if (n_points - i > 1) + { + Point> p_vec; + for (unsigned int j = 0; j < n_lanes; ++j) + if (i + j < n_points) + for (unsigned int d = 0; d < spacedim; ++d) + p_vec[d][j] = real_points[i + j][d]; + else + for (unsigned int d = 0; d < spacedim; ++d) + p_vec[d][j] = real_points[i][d]; + + Point> unit_point = + internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal( + p_vec, + inverse_approximation.compute(p_vec), + support_points, + polynomials_1d, + renumber_lexicographic_to_hierarchic); + + // If the vectorized computation failed, it could be that only some of + // the lanes failed but others would have succeeded if we had let them + // compute alone without interference (like negative Jacobian + // determinants) from other SIMD lanes. Repeat the computation in this + // unlikely case with scalar arguments. + for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) + if (unit_point[0][j] == std::numeric_limits::infinity()) + unit_points[i + j] = internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal( + real_points[i + j], + inverse_approximation.compute(real_points[i + j]), + support_points, + polynomials_1d, + renumber_lexicographic_to_hierarchic); + else + for (unsigned int d = 0; d < dim; ++d) + unit_points[i + j][d] = unit_point[d][j]; + } + else + unit_points[i] = internal::MappingQImplementation:: + do_transform_real_to_unit_cell_internal( + real_points[i], + inverse_approximation.compute(real_points[i]), + support_points, + polynomials_1d, + renumber_lexicographic_to_hierarchic); +} + + + +template +UpdateFlags +MappingQ::requires_update_flags(const UpdateFlags in) const +{ + // add flags if the respective quantities are necessary to compute + // what we need. note that some flags appear in both the conditions + // and in subsequent set operations. this leads to some circular + // logic. the only way to treat this is to iterate. since there are + // 5 if-clauses in the loop, it will take at most 5 iterations to + // converge. do them: + UpdateFlags out = in; + for (unsigned int i = 0; i < 5; ++i) + { + // The following is a little incorrect: + // If not applied on a face, + // update_boundary_forms does not + // make sense. On the other hand, + // it is necessary on a + // face. Currently, + // update_boundary_forms is simply + // ignored for the interior of a + // cell. + if (out & (update_JxW_values | update_normal_vectors)) + out |= update_boundary_forms; + + if (out & (update_covariant_transformation | update_JxW_values | + update_jacobians | update_jacobian_grads | + update_boundary_forms | update_normal_vectors)) + out |= update_contravariant_transformation; + + if (out & + (update_inverse_jacobians | update_jacobian_pushed_forward_grads | + update_jacobian_pushed_forward_2nd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives)) + out |= update_covariant_transformation; + + // The contravariant transformation is used in the Piola + // transformation, which requires the determinant of the Jacobi + // matrix of the transformation. Because we have no way of + // knowing here whether the finite element wants to use the + // contravariant or the Piola transforms, we add the JxW values + // to the list of flags to be updated for each cell. + if (out & update_contravariant_transformation) + out |= update_volume_elements; + + // the same is true when computing normal vectors: they require + // the determinant of the Jacobian + if (out & update_normal_vectors) + out |= update_volume_elements; + } + + return out; +} + + + +template +std::unique_ptr::InternalDataBase> +MappingQ::get_data(const UpdateFlags update_flags, + const Quadrature &q) const +{ + std::unique_ptr::InternalDataBase> data_ptr = + std::make_unique(polynomial_degree); + auto &data = dynamic_cast(*data_ptr); + data.initialize(this->requires_update_flags(update_flags), q, q.size()); + + return data_ptr; +} + + + +template +std::unique_ptr::InternalDataBase> +MappingQ::get_face_data( + const UpdateFlags update_flags, + const hp::QCollection &quadrature) const +{ + AssertDimension(quadrature.size(), 1); + + std::unique_ptr::InternalDataBase> data_ptr = + std::make_unique(polynomial_degree); + auto &data = dynamic_cast(*data_ptr); + data.initialize_face(this->requires_update_flags(update_flags), + QProjector::project_to_all_faces( + ReferenceCells::get_hypercube(), quadrature[0]), + quadrature[0].size()); + + return data_ptr; +} + + + +template +std::unique_ptr::InternalDataBase> +MappingQ::get_subface_data( + const UpdateFlags update_flags, + const Quadrature &quadrature) const +{ + std::unique_ptr::InternalDataBase> data_ptr = + std::make_unique(polynomial_degree); + auto &data = dynamic_cast(*data_ptr); + data.initialize_face(this->requires_update_flags(update_flags), + QProjector::project_to_all_subfaces( + ReferenceCells::get_hypercube(), quadrature), + quadrature.size()); + + return data_ptr; +} + + + +template +CellSimilarity::Similarity +MappingQ::fill_fe_values( + const typename Triangulation::cell_iterator &cell, + const CellSimilarity::Similarity cell_similarity, + const Quadrature & quadrature, + const typename Mapping::InternalDataBase & internal_data, + internal::FEValuesImplementation::MappingRelatedData + &output_data) const +{ + // ensure that the following static_cast is really correct: + Assert(dynamic_cast(&internal_data) != nullptr, + ExcInternalError()); + const InternalData &data = static_cast(internal_data); + + const unsigned int n_q_points = quadrature.size(); + + // recompute the support points of the transformation of this + // cell. we tried to be clever here in an earlier version of the + // library by checking whether the cell is the same as the one we + // had visited last, but it turns out to be difficult to determine + // that because a cell for the purposes of a mapping is + // characterized not just by its (triangulation, level, index) + // triple, but also by the locations of its vertices, the manifold + // object attached to the cell and all of its bounding faces/edges, + // etc. to reliably test that the "cell" we are on is, therefore, + // not easily done + data.mapping_support_points = this->compute_mapping_support_points(cell); + data.cell_of_current_support_points = cell; + + // if the order of the mapping is greater than 1, then do not reuse any cell + // similarity information. This is necessary because the cell similarity + // value is computed with just cell vertices and does not take into account + // cell curvature. + const CellSimilarity::Similarity computed_cell_similarity = + (polynomial_degree == 1 ? cell_similarity : CellSimilarity::none); + + if (dim > 1 && data.tensor_product_quadrature) + { + internal::MappingQImplementation:: + maybe_update_q_points_Jacobians_and_grads_tensor( + computed_cell_similarity, + data, + output_data.quadrature_points, + output_data.jacobian_grads); + } + else + { + internal::MappingQImplementation::maybe_compute_q_points( + QProjector::DataSetDescriptor::cell(), + data, + output_data.quadrature_points); + + internal::MappingQImplementation::maybe_update_Jacobians( + computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data); + + internal::MappingQImplementation::maybe_update_jacobian_grads( + computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_grads); + } + + internal::MappingQImplementation::maybe_update_jacobian_pushed_forward_grads< + dim, + spacedim>(computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_pushed_forward_grads); + + internal::MappingQImplementation::maybe_update_jacobian_2nd_derivatives< + dim, + spacedim>(computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_2nd_derivatives); + + internal::MappingQImplementation:: + maybe_update_jacobian_pushed_forward_2nd_derivatives( + computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_pushed_forward_2nd_derivatives); + + internal::MappingQImplementation::maybe_update_jacobian_3rd_derivatives< + dim, + spacedim>(computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_3rd_derivatives); + + internal::MappingQImplementation:: + maybe_update_jacobian_pushed_forward_3rd_derivatives( + computed_cell_similarity, + QProjector::DataSetDescriptor::cell(), + data, + output_data.jacobian_pushed_forward_3rd_derivatives); + + const UpdateFlags update_flags = data.update_each; + const std::vector &weights = quadrature.get_weights(); + + // Multiply quadrature weights by absolute value of Jacobian determinants or + // the area element g=sqrt(DX^t DX) in case of codim > 0 + + if (update_flags & (update_normal_vectors | update_JxW_values)) + { + AssertDimension(output_data.JxW_values.size(), n_q_points); + + Assert(!(update_flags & update_normal_vectors) || + (output_data.normal_vectors.size() == n_q_points), + ExcDimensionMismatch(output_data.normal_vectors.size(), + n_q_points)); + + + if (computed_cell_similarity != CellSimilarity::translation) + for (unsigned int point = 0; point < n_q_points; ++point) + { + if (dim == spacedim) + { + const double det = data.contravariant[point].determinant(); + + // check for distorted cells. + + // TODO: this allows for anisotropies of up to 1e6 in 3D and + // 1e12 in 2D. might want to find a finer + // (dimension-independent) criterion + Assert(det > + 1e-12 * Utilities::fixed_power( + cell->diameter() / std::sqrt(double(dim))), + (typename Mapping::ExcDistortedMappedCell( + cell->center(), det, point))); + + output_data.JxW_values[point] = weights[point] * det; + } + // if dim==spacedim, then there is no cell normal to + // compute. since this is for FEValues (and not FEFaceValues), + // there are also no face normals to compute + else // codim>0 case + { + Tensor<1, spacedim> DX_t[dim]; + for (unsigned int i = 0; i < spacedim; ++i) + for (unsigned int j = 0; j < dim; ++j) + DX_t[j][i] = data.contravariant[point][i][j]; + + Tensor<2, dim> G; // First fundamental form + for (unsigned int i = 0; i < dim; ++i) + for (unsigned int j = 0; j < dim; ++j) + G[i][j] = DX_t[i] * DX_t[j]; + + output_data.JxW_values[point] = + std::sqrt(determinant(G)) * weights[point]; + + if (computed_cell_similarity == + CellSimilarity::inverted_translation) + { + // we only need to flip the normal + if (update_flags & update_normal_vectors) + output_data.normal_vectors[point] *= -1.; + } + else + { + if (update_flags & update_normal_vectors) + { + Assert(spacedim == dim + 1, + ExcMessage( + "There is no (unique) cell normal for " + + Utilities::int_to_string(dim) + + "-dimensional cells in " + + Utilities::int_to_string(spacedim) + + "-dimensional space. This only works if the " + "space dimension is one greater than the " + "dimensionality of the mesh cells.")); + + if (dim == 1) + output_data.normal_vectors[point] = + cross_product_2d(-DX_t[0]); + else // dim == 2 + output_data.normal_vectors[point] = + cross_product_3d(DX_t[0], DX_t[1]); + + output_data.normal_vectors[point] /= + output_data.normal_vectors[point].norm(); + + if (cell->direction_flag() == false) + output_data.normal_vectors[point] *= -1.; + } + } + } // codim>0 case + } + } + + + + // copy values from InternalData to vector given by reference + if (update_flags & update_jacobians) + { + AssertDimension(output_data.jacobians.size(), n_q_points); + if (computed_cell_similarity != CellSimilarity::translation) + for (unsigned int point = 0; point < n_q_points; ++point) + output_data.jacobians[point] = data.contravariant[point]; + } + + // copy values from InternalData to vector given by reference + if (update_flags & update_inverse_jacobians) + { + AssertDimension(output_data.inverse_jacobians.size(), n_q_points); + if (computed_cell_similarity != CellSimilarity::translation) + for (unsigned int point = 0; point < n_q_points; ++point) + output_data.inverse_jacobians[point] = + data.covariant[point].transpose(); + } + + return computed_cell_similarity; +} + + + +template +void +MappingQ::fill_fe_face_values( + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const hp::QCollection & quadrature, + const typename Mapping::InternalDataBase & internal_data, + internal::FEValuesImplementation::MappingRelatedData + &output_data) const +{ + AssertDimension(quadrature.size(), 1); + + // ensure that the following cast is really correct: + Assert((dynamic_cast(&internal_data) != nullptr), + ExcInternalError()); + const InternalData &data = static_cast(internal_data); + + // if necessary, recompute the support points of the transformation of this + // cell (note that we need to first check the triangulation pointer, since + // otherwise the second test might trigger an exception if the triangulations + // are not the same) + if ((data.mapping_support_points.size() == 0) || + (&cell->get_triangulation() != + &data.cell_of_current_support_points->get_triangulation()) || + (cell != data.cell_of_current_support_points)) + { + data.mapping_support_points = this->compute_mapping_support_points(cell); + data.cell_of_current_support_points = cell; + } + + internal::MappingQImplementation::do_fill_fe_face_values( + *this, + cell, + face_no, + numbers::invalid_unsigned_int, + QProjector::DataSetDescriptor::face( + ReferenceCells::get_hypercube(), + face_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature[0].size()), + quadrature[0], + data, + output_data); +} + + + +template +void +MappingQ::fill_fe_subface_values( + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const Quadrature & quadrature, + const typename Mapping::InternalDataBase & internal_data, + internal::FEValuesImplementation::MappingRelatedData + &output_data) const +{ + // ensure that the following cast is really correct: + Assert((dynamic_cast(&internal_data) != nullptr), + ExcInternalError()); + const InternalData &data = static_cast(internal_data); + + // if necessary, recompute the support points of the transformation of this + // cell (note that we need to first check the triangulation pointer, since + // otherwise the second test might trigger an exception if the triangulations + // are not the same) + if ((data.mapping_support_points.size() == 0) || + (&cell->get_triangulation() != + &data.cell_of_current_support_points->get_triangulation()) || + (cell != data.cell_of_current_support_points)) + { + data.mapping_support_points = this->compute_mapping_support_points(cell); + data.cell_of_current_support_points = cell; + } + + internal::MappingQImplementation::do_fill_fe_face_values( + *this, + cell, + face_no, + subface_no, + QProjector::DataSetDescriptor::subface( + ReferenceCells::get_hypercube(), + face_no, + subface_no, + cell->face_orientation(face_no), + cell->face_flip(face_no), + cell->face_rotation(face_no), + quadrature.size(), + cell->subface_case(face_no)), + quadrature, + data, + output_data); +} + + + +template +void +MappingQ::fill_mapping_data_for_generic_points( + const typename Triangulation::cell_iterator &cell, + const ArrayView> & unit_points, + const UpdateFlags update_flags, + dealii::internal::FEValuesImplementation::MappingRelatedData + &output_data) const +{ + if (update_flags == update_default) + return; + + Assert(update_flags & update_inverse_jacobians || + update_flags & update_jacobians || + update_flags & update_quadrature_points, + ExcNotImplemented()); + + output_data.initialize(unit_points.size(), update_flags); + const std::vector> support_points = + this->compute_mapping_support_points(cell); + + const unsigned int n_points = unit_points.size(); + const unsigned int n_lanes = VectorizedArray::size(); + + // Use the more heavy VectorizedArray code path if there is more than + // one point left to compute + for (unsigned int i = 0; i < n_points; i += n_lanes) + if (n_points - i > 1) + { + Point> p_vec; + for (unsigned int j = 0; j < n_lanes; ++j) + if (i + j < n_points) + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][j] = unit_points[i + j][d]; + else + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][j] = unit_points[i][d]; + + const auto result = + internal::evaluate_tensor_product_value_and_gradient( + polynomials_1d, + support_points, + p_vec, + polynomial_degree == 1, + renumber_lexicographic_to_hierarchic); + + if (update_flags & update_quadrature_points) + for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) + for (unsigned int d = 0; d < spacedim; ++d) + output_data.quadrature_points[i + j][d] = result.first[d][j]; + + if (update_flags & update_jacobians) + for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) + for (unsigned int d = 0; d < spacedim; ++d) + for (unsigned int e = 0; e < dim; ++e) + output_data.jacobians[i + j][d][e] = result.second[e][d][j]; + + if (update_flags & update_inverse_jacobians) + { + DerivativeForm<1, spacedim, dim, VectorizedArray> jac( + result.second); + const DerivativeForm<1, spacedim, dim, VectorizedArray> + inv_jac = jac.covariant_form(); + for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < spacedim; ++e) + output_data.inverse_jacobians[i + j][d][e] = inv_jac[d][e][j]; + } + } + else + { + const auto result = + internal::evaluate_tensor_product_value_and_gradient( + polynomials_1d, + support_points, + unit_points[i], + polynomial_degree == 1, + renumber_lexicographic_to_hierarchic); + + if (update_flags & update_quadrature_points) + output_data.quadrature_points[i] = result.first; + + if (update_flags & update_jacobians) + { + DerivativeForm<1, spacedim, dim> jac = result.second; + output_data.jacobians[i] = jac.transpose(); + } + + if (update_flags & update_inverse_jacobians) + { + DerivativeForm<1, spacedim, dim> jac(result.second); + DerivativeForm<1, spacedim, dim> inv_jac = jac.covariant_form(); + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < spacedim; ++e) + output_data.inverse_jacobians[i][d][e] = inv_jac[d][e]; + } + } +} + + + +template +void +MappingQ::transform( + const ArrayView> & input, + const MappingKind mapping_kind, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView> & output) const +{ + internal::MappingQImplementation::transform_fields(input, + mapping_kind, + mapping_data, + output); +} + + + +template +void +MappingQ::transform( + const ArrayView> &input, + const MappingKind mapping_kind, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView> & output) const +{ + internal::MappingQImplementation::transform_differential_forms(input, + mapping_kind, + mapping_data, + output); +} + + + +template +void +MappingQ::transform( + const ArrayView> & input, + const MappingKind mapping_kind, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView> & output) const +{ + switch (mapping_kind) + { + case mapping_contravariant: + internal::MappingQImplementation::transform_fields(input, + mapping_kind, + mapping_data, + output); + return; + + case mapping_piola_gradient: + case mapping_contravariant_gradient: + case mapping_covariant_gradient: + internal::MappingQImplementation::transform_gradients(input, + mapping_kind, + mapping_data, + output); + return; + default: + Assert(false, ExcNotImplemented()); + } +} + + + +template +void +MappingQ::transform( + const ArrayView> &input, + const MappingKind mapping_kind, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView> & output) const +{ + AssertDimension(input.size(), output.size()); + Assert(dynamic_cast(&mapping_data) != nullptr, + ExcInternalError()); + const InternalData &data = static_cast(mapping_data); + + switch (mapping_kind) + { + case mapping_covariant_gradient: + { + Assert(data.update_each & update_contravariant_transformation, + typename FEValuesBase::ExcAccessToUninitializedField( + "update_covariant_transformation")); + + for (unsigned int q = 0; q < output.size(); ++q) + for (unsigned int i = 0; i < spacedim; ++i) + for (unsigned int j = 0; j < spacedim; ++j) + { + double tmp[dim]; + for (unsigned int K = 0; K < dim; ++K) + { + tmp[K] = data.covariant[q][j][0] * input[q][i][0][K]; + for (unsigned int J = 1; J < dim; ++J) + tmp[K] += data.covariant[q][j][J] * input[q][i][J][K]; + } + for (unsigned int k = 0; k < spacedim; ++k) + { + output[q][i][j][k] = data.covariant[q][k][0] * tmp[0]; + for (unsigned int K = 1; K < dim; ++K) + output[q][i][j][k] += data.covariant[q][k][K] * tmp[K]; + } + } + return; + } + + default: + Assert(false, ExcNotImplemented()); + } +} + + + +template +void +MappingQ::transform( + const ArrayView> & input, + const MappingKind mapping_kind, + const typename Mapping::InternalDataBase &mapping_data, + const ArrayView> & output) const +{ + switch (mapping_kind) + { + case mapping_piola_hessian: + case mapping_contravariant_hessian: + case mapping_covariant_hessian: + internal::MappingQImplementation::transform_hessians(input, + mapping_kind, + mapping_data, + output); + return; + default: + Assert(false, ExcNotImplemented()); + } +} + + + +template +void +MappingQ::add_line_support_points( + const typename Triangulation::cell_iterator &cell, + std::vector> & a) const +{ + // if we only need the midpoint, then ask for it. + if (this->polynomial_degree == 2) + { + for (unsigned int line_no = 0; + line_no < GeometryInfo::lines_per_cell; + ++line_no) + { + const typename Triangulation::line_iterator line = + (dim == 1 ? + static_cast< + typename Triangulation::line_iterator>(cell) : + cell->line(line_no)); + + const Manifold &manifold = + ((line->manifold_id() == numbers::flat_manifold_id) && + (dim < spacedim) ? + cell->get_manifold() : + line->get_manifold()); + a.push_back(manifold.get_new_point_on_line(line)); + } + } + else + // otherwise call the more complicated functions and ask for inner points + // from the manifold description + { + std::vector> tmp_points; + for (unsigned int line_no = 0; + line_no < GeometryInfo::lines_per_cell; + ++line_no) + { + const typename Triangulation::line_iterator line = + (dim == 1 ? + static_cast< + typename Triangulation::line_iterator>(cell) : + cell->line(line_no)); + + const Manifold &manifold = + ((line->manifold_id() == numbers::flat_manifold_id) && + (dim < spacedim) ? + cell->get_manifold() : + line->get_manifold()); + + const std::array, 2> vertices{ + {cell->vertex(GeometryInfo::line_to_cell_vertices(line_no, 0)), + cell->vertex( + GeometryInfo::line_to_cell_vertices(line_no, 1))}}; + + const std::size_t n_rows = + support_point_weights_perimeter_to_interior[0].size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + manifold.get_new_points( + make_array_view(vertices.begin(), vertices.end()), + support_point_weights_perimeter_to_interior[0], + a_view); + } + } +} + + + +template <> +void +MappingQ<3, 3>::add_quad_support_points( + const Triangulation<3, 3>::cell_iterator &cell, + std::vector> & a) const +{ + const unsigned int faces_per_cell = GeometryInfo<3>::faces_per_cell; + + // used if face quad at boundary or entirely in the interior of the domain + std::vector> tmp_points; + + // loop over all faces and collect points on them + for (unsigned int face_no = 0; face_no < faces_per_cell; ++face_no) + { + const Triangulation<3>::face_iterator face = cell->face(face_no); + +#ifdef DEBUG + const bool face_orientation = cell->face_orientation(face_no), + face_flip = cell->face_flip(face_no), + face_rotation = cell->face_rotation(face_no); + const unsigned int vertices_per_face = GeometryInfo<3>::vertices_per_face, + lines_per_face = GeometryInfo<3>::lines_per_face; + + // some sanity checks up front + for (unsigned int i = 0; i < vertices_per_face; ++i) + Assert(face->vertex_index(i) == + cell->vertex_index(GeometryInfo<3>::face_to_cell_vertices( + face_no, i, face_orientation, face_flip, face_rotation)), + ExcInternalError()); + + // indices of the lines that bound a face are given by GeometryInfo<3>:: + // face_to_cell_lines + for (unsigned int i = 0; i < lines_per_face; ++i) + Assert(face->line(i) == + cell->line(GeometryInfo<3>::face_to_cell_lines( + face_no, i, face_orientation, face_flip, face_rotation)), + ExcInternalError()); +#endif + // extract the points surrounding a quad from the points + // already computed. First get the 4 vertices and then the points on + // the four lines + boost::container::small_vector, 200> tmp_points( + GeometryInfo<2>::vertices_per_cell + + GeometryInfo<2>::lines_per_cell * (polynomial_degree - 1)); + for (const unsigned int v : GeometryInfo<2>::vertex_indices()) + tmp_points[v] = a[GeometryInfo<3>::face_to_cell_vertices(face_no, v)]; + if (polynomial_degree > 1) + for (unsigned int line = 0; line < GeometryInfo<2>::lines_per_cell; + ++line) + for (unsigned int i = 0; i < polynomial_degree - 1; ++i) + tmp_points[4 + line * (polynomial_degree - 1) + i] = + a[GeometryInfo<3>::vertices_per_cell + + (polynomial_degree - 1) * + GeometryInfo<3>::face_to_cell_lines(face_no, line) + + i]; + + const std::size_t n_rows = + support_point_weights_perimeter_to_interior[1].size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + face->get_manifold().get_new_points( + make_array_view(tmp_points.begin(), tmp_points.end()), + support_point_weights_perimeter_to_interior[1], + a_view); + } +} + + + +template <> +void +MappingQ<2, 3>::add_quad_support_points( + const Triangulation<2, 3>::cell_iterator &cell, + std::vector> & a) const +{ + std::array, GeometryInfo<2>::vertices_per_cell> vertices; + for (const unsigned int i : GeometryInfo<2>::vertex_indices()) + vertices[i] = cell->vertex(i); + + Table<2, double> weights(Utilities::fixed_power<2>(polynomial_degree - 1), + GeometryInfo<2>::vertices_per_cell); + for (unsigned int q = 0, q2 = 0; q2 < polynomial_degree - 1; ++q2) + for (unsigned int q1 = 0; q1 < polynomial_degree - 1; ++q1, ++q) + { + Point<2> point(line_support_points[q1 + 1][0], + line_support_points[q2 + 1][0]); + for (const unsigned int i : GeometryInfo<2>::vertex_indices()) + weights(q, i) = GeometryInfo<2>::d_linear_shape_function(point, i); + } + + const std::size_t n_rows = weights.size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + cell->get_manifold().get_new_points( + make_array_view(vertices.begin(), vertices.end()), weights, a_view); +} + + + +template +void +MappingQ::add_quad_support_points( + const typename Triangulation::cell_iterator &, + std::vector> &) const +{ + Assert(false, ExcInternalError()); +} + + + +template +std::vector> +MappingQ::compute_mapping_support_points( + const typename Triangulation::cell_iterator &cell) const +{ + // get the vertices first + std::vector> a; + a.reserve(Utilities::fixed_power(polynomial_degree + 1)); + for (const unsigned int i : GeometryInfo::vertex_indices()) + a.push_back(cell->vertex(i)); + + if (this->polynomial_degree > 1) + { + // check if all entities have the same manifold id which is when we can + // simply ask the manifold for all points. the transfinite manifold can + // do the interpolation better than this class, so if we detect that we + // do not have to change anything here + Assert(dim <= 3, ExcImpossibleInDim(dim)); + bool all_manifold_ids_are_equal = (dim == spacedim); + if (all_manifold_ids_are_equal && + dynamic_cast *>( + &cell->get_manifold()) == nullptr) + { + for (auto f : GeometryInfo::face_indices()) + if (&cell->face(f)->get_manifold() != &cell->get_manifold()) + all_manifold_ids_are_equal = false; + + if (dim == 3) + for (unsigned int l = 0; l < GeometryInfo::lines_per_cell; ++l) + if (&cell->line(l)->get_manifold() != &cell->get_manifold()) + all_manifold_ids_are_equal = false; + } + + if (all_manifold_ids_are_equal) + { + const std::size_t n_rows = support_point_weights_cell.size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + cell->get_manifold().get_new_points(make_array_view(a.begin(), + a.end() - n_rows), + support_point_weights_cell, + a_view); + } + else + switch (dim) + { + case 1: + add_line_support_points(cell, a); + break; + case 2: + // in 2d, add the points on the four bounding lines to the + // exterior (outer) points + add_line_support_points(cell, a); + + // then get the interior support points + if (dim != spacedim) + add_quad_support_points(cell, a); + else + { + const std::size_t n_rows = + support_point_weights_perimeter_to_interior[1].size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + cell->get_manifold().get_new_points( + make_array_view(a.begin(), a.end() - n_rows), + support_point_weights_perimeter_to_interior[1], + a_view); + } + break; + + case 3: + // in 3d also add the points located on the boundary faces + add_line_support_points(cell, a); + add_quad_support_points(cell, a); + + // then compute the interior points + { + const std::size_t n_rows = + support_point_weights_perimeter_to_interior[2].size(0); + a.resize(a.size() + n_rows); + auto a_view = make_array_view(a.end() - n_rows, a.end()); + cell->get_manifold().get_new_points( + make_array_view(a.begin(), a.end() - n_rows), + support_point_weights_perimeter_to_interior[2], + a_view); + } + break; + + default: + Assert(false, ExcNotImplemented()); + break; + } + } + + return a; +} + + + +template +BoundingBox +MappingQ::get_bounding_box( + const typename Triangulation::cell_iterator &cell) const +{ + return BoundingBox(this->compute_mapping_support_points(cell)); +} + + + +template +bool +MappingQ::is_compatible_with( + const ReferenceCell &reference_cell) const +{ + Assert(dim == reference_cell.get_dimension(), + ExcMessage("The dimension of your mapping (" + + Utilities::to_string(dim) + + ") and the reference cell cell_type (" + + Utilities::to_string(reference_cell.get_dimension()) + + " ) do not agree.")); + + return reference_cell.is_hyper_cube(); +} + + + +//--------------------------- Explicit instantiations ----------------------- #include "mapping_q.inst" diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index 68ce6f44dc..1f8aec3bdf 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -23,7 +23,7 @@ DEAL_II_NAMESPACE_OPEN template MappingQ1::MappingQ1() - : MappingQGeneric(1) + : MappingQ(1) {} @@ -39,8 +39,8 @@ MappingQ1::clone() const template -MappingQGeneric - StaticMappingQ1::mapping = MappingQGeneric(1); +MappingQ + StaticMappingQ1::mapping = MappingQ(1); diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index 3d495c32b4..84c07d1c95 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -42,7 +42,7 @@ template MappingQ1Eulerian::MappingQ1Eulerian( const DoFHandler &shiftmap_dof_handler, const VectorType & euler_transform_vectors) - : MappingQGeneric(1) + : MappingQ(1) , euler_transform_vectors(&euler_transform_vectors) , shiftmap_dof_handler(&shiftmap_dof_handler) {} @@ -141,12 +141,11 @@ MappingQ1Eulerian::fill_fe_values( // call the function of the base class, but ignoring // any potentially detected cell similarity between // the current and the previous cell - MappingQGeneric::fill_fe_values( - cell, - CellSimilarity::invalid_next_cell, - quadrature, - internal_data, - output_data); + MappingQ::fill_fe_values(cell, + CellSimilarity::invalid_next_cell, + quadrature, + internal_data, + output_data); // also return the updated flag since any detected // similarity wasn't based on the mapped field, but // the original vertices which are meaningless diff --git a/source/fe/mapping_q_cache.cc b/source/fe/mapping_q_cache.cc index b28872e246..5c106dedcb 100644 --- a/source/fe/mapping_q_cache.cc +++ b/source/fe/mapping_q_cache.cc @@ -39,7 +39,7 @@ DEAL_II_NAMESPACE_OPEN template MappingQCache::MappingQCache( const unsigned int polynomial_degree) - : MappingQGeneric(polynomial_degree) + : MappingQ(polynomial_degree) , uses_level_info(false) {} @@ -48,7 +48,7 @@ MappingQCache::MappingQCache( template MappingQCache::MappingQCache( const MappingQCache &mapping) - : MappingQGeneric(mapping) + : MappingQ(mapping) , support_point_cache(mapping.support_point_cache) , uses_level_info(mapping.uses_level_info) {} @@ -100,12 +100,11 @@ MappingQCache::initialize( this->initialize( triangulation, [&](const typename Triangulation::cell_iterator &cell) { - const auto mapping_q_generic = - dynamic_cast *>(&mapping); - if (mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) + const auto mapping_q = + dynamic_cast *>(&mapping); + if (mapping_q != nullptr && this->get_degree() == mapping_q->get_degree()) { - return mapping_q_generic->compute_mapping_support_points(cell); + return mapping_q->compute_mapping_support_points(cell); } else { @@ -139,8 +138,8 @@ MappingQCache::initialize( template void MappingQCache::initialize( - const Triangulation & triangulation, - const MappingQGeneric &mapping) + const Triangulation &triangulation, + const MappingQ & mapping) { this->initialize(mapping, triangulation); } @@ -208,13 +207,12 @@ MappingQCache::initialize( [&](const typename Triangulation::cell_iterator &cell) { std::vector> points; - const auto mapping_q_generic = - dynamic_cast *>(&mapping); + const auto mapping_q = + dynamic_cast *>(&mapping); - if (mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) + if (mapping_q != nullptr && this->get_degree() == mapping_q->get_degree()) { - points = mapping_q_generic->compute_mapping_support_points(cell); + points = mapping_q->compute_mapping_support_points(cell); } else { @@ -360,15 +358,15 @@ MappingQCache::initialize( cell_tria->index(), &dof_handler); - const auto mapping_q_generic = - dynamic_cast *>(&mapping); + const auto mapping_q = + dynamic_cast *>(&mapping); // Step 2a) set up and reinit FEValues (if needed) if ( ((vector_describes_relative_displacement || (is_active_non_artificial_cell == false)) && - ((mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) == + ((mapping_q != nullptr && + this->get_degree() == mapping_q->get_degree()) == false)) /*condition 1: points need to be computed via FEValues*/ || (is_active_non_artificial_cell && interpolation_of_values_is_needed) /*condition 2: interpolation of values is needed*/) @@ -411,10 +409,9 @@ MappingQCache::initialize( if (vector_describes_relative_displacement || is_active_non_artificial_cell == false) { - if (mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) - result = - mapping_q_generic->compute_mapping_support_points(cell_tria); + if (mapping_q != nullptr && + this->get_degree() == mapping_q->get_degree()) + result = mapping_q->compute_mapping_support_points(cell_tria); else result = fe_values_all.get()->get_quadrature_points(); @@ -566,15 +563,15 @@ MappingQCache::initialize( cell_tria->index(), &dof_handler); - const auto mapping_q_generic = - dynamic_cast *>(&mapping); + const auto mapping_q = + dynamic_cast *>(&mapping); // Step 2a) set up and reinit FEValues (if needed) if ( ((vector_describes_relative_displacement || (is_non_artificial_cell == false)) && - ((mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) == + ((mapping_q != nullptr && + this->get_degree() == mapping_q->get_degree()) == false)) /*condition 1: points need to be computed via FEValues*/ || (is_non_artificial_cell == true && interpolation_of_values_is_needed) /*condition 2: interpolation of values is needed*/) @@ -617,10 +614,9 @@ MappingQCache::initialize( if (vector_describes_relative_displacement || (is_non_artificial_cell == false)) { - if (mapping_q_generic != nullptr && - this->get_degree() == mapping_q_generic->get_degree()) - result = - mapping_q_generic->compute_mapping_support_points(cell_tria); + if (mapping_q != nullptr && + this->get_degree() == mapping_q->get_degree()) + result = mapping_q->compute_mapping_support_points(cell_tria); else result = fe_values_all.get()->get_quadrature_points(); diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index 9102152678..d267d0b0ad 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -51,7 +51,7 @@ MappingQEulerian::MappingQEulerian( const DoFHandler &euler_dof_handler, const VectorType & euler_vector, const unsigned int level) - : MappingQGeneric(degree) + : MappingQ(degree) , euler_vector(&euler_vector) , euler_dof_handler(&euler_dof_handler) , level(level) @@ -205,12 +205,11 @@ MappingQEulerian::fill_fe_values( // call the function of the base class, but ignoring // any potentially detected cell similarity between // the current and the previous cell - MappingQGeneric::fill_fe_values( - cell, - CellSimilarity::invalid_next_cell, - quadrature, - internal_data, - output_data); + MappingQ::fill_fe_values(cell, + CellSimilarity::invalid_next_cell, + quadrature, + internal_data, + output_data); // also return the updated flag since any detected // similarity wasn't based on the mapped field, but // the original vertices which are meaningless diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc deleted file mode 100644 index 40f35af3f1..0000000000 --- a/source/fe/mapping_q_generic.cc +++ /dev/null @@ -1,1778 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2000 - 2021 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE.md at -// the top level directory of deal.II. -// -// --------------------------------------------------------------------- - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -DEAL_II_DISABLE_EXTRA_DIAGNOSTICS -#include -DEAL_II_ENABLE_EXTRA_DIAGNOSTICS - -#include -#include -#include -#include -#include - - -DEAL_II_NAMESPACE_OPEN - - -template -MappingQGeneric::InternalData::InternalData( - const unsigned int polynomial_degree) - : polynomial_degree(polynomial_degree) - , n_shape_functions(Utilities::fixed_power(polynomial_degree + 1)) - , line_support_points(QGaussLobatto<1>(polynomial_degree + 1)) - , tensor_product_quadrature(false) -{} - - - -template -std::size_t -MappingQGeneric::InternalData::memory_consumption() const -{ - return ( - Mapping::InternalDataBase::memory_consumption() + - MemoryConsumption::memory_consumption(shape_values) + - MemoryConsumption::memory_consumption(shape_derivatives) + - MemoryConsumption::memory_consumption(covariant) + - MemoryConsumption::memory_consumption(contravariant) + - MemoryConsumption::memory_consumption(unit_tangentials) + - MemoryConsumption::memory_consumption(aux) + - MemoryConsumption::memory_consumption(mapping_support_points) + - MemoryConsumption::memory_consumption(cell_of_current_support_points) + - MemoryConsumption::memory_consumption(volume_elements) + - MemoryConsumption::memory_consumption(polynomial_degree) + - MemoryConsumption::memory_consumption(n_shape_functions)); -} - - - -template -void -MappingQGeneric::InternalData::initialize( - const UpdateFlags update_flags, - const Quadrature &q, - const unsigned int n_original_q_points) -{ - // store the flags in the internal data object so we can access them - // in fill_fe_*_values() - this->update_each = update_flags; - - const unsigned int n_q_points = q.size(); - - const bool needs_higher_order_terms = - this->update_each & - (update_jacobian_pushed_forward_grads | update_jacobian_2nd_derivatives | - update_jacobian_pushed_forward_2nd_derivatives | - update_jacobian_3rd_derivatives | - update_jacobian_pushed_forward_3rd_derivatives); - - if (this->update_each & update_covariant_transformation) - covariant.resize(n_original_q_points); - - if (this->update_each & update_contravariant_transformation) - contravariant.resize(n_original_q_points); - - if (this->update_each & update_volume_elements) - volume_elements.resize(n_original_q_points); - - tensor_product_quadrature = q.is_tensor_product(); - - // use of MatrixFree only for higher order elements and with more than one - // point where tensor products do not make sense - if (polynomial_degree < 2 || n_q_points == 1) - tensor_product_quadrature = false; - - if (dim > 1) - { - // find out if the one-dimensional formula is the same - // in all directions - if (tensor_product_quadrature) - { - const std::array, dim> quad_array = - q.get_tensor_basis(); - for (unsigned int i = 1; i < dim && tensor_product_quadrature; ++i) - { - if (quad_array[i - 1].size() != quad_array[i].size()) - { - tensor_product_quadrature = false; - break; - } - else - { - const std::vector> &points_1 = - quad_array[i - 1].get_points(); - const std::vector> &points_2 = - quad_array[i].get_points(); - const std::vector &weights_1 = - quad_array[i - 1].get_weights(); - const std::vector &weights_2 = - quad_array[i].get_weights(); - for (unsigned int j = 0; j < quad_array[i].size(); ++j) - { - if (std::abs(points_1[j][0] - points_2[j][0]) > 1.e-10 || - std::abs(weights_1[j] - weights_2[j]) > 1.e-10) - { - tensor_product_quadrature = false; - break; - } - } - } - } - - if (tensor_product_quadrature) - { - // use a 1D FE_DGQ and adjust the hierarchic -> lexicographic - // numbering manually (building an FE_Q is relatively - // expensive due to constraints) - const FE_DGQ<1> fe(polynomial_degree); - shape_info.reinit(q.get_tensor_basis()[0], fe); - shape_info.lexicographic_numbering = - FETools::lexicographic_to_hierarchic_numbering( - polynomial_degree); - shape_info.n_q_points = q.size(); - shape_info.dofs_per_component_on_cell = - Utilities::pow(polynomial_degree + 1, dim); - } - } - } - - // Only fill the big arrays on demand in case we cannot use the tensor - // product quadrature code path - if (dim == 1 || !tensor_product_quadrature || needs_higher_order_terms) - { - // see if we need the (transformation) shape function values - // and/or gradients and resize the necessary arrays - if (this->update_each & update_quadrature_points) - shape_values.resize(n_shape_functions * n_q_points); - - if (this->update_each & - (update_covariant_transformation | - update_contravariant_transformation | update_JxW_values | - update_boundary_forms | update_normal_vectors | update_jacobians | - update_jacobian_grads | update_inverse_jacobians | - update_jacobian_pushed_forward_grads | - update_jacobian_2nd_derivatives | - update_jacobian_pushed_forward_2nd_derivatives | - update_jacobian_3rd_derivatives | - update_jacobian_pushed_forward_3rd_derivatives)) - shape_derivatives.resize(n_shape_functions * n_q_points); - - if (this->update_each & - (update_jacobian_grads | update_jacobian_pushed_forward_grads)) - shape_second_derivatives.resize(n_shape_functions * n_q_points); - - if (this->update_each & (update_jacobian_2nd_derivatives | - update_jacobian_pushed_forward_2nd_derivatives)) - shape_third_derivatives.resize(n_shape_functions * n_q_points); - - if (this->update_each & (update_jacobian_3rd_derivatives | - update_jacobian_pushed_forward_3rd_derivatives)) - shape_fourth_derivatives.resize(n_shape_functions * n_q_points); - - // now also fill the various fields with their correct values - compute_shape_function_values(q.get_points()); - } -} - - - -template -void -MappingQGeneric::InternalData::initialize_face( - const UpdateFlags update_flags, - const Quadrature &q, - const unsigned int n_original_q_points) -{ - initialize(update_flags, q, n_original_q_points); - - if (dim > 1 && tensor_product_quadrature) - { - constexpr unsigned int facedim = dim - 1; - const FE_DGQ<1> fe(polynomial_degree); - shape_info.reinit(q.get_tensor_basis()[0], fe); - shape_info.lexicographic_numbering = - FETools::lexicographic_to_hierarchic_numbering( - polynomial_degree); - shape_info.n_q_points = n_original_q_points; - shape_info.dofs_per_component_on_cell = - Utilities::pow(polynomial_degree + 1, dim); - } - - if (dim > 1) - { - if (this->update_each & - (update_boundary_forms | update_normal_vectors | update_jacobians | - update_JxW_values | update_inverse_jacobians)) - { - aux.resize(dim - 1, - AlignedVector>(n_original_q_points)); - - // Compute tangentials to the unit cell. - for (const unsigned int i : GeometryInfo::face_indices()) - { - unit_tangentials[i].resize(n_original_q_points); - std::fill(unit_tangentials[i].begin(), - unit_tangentials[i].end(), - GeometryInfo::unit_tangential_vectors[i][0]); - if (dim > 2) - { - unit_tangentials[GeometryInfo::faces_per_cell + i] - .resize(n_original_q_points); - std::fill( - unit_tangentials[GeometryInfo::faces_per_cell + i] - .begin(), - unit_tangentials[GeometryInfo::faces_per_cell + i] - .end(), - GeometryInfo::unit_tangential_vectors[i][1]); - } - } - } - } -} - - - -template -void -MappingQGeneric::InternalData::compute_shape_function_values( - const std::vector> &unit_points) -{ - const unsigned int n_points = unit_points.size(); - - // Construct the tensor product polynomials used as shape functions for - // the Qp mapping of cells at the boundary. - const TensorProductPolynomials tensor_pols( - Polynomials::generate_complete_Lagrange_basis( - line_support_points.get_points())); - Assert(n_shape_functions == tensor_pols.n(), ExcInternalError()); - - // then also construct the mapping from lexicographic to the Qp shape - // function numbering - const std::vector renumber = - FETools::hierarchic_to_lexicographic_numbering(polynomial_degree); - - std::vector values; - std::vector> grads; - if (shape_values.size() != 0) - { - Assert(shape_values.size() == n_shape_functions * n_points, - ExcInternalError()); - values.resize(n_shape_functions); - } - if (shape_derivatives.size() != 0) - { - Assert(shape_derivatives.size() == n_shape_functions * n_points, - ExcInternalError()); - grads.resize(n_shape_functions); - } - - std::vector> grad2; - if (shape_second_derivatives.size() != 0) - { - Assert(shape_second_derivatives.size() == n_shape_functions * n_points, - ExcInternalError()); - grad2.resize(n_shape_functions); - } - - std::vector> grad3; - if (shape_third_derivatives.size() != 0) - { - Assert(shape_third_derivatives.size() == n_shape_functions * n_points, - ExcInternalError()); - grad3.resize(n_shape_functions); - } - - std::vector> grad4; - if (shape_fourth_derivatives.size() != 0) - { - Assert(shape_fourth_derivatives.size() == n_shape_functions * n_points, - ExcInternalError()); - grad4.resize(n_shape_functions); - } - - - if (shape_values.size() != 0 || shape_derivatives.size() != 0 || - shape_second_derivatives.size() != 0 || - shape_third_derivatives.size() != 0 || - shape_fourth_derivatives.size() != 0) - for (unsigned int point = 0; point < n_points; ++point) - { - tensor_pols.evaluate( - unit_points[point], values, grads, grad2, grad3, grad4); - - if (shape_values.size() != 0) - for (unsigned int i = 0; i < n_shape_functions; ++i) - shape(point, i) = values[renumber[i]]; - - if (shape_derivatives.size() != 0) - for (unsigned int i = 0; i < n_shape_functions; ++i) - derivative(point, i) = grads[renumber[i]]; - - if (shape_second_derivatives.size() != 0) - for (unsigned int i = 0; i < n_shape_functions; ++i) - second_derivative(point, i) = grad2[renumber[i]]; - - if (shape_third_derivatives.size() != 0) - for (unsigned int i = 0; i < n_shape_functions; ++i) - third_derivative(point, i) = grad3[renumber[i]]; - - if (shape_fourth_derivatives.size() != 0) - for (unsigned int i = 0; i < n_shape_functions; ++i) - fourth_derivative(point, i) = grad4[renumber[i]]; - } -} - - - -template -MappingQGeneric::MappingQGeneric(const unsigned int p) - : polynomial_degree(p) - , line_support_points( - QGaussLobatto<1>(this->polynomial_degree + 1).get_points()) - , polynomials_1d( - Polynomials::generate_complete_Lagrange_basis(line_support_points)) - , renumber_lexicographic_to_hierarchic( - FETools::lexicographic_to_hierarchic_numbering(p)) - , unit_cell_support_points( - internal::MappingQGenericImplementation::unit_support_points( - line_support_points, - renumber_lexicographic_to_hierarchic)) - , support_point_weights_perimeter_to_interior( - internal::MappingQGenericImplementation:: - compute_support_point_weights_perimeter_to_interior( - this->polynomial_degree, - dim)) - , support_point_weights_cell( - internal::MappingQGenericImplementation:: - compute_support_point_weights_cell(this->polynomial_degree)) -{ - Assert(p >= 1, - ExcMessage("It only makes sense to create polynomial mappings " - "with a polynomial degree greater or equal to one.")); -} - - - -template -MappingQGeneric::MappingQGeneric( - const MappingQGeneric &mapping) - : polynomial_degree(mapping.polynomial_degree) - , line_support_points(mapping.line_support_points) - , polynomials_1d(mapping.polynomials_1d) - , renumber_lexicographic_to_hierarchic( - mapping.renumber_lexicographic_to_hierarchic) - , support_point_weights_perimeter_to_interior( - mapping.support_point_weights_perimeter_to_interior) - , support_point_weights_cell(mapping.support_point_weights_cell) -{} - - - -template -std::unique_ptr> -MappingQGeneric::clone() const -{ - return std::make_unique>(*this); -} - - - -template -unsigned int -MappingQGeneric::get_degree() const -{ - return polynomial_degree; -} - - - -template -Point -MappingQGeneric::transform_unit_to_real_cell( - const typename Triangulation::cell_iterator &cell, - const Point & p) const -{ - return Point(internal::evaluate_tensor_product_value_and_gradient( - polynomials_1d, - this->compute_mapping_support_points(cell), - p, - polynomials_1d.size() == 2, - renumber_lexicographic_to_hierarchic) - .first); -} - - -// In the code below, GCC tries to instantiate MappingQGeneric<3,4> when -// seeing which of the overloaded versions of -// do_transform_real_to_unit_cell_internal() to call. This leads to bad -// error messages and, generally, nothing very good. Avoid this by ensuring -// that this class exists, but does not have an inner InternalData -// type, thereby ruling out the codim-1 version of the function -// below when doing overload resolution. -template <> -class MappingQGeneric<3, 4> -{}; - - - -// visual studio freaks out when trying to determine if -// do_transform_real_to_unit_cell_internal with dim=3 and spacedim=4 is a good -// candidate. So instead of letting the compiler pick the correct overload, we -// use template specialization to make sure we pick up the right function to -// call: - -template -Point -MappingQGeneric::transform_real_to_unit_cell_internal( - const typename Triangulation::cell_iterator &, - const Point &, - const Point &) const -{ - // default implementation (should never be called) - Assert(false, ExcInternalError()); - return {}; -} - - - -template <> -Point<1> -MappingQGeneric<1, 1>::transform_real_to_unit_cell_internal( - const Triangulation<1, 1>::cell_iterator &cell, - const Point<1> & p, - const Point<1> & initial_p_unit) const -{ - // dispatch to the various specializations for spacedim=dim, - // spacedim=dim+1, etc - return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal<1>( - p, - initial_p_unit, - this->compute_mapping_support_points(cell), - polynomials_1d, - renumber_lexicographic_to_hierarchic); -} - - - -template <> -Point<2> -MappingQGeneric<2, 2>::transform_real_to_unit_cell_internal( - const Triangulation<2, 2>::cell_iterator &cell, - const Point<2> & p, - const Point<2> & initial_p_unit) const -{ - return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal<2>( - p, - initial_p_unit, - this->compute_mapping_support_points(cell), - polynomials_1d, - renumber_lexicographic_to_hierarchic); -} - - - -template <> -Point<3> -MappingQGeneric<3, 3>::transform_real_to_unit_cell_internal( - const Triangulation<3, 3>::cell_iterator &cell, - const Point<3> & p, - const Point<3> & initial_p_unit) const -{ - return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal<3>( - p, - initial_p_unit, - this->compute_mapping_support_points(cell), - polynomials_1d, - renumber_lexicographic_to_hierarchic); -} - - - -template <> -Point<1> -MappingQGeneric<1, 2>::transform_real_to_unit_cell_internal( - const Triangulation<1, 2>::cell_iterator &cell, - const Point<2> & p, - const Point<1> & initial_p_unit) const -{ - const int dim = 1; - const int spacedim = 2; - - const Quadrature point_quadrature(initial_p_unit); - - UpdateFlags update_flags = update_quadrature_points | update_jacobians; - if (spacedim > dim) - update_flags |= update_jacobian_grads; - auto mdata = Utilities::dynamic_unique_cast( - get_data(update_flags, point_quadrature)); - - mdata->mapping_support_points = this->compute_mapping_support_points(cell); - - // dispatch to the various specializations for spacedim=dim, - // spacedim=dim+1, etc - return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal_codim1<1>(cell, - p, - initial_p_unit, - *mdata); -} - - - -template <> -Point<2> -MappingQGeneric<2, 3>::transform_real_to_unit_cell_internal( - const Triangulation<2, 3>::cell_iterator &cell, - const Point<3> & p, - const Point<2> & initial_p_unit) const -{ - const int dim = 2; - const int spacedim = 3; - - const Quadrature point_quadrature(initial_p_unit); - - UpdateFlags update_flags = update_quadrature_points | update_jacobians; - if (spacedim > dim) - update_flags |= update_jacobian_grads; - auto mdata = Utilities::dynamic_unique_cast( - get_data(update_flags, point_quadrature)); - - mdata->mapping_support_points = this->compute_mapping_support_points(cell); - - // dispatch to the various specializations for spacedim=dim, - // spacedim=dim+1, etc - return internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal_codim1<2>(cell, - p, - initial_p_unit, - *mdata); -} - -template <> -Point<1> -MappingQGeneric<1, 3>::transform_real_to_unit_cell_internal( - const Triangulation<1, 3>::cell_iterator &, - const Point<3> &, - const Point<1> &) const -{ - Assert(false, ExcNotImplemented()); - return {}; -} - - - -template -Point -MappingQGeneric::transform_real_to_unit_cell( - const typename Triangulation::cell_iterator &cell, - const Point & p) const -{ - // Use an exact formula if one is available. this is only the case - // for Q1 mappings in 1d, and in 2d if dim==spacedim - if (this->preserves_vertex_locations() && (polynomial_degree == 1) && - ((dim == 1) || ((dim == 2) && (dim == spacedim)))) - { - // The dimension-dependent algorithms are much faster (about 25-45x in - // 2D) but fail most of the time when the given point (p) is not in the - // cell. The dimension-independent Newton algorithm given below is - // slower, but more robust (though it still sometimes fails). Therefore - // this function implements the following strategy based on the - // p's dimension: - // - // * In 1D this mapping is linear, so the mapping is always invertible - // (and the exact formula is known) as long as the cell has non-zero - // length. - // * In 2D the exact (quadratic) formula is called first. If either the - // exact formula does not succeed (negative discriminant in the - // quadratic formula) or succeeds but finds a solution outside of the - // unit cell, then the Newton solver is called. The rationale for the - // second choice is that the exact formula may provide two different - // answers when mapping a point outside of the real cell, but the - // Newton solver (if it converges) will only return one answer. - // Otherwise the exact formula successfully found a point in the unit - // cell and that value is returned. - // * In 3D there is no (known to the authors) exact formula, so the Newton - // algorithm is used. - const auto vertices_ = this->get_vertices(cell); - - std::array, GeometryInfo::vertices_per_cell> - vertices; - for (unsigned int i = 0; i < vertices.size(); ++i) - vertices[i] = vertices_[i]; - - try - { - switch (dim) - { - case 1: - { - // formula not subject to any issues in 1d - if (spacedim == 1) - return internal::MappingQ1::transform_real_to_unit_cell( - vertices, p); - else - break; - } - - case 2: - { - const Point point = - internal::MappingQ1::transform_real_to_unit_cell(vertices, - p); - - // formula not guaranteed to work for points outside of - // the cell. only take the computed point if it lies - // inside the reference cell - const double eps = 1e-15; - if (-eps <= point(1) && point(1) <= 1 + eps && - -eps <= point(0) && point(0) <= 1 + eps) - { - return point; - } - else - break; - } - - default: - { - // we should get here, based on the if-condition at the top - Assert(false, ExcInternalError()); - } - } - } - catch ( - const typename Mapping::ExcTransformationFailed &) - { - // simply fall through and continue on to the standard Newton code - } - } - else - { - // we can't use an explicit formula, - } - - - // Find the initial value for the Newton iteration by a normal - // projection to the least square plane determined by the vertices - // of the cell - Point initial_p_unit; - if (this->preserves_vertex_locations()) - { - initial_p_unit = cell->real_to_unit_cell_affine_approximation(p); - // in 1d with spacedim > 1 the affine approximation is exact - if (dim == 1 && polynomial_degree == 1) - return initial_p_unit; - } - else - { - // else, we simply use the mid point - for (unsigned int d = 0; d < dim; ++d) - initial_p_unit[d] = 0.5; - } - - // perform the Newton iteration and return the result. note that this - // statement may throw an exception, which we simply pass up to the caller - const Point p_unit = - this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit); - if (p_unit[0] == std::numeric_limits::infinity()) - AssertThrow(false, - (typename Mapping::ExcTransformationFailed())); - return p_unit; -} - - - -template -void -MappingQGeneric::transform_points_real_to_unit_cell( - const typename Triangulation::cell_iterator &cell, - const ArrayView> & real_points, - const ArrayView> & unit_points) const -{ - // Go to base class functions for dim < spacedim because it is not yet - // implemented with optimized code. - if (dim < spacedim) - { - Mapping::transform_points_real_to_unit_cell(cell, - real_points, - unit_points); - return; - } - - AssertDimension(real_points.size(), unit_points.size()); - const std::vector> support_points = - this->compute_mapping_support_points(cell); - - // From the given (high-order) support points, now only pick the first - // 2^dim points and construct an affine approximation from those. - internal::MappingQGenericImplementation:: - InverseQuadraticApproximation - inverse_approximation(support_points, unit_cell_support_points); - - const unsigned int n_points = real_points.size(); - const unsigned int n_lanes = VectorizedArray::size(); - - // Use the more heavy VectorizedArray code path if there is more than - // one point left to compute - for (unsigned int i = 0; i < n_points; i += n_lanes) - if (n_points - i > 1) - { - Point> p_vec; - for (unsigned int j = 0; j < n_lanes; ++j) - if (i + j < n_points) - for (unsigned int d = 0; d < spacedim; ++d) - p_vec[d][j] = real_points[i + j][d]; - else - for (unsigned int d = 0; d < spacedim; ++d) - p_vec[d][j] = real_points[i][d]; - - Point> unit_point = - internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal( - p_vec, - inverse_approximation.compute(p_vec), - support_points, - polynomials_1d, - renumber_lexicographic_to_hierarchic); - - // If the vectorized computation failed, it could be that only some of - // the lanes failed but others would have succeeded if we had let them - // compute alone without interference (like negative Jacobian - // determinants) from other SIMD lanes. Repeat the computation in this - // unlikely case with scalar arguments. - for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - if (unit_point[0][j] == std::numeric_limits::infinity()) - unit_points[i + j] = internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal( - real_points[i + j], - inverse_approximation.compute(real_points[i + j]), - support_points, - polynomials_1d, - renumber_lexicographic_to_hierarchic); - else - for (unsigned int d = 0; d < dim; ++d) - unit_points[i + j][d] = unit_point[d][j]; - } - else - unit_points[i] = internal::MappingQGenericImplementation:: - do_transform_real_to_unit_cell_internal( - real_points[i], - inverse_approximation.compute(real_points[i]), - support_points, - polynomials_1d, - renumber_lexicographic_to_hierarchic); -} - - - -template -UpdateFlags -MappingQGeneric::requires_update_flags( - const UpdateFlags in) const -{ - // add flags if the respective quantities are necessary to compute - // what we need. note that some flags appear in both the conditions - // and in subsequent set operations. this leads to some circular - // logic. the only way to treat this is to iterate. since there are - // 5 if-clauses in the loop, it will take at most 5 iterations to - // converge. do them: - UpdateFlags out = in; - for (unsigned int i = 0; i < 5; ++i) - { - // The following is a little incorrect: - // If not applied on a face, - // update_boundary_forms does not - // make sense. On the other hand, - // it is necessary on a - // face. Currently, - // update_boundary_forms is simply - // ignored for the interior of a - // cell. - if (out & (update_JxW_values | update_normal_vectors)) - out |= update_boundary_forms; - - if (out & (update_covariant_transformation | update_JxW_values | - update_jacobians | update_jacobian_grads | - update_boundary_forms | update_normal_vectors)) - out |= update_contravariant_transformation; - - if (out & - (update_inverse_jacobians | update_jacobian_pushed_forward_grads | - update_jacobian_pushed_forward_2nd_derivatives | - update_jacobian_pushed_forward_3rd_derivatives)) - out |= update_covariant_transformation; - - // The contravariant transformation is used in the Piola - // transformation, which requires the determinant of the Jacobi - // matrix of the transformation. Because we have no way of - // knowing here whether the finite element wants to use the - // contravariant or the Piola transforms, we add the JxW values - // to the list of flags to be updated for each cell. - if (out & update_contravariant_transformation) - out |= update_volume_elements; - - // the same is true when computing normal vectors: they require - // the determinant of the Jacobian - if (out & update_normal_vectors) - out |= update_volume_elements; - } - - return out; -} - - - -template -std::unique_ptr::InternalDataBase> -MappingQGeneric::get_data(const UpdateFlags update_flags, - const Quadrature &q) const -{ - std::unique_ptr::InternalDataBase> data_ptr = - std::make_unique(polynomial_degree); - auto &data = dynamic_cast(*data_ptr); - data.initialize(this->requires_update_flags(update_flags), q, q.size()); - - return data_ptr; -} - - - -template -std::unique_ptr::InternalDataBase> -MappingQGeneric::get_face_data( - const UpdateFlags update_flags, - const hp::QCollection &quadrature) const -{ - AssertDimension(quadrature.size(), 1); - - std::unique_ptr::InternalDataBase> data_ptr = - std::make_unique(polynomial_degree); - auto &data = dynamic_cast(*data_ptr); - data.initialize_face(this->requires_update_flags(update_flags), - QProjector::project_to_all_faces( - ReferenceCells::get_hypercube(), quadrature[0]), - quadrature[0].size()); - - return data_ptr; -} - - - -template -std::unique_ptr::InternalDataBase> -MappingQGeneric::get_subface_data( - const UpdateFlags update_flags, - const Quadrature &quadrature) const -{ - std::unique_ptr::InternalDataBase> data_ptr = - std::make_unique(polynomial_degree); - auto &data = dynamic_cast(*data_ptr); - data.initialize_face(this->requires_update_flags(update_flags), - QProjector::project_to_all_subfaces( - ReferenceCells::get_hypercube(), quadrature), - quadrature.size()); - - return data_ptr; -} - - - -template -CellSimilarity::Similarity -MappingQGeneric::fill_fe_values( - const typename Triangulation::cell_iterator &cell, - const CellSimilarity::Similarity cell_similarity, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase & internal_data, - internal::FEValuesImplementation::MappingRelatedData - &output_data) const -{ - // ensure that the following static_cast is really correct: - Assert(dynamic_cast(&internal_data) != nullptr, - ExcInternalError()); - const InternalData &data = static_cast(internal_data); - - const unsigned int n_q_points = quadrature.size(); - - // recompute the support points of the transformation of this - // cell. we tried to be clever here in an earlier version of the - // library by checking whether the cell is the same as the one we - // had visited last, but it turns out to be difficult to determine - // that because a cell for the purposes of a mapping is - // characterized not just by its (triangulation, level, index) - // triple, but also by the locations of its vertices, the manifold - // object attached to the cell and all of its bounding faces/edges, - // etc. to reliably test that the "cell" we are on is, therefore, - // not easily done - data.mapping_support_points = this->compute_mapping_support_points(cell); - data.cell_of_current_support_points = cell; - - // if the order of the mapping is greater than 1, then do not reuse any cell - // similarity information. This is necessary because the cell similarity - // value is computed with just cell vertices and does not take into account - // cell curvature. - const CellSimilarity::Similarity computed_cell_similarity = - (polynomial_degree == 1 ? cell_similarity : CellSimilarity::none); - - if (dim > 1 && data.tensor_product_quadrature) - { - internal::MappingQGenericImplementation:: - maybe_update_q_points_Jacobians_and_grads_tensor( - computed_cell_similarity, - data, - output_data.quadrature_points, - output_data.jacobian_grads); - } - else - { - internal::MappingQGenericImplementation::maybe_compute_q_points( - QProjector::DataSetDescriptor::cell(), - data, - output_data.quadrature_points); - - internal::MappingQGenericImplementation::maybe_update_Jacobians( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data); - - internal::MappingQGenericImplementation::maybe_update_jacobian_grads< - dim, - spacedim>(computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_grads); - } - - internal::MappingQGenericImplementation:: - maybe_update_jacobian_pushed_forward_grads( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_pushed_forward_grads); - - internal::MappingQGenericImplementation:: - maybe_update_jacobian_2nd_derivatives( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_2nd_derivatives); - - internal::MappingQGenericImplementation:: - maybe_update_jacobian_pushed_forward_2nd_derivatives( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_pushed_forward_2nd_derivatives); - - internal::MappingQGenericImplementation:: - maybe_update_jacobian_3rd_derivatives( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_3rd_derivatives); - - internal::MappingQGenericImplementation:: - maybe_update_jacobian_pushed_forward_3rd_derivatives( - computed_cell_similarity, - QProjector::DataSetDescriptor::cell(), - data, - output_data.jacobian_pushed_forward_3rd_derivatives); - - const UpdateFlags update_flags = data.update_each; - const std::vector &weights = quadrature.get_weights(); - - // Multiply quadrature weights by absolute value of Jacobian determinants or - // the area element g=sqrt(DX^t DX) in case of codim > 0 - - if (update_flags & (update_normal_vectors | update_JxW_values)) - { - AssertDimension(output_data.JxW_values.size(), n_q_points); - - Assert(!(update_flags & update_normal_vectors) || - (output_data.normal_vectors.size() == n_q_points), - ExcDimensionMismatch(output_data.normal_vectors.size(), - n_q_points)); - - - if (computed_cell_similarity != CellSimilarity::translation) - for (unsigned int point = 0; point < n_q_points; ++point) - { - if (dim == spacedim) - { - const double det = data.contravariant[point].determinant(); - - // check for distorted cells. - - // TODO: this allows for anisotropies of up to 1e6 in 3D and - // 1e12 in 2D. might want to find a finer - // (dimension-independent) criterion - Assert(det > - 1e-12 * Utilities::fixed_power( - cell->diameter() / std::sqrt(double(dim))), - (typename Mapping::ExcDistortedMappedCell( - cell->center(), det, point))); - - output_data.JxW_values[point] = weights[point] * det; - } - // if dim==spacedim, then there is no cell normal to - // compute. since this is for FEValues (and not FEFaceValues), - // there are also no face normals to compute - else // codim>0 case - { - Tensor<1, spacedim> DX_t[dim]; - for (unsigned int i = 0; i < spacedim; ++i) - for (unsigned int j = 0; j < dim; ++j) - DX_t[j][i] = data.contravariant[point][i][j]; - - Tensor<2, dim> G; // First fundamental form - for (unsigned int i = 0; i < dim; ++i) - for (unsigned int j = 0; j < dim; ++j) - G[i][j] = DX_t[i] * DX_t[j]; - - output_data.JxW_values[point] = - std::sqrt(determinant(G)) * weights[point]; - - if (computed_cell_similarity == - CellSimilarity::inverted_translation) - { - // we only need to flip the normal - if (update_flags & update_normal_vectors) - output_data.normal_vectors[point] *= -1.; - } - else - { - if (update_flags & update_normal_vectors) - { - Assert(spacedim == dim + 1, - ExcMessage( - "There is no (unique) cell normal for " + - Utilities::int_to_string(dim) + - "-dimensional cells in " + - Utilities::int_to_string(spacedim) + - "-dimensional space. This only works if the " - "space dimension is one greater than the " - "dimensionality of the mesh cells.")); - - if (dim == 1) - output_data.normal_vectors[point] = - cross_product_2d(-DX_t[0]); - else // dim == 2 - output_data.normal_vectors[point] = - cross_product_3d(DX_t[0], DX_t[1]); - - output_data.normal_vectors[point] /= - output_data.normal_vectors[point].norm(); - - if (cell->direction_flag() == false) - output_data.normal_vectors[point] *= -1.; - } - } - } // codim>0 case - } - } - - - - // copy values from InternalData to vector given by reference - if (update_flags & update_jacobians) - { - AssertDimension(output_data.jacobians.size(), n_q_points); - if (computed_cell_similarity != CellSimilarity::translation) - for (unsigned int point = 0; point < n_q_points; ++point) - output_data.jacobians[point] = data.contravariant[point]; - } - - // copy values from InternalData to vector given by reference - if (update_flags & update_inverse_jacobians) - { - AssertDimension(output_data.inverse_jacobians.size(), n_q_points); - if (computed_cell_similarity != CellSimilarity::translation) - for (unsigned int point = 0; point < n_q_points; ++point) - output_data.inverse_jacobians[point] = - data.covariant[point].transpose(); - } - - return computed_cell_similarity; -} - - - -template -void -MappingQGeneric::fill_fe_face_values( - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const hp::QCollection & quadrature, - const typename Mapping::InternalDataBase & internal_data, - internal::FEValuesImplementation::MappingRelatedData - &output_data) const -{ - AssertDimension(quadrature.size(), 1); - - // ensure that the following cast is really correct: - Assert((dynamic_cast(&internal_data) != nullptr), - ExcInternalError()); - const InternalData &data = static_cast(internal_data); - - // if necessary, recompute the support points of the transformation of this - // cell (note that we need to first check the triangulation pointer, since - // otherwise the second test might trigger an exception if the triangulations - // are not the same) - if ((data.mapping_support_points.size() == 0) || - (&cell->get_triangulation() != - &data.cell_of_current_support_points->get_triangulation()) || - (cell != data.cell_of_current_support_points)) - { - data.mapping_support_points = this->compute_mapping_support_points(cell); - data.cell_of_current_support_points = cell; - } - - internal::MappingQGenericImplementation::do_fill_fe_face_values( - *this, - cell, - face_no, - numbers::invalid_unsigned_int, - QProjector::DataSetDescriptor::face( - ReferenceCells::get_hypercube(), - face_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature[0].size()), - quadrature[0], - data, - output_data); -} - - - -template -void -MappingQGeneric::fill_fe_subface_values( - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int subface_no, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase & internal_data, - internal::FEValuesImplementation::MappingRelatedData - &output_data) const -{ - // ensure that the following cast is really correct: - Assert((dynamic_cast(&internal_data) != nullptr), - ExcInternalError()); - const InternalData &data = static_cast(internal_data); - - // if necessary, recompute the support points of the transformation of this - // cell (note that we need to first check the triangulation pointer, since - // otherwise the second test might trigger an exception if the triangulations - // are not the same) - if ((data.mapping_support_points.size() == 0) || - (&cell->get_triangulation() != - &data.cell_of_current_support_points->get_triangulation()) || - (cell != data.cell_of_current_support_points)) - { - data.mapping_support_points = this->compute_mapping_support_points(cell); - data.cell_of_current_support_points = cell; - } - - internal::MappingQGenericImplementation::do_fill_fe_face_values( - *this, - cell, - face_no, - subface_no, - QProjector::DataSetDescriptor::subface( - ReferenceCells::get_hypercube(), - face_no, - subface_no, - cell->face_orientation(face_no), - cell->face_flip(face_no), - cell->face_rotation(face_no), - quadrature.size(), - cell->subface_case(face_no)), - quadrature, - data, - output_data); -} - - - -template -inline void -MappingQGeneric::fill_mapping_data_for_generic_points( - const typename Triangulation::cell_iterator &cell, - const ArrayView> & unit_points, - const UpdateFlags update_flags, - dealii::internal::FEValuesImplementation::MappingRelatedData - &output_data) const -{ - if (update_flags == update_default) - return; - - Assert(update_flags & update_inverse_jacobians || - update_flags & update_jacobians || - update_flags & update_quadrature_points, - ExcNotImplemented()); - - output_data.initialize(unit_points.size(), update_flags); - const std::vector> support_points = - this->compute_mapping_support_points(cell); - - const unsigned int n_points = unit_points.size(); - const unsigned int n_lanes = VectorizedArray::size(); - - // Use the more heavy VectorizedArray code path if there is more than - // one point left to compute - for (unsigned int i = 0; i < n_points; i += n_lanes) - if (n_points - i > 1) - { - Point> p_vec; - for (unsigned int j = 0; j < n_lanes; ++j) - if (i + j < n_points) - for (unsigned int d = 0; d < dim; ++d) - p_vec[d][j] = unit_points[i + j][d]; - else - for (unsigned int d = 0; d < dim; ++d) - p_vec[d][j] = unit_points[i][d]; - - const auto result = - internal::evaluate_tensor_product_value_and_gradient( - polynomials_1d, - support_points, - p_vec, - polynomial_degree == 1, - renumber_lexicographic_to_hierarchic); - - if (update_flags & update_quadrature_points) - for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - for (unsigned int d = 0; d < spacedim; ++d) - output_data.quadrature_points[i + j][d] = result.first[d][j]; - - if (update_flags & update_jacobians) - for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - for (unsigned int d = 0; d < spacedim; ++d) - for (unsigned int e = 0; e < dim; ++e) - output_data.jacobians[i + j][d][e] = result.second[e][d][j]; - - if (update_flags & update_inverse_jacobians) - { - DerivativeForm<1, spacedim, dim, VectorizedArray> jac( - result.second); - const DerivativeForm<1, spacedim, dim, VectorizedArray> - inv_jac = jac.covariant_form(); - for (unsigned int j = 0; j < n_lanes && i + j < n_points; ++j) - for (unsigned int d = 0; d < dim; ++d) - for (unsigned int e = 0; e < spacedim; ++e) - output_data.inverse_jacobians[i + j][d][e] = inv_jac[d][e][j]; - } - } - else - { - const auto result = - internal::evaluate_tensor_product_value_and_gradient( - polynomials_1d, - support_points, - unit_points[i], - polynomial_degree == 1, - renumber_lexicographic_to_hierarchic); - - if (update_flags & update_quadrature_points) - output_data.quadrature_points[i] = result.first; - - if (update_flags & update_jacobians) - { - DerivativeForm<1, spacedim, dim> jac = result.second; - output_data.jacobians[i] = jac.transpose(); - } - - if (update_flags & update_inverse_jacobians) - { - DerivativeForm<1, spacedim, dim> jac(result.second); - DerivativeForm<1, spacedim, dim> inv_jac = jac.covariant_form(); - for (unsigned int d = 0; d < dim; ++d) - for (unsigned int e = 0; e < spacedim; ++e) - output_data.inverse_jacobians[i][d][e] = inv_jac[d][e]; - } - } -} - - - -template -void -MappingQGeneric::transform( - const ArrayView> & input, - const MappingKind mapping_kind, - const typename Mapping::InternalDataBase &mapping_data, - const ArrayView> & output) const -{ - internal::MappingQGenericImplementation::transform_fields(input, - mapping_kind, - mapping_data, - output); -} - - - -template -void -MappingQGeneric::transform( - const ArrayView> &input, - const MappingKind mapping_kind, - const typename Mapping::InternalDataBase &mapping_data, - const ArrayView> & output) const -{ - internal::MappingQGenericImplementation::transform_differential_forms( - input, mapping_kind, mapping_data, output); -} - - - -template -void -MappingQGeneric::transform( - const ArrayView> & input, - const MappingKind mapping_kind, - const typename Mapping::InternalDataBase &mapping_data, - const ArrayView> & output) const -{ - switch (mapping_kind) - { - case mapping_contravariant: - internal::MappingQGenericImplementation::transform_fields(input, - mapping_kind, - mapping_data, - output); - return; - - case mapping_piola_gradient: - case mapping_contravariant_gradient: - case mapping_covariant_gradient: - internal::MappingQGenericImplementation::transform_gradients( - input, mapping_kind, mapping_data, output); - return; - default: - Assert(false, ExcNotImplemented()); - } -} - - - -template -void -MappingQGeneric::transform( - const ArrayView> &input, - const MappingKind mapping_kind, - const typename Mapping::InternalDataBase &mapping_data, - const ArrayView> & output) const -{ - AssertDimension(input.size(), output.size()); - Assert(dynamic_cast(&mapping_data) != nullptr, - ExcInternalError()); - const InternalData &data = static_cast(mapping_data); - - switch (mapping_kind) - { - case mapping_covariant_gradient: - { - Assert(data.update_each & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField( - "update_covariant_transformation")); - - for (unsigned int q = 0; q < output.size(); ++q) - for (unsigned int i = 0; i < spacedim; ++i) - for (unsigned int j = 0; j < spacedim; ++j) - { - double tmp[dim]; - for (unsigned int K = 0; K < dim; ++K) - { - tmp[K] = data.covariant[q][j][0] * input[q][i][0][K]; - for (unsigned int J = 1; J < dim; ++J) - tmp[K] += data.covariant[q][j][J] * input[q][i][J][K]; - } - for (unsigned int k = 0; k < spacedim; ++k) - { - output[q][i][j][k] = data.covariant[q][k][0] * tmp[0]; - for (unsigned int K = 1; K < dim; ++K) - output[q][i][j][k] += data.covariant[q][k][K] * tmp[K]; - } - } - return; - } - - default: - Assert(false, ExcNotImplemented()); - } -} - - - -template -void -MappingQGeneric::transform( - const ArrayView> & input, - const MappingKind mapping_kind, - const typename Mapping::InternalDataBase &mapping_data, - const ArrayView> & output) const -{ - switch (mapping_kind) - { - case mapping_piola_hessian: - case mapping_contravariant_hessian: - case mapping_covariant_hessian: - internal::MappingQGenericImplementation::transform_hessians( - input, mapping_kind, mapping_data, output); - return; - default: - Assert(false, ExcNotImplemented()); - } -} - - - -template -void -MappingQGeneric::add_line_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector> & a) const -{ - // if we only need the midpoint, then ask for it. - if (this->polynomial_degree == 2) - { - for (unsigned int line_no = 0; - line_no < GeometryInfo::lines_per_cell; - ++line_no) - { - const typename Triangulation::line_iterator line = - (dim == 1 ? - static_cast< - typename Triangulation::line_iterator>(cell) : - cell->line(line_no)); - - const Manifold &manifold = - ((line->manifold_id() == numbers::flat_manifold_id) && - (dim < spacedim) ? - cell->get_manifold() : - line->get_manifold()); - a.push_back(manifold.get_new_point_on_line(line)); - } - } - else - // otherwise call the more complicated functions and ask for inner points - // from the manifold description - { - std::vector> tmp_points; - for (unsigned int line_no = 0; - line_no < GeometryInfo::lines_per_cell; - ++line_no) - { - const typename Triangulation::line_iterator line = - (dim == 1 ? - static_cast< - typename Triangulation::line_iterator>(cell) : - cell->line(line_no)); - - const Manifold &manifold = - ((line->manifold_id() == numbers::flat_manifold_id) && - (dim < spacedim) ? - cell->get_manifold() : - line->get_manifold()); - - const std::array, 2> vertices{ - {cell->vertex(GeometryInfo::line_to_cell_vertices(line_no, 0)), - cell->vertex( - GeometryInfo::line_to_cell_vertices(line_no, 1))}}; - - const std::size_t n_rows = - support_point_weights_perimeter_to_interior[0].size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - manifold.get_new_points( - make_array_view(vertices.begin(), vertices.end()), - support_point_weights_perimeter_to_interior[0], - a_view); - } - } -} - - - -template <> -void -MappingQGeneric<3, 3>::add_quad_support_points( - const Triangulation<3, 3>::cell_iterator &cell, - std::vector> & a) const -{ - const unsigned int faces_per_cell = GeometryInfo<3>::faces_per_cell; - - // used if face quad at boundary or entirely in the interior of the domain - std::vector> tmp_points; - - // loop over all faces and collect points on them - for (unsigned int face_no = 0; face_no < faces_per_cell; ++face_no) - { - const Triangulation<3>::face_iterator face = cell->face(face_no); - -#ifdef DEBUG - const bool face_orientation = cell->face_orientation(face_no), - face_flip = cell->face_flip(face_no), - face_rotation = cell->face_rotation(face_no); - const unsigned int vertices_per_face = GeometryInfo<3>::vertices_per_face, - lines_per_face = GeometryInfo<3>::lines_per_face; - - // some sanity checks up front - for (unsigned int i = 0; i < vertices_per_face; ++i) - Assert(face->vertex_index(i) == - cell->vertex_index(GeometryInfo<3>::face_to_cell_vertices( - face_no, i, face_orientation, face_flip, face_rotation)), - ExcInternalError()); - - // indices of the lines that bound a face are given by GeometryInfo<3>:: - // face_to_cell_lines - for (unsigned int i = 0; i < lines_per_face; ++i) - Assert(face->line(i) == - cell->line(GeometryInfo<3>::face_to_cell_lines( - face_no, i, face_orientation, face_flip, face_rotation)), - ExcInternalError()); -#endif - // extract the points surrounding a quad from the points - // already computed. First get the 4 vertices and then the points on - // the four lines - boost::container::small_vector, 200> tmp_points( - GeometryInfo<2>::vertices_per_cell + - GeometryInfo<2>::lines_per_cell * (polynomial_degree - 1)); - for (const unsigned int v : GeometryInfo<2>::vertex_indices()) - tmp_points[v] = a[GeometryInfo<3>::face_to_cell_vertices(face_no, v)]; - if (polynomial_degree > 1) - for (unsigned int line = 0; line < GeometryInfo<2>::lines_per_cell; - ++line) - for (unsigned int i = 0; i < polynomial_degree - 1; ++i) - tmp_points[4 + line * (polynomial_degree - 1) + i] = - a[GeometryInfo<3>::vertices_per_cell + - (polynomial_degree - 1) * - GeometryInfo<3>::face_to_cell_lines(face_no, line) + - i]; - - const std::size_t n_rows = - support_point_weights_perimeter_to_interior[1].size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - face->get_manifold().get_new_points( - make_array_view(tmp_points.begin(), tmp_points.end()), - support_point_weights_perimeter_to_interior[1], - a_view); - } -} - - - -template <> -void -MappingQGeneric<2, 3>::add_quad_support_points( - const Triangulation<2, 3>::cell_iterator &cell, - std::vector> & a) const -{ - std::array, GeometryInfo<2>::vertices_per_cell> vertices; - for (const unsigned int i : GeometryInfo<2>::vertex_indices()) - vertices[i] = cell->vertex(i); - - Table<2, double> weights(Utilities::fixed_power<2>(polynomial_degree - 1), - GeometryInfo<2>::vertices_per_cell); - for (unsigned int q = 0, q2 = 0; q2 < polynomial_degree - 1; ++q2) - for (unsigned int q1 = 0; q1 < polynomial_degree - 1; ++q1, ++q) - { - Point<2> point(line_support_points[q1 + 1][0], - line_support_points[q2 + 1][0]); - for (const unsigned int i : GeometryInfo<2>::vertex_indices()) - weights(q, i) = GeometryInfo<2>::d_linear_shape_function(point, i); - } - - const std::size_t n_rows = weights.size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - cell->get_manifold().get_new_points( - make_array_view(vertices.begin(), vertices.end()), weights, a_view); -} - - - -template -void -MappingQGeneric::add_quad_support_points( - const typename Triangulation::cell_iterator &, - std::vector> &) const -{ - Assert(false, ExcInternalError()); -} - - - -template -std::vector> -MappingQGeneric::compute_mapping_support_points( - const typename Triangulation::cell_iterator &cell) const -{ - // get the vertices first - std::vector> a; - a.reserve(Utilities::fixed_power(polynomial_degree + 1)); - for (const unsigned int i : GeometryInfo::vertex_indices()) - a.push_back(cell->vertex(i)); - - if (this->polynomial_degree > 1) - { - // check if all entities have the same manifold id which is when we can - // simply ask the manifold for all points. the transfinite manifold can - // do the interpolation better than this class, so if we detect that we - // do not have to change anything here - Assert(dim <= 3, ExcImpossibleInDim(dim)); - bool all_manifold_ids_are_equal = (dim == spacedim); - if (all_manifold_ids_are_equal && - dynamic_cast *>( - &cell->get_manifold()) == nullptr) - { - for (auto f : GeometryInfo::face_indices()) - if (&cell->face(f)->get_manifold() != &cell->get_manifold()) - all_manifold_ids_are_equal = false; - - if (dim == 3) - for (unsigned int l = 0; l < GeometryInfo::lines_per_cell; ++l) - if (&cell->line(l)->get_manifold() != &cell->get_manifold()) - all_manifold_ids_are_equal = false; - } - - if (all_manifold_ids_are_equal) - { - const std::size_t n_rows = support_point_weights_cell.size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - cell->get_manifold().get_new_points(make_array_view(a.begin(), - a.end() - n_rows), - support_point_weights_cell, - a_view); - } - else - switch (dim) - { - case 1: - add_line_support_points(cell, a); - break; - case 2: - // in 2d, add the points on the four bounding lines to the - // exterior (outer) points - add_line_support_points(cell, a); - - // then get the interior support points - if (dim != spacedim) - add_quad_support_points(cell, a); - else - { - const std::size_t n_rows = - support_point_weights_perimeter_to_interior[1].size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - cell->get_manifold().get_new_points( - make_array_view(a.begin(), a.end() - n_rows), - support_point_weights_perimeter_to_interior[1], - a_view); - } - break; - - case 3: - // in 3d also add the points located on the boundary faces - add_line_support_points(cell, a); - add_quad_support_points(cell, a); - - // then compute the interior points - { - const std::size_t n_rows = - support_point_weights_perimeter_to_interior[2].size(0); - a.resize(a.size() + n_rows); - auto a_view = make_array_view(a.end() - n_rows, a.end()); - cell->get_manifold().get_new_points( - make_array_view(a.begin(), a.end() - n_rows), - support_point_weights_perimeter_to_interior[2], - a_view); - } - break; - - default: - Assert(false, ExcNotImplemented()); - break; - } - } - - return a; -} - - - -template -BoundingBox -MappingQGeneric::get_bounding_box( - const typename Triangulation::cell_iterator &cell) const -{ - return BoundingBox(this->compute_mapping_support_points(cell)); -} - - - -template -bool -MappingQGeneric::is_compatible_with( - const ReferenceCell &reference_cell) const -{ - Assert(dim == reference_cell.get_dimension(), - ExcMessage("The dimension of your mapping (" + - Utilities::to_string(dim) + - ") and the reference cell cell_type (" + - Utilities::to_string(reference_cell.get_dimension()) + - " ) do not agree.")); - - return reference_cell.is_hyper_cube(); -} - - - -//--------------------------- Explicit instantiations ----------------------- -#include "mapping_q_generic.inst" - - -DEAL_II_NAMESPACE_CLOSE diff --git a/source/fe/mapping_q_generic.inst.in b/source/fe/mapping_q_generic.inst.in deleted file mode 100644 index 93b78cc325..0000000000 --- a/source/fe/mapping_q_generic.inst.in +++ /dev/null @@ -1,22 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2015 - 2018 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE.md at -// the top level directory of deal.II. -// -// --------------------------------------------------------------------- - - -for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) - { -#if deal_II_dimension <= deal_II_space_dimension - template class MappingQGeneric; -#endif - } diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 06e0a46026..5c9b766527 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -139,8 +138,7 @@ namespace GridTools { // get the degree of the mapping if possible. if not, just assume 1 unsigned int mapping_degree = 1; - if (const auto *p = - dynamic_cast *>(&mapping)) + if (const auto *p = dynamic_cast *>(&mapping)) mapping_degree = p->get_degree(); else if (const auto *p = dynamic_cast *>(&mapping)) diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index ab4afa55e2..2842954fd4 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -24,8 +24,8 @@ #include #include +#include #include -#include #include #include @@ -512,8 +512,7 @@ namespace GridTools } } catch ( - typename MappingQGeneric::ExcTransformationFailed &) + typename MappingQ::ExcTransformationFailed &) { // ok, the transformation // failed presumably @@ -1347,8 +1346,7 @@ namespace GridTools } } catch ( - typename MappingQGeneric::ExcTransformationFailed &) + typename MappingQ::ExcTransformationFailed &) { // ok, the transformation // failed presumably diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 5f0f75b931..119752f014 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include #include #include @@ -112,7 +112,7 @@ ReferenceCell::get_default_mapping(const unsigned int degree) const AssertDimension(dim, get_dimension()); if (is_hyper_cube()) - return std::make_unique>(degree); + return std::make_unique>(degree); else if (is_simplex()) return std::make_unique>( FE_SimplexP(degree)); @@ -127,7 +127,7 @@ ReferenceCell::get_default_mapping(const unsigned int degree) const Assert(false, ExcNotImplemented()); } - return std::make_unique>(degree); + return std::make_unique>(degree); } diff --git a/source/hp/mapping_collection.cc b/source/hp/mapping_collection.cc index dcc0e2ce11..e3d0975240 100644 --- a/source/hp/mapping_collection.cc +++ b/source/hp/mapping_collection.cc @@ -66,7 +66,7 @@ namespace hp * this function is called. */ template - MappingQGeneric & + MappingQ & get_static_mapping_q1() { static MappingQ1 mapping; diff --git a/tests/aniso/solution_transfer.cc b/tests/aniso/solution_transfer.cc index d58babb880..88f466b52c 100644 --- a/tests/aniso/solution_transfer.cc +++ b/tests/aniso/solution_transfer.cc @@ -68,11 +68,11 @@ transfer(std::ostream &out) Triangulation tria(Triangulation::allow_anisotropic_smoothing); GridGenerator::hyper_cube(tria); tria.refine_global(3); - FE_DGQ fe(1); - DoFHandler dof_handler(tria); - Vector solution; - MappingQGeneric mapping(1); - DataOut data_out; + FE_DGQ fe(1); + DoFHandler dof_handler(tria); + Vector solution; + MappingQ mapping(1); + DataOut data_out; dof_handler.distribute_dofs(fe); solution.reinit(dof_handler.n_dofs()); diff --git a/tests/bits/find_cell_10.cc b/tests/bits/find_cell_10.cc index 5bf724f8de..ba80611e90 100644 --- a/tests/bits/find_cell_10.cc +++ b/tests/bits/find_cell_10.cc @@ -98,8 +98,8 @@ test() ePos(0) = 0.0653630060373507487669897386695; ePos(1) = 1125.59175030825804242340382189; - MappingQ<2> mapping(1); - MappingQGeneric<2> &mapping2 = StaticMappingQ1<2>::mapping; + MappingQ<2> mapping(1); + MappingQ<2> &mapping2 = StaticMappingQ1<2>::mapping; deallog << "1:" << std::endl; GridTools::find_active_cell_around_point(mapping, triangulation, ePos); deallog << "2:" << std::endl; diff --git a/tests/bits/find_cell_10a.cc b/tests/bits/find_cell_10a.cc index 6ac52eb2ac..33c9968d14 100644 --- a/tests/bits/find_cell_10a.cc +++ b/tests/bits/find_cell_10a.cc @@ -85,8 +85,8 @@ test() ePos(0) = 0.0653630060373507487669897386695; ePos(1) = 1125.59175030825804242340382189; - MappingQ<2> mapping(1); - MappingQGeneric<2> &mapping2 = StaticMappingQ1<2>::mapping; + MappingQ<2> mapping(1); + MappingQ<2> &mapping2 = StaticMappingQ1<2>::mapping; Triangulation<2> triangulation; create_coarse_grid(triangulation); // first Tria with just one cell diff --git a/tests/bits/find_cell_12.cc b/tests/bits/find_cell_12.cc index a084fe28b4..a53d10564a 100644 --- a/tests/bits/find_cell_12.cc +++ b/tests/bits/find_cell_12.cc @@ -74,10 +74,9 @@ test() Point<2> test_point(250, 195); std::cout << "Checking Point " << test_point << std::endl; - auto current_cell = - GridTools::find_active_cell_around_point(MappingQGeneric<2>(1), - triangulation, - test_point); + auto current_cell = GridTools::find_active_cell_around_point(MappingQ<2>(1), + triangulation, + test_point); if (current_cell.first.state() == IteratorState::valid) { deallog << "cell: index = " << current_cell.first->index() diff --git a/tests/bits/find_cell_7.cc b/tests/bits/find_cell_7.cc index 0d9ef642ba..90bd1a557e 100644 --- a/tests/bits/find_cell_7.cc +++ b/tests/bits/find_cell_7.cc @@ -74,8 +74,8 @@ check2() deallog << inside(tria, p2) << std::endl; hp::MappingCollection<3> mappings; - mappings.push_back(MappingQGeneric<3>(1)); - mappings.push_back(MappingQGeneric<3>(1)); + mappings.push_back(MappingQ<3>(1)); + mappings.push_back(MappingQ<3>(1)); hp::FECollection<3> fes; fes.push_back(FE_Q<3>(1)); diff --git a/tests/bits/find_cell_alt_4.cc b/tests/bits/find_cell_alt_4.cc index 9ec9baef81..1f98182b0d 100644 --- a/tests/bits/find_cell_alt_4.cc +++ b/tests/bits/find_cell_alt_4.cc @@ -32,7 +32,7 @@ void check(Triangulation<3> &tria) { - MappingQGeneric<3> map(1); + MappingQ<3> map(1); Point<3> p(0.75, 0, 0); diff --git a/tests/bits/find_cell_alt_5.cc b/tests/bits/find_cell_alt_5.cc index 5e03d6f4df..204bfff1a3 100644 --- a/tests/bits/find_cell_alt_5.cc +++ b/tests/bits/find_cell_alt_5.cc @@ -32,8 +32,8 @@ void check(Triangulation<3> &tria) { - MappingQGeneric<3> map(1); - Point<3> p(0.75, 0.75, 0.75); + MappingQ<3> map(1); + Point<3> p(0.75, 0.75, 0.75); std::pair::active_cell_iterator, Point<3>> cell = GridTools::find_active_cell_around_point(map, tria, p); diff --git a/tests/bits/find_cell_alt_6.cc b/tests/bits/find_cell_alt_6.cc index 777ae40c0e..51a0c54c0c 100644 --- a/tests/bits/find_cell_alt_6.cc +++ b/tests/bits/find_cell_alt_6.cc @@ -44,7 +44,7 @@ void check(Triangulation<2> &tria) { const std::vector> &v = tria.get_vertices(); - MappingQGeneric<2> map(1); + MappingQ<2> map(1); for (unsigned i = 0; i < tria.n_vertices(); i++) { diff --git a/tests/bits/point_difference_02.cc b/tests/bits/point_difference_02.cc index cd2258c308..cb144d4888 100644 --- a/tests/bits/point_difference_02.cc +++ b/tests/bits/point_difference_02.cc @@ -116,8 +116,8 @@ template void check() { - MappingQGeneric mapping(1); - Triangulation tria; + MappingQ mapping(1); + Triangulation tria; make_mesh(tria); FE_Q element(QIterated<1>(QTrapezoid<1>(), 3)); diff --git a/tests/bits/point_gradient_02.cc b/tests/bits/point_gradient_02.cc index 2d137b990d..e14fa1e177 100644 --- a/tests/bits/point_gradient_02.cc +++ b/tests/bits/point_gradient_02.cc @@ -145,9 +145,9 @@ check() Triangulation tria; make_mesh(tria); - FE_Q element(QIterated<1>(QTrapezoid<1>(), 3)); - DoFHandler dof(tria); - MappingQGeneric mapping(1); + FE_Q element(QIterated<1>(QTrapezoid<1>(), 3)); + DoFHandler dof(tria); + MappingQ mapping(1); dof.distribute_dofs(element); // test with two different functions: one diff --git a/tests/bits/point_gradient_hp_02.cc b/tests/bits/point_gradient_hp_02.cc index b0ea620c73..30311d7c5b 100644 --- a/tests/bits/point_gradient_hp_02.cc +++ b/tests/bits/point_gradient_hp_02.cc @@ -153,12 +153,12 @@ check() fe.push_back(FE_Q(QIterated<1>(QTrapezoid<1>(), 5))); hp::MappingCollection mapping_1; - mapping_1.push_back(MappingQGeneric(1)); - mapping_1.push_back(MappingQGeneric(1)); - mapping_1.push_back(MappingQGeneric(1)); + mapping_1.push_back(MappingQ(1)); + mapping_1.push_back(MappingQ(1)); + mapping_1.push_back(MappingQ(1)); hp::MappingCollection mapping_2; - mapping_2.push_back(MappingQGeneric(1)); + mapping_2.push_back(MappingQ(1)); DoFHandler dof_handler(tria); diff --git a/tests/bits/point_value_02.cc b/tests/bits/point_value_02.cc index d1db8b0e8d..b929ff2299 100644 --- a/tests/bits/point_value_02.cc +++ b/tests/bits/point_value_02.cc @@ -115,9 +115,9 @@ check() Triangulation tria; make_mesh(tria); - FE_Q element(QIterated<1>(QTrapezoid<1>(), 3)); - DoFHandler dof(tria); - MappingQGeneric mapping(1); + FE_Q element(QIterated<1>(QTrapezoid<1>(), 3)); + DoFHandler dof(tria); + MappingQ mapping(1); dof.distribute_dofs(element); // test with two different functions: one diff --git a/tests/bits/point_value_hp_02.cc b/tests/bits/point_value_hp_02.cc index 82fd0326f9..5f7762c582 100644 --- a/tests/bits/point_value_hp_02.cc +++ b/tests/bits/point_value_hp_02.cc @@ -123,12 +123,12 @@ check() fe.push_back(FE_Q(5)); hp::MappingCollection mapping_1; - mapping_1.push_back(MappingQGeneric(1)); - mapping_1.push_back(MappingQGeneric(1)); - mapping_1.push_back(MappingQGeneric(1)); + mapping_1.push_back(MappingQ(1)); + mapping_1.push_back(MappingQ(1)); + mapping_1.push_back(MappingQ(1)); hp::MappingCollection mapping_2; - mapping_2.push_back(MappingQGeneric(1)); + mapping_2.push_back(MappingQ(1)); DoFHandler dof_handler(tria); diff --git a/tests/bits/solution_transfer.cc b/tests/bits/solution_transfer.cc index 678af6ef70..1e414f7e74 100644 --- a/tests/bits/solution_transfer.cc +++ b/tests/bits/solution_transfer.cc @@ -77,7 +77,7 @@ transfer(std::ostream &out) DoFHandler dgq_dof_handler(tria); Vector q_solution; Vector dgq_solution; - MappingQGeneric mapping(1); + MappingQ mapping(1); DataOut q_data_out, dgq_data_out; AffineConstraints cm; cm.close(); diff --git a/tests/bits/step-12.cc b/tests/bits/step-12.cc index 8f69239796..b1d6b55d6c 100644 --- a/tests/bits/step-12.cc +++ b/tests/bits/step-12.cc @@ -346,8 +346,8 @@ private: void output_results(const unsigned int cycle) const; - Triangulation triangulation; - const MappingQGeneric mapping; + Triangulation triangulation; + const MappingQ mapping; FE_DGQ fe; DoFHandler dof_handler; diff --git a/tests/bits/step-4_dg_periodic.cc b/tests/bits/step-4_dg_periodic.cc index 8120627447..0c6bfc1193 100644 --- a/tests/bits/step-4_dg_periodic.cc +++ b/tests/bits/step-4_dg_periodic.cc @@ -187,7 +187,7 @@ Step4::setup_system() solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags_all(update_flags); diff --git a/tests/bits/step-4_dg_periodic_coupling.cc b/tests/bits/step-4_dg_periodic_coupling.cc index 84ff8b042d..f42c82d40a 100644 --- a/tests/bits/step-4_dg_periodic_coupling.cc +++ b/tests/bits/step-4_dg_periodic_coupling.cc @@ -194,7 +194,7 @@ Step4::setup_system() solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags_all(update_flags); diff --git a/tests/codim_one/mapping_01.cc b/tests/codim_one/mapping_01.cc index a55fdbca04..bd9e71ba2c 100644 --- a/tests/codim_one/mapping_01.cc +++ b/tests/codim_one/mapping_01.cc @@ -16,7 +16,7 @@ // test mapping surfaces in higher dimensions. when we use the -// MappingQGeneric(1) class, each 1d cell in 2d space is mapped to a straight +// MappingQ(1) class, each 1d cell in 2d space is mapped to a straight // line and so all cell normals should be parallel. likewise, if the four // vertices of a 2d cell in 3d space are in a plane, then the cell normal // vectors at all quadrature points of the same cell should be parallel, even @@ -52,9 +52,9 @@ test() GridGenerator::extract_boundary_mesh(volume_mesh, boundary_mesh); - QGauss quadrature(2); - MappingQGeneric mapping(1); - FE_Q fe(1); + QGauss quadrature(2); + MappingQ mapping(1); + FE_Q fe(1); FEValues fe_values(mapping, fe, diff --git a/tests/codim_one/mapping_q1.cc b/tests/codim_one/mapping_q1.cc index 5d1ed0f48e..78a855b7fd 100644 --- a/tests/codim_one/mapping_q1.cc +++ b/tests/codim_one/mapping_q1.cc @@ -47,8 +47,8 @@ test(std::string filename) grid_out.set_flags(GridOutFlags::Ucd(true)); grid_out.write_ucd(tria, deallog.get_file_stream()); - QTrapezoid quad; - MappingQGeneric mapping(1); + QTrapezoid quad; + MappingQ mapping(1); typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); diff --git a/tests/cuda/coefficient_eval.cu b/tests/cuda/coefficient_eval.cu index 4b9776192d..54913adf2a 100644 --- a/tests/cuda/coefficient_eval.cu +++ b/tests/cuda/coefficient_eval.cu @@ -117,7 +117,7 @@ test() constraints.close(); // Computation on the device - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; typename CUDAWrappers::MatrixFree::AdditionalData additional_data; diff --git a/tests/cuda/matrix_free_initialize_vector.cu b/tests/cuda/matrix_free_initialize_vector.cu index 69d6a1000c..46e41fad76 100644 --- a/tests/cuda/matrix_free_initialize_vector.cu +++ b/tests/cuda/matrix_free_initialize_vector.cu @@ -85,7 +85,7 @@ test() AffineConstraints constraints(relevant_set); constraints.close(); - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_free_matrix_vector_10.cu b/tests/cuda/matrix_free_matrix_vector_10.cu index cd6cd531e7..dc47e1323e 100644 --- a/tests/cuda/matrix_free_matrix_vector_10.cu +++ b/tests/cuda/matrix_free_matrix_vector_10.cu @@ -105,7 +105,7 @@ test() deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_free_matrix_vector_10a.cu b/tests/cuda/matrix_free_matrix_vector_10a.cu index 55734b1d29..250ca0463a 100644 --- a/tests/cuda/matrix_free_matrix_vector_10a.cu +++ b/tests/cuda/matrix_free_matrix_vector_10a.cu @@ -107,7 +107,7 @@ test() deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_free_matrix_vector_19.cu b/tests/cuda/matrix_free_matrix_vector_19.cu index cf7f617e04..e39e1b4218 100644 --- a/tests/cuda/matrix_free_matrix_vector_19.cu +++ b/tests/cuda/matrix_free_matrix_vector_19.cu @@ -101,7 +101,7 @@ test() deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_free_matrix_vector_25.cu b/tests/cuda/matrix_free_matrix_vector_25.cu index 86bc853f09..38e27a7036 100644 --- a/tests/cuda/matrix_free_matrix_vector_25.cu +++ b/tests/cuda/matrix_free_matrix_vector_25.cu @@ -107,7 +107,7 @@ test() deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_free_multiple_objects.cu b/tests/cuda/matrix_free_multiple_objects.cu index 5ce71310c0..4742c108a6 100644 --- a/tests/cuda/matrix_free_multiple_objects.cu +++ b/tests/cuda/matrix_free_multiple_objects.cu @@ -54,7 +54,7 @@ do_test(const DoFHandler<2> & dof, LinearAlgebra::CUDAWrappers::Vector, n_q_points_1d> & mf, unsigned int n_dofs, - MappingQGeneric<2> & mapping, + MappingQ<2> & mapping, const AffineConstraints &constraints) { Vector in_host(n_dofs), out_host(n_dofs); @@ -162,7 +162,7 @@ main() FE_Q<2> fe_1(fe_degree_1); DoFHandler<2> dof_1(tria); dof_1.distribute_dofs(fe_1); - MappingQGeneric<2> mapping_1(fe_degree_1); + MappingQ<2> mapping_1(fe_degree_1); CUDAWrappers::MatrixFree<2, double> mf_data_1; CUDAWrappers::MatrixFree<2, double>::AdditionalData additional_data_1; additional_data_1.mapping_update_flags = update_values | update_gradients | @@ -186,7 +186,7 @@ main() FE_Q<2> fe_2(fe_degree_2); DoFHandler<2> dof_2(tria); dof_2.distribute_dofs(fe_2); - MappingQGeneric<2> mapping_2(fe_degree_2); + MappingQ<2> mapping_2(fe_degree_2); CUDAWrappers::MatrixFree<2, double> mf_data_2; CUDAWrappers::MatrixFree<2, double>::AdditionalData additional_data_2; additional_data_2.mapping_update_flags = update_values | update_gradients | diff --git a/tests/cuda/matrix_free_reinit_01.cu b/tests/cuda/matrix_free_reinit_01.cu index 10e2f204d2..0d072baba3 100644 --- a/tests/cuda/matrix_free_reinit_01.cu +++ b/tests/cuda/matrix_free_reinit_01.cu @@ -68,7 +68,7 @@ test() constraints); constraints.close(); - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/cuda/matrix_vector_common.h b/tests/cuda/matrix_vector_common.h index 1afedb5607..f18302111a 100644 --- a/tests/cuda/matrix_vector_common.h +++ b/tests/cuda/matrix_vector_common.h @@ -84,7 +84,7 @@ do_test(const DoFHandler & dof, { deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; typename CUDAWrappers::MatrixFree::AdditionalData additional_data; diff --git a/tests/cuda/precondition_03.cu b/tests/cuda/precondition_03.cu index 4dc32b4ccc..e4b0dfb66d 100644 --- a/tests/cuda/precondition_03.cu +++ b/tests/cuda/precondition_03.cu @@ -106,7 +106,7 @@ test() deallog << "Testing " << dof.get_fe().get_name() << std::endl; - MappingQGeneric mapping(fe_degree); + MappingQ mapping(fe_degree); CUDAWrappers::MatrixFree mf_data; const QGauss<1> quad(fe_degree + 1); typename CUDAWrappers::MatrixFree::AdditionalData diff --git a/tests/data_out/data_out_11.cc b/tests/data_out/data_out_11.cc index f4e7b4bbaf..ffa49a8965 100644 --- a/tests/data_out/data_out_11.cc +++ b/tests/data_out/data_out_11.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ test() component_interpretation( dim, DataComponentInterpretation::component_is_part_of_vector); - MappingQGeneric mapping(2); + MappingQ mapping(2); // variant 1 { diff --git a/tests/data_out/data_out_base_vtk_04.cc b/tests/data_out/data_out_base_vtk_04.cc index 8f781b8b79..bcabebfe56 100644 --- a/tests/data_out/data_out_base_vtk_04.cc +++ b/tests/data_out/data_out_base_vtk_04.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -44,8 +44,8 @@ check(std::ostream &log, unsigned cell_order) DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); - Vector vec(dof_handler.n_dofs()); - MappingQGeneric mapping(cell_order); + Vector vec(dof_handler.n_dofs()); + MappingQ mapping(cell_order); VectorTools::interpolate(mapping, dof_handler, diff --git a/tests/data_out/data_out_base_vtk_05.cc b/tests/data_out/data_out_base_vtk_05.cc index 57fa59fd27..1363d54aea 100644 --- a/tests/data_out/data_out_base_vtk_05.cc +++ b/tests/data_out/data_out_base_vtk_05.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -43,8 +43,8 @@ check(std::ostream &log, unsigned cell_order) DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); - Vector vec(dof_handler.n_dofs()); - MappingQGeneric mapping(cell_order); + Vector vec(dof_handler.n_dofs()); + MappingQ mapping(cell_order); VectorTools::interpolate(mapping, dof_handler, diff --git a/tests/data_out/data_out_base_vtu_04.cc b/tests/data_out/data_out_base_vtu_04.cc index 722d7f5a79..027b2e6eab 100644 --- a/tests/data_out/data_out_base_vtu_04.cc +++ b/tests/data_out/data_out_base_vtu_04.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -51,8 +51,8 @@ check(std::ostream &log, unsigned cell_order) DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); - Vector vec(dof_handler.n_dofs()); - MappingQGeneric mapping(cell_order); + Vector vec(dof_handler.n_dofs()); + MappingQ mapping(cell_order); VectorTools::interpolate(mapping, dof_handler, diff --git a/tests/data_out/data_out_base_vtu_05.cc b/tests/data_out/data_out_base_vtu_05.cc index f33f461d95..a36afe12b9 100644 --- a/tests/data_out/data_out_base_vtu_05.cc +++ b/tests/data_out/data_out_base_vtu_05.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -43,8 +43,8 @@ check(std::ostream &log, unsigned cell_order) DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); - Vector vec(dof_handler.n_dofs()); - MappingQGeneric mapping(cell_order); + Vector vec(dof_handler.n_dofs()); + MappingQ mapping(cell_order); VectorTools::interpolate(mapping, dof_handler, diff --git a/tests/data_out/data_out_curved_cells.cc b/tests/data_out/data_out_curved_cells.cc index 4e956bc35b..df443cc819 100644 --- a/tests/data_out/data_out_curved_cells.cc +++ b/tests/data_out/data_out_curved_cells.cc @@ -136,9 +136,9 @@ curved_grid(std::ostream &out) // now provide everything that is // needed for solving a Laplace // equation. - MappingQGeneric<2> mapping_q1(1); - FE_Q<2> fe(2); - DoFHandler<2> dof_handler(triangulation); + MappingQ<2> mapping_q1(1); + FE_Q<2> fe(2); + DoFHandler<2> dof_handler(triangulation); dof_handler.distribute_dofs(fe); SparsityPattern sparsity_pattern(dof_handler.n_dofs(), dof_handler.n_dofs(), diff --git a/tests/data_out/data_out_mapping_collection_01.cc b/tests/data_out/data_out_mapping_collection_01.cc index 28f73c2f55..23647bdae5 100644 --- a/tests/data_out/data_out_mapping_collection_01.cc +++ b/tests/data_out/data_out_mapping_collection_01.cc @@ -65,7 +65,7 @@ test() MappingFEField mapping_1(dhq, eulerq, mask); // create first mapping class, that does preserve position of vertices - MappingQGeneric mapping_2(1); + MappingQ mapping_2(1); // create mapping collection hp::FECollection fe_collection(FE_Q(1), FE_Q(1)); diff --git a/tests/distributed_grids/solution_transfer_02.cc b/tests/distributed_grids/solution_transfer_02.cc index a6d456a7b5..7b73670689 100644 --- a/tests/distributed_grids/solution_transfer_02.cc +++ b/tests/distributed_grids/solution_transfer_02.cc @@ -65,7 +65,7 @@ void test(std::ostream & /*out*/) { MyFunction func; - MappingQGeneric mapping(1); + MappingQ mapping(1); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_cube(tr); diff --git a/tests/distributed_grids/solution_transfer_03.cc b/tests/distributed_grids/solution_transfer_03.cc index d84c754355..907e591f6a 100644 --- a/tests/distributed_grids/solution_transfer_03.cc +++ b/tests/distributed_grids/solution_transfer_03.cc @@ -64,7 +64,7 @@ void test(std::ostream & /*out*/) { MyFunction func; - MappingQGeneric mapping(1); + MappingQ mapping(1); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_cube(tr); diff --git a/tests/dofs/dof_tools_04a.cc b/tests/dofs/dof_tools_04a.cc index 92b37659ad..dae3c6ecd0 100644 --- a/tests/dofs/dof_tools_04a.cc +++ b/tests/dofs/dof_tools_04a.cc @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/tests/dofs/interpolate_based_on_material_id_01.cc b/tests/dofs/interpolate_based_on_material_id_01.cc index a0afc98c82..ac154f3908 100644 --- a/tests/dofs/interpolate_based_on_material_id_01.cc +++ b/tests/dofs/interpolate_based_on_material_id_01.cc @@ -92,7 +92,7 @@ test() dof_handler.distribute_dofs(fe); Vector interpolant(dof_handler.n_dofs()); - VectorTools::interpolate_based_on_material_id(MappingQGeneric(1), + VectorTools::interpolate_based_on_material_id(MappingQ(1), dof_handler, functions, interpolant); diff --git a/tests/fe/abf_01.cc b/tests/fe/abf_01.cc index 2944c0d909..8234118ec9 100644 --- a/tests/fe/abf_01.cc +++ b/tests/fe/abf_01.cc @@ -633,7 +633,7 @@ main(int /*argc*/, char ** /*argv*/) hn_constraints.clear(); DoFTools::make_hanging_node_constraints(*dof_handler, hn_constraints); hn_constraints.close(); - MappingQGeneric<2> map_default(1); + MappingQ<2> map_default(1); project(map_default, *dof_handler, hn_constraints, diff --git a/tests/fe/abf_02.cc b/tests/fe/abf_02.cc index be07865ecf..a24a65cec4 100644 --- a/tests/fe/abf_02.cc +++ b/tests/fe/abf_02.cc @@ -542,7 +542,7 @@ main() hn_constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, hn_constraints); hn_constraints.close(); - MappingQGeneric<3> map_default(1); + MappingQ<3> map_default(1); project(map_default, dof_handler, hn_constraints, diff --git a/tests/fe/cell_similarity_01.cc b/tests/fe/cell_similarity_01.cc index 920a6ed421..8808da3dd3 100644 --- a/tests/fe/cell_similarity_01.cc +++ b/tests/fe/cell_similarity_01.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_Q fe(1); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/cell_similarity_02.cc b/tests/fe/cell_similarity_02.cc index dc093efa41..6ed4e75813 100644 --- a/tests/fe/cell_similarity_02.cc +++ b/tests/fe/cell_similarity_02.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_Q fe(2); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/cell_similarity_dgp_monomial_01.cc b/tests/fe/cell_similarity_dgp_monomial_01.cc index c9489b264f..c72b0eb165 100644 --- a/tests/fe/cell_similarity_dgp_monomial_01.cc +++ b/tests/fe/cell_similarity_dgp_monomial_01.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_DGPMonomial fe(1); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/cell_similarity_dgp_monomial_02.cc b/tests/fe/cell_similarity_dgp_monomial_02.cc index c7bc94b8f2..a53070c0a0 100644 --- a/tests/fe/cell_similarity_dgp_monomial_02.cc +++ b/tests/fe/cell_similarity_dgp_monomial_02.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_DGPMonomial fe(2); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/cell_similarity_dgp_nonparametric_01.cc b/tests/fe/cell_similarity_dgp_nonparametric_01.cc index 0f35a1551d..d5607df92d 100644 --- a/tests/fe/cell_similarity_dgp_nonparametric_01.cc +++ b/tests/fe/cell_similarity_dgp_nonparametric_01.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_DGPNonparametric fe(1); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/cell_similarity_dgp_nonparametric_02.cc b/tests/fe/cell_similarity_dgp_nonparametric_02.cc index 0d8da5bc12..3a567ed39a 100644 --- a/tests/fe/cell_similarity_dgp_nonparametric_02.cc +++ b/tests/fe/cell_similarity_dgp_nonparametric_02.cc @@ -71,7 +71,7 @@ test(const Triangulation &tr) FE_DGPNonparametric fe(2); deallog << "FE=" << fe.get_name() << std::endl; - MappingQGeneric mapping(1); + MappingQ mapping(1); deallog << "Mapping=Q1" << std::endl; diff --git a/tests/fe/deformed_projection.h b/tests/fe/deformed_projection.h index 7ebc726bb8..d537359312 100644 --- a/tests/fe/deformed_projection.h +++ b/tests/fe/deformed_projection.h @@ -744,7 +744,7 @@ check(const FiniteElement<2> & fe, DoFTools::make_hanging_node_constraints(*dof_handler, hn_constraints); hn_constraints.close(); - MappingQGeneric<2> map_default(1); + MappingQ<2> map_default(1); project(map_default, *dof_handler, diff --git a/tests/fe/derivatives.cc b/tests/fe/derivatives.cc index e3bd63f518..7ac19c8f7e 100644 --- a/tests/fe/derivatives.cc +++ b/tests/fe/derivatives.cc @@ -88,8 +88,8 @@ template void plot_FE_Q_shape_functions() { - MappingQGeneric m(1); - FE_Q q1(1); + MappingQ m(1); + FE_Q q1(1); plot_derivatives(m, q1, "Q1"); // plot_face_shape_functions(m, q1, "Q1"); FE_Q q2(2); @@ -120,8 +120,8 @@ template void plot_FE_DGQ_shape_functions() { - MappingQGeneric m(1); - FE_DGQ q1(1); + MappingQ m(1); + FE_DGQ q1(1); plot_derivatives(m, q1, "DGQ1"); // plot_face_shape_functions(m, q1, "DGQ1"); FE_DGQ q2(2); @@ -169,8 +169,8 @@ main() // FESystem test. - MappingQGeneric<2> m(1); - FESystem<2> q2_q3(FE_Q<2>(2), + MappingQ<2> m(1); + FESystem<2> q2_q3(FE_Q<2>(2), 1, FE_Q<2>(QIterated<1>(QTrapezoid<1>(), 3)), 1); diff --git a/tests/fe/derivatives_bernstein.cc b/tests/fe/derivatives_bernstein.cc index a6ff93d5fd..528c661527 100644 --- a/tests/fe/derivatives_bernstein.cc +++ b/tests/fe/derivatives_bernstein.cc @@ -87,8 +87,8 @@ template void plot_FE_Bernstein_shape_functions() { - MappingQGeneric m(1); - FE_Bernstein b1(1); + MappingQ m(1); + FE_Bernstein b1(1); plot_derivatives(m, b1, "B1"); FE_Bernstein b2(2); @@ -124,8 +124,8 @@ main() // FESystem test. - MappingQGeneric<2> m(1); - FESystem<2> q2_q3(FE_Bernstein<2>(2), 1, FE_Bernstein<2>(3), 1); + MappingQ<2> m(1); + FESystem<2> q2_q3(FE_Bernstein<2>(2), 1, FE_Bernstein<2>(3), 1); // plot_derivatives(m, q2_q3, "B2_Q3"); return 0; diff --git a/tests/fe/derivatives_face.cc b/tests/fe/derivatives_face.cc index a363f83ce1..b13980b0cb 100644 --- a/tests/fe/derivatives_face.cc +++ b/tests/fe/derivatives_face.cc @@ -80,7 +80,7 @@ template void plot_FE_Q_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); // FE_Q q1(1); // plot_derivatives(m, q1, "Q1"); // plot_face_shape_functions(m, q1, "Q1"); @@ -97,8 +97,8 @@ template void plot_FE_DGQ_shape_functions() { - MappingQGeneric m(1); - FE_DGQ q1(1); + MappingQ m(1); + FE_DGQ q1(1); plot_derivatives(m, q1, "DGQ1"); FE_DGQ q2(2); plot_derivatives(m, q2, "DGQ2"); diff --git a/tests/fe/fe_face_values_1d.cc b/tests/fe/fe_face_values_1d.cc index 642eb78ce0..772119c8be 100644 --- a/tests/fe/fe_face_values_1d.cc +++ b/tests/fe/fe_face_values_1d.cc @@ -144,8 +144,8 @@ mapping_test() std::vector *> mapping_ptr; std::vector mapping_strings; - MappingQGeneric mapping(1); - std::string mapping_name = "MappingQ1"; + MappingQ mapping(1); + std::string mapping_name = "MappingQ1"; Triangulation tria; GridGenerator::hyper_cube(tria); diff --git a/tests/fe/fe_project_2d.cc b/tests/fe/fe_project_2d.cc index c51fe56e1f..85e2ba211f 100644 --- a/tests/fe/fe_project_2d.cc +++ b/tests/fe/fe_project_2d.cc @@ -182,7 +182,7 @@ test(const FiniteElement &fe, const QGauss quadrature(fe.degree + 1); const unsigned int n_q_points = quadrature.size(); MappingQ mapping(1); - // MappingQGeneric mapping(1); + // MappingQ mapping(1); std::vector div_v(n_q_points); std::vector::curl_type> curl_v( n_q_points); diff --git a/tests/fe/fe_project_3d.cc b/tests/fe/fe_project_3d.cc index ebaa740c38..84ff5f72ca 100644 --- a/tests/fe/fe_project_3d.cc +++ b/tests/fe/fe_project_3d.cc @@ -247,7 +247,7 @@ test(const FiniteElement &fe, const unsigned int n_q_points = quadrature.size(); const unsigned int n_face_q_points = face_quadrature.size(); // MappingQ mapping(2); - MappingQGeneric mapping(1); + MappingQ mapping(1); std::vector div_v(n_q_points); std::vector::curl_type> curl_v( n_q_points); diff --git a/tests/fe/fe_tools_test.cc b/tests/fe/fe_tools_test.cc index 284fddf092..97ee685583 100644 --- a/tests/fe/fe_tools_test.cc +++ b/tests/fe/fe_tools_test.cc @@ -202,8 +202,8 @@ main() { initlog(); - Triangulation<2> tria; - MappingQGeneric<2> mapping(1); + Triangulation<2> tria; + MappingQ<2> mapping(1); make_grid(tria); diff --git a/tests/fe/fe_values_function_manifold.cc b/tests/fe/fe_values_function_manifold.cc index eb2e0c411f..06cfcc9b7c 100644 --- a/tests/fe/fe_values_function_manifold.cc +++ b/tests/fe/fe_values_function_manifold.cc @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -238,7 +238,7 @@ protected: FE_Q finite_element; DoFHandler dof_handler; QGauss cell_quadrature; - MappingQGeneric cell_mapping; + MappingQ cell_mapping; AffineConstraints all_constraints; SparsityPattern sparsity_pattern; diff --git a/tests/fe/fe_values_view_30.cc b/tests/fe/fe_values_view_30.cc index cbfd78d0ec..b9c092047d 100644 --- a/tests/fe/fe_values_view_30.cc +++ b/tests/fe/fe_values_view_30.cc @@ -118,7 +118,7 @@ test(const Triangulation &tr, const FiniteElement &fe) VectorFunction fe_function; - MappingQGeneric mapping(1); + MappingQ mapping(1); const QGauss quadrature(fe.degree + 2); FEValues fe_values(mapping, diff --git a/tests/fe/shapes_bernstein.cc b/tests/fe/shapes_bernstein.cc index b452d071f1..18177247b0 100644 --- a/tests/fe/shapes_bernstein.cc +++ b/tests/fe/shapes_bernstein.cc @@ -31,7 +31,7 @@ template void plot_FE_Bernstein_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Bernstein b1(1); plot_shape_functions(m, b1, "B1"); diff --git a/tests/fe/shapes_dgp.cc b/tests/fe/shapes_dgp.cc index 39533b921b..077d861084 100644 --- a/tests/fe/shapes_dgp.cc +++ b/tests/fe/shapes_dgp.cc @@ -30,7 +30,7 @@ template void plot_FE_DGP_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_DGP p1(1); plot_shape_functions(m, p1, "DGP1"); diff --git a/tests/fe/shapes_dgp_monomial.cc b/tests/fe/shapes_dgp_monomial.cc index 6b9ec93cf2..bb92bd3f48 100644 --- a/tests/fe/shapes_dgp_monomial.cc +++ b/tests/fe/shapes_dgp_monomial.cc @@ -30,7 +30,7 @@ template void plot_FE_DGPMonomial_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_DGPMonomial p1(1); plot_shape_functions(m, p1, "DGPMonomial1"); diff --git a/tests/fe/shapes_dgp_nonparametric.cc b/tests/fe/shapes_dgp_nonparametric.cc index 4d745aa1b3..611d4aaf2e 100644 --- a/tests/fe/shapes_dgp_nonparametric.cc +++ b/tests/fe/shapes_dgp_nonparametric.cc @@ -30,7 +30,7 @@ template void plot_FE_DGPNonparametric_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_DGPNonparametric p0(0); plot_shape_functions(m, p0, "DGPNonparametric0"); diff --git a/tests/fe/shapes_dgq.cc b/tests/fe/shapes_dgq.cc index 07060307f4..d6ac2665ee 100644 --- a/tests/fe/shapes_dgq.cc +++ b/tests/fe/shapes_dgq.cc @@ -30,7 +30,7 @@ template void plot_FE_DGQ_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_DGQ q1(1); plot_shape_functions(m, q1, "DGQ1"); diff --git a/tests/fe/shapes_faceq.cc b/tests/fe/shapes_faceq.cc index 1964ca6461..4d79377070 100644 --- a/tests/fe/shapes_faceq.cc +++ b/tests/fe/shapes_faceq.cc @@ -32,7 +32,7 @@ template void plot_FE_FaceQ_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_FaceQ q0(0); FE_FaceQ q1(1); diff --git a/tests/fe/shapes_nedelec.cc b/tests/fe/shapes_nedelec.cc index a40e5469a5..8a02ba52cf 100644 --- a/tests/fe/shapes_nedelec.cc +++ b/tests/fe/shapes_nedelec.cc @@ -30,8 +30,8 @@ template void plot_FE_Nedelec_shape_functions() { - MappingQGeneric m(1); - FE_Nedelec p0(0); + MappingQ m(1); + FE_Nedelec p0(0); // plot_shape_functions(m, p1, "Nedelec1"); // plot_face_shape_functions(m, p1, "Nedelec1"); test_compute_functions(m, p0, "Nedelec0"); diff --git a/tests/fe/shapes_q.cc b/tests/fe/shapes_q.cc index 77ddba8a8e..d6789456a3 100644 --- a/tests/fe/shapes_q.cc +++ b/tests/fe/shapes_q.cc @@ -30,7 +30,7 @@ template void plot_FE_Q_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Q q1(1); plot_shape_functions(m, q1, "Q1"); diff --git a/tests/fe/shapes_q_bubbles.cc b/tests/fe/shapes_q_bubbles.cc index e54687514c..5d5cba9079 100644 --- a/tests/fe/shapes_q_bubbles.cc +++ b/tests/fe/shapes_q_bubbles.cc @@ -30,7 +30,7 @@ template void plot_FE_Q_Bubbles_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Q_Bubbles q1(1); plot_shape_functions(m, q1, "Q1_Bubbles"); diff --git a/tests/fe/shapes_q_dg0.cc b/tests/fe/shapes_q_dg0.cc index d35851331d..af138e701e 100644 --- a/tests/fe/shapes_q_dg0.cc +++ b/tests/fe/shapes_q_dg0.cc @@ -30,7 +30,7 @@ template void plot_FE_Q_DG0_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Q_DG0 q1(1); plot_shape_functions(m, q1, "Q1_DG0"); diff --git a/tests/fe/shapes_q_hierarchical.cc b/tests/fe/shapes_q_hierarchical.cc index c37beb5c3e..7d1edf7d6c 100644 --- a/tests/fe/shapes_q_hierarchical.cc +++ b/tests/fe/shapes_q_hierarchical.cc @@ -30,7 +30,7 @@ template void plot_FE_Q_Hierarchical_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Q_Hierarchical q1(1); plot_shape_functions(m, q1, "QHierarchical1"); diff --git a/tests/fe/shapes_q_iso_q1.cc b/tests/fe/shapes_q_iso_q1.cc index deb0aa5e7a..b927461fe6 100644 --- a/tests/fe/shapes_q_iso_q1.cc +++ b/tests/fe/shapes_q_iso_q1.cc @@ -30,7 +30,7 @@ template void plot_FE_Q_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_Q_iso_Q1 q1(1); plot_shape_functions(m, q1, "Q1"); diff --git a/tests/fe/shapes_system.cc b/tests/fe/shapes_system.cc index 37d3802354..fabb4a4b8a 100644 --- a/tests/fe/shapes_system.cc +++ b/tests/fe/shapes_system.cc @@ -33,7 +33,7 @@ template void plot_FE_System_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); // FESystem p1(FE_Q(2), 1, // FE_Q(dim<3 ? 3 : 2), 2); diff --git a/tests/fe/shapes_system_02.cc b/tests/fe/shapes_system_02.cc index 8697526879..718c51e678 100644 --- a/tests/fe/shapes_system_02.cc +++ b/tests/fe/shapes_system_02.cc @@ -35,7 +35,7 @@ template void plot_FE_System_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FESystem p3(FE_Q(1), 1, FESystem(FE_Q(1), 2), 2); test_compute_functions(m, p3, "System_1"); diff --git a/tests/fe/shapes_traceq.cc b/tests/fe/shapes_traceq.cc index 62c8f791c7..4bcdcc39ff 100644 --- a/tests/fe/shapes_traceq.cc +++ b/tests/fe/shapes_traceq.cc @@ -31,7 +31,7 @@ template void plot_FE_TraceQ_shape_functions() { - MappingQGeneric m(1); + MappingQ m(1); FE_TraceQ tq1(1); FE_TraceQ tq2(2); diff --git a/tests/fullydistributed_grids/copy_serial_tria_06.cc b/tests/fullydistributed_grids/copy_serial_tria_06.cc index bde0d89cc5..b38a7028d8 100644 --- a/tests/fullydistributed_grids/copy_serial_tria_06.cc +++ b/tests/fullydistributed_grids/copy_serial_tria_06.cc @@ -95,7 +95,7 @@ test(int n_refinements, MPI_Comm comm) additional_data.mapping_update_flags_faces_by_cells = update_gradients | update_JxW_values | update_quadrature_points; - MappingQGeneric mapping(1); + MappingQ mapping(1); QGauss<1> quad(degree + 1); AffineConstraints constraint; diff --git a/tests/grid/find_all_active_cells_around_point_01.cc b/tests/grid/find_all_active_cells_around_point_01.cc index 1fa088bfa0..3457f91a0a 100644 --- a/tests/grid/find_all_active_cells_around_point_01.cc +++ b/tests/grid/find_all_active_cells_around_point_01.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ test(unsigned int n_ref) Triangulation tria; GridGenerator::hyper_cube(tria); tria.refine_global(n_ref); - MappingQGeneric mapping(3); + MappingQ mapping(3); Point p; { diff --git a/tests/grid/find_all_active_cells_around_point_01_b.cc b/tests/grid/find_all_active_cells_around_point_01_b.cc index 984f0b9246..85c982a1d6 100644 --- a/tests/grid/find_all_active_cells_around_point_01_b.cc +++ b/tests/grid/find_all_active_cells_around_point_01_b.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -55,7 +55,7 @@ test(unsigned int n_ref) Triangulation tria; GridGenerator::hyper_cube(tria); tria.refine_global(n_ref); - MappingQGeneric mapping(3); + MappingQ mapping(3); Point p; { diff --git a/tests/grid/find_all_active_cells_around_point_02.cc b/tests/grid/find_all_active_cells_around_point_02.cc index d2318f5e80..b4d2fd4484 100644 --- a/tests/grid/find_all_active_cells_around_point_02.cc +++ b/tests/grid/find_all_active_cells_around_point_02.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ test(unsigned int n_ref) Triangulation tria; GridGenerator::hyper_shell(tria, Point(), 0.8, 1., dim == 2 ? 3 : 6); tria.refine_global(n_ref); - MappingQGeneric mapping(8); + MappingQ mapping(8); { const double phi = 0.; diff --git a/tests/grid/find_all_active_cells_around_point_03.cc b/tests/grid/find_all_active_cells_around_point_03.cc index 48a41b563c..b5cc27db68 100644 --- a/tests/grid/find_all_active_cells_around_point_03.cc +++ b/tests/grid/find_all_active_cells_around_point_03.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -71,7 +71,7 @@ test(unsigned int n_ref) Triangulation tria; GridGenerator::channel_with_cylinder(tria, 0.03, 2, 2); tria.refine_global(n_ref); - MappingQGeneric mapping(3); + MappingQ mapping(3); Point p1; p1[0] = 0.28; diff --git a/tests/grid/grid_generator_marching_cube_algorithm_01.cc b/tests/grid/grid_generator_marching_cube_algorithm_01.cc index 02de9d4a9e..d14d608992 100644 --- a/tests/grid/grid_generator_marching_cube_algorithm_01.cc +++ b/tests/grid/grid_generator_marching_cube_algorithm_01.cc @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/grid/grid_generator_open_torus.cc b/tests/grid/grid_generator_open_torus.cc index a50e53e919..92e5a273dc 100644 --- a/tests/grid/grid_generator_open_torus.cc +++ b/tests/grid/grid_generator_open_torus.cc @@ -26,7 +26,7 @@ #include -#include +#include #include #include @@ -48,8 +48,8 @@ test() GridGenerator::torus( tria_open, R, r, n_cells_toroidal / factor, angle / (double)factor); - MappingQGeneric<3> const mapping(3); - QGauss<3> const gauss(4); + MappingQ<3> const mapping(3); + QGauss<3> const gauss(4); double const ar_full_torus = GridTools::compute_maximum_aspect_ratio(mapping, tria, gauss); diff --git a/tests/grid/grid_out_gnuplot_01.cc b/tests/grid/grid_out_gnuplot_01.cc index 7794602a3b..215f234b82 100644 --- a/tests/grid/grid_out_gnuplot_01.cc +++ b/tests/grid/grid_out_gnuplot_01.cc @@ -20,7 +20,7 @@ // and also that we can do output in dim = 2, spacedim = 3. -#include +#include #include #include @@ -57,7 +57,7 @@ gnuplot_output(const GridOutFlags::Gnuplot &flags) Triangulation triangulation; make_grid(triangulation); - MappingQGeneric mapping(3); + MappingQ mapping(3); auto cell = triangulation.begin_active(); cell->set_refine_flag(); // 0 diff --git a/tests/grid/grid_tools_aspect_ratio.cc b/tests/grid/grid_tools_aspect_ratio.cc index 39e310cb6e..39fa9721ce 100644 --- a/tests/grid/grid_tools_aspect_ratio.cc +++ b/tests/grid/grid_tools_aspect_ratio.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -72,8 +72,8 @@ compute_aspect_ratio_hyper_rectangle( tria.begin_active()->vertex(0) += shift; } - MappingQGeneric const mapping(degree); - QGauss const gauss(n_q_points); + MappingQ const mapping(degree); + QGauss const gauss(n_q_points); Vector ratios = GridTools::compute_aspect_ratio_of_cells(mapping, tria, gauss); diff --git a/tests/grid/project_to_object_01.cc b/tests/grid/project_to_object_01.cc index 9a80b53f59..91bb5c9acd 100644 --- a/tests/grid/project_to_object_01.cc +++ b/tests/grid/project_to_object_01.cc @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -221,7 +221,7 @@ main() << "minimizers. The output here has been eyeballed as decent." << std::endl; - MappingQGeneric<2, 3> mapping(6); + MappingQ<2, 3> mapping(6); for (auto &cell : triangulation.active_cell_iterators()) { const Point<3> projected_point = diff --git a/tests/hp/project_01_curved_boundary.cc b/tests/hp/project_01_curved_boundary.cc index f26e946876..d15105a048 100644 --- a/tests/hp/project_01_curved_boundary.cc +++ b/tests/hp/project_01_curved_boundary.cc @@ -100,7 +100,7 @@ test() // use an explicit Q1 mapping. this will yield a zero solution { - VectorTools::project(hp::MappingCollection(MappingQGeneric(1)), + VectorTools::project(hp::MappingCollection(MappingQ(1)), dh, cm, hp::QCollection(QGauss(3)), diff --git a/tests/hp/solution_transfer.cc b/tests/hp/solution_transfer.cc index 291689ca4a..20a5e2d135 100644 --- a/tests/hp/solution_transfer.cc +++ b/tests/hp/solution_transfer.cc @@ -83,11 +83,11 @@ transfer(std::ostream &out) fe_q.push_back(FE_Q(deg)); fe_dgq.push_back(FE_DGQ(deg)); } - DoFHandler q_dof_handler(tria); - DoFHandler dgq_dof_handler(tria); - Vector q_solution; - Vector dgq_solution; - MappingQGeneric mapping(1); + DoFHandler q_dof_handler(tria); + DoFHandler dgq_dof_handler(tria); + Vector q_solution; + Vector dgq_solution; + MappingQ mapping(1); // refine a few cells typename Triangulation::active_cell_iterator cell = tria.begin_active(), diff --git a/tests/hp/solution_transfer_12.cc b/tests/hp/solution_transfer_12.cc index 1cee10bf79..6f754bae53 100644 --- a/tests/hp/solution_transfer_12.cc +++ b/tests/hp/solution_transfer_12.cc @@ -85,9 +85,9 @@ transfer(std::ostream &out) { fe_q.push_back(FE_Q_Hierarchical(deg)); } - DoFHandler q_dof_handler(tria); - Vector q_solution; - MappingQGeneric mapping(1); + DoFHandler q_dof_handler(tria); + Vector q_solution; + MappingQ mapping(1); // refine a few cells typename Triangulation::active_cell_iterator cell = tria.begin_active(), diff --git a/tests/hp/step-12.cc b/tests/hp/step-12.cc index 28a9b12eae..9d5188d8e4 100644 --- a/tests/hp/step-12.cc +++ b/tests/hp/step-12.cc @@ -439,7 +439,7 @@ private: template DGMethod::DGMethod() - : mapping(MappingQGeneric(1)) + : mapping(MappingQ(1)) , fe(FE_DGQ(1)) , dof_handler(triangulation) , quadrature(QGauss(4)) diff --git a/tests/integrators/assembler_simple_mgmatrix_04.cc b/tests/integrators/assembler_simple_mgmatrix_04.cc index db64acbbea..9a9277087a 100644 --- a/tests/integrators/assembler_simple_mgmatrix_04.cc +++ b/tests/integrators/assembler_simple_mgmatrix_04.cc @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -138,7 +138,7 @@ assemble_mg_matrix(DoFHandler & dof_handler, mg.set_zero(); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients | update_hessians; diff --git a/tests/integrators/cochain_01.cc b/tests/integrators/cochain_01.cc index 8f6ae6d5ff..5c408e6d36 100644 --- a/tests/integrators/cochain_01.cc +++ b/tests/integrators/cochain_01.cc @@ -99,7 +99,7 @@ template void test_cochain(const Triangulation &tr, const FiniteElement &fe) { - MappingQGeneric mapping(1); + MappingQ mapping(1); // Initialize DofHandler for a // block system with local blocks DoFHandler dof(tr); diff --git a/tests/integrators/mesh_worker_01.cc b/tests/integrators/mesh_worker_01.cc index 47804d517e..ef44d9d0de 100644 --- a/tests/integrators/mesh_worker_01.cc +++ b/tests/integrators/mesh_worker_01.cc @@ -143,7 +143,7 @@ test_simple(DoFHandler &mgdofs) local.cells = true; local.faces = false; - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; info_box.initialize_gauss_quadrature(1, 1, 1); diff --git a/tests/integrators/mesh_worker_02.cc b/tests/integrators/mesh_worker_02.cc index 313071cda8..f303d9561e 100644 --- a/tests/integrators/mesh_worker_02.cc +++ b/tests/integrators/mesh_worker_02.cc @@ -155,7 +155,7 @@ void assemble(const DoFHandler &dof_handler, SparseMatrix &matrix) { const FiniteElement &fe = dof_handler.get_fe(); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1; @@ -195,7 +195,7 @@ assemble(const DoFHandler & dof_handler, MGLevelObject> dg_down) { const FiniteElement &fe = dof_handler.get_fe(); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1; diff --git a/tests/integrators/mesh_worker_03.cc b/tests/integrators/mesh_worker_03.cc index 4c14dd6b23..fa6a99cdf7 100644 --- a/tests/integrators/mesh_worker_03.cc +++ b/tests/integrators/mesh_worker_03.cc @@ -154,7 +154,7 @@ void assemble(const DoFHandler &dof_handler, SparseMatrix &matrix) { const FiniteElement &fe = dof_handler.get_fe(); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1; @@ -194,7 +194,7 @@ assemble(const DoFHandler & dof_handler, MGLevelObject> dg_down) { const FiniteElement &fe = dof_handler.get_fe(); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1; diff --git a/tests/integrators/mesh_worker_1d_dg.cc b/tests/integrators/mesh_worker_1d_dg.cc index 0fa41b758f..28711c5528 100644 --- a/tests/integrators/mesh_worker_1d_dg.cc +++ b/tests/integrators/mesh_worker_1d_dg.cc @@ -64,7 +64,7 @@ namespace Advection run(); private: - const MappingQGeneric mapping; + const MappingQ mapping; void setup_system(); diff --git a/tests/integrators/mesh_worker_matrix_01.cc b/tests/integrators/mesh_worker_matrix_01.cc index cc96ac569b..c198c713da 100644 --- a/tests/integrators/mesh_worker_matrix_01.cc +++ b/tests/integrators/mesh_worker_matrix_01.cc @@ -151,7 +151,7 @@ test_simple(DoFHandler &dofs, bool faces) local.cells = true; local.faces = faces; - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; info_box.initialize_gauss_quadrature(1, 1, 1); diff --git a/tests/lac/block_linear_operator_01.cc b/tests/lac/block_linear_operator_01.cc index 4052babc68..7035e38f7b 100644 --- a/tests/lac/block_linear_operator_01.cc +++ b/tests/lac/block_linear_operator_01.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -52,9 +52,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FESystem fe(FE_Q(2), 1, FE_Q(1), 1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FESystem fe(FE_Q(2), 1, FE_Q(1), 1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); diff --git a/tests/lac/block_linear_operator_02.cc b/tests/lac/block_linear_operator_02.cc index 4178eee0f3..f2f6daea28 100644 --- a/tests/lac/block_linear_operator_02.cc +++ b/tests/lac/block_linear_operator_02.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -53,9 +53,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FESystem fe(FE_Q(2), 1, FE_Q(1), 1, FE_Q(3), 1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FESystem fe(FE_Q(2), 1, FE_Q(1), 1, FE_Q(3), 1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); diff --git a/tests/lac/block_linear_operator_06.cc b/tests/lac/block_linear_operator_06.cc index bcfcbf3485..789e2c8974 100644 --- a/tests/lac/block_linear_operator_06.cc +++ b/tests/lac/block_linear_operator_06.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -52,9 +52,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FESystem fe(FE_Q(2), 1, FE_Q(1), 1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FESystem fe(FE_Q(2), 1, FE_Q(1), 1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); diff --git a/tests/lac/linear_operator_02.cc b/tests/lac/linear_operator_02.cc index ca30e689ba..674bc99694 100644 --- a/tests/lac/linear_operator_02.cc +++ b/tests/lac/linear_operator_02.cc @@ -53,9 +53,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FE_Q q1(1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FE_Q q1(1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(q1); DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); diff --git a/tests/lac/linear_operator_02a.cc b/tests/lac/linear_operator_02a.cc index 4e082de1d1..afddb53aed 100644 --- a/tests/lac/linear_operator_02a.cc +++ b/tests/lac/linear_operator_02a.cc @@ -57,9 +57,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FE_Q q1(1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FE_Q q1(1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(q1); DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); diff --git a/tests/lac/linear_operator_03.cc b/tests/lac/linear_operator_03.cc index b5ccb7ec5f..46cb8e9024 100644 --- a/tests/lac/linear_operator_03.cc +++ b/tests/lac/linear_operator_03.cc @@ -61,9 +61,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FESystem fe(FE_Q(1), 1, FE_Q(1), 1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FESystem fe(FE_Q(1), 1, FE_Q(1), 1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); diff --git a/tests/lac/packaged_operation_02.cc b/tests/lac/packaged_operation_02.cc index 9a1b7c1ff0..077c8c0160 100644 --- a/tests/lac/packaged_operation_02.cc +++ b/tests/lac/packaged_operation_02.cc @@ -73,9 +73,9 @@ main() GridGenerator::hyper_cube(triangulation); triangulation.refine_global(2); - MappingQGeneric mapping_q1(1); - FE_Q q1(1); - DoFHandler dof_handler(triangulation); + MappingQ mapping_q1(1); + FE_Q q1(1); + DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(q1); DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); diff --git a/tests/manifold/polar_manifold_06.cc b/tests/manifold/polar_manifold_06.cc index 5e5d2804fa..5478f75ae8 100644 --- a/tests/manifold/polar_manifold_06.cc +++ b/tests/manifold/polar_manifold_06.cc @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/tests/manifold/spherical_manifold_10.cc b/tests/manifold/spherical_manifold_10.cc index 970e9bf934..bc6db06285 100644 --- a/tests/manifold/spherical_manifold_10.cc +++ b/tests/manifold/spherical_manifold_10.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -44,7 +44,7 @@ main() tria.set_all_manifold_ids(0); tria.set_manifold(0, spherical); - MappingQGeneric mapping(4); + MappingQ mapping(4); QGaussLobatto quadrature(4); FE_Nothing dummy; diff --git a/tests/manifold/spherical_manifold_12.cc b/tests/manifold/spherical_manifold_12.cc index cd68af390d..5f016504c8 100644 --- a/tests/manifold/spherical_manifold_12.cc +++ b/tests/manifold/spherical_manifold_12.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -48,7 +48,7 @@ main() tria.refine_global(1); - MappingQGeneric mapping(4); + MappingQ mapping(4); QGaussLobatto quadrature(4); FE_Nothing dummy; FEFaceValues fe_values(mapping, diff --git a/tests/manifold/transfinite_manifold_03.cc b/tests/manifold/transfinite_manifold_03.cc index 68a1d240a5..e4663e00b4 100644 --- a/tests/manifold/transfinite_manifold_03.cc +++ b/tests/manifold/transfinite_manifold_03.cc @@ -14,14 +14,14 @@ // --------------------------------------------------------------------- -// Similar to transfinite_manifold_01 but now applying a MappingQGeneric and +// Similar to transfinite_manifold_01 but now applying a MappingQ and // computing some areas #include #include #include -#include +#include #include #include @@ -38,9 +38,9 @@ do_test(const Triangulation &tria) { for (unsigned int degree = 1; degree < 5; ++degree) { - MappingQGeneric mapping(degree); - FE_Nothing fe; - QGauss gauss(degree + 1); + MappingQ mapping(degree); + FE_Nothing fe; + QGauss gauss(degree + 1); FEValues fe_values(mapping, fe, gauss, update_JxW_values); double volume = 0; for (typename Triangulation::cell_iterator cell = diff --git a/tests/mappings/mapping.cc b/tests/mappings/mapping.cc index 9fabd7ce82..5ce2e43015 100644 --- a/tests/mappings/mapping.cc +++ b/tests/mappings/mapping.cc @@ -435,7 +435,7 @@ mapping_test() std::vector mapping_strings; MappingCartesian cart; - MappingQGeneric q1_old(1); + MappingQ q1_old(1); MappingQ q1tmp(1); MappingQ q2tmp(2); MappingQ q3tmp(3); diff --git a/tests/mappings/mapping_fe_field_05.cc b/tests/mappings/mapping_fe_field_05.cc index 497bf71777..4824d5bb65 100644 --- a/tests/mappings/mapping_fe_field_05.cc +++ b/tests/mappings/mapping_fe_field_05.cc @@ -69,8 +69,8 @@ test() transfer.build(dh); transfer.interpolate_to_mg(dh, level_vectors, map_vector); MappingFEField> - mapping(dh, level_vectors); - MappingQGeneric mapping_ref(fe.degree); + mapping(dh, level_vectors); + MappingQ mapping_ref(fe.degree); QGauss quad(1); FEValues fe_values_ref(mapping_ref, diff --git a/tests/mappings/mapping_fe_field_06.cc b/tests/mappings/mapping_fe_field_06.cc index a4df982c76..23a4405395 100644 --- a/tests/mappings/mapping_fe_field_06.cc +++ b/tests/mappings/mapping_fe_field_06.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include @@ -67,8 +67,8 @@ test() // Create a Mapping std::vector> level_vectors( tria.n_global_levels()); - MappingQGeneric mapping_ref(fe.degree); - FEValues fe_values_setup(mapping_ref, + MappingQ mapping_ref(fe.degree); + FEValues fe_values_setup(mapping_ref, dh.get_fe(), Quadrature( dh.get_fe().get_unit_support_points()), diff --git a/tests/mappings/mapping_fe_field_07.cc b/tests/mappings/mapping_fe_field_07.cc index 71bc4aa917..344b3631b3 100644 --- a/tests/mappings/mapping_fe_field_07.cc +++ b/tests/mappings/mapping_fe_field_07.cc @@ -13,7 +13,7 @@ // // --------------------------------------------------------------------- -// check that MappingFEField is equivalent to MappingQGeneric on a curved +// check that MappingFEField is equivalent to MappingQ on a curved // shell mesh #include @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include @@ -55,7 +55,7 @@ test() Vector map_vector(dh.n_dofs()); VectorTools::get_position_vector(dh, map_vector); MappingFEField> mapping(dh, map_vector); - MappingQGeneric mapping_ref(fe.degree); + MappingQ mapping_ref(fe.degree); QGauss quad(1); FEValues fe_values_ref(mapping_ref, fe, quad, update_quadrature_points); diff --git a/tests/mappings/mapping_fe_field_08.cc b/tests/mappings/mapping_fe_field_08.cc index ed50caefd0..6d305d17b8 100644 --- a/tests/mappings/mapping_fe_field_08.cc +++ b/tests/mappings/mapping_fe_field_08.cc @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -169,8 +168,8 @@ test(unsigned int n_ref) Triangulation tria; GridGenerator::hyper_shell(tria, Point(), 0.8, 1., dim == 2 ? 3 : 6); tria.refine_global(n_ref); - const unsigned int fe_degree = dim == 2 ? 8 : 4; - MappingQGeneric mapping_q(fe_degree); + const unsigned int fe_degree = dim == 2 ? 8 : 4; + MappingQ mapping_q(fe_degree); FE_Q fe_q(fe_degree); FESystem fe_system(fe_q, dim); @@ -184,8 +183,8 @@ test(unsigned int n_ref) VectorTools::get_position_vector(dofh, nodes, mask); MappingFEField> mapping(dofh, nodes, mask); - deallog << "Test with MappingQGeneric in " << dim << "D on " - << tria.n_active_cells() << " cells:" << std::endl; + deallog << "Test with MappingQ in " << dim << "D on " << tria.n_active_cells() + << " cells:" << std::endl; do_test(mapping_q, tria); deallog << std::endl; deallog << "Test with MappingFEField in " << dim << "D on " diff --git a/tests/mappings/mapping_fe_field_08.output b/tests/mappings/mapping_fe_field_08.output index 80ba511cb6..28b7c7d065 100644 --- a/tests/mappings/mapping_fe_field_08.output +++ b/tests/mappings/mapping_fe_field_08.output @@ -1,5 +1,5 @@ -DEAL::Test with MappingQGeneric in 2D on 12 cells: +DEAL::Test with MappingQ in 2D on 12 cells: DEAL::Testing 2D with point 0.8000000000 0.000000000 tolerance 1.000000000e-08 DEAL::Cell: 0_1:2 unit point 2.615834610e-20 1.000000000 DEAL::Cell: 2_1:3 unit point 1.000000000 1.000000000 @@ -203,7 +203,7 @@ DEAL::Testing 2D with point -0.7071067812 0.7071067812 tolerance 1.000000000e-08 DEAL::Cell: 1_1:0 unit point 0.2500000000 9.777199125e-11 DEAL:: DEAL:: -DEAL::Test with MappingQGeneric in 2D on 48 cells: +DEAL::Test with MappingQ in 2D on 48 cells: DEAL::Testing 2D with point 0.8000000000 0.000000000 tolerance 1.000000000e-08 DEAL::Cell: 0_2:22 unit point -5.001540069e-12 1.000000000 DEAL::Cell: 2_2:33 unit point 1.000000000 1.000000000 @@ -455,7 +455,7 @@ DEAL::Testing 2D with point -0.7071067812 0.7071067812 tolerance 1.000000000e-08 DEAL::Cell: 1_2:00 unit point 0.5000000000 0.000000000 DEAL:: DEAL:: -DEAL::Test with MappingQGeneric in 3D on 48 cells: +DEAL::Test with MappingQ in 3D on 48 cells: DEAL::Testing 3D with point 0.8000000000 0.000000000 4.898587197e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_1:2 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_1:3 unit point 8.316724501e-17 1.000000000 1.000000000 @@ -943,7 +943,7 @@ DEAL::Testing 3D with point 0.05868060999 0.08076693067 0.9950041653 tolerance 1 DEAL::Cell: 2_1:5 unit point 0.07446169019 3.662117048e-05 0.1025974553 DEAL:: DEAL:: -DEAL::Test with MappingQGeneric in 3D on 384 cells: +DEAL::Test with MappingQ in 3D on 384 cells: DEAL::Testing 3D with point 0.8000000000 0.000000000 4.898587197e-17 tolerance 1.000000000e-08 DEAL::Cell: 1_2:27 unit point 1.000000000 1.000000000 1.000000000 DEAL::Cell: 1_2:36 unit point -8.454658402e-13 1.000000000 1.000000000 diff --git a/tests/mappings/mapping_get_bounding_box_01.cc b/tests/mappings/mapping_get_bounding_box_01.cc index 99c2589e85..bb06a87a44 100644 --- a/tests/mappings/mapping_get_bounding_box_01.cc +++ b/tests/mappings/mapping_get_bounding_box_01.cc @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -73,8 +72,8 @@ main() test_bounding_boxes(mapping, degree); } { - unsigned int degree = 2; - MappingQGeneric<2> mapping(degree); + unsigned int degree = 2; + MappingQ<2> mapping(degree); test_bounding_boxes(mapping, degree); } } diff --git a/tests/mappings/mapping_get_bounding_box_01.output b/tests/mappings/mapping_get_bounding_box_01.output index 6ceb716d34..331ea104d4 100644 --- a/tests/mappings/mapping_get_bounding_box_01.output +++ b/tests/mappings/mapping_get_bounding_box_01.output @@ -38,7 +38,7 @@ CELL_TYPES 5 9 9 9 9 9 POINT_DATA 20 -DEAL::Testing dealii::MappingQGeneric<2, 2>(2) +DEAL::Testing dealii::MappingQ<2, 2>(2) # vtk DataFile Version 3.0 #This file was generated by the deal.II library. ASCII diff --git a/tests/mappings/mapping_manifold_01.cc b/tests/mappings/mapping_manifold_01.cc index 23efdc79db..638c272a06 100644 --- a/tests/mappings/mapping_manifold_01.cc +++ b/tests/mappings/mapping_manifold_01.cc @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -43,7 +43,7 @@ test() std::vector> q_points = quadrature.get_points(); MappingManifold map_manifold; - MappingQGeneric map_q1(1); + MappingQ map_q1(1); typename Triangulation::active_cell_iterator cell = triangulation.begin_active(), diff --git a/tests/mappings/mapping_manifold_02.cc b/tests/mappings/mapping_manifold_02.cc index 910d9d2d24..d3c5bae625 100644 --- a/tests/mappings/mapping_manifold_02.cc +++ b/tests/mappings/mapping_manifold_02.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/mappings/mapping_manifold_03.cc b/tests/mappings/mapping_manifold_03.cc index 6017b172aa..1c4a5b2c4b 100644 --- a/tests/mappings/mapping_manifold_03.cc +++ b/tests/mappings/mapping_manifold_03.cc @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -50,7 +50,7 @@ test() dof.distribute_dofs(fe); MappingManifold mapping_manifold; - MappingQGeneric mapping_q(1); + MappingQ mapping_q(1); FEValues fe_values_mapping(mapping_manifold, fe, diff --git a/tests/mappings/mapping_manifold_04.cc b/tests/mappings/mapping_manifold_04.cc index 18a64e5aad..6518337480 100644 --- a/tests/mappings/mapping_manifold_04.cc +++ b/tests/mappings/mapping_manifold_04.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -56,7 +56,7 @@ test() dof.distribute_dofs(fe); MappingManifold mapping_manifold; - MappingQGeneric mapping_q(1); + MappingQ mapping_q(1); FEValues fe_values_mapping(mapping_manifold, fe, diff --git a/tests/mappings/mapping_manifold_05.cc b/tests/mappings/mapping_manifold_05.cc index 16ba7ddb25..631e06369a 100644 --- a/tests/mappings/mapping_manifold_05.cc +++ b/tests/mappings/mapping_manifold_05.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -58,7 +58,7 @@ test() dof.distribute_dofs(fe); MappingManifold mapping_manifold; - MappingQGeneric mapping_q(1); + MappingQ mapping_q(1); FEFaceValues fe_values_mapping(mapping_manifold, fe, diff --git a/tests/mappings/mapping_manifold_06.cc b/tests/mappings/mapping_manifold_06.cc index d5ca36ace7..e5b5e633aa 100644 --- a/tests/mappings/mapping_manifold_06.cc +++ b/tests/mappings/mapping_manifold_06.cc @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/mappings/mapping_manifold_07.cc b/tests/mappings/mapping_manifold_07.cc index 9abb35bd7b..5fd369b90a 100644 --- a/tests/mappings/mapping_manifold_07.cc +++ b/tests/mappings/mapping_manifold_07.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/mappings/mapping_points_real_to_unit.cc b/tests/mappings/mapping_points_real_to_unit.cc index 19ca12142d..8e7028adc5 100644 --- a/tests/mappings/mapping_points_real_to_unit.cc +++ b/tests/mappings/mapping_points_real_to_unit.cc @@ -17,7 +17,7 @@ // on a test case similar to mapping_real_to_unit_q4_curved, check the // implementation of the many-point interface -// Mapping::transform_points_real_to_unit_cell for both a MappingQGeneric and +// Mapping::transform_points_real_to_unit_cell for both a MappingQ and // MappingFEField #include @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -114,9 +114,9 @@ test() { deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl; deallog << "MappingQ(1): "; - test_real_to_unit_cell(MappingQGeneric(1)); + test_real_to_unit_cell(MappingQ(1)); deallog << "MappingQ(4): "; - test_real_to_unit_cell(MappingQGeneric(4)); + test_real_to_unit_cell(MappingQ(4)); deallog << "MappingFEField(FESystem(FE_Q(4))): "; Triangulation triangulation; diff --git a/tests/mappings/mapping_project_01.cc b/tests/mappings/mapping_project_01.cc index 099de19eff..3a48c08be6 100644 --- a/tests/mappings/mapping_project_01.cc +++ b/tests/mappings/mapping_project_01.cc @@ -38,7 +38,7 @@ dim2_grid() const Point<2> testp(.5, -.5); // test point - MappingQGeneric<2> mapping(1); + MappingQ<2> mapping(1); deallog << "Check project for 2D cube from (-1,-1), to (1,1)." << std::endl; @@ -68,7 +68,7 @@ dim3_grid() const Point<3> testp(.5, -.5, 0); // test point - MappingQGeneric<3> mapping(1); + MappingQ<3> mapping(1); deallog << "Check project for 3D cube from (-1,-1,-1) to (1,1,1)." << std::endl; @@ -102,7 +102,7 @@ dim3_parallelepiped_grid() const Point<3> testp(1, 1, 1); // test point - MappingQGeneric<3> mapping(1); + MappingQ<3> mapping(1); deallog << "Check project for 3D parallelepiped with vectors (2, 0, 0), (0, 2, 0), and (0, 1, 2)." diff --git a/tests/mappings/mapping_q1_cartesian_grid.cc b/tests/mappings/mapping_q1_cartesian_grid.cc index 306def294c..a03f82dfac 100644 --- a/tests/mappings/mapping_q1_cartesian_grid.cc +++ b/tests/mappings/mapping_q1_cartesian_grid.cc @@ -112,8 +112,8 @@ private: void test_mapping() { - const double tol = 1e-8; - const MappingQGeneric mapping(1); + const double tol = 1e-8; + const MappingQ mapping(1); deallog << "Number of active cells: " << triangulation.n_active_cells() << std::endl; diff --git a/tests/mappings/mapping_q_cache_01.cc b/tests/mappings/mapping_q_cache_01.cc index ca81992519..ded54487d0 100644 --- a/tests/mappings/mapping_q_cache_01.cc +++ b/tests/mappings/mapping_q_cache_01.cc @@ -13,10 +13,10 @@ // // --------------------------------------------------------------------- -// Test MappingQCache by comparison with MappingQGeneric +// Test MappingQCache by comparison with MappingQ +#include #include -#include #include #include @@ -33,8 +33,8 @@ do_test(const unsigned int degree) else GridGenerator::hyper_cube(tria, -1, 1); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); mapping_cache.initialize(tria, mapping); Point p1; diff --git a/tests/mappings/mapping_q_cache_02.cc b/tests/mappings/mapping_q_cache_02.cc index 95117f7b46..533fe609f4 100644 --- a/tests/mappings/mapping_q_cache_02.cc +++ b/tests/mappings/mapping_q_cache_02.cc @@ -13,14 +13,14 @@ // // --------------------------------------------------------------------- -// Test MappingQCache by comparison with MappingQGeneric in parallel +// Test MappingQCache by comparison with MappingQ in parallel #include #include +#include #include -#include #include @@ -38,8 +38,8 @@ do_test(const unsigned int degree) tria.refine_global(1); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); mapping_cache.initialize(tria, mapping); Point p1; diff --git a/tests/mappings/mapping_q_cache_03.cc b/tests/mappings/mapping_q_cache_03.cc index fd37639a66..19a274afec 100644 --- a/tests/mappings/mapping_q_cache_03.cc +++ b/tests/mappings/mapping_q_cache_03.cc @@ -13,11 +13,11 @@ // // --------------------------------------------------------------------- -// Test MappingQCache by comparison with MappingQGeneric for the case when we +// Test MappingQCache by comparison with MappingQ for the case when we // change the mesh +#include #include -#include #include #include @@ -34,8 +34,8 @@ do_test(const unsigned int degree) else GridGenerator::hyper_cube(tria, -1, 1); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); mapping_cache.initialize(tria, mapping); Point p1; diff --git a/tests/mappings/mapping_q_cache_04.cc b/tests/mappings/mapping_q_cache_04.cc index 753e8d9b60..2caf2b20fb 100644 --- a/tests/mappings/mapping_q_cache_04.cc +++ b/tests/mappings/mapping_q_cache_04.cc @@ -18,8 +18,8 @@ #include #include #include +#include #include -#include #include #include @@ -36,9 +36,9 @@ do_test(const unsigned int degree) else GridGenerator::hyper_cube(tria, -1, 1); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); - Point shift; + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); + Point shift; for (unsigned int d = 0; d < dim; ++d) shift[d] = -0.5 + 0.1 * d; diff --git a/tests/mappings/mapping_q_cache_05.cc b/tests/mappings/mapping_q_cache_05.cc index a45edce896..0eb0707690 100644 --- a/tests/mappings/mapping_q_cache_05.cc +++ b/tests/mappings/mapping_q_cache_05.cc @@ -18,8 +18,8 @@ #include #include #include +#include #include -#include #include #include @@ -59,8 +59,8 @@ do_test(const unsigned int degree, Triangulation tria; GridGenerator::subdivided_hyper_cube(tria, 4); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); mapping_cache.initialize(mapping, tria, fu, is_displacement_function); { diff --git a/tests/mappings/mapping_q_cache_06.cc b/tests/mappings/mapping_q_cache_06.cc index 9487ce0e2b..35a0f8b585 100644 --- a/tests/mappings/mapping_q_cache_06.cc +++ b/tests/mappings/mapping_q_cache_06.cc @@ -21,8 +21,8 @@ #include #include #include +#include #include -#include #include #include @@ -86,8 +86,8 @@ do_test(const unsigned int degree, VectorTools::interpolate(dof_handler, fu, vector); { - MappingQGeneric mapping(mapping_degree); - MappingQCache mapping_cache(mapping_degree); + MappingQ mapping(mapping_degree); + MappingQCache mapping_cache(mapping_degree); mapping_cache.initialize(mapping, dof_handler, vector, @@ -120,8 +120,8 @@ do_test(const unsigned int degree, transfer.build(dof_handler); transfer.interpolate_to_mg(dof_handler, vectors, vector); - MappingQGeneric mapping(mapping_degree); - MappingQCache mapping_cache(mapping_degree); + MappingQ mapping(mapping_degree); + MappingQCache mapping_cache(mapping_degree); mapping_cache.initialize(mapping, dof_handler, vectors, diff --git a/tests/mappings/mapping_q_cache_07.cc b/tests/mappings/mapping_q_cache_07.cc index 79ea3b3b5b..880c68ac36 100644 --- a/tests/mappings/mapping_q_cache_07.cc +++ b/tests/mappings/mapping_q_cache_07.cc @@ -20,8 +20,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/tests/mappings/mapping_q_cache_08.cc b/tests/mappings/mapping_q_cache_08.cc index 43a564eade..34ac006251 100644 --- a/tests/mappings/mapping_q_cache_08.cc +++ b/tests/mappings/mapping_q_cache_08.cc @@ -18,8 +18,8 @@ #include #include #include +#include #include -#include #include #include @@ -36,9 +36,9 @@ do_test(const unsigned int degree) else GridGenerator::hyper_cube(tria, -1, 1); - MappingQGeneric mapping(degree); - MappingQCache mapping_cache(degree); - Point shift; + MappingQ mapping(degree); + MappingQCache mapping_cache(degree); + Point shift; for (unsigned int d = 0; d < dim; ++d) shift[d] = -0.5 + 0.1 * d; diff --git a/tests/mappings/mapping_q_eulerian.cc b/tests/mappings/mapping_q_eulerian.cc index b2644ead7e..9e428ea537 100644 --- a/tests/mappings/mapping_q_eulerian.cc +++ b/tests/mappings/mapping_q_eulerian.cc @@ -173,7 +173,7 @@ MappingTest::run_test() dof_handler.distribute_dofs(fe); displacements.reinit(dof_handler.n_dofs()); - VectorTools::interpolate(MappingQGeneric(1), + VectorTools::interpolate(MappingQ(1), dof_handler, imposed_displacement, displacements); @@ -244,7 +244,7 @@ MappingTest::graphical_output() dof_handler.distribute_dofs(fe); displacements.reinit(dof_handler.n_dofs()); - VectorTools::interpolate(MappingQGeneric(1), + VectorTools::interpolate(MappingQ(1), dof_handler, imposed_displacement, displacements); diff --git a/tests/mappings/mapping_q_inverse_quadratic_approximation.cc b/tests/mappings/mapping_q_inverse_quadratic_approximation.cc index 411db4c8f7..381431862b 100644 --- a/tests/mappings/mapping_q_inverse_quadratic_approximation.cc +++ b/tests/mappings/mapping_q_inverse_quadratic_approximation.cc @@ -15,7 +15,7 @@ // Check InverseQuadraticApproximation used for the initial guess in -// MappingQGeneric::transform_points_real_to_unit_cell +// MappingQ::transform_points_real_to_unit_cell #include #include @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -47,8 +46,8 @@ print_result(const unsigned int mapping_degree, { deallog << "Testing " << dim << "D with point " << p << std::endl; - FE_Q dummy(mapping_degree); - MappingQGeneric mapping(mapping_degree); + FE_Q dummy(mapping_degree); + MappingQ mapping(mapping_degree); FEValues fe_values(mapping, dummy, @@ -60,8 +59,8 @@ print_result(const unsigned int mapping_degree, std::vector renumber = FETools::lexicographic_to_hierarchic_numbering(mapping_degree); std::vector> mapping_unit_support_points = - internal::MappingQGenericImplementation::unit_support_points( - mapping_points, renumber); + internal::MappingQImplementation::unit_support_points(mapping_points, + renumber); for (const auto &cell : tria.active_cell_iterators()) { @@ -76,7 +75,7 @@ print_result(const unsigned int mapping_degree, deallog << "Affine approximation: " << cell->real_to_unit_cell_affine_approximation(p) << std::endl; - internal::MappingQGenericImplementation:: + internal::MappingQImplementation:: InverseQuadraticApproximation approx(fe_values.get_quadrature_points(), mapping_unit_support_points); diff --git a/tests/mappings/mapping_q_mixed_manifolds_01.cc b/tests/mappings/mapping_q_mixed_manifolds_01.cc index 4e1cbef552..139c500408 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_01.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_01.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -84,7 +84,7 @@ test() FE_Nothing fe; for (unsigned int degree = 6; degree < 7; ++degree) { - MappingQGeneric mapping(degree); + MappingQ mapping(degree); QGauss quad(degree + 1); FEValues fe_values(mapping, fe, quad, update_JxW_values); diff --git a/tests/mappings/mapping_q_mixed_manifolds_02.cc b/tests/mappings/mapping_q_mixed_manifolds_02.cc index f9770fe5e7..246e52cc20 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_02.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_02.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -224,10 +224,10 @@ test() FE_Nothing fe; for (unsigned int degree = 1; degree < 7; ++degree) { - MappingQGeneric mapping(degree); - QGauss quad(degree + 1); - FEValues fe_values(mapping, fe, quad, update_JxW_values); - double sum = 0.; + MappingQ mapping(degree); + QGauss quad(degree + 1); + FEValues fe_values(mapping, fe, quad, update_JxW_values); + double sum = 0.; for (typename Triangulation::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); diff --git a/tests/mappings/mapping_q_points_real_to_unit.cc b/tests/mappings/mapping_q_points_real_to_unit.cc index cf747e3de9..b1c6749e66 100644 --- a/tests/mappings/mapping_q_points_real_to_unit.cc +++ b/tests/mappings/mapping_q_points_real_to_unit.cc @@ -14,12 +14,12 @@ // --------------------------------------------------------------------- -// check MappingQGeneric::transform_real_to_unit_points on a set of +// check MappingQ::transform_real_to_unit_points on a set of // challenging points, especially with vectorization because we have nearby // points that succeed and others in the regime of negative Jacobian // determinants, respectively -#include +#include #include #include @@ -42,7 +42,7 @@ test(const unsigned int degree) real_points.push_back( (i % 2 ? 0.05 * (static_cast(i) - 10.) : 0.05 * i) * p); std::vector> unit_points(real_points.size()); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); mapping.transform_points_real_to_unit_cell(tria.begin(), real_points, unit_points); diff --git a/tests/mappings/mapping_q_quadrature_points.cc b/tests/mappings/mapping_q_quadrature_points.cc index 1f4a9c1dd0..f36aeabb59 100644 --- a/tests/mappings/mapping_q_quadrature_points.cc +++ b/tests/mappings/mapping_q_quadrature_points.cc @@ -14,10 +14,10 @@ // --------------------------------------------------------------------- -// Show positions of quadrature points with various degrees of MappingQGeneric +// Show positions of quadrature points with various degrees of MappingQ // and quadrature formulas, including the collocation case where quadrature // points coincide with the mapping support points and going to the tensor -// product and non-tensor product path of MappingQGeneric +// product and non-tensor product path of MappingQ #include @@ -35,10 +35,10 @@ template void test(const unsigned int degree, const unsigned int n_q_points) { - MappingQGeneric mapping(degree); - FE_Nothing dummy; - QGaussLobatto quadrature(n_q_points); - Quadrature quadrature_copy(quadrature.get_points()); + MappingQ mapping(degree); + FE_Nothing dummy; + QGaussLobatto quadrature(n_q_points); + Quadrature quadrature_copy(quadrature.get_points()); Triangulation tria; GridGenerator::hyper_ball(tria); @@ -47,7 +47,7 @@ test(const unsigned int degree, const unsigned int n_q_points) << " with " << n_q_points << " points per coordinate direction" << std::endl; - // for QGaussLobatto, MappingQGeneric will choose the tensor product code + // for QGaussLobatto, MappingQ will choose the tensor product code // path, whereas for the copy it will not as we do not know the tensor // product property on general points FEValues fe_val(mapping, dummy, quadrature, update_quadrature_points); diff --git a/tests/mappings/mapping_q_real_to_unit_internal.cc b/tests/mappings/mapping_q_real_to_unit_internal.cc index a02462d8ad..5ff8f1fb9a 100644 --- a/tests/mappings/mapping_q_real_to_unit_internal.cc +++ b/tests/mappings/mapping_q_real_to_unit_internal.cc @@ -15,7 +15,7 @@ // Check internal implementation of -// MappingQGeneric::transform_real_to_unit_point by printing Newton iteration +// MappingQ::transform_real_to_unit_point by printing Newton iteration // information. This test is sensitive to roundoff errors by the nature of // what gets tested, which can cause one more or one less iteration, // especially due to FMA @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -50,8 +49,8 @@ print_result(const unsigned int mapping_degree, { deallog << "Testing " << dim << "D with point " << p << std::endl; - FE_Q dummy(mapping_degree); - MappingQGeneric mapping(mapping_degree); + FE_Q dummy(mapping_degree); + MappingQ mapping(mapping_degree); FEValues fe_values(mapping, dummy, @@ -72,7 +71,7 @@ print_result(const unsigned int mapping_degree, if (GeometryInfo::distance_to_unit_cell( cell->real_to_unit_cell_affine_approximation(p)) < (-0.6 + 1.3 * dim)) - internal::MappingQGenericImplementation:: + internal::MappingQImplementation:: do_transform_real_to_unit_cell_internal( p, cell->real_to_unit_cell_affine_approximation(p), diff --git a/tests/mappings/mapping_real_to_unit_02.cc b/tests/mappings/mapping_real_to_unit_02.cc index 82b8c5ce01..6820284f02 100644 --- a/tests/mappings/mapping_real_to_unit_02.cc +++ b/tests/mappings/mapping_real_to_unit_02.cc @@ -45,7 +45,7 @@ test2() GridGenerator::hyper_ball(triangulation); triangulation.set_manifold(0, boundary_description); triangulation.refine_global(1); - MappingQGeneric mapping(1); + MappingQ mapping(1); Point p(-0.27999999999999992, -0.62999999999999989); diff --git a/tests/mappings/mapping_real_to_unit_q1.cc b/tests/mappings/mapping_real_to_unit_q1.cc index f3d6c6deee..d3692cb85a 100644 --- a/tests/mappings/mapping_real_to_unit_q1.cc +++ b/tests/mappings/mapping_real_to_unit_q1.cc @@ -74,7 +74,7 @@ test_real_to_unit_cell() } - MappingQGeneric map(1); + MappingQ map(1); typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); diff --git a/tests/mappings/mapping_real_to_unit_q1_singular.cc b/tests/mappings/mapping_real_to_unit_q1_singular.cc index b32643e28c..a6a1197c37 100644 --- a/tests/mappings/mapping_real_to_unit_q1_singular.cc +++ b/tests/mappings/mapping_real_to_unit_q1_singular.cc @@ -37,8 +37,8 @@ test_real_to_unit_cell() Triangulation triangulation; GridGenerator::hyper_ball(triangulation); - Point point; - MappingQGeneric mapping(1); + Point point; + MappingQ mapping(1); point[1] = -1. / (1 + std::sqrt(2.0)) / std::sqrt(2); diff --git a/tests/mappings/mapping_real_to_unit_q1_singular_02.cc b/tests/mappings/mapping_real_to_unit_q1_singular_02.cc index 72de42c74f..5a198157ba 100644 --- a/tests/mappings/mapping_real_to_unit_q1_singular_02.cc +++ b/tests/mappings/mapping_real_to_unit_q1_singular_02.cc @@ -49,8 +49,8 @@ test_real_to_unit_cell() cells[0].material_id = 0; triangulation.create_triangulation(points, cells, SubCellData()); - Point point(-0.29999999999999999, -0.29999999999999999); - MappingQGeneric mapping(1); + Point point(-0.29999999999999999, -0.29999999999999999); + MappingQ mapping(1); try { diff --git a/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc b/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc index f4917077de..bd3dd5df7f 100644 --- a/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc +++ b/tests/mappings/mapping_real_to_unit_q4_sphere_x.cc @@ -78,8 +78,8 @@ test_real_to_unit_cell() // of the following point in the // reference coordinate system of // the cell - const Point p(-3.56413e+06, 1.74215e+06, 2.14762e+06); - MappingQGeneric map(1); + const Point p(-3.56413e+06, 1.74215e+06, 2.14762e+06); + MappingQ map(1); Triangulation::active_cell_iterator cell = triangulation.begin_active(); try { diff --git a/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc b/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc index d3515cc9ef..88a1814ffa 100644 --- a/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc +++ b/tests/mappings/mapping_real_to_unit_q4_sphere_y.cc @@ -78,8 +78,8 @@ test_real_to_unit_cell() // of the following point in the // reference coordinate system of // the cell - const Point p(-3.56413e+06, 1.74215e+06, 2.14762e+06); - MappingQGeneric map(1); + const Point p(-3.56413e+06, 1.74215e+06, 2.14762e+06); + MappingQ map(1); Triangulation::active_cell_iterator cell = triangulation.begin_active(); // the following call will fail diff --git a/tests/matrix_free/boundary_id.cc b/tests/matrix_free/boundary_id.cc index b57e5e93d2..d9caf07dfa 100644 --- a/tests/matrix_free/boundary_id.cc +++ b/tests/matrix_free/boundary_id.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -45,9 +45,9 @@ test() count += 100000; } - MappingQGeneric mapping(1); - FE_Q fe(1); - DoFHandler dof(tria); + MappingQ mapping(1); + FE_Q fe(1); + DoFHandler dof(tria); dof.distribute_dofs(fe); AffineConstraints constraints; constraints.close(); diff --git a/tests/matrix_free/compare_faces_by_cells.cc b/tests/matrix_free/compare_faces_by_cells.cc index 254171d948..76a75982e5 100644 --- a/tests/matrix_free/compare_faces_by_cells.cc +++ b/tests/matrix_free/compare_faces_by_cells.cc @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include @@ -342,7 +342,7 @@ test() dof.distribute_mg_dofs(); deallog << "Number of DoFs: " << dof.n_dofs() << std::endl; - MappingQGeneric mapping(fe_degree + 1); + MappingQ mapping(fe_degree + 1); LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof); diff --git a/tests/matrix_free/compress_mapping.cc b/tests/matrix_free/compress_mapping.cc index dd120c0be3..305bee6532 100644 --- a/tests/matrix_free/compress_mapping.cc +++ b/tests/matrix_free/compress_mapping.cc @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -256,7 +256,7 @@ test_deformed_cube() // check again, now using a mapping that displaces points { - MappingQGeneric mapping(3); + MappingQ mapping(3); mf.reinit(mapping, dof, constraints, quad, data); std::vector n_cell_types(4, 0); diff --git a/tests/matrix_free/mapping_info_01.cc b/tests/matrix_free/mapping_info_01.cc index 5675b98050..ff7040c77a 100644 --- a/tests/matrix_free/mapping_info_01.cc +++ b/tests/matrix_free/mapping_info_01.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -47,7 +47,7 @@ test(const unsigned int degree) AffineConstraints constraints; constraints.close(); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); MatrixFree mf_data; const QGauss<1> quad(degree); diff --git a/tests/matrix_free/matrix_vector_common.h b/tests/matrix_free/matrix_vector_common.h index 358990ff73..5025fc0512 100644 --- a/tests/matrix_free/matrix_vector_common.h +++ b/tests/matrix_free/matrix_vector_common.h @@ -67,7 +67,7 @@ do_test(const DoFHandler & dof, // of degrees of freedom: " << dof.n_dofs() << std::endl; std::cout << "Number // of constraints: " << constraints.n_constraints() << std::endl; - MappingQGeneric mapping(dof.get_fe().degree); + MappingQ mapping(dof.get_fe().degree); MatrixFree mf_data; { const QGauss<1> quad(n_q_points_1d); diff --git a/tests/matrix_free/matrix_vector_faces_14.cc b/tests/matrix_free/matrix_vector_faces_14.cc index 7058d695ea..c620a04a48 100644 --- a/tests/matrix_free/matrix_vector_faces_14.cc +++ b/tests/matrix_free/matrix_vector_faces_14.cc @@ -79,7 +79,7 @@ test() deallog << " on " << dof.n_dofs() << " DoFs"; deallog << std::endl; - MappingQGeneric mapping(dof.get_fe().degree + 1); + MappingQ mapping(dof.get_fe().degree + 1); LinearAlgebra::distributed::Vector in, out, out_dist; diff --git a/tests/matrix_free/matrix_vector_faces_29.cc b/tests/matrix_free/matrix_vector_faces_29.cc index e1706bbd0a..5187c374fa 100644 --- a/tests/matrix_free/matrix_vector_faces_29.cc +++ b/tests/matrix_free/matrix_vector_faces_29.cc @@ -79,7 +79,7 @@ test() deallog << " on " << dof.n_dofs() << " DoFs"; deallog << std::endl; - MappingQGeneric mapping(dof.get_fe().degree + 1); + MappingQ mapping(dof.get_fe().degree + 1); LinearAlgebra::distributed::BlockVector in(1); LinearAlgebra::distributed::BlockVector out(1); diff --git a/tests/matrix_free/matrix_vector_faces_common.h b/tests/matrix_free/matrix_vector_faces_common.h index 6f35018971..b0413f3f18 100644 --- a/tests/matrix_free/matrix_vector_faces_common.h +++ b/tests/matrix_free/matrix_vector_faces_common.h @@ -774,7 +774,7 @@ do_test(const DoFHandler & dof, // of degrees of freedom: " << dof.n_dofs() << std::endl; std::cout << "Number // of constraints: " << constraints.n_constraints() << std::endl; - MappingQGeneric mapping(dof.get_fe().degree + 1); + MappingQ mapping(dof.get_fe().degree + 1); Vector in(dof.n_dofs()), out(dof.n_dofs()); Vector out_dist(out); diff --git a/tests/matrix_free/matrix_vector_mg.cc b/tests/matrix_free/matrix_vector_mg.cc index d441f25f09..431eef17f7 100644 --- a/tests/matrix_free/matrix_vector_mg.cc +++ b/tests/matrix_free/matrix_vector_mg.cc @@ -66,9 +66,9 @@ test() // of degrees of freedom: " << dof.n_dofs() << std::endl; // set up MatrixFree - MappingQGeneric mapping(fe_degree); - QGauss<1> quad(fe_degree + 1); - MatrixFree mf_data; + MappingQ mapping(fe_degree); + QGauss<1> quad(fe_degree + 1); + MatrixFree mf_data; mf_data.reinit(mapping, dof, constraints, quad); SparsityPattern sparsity; SparseMatrix system_matrix; diff --git a/tests/matrix_free/point_evaluation_01.cc b/tests/matrix_free/point_evaluation_01.cc index e704004cb3..ab6d385049 100644 --- a/tests/matrix_free/point_evaluation_01.cc +++ b/tests/matrix_free/point_evaluation_01.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for scalar FE_Q and MappingQGeneric by comparing to +// check FEPointEvaluation for scalar FE_Q and MappingQ by comparing to // the output of FEValues with the same settings #include @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_02.cc b/tests/matrix_free/point_evaluation_02.cc index a89eba36af..9feca85fbe 100644 --- a/tests/matrix_free/point_evaluation_02.cc +++ b/tests/matrix_free/point_evaluation_02.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for scalar FE_DGQ and MappingQGeneric by comparing +// check FEPointEvaluation for scalar FE_DGQ and MappingQ by comparing // to the output of FEValues with the same settings #include @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(std::max(1, degree)); + MappingQ mapping(std::max(1, degree)); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_03.cc b/tests/matrix_free/point_evaluation_03.cc index 0c95269f15..2b573ea9d8 100644 --- a/tests/matrix_free/point_evaluation_03.cc +++ b/tests/matrix_free/point_evaluation_03.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for vector-valued FE_Q and MappingQGeneric by +// check FEPointEvaluation for vector-valued FE_Q and MappingQ by // comparing to the output of FEValues with the same settings #include @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_04.cc b/tests/matrix_free/point_evaluation_04.cc index c598625cce..3399d4af81 100644 --- a/tests/matrix_free/point_evaluation_04.cc +++ b/tests/matrix_free/point_evaluation_04.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for FESystem(FE_Q^dim, FE_Q) and MappingQGeneric by +// check FEPointEvaluation for FESystem(FE_Q^dim, FE_Q) and MappingQ by // comparing to the output of FEValues with the same settings #include @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -73,7 +73,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_09.cc b/tests/matrix_free/point_evaluation_09.cc index 3bea6919a4..5d7bb217bc 100644 --- a/tests/matrix_free/point_evaluation_09.cc +++ b/tests/matrix_free/point_evaluation_09.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for (dim+1)-valued FE_Q and MappingQGeneric by +// check FEPointEvaluation for (dim+1)-valued FE_Q and MappingQ by // comparing to the output of FEValues with the same settings #include @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -70,7 +70,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_10.cc b/tests/matrix_free/point_evaluation_10.cc index 714b1ef5e8..f25138c165 100644 --- a/tests/matrix_free/point_evaluation_10.cc +++ b/tests/matrix_free/point_evaluation_10.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for scalar FE_DGQArbitraryNodes and MappingQGeneric +// check FEPointEvaluation for scalar FE_DGQArbitraryNodes and MappingQ // by comparing to the output of FEValues with the same settings (apart from // the finite element, this test is the same as point_evaluation_02) @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_11.cc b/tests/matrix_free/point_evaluation_11.cc index 0cda0c2405..e176925ce4 100644 --- a/tests/matrix_free/point_evaluation_11.cc +++ b/tests/matrix_free/point_evaluation_11.cc @@ -14,7 +14,7 @@ // --------------------------------------------------------------------- -// check FEPointEvaluation for scalar FE_DGQHermite and MappingQGeneric by +// check FEPointEvaluation for scalar FE_DGQHermite and MappingQ by // comparing to the output of FEValues with the same settings (apart from the // finite element and the interpolated function, this is the same as // point_evaluation_02) @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -54,7 +54,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/matrix_free/point_evaluation_12.cc b/tests/matrix_free/point_evaluation_12.cc index 316e4ff722..f41c308e5d 100644 --- a/tests/matrix_free/point_evaluation_12.cc +++ b/tests/matrix_free/point_evaluation_12.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ test(const unsigned int degree) else GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1); - MappingQGeneric mapping(degree); + MappingQ mapping(degree); deallog << "Mapping of degree " << degree << std::endl; std::vector> unit_points; diff --git a/tests/mpi/derivative_approximation_01.cc b/tests/mpi/derivative_approximation_01.cc index 02e68949ce..5f7eb015ed 100644 --- a/tests/mpi/derivative_approximation_01.cc +++ b/tests/mpi/derivative_approximation_01.cc @@ -86,8 +86,8 @@ test() TrilinosWrappers::MPI::Vector vec_rel(locally_relevant_set); vec_rel = vec; - MappingQGeneric mapping(1); - Vector indicators(tr.n_active_cells()); + MappingQ mapping(1); + Vector indicators(tr.n_active_cells()); DerivativeApproximation::approximate_gradient(mapping, dofh, vec_rel, diff --git a/tests/mpi/flux_edge_01.cc b/tests/mpi/flux_edge_01.cc index 42c2cbae13..68de5c1665 100644 --- a/tests/mpi/flux_edge_01.cc +++ b/tests/mpi/flux_edge_01.cc @@ -78,7 +78,7 @@ namespace Step39 setup_system(); parallel::distributed::Triangulation triangulation; - const MappingQGeneric mapping; + const MappingQ mapping; const FiniteElement & fe; DoFHandler dof_handler; diff --git a/tests/mpi/map_dofs_to_support_points.cc b/tests/mpi/map_dofs_to_support_points.cc index 2d70183437..ccd17ec17e 100644 --- a/tests/mpi/map_dofs_to_support_points.cc +++ b/tests/mpi/map_dofs_to_support_points.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -46,7 +46,7 @@ test() dofh.distribute_dofs(fe); std::map> points; - DoFTools::map_dofs_to_support_points(MappingQGeneric(1), dofh, points); + DoFTools::map_dofs_to_support_points(MappingQ(1), dofh, points); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { for (typename std::map &dofs, bool faces) local.cells = true; local.faces = faces; - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; info_box.initialize_gauss_quadrature(1, 1, 1); diff --git a/tests/mpi/periodicity_04.cc b/tests/mpi/periodicity_04.cc index 916a759654..cb0855932e 100644 --- a/tests/mpi/periodicity_04.cc +++ b/tests/mpi/periodicity_04.cc @@ -218,7 +218,7 @@ check(const unsigned int orientation, bool reverse) unsigned int n_local_constraints = 0; std::map> support_points; - DoFTools::map_dofs_to_support_points(MappingQGeneric(1), + DoFTools::map_dofs_to_support_points(MappingQ(1), dof_handler, support_points); IndexSet constraints_lines = constraints.get_local_lines(); diff --git a/tests/mpi/solution_transfer_09.cc b/tests/mpi/solution_transfer_09.cc index a1ee7371d5..489c1745bf 100644 --- a/tests/mpi/solution_transfer_09.cc +++ b/tests/mpi/solution_transfer_09.cc @@ -53,7 +53,7 @@ refine_and_transfer(const Function &function, Triangulation &tria) tria.prepare_coarsening_and_refinement(); Vector sol_old(dh.n_dofs()); - VectorTools::interpolate(MappingQGeneric(1), dh, function, sol_old); + VectorTools::interpolate(MappingQ(1), dh, function, sol_old); SolutionTransfer soltrans(dh); soltrans.prepare_for_coarsening_and_refinement(sol_old); diff --git a/tests/mpi/solution_transfer_10.cc b/tests/mpi/solution_transfer_10.cc index be62e2fb61..7aa13a3927 100644 --- a/tests/mpi/solution_transfer_10.cc +++ b/tests/mpi/solution_transfer_10.cc @@ -53,7 +53,7 @@ refine_and_transfer(const Function &function, Triangulation &tria) tria.prepare_coarsening_and_refinement(); Vector sol_old(dh.n_dofs()); - VectorTools::interpolate(MappingQGeneric(1), dh, function, sol_old); + VectorTools::interpolate(MappingQ(1), dh, function, sol_old); SolutionTransfer soltrans(dh); soltrans.prepare_for_pure_refinement(); diff --git a/tests/mpi/step-39-block.cc b/tests/mpi/step-39-block.cc index dc3b1a6efa..1aae9c4e96 100644 --- a/tests/mpi/step-39-block.cc +++ b/tests/mpi/step-39-block.cc @@ -421,7 +421,7 @@ namespace Step39 output_results(const unsigned int cycle) const; parallel::distributed::Triangulation triangulation; - const MappingQGeneric mapping; + const MappingQ mapping; const FiniteElement & fe; DoFHandler dof_handler; diff --git a/tests/mpi/step-39.cc b/tests/mpi/step-39.cc index 966b3c5545..31aa6a820a 100644 --- a/tests/mpi/step-39.cc +++ b/tests/mpi/step-39.cc @@ -422,7 +422,7 @@ namespace Step39 output_results(const unsigned int cycle) const; parallel::distributed::Triangulation triangulation; - const MappingQGeneric mapping; + const MappingQ mapping; const FiniteElement & fe; DoFHandler dof_handler; diff --git a/tests/multigrid/mg_renumbered_02.cc b/tests/multigrid/mg_renumbered_02.cc index 1235f5a600..3fe907b249 100644 --- a/tests/multigrid/mg_renumbered_02.cc +++ b/tests/multigrid/mg_renumbered_02.cc @@ -195,10 +195,10 @@ private: void refine_local(); - Triangulation triangulation; - const MappingQGeneric mapping; - FESystem fe; - DoFHandler mg_dof_handler_renumbered; + Triangulation triangulation; + const MappingQ mapping; + FESystem fe; + DoFHandler mg_dof_handler_renumbered; const unsigned int degree; std::vector> boundary_indices_renumbered; diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 08ddf93adc..426a292d90 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -242,11 +242,11 @@ private: void refine_local(); - Triangulation triangulation; - const MappingQGeneric mapping; - FESystem fe; - DoFHandler mg_dof_handler; - DoFHandler mg_dof_handler_renumbered; + Triangulation triangulation; + const MappingQ mapping; + FESystem fe; + DoFHandler mg_dof_handler; + DoFHandler mg_dof_handler_renumbered; const unsigned int degree; std::vector> boundary_indices, diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index d091c9b272..7035cba0b4 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -257,7 +257,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, @@ -358,7 +358,7 @@ LaplaceProblem::assemble_multigrid(const bool &use_mw) { mg_matrices = 0.; - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients | update_hessians; diff --git a/tests/multigrid/step-16-03.cc b/tests/multigrid/step-16-03.cc index add8ad999d..8f8ac391b4 100644 --- a/tests/multigrid/step-16-03.cc +++ b/tests/multigrid/step-16-03.cc @@ -176,7 +176,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-04.cc b/tests/multigrid/step-16-04.cc index 02cc1de2d2..9a9eec0069 100644 --- a/tests/multigrid/step-16-04.cc +++ b/tests/multigrid/step-16-04.cc @@ -180,7 +180,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-05.cc b/tests/multigrid/step-16-05.cc index 8c21075ff7..eadb8d1679 100644 --- a/tests/multigrid/step-16-05.cc +++ b/tests/multigrid/step-16-05.cc @@ -180,7 +180,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-06.cc b/tests/multigrid/step-16-06.cc index f3b8290eff..360a662960 100644 --- a/tests/multigrid/step-16-06.cc +++ b/tests/multigrid/step-16-06.cc @@ -180,7 +180,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-07.cc b/tests/multigrid/step-16-07.cc index 766aa29ee4..43b966d7af 100644 --- a/tests/multigrid/step-16-07.cc +++ b/tests/multigrid/step-16-07.cc @@ -182,7 +182,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-08.cc b/tests/multigrid/step-16-08.cc index 52f68cfbfb..04da0ce19f 100644 --- a/tests/multigrid/step-16-08.cc +++ b/tests/multigrid/step-16-08.cc @@ -184,7 +184,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-50-serial.cc b/tests/multigrid/step-16-50-serial.cc index e8aaf929e4..07f73318c1 100644 --- a/tests/multigrid/step-16-50-serial.cc +++ b/tests/multigrid/step-16-50-serial.cc @@ -180,7 +180,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-16-bdry1.cc b/tests/multigrid/step-16-bdry1.cc index e6bb79763a..d8681b30b1 100644 --- a/tests/multigrid/step-16-bdry1.cc +++ b/tests/multigrid/step-16-bdry1.cc @@ -258,7 +258,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, @@ -364,7 +364,7 @@ LaplaceProblem::assemble_multigrid(bool use_mw) mg_interface_in = 0.; mg_interface_out = 0.; - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients | update_hessians; diff --git a/tests/multigrid/step-16.cc b/tests/multigrid/step-16.cc index 19475fbb41..96f506813d 100644 --- a/tests/multigrid/step-16.cc +++ b/tests/multigrid/step-16.cc @@ -182,7 +182,7 @@ LaplaceProblem::setup_system() std::map *> dirichlet_boundary; Functions::ZeroFunction homogeneous_dirichlet_bc(1); dirichlet_boundary[0] = &homogeneous_dirichlet_bc; - MappingQGeneric mapping(1); + MappingQ mapping(1); VectorTools::interpolate_boundary_values(mapping, mg_dof_handler, dirichlet_boundary, diff --git a/tests/multigrid/step-39-02.cc b/tests/multigrid/step-39-02.cc index 39e09129e2..493da72316 100644 --- a/tests/multigrid/step-39-02.cc +++ b/tests/multigrid/step-39-02.cc @@ -411,10 +411,10 @@ namespace Step39 void output_results(const unsigned int cycle) const; - Triangulation triangulation; - const MappingQGeneric mapping; - const FiniteElement & fe; - DoFHandler dof_handler; + Triangulation triangulation; + const MappingQ mapping; + const FiniteElement &fe; + DoFHandler dof_handler; SparsityPattern sparsity; SparseMatrix matrix; diff --git a/tests/multigrid/step-39-02a.cc b/tests/multigrid/step-39-02a.cc index b780aa2cba..d420214a95 100644 --- a/tests/multigrid/step-39-02a.cc +++ b/tests/multigrid/step-39-02a.cc @@ -413,11 +413,11 @@ namespace Step39 void output_results(const unsigned int cycle) const; - Triangulation triangulation; - const MappingQGeneric mapping; - const FiniteElement & fe; - DoFHandler dof_handler; - MGConstrainedDoFs mg_constraints; + Triangulation triangulation; + const MappingQ mapping; + const FiniteElement &fe; + DoFHandler dof_handler; + MGConstrainedDoFs mg_constraints; SparsityPattern sparsity; SparseMatrix matrix; diff --git a/tests/multigrid/step-39-03.cc b/tests/multigrid/step-39-03.cc index 22acb0cd73..825e93104f 100644 --- a/tests/multigrid/step-39-03.cc +++ b/tests/multigrid/step-39-03.cc @@ -417,10 +417,10 @@ namespace Step39 void output_results(const unsigned int cycle) const; - Triangulation triangulation; - const MappingQGeneric mapping; - const FiniteElement & fe; - DoFHandler dof_handler; + Triangulation triangulation; + const MappingQ mapping; + const FiniteElement &fe; + DoFHandler dof_handler; SparsityPattern sparsity; SparseMatrix matrix; diff --git a/tests/multigrid/step-39.cc b/tests/multigrid/step-39.cc index aebc0d93b1..da2ebc8908 100644 --- a/tests/multigrid/step-39.cc +++ b/tests/multigrid/step-39.cc @@ -412,10 +412,10 @@ namespace Step39 void output_results(const unsigned int cycle) const; - Triangulation triangulation; - const MappingQGeneric mapping; - const FiniteElement & fe; - DoFHandler dof_handler; + Triangulation triangulation; + const MappingQ mapping; + const FiniteElement &fe; + DoFHandler dof_handler; SparsityPattern sparsity; SparseMatrix matrix; diff --git a/tests/numerics/derivative_approximation_02.cc b/tests/numerics/derivative_approximation_02.cc index 2b72a7867c..6b64552ac9 100644 --- a/tests/numerics/derivative_approximation_02.cc +++ b/tests/numerics/derivative_approximation_02.cc @@ -151,12 +151,12 @@ derivatives() Triangulation tria; GridGenerator::hyper_cube(tria); tria.refine_global(5 - dim); - FE_DGQ fe(2); - DoFHandler dof_handler(tria); - Vector solution; - MappingQGeneric mapping(1); - QMidpoint q_midpoint; - FEValues fe_values(mapping, fe, q_midpoint, update_quadrature_points); + FE_DGQ fe(2); + DoFHandler dof_handler(tria); + Vector solution; + MappingQ mapping(1); + QMidpoint q_midpoint; + FEValues fe_values(mapping, fe, q_midpoint, update_quadrature_points); dof_handler.distribute_dofs(fe); solution.reinit(dof_handler.n_dofs()); diff --git a/tests/numerics/derivatives.cc b/tests/numerics/derivatives.cc index 6a6aeeeb7f..0cc960bd2e 100644 --- a/tests/numerics/derivatives.cc +++ b/tests/numerics/derivatives.cc @@ -190,7 +190,7 @@ loop() std::vector *> maps; // maps.push_back (new MappingCartesian); - maps.push_back(new MappingQGeneric(1)); + maps.push_back(new MappingQ(1)); maps.push_back(new MappingQ(2)); std::vector *> elements; diff --git a/tests/numerics/interpolate_to_different_mesh_01.cc b/tests/numerics/interpolate_to_different_mesh_01.cc index dcd819820f..332f6783c5 100644 --- a/tests/numerics/interpolate_to_different_mesh_01.cc +++ b/tests/numerics/interpolate_to_different_mesh_01.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -51,7 +51,7 @@ template void check(const unsigned int refinement_1, const unsigned int refinement_2) { - MappingQGeneric mapping(1); + MappingQ mapping(1); Triangulation tria_1, tria_2; GridGenerator::hyper_cube(tria_1); diff --git a/tests/numerics/interpolate_to_different_mesh_02.cc b/tests/numerics/interpolate_to_different_mesh_02.cc index 5f945e5d31..bcc2859296 100644 --- a/tests/numerics/interpolate_to_different_mesh_02.cc +++ b/tests/numerics/interpolate_to_different_mesh_02.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -53,7 +53,7 @@ template void check(const unsigned int refinement_1, const unsigned int refinement_2) { - MappingQGeneric mapping(1); + MappingQ mapping(1); Triangulation tria_1, tria_2; GridGenerator::hyper_cube(tria_1); diff --git a/tests/numerics/interpolate_to_different_mesh_03.cc b/tests/numerics/interpolate_to_different_mesh_03.cc index 6ce3e2e65b..d7c88c7205 100644 --- a/tests/numerics/interpolate_to_different_mesh_03.cc +++ b/tests/numerics/interpolate_to_different_mesh_03.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -41,7 +41,7 @@ template void check(const unsigned int refinement_1, const unsigned int refinement_2) { - MappingQGeneric mapping(1); + MappingQ mapping(1); Triangulation tria_1, tria_2; GridGenerator::hyper_cube(tria_1); diff --git a/tests/numerics/interpolate_to_different_mesh_04.cc b/tests/numerics/interpolate_to_different_mesh_04.cc index 2b9ac17036..8df1c116fe 100644 --- a/tests/numerics/interpolate_to_different_mesh_04.cc +++ b/tests/numerics/interpolate_to_different_mesh_04.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -43,7 +43,7 @@ template void check(const unsigned int refinement_1, const unsigned int refinement_2) { - MappingQGeneric mapping(1); + MappingQ mapping(1); Triangulation tria_1, tria_2; GridGenerator::hyper_cube(tria_1); diff --git a/tests/numerics/project_01_curved_boundary.cc b/tests/numerics/project_01_curved_boundary.cc index 437198c182..befb0ed1f4 100644 --- a/tests/numerics/project_01_curved_boundary.cc +++ b/tests/numerics/project_01_curved_boundary.cc @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -97,8 +96,7 @@ test() // use an explicit Q1 mapping. this will yield a zero solution { - VectorTools::project( - MappingQGeneric(1), dh, cm, QGauss(3), F(), v); + VectorTools::project(MappingQ(1), dh, cm, QGauss(3), F(), v); deallog << v.l2_norm() << std::endl; Assert(v.l2_norm() == 0, ExcInternalError()); } diff --git a/tests/numerics/project_boundary_rt_01.cc b/tests/numerics/project_boundary_rt_01.cc index 05126e1bab..e639e62327 100644 --- a/tests/numerics/project_boundary_rt_01.cc +++ b/tests/numerics/project_boundary_rt_01.cc @@ -144,8 +144,8 @@ test_projection(const Triangulation &tr, const FiniteElement &fe) DoFHandler dof(tr); dof.distribute_dofs(fe); - QGauss quadrature(degree + 2); - MappingQGeneric mapping(1); + QGauss quadrature(degree + 2); + MappingQ mapping(1); TestFunction f(degree - 1); std::map boundary_constraints; diff --git a/tests/numerics/project_parallel_qp_common.h b/tests/numerics/project_parallel_qp_common.h index fb7e0093c1..e72308bb3e 100644 --- a/tests/numerics/project_parallel_qp_common.h +++ b/tests/numerics/project_parallel_qp_common.h @@ -156,7 +156,7 @@ do_project(const parallel::distributed::Triangulation &triangulation, VectorType field(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD); VectorTools::project( - MappingQGeneric(1), + MappingQ(1), dof_handler, constraints, quadrature_formula, diff --git a/tests/opencascade/normal_to_mesh_projection_03.cc b/tests/opencascade/normal_to_mesh_projection_03.cc index 6a5f96c02a..47eed86e2e 100644 --- a/tests/opencascade/normal_to_mesh_projection_03.cc +++ b/tests/opencascade/normal_to_mesh_projection_03.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -79,7 +79,7 @@ main() FE_Q<2, 3> fe(2); DoFHandler<2, 3> dh(tria); dh.distribute_dofs(fe); - MappingQGeneric<2, 3> mapping2(2); + MappingQ<2, 3> mapping2(2); std::vector> spoints(dh.n_dofs()); DoFTools::map_dofs_to_support_points(mapping2, dh, spoints); diff --git a/tests/opencascade/normal_to_mesh_projection_04.cc b/tests/opencascade/normal_to_mesh_projection_04.cc index 9f303abfd7..b8100e95e5 100644 --- a/tests/opencascade/normal_to_mesh_projection_04.cc +++ b/tests/opencascade/normal_to_mesh_projection_04.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tests/particles/generators_03.cc b/tests/particles/generators_03.cc index f61a4d2a91..2a595865f9 100644 --- a/tests/particles/generators_03.cc +++ b/tests/particles/generators_03.cc @@ -43,7 +43,7 @@ test() GridGenerator::hyper_shell(tr, Point(), 0.5, 1.0); - MappingQGeneric mapping(4); + MappingQ mapping(4); Particles::ParticleHandler particle_handler(tr, mapping); diff --git a/tests/particles/local_particle_index.cc b/tests/particles/local_particle_index.cc index a45df3cd21..8535f5541d 100644 --- a/tests/particles/local_particle_index.cc +++ b/tests/particles/local_particle_index.cc @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -50,7 +50,7 @@ test() GridGenerator::hyper_cube(background_triangulation, 0, 1); background_triangulation.refine_global(6 - dim); - const MappingQGeneric mapping(1); + const MappingQ mapping(1); Particles::ParticleHandler particle_handler; particle_handler.initialize(background_triangulation, mapping, 1); diff --git a/tests/remote_point_evaluation/remote_point_evaluation_01.cc b/tests/remote_point_evaluation/remote_point_evaluation_01.cc index 528f16322d..b27967cf6d 100644 --- a/tests/remote_point_evaluation/remote_point_evaluation_01.cc +++ b/tests/remote_point_evaluation/remote_point_evaluation_01.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -436,8 +436,7 @@ test() Vector euler_vector(dof_handler_dim.n_dofs()); VectorTools::get_position_vector(dof_handler_dim, euler_vector, - MappingQGeneric( - mapping_degree)); + MappingQ(mapping_degree)); MappingFEField mapping(dof_handler_dim, euler_vector); diff --git a/tests/remote_point_evaluation/remote_point_evaluation_02.cc b/tests/remote_point_evaluation/remote_point_evaluation_02.cc index 50f4049cad..8bd1be938a 100644 --- a/tests/remote_point_evaluation/remote_point_evaluation_02.cc +++ b/tests/remote_point_evaluation/remote_point_evaluation_02.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -366,8 +366,7 @@ test() Vector euler_vector(dof_handler_dim.n_dofs()); VectorTools::get_position_vector(dof_handler_dim, euler_vector, - MappingQGeneric( - mapping_degree)); + MappingQ(mapping_degree)); MappingFEField mapping(dof_handler_dim, euler_vector); diff --git a/tests/remote_point_evaluation/remote_point_evaluation_03.cc b/tests/remote_point_evaluation/remote_point_evaluation_03.cc index bfacec3499..726449f1ab 100644 --- a/tests/remote_point_evaluation/remote_point_evaluation_03.cc +++ b/tests/remote_point_evaluation/remote_point_evaluation_03.cc @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -362,8 +362,7 @@ test(const MPI_Comm comm) Vector euler_vector(dof_handler_dim.n_dofs()); VectorTools::get_position_vector(dof_handler_dim, euler_vector, - MappingQGeneric( - mapping_degree)); + MappingQ(mapping_degree)); MappingFEField mapping(dof_handler_dim, euler_vector); diff --git a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_01.cc b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_01.cc index b1ce1f6556..71a48ea124 100644 --- a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_01.cc +++ b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_01.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_02.cc b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_02.cc index a6a5f7ae4f..6a610129ef 100644 --- a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_02.cc +++ b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_02.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -294,18 +294,18 @@ test() const unsigned int n_refinements_1 = 4; const unsigned int n_refinements_2 = 4; - const MappingQGeneric mapping_1(1); - const FE_Q fe_1(2); - const QGauss quad_1(3); + const MappingQ mapping_1(1); + const FE_Q fe_1(2); + const QGauss quad_1(3); #if false const MappingFE mapping_2(Simplex::FE_P(1)); const Simplex::FE_P fe_2(2); const Simplex::QGauss quad_2(3); #else - const MappingQGeneric mapping_2(1); - const FE_Q fe_2(2); - const QGauss quad_2(3); + const MappingQ mapping_2(1); + const FE_Q fe_2(2); + const QGauss quad_2(3); #endif parallel::distributed::Triangulation tria_1(MPI_COMM_WORLD); diff --git a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_03.cc b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_03.cc index c1cc3f82aa..2bf4c47d72 100644 --- a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_03.cc +++ b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_03.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include diff --git a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_04.cc b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_04.cc index c30f0ec9bc..50cd624619 100644 --- a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_04.cc +++ b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_04.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_05.cc b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_05.cc index 808f485c34..62fcaf2a28 100644 --- a/tests/remote_point_evaluation/vector_tools_evaluate_at_points_05.cc +++ b/tests/remote_point_evaluation/vector_tools_evaluate_at_points_05.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff --git a/tests/simplex/data_out_write_vtk_02.cc b/tests/simplex/data_out_write_vtk_02.cc index 0094b9c7b6..efc597ad62 100644 --- a/tests/simplex/data_out_write_vtk_02.cc +++ b/tests/simplex/data_out_write_vtk_02.cc @@ -72,9 +72,9 @@ test(const FiniteElement &fe_0, hp::QCollection quadrature(QGaussSimplex(degree + 1), QGauss(degree + 1)); - hp::MappingCollection mapping( - MappingFE(FE_SimplexP(1)), - MappingQGeneric(1)); + hp::MappingCollection mapping(MappingFE( + FE_SimplexP(1)), + MappingQ(1)); Triangulation tria; GridGenerator::subdivided_hyper_cube_with_simplices_mix(tria, diff --git a/tests/simplex/matrix_free_range_iteration_01.cc b/tests/simplex/matrix_free_range_iteration_01.cc index 115179c52a..1638180e5d 100644 --- a/tests/simplex/matrix_free_range_iteration_01.cc +++ b/tests/simplex/matrix_free_range_iteration_01.cc @@ -47,7 +47,7 @@ test() GridGenerator::subdivided_hyper_cube(tria, 4); hp::FECollection fe{FE_Q<2>(degree), FE_Q<2>(degree)}; - MappingQGeneric mapping(1); + MappingQ mapping(1); QGauss quadrature(degree + 1); DoFHandler dof_handler(tria); diff --git a/tests/simplex/step-12b.cc b/tests/simplex/step-12b.cc index ccc00ba976..6110f0df9a 100644 --- a/tests/simplex/step-12b.cc +++ b/tests/simplex/step-12b.cc @@ -1015,10 +1015,9 @@ main() { ScratchData<2> scratch_data; - scratch_data.mapping = - hp::MappingCollection<2>(MappingQGeneric<2>(1)); - scratch_data.fe = hp::FECollection<2>(FE_DGQ<2>(i)); - scratch_data.quadrature = hp::QCollection<2>(QGauss<2>(i + 1)); + scratch_data.mapping = hp::MappingCollection<2>(MappingQ<2>(1)); + scratch_data.fe = hp::FECollection<2>(FE_DGQ<2>(i)); + scratch_data.quadrature = hp::QCollection<2>(QGauss<2>(i + 1)); scratch_data.face_quadrature = std::vector>{ hp::QCollection<1>(QGauss<1>(i + 1))}; scratch_data.mesh_generator = @@ -1106,10 +1105,9 @@ main() { ScratchData<3> scratch_data; - scratch_data.mapping = - hp::MappingCollection<3>(MappingQGeneric<3>(1)); - scratch_data.fe = hp::FECollection<3>(FE_DGQ<3>(i)); - scratch_data.quadrature = hp::QCollection<3>(QGauss<3>(i + 1)); + scratch_data.mapping = hp::MappingCollection<3>(MappingQ<3>(1)); + scratch_data.fe = hp::FECollection<3>(FE_DGQ<3>(i)); + scratch_data.quadrature = hp::QCollection<3>(QGauss<3>(i + 1)); scratch_data.face_quadrature = std::vector>{ hp::QCollection<2>(QGauss<2>(i + 1))}; scratch_data.mesh_generator = diff --git a/tests/simplex/step-12c.cc b/tests/simplex/step-12c.cc index 49b5b6150f..4a8ba815d0 100644 --- a/tests/simplex/step-12c.cc +++ b/tests/simplex/step-12c.cc @@ -1015,10 +1015,9 @@ main() { ScratchData<2> scratch_data; - scratch_data.mapping = - hp::MappingCollection<2>(MappingQGeneric<2>(1)); - scratch_data.fe = hp::FECollection<2>(FE_DGQ<2>(i)); - scratch_data.quadrature = hp::QCollection<2>(QGauss<2>(i + 1)); + scratch_data.mapping = hp::MappingCollection<2>(MappingQ<2>(1)); + scratch_data.fe = hp::FECollection<2>(FE_DGQ<2>(i)); + scratch_data.quadrature = hp::QCollection<2>(QGauss<2>(i + 1)); scratch_data.face_quadrature = std::vector>{ hp::QCollection<1>(QGauss<1>(i + 1))}; scratch_data.mesh_generator = @@ -1106,10 +1105,9 @@ main() { ScratchData<3> scratch_data; - scratch_data.mapping = - hp::MappingCollection<3>(MappingQGeneric<3>(1)); - scratch_data.fe = hp::FECollection<3>(FE_DGQ<3>(i)); - scratch_data.quadrature = hp::QCollection<3>(QGauss<3>(i + 1)); + scratch_data.mapping = hp::MappingCollection<3>(MappingQ<3>(1)); + scratch_data.fe = hp::FECollection<3>(FE_DGQ<3>(i)); + scratch_data.quadrature = hp::QCollection<3>(QGauss<3>(i + 1)); scratch_data.face_quadrature = std::vector>{ hp::QCollection<2>(QGauss<2>(i + 1))}; scratch_data.mesh_generator = diff --git a/tests/simplex/step-17.cc b/tests/simplex/step-17.cc index fe0e208ce2..52531733a0 100644 --- a/tests/simplex/step-17.cc +++ b/tests/simplex/step-17.cc @@ -110,7 +110,7 @@ namespace Step17 const unsigned int this_mpi_process; #ifdef HEX - MappingQGeneric mapping; + MappingQ mapping; #else MappingFE mapping; #endif diff --git a/tests/simplex/step-18.cc b/tests/simplex/step-18.cc index 518a640192..269024ec61 100644 --- a/tests/simplex/step-18.cc +++ b/tests/simplex/step-18.cc @@ -241,7 +241,7 @@ namespace Step18 const Quadrature quadrature_formula; #ifdef HEX - MappingQGeneric mapping; + MappingQ mapping; #else MappingFE mapping; #endif diff --git a/tests/simplex/step-23.cc b/tests/simplex/step-23.cc index 0c706f037b..7102155424 100644 --- a/tests/simplex/step-23.cc +++ b/tests/simplex/step-23.cc @@ -88,9 +88,9 @@ namespace Step23 Triangulation triangulation; #ifdef HEX - MappingQGeneric mapping; - FE_Q fe; - QGauss quadrature; + MappingQ mapping; + FE_Q fe; + QGauss quadrature; #else MappingFE mapping; FE_SimplexP fe; diff --git a/tests/simplex/step-40.cc b/tests/simplex/step-40.cc index 7a670fbe41..b040723a55 100644 --- a/tests/simplex/step-40.cc +++ b/tests/simplex/step-40.cc @@ -119,7 +119,7 @@ namespace Step40 MPI_Comm mpi_communicator; #ifdef HEX - MappingQGeneric mapping; + MappingQ mapping; parallel::distributed::Triangulation triangulation; FE_Q fe; #else diff --git a/tests/simplex/step-67.cc b/tests/simplex/step-67.cc index 912b01b910..87cecd642b 100644 --- a/tests/simplex/step-67.cc +++ b/tests/simplex/step-67.cc @@ -1909,7 +1909,7 @@ namespace Euler_DG #endif #ifdef HEX - MappingQGeneric mapping; + MappingQ mapping; #else MappingFE mapping; #endif diff --git a/tests/trilinos/precondition_amg_dgp_01.cc b/tests/trilinos/precondition_amg_dgp_01.cc index 1c3de3bf81..f4a198eaf0 100644 --- a/tests/trilinos/precondition_amg_dgp_01.cc +++ b/tests/trilinos/precondition_amg_dgp_01.cc @@ -166,7 +166,7 @@ Step4::setup_system() solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags_all(update_flags); diff --git a/tests/trilinos/precondition_amg_dgp_03.cc b/tests/trilinos/precondition_amg_dgp_03.cc index 38beda26f9..c32bfd4572 100644 --- a/tests/trilinos/precondition_amg_dgp_03.cc +++ b/tests/trilinos/precondition_amg_dgp_03.cc @@ -169,7 +169,7 @@ Step4::setup_system() solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags_all(update_flags); diff --git a/tests/trilinos/precondition_muelu_dgp.cc b/tests/trilinos/precondition_muelu_dgp.cc index 6bc6c334aa..f80ec27a5d 100644 --- a/tests/trilinos/precondition_muelu_dgp.cc +++ b/tests/trilinos/precondition_muelu_dgp.cc @@ -166,7 +166,7 @@ Step4::setup_system() solution.reinit(dof_handler.n_dofs()); system_rhs.reinit(dof_handler.n_dofs()); - MappingQGeneric mapping(1); + MappingQ mapping(1); MeshWorker::IntegrationInfoBox info_box; UpdateFlags update_flags = update_values | update_gradients; info_box.add_update_flags_all(update_flags); diff --git a/tests/vector_tools/get_position_vector_01.cc b/tests/vector_tools/get_position_vector_01.cc index 3cf4b15551..30f31f3963 100644 --- a/tests/vector_tools/get_position_vector_01.cc +++ b/tests/vector_tools/get_position_vector_01.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ test() // set up base high-order mapping Vector euler_vector_base(dof_handler_dim.n_dofs()); - VectorTools::get_position_vector(MappingQGeneric(4), + VectorTools::get_position_vector(MappingQ(4), dof_handler_dim, euler_vector_base); MappingFEField mapping_base(dof_handler_dim, @@ -62,7 +62,7 @@ test() // clear manifold tria.reset_all_manifolds(); - // output mesh with with MappingQGeneric(degree=4) + // output mesh with with MappingQ(degree=4) { DataOutBase::VtkFlags flags; @@ -71,7 +71,7 @@ test() data_out.attach_dof_handler(dof_handler); data_out.build_patches( - MappingQGeneric(4), + MappingQ(4), fe_degree + 1, DataOut::CurvedCellRegion::curved_inner_cells); diff --git a/tests/vector_tools/interpolate_with_material_id_01.cc b/tests/vector_tools/interpolate_with_material_id_01.cc index dc9ee8cf37..4149e71227 100644 --- a/tests/vector_tools/interpolate_with_material_id_01.cc +++ b/tests/vector_tools/interpolate_with_material_id_01.cc @@ -144,7 +144,7 @@ namespace PhaseField const Functions::ConstantFunction constant_function_1(1.0); function_map[1] = &constant_function_1; - VectorTools::interpolate_based_on_material_id(MappingQGeneric(1), + VectorTools::interpolate_based_on_material_id(MappingQ(1), dof_handler, function_map, dst);