void *cell_accessor_ptr,
void *point_ptr)
{
- const MappingQGeneric<dim, spacedim> *mapping =
- static_cast<const MappingQGeneric<dim, spacedim> *>(mapping_ptr);
+ const MappingQ<dim, spacedim> *mapping =
+ static_cast<const MappingQ<dim, spacedim> *>(mapping_ptr);
const CellAccessor<dim, spacedim> *cell_accessor =
static_cast<const CellAccessor<dim, spacedim> *>(cell_accessor_ptr);
void *cell_accessor_ptr,
void *point_ptr)
{
- const MappingQGeneric<dim, spacedim> *mapping =
- static_cast<const MappingQGeneric<dim, spacedim> *>(mapping_ptr);
+ const MappingQ<dim, spacedim> *mapping =
+ static_cast<const MappingQ<dim, spacedim> *>(mapping_ptr);
const CellAccessor<dim, spacedim> *cell_accessor =
static_cast<const CellAccessor<dim, spacedim> *>(cell_accessor_ptr);
const unsigned int face_no,
void * point_ptr)
{
- const MappingQGeneric<dim, spacedim> *mapping =
- static_cast<const MappingQGeneric<dim, spacedim> *>(mapping_ptr);
+ const MappingQ<dim, spacedim> *mapping =
+ static_cast<const MappingQ<dim, spacedim> *>(mapping_ptr);
const CellAccessor<dim, spacedim> *cell_accessor =
static_cast<const CellAccessor<dim, spacedim> *>(cell_accessor_ptr);
{
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."));
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."));
{
// We cannot call delete on a void pointer so cast the void pointer
// back first.
- MappingQGeneric<2, 2> *tmp =
- static_cast<MappingQGeneric<2, 2> *>(mapping_ptr);
+ MappingQ<2, 2> *tmp = static_cast<MappingQ<2, 2> *>(mapping_ptr);
delete tmp;
}
else if ((dim == 2) && (spacedim == 3))
{
- MappingQGeneric<2, 3> *tmp =
- static_cast<MappingQGeneric<2, 3> *>(mapping_ptr);
+ MappingQ<2, 3> *tmp = static_cast<MappingQ<2, 3> *>(mapping_ptr);
delete tmp;
}
else
{
- MappingQGeneric<3, 3> *tmp =
- static_cast<MappingQGeneric<3, 3> *>(mapping_ptr);
+ MappingQ<3, 3> *tmp = static_cast<MappingQ<3, 3> *>(mapping_ptr);
delete tmp;
}
if (mapping_wrapper.get_mapping() != nullptr)
{
- const MappingQGeneric<dim, spacedim> *mapping =
- static_cast<const MappingQGeneric<dim, spacedim> *>(
+ const MappingQ<dim, spacedim> *mapping =
+ static_cast<const MappingQ<dim, spacedim> *>(
mapping_wrapper.get_mapping());
auto cell_pair =
const Quadrature<dim> *quad = static_cast<const Quadrature<dim> *>(
quadrature_wrapper.get_quadrature());
- const MappingQGeneric<dim, spacedim> *mapping =
- static_cast<const MappingQGeneric<dim, spacedim> *>(
+ const MappingQ<dim, spacedim> *mapping =
+ static_cast<const MappingQ<dim, spacedim> *>(
mapping_wrapper.get_mapping());
auto aspect_ratios =
void output_results() const;
Triangulation<dim> triangulation;
- MappingQGeneric<dim> mapping;
+ MappingQ<dim> mapping;
FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
AffineConstraints<double> constraints;
- 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
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<dim> mapping(3);
+ MappingQ<dim> mapping(3);
grid_out.write_gnuplot(triangulation, output, &mapping);
}
@endcode
std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot");
GridOutFlags::Gnuplot gnuplot_flags(false, 5);
grid_out.set_flags(gnuplot_flags);
- MappingQGeneric<dim> mapping(3);
+ MappingQ<dim> mapping(3);
grid_out.write_gnuplot(triangulation, output, &mapping);
}
const DoFHandler<dim> & dof_handler,
const AffineConstraints<double> &constraints)
{
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
typename CUDAWrappers::MatrixFree<dim, double>::AdditionalData
additional_data;
additional_data.mapping_update_flags = update_values | update_gradients |
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
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
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.
[ 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
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
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
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_tools.h>
// 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
{
std::cout << std::endl
- << "====== Running with the basic MappingQGeneric class ====== "
+ << "====== Running with the basic MappingQ class ====== "
<< std::endl
<< std::endl;
- MappingQGeneric<dim> mapping(fe.degree + 1);
+ MappingQ<dim> mapping(fe.degree + 1);
setup_system(mapping);
assemble_system(mapping);
solve();
// 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
MappingQCache<dim> mapping(fe.degree + 1);
{
TimerOutput::Scope scope(timer, "Initialize mapping cache");
- mapping.initialize(MappingQGeneric<dim>(fe.degree + 1), triangulation);
+ mapping.initialize(MappingQ<dim>(fe.degree + 1), triangulation);
}
std::cout << " Memory consumption cache: "
<< 1e-6 * mapping.memory_consumption() << " MB" << std::endl;
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.
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
// 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
- // <code>use_mapping_q_on_all_cells</code> flags in the contructor call to
- // <code>true</code>. 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<dim> triangulation;
- const MappingQGeneric<dim> mapping;
+ const MappingQ<dim> mapping;
// As usual we then define the Lagrangian finite elements FE_Q and a
Triangulation<dim> triangulation;
#endif
- FESystem<dim> fe;
- MappingQGeneric<dim> mapping;
- DoFHandler<dim> dof_handler;
+ FESystem<dim> fe;
+ MappingQ<dim> mapping;
+ DoFHandler<dim> dof_handler;
TimerOutput timer;
Triangulation<dim> triangulation;
#endif
- FESystem<dim> fe;
- MappingQGeneric<dim> mapping;
- DoFHandler<dim> dof_handler;
+ FESystem<dim> fe;
+ MappingQ<dim> mapping;
+ DoFHandler<dim> dof_handler;
TimerOutput timer;
system_rhs = 0;
- MappingQGeneric<dim> mapping(1);
- QGauss<dim> quadrature_formula(fe.degree + 1);
- QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
- FEValues<dim> fe_values(mapping,
+ MappingQ<dim> mapping(1);
+ QGauss<dim> quadrature_formula(fe.degree + 1);
+ QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
+ FEValues<dim> fe_values(mapping,
fe,
quadrature_formula,
update_values | update_gradients |
update_quadrature_points | update_JxW_values);
- FEFaceValues<dim> fe_face_values(mapping,
+ FEFaceValues<dim> fe_face_values(mapping,
fe,
face_quadrature_formula,
update_values | update_quadrature_points |
BlockVector<double> test_rhs;
test_rhs.reinit(system_rhs);
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
const QGauss<dim> quadrature_formula(fe.degree + 1);
const QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(mapping,
// Start with computing the objective function:
double objective_function_merit = 0;
{
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
const QGauss<dim> quadrature_formula(fe.degree + 1);
const QGauss<dim - 1> face_quadrature_formula(fe.degree + 1);
FEValues<dim> fe_values(mapping,
/**
* 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<dim, spacedim> &fe,
const Quadrature<dim> & quadrature,
/**
* 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<dim, spacedim> &fe,
const Quadrature<dim - 1> & quadrature,
/**
* 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<dim, spacedim> &fe,
const Quadrature<dim - 1> & face_quadrature,
* 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;
* 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<double>::infinity() as the first entry.
/**
* 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 <int dim, int spacedim = dim>
-class MappingC1 : public MappingQGeneric<dim, spacedim>
+class MappingC1 : public MappingQ<dim, spacedim>
{
public:
/**
* 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
// ---------------------------------------------------------------------
//
-// 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.
//
#include <deal.II/base/config.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/base/derivative_form.h>
+#include <deal.II/base/polynomial.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/table.h>
+#include <deal.II/base/vectorization.h>
+
+#include <deal.II/fe/mapping.h>
+
+#include <deal.II/grid/tria_iterator.h>
+
+#include <deal.II/matrix_free/shape_info.h>
+#include <deal.II/matrix_free/tensor_product_kernels.h>
+
+#include <array>
+#include <cmath>
DEAL_II_NAMESPACE_OPEN
+template <int, int>
+class MappingQ;
+
+template <int, int>
+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.
+ *
+ * <h4>Behavior along curved boundaries and with different manifolds</h4>
+ *
+ * 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 <int dim, int spacedim = dim>
-class MappingQ : public MappingQGeneric<dim, spacedim>
+class MappingQ : public Mapping<dim, spacedim>
{
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);
* Copy constructor.
*/
MappingQ(const MappingQ<dim, spacedim> &mapping);
+
+ // for documentation, see the Mapping base class
+ virtual std::unique_ptr<Mapping<dim, spacedim>>
+ 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<spacedim>
+ get_bounding_box(const typename Triangulation<dim, spacedim>::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<spacedim>
+ transform_unit_to_real_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Point<dim> &p) const override;
+
+ // for documentation, see the Mapping base class
+ virtual Point<dim>
+ transform_real_to_unit_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Point<spacedim> &p) const override;
+
+ // for documentation, see the Mapping base class
+ virtual void
+ transform_points_real_to_unit_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const ArrayView<const Point<spacedim>> & real_points,
+ const ArrayView<Point<dim>> &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<const Tensor<1, dim>> & input,
+ const MappingKind kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<1, spacedim>> &output) const override;
+
+ // for documentation, see the Mapping base class
+ virtual void
+ transform(const ArrayView<const DerivativeForm<1, dim, spacedim>> &input,
+ const MappingKind kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2, spacedim>> &output) const override;
+
+ // for documentation, see the Mapping base class
+ virtual void
+ transform(const ArrayView<const Tensor<2, dim>> & input,
+ const MappingKind kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2, spacedim>> &output) const override;
+
+ // for documentation, see the Mapping base class
+ virtual void
+ transform(const ArrayView<const DerivativeForm<2, dim, spacedim>> &input,
+ const MappingKind kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3, spacedim>> &output) const override;
+
+ // for documentation, see the Mapping base class
+ virtual void
+ transform(const ArrayView<const Tensor<3, dim>> & input,
+ const MappingKind kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3, spacedim>> &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<dim, spacedim>::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<dim> &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<dim> &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<Point<dim>> &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<double> shape_values;
+
+ /**
+ * Values of shape function derivatives. Access by function @p derivative.
+ *
+ * Computed once.
+ */
+ AlignedVector<Tensor<1, dim>> shape_derivatives;
+
+ /**
+ * Values of shape function second derivatives. Access by function @p
+ * second_derivative.
+ *
+ * Computed once.
+ */
+ AlignedVector<Tensor<2, dim>> shape_second_derivatives;
+
+ /**
+ * Values of shape function third derivatives. Access by function @p
+ * second_derivative.
+ *
+ * Computed once.
+ */
+ AlignedVector<Tensor<3, dim>> shape_third_derivatives;
+
+ /**
+ * Values of shape function fourth derivatives. Access by function @p
+ * second_derivative.
+ *
+ * Computed once.
+ */
+ AlignedVector<Tensor<4, dim>> 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<std::vector<Tensor<1, dim>>,
+ GeometryInfo<dim>::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<VectorizedArray<double>>
+ shape_info;
+
+ /**
+ * In case the quadrature rule given represents a tensor product
+ * we need to store temporary data in this object.
+ */
+ mutable AlignedVector<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<DerivativeForm<1, dim, spacedim>> 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<DerivativeForm<1, dim, spacedim>> contravariant;
+
+ /**
+ * Auxiliary vectors for internal use.
+ */
+ mutable std::vector<AlignedVector<Tensor<1, spacedim>>> aux;
+
+ /**
+ * Stores the support points of the mapping shape functions on the @p
+ * cell_of_current_support_points.
+ */
+ mutable std::vector<Point<spacedim>> mapping_support_points;
+
+ /**
+ * Stores the cell of which the @p mapping_support_points are stored.
+ */
+ mutable typename Triangulation<dim, spacedim>::cell_iterator
+ cell_of_current_support_points;
+
+ /**
+ * The determinant of the Jacobian in each quadrature point. Filled if
+ * #update_volume_elements.
+ */
+ mutable AlignedVector<double> 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<typename Mapping<dim, spacedim>::InternalDataBase>
+ get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
+
+ using Mapping<dim, spacedim>::get_face_data;
+
+ // documentation can be found in Mapping::get_face_data()
+ virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
+ get_face_data(const UpdateFlags flags,
+ const hp::QCollection<dim - 1> &quadrature) const override;
+
+ // documentation can be found in Mapping::get_subface_data()
+ virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
+ get_subface_data(const UpdateFlags flags,
+ const Quadrature<dim - 1> &quadrature) const override;
+
+ // documentation can be found in Mapping::fill_fe_values()
+ virtual CellSimilarity::Similarity
+ fill_fe_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const CellSimilarity::Similarity cell_similarity,
+ const Quadrature<dim> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const override;
+
+ using Mapping<dim, spacedim>::fill_fe_face_values;
+
+ // documentation can be found in Mapping::fill_fe_face_values()
+ virtual void
+ fill_fe_face_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const hp::QCollection<dim - 1> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const override;
+
+ // documentation can be found in Mapping::fill_fe_subface_values()
+ virtual void
+ fill_fe_subface_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const Quadrature<dim - 1> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &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<dim, spacedim>::cell_iterator &cell,
+ const ArrayView<const Point<dim>> & unit_points,
+ const UpdateFlags update_flags,
+ dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &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<dim,spacedim> 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<Point<1>> 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::Polynomial<double>> 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<unsigned int> 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<dim>(this->degree).
+ */
+ const std::vector<Point<dim>> 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, <code>4 + 4*(degree-1)</code> for
+ * a quad, <code>8 + 12*(degree-1) + 6*(degree-1)*(degree-1)</code> 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<Table<2, double>>
+ 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., <code>(degree+1)^dim - 2^dim</code>.
+ */
+ 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<spacedim, it asks the underlying manifold for
+ * the locations of interior points.
+ */
+ virtual std::vector<Point<spacedim>>
+ compute_mapping_support_points(
+ const typename Triangulation<dim, spacedim>::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<dim>
+ transform_real_to_unit_cell_internal(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Point<spacedim> & p,
+ const Point<dim> &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<dim, spacedim>::cell_iterator &cell,
+ std::vector<Point<spacedim>> & 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 <tt>dim=3</tt>. 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<dim, spacedim>::cell_iterator &cell,
+ std::vector<Point<spacedim>> & a) const;
+
+ // Make MappingQCache a friend since it needs to call the
+ // compute_mapping_support_points() function.
+ template <int, int>
+ 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 <int dim, int spacedim = dim>
+using MappingQGeneric = MappingQ<dim, spacedim>;
+
/*@}*/
+
+/*----------------------------------------------------------------------*/
+
+#ifndef DOXYGEN
+
+template <int dim, int spacedim>
+inline const double &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline double &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline const Tensor<1, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline Tensor<1, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline const Tensor<2, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline Tensor<2, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline const Tensor<3, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline Tensor<3, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline const Tensor<4, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline Tensor<4, dim> &
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+inline bool
+MappingQ<dim, spacedim>::preserves_vertex_locations() const
+{
+ return true;
+}
+
+#endif // DOXYGEN
+
+/* -------------- declaration of explicit specializations ------------- */
+
+
DEAL_II_NAMESPACE_CLOSE
#endif
#include <deal.II/base/config.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <cmath>
* 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
* 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 <int dim, int spacedim = dim>
-class MappingQ1 : public MappingQGeneric<dim, spacedim>
+class MappingQ1 : public MappingQ<dim, spacedim>
{
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
* The static $Q_1$ mapping object discussed in the documentation of this
* class.
*/
- static MappingQGeneric<dim, spacedim> mapping;
+ static MappingQ<dim, spacedim> mapping;
};
* the documentation of FiniteElement or the one of Triangulation.
*/
template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
-class MappingQ1Eulerian : public MappingQGeneric<dim, spacedim>
+class MappingQ1Eulerian : public MappingQ<dim, spacedim>
{
public:
/**
/**
* 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<Point<spacedim>>
#include <deal.II/base/function.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/tria.h>
/**
* 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 <int dim, int spacedim = dim>
-class MappingQCache : public MappingQGeneric<dim, spacedim>
+class MappingQCache : public MappingQ<dim, spacedim>
{
public:
/**
* @deprecated Use initialize() version above instead.
*/
DEAL_II_DEPRECATED void
- initialize(const Triangulation<dim, spacedim> & triangulation,
- const MappingQGeneric<dim, spacedim> &mapping);
+ initialize(const Triangulation<dim, spacedim> &triangulation,
+ const MappingQ<dim, spacedim> & mapping);
/**
* Initialize the data cache by letting the function given as an argument
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<Point<spacedim>>
compute_mapping_support_points(
* of the vector can be specified as template parameter <tt>VectorType</tt>.
*/
template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
-class MappingQEulerian : public MappingQGeneric<dim, spacedim>
+class MappingQEulerian : public MappingQ<dim, spacedim>
{
public:
/**
// ---------------------------------------------------------------------
//
-// 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.
//
#include <deal.II/base/config.h>
-#include <deal.II/base/derivative_form.h>
-#include <deal.II/base/polynomial.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/table.h>
-#include <deal.II/base/vectorization.h>
+#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping.h>
-
-#include <deal.II/grid/tria_iterator.h>
-
-#include <deal.II/matrix_free/shape_info.h>
-#include <deal.II/matrix_free/tensor_product_kernels.h>
-
-#include <array>
-#include <cmath>
-
-DEAL_II_NAMESPACE_OPEN
-
-template <int, int>
-class MappingQ;
-
-template <int, int>
-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$ <i>on cells at the boundary of the domain</i>). 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 <i>happen</i> 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.
- *
- * <h4>Behavior along curved boundaries and with different manifolds</h4>
- *
- * 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 <int dim, int spacedim = dim>
-class MappingQGeneric : public Mapping<dim, spacedim>
-{
-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<dim, spacedim> &mapping);
-
- // for documentation, see the Mapping base class
- virtual std::unique_ptr<Mapping<dim, spacedim>>
- 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<spacedim>
- get_bounding_box(const typename Triangulation<dim, spacedim>::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<spacedim>
- transform_unit_to_real_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const Point<dim> &p) const override;
-
- // for documentation, see the Mapping base class
- virtual Point<dim>
- transform_real_to_unit_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const Point<spacedim> &p) const override;
-
- // for documentation, see the Mapping base class
- virtual void
- transform_points_real_to_unit_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const ArrayView<const Point<spacedim>> & real_points,
- const ArrayView<Point<dim>> &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<const Tensor<1, dim>> & input,
- const MappingKind kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &internal,
- const ArrayView<Tensor<1, spacedim>> &output) const override;
-
- // for documentation, see the Mapping base class
- virtual void
- transform(const ArrayView<const DerivativeForm<1, dim, spacedim>> &input,
- const MappingKind kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &internal,
- const ArrayView<Tensor<2, spacedim>> &output) const override;
-
- // for documentation, see the Mapping base class
- virtual void
- transform(const ArrayView<const Tensor<2, dim>> & input,
- const MappingKind kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &internal,
- const ArrayView<Tensor<2, spacedim>> &output) const override;
-
- // for documentation, see the Mapping base class
- virtual void
- transform(const ArrayView<const DerivativeForm<2, dim, spacedim>> &input,
- const MappingKind kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &internal,
- const ArrayView<Tensor<3, spacedim>> &output) const override;
-
- // for documentation, see the Mapping base class
- virtual void
- transform(const ArrayView<const Tensor<3, dim>> & input,
- const MappingKind kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &internal,
- const ArrayView<Tensor<3, spacedim>> &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<dim, spacedim>::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<dim> &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<dim> &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<Point<dim>> &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<double> shape_values;
-
- /**
- * Values of shape function derivatives. Access by function @p derivative.
- *
- * Computed once.
- */
- AlignedVector<Tensor<1, dim>> shape_derivatives;
-
- /**
- * Values of shape function second derivatives. Access by function @p
- * second_derivative.
- *
- * Computed once.
- */
- AlignedVector<Tensor<2, dim>> shape_second_derivatives;
-
- /**
- * Values of shape function third derivatives. Access by function @p
- * second_derivative.
- *
- * Computed once.
- */
- AlignedVector<Tensor<3, dim>> shape_third_derivatives;
-
- /**
- * Values of shape function fourth derivatives. Access by function @p
- * second_derivative.
- *
- * Computed once.
- */
- AlignedVector<Tensor<4, dim>> 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<std::vector<Tensor<1, dim>>,
- GeometryInfo<dim>::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<VectorizedArray<double>>
- shape_info;
-
- /**
- * In case the quadrature rule given represents a tensor product
- * we need to store temporary data in this object.
- */
- mutable AlignedVector<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<VectorizedArray<double>> 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<DerivativeForm<1, dim, spacedim>> 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<DerivativeForm<1, dim, spacedim>> contravariant;
-
- /**
- * Auxiliary vectors for internal use.
- */
- mutable std::vector<AlignedVector<Tensor<1, spacedim>>> aux;
-
- /**
- * Stores the support points of the mapping shape functions on the @p
- * cell_of_current_support_points.
- */
- mutable std::vector<Point<spacedim>> mapping_support_points;
-
- /**
- * Stores the cell of which the @p mapping_support_points are stored.
- */
- mutable typename Triangulation<dim, spacedim>::cell_iterator
- cell_of_current_support_points;
-
- /**
- * The determinant of the Jacobian in each quadrature point. Filled if
- * #update_volume_elements.
- */
- mutable AlignedVector<double> 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<typename Mapping<dim, spacedim>::InternalDataBase>
- get_data(const UpdateFlags, const Quadrature<dim> &quadrature) const override;
-
- using Mapping<dim, spacedim>::get_face_data;
-
- // documentation can be found in Mapping::get_face_data()
- virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
- get_face_data(const UpdateFlags flags,
- const hp::QCollection<dim - 1> &quadrature) const override;
-
- // documentation can be found in Mapping::get_subface_data()
- virtual std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
- get_subface_data(const UpdateFlags flags,
- const Quadrature<dim - 1> &quadrature) const override;
-
- // documentation can be found in Mapping::fill_fe_values()
- virtual CellSimilarity::Similarity
- fill_fe_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const CellSimilarity::Similarity cell_similarity,
- const Quadrature<dim> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &output_data) const override;
-
- using Mapping<dim, spacedim>::fill_fe_face_values;
-
- // documentation can be found in Mapping::fill_fe_face_values()
- virtual void
- fill_fe_face_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const hp::QCollection<dim - 1> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &output_data) const override;
-
- // documentation can be found in Mapping::fill_fe_subface_values()
- virtual void
- fill_fe_subface_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const Quadrature<dim - 1> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &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<dim, spacedim>::cell_iterator &cell,
- const ArrayView<const Point<dim>> & unit_points,
- const UpdateFlags update_flags,
- dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &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<dim,spacedim> 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<Point<1>> 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::Polynomial<double>> 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<unsigned int> 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<dim>(this->degree).
- */
- const std::vector<Point<dim>> 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, <code>4 + 4*(degree-1)</code> for
- * a quad, <code>8 + 12*(degree-1) + 6*(degree-1)*(degree-1)</code> 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<Table<2, double>>
- 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., <code>(degree+1)^dim - 2^dim</code>.
- */
- 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<spacedim, it asks the underlying manifold for
- * the locations of interior points.
- */
- virtual std::vector<Point<spacedim>>
- compute_mapping_support_points(
- const typename Triangulation<dim, spacedim>::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<dim>
- transform_real_to_unit_cell_internal(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const Point<spacedim> & p,
- const Point<dim> &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<dim, spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim>> & 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 <tt>dim=3</tt>. 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<dim, spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim>> & a) const;
-
- // Make MappingQ a friend since it needs to call the fill_fe_values()
- // functions on its MappingQGeneric(1) sub-object.
- template <int, int>
- friend class MappingQ;
-
- // Make MappingQCache a friend since it needs to call the
- // compute_mapping_support_points() function.
- template <int, int>
- friend class MappingQCache;
-};
-
-
-
-/*@}*/
-
-/*----------------------------------------------------------------------*/
-
-#ifndef DOXYGEN
-
-template <int dim, int spacedim>
-inline const double &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline double &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline const Tensor<1, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline Tensor<1, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline const Tensor<2, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline Tensor<2, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline const Tensor<3, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline Tensor<3, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline const Tensor<4, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline Tensor<4, dim> &
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-inline bool
-MappingQGeneric<dim, spacedim>::preserves_vertex_locations() const
-{
- return true;
-}
-
-#endif // DOXYGEN
-
-/* -------------- declaration of explicit specializations ------------- */
-
-
-DEAL_II_NAMESPACE_CLOSE
#endif
#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/fe_update_flags.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_tools.h>
/**
- * 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
template <int dim, int spacedim>
inline Point<spacedim>
compute_mapped_location_of_point(
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data)
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data)
{
AssertDimension(data.shape_values.size(),
data.mapping_support_points.size());
do_transform_real_to_unit_cell_internal_codim1(
const typename dealii::Triangulation<dim, dim + 1>::cell_iterator &cell,
const Point<dim + 1> & p,
- const Point<dim> &initial_p_unit,
- typename dealii::MappingQGeneric<dim, dim + 1>::InternalData &mdata)
+ const Point<dim> & initial_p_unit,
+ typename dealii::MappingQ<dim, dim + 1>::InternalData &mdata)
{
const unsigned int spacedim = dim + 1;
* 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
*
* @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
inline void
maybe_update_q_points_Jacobians_and_grads_tensor(
const CellSimilarity::Similarity cell_similarity,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<Point<spacedim>> & quadrature_points,
std::vector<DerivativeForm<2, dim, spacedim>> &jacobian_grads)
{
template <int dim, int spacedim>
inline void
maybe_compute_q_points(
- const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename QProjector<dim>::DataSetDescriptor data_set,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<Point<spacedim>> &quadrature_points)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_Jacobians(
const CellSimilarity::Similarity cell_similarity,
const typename dealii::QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data)
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_grads(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<DerivativeForm<2, dim, spacedim>> &jacobian_grads)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_pushed_forward_grads(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<Tensor<3, spacedim>> &jacobian_pushed_forward_grads)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_2nd_derivatives(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<DerivativeForm<3, dim, spacedim>> &jacobian_2nd_derivatives)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_pushed_forward_2nd_derivatives(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<Tensor<4, spacedim>> &jacobian_pushed_forward_2nd_derivatives)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_3rd_derivatives(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<DerivativeForm<4, dim, spacedim>> &jacobian_3rd_derivatives)
{
const UpdateFlags update_flags = data.update_each;
maybe_update_jacobian_pushed_forward_3rd_derivatives(
const CellSimilarity::Similarity cell_similarity,
const typename QProjector<dim>::DataSetDescriptor data_set,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
std::vector<Tensor<5, spacedim>> &jacobian_pushed_forward_3rd_derivatives)
{
const UpdateFlags update_flags = data.update_each;
template <int dim, int spacedim>
inline void
maybe_compute_face_data(
- const dealii::MappingQGeneric<dim, spacedim> &mapping,
+ const dealii::MappingQ<dim, spacedim> &mapping,
const typename dealii::Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const unsigned int n_q_points,
- const std::vector<double> &weights,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const unsigned int n_q_points,
+ const std::vector<double> & weights,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
&output_data)
{
/**
- * 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 <int dim, int spacedim>
inline void
do_fill_fe_face_values(
- const dealii::MappingQGeneric<dim, spacedim> &mapping,
+ const dealii::MappingQ<dim, spacedim> &mapping,
const typename dealii::Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const typename QProjector<dim>::DataSetDescriptor data_set,
- const Quadrature<dim - 1> & quadrature,
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData &data,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const typename QProjector<dim>::DataSetDescriptor data_set,
+ const Quadrature<dim - 1> & quadrature,
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data,
internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
&output_data)
{
/**
- * Implementation of MappingQGeneric::transform() for generic tensors.
+ * Implementation of MappingQ::transform() for generic tensors.
*/
template <int dim, int spacedim, int rank>
inline void
const ArrayView<Tensor<rank, spacedim>> & output)
{
AssertDimension(input.size(), output.size());
- Assert((dynamic_cast<const typename dealii::
- MappingQGeneric<dim, spacedim>::InternalData *>(
+ Assert((dynamic_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData *>(
&mapping_data) != nullptr),
ExcInternalError());
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData
- &data =
- static_cast<const typename dealii::MappingQGeneric<dim, spacedim>::
- InternalData &>(mapping_data);
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data =
+ static_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &>(
+ mapping_data);
switch (mapping_kind)
{
/**
- * Implementation of MappingQGeneric::transform() for gradients.
+ * Implementation of MappingQ::transform() for gradients.
*/
template <int dim, int spacedim, int rank>
inline void
const ArrayView<Tensor<rank, spacedim>> & output)
{
AssertDimension(input.size(), output.size());
- Assert((dynamic_cast<const typename dealii::
- MappingQGeneric<dim, spacedim>::InternalData *>(
+ Assert((dynamic_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData *>(
&mapping_data) != nullptr),
ExcInternalError());
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData
- &data =
- static_cast<const typename dealii::MappingQGeneric<dim, spacedim>::
- InternalData &>(mapping_data);
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data =
+ static_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &>(
+ mapping_data);
switch (mapping_kind)
{
/**
- * Implementation of MappingQGeneric::transform() for hessians.
+ * Implementation of MappingQ::transform() for hessians.
*/
template <int dim, int spacedim>
inline void
const ArrayView<Tensor<3, spacedim>> & output)
{
AssertDimension(input.size(), output.size());
- Assert((dynamic_cast<const typename dealii::
- MappingQGeneric<dim, spacedim>::InternalData *>(
+ Assert((dynamic_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData *>(
&mapping_data) != nullptr),
ExcInternalError());
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData
- &data =
- static_cast<const typename dealii::MappingQGeneric<dim, spacedim>::
- InternalData &>(mapping_data);
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data =
+ static_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &>(
+ mapping_data);
switch (mapping_kind)
{
/**
- * Implementation of MappingQGeneric::transform() for DerivativeForm
+ * Implementation of MappingQ::transform() for DerivativeForm
* arguments.
*/
template <int dim, int spacedim, int rank>
const ArrayView<Tensor<rank + 1, spacedim>> & output)
{
AssertDimension(input.size(), output.size());
- Assert((dynamic_cast<const typename dealii::
- MappingQGeneric<dim, spacedim>::InternalData *>(
+ Assert((dynamic_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData *>(
&mapping_data) != nullptr),
ExcInternalError());
- const typename dealii::MappingQGeneric<dim, spacedim>::InternalData
- &data =
- static_cast<const typename dealii::MappingQGeneric<dim, spacedim>::
- InternalData &>(mapping_data);
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &data =
+ static_cast<
+ const typename dealii::MappingQ<dim, spacedim>::InternalData &>(
+ mapping_data);
switch (mapping_kind)
{
Assert(false, ExcNotImplemented());
}
}
- } // namespace MappingQGenericImplementation
+ } // namespace MappingQImplementation
} // namespace internal
DEAL_II_NAMESPACE_CLOSE
* to visualize GNUPLOT output)
*
* @code
- * #include <deal.II/fe/mapping_q_generic.h>
+ * #include <deal.II/fe/mapping_q.h>
*
* #include <deal.II/grid/grid_generator.h>
* #include <deal.II/grid/grid_out.h>
* 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);
* }
* 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.
* 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
// forward declaration
namespace internal
{
- namespace MappingQGenericImplementation
+ namespace MappingQImplementation
{
template <int, int>
class InverseQuadraticApproximation;
* nature of the manifold that is originally contained in one <i>coarse</i>
* mesh layer will be applied to more than one <i>fine</i> 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.
* A vector of quadratic approximations to the inverse map from real points
* to chart points for each of the coarse mesh cells.
*/
- std::vector<internal::MappingQGenericImplementation::
+ std::vector<internal::MappingQImplementation::
InverseQuadraticApproximation<dim, spacedim>>
quadratic_approximation;
/**
* 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
/**
* 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<dim, FEValuesType::space_dimension> &fe_collection,
/**
* 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<dim, spacedim> &fe_collection,
const QCollection<dim> & q_collection,
/**
* 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<dim, spacedim> &fe_collection,
const hp::QCollection<dim - 1> & q_collection,
/**
* 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<dim, spacedim> &fe_collection,
const hp::QCollection<dim - 1> & q_collection,
* 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
/**
* 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<dim> &fe,
const Quadrature<1> & quadrature,
#include <deal.II/base/vectorization.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/matrix_free/evaluation_flags.h>
#include <deal.II/matrix_free/shape_info.h>
* 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`.
SmartPointer<const Mapping<dim, spacedim>> 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<dim, spacedim> *mapping_q_generic;
+ const MappingQ<dim, spacedim> *mapping_q;
/**
* Pointer to the FiniteElement object passed to the constructor.
const UpdateFlags update_flags,
const unsigned int first_selected_component)
: mapping(&mapping)
- , mapping_q_generic(
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping))
+ , mapping_q(dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
, fe(&fe)
, update_flags(update_flags)
, update_flags_mapping(update_default)
}
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)
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<FEValues<dim, spacedim>>(
{
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];
/**
* 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);
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/matrix_free/evaluation_template_factory.h>
#include <deal.II/matrix_free/mapping_info.h>
}
// 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<const MappingQGeneric<dim> *>(&mapping->operator[](0)))
+ dynamic_cast<const MappingQ<dim> *>(&mapping->operator[](0)))
compute_mapping_q(tria, cells, face_info.faces);
else
{
this->mapping = &mapping->operator[](0);
if (active_fe_index.empty() && !cells.empty() && mapping->size() == 1 &&
- dynamic_cast<const MappingQGeneric<dim> *>(&mapping->operator[](0)))
+ dynamic_cast<const MappingQ<dim> *>(&mapping->operator[](0)))
compute_mapping_q(tria, cells, face_info.faces);
else
{
mapping_q_query_fe_values(
const unsigned int begin_cell,
const unsigned int end_cell,
- const MappingQGeneric<dim> & mapping_q,
+ const MappingQ<dim> & mapping_q,
const dealii::Triangulation<dim> & tria,
const std::vector<std::pair<unsigned int, unsigned int>> &cell_array,
const double jacobian_size,
const std::vector<FaceToCellTopology<VectorizedArrayType::size()>> &faces)
{
// step 1: extract quadrature point data with the data appropriate for
- // MappingQGeneric
+ // MappingQ
AssertDimension(this->mapping_collection->size(), 1);
- const MappingQGeneric<dim> *mapping_q =
- dynamic_cast<const MappingQGeneric<dim> *>(
- &this->mapping_collection->operator[](0));
+ const MappingQ<dim> *mapping_q = dynamic_cast<const MappingQ<dim> *>(
+ &this->mapping_collection->operator[](0));
Assert(mapping_q != nullptr, ExcInternalError());
const unsigned int mapping_degree = mapping_q->get_degree();
const unsigned int component = 0);
/**
- * Call the function above with <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * Call the function above with <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, class InputVector, int spacedim>
void
const unsigned int component = 0);
/**
- * Call the function above with <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * Call the function above with <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, class InputVector, int spacedim>
void
const unsigned int component = 0);
/**
- * Same as above, with <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * Same as above, with <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim, class InputVector, int order>
void
/**
* Call the @p estimate function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <typename InputVector>
static void
/**
* Call the @p estimate function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <typename InputVector>
static void
/**
* Call the @p estimate function, see above, with
- * <tt>mapping=MappingQGeneric1<1>()</tt>.
+ * <tt>mapping=MappingQ1<1>()</tt>.
*/
template <typename InputVector>
static void
/**
* Call the @p estimate function, see above, with
- * <tt>mapping=MappingQGeneric1<1>()</tt>.
+ * <tt>mapping=MappingQ1<1>()</tt>.
*/
template <typename InputVector>
static void
* 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
* <b>with</b> mapping argument should be used.
*
/**
* Call the create_mass_matrix() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim, typename number>
void
/**
* Call the create_mass_matrix() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim, typename number>
void
/**
* Call the create_boundary_mass_matrix() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim, typename number>
void
/**
* Call the create_laplace_matrix() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim>
void
/**
* Call the create_laplace_matrix() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim>
void
* @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
* <b>with</b> mapping argument should be used.
*
/**
* Call the other interpolate_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>. The same comments
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>. 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.
*
/**
* Call the other interpolate_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>. The same comments
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>. 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.
*/
/**
* Call the other interpolate_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>. The same comments
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>. 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.
*
/**
* Call the other interpolate_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>. The same comments
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>. 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.
*
/**
* Call the project_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>.
*/
template <int dim, int spacedim, typename number>
void
/**
* Call the project_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>.
*/
template <int dim, int spacedim, typename number>
void
/**
* Call the project_boundary_values() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>.
*
* @ingroup constraints
*/
* </p>
*
* 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
/**
* Call the integrate_difference() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, class InVector, class OutVector, int spacedim>
void
/**
* Call the integrate_difference() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, class InVector, class OutVector, int spacedim>
void
/**
* Call the @p interpolate() function above with
- * <tt>mapping=MappingQGeneric@<dim,spacedim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim,spacedim@>(1)</tt>.
*/
template <int dim, int spacedim, typename VectorType>
void
/**
* Call the other compute_mean_value() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, typename VectorType, int spacedim>
typename VectorType::value_type
/**
* Call the project() function above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, typename VectorType, int spacedim>
void
/**
* Call the create_right_hand_side() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*/
template <int dim, int spacedim, typename VectorType>
void
/**
* Call the create_boundary_right_hand_side() function, see above, with
- * <tt>mapping=MappingQGeneric@<dim@>(1)</tt>.
+ * <tt>mapping=MappingQ@<dim@>(1)</tt>.
*
* @see
* @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
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
SET(_separate_src
fe_values.cc
- fe_values_extractors.cc
fe_values_inst2.cc
fe_values_inst3.cc
fe_values_inst4.cc
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
)
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
template <int dim, int spacedim>
MappingC1<dim, spacedim>::MappingC1()
- : MappingQGeneric<dim, spacedim>(3)
+ : MappingQ<dim, spacedim>(3)
{
Assert(dim > 1, ExcImpossibleInDim(dim));
}
// ---------------------------------------------------------------------
//
-// 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.
//
//
// ---------------------------------------------------------------------
+
#include <deal.II/base/array_view.h>
+#include <deal.II/base/derivative_form.h>
#include <deal.II/base/memory_consumption.h>
-#include <deal.II/base/polynomial.h>
+#include <deal.II/base/qprojector.h>
#include <deal.II/base/quadrature.h>
#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/base/table.h>
#include <deal.II/base/tensor_product_polynomials.h>
-#include <deal.II/base/utilities.h>
-
-#include <deal.II/dofs/dof_accessor.h>
-#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_q.h>
+#include <deal.II/fe/mapping_q1.h>
+#include <deal.II/fe/mapping_q_internal.h>
+#include <deal.II/grid/manifold_lib.h>
+#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/lac/full_matrix.h>
+DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
+#include <boost/container/small_vector.hpp>
+DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
+#include <algorithm>
+#include <array>
+#include <cmath>
#include <memory>
#include <numeric>
+
DEAL_II_NAMESPACE_OPEN
template <int dim, int spacedim>
-MappingQ<dim, spacedim>::MappingQ(const unsigned int degree)
- : MappingQGeneric<dim, spacedim>(degree)
+MappingQ<dim, spacedim>::InternalData::InternalData(
+ const unsigned int polynomial_degree)
+ : polynomial_degree(polynomial_degree)
+ , n_shape_functions(Utilities::fixed_power<dim>(polynomial_degree + 1))
+ , line_support_points(QGaussLobatto<1>(polynomial_degree + 1))
+ , tensor_product_quadrature(false)
{}
template <int dim, int spacedim>
-MappingQ<dim, spacedim>::MappingQ(const unsigned int degree, const bool)
- : MappingQGeneric<dim, spacedim>(degree)
-{}
+std::size_t
+MappingQ<dim, spacedim>::InternalData::memory_consumption() const
+{
+ return (
+ Mapping<dim, spacedim>::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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::InternalData::initialize(
+ const UpdateFlags update_flags,
+ const Quadrature<dim> &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<Quadrature<1>, 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<Point<1>> &points_1 =
+ quad_array[i - 1].get_points();
+ const std::vector<Point<1>> &points_2 =
+ quad_array[i].get_points();
+ const std::vector<double> &weights_1 =
+ quad_array[i - 1].get_weights();
+ const std::vector<double> &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<dim> 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<dim>(
+ 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::InternalData::initialize_face(
+ const UpdateFlags update_flags,
+ const Quadrature<dim> &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<facedim>(
+ 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<Tensor<1, spacedim>>(n_original_q_points));
+
+ // Compute tangentials to the unit cell.
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
+ {
+ unit_tangentials[i].resize(n_original_q_points);
+ std::fill(unit_tangentials[i].begin(),
+ unit_tangentials[i].end(),
+ GeometryInfo<dim>::unit_tangential_vectors[i][0]);
+ if (dim > 2)
+ {
+ unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
+ .resize(n_original_q_points);
+ std::fill(
+ unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
+ .begin(),
+ unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
+ .end(),
+ GeometryInfo<dim>::unit_tangential_vectors[i][1]);
+ }
+ }
+ }
+ }
+}
+
+
+
+template <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::InternalData::compute_shape_function_values(
+ const std::vector<Point<dim>> &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<dim> 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<unsigned int> renumber =
+ FETools::hierarchic_to_lexicographic_numbering<dim>(polynomial_degree);
+
+ std::vector<double> values;
+ std::vector<Tensor<1, dim>> 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<Tensor<2, dim>> 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<Tensor<3, dim>> 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<Tensor<4, dim>> 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 <int dim, int spacedim>
+MappingQ<dim, spacedim>::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<dim>(p))
+ , unit_cell_support_points(
+ internal::MappingQImplementation::unit_support_points<dim>(
+ 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<dim>(
+ 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 <int dim, int spacedim>
+MappingQ<dim, spacedim>::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<dim>(p))
+ , unit_cell_support_points(
+ internal::MappingQImplementation::unit_support_points<dim>(
+ 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<dim>(
+ 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 <int dim, int spacedim>
MappingQ<dim, spacedim>::MappingQ(const MappingQ<dim, spacedim> &mapping)
- : MappingQGeneric<dim, spacedim>(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 <int dim, int spacedim>
+std::unique_ptr<Mapping<dim, spacedim>>
+MappingQ<dim, spacedim>::clone() const
+{
+ return std::make_unique<MappingQ<dim, spacedim>>(*this);
+}
+
+
+
+template <int dim, int spacedim>
+unsigned int
+MappingQ<dim, spacedim>::get_degree() const
+{
+ return polynomial_degree;
+}
+
+
+
+template <int dim, int spacedim>
+Point<spacedim>
+MappingQ<dim, spacedim>::transform_unit_to_real_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Point<dim> & p) const
+{
+ return Point<spacedim>(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 <int dim, int spacedim>
+Point<dim>
+MappingQ<dim, spacedim>::transform_real_to_unit_cell_internal(
+ const typename Triangulation<dim, spacedim>::cell_iterator &,
+ const Point<spacedim> &,
+ const Point<dim> &) 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<dim> 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<InternalData>(
+ 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<dim> 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<InternalData>(
+ 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 <int dim, int spacedim>
+Point<dim>
+MappingQ<dim, spacedim>::transform_real_to_unit_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const Point<spacedim> & 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<Point<spacedim>, GeometryInfo<dim>::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<dim> 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<spacedim, spacedim>::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<dim> 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<dim> p_unit =
+ this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit);
+ if (p_unit[0] == std::numeric_limits<double>::infinity())
+ AssertThrow(false,
+ (typename Mapping<dim, spacedim>::ExcTransformationFailed()));
+ return p_unit;
+}
+
+
+
+template <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform_points_real_to_unit_cell(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const ArrayView<const Point<spacedim>> & real_points,
+ const ArrayView<Point<dim>> & unit_points) const
+{
+ // Go to base class functions for dim < spacedim because it is not yet
+ // implemented with optimized code.
+ if (dim < spacedim)
+ {
+ Mapping<dim, spacedim>::transform_points_real_to_unit_cell(cell,
+ real_points,
+ unit_points);
+ return;
+ }
+
+ AssertDimension(real_points.size(), unit_points.size());
+ const std::vector<Point<spacedim>> 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<dim, spacedim>
+ inverse_approximation(support_points, unit_cell_support_points);
+
+ const unsigned int n_points = real_points.size();
+ const unsigned int n_lanes = VectorizedArray<double>::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<spacedim, VectorizedArray<double>> 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<dim, VectorizedArray<double>> unit_point =
+ internal::MappingQImplementation::
+ do_transform_real_to_unit_cell_internal<dim, spacedim>(
+ 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<double>::infinity())
+ unit_points[i + j] = internal::MappingQImplementation::
+ do_transform_real_to_unit_cell_internal<dim, spacedim>(
+ 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<dim, spacedim>(
+ real_points[i],
+ inverse_approximation.compute(real_points[i]),
+ support_points,
+ polynomials_1d,
+ renumber_lexicographic_to_hierarchic);
+}
+
+
+
+template <int dim, int spacedim>
+UpdateFlags
+MappingQ<dim, spacedim>::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 <int dim, int spacedim>
+std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
+MappingQ<dim, spacedim>::get_data(const UpdateFlags update_flags,
+ const Quadrature<dim> &q) const
+{
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize(this->requires_update_flags(update_flags), q, q.size());
+
+ return data_ptr;
+}
+
+
+
+template <int dim, int spacedim>
+std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
+MappingQ<dim, spacedim>::get_face_data(
+ const UpdateFlags update_flags,
+ const hp::QCollection<dim - 1> &quadrature) const
+{
+ AssertDimension(quadrature.size(), 1);
+
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_faces(
+ ReferenceCells::get_hypercube<dim>(), quadrature[0]),
+ quadrature[0].size());
+
+ return data_ptr;
+}
+
+
+
+template <int dim, int spacedim>
+std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
+MappingQ<dim, spacedim>::get_subface_data(
+ const UpdateFlags update_flags,
+ const Quadrature<dim - 1> &quadrature) const
+{
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_subfaces(
+ ReferenceCells::get_hypercube<dim>(), quadrature),
+ quadrature.size());
+
+ return data_ptr;
+}
+
+
+
+template <int dim, int spacedim>
+CellSimilarity::Similarity
+MappingQ<dim, spacedim>::fill_fe_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const CellSimilarity::Similarity cell_similarity,
+ const Quadrature<dim> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const
+{
+ // ensure that the following static_cast is really correct:
+ Assert(dynamic_cast<const InternalData *>(&internal_data) != nullptr,
+ ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &>(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<dim, spacedim>(
+ computed_cell_similarity,
+ data,
+ output_data.quadrature_points,
+ output_data.jacobian_grads);
+ }
+ else
+ {
+ internal::MappingQImplementation::maybe_compute_q_points<dim, spacedim>(
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.quadrature_points);
+
+ internal::MappingQImplementation::maybe_update_Jacobians<dim, spacedim>(
+ computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data);
+
+ internal::MappingQImplementation::maybe_update_jacobian_grads<dim,
+ spacedim>(
+ computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_grads);
+ }
+
+ internal::MappingQImplementation::maybe_update_jacobian_pushed_forward_grads<
+ dim,
+ spacedim>(computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_pushed_forward_grads);
+
+ internal::MappingQImplementation::maybe_update_jacobian_2nd_derivatives<
+ dim,
+ spacedim>(computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_2nd_derivatives);
+
+ internal::MappingQImplementation::
+ maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
+ computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_pushed_forward_2nd_derivatives);
+
+ internal::MappingQImplementation::maybe_update_jacobian_3rd_derivatives<
+ dim,
+ spacedim>(computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_3rd_derivatives);
+
+ internal::MappingQImplementation::
+ maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
+ computed_cell_similarity,
+ QProjector<dim>::DataSetDescriptor::cell(),
+ data,
+ output_data.jacobian_pushed_forward_3rd_derivatives);
+
+ const UpdateFlags update_flags = data.update_each;
+ const std::vector<double> &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<dim>(
+ cell->diameter() / std::sqrt(double(dim))),
+ (typename Mapping<dim, spacedim>::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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::fill_fe_face_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const hp::QCollection<dim - 1> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const
+{
+ AssertDimension(quadrature.size(), 1);
+
+ // ensure that the following cast is really correct:
+ Assert((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
+ ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &>(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<dim>::DataSetDescriptor::face(
+ ReferenceCells::get_hypercube<dim>(),
+ 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::fill_fe_subface_values(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const Quadrature<dim - 1> & quadrature,
+ const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
+ internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const
+{
+ // ensure that the following cast is really correct:
+ Assert((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
+ ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &>(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<dim>::DataSetDescriptor::subface(
+ ReferenceCells::get_hypercube<dim>(),
+ 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::fill_mapping_data_for_generic_points(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const ArrayView<const Point<dim>> & unit_points,
+ const UpdateFlags update_flags,
+ dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &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<Point<spacedim>> support_points =
+ this->compute_mapping_support_points(cell);
+
+ const unsigned int n_points = unit_points.size();
+ const unsigned int n_lanes = VectorizedArray<double>::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<dim, VectorizedArray<double>> 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<double>> jac(
+ result.second);
+ const DerivativeForm<1, spacedim, dim, VectorizedArray<double>>
+ 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform(
+ const ArrayView<const Tensor<1, dim>> & input,
+ const MappingKind mapping_kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<1, spacedim>> & output) const
+{
+ internal::MappingQImplementation::transform_fields(input,
+ mapping_kind,
+ mapping_data,
+ output);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform(
+ const ArrayView<const DerivativeForm<1, dim, spacedim>> &input,
+ const MappingKind mapping_kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2, spacedim>> & output) const
+{
+ internal::MappingQImplementation::transform_differential_forms(input,
+ mapping_kind,
+ mapping_data,
+ output);
+}
+
+
+
+template <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform(
+ const ArrayView<const Tensor<2, dim>> & input,
+ const MappingKind mapping_kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2, spacedim>> & 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform(
+ const ArrayView<const DerivativeForm<2, dim, spacedim>> &input,
+ const MappingKind mapping_kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3, spacedim>> & output) const
+{
+ AssertDimension(input.size(), output.size());
+ Assert(dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
+ ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &>(mapping_data);
+
+ switch (mapping_kind)
+ {
+ case mapping_covariant_gradient:
+ {
+ Assert(data.update_each & update_contravariant_transformation,
+ typename FEValuesBase<dim>::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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::transform(
+ const ArrayView<const Tensor<3, dim>> & input,
+ const MappingKind mapping_kind,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3, spacedim>> & 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::add_line_support_points(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ std::vector<Point<spacedim>> & 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<dim>::lines_per_cell;
+ ++line_no)
+ {
+ const typename Triangulation<dim, spacedim>::line_iterator line =
+ (dim == 1 ?
+ static_cast<
+ typename Triangulation<dim, spacedim>::line_iterator>(cell) :
+ cell->line(line_no));
+
+ const Manifold<dim, spacedim> &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<Point<spacedim>> tmp_points;
+ for (unsigned int line_no = 0;
+ line_no < GeometryInfo<dim>::lines_per_cell;
+ ++line_no)
+ {
+ const typename Triangulation<dim, spacedim>::line_iterator line =
+ (dim == 1 ?
+ static_cast<
+ typename Triangulation<dim, spacedim>::line_iterator>(cell) :
+ cell->line(line_no));
+
+ const Manifold<dim, spacedim> &manifold =
+ ((line->manifold_id() == numbers::flat_manifold_id) &&
+ (dim < spacedim) ?
+ cell->get_manifold() :
+ line->get_manifold());
+
+ const std::array<Point<spacedim>, 2> vertices{
+ {cell->vertex(GeometryInfo<dim>::line_to_cell_vertices(line_no, 0)),
+ cell->vertex(
+ GeometryInfo<dim>::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<Point<3>> & 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<Point<3>> 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<Point<3>, 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<Point<3>> & a) const
+{
+ std::array<Point<3>, 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 <int dim, int spacedim>
+void
+MappingQ<dim, spacedim>::add_quad_support_points(
+ const typename Triangulation<dim, spacedim>::cell_iterator &,
+ std::vector<Point<spacedim>> &) const
+{
+ Assert(false, ExcInternalError());
+}
+
+
+
+template <int dim, int spacedim>
+std::vector<Point<spacedim>>
+MappingQ<dim, spacedim>::compute_mapping_support_points(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
+{
+ // get the vertices first
+ std::vector<Point<spacedim>> a;
+ a.reserve(Utilities::fixed_power<dim>(polynomial_degree + 1));
+ for (const unsigned int i : GeometryInfo<dim>::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<const TransfiniteInterpolationManifold<dim, spacedim> *>(
+ &cell->get_manifold()) == nullptr)
+ {
+ for (auto f : GeometryInfo<dim>::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<dim>::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 <int dim, int spacedim>
+BoundingBox<spacedim>
+MappingQ<dim, spacedim>::get_bounding_box(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
+{
+ return BoundingBox<spacedim>(this->compute_mapping_support_points(cell));
+}
+
+
+
+template <int dim, int spacedim>
+bool
+MappingQ<dim, spacedim>::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"
template <int dim, int spacedim>
MappingQ1<dim, spacedim>::MappingQ1()
- : MappingQGeneric<dim, spacedim>(1)
+ : MappingQ<dim, spacedim>(1)
{}
template <int dim, int spacedim>
-MappingQGeneric<dim, spacedim>
- StaticMappingQ1<dim, spacedim>::mapping = MappingQGeneric<dim, spacedim>(1);
+MappingQ<dim, spacedim>
+ StaticMappingQ1<dim, spacedim>::mapping = MappingQ<dim, spacedim>(1);
MappingQ1Eulerian<dim, VectorType, spacedim>::MappingQ1Eulerian(
const DoFHandler<dim, spacedim> &shiftmap_dof_handler,
const VectorType & euler_transform_vectors)
- : MappingQGeneric<dim, spacedim>(1)
+ : MappingQ<dim, spacedim>(1)
, euler_transform_vectors(&euler_transform_vectors)
, shiftmap_dof_handler(&shiftmap_dof_handler)
{}
// call the function of the base class, but ignoring
// any potentially detected cell similarity between
// the current and the previous cell
- MappingQGeneric<dim, spacedim>::fill_fe_values(
- cell,
- CellSimilarity::invalid_next_cell,
- quadrature,
- internal_data,
- output_data);
+ MappingQ<dim, spacedim>::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
template <int dim, int spacedim>
MappingQCache<dim, spacedim>::MappingQCache(
const unsigned int polynomial_degree)
- : MappingQGeneric<dim, spacedim>(polynomial_degree)
+ : MappingQ<dim, spacedim>(polynomial_degree)
, uses_level_info(false)
{}
template <int dim, int spacedim>
MappingQCache<dim, spacedim>::MappingQCache(
const MappingQCache<dim, spacedim> &mapping)
- : MappingQGeneric<dim, spacedim>(mapping)
+ : MappingQ<dim, spacedim>(mapping)
, support_point_cache(mapping.support_point_cache)
, uses_level_info(mapping.uses_level_info)
{}
this->initialize(
triangulation,
[&](const typename Triangulation<dim, spacedim>::cell_iterator &cell) {
- const auto mapping_q_generic =
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping);
- if (mapping_q_generic != nullptr &&
- this->get_degree() == mapping_q_generic->get_degree())
+ const auto mapping_q =
+ dynamic_cast<const MappingQ<dim, spacedim> *>(&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
{
template <int dim, int spacedim>
void
MappingQCache<dim, spacedim>::initialize(
- const Triangulation<dim, spacedim> & triangulation,
- const MappingQGeneric<dim, spacedim> &mapping)
+ const Triangulation<dim, spacedim> &triangulation,
+ const MappingQ<dim, spacedim> & mapping)
{
this->initialize(mapping, triangulation);
}
[&](const typename Triangulation<dim, spacedim>::cell_iterator &cell) {
std::vector<Point<spacedim>> points;
- const auto mapping_q_generic =
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping);
+ const auto mapping_q =
+ dynamic_cast<const MappingQ<dim, spacedim> *>(&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
{
cell_tria->index(),
&dof_handler);
- const auto mapping_q_generic =
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping);
+ const auto mapping_q =
+ dynamic_cast<const MappingQ<dim, spacedim> *>(&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*/)
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();
cell_tria->index(),
&dof_handler);
- const auto mapping_q_generic =
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping);
+ const auto mapping_q =
+ dynamic_cast<const MappingQ<dim, spacedim> *>(&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*/)
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();
const DoFHandler<dim, spacedim> &euler_dof_handler,
const VectorType & euler_vector,
const unsigned int level)
- : MappingQGeneric<dim, spacedim>(degree)
+ : MappingQ<dim, spacedim>(degree)
, euler_vector(&euler_vector)
, euler_dof_handler(&euler_dof_handler)
, level(level)
// call the function of the base class, but ignoring
// any potentially detected cell similarity between
// the current and the previous cell
- MappingQGeneric<dim, spacedim>::fill_fe_values(
- cell,
- CellSimilarity::invalid_next_cell,
- quadrature,
- internal_data,
- output_data);
+ MappingQ<dim, spacedim>::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
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// 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 <deal.II/base/array_view.h>
-#include <deal.II/base/derivative_form.h>
-#include <deal.II/base/memory_consumption.h>
-#include <deal.II/base/qprojector.h>
-#include <deal.II/base/quadrature.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/table.h>
-#include <deal.II/base/tensor_product_polynomials.h>
-
-#include <deal.II/fe/fe_dgq.h>
-#include <deal.II/fe/fe_tools.h>
-#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q1.h>
-#include <deal.II/fe/mapping_q_generic.h>
-#include <deal.II/fe/mapping_q_internal.h>
-
-#include <deal.II/grid/manifold_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/tria_iterator.h>
-
-DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
-#include <boost/container/small_vector.hpp>
-DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
-
-#include <algorithm>
-#include <array>
-#include <cmath>
-#include <memory>
-#include <numeric>
-
-
-DEAL_II_NAMESPACE_OPEN
-
-
-template <int dim, int spacedim>
-MappingQGeneric<dim, spacedim>::InternalData::InternalData(
- const unsigned int polynomial_degree)
- : polynomial_degree(polynomial_degree)
- , n_shape_functions(Utilities::fixed_power<dim>(polynomial_degree + 1))
- , line_support_points(QGaussLobatto<1>(polynomial_degree + 1))
- , tensor_product_quadrature(false)
-{}
-
-
-
-template <int dim, int spacedim>
-std::size_t
-MappingQGeneric<dim, spacedim>::InternalData::memory_consumption() const
-{
- return (
- Mapping<dim, spacedim>::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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::InternalData::initialize(
- const UpdateFlags update_flags,
- const Quadrature<dim> &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<Quadrature<1>, 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<Point<1>> &points_1 =
- quad_array[i - 1].get_points();
- const std::vector<Point<1>> &points_2 =
- quad_array[i].get_points();
- const std::vector<double> &weights_1 =
- quad_array[i - 1].get_weights();
- const std::vector<double> &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<dim> 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<dim>(
- 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::InternalData::initialize_face(
- const UpdateFlags update_flags,
- const Quadrature<dim> &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<facedim>(
- 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<Tensor<1, spacedim>>(n_original_q_points));
-
- // Compute tangentials to the unit cell.
- for (const unsigned int i : GeometryInfo<dim>::face_indices())
- {
- unit_tangentials[i].resize(n_original_q_points);
- std::fill(unit_tangentials[i].begin(),
- unit_tangentials[i].end(),
- GeometryInfo<dim>::unit_tangential_vectors[i][0]);
- if (dim > 2)
- {
- unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
- .resize(n_original_q_points);
- std::fill(
- unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
- .begin(),
- unit_tangentials[GeometryInfo<dim>::faces_per_cell + i]
- .end(),
- GeometryInfo<dim>::unit_tangential_vectors[i][1]);
- }
- }
- }
- }
-}
-
-
-
-template <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::InternalData::compute_shape_function_values(
- const std::vector<Point<dim>> &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<dim> 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<unsigned int> renumber =
- FETools::hierarchic_to_lexicographic_numbering<dim>(polynomial_degree);
-
- std::vector<double> values;
- std::vector<Tensor<1, dim>> 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<Tensor<2, dim>> 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<Tensor<3, dim>> 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<Tensor<4, dim>> 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 <int dim, int spacedim>
-MappingQGeneric<dim, spacedim>::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<dim>(p))
- , unit_cell_support_points(
- internal::MappingQGenericImplementation::unit_support_points<dim>(
- 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<dim>(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 <int dim, int spacedim>
-MappingQGeneric<dim, spacedim>::MappingQGeneric(
- const MappingQGeneric<dim, spacedim> &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 <int dim, int spacedim>
-std::unique_ptr<Mapping<dim, spacedim>>
-MappingQGeneric<dim, spacedim>::clone() const
-{
- return std::make_unique<MappingQGeneric<dim, spacedim>>(*this);
-}
-
-
-
-template <int dim, int spacedim>
-unsigned int
-MappingQGeneric<dim, spacedim>::get_degree() const
-{
- return polynomial_degree;
-}
-
-
-
-template <int dim, int spacedim>
-Point<spacedim>
-MappingQGeneric<dim, spacedim>::transform_unit_to_real_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const Point<dim> & p) const
-{
- return Point<spacedim>(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 <int dim, int spacedim>
-Point<dim>
-MappingQGeneric<dim, spacedim>::transform_real_to_unit_cell_internal(
- const typename Triangulation<dim, spacedim>::cell_iterator &,
- const Point<spacedim> &,
- const Point<dim> &) 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<dim> 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<InternalData>(
- 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<dim> 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<InternalData>(
- 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 <int dim, int spacedim>
-Point<dim>
-MappingQGeneric<dim, spacedim>::transform_real_to_unit_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const Point<spacedim> & 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<Point<spacedim>, GeometryInfo<dim>::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<dim> 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<spacedim, spacedim>::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<dim> 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<dim> p_unit =
- this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit);
- if (p_unit[0] == std::numeric_limits<double>::infinity())
- AssertThrow(false,
- (typename Mapping<dim, spacedim>::ExcTransformationFailed()));
- return p_unit;
-}
-
-
-
-template <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform_points_real_to_unit_cell(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const ArrayView<const Point<spacedim>> & real_points,
- const ArrayView<Point<dim>> & unit_points) const
-{
- // Go to base class functions for dim < spacedim because it is not yet
- // implemented with optimized code.
- if (dim < spacedim)
- {
- Mapping<dim, spacedim>::transform_points_real_to_unit_cell(cell,
- real_points,
- unit_points);
- return;
- }
-
- AssertDimension(real_points.size(), unit_points.size());
- const std::vector<Point<spacedim>> 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<dim, spacedim>
- inverse_approximation(support_points, unit_cell_support_points);
-
- const unsigned int n_points = real_points.size();
- const unsigned int n_lanes = VectorizedArray<double>::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<spacedim, VectorizedArray<double>> 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<dim, VectorizedArray<double>> unit_point =
- internal::MappingQGenericImplementation::
- do_transform_real_to_unit_cell_internal<dim, spacedim>(
- 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<double>::infinity())
- unit_points[i + j] = internal::MappingQGenericImplementation::
- do_transform_real_to_unit_cell_internal<dim, spacedim>(
- 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<dim, spacedim>(
- real_points[i],
- inverse_approximation.compute(real_points[i]),
- support_points,
- polynomials_1d,
- renumber_lexicographic_to_hierarchic);
-}
-
-
-
-template <int dim, int spacedim>
-UpdateFlags
-MappingQGeneric<dim, spacedim>::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 <int dim, int spacedim>
-std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
-MappingQGeneric<dim, spacedim>::get_data(const UpdateFlags update_flags,
- const Quadrature<dim> &q) const
-{
- std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
- std::make_unique<InternalData>(polynomial_degree);
- auto &data = dynamic_cast<InternalData &>(*data_ptr);
- data.initialize(this->requires_update_flags(update_flags), q, q.size());
-
- return data_ptr;
-}
-
-
-
-template <int dim, int spacedim>
-std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
-MappingQGeneric<dim, spacedim>::get_face_data(
- const UpdateFlags update_flags,
- const hp::QCollection<dim - 1> &quadrature) const
-{
- AssertDimension(quadrature.size(), 1);
-
- std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
- std::make_unique<InternalData>(polynomial_degree);
- auto &data = dynamic_cast<InternalData &>(*data_ptr);
- data.initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_faces(
- ReferenceCells::get_hypercube<dim>(), quadrature[0]),
- quadrature[0].size());
-
- return data_ptr;
-}
-
-
-
-template <int dim, int spacedim>
-std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
-MappingQGeneric<dim, spacedim>::get_subface_data(
- const UpdateFlags update_flags,
- const Quadrature<dim - 1> &quadrature) const
-{
- std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
- std::make_unique<InternalData>(polynomial_degree);
- auto &data = dynamic_cast<InternalData &>(*data_ptr);
- data.initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_subfaces(
- ReferenceCells::get_hypercube<dim>(), quadrature),
- quadrature.size());
-
- return data_ptr;
-}
-
-
-
-template <int dim, int spacedim>
-CellSimilarity::Similarity
-MappingQGeneric<dim, spacedim>::fill_fe_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const CellSimilarity::Similarity cell_similarity,
- const Quadrature<dim> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &output_data) const
-{
- // ensure that the following static_cast is really correct:
- Assert(dynamic_cast<const InternalData *>(&internal_data) != nullptr,
- ExcInternalError());
- const InternalData &data = static_cast<const InternalData &>(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<dim, spacedim>(
- computed_cell_similarity,
- data,
- output_data.quadrature_points,
- output_data.jacobian_grads);
- }
- else
- {
- internal::MappingQGenericImplementation::maybe_compute_q_points<dim,
- spacedim>(
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.quadrature_points);
-
- internal::MappingQGenericImplementation::maybe_update_Jacobians<dim,
- spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data);
-
- internal::MappingQGenericImplementation::maybe_update_jacobian_grads<
- dim,
- spacedim>(computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_grads);
- }
-
- internal::MappingQGenericImplementation::
- maybe_update_jacobian_pushed_forward_grads<dim, spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_pushed_forward_grads);
-
- internal::MappingQGenericImplementation::
- maybe_update_jacobian_2nd_derivatives<dim, spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_2nd_derivatives);
-
- internal::MappingQGenericImplementation::
- maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_pushed_forward_2nd_derivatives);
-
- internal::MappingQGenericImplementation::
- maybe_update_jacobian_3rd_derivatives<dim, spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_3rd_derivatives);
-
- internal::MappingQGenericImplementation::
- maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
- computed_cell_similarity,
- QProjector<dim>::DataSetDescriptor::cell(),
- data,
- output_data.jacobian_pushed_forward_3rd_derivatives);
-
- const UpdateFlags update_flags = data.update_each;
- const std::vector<double> &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<dim>(
- cell->diameter() / std::sqrt(double(dim))),
- (typename Mapping<dim, spacedim>::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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::fill_fe_face_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const hp::QCollection<dim - 1> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &output_data) const
-{
- AssertDimension(quadrature.size(), 1);
-
- // ensure that the following cast is really correct:
- Assert((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
- ExcInternalError());
- const InternalData &data = static_cast<const InternalData &>(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<dim>::DataSetDescriptor::face(
- ReferenceCells::get_hypercube<dim>(),
- 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::fill_fe_subface_values(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const Quadrature<dim - 1> & quadrature,
- const typename Mapping<dim, spacedim>::InternalDataBase & internal_data,
- internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &output_data) const
-{
- // ensure that the following cast is really correct:
- Assert((dynamic_cast<const InternalData *>(&internal_data) != nullptr),
- ExcInternalError());
- const InternalData &data = static_cast<const InternalData &>(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<dim>::DataSetDescriptor::subface(
- ReferenceCells::get_hypercube<dim>(),
- 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 <int dim, int spacedim>
-inline void
-MappingQGeneric<dim, spacedim>::fill_mapping_data_for_generic_points(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- const ArrayView<const Point<dim>> & unit_points,
- const UpdateFlags update_flags,
- dealii::internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
- &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<Point<spacedim>> support_points =
- this->compute_mapping_support_points(cell);
-
- const unsigned int n_points = unit_points.size();
- const unsigned int n_lanes = VectorizedArray<double>::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<dim, VectorizedArray<double>> 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<double>> jac(
- result.second);
- const DerivativeForm<1, spacedim, dim, VectorizedArray<double>>
- 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform(
- const ArrayView<const Tensor<1, dim>> & input,
- const MappingKind mapping_kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
- const ArrayView<Tensor<1, spacedim>> & output) const
-{
- internal::MappingQGenericImplementation::transform_fields(input,
- mapping_kind,
- mapping_data,
- output);
-}
-
-
-
-template <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform(
- const ArrayView<const DerivativeForm<1, dim, spacedim>> &input,
- const MappingKind mapping_kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
- const ArrayView<Tensor<2, spacedim>> & output) const
-{
- internal::MappingQGenericImplementation::transform_differential_forms(
- input, mapping_kind, mapping_data, output);
-}
-
-
-
-template <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform(
- const ArrayView<const Tensor<2, dim>> & input,
- const MappingKind mapping_kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
- const ArrayView<Tensor<2, spacedim>> & 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform(
- const ArrayView<const DerivativeForm<2, dim, spacedim>> &input,
- const MappingKind mapping_kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
- const ArrayView<Tensor<3, spacedim>> & output) const
-{
- AssertDimension(input.size(), output.size());
- Assert(dynamic_cast<const InternalData *>(&mapping_data) != nullptr,
- ExcInternalError());
- const InternalData &data = static_cast<const InternalData &>(mapping_data);
-
- switch (mapping_kind)
- {
- case mapping_covariant_gradient:
- {
- Assert(data.update_each & update_contravariant_transformation,
- typename FEValuesBase<dim>::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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::transform(
- const ArrayView<const Tensor<3, dim>> & input,
- const MappingKind mapping_kind,
- const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
- const ArrayView<Tensor<3, spacedim>> & 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::add_line_support_points(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim>> & 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<dim>::lines_per_cell;
- ++line_no)
- {
- const typename Triangulation<dim, spacedim>::line_iterator line =
- (dim == 1 ?
- static_cast<
- typename Triangulation<dim, spacedim>::line_iterator>(cell) :
- cell->line(line_no));
-
- const Manifold<dim, spacedim> &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<Point<spacedim>> tmp_points;
- for (unsigned int line_no = 0;
- line_no < GeometryInfo<dim>::lines_per_cell;
- ++line_no)
- {
- const typename Triangulation<dim, spacedim>::line_iterator line =
- (dim == 1 ?
- static_cast<
- typename Triangulation<dim, spacedim>::line_iterator>(cell) :
- cell->line(line_no));
-
- const Manifold<dim, spacedim> &manifold =
- ((line->manifold_id() == numbers::flat_manifold_id) &&
- (dim < spacedim) ?
- cell->get_manifold() :
- line->get_manifold());
-
- const std::array<Point<spacedim>, 2> vertices{
- {cell->vertex(GeometryInfo<dim>::line_to_cell_vertices(line_no, 0)),
- cell->vertex(
- GeometryInfo<dim>::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<Point<3>> & 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<Point<3>> 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<Point<3>, 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<Point<3>> & a) const
-{
- std::array<Point<3>, 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 <int dim, int spacedim>
-void
-MappingQGeneric<dim, spacedim>::add_quad_support_points(
- const typename Triangulation<dim, spacedim>::cell_iterator &,
- std::vector<Point<spacedim>> &) const
-{
- Assert(false, ExcInternalError());
-}
-
-
-
-template <int dim, int spacedim>
-std::vector<Point<spacedim>>
-MappingQGeneric<dim, spacedim>::compute_mapping_support_points(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
-{
- // get the vertices first
- std::vector<Point<spacedim>> a;
- a.reserve(Utilities::fixed_power<dim>(polynomial_degree + 1));
- for (const unsigned int i : GeometryInfo<dim>::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<const TransfiniteInterpolationManifold<dim, spacedim> *>(
- &cell->get_manifold()) == nullptr)
- {
- for (auto f : GeometryInfo<dim>::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<dim>::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 <int dim, int spacedim>
-BoundingBox<spacedim>
-MappingQGeneric<dim, spacedim>::get_bounding_box(
- const typename Triangulation<dim, spacedim>::cell_iterator &cell) const
-{
- return BoundingBox<spacedim>(this->compute_mapping_support_points(cell));
-}
-
-
-
-template <int dim, int spacedim>
-bool
-MappingQGeneric<dim, spacedim>::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
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// 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<deal_II_dimension, deal_II_space_dimension>;
-#endif
- }
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q1.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/filtered_iterator.h>
#include <deal.II/grid/grid_reordering.h>
{
// get the degree of the mapping if possible. if not, just assume 1
unsigned int mapping_degree = 1;
- if (const auto *p =
- dynamic_cast<const MappingQGeneric<dim, spacedim> *>(&mapping))
+ if (const auto *p = dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
mapping_degree = p->get_degree();
else if (const auto *p =
dynamic_cast<const MappingQ<dim, spacedim> *>(&mapping))
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q1.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/filtered_iterator.h>
#include <deal.II/grid/grid_tools.h>
}
}
catch (
- typename MappingQGeneric<dim,
- spacedim>::ExcTransformationFailed &)
+ typename MappingQ<dim, spacedim>::ExcTransformationFailed &)
{
// ok, the transformation
// failed presumably
}
}
catch (
- typename MappingQGeneric<dim,
- spacedim>::ExcTransformationFailed &)
+ typename MappingQ<dim, spacedim>::ExcTransformationFailed &)
{
// ok, the transformation
// failed presumably
#include <deal.II/fe/fe_simplex_p_bubbles.h>
#include <deal.II/fe/fe_wedge_p.h>
#include <deal.II/fe/mapping_fe.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q1.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/reference_cell.h>
AssertDimension(dim, get_dimension());
if (is_hyper_cube())
- return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
+ return std::make_unique<MappingQ<dim, spacedim>>(degree);
else if (is_simplex())
return std::make_unique<MappingFE<dim, spacedim>>(
FE_SimplexP<dim, spacedim>(degree));
Assert(false, ExcNotImplemented());
}
- return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
+ return std::make_unique<MappingQ<dim, spacedim>>(degree);
}
* this function is called.
*/
template <int dim, int spacedim>
- MappingQGeneric<dim, spacedim> &
+ MappingQ<dim, spacedim> &
get_static_mapping_q1()
{
static MappingQ1<dim, spacedim> mapping;
Triangulation<dim> tria(Triangulation<dim>::allow_anisotropic_smoothing);
GridGenerator::hyper_cube(tria);
tria.refine_global(3);
- FE_DGQ<dim> fe(1);
- DoFHandler<dim> dof_handler(tria);
- Vector<double> solution;
- MappingQGeneric<dim> mapping(1);
- DataOut<dim> data_out;
+ FE_DGQ<dim> fe(1);
+ DoFHandler<dim> dof_handler(tria);
+ Vector<double> solution;
+ MappingQ<dim> mapping(1);
+ DataOut<dim> data_out;
dof_handler.distribute_dofs(fe);
solution.reinit(dof_handler.n_dofs());
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;
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
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()
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));
void check(Triangulation<3> &tria)
{
- MappingQGeneric<3> map(1);
+ MappingQ<3> map(1);
Point<3> p(0.75, 0, 0);
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<Triangulation<3>::active_cell_iterator, Point<3>> cell =
GridTools::find_active_cell_around_point(map, tria, p);
void check(Triangulation<2> &tria)
{
const std::vector<Point<2>> &v = tria.get_vertices();
- MappingQGeneric<2> map(1);
+ MappingQ<2> map(1);
for (unsigned i = 0; i < tria.n_vertices(); i++)
{
void
check()
{
- MappingQGeneric<dim> mapping(1);
- Triangulation<dim> tria;
+ MappingQ<dim> mapping(1);
+ Triangulation<dim> tria;
make_mesh(tria);
FE_Q<dim> element(QIterated<1>(QTrapezoid<1>(), 3));
Triangulation<dim> tria;
make_mesh(tria);
- FE_Q<dim> element(QIterated<1>(QTrapezoid<1>(), 3));
- DoFHandler<dim> dof(tria);
- MappingQGeneric<dim> mapping(1);
+ FE_Q<dim> element(QIterated<1>(QTrapezoid<1>(), 3));
+ DoFHandler<dim> dof(tria);
+ MappingQ<dim> mapping(1);
dof.distribute_dofs(element);
// test with two different functions: one
fe.push_back(FE_Q<dim>(QIterated<1>(QTrapezoid<1>(), 5)));
hp::MappingCollection<dim> mapping_1;
- mapping_1.push_back(MappingQGeneric<dim>(1));
- mapping_1.push_back(MappingQGeneric<dim>(1));
- mapping_1.push_back(MappingQGeneric<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
hp::MappingCollection<dim> mapping_2;
- mapping_2.push_back(MappingQGeneric<dim>(1));
+ mapping_2.push_back(MappingQ<dim>(1));
DoFHandler<dim> dof_handler(tria);
Triangulation<dim> tria;
make_mesh(tria);
- FE_Q<dim> element(QIterated<1>(QTrapezoid<1>(), 3));
- DoFHandler<dim> dof(tria);
- MappingQGeneric<dim> mapping(1);
+ FE_Q<dim> element(QIterated<1>(QTrapezoid<1>(), 3));
+ DoFHandler<dim> dof(tria);
+ MappingQ<dim> mapping(1);
dof.distribute_dofs(element);
// test with two different functions: one
fe.push_back(FE_Q<dim>(5));
hp::MappingCollection<dim> mapping_1;
- mapping_1.push_back(MappingQGeneric<dim>(1));
- mapping_1.push_back(MappingQGeneric<dim>(1));
- mapping_1.push_back(MappingQGeneric<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
+ mapping_1.push_back(MappingQ<dim>(1));
hp::MappingCollection<dim> mapping_2;
- mapping_2.push_back(MappingQGeneric<dim>(1));
+ mapping_2.push_back(MappingQ<dim>(1));
DoFHandler<dim> dof_handler(tria);
DoFHandler<dim> dgq_dof_handler(tria);
Vector<double> q_solution;
Vector<double> dgq_solution;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
DataOut<dim> q_data_out, dgq_data_out;
AffineConstraints<double> cm;
cm.close();
void
output_results(const unsigned int cycle) const;
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
FE_DGQ<dim> fe;
DoFHandler<dim> dof_handler;
solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients;
info_box.add_update_flags_all(update_flags);
solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients;
info_box.add_update_flags_all(update_flags);
// 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
GridGenerator::extract_boundary_mesh(volume_mesh, boundary_mesh);
- QGauss<dim - 1> quadrature(2);
- MappingQGeneric<dim - 1, dim> mapping(1);
- FE_Q<dim - 1, dim> fe(1);
+ QGauss<dim - 1> quadrature(2);
+ MappingQ<dim - 1, dim> mapping(1);
+ FE_Q<dim - 1, dim> fe(1);
FEValues<dim - 1, dim> fe_values(mapping,
fe,
grid_out.set_flags(GridOutFlags::Ucd(true));
grid_out.write_ucd(tria, deallog.get_file_stream());
- QTrapezoid<dim> quad;
- MappingQGeneric<dim, spacedim> mapping(1);
+ QTrapezoid<dim> quad;
+ MappingQ<dim, spacedim> mapping(1);
typename Triangulation<dim, spacedim>::active_cell_iterator
cell = tria.begin_active(),
endc = tria.end();
constraints.close();
// Computation on the device
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, double> mf_data;
typename CUDAWrappers::MatrixFree<dim, double>::AdditionalData
additional_data;
AffineConstraints<double> constraints(relevant_set);
constraints.close();
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
LinearAlgebra::CUDAWrappers::Vector<double>,
n_q_points_1d> & mf,
unsigned int n_dofs,
- MappingQGeneric<2> & mapping,
+ MappingQ<2> & mapping,
const AffineConstraints<double> &constraints)
{
Vector<double> in_host(n_dofs), out_host(n_dofs);
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 |
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 |
constraints);
constraints.close();
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
{
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
additional_data;
deallog << "Testing " << dof.get_fe().get_name() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree);
+ MappingQ<dim> mapping(fe_degree);
CUDAWrappers::MatrixFree<dim, Number> mf_data;
const QGauss<1> quad(fe_degree + 1);
typename CUDAWrappers::MatrixFree<dim, Number>::AdditionalData
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
component_interpretation(
dim, DataComponentInterpretation::component_is_part_of_vector);
- MappingQGeneric<dim> mapping(2);
+ MappingQ<dim> mapping(2);
// variant 1
{
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- Vector<double> vec(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(cell_order);
+ Vector<double> vec(dof_handler.n_dofs());
+ MappingQ<dim> mapping(cell_order);
VectorTools::interpolate(mapping,
dof_handler,
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- Vector<double> vec(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(cell_order);
+ Vector<double> vec(dof_handler.n_dofs());
+ MappingQ<dim> mapping(cell_order);
VectorTools::interpolate(mapping,
dof_handler,
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- Vector<double> vec(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(cell_order);
+ Vector<double> vec(dof_handler.n_dofs());
+ MappingQ<dim> mapping(cell_order);
VectorTools::interpolate(mapping,
dof_handler,
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
- Vector<double> vec(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(cell_order);
+ Vector<double> vec(dof_handler.n_dofs());
+ MappingQ<dim> mapping(cell_order);
VectorTools::interpolate(mapping,
dof_handler,
// 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(),
MappingFEField<dim, spacedim> mapping_1(dhq, eulerq, mask);
// create first mapping class, that does preserve position of vertices
- MappingQGeneric<dim, spacedim> mapping_2(1);
+ MappingQ<dim, spacedim> mapping_2(1);
// create mapping collection
hp::FECollection<dim> fe_collection(FE_Q<dim>(1), FE_Q<dim>(1));
test(std::ostream & /*out*/)
{
MyFunction<dim> func;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
test(std::ostream & /*out*/)
{
MyFunction<dim> func;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tr);
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
dof_handler.distribute_dofs(fe);
Vector<double> interpolant(dof_handler.n_dofs());
- VectorTools::interpolate_based_on_material_id(MappingQGeneric<dim>(1),
+ VectorTools::interpolate_based_on_material_id(MappingQ<dim>(1),
dof_handler,
functions,
interpolant);
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,
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,
FE_Q<dim> fe(1);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
FE_Q<dim> fe(2);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
FE_DGPMonomial<dim> fe(1);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
FE_DGPMonomial<dim> fe(2);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
FE_DGPNonparametric<dim> fe(1);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
FE_DGPNonparametric<dim> fe(2);
deallog << "FE=" << fe.get_name() << std::endl;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
deallog << "Mapping=Q1" << std::endl;
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,
void
plot_FE_Q_shape_functions()
{
- MappingQGeneric<dim> m(1);
- FE_Q<dim> q1(1);
+ MappingQ<dim> m(1);
+ FE_Q<dim> q1(1);
plot_derivatives(m, q1, "Q1");
// plot_face_shape_functions(m, q1, "Q1");
FE_Q<dim> q2(2);
void
plot_FE_DGQ_shape_functions()
{
- MappingQGeneric<dim> m(1);
- FE_DGQ<dim> q1(1);
+ MappingQ<dim> m(1);
+ FE_DGQ<dim> q1(1);
plot_derivatives(m, q1, "DGQ1");
// plot_face_shape_functions(m, q1, "DGQ1");
FE_DGQ<dim> q2(2);
// 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);
void
plot_FE_Bernstein_shape_functions()
{
- MappingQGeneric<dim> m(1);
- FE_Bernstein<dim> b1(1);
+ MappingQ<dim> m(1);
+ FE_Bernstein<dim> b1(1);
plot_derivatives(m, b1, "B1");
FE_Bernstein<dim> b2(2);
// 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;
void
plot_FE_Q_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
// FE_Q<dim> q1(1);
// plot_derivatives(m, q1, "Q1");
// plot_face_shape_functions(m, q1, "Q1");
void
plot_FE_DGQ_shape_functions()
{
- MappingQGeneric<dim> m(1);
- FE_DGQ<dim> q1(1);
+ MappingQ<dim> m(1);
+ FE_DGQ<dim> q1(1);
plot_derivatives(m, q1, "DGQ1");
FE_DGQ<dim> q2(2);
plot_derivatives(m, q2, "DGQ2");
std::vector<Mapping<dim> *> mapping_ptr;
std::vector<std::string> mapping_strings;
- MappingQGeneric<dim> mapping(1);
- std::string mapping_name = "MappingQ1";
+ MappingQ<dim> mapping(1);
+ std::string mapping_name = "MappingQ1";
Triangulation<dim> tria;
GridGenerator::hyper_cube(tria);
const QGauss<dim> quadrature(fe.degree + 1);
const unsigned int n_q_points = quadrature.size();
MappingQ<dim> mapping(1);
- // MappingQGeneric<dim> mapping(1);
+ // MappingQ<dim> mapping(1);
std::vector<double> div_v(n_q_points);
std::vector<typename FEValuesViews::Vector<dim>::curl_type> curl_v(
n_q_points);
const unsigned int n_q_points = quadrature.size();
const unsigned int n_face_q_points = face_quadrature.size();
// MappingQ<dim> mapping(2);
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
std::vector<double> div_v(n_q_points);
std::vector<typename FEValuesViews::Vector<dim>::curl_type> curl_v(
n_q_points);
{
initlog();
- Triangulation<2> tria;
- MappingQGeneric<2> mapping(1);
+ Triangulation<2> tria;
+ MappingQ<2> mapping(1);
make_grid(tria);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold.h>
FE_Q<dim> finite_element;
DoFHandler<dim> dof_handler;
QGauss<dim> cell_quadrature;
- MappingQGeneric<dim> cell_mapping;
+ MappingQ<dim> cell_mapping;
AffineConstraints<double> all_constraints;
SparsityPattern sparsity_pattern;
VectorFunction<dim> fe_function;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
const QGauss<dim> quadrature(fe.degree + 2);
FEValues<dim> fe_values(mapping,
void
plot_FE_Bernstein_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Bernstein<dim> b1(1);
plot_shape_functions(m, b1, "B1");
void
plot_FE_DGP_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_DGP<dim> p1(1);
plot_shape_functions(m, p1, "DGP1");
void
plot_FE_DGPMonomial_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_DGPMonomial<dim> p1(1);
plot_shape_functions(m, p1, "DGPMonomial1");
void
plot_FE_DGPNonparametric_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_DGPNonparametric<dim> p0(0);
plot_shape_functions(m, p0, "DGPNonparametric0");
void
plot_FE_DGQ_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_DGQ<dim> q1(1);
plot_shape_functions(m, q1, "DGQ1");
void
plot_FE_FaceQ_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_FaceQ<dim> q0(0);
FE_FaceQ<dim> q1(1);
void
plot_FE_Nedelec_shape_functions()
{
- MappingQGeneric<dim> m(1);
- FE_Nedelec<dim> p0(0);
+ MappingQ<dim> m(1);
+ FE_Nedelec<dim> p0(0);
// plot_shape_functions(m, p1, "Nedelec1");
// plot_face_shape_functions(m, p1, "Nedelec1");
test_compute_functions(m, p0, "Nedelec0");
void
plot_FE_Q_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Q<dim> q1(1);
plot_shape_functions(m, q1, "Q1");
void
plot_FE_Q_Bubbles_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Q_Bubbles<dim> q1(1);
plot_shape_functions(m, q1, "Q1_Bubbles");
void
plot_FE_Q_DG0_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Q_DG0<dim> q1(1);
plot_shape_functions(m, q1, "Q1_DG0");
void
plot_FE_Q_Hierarchical_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Q_Hierarchical<dim> q1(1);
plot_shape_functions(m, q1, "QHierarchical1");
void
plot_FE_Q_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_Q_iso_Q1<dim> q1(1);
plot_shape_functions(m, q1, "Q1");
void
plot_FE_System_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
// FESystem<dim> p1(FE_Q<dim>(2), 1,
// FE_Q<dim>(dim<3 ? 3 : 2), 2);
void
plot_FE_System_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FESystem<dim> p3(FE_Q<dim>(1), 1, FESystem<dim>(FE_Q<dim>(1), 2), 2);
test_compute_functions(m, p3, "System_1");
void
plot_FE_TraceQ_shape_functions()
{
- MappingQGeneric<dim> m(1);
+ MappingQ<dim> m(1);
FE_TraceQ<dim> tq1(1);
FE_TraceQ<dim> tq2(2);
additional_data.mapping_update_flags_faces_by_cells =
update_gradients | update_JxW_values | update_quadrature_points;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
QGauss<1> quad(degree + 1);
AffineConstraints<double> constraint;
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
Triangulation<dim, spacedim> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(n_ref);
- MappingQGeneric<dim, spacedim> mapping(3);
+ MappingQ<dim, spacedim> mapping(3);
Point<dim> p;
{
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
Triangulation<dim, spacedim> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(n_ref);
- MappingQGeneric<dim, spacedim> mapping(3);
+ MappingQ<dim, spacedim> mapping(3);
Point<dim> p;
{
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
Triangulation<dim, spacedim> tria;
GridGenerator::hyper_shell(tria, Point<dim>(), 0.8, 1., dim == 2 ? 3 : 6);
tria.refine_global(n_ref);
- MappingQGeneric<dim, spacedim> mapping(8);
+ MappingQ<dim, spacedim> mapping(8);
{
const double phi = 0.;
#include <deal.II/base/logstream.h>
#include <deal.II/base/utilities.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
Triangulation<dim, spacedim> tria;
GridGenerator::channel_with_cylinder(tria, 0.03, 2, 2);
tria.refine_global(n_ref);
- MappingQGeneric<dim, spacedim> mapping(3);
+ MappingQ<dim, spacedim> mapping(3);
Point<dim> p1;
p1[0] = 0.28;
#include <deal.II/fe/fe_q_iso_q1.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/distributed/tria.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
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);
// and also that we can do output in dim = 2, spacedim = 3.
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
Triangulation<dim, spacedim> triangulation;
make_grid(triangulation);
- MappingQGeneric<dim, spacedim> mapping(3);
+ MappingQ<dim, spacedim> mapping(3);
auto cell = triangulation.begin_active();
cell->set_refine_flag(); // 0
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_dgq.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
tria.begin_active()->vertex(0) += shift;
}
- MappingQGeneric<dim> const mapping(degree);
- QGauss<dim> const gauss(n_q_points);
+ MappingQ<dim> const mapping(degree);
+ QGauss<dim> const gauss(n_q_points);
Vector<double> ratios =
GridTools::compute_aspect_ratio_of_cells(mapping, tria, gauss);
#include <deal.II/base/geometry_info.h>
#include <deal.II/base/tensor.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
<< "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 =
// use an explicit Q1 mapping. this will yield a zero solution
{
- VectorTools::project(hp::MappingCollection<dim>(MappingQGeneric<dim>(1)),
+ VectorTools::project(hp::MappingCollection<dim>(MappingQ<dim>(1)),
dh,
cm,
hp::QCollection<dim>(QGauss<dim>(3)),
fe_q.push_back(FE_Q<dim>(deg));
fe_dgq.push_back(FE_DGQ<dim>(deg));
}
- DoFHandler<dim> q_dof_handler(tria);
- DoFHandler<dim> dgq_dof_handler(tria);
- Vector<double> q_solution;
- Vector<double> dgq_solution;
- MappingQGeneric<dim> mapping(1);
+ DoFHandler<dim> q_dof_handler(tria);
+ DoFHandler<dim> dgq_dof_handler(tria);
+ Vector<double> q_solution;
+ Vector<double> dgq_solution;
+ MappingQ<dim> mapping(1);
// refine a few cells
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
{
fe_q.push_back(FE_Q_Hierarchical<dim>(deg));
}
- DoFHandler<dim> q_dof_handler(tria);
- Vector<double> q_solution;
- MappingQGeneric<dim> mapping(1);
+ DoFHandler<dim> q_dof_handler(tria);
+ Vector<double> q_solution;
+ MappingQ<dim> mapping(1);
// refine a few cells
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
template <int dim>
DGMethod<dim>::DGMethod()
- : mapping(MappingQGeneric<dim>(1))
+ : mapping(MappingQ<dim>(1))
, fe(FE_DGQ<dim>(1))
, dof_handler(triangulation)
, quadrature(QGauss<dim>(4))
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_raviart_thomas.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
mg.set_zero();
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients | update_hessians;
void
test_cochain(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
{
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
// Initialize DofHandler for a
// block system with local blocks
DoFHandler<dim> dof(tr);
local.cells = true;
local.faces = false;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
info_box.initialize_gauss_quadrature(1, 1, 1);
assemble(const DoFHandler<dim> &dof_handler, SparseMatrix<double> &matrix)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1;
MGLevelObject<SparseMatrix<double>> dg_down)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1;
assemble(const DoFHandler<dim> &dof_handler, SparseMatrix<double> &matrix)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1;
MGLevelObject<SparseMatrix<double>> dg_down)
{
const FiniteElement<dim> &fe = dof_handler.get_fe();
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree() + 1;
run();
private:
- const MappingQGeneric<dim> mapping;
+ const MappingQ<dim> mapping;
void
setup_system();
local.cells = true;
local.faces = faces;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
info_box.initialize_gauss_quadrature(1, 1, 1);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1, FE_Q<dim>(3), 1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1, FE_Q<dim>(3), 1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FESystem<dim> fe(FE_Q<dim>(2), 1, FE_Q<dim>(1), 1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FE_Q<dim> q1(1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FE_Q<dim> q1(1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(q1);
DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs());
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FE_Q<dim> q1(1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FE_Q<dim> q1(1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(q1);
DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs());
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FESystem<dim> fe(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FESystem<dim> fe(FE_Q<dim>(1), 1, FE_Q<dim>(1), 1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global(2);
- MappingQGeneric<dim> mapping_q1(1);
- FE_Q<dim> q1(1);
- DoFHandler<dim> dof_handler(triangulation);
+ MappingQ<dim> mapping_q1(1);
+ FE_Q<dim> q1(1);
+ DoFHandler<dim> dof_handler(triangulation);
dof_handler.distribute_dofs(q1);
DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs());
#include <deal.II/base/utilities.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
tria.set_all_manifold_ids(0);
tria.set_manifold(0, spherical);
- MappingQGeneric<dim> mapping(4);
+ MappingQ<dim> mapping(4);
QGaussLobatto<dim - 1> quadrature(4);
FE_Nothing<dim> dummy;
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
tria.refine_global(1);
- MappingQGeneric<dim> mapping(4);
+ MappingQ<dim> mapping(4);
QGaussLobatto<dim - 1> quadrature(4);
FE_Nothing<dim> dummy;
FEFaceValues<dim> fe_values(mapping,
// ---------------------------------------------------------------------
-// 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 <deal.II/base/quadrature_lib.h>
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
{
for (unsigned int degree = 1; degree < 5; ++degree)
{
- MappingQGeneric<dim, spacedim> mapping(degree);
- FE_Nothing<dim, spacedim> fe;
- QGauss<dim> gauss(degree + 1);
+ MappingQ<dim, spacedim> mapping(degree);
+ FE_Nothing<dim, spacedim> fe;
+ QGauss<dim> gauss(degree + 1);
FEValues<dim, spacedim> fe_values(mapping, fe, gauss, update_JxW_values);
double volume = 0;
for (typename Triangulation<dim, spacedim>::cell_iterator cell =
std::vector<std::string> mapping_strings;
MappingCartesian<dim> cart;
- MappingQGeneric<dim> q1_old(1);
+ MappingQ<dim> q1_old(1);
MappingQ<dim> q1tmp(1);
MappingQ<dim> q2tmp(2);
MappingQ<dim> q3tmp(3);
transfer.build(dh);
transfer.interpolate_to_mg(dh, level_vectors, map_vector);
MappingFEField<dim, spacedim, LinearAlgebra::distributed::Vector<double>>
- mapping(dh, level_vectors);
- MappingQGeneric<dim> mapping_ref(fe.degree);
+ mapping(dh, level_vectors);
+ MappingQ<dim> mapping_ref(fe.degree);
QGauss<dim> quad(1);
FEValues<dim> fe_values_ref(mapping_ref,
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
// Create a Mapping
std::vector<LinearAlgebra::distributed::Vector<double>> level_vectors(
tria.n_global_levels());
- MappingQGeneric<dim, spacedim> mapping_ref(fe.degree);
- FEValues<dim> fe_values_setup(mapping_ref,
+ MappingQ<dim, spacedim> mapping_ref(fe.degree);
+ FEValues<dim> fe_values_setup(mapping_ref,
dh.get_fe(),
Quadrature<dim>(
dh.get_fe().get_unit_support_points()),
//
// ---------------------------------------------------------------------
-// check that MappingFEField is equivalent to MappingQGeneric on a curved
+// check that MappingFEField is equivalent to MappingQ on a curved
// shell mesh
#include <deal.II/base/geometry_info.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
Vector<double> map_vector(dh.n_dofs());
VectorTools::get_position_vector(dh, map_vector);
MappingFEField<dim, spacedim, Vector<double>> mapping(dh, map_vector);
- MappingQGeneric<dim> mapping_ref(fe.degree);
+ MappingQ<dim> mapping_ref(fe.degree);
QGauss<dim> quad(1);
FEValues<dim> fe_values_ref(mapping_ref, fe, quad, update_quadrature_points);
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
Triangulation<dim, spacedim> tria;
GridGenerator::hyper_shell(tria, Point<dim>(), 0.8, 1., dim == 2 ? 3 : 6);
tria.refine_global(n_ref);
- const unsigned int fe_degree = dim == 2 ? 8 : 4;
- MappingQGeneric<dim, spacedim> mapping_q(fe_degree);
+ const unsigned int fe_degree = dim == 2 ? 8 : 4;
+ MappingQ<dim, spacedim> mapping_q(fe_degree);
FE_Q<dim> fe_q(fe_degree);
FESystem<dim, dim> fe_system(fe_q, dim);
VectorTools::get_position_vector(dofh, nodes, mask);
MappingFEField<dim, dim, Vector<double>> 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 "
-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
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
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
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
#include <deal.II/base/utilities.h>
#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools_cache.h>
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);
}
}
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
#include <deal.II/base/utilities.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
std::vector<Point<dim>> q_points = quadrature.get_points();
MappingManifold<dim, spacedim> map_manifold;
- MappingQGeneric<dim, spacedim> map_q1(1);
+ MappingQ<dim, spacedim> map_q1(1);
typename Triangulation<dim, spacedim>::active_cell_iterator
cell = triangulation.begin_active(),
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
dof.distribute_dofs(fe);
MappingManifold<dim, spacedim> mapping_manifold;
- MappingQGeneric<dim, spacedim> mapping_q(1);
+ MappingQ<dim, spacedim> mapping_q(1);
FEValues<dim, spacedim> fe_values_mapping(mapping_manifold,
fe,
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
dof.distribute_dofs(fe);
MappingManifold<dim, spacedim> mapping_manifold;
- MappingQGeneric<dim, spacedim> mapping_q(1);
+ MappingQ<dim, spacedim> mapping_q(1);
FEValues<dim, spacedim> fe_values_mapping(mapping_manifold,
fe,
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
dof.distribute_dofs(fe);
MappingManifold<dim, spacedim> mapping_manifold;
- MappingQGeneric<dim, spacedim> mapping_q(1);
+ MappingQ<dim, spacedim> mapping_q(1);
FEFaceValues<dim, spacedim> fe_values_mapping(mapping_manifold,
fe,
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_manifold.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
// 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 <deal.II/base/utilities.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
{
deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
deallog << "MappingQ(1): ";
- test_real_to_unit_cell(MappingQGeneric<dim, spacedim>(1));
+ test_real_to_unit_cell(MappingQ<dim, spacedim>(1));
deallog << "MappingQ(4): ";
- test_real_to_unit_cell(MappingQGeneric<dim, spacedim>(4));
+ test_real_to_unit_cell(MappingQ<dim, spacedim>(4));
deallog << "MappingFEField(FESystem(FE_Q(4))): ";
Triangulation<dim, spacedim> triangulation;
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;
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;
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)."
void
test_mapping()
{
- const double tol = 1e-8;
- const MappingQGeneric<dim> mapping(1);
+ const double tol = 1e-8;
+ const MappingQ<dim> mapping(1);
deallog << "Number of active cells: " << triangulation.n_active_cells()
<< std::endl;
//
// ---------------------------------------------------------------------
-// Test MappingQCache by comparison with MappingQGeneric
+// Test MappingQCache by comparison with MappingQ
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::hyper_cube(tria, -1, 1);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
mapping_cache.initialize(tria, mapping);
Point<dim> p1;
//
// ---------------------------------------------------------------------
-// Test MappingQCache by comparison with MappingQGeneric in parallel
+// Test MappingQCache by comparison with MappingQ in parallel
#include <deal.II/base/mpi.h>
#include <deal.II/distributed/tria.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
tria.refine_global(1);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
mapping_cache.initialize(tria, mapping);
Point<dim> p1;
//
// ---------------------------------------------------------------------
-// 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 <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::hyper_cube(tria, -1, 1);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
mapping_cache.initialize(tria, mapping);
Point<dim> p1;
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::hyper_cube(tria, -1, 1);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
- Point<dim> shift;
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
+ Point<dim> shift;
for (unsigned int d = 0; d < dim; ++d)
shift[d] = -0.5 + 0.1 * d;
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
Triangulation<dim> tria;
GridGenerator::subdivided_hyper_cube(tria, 4);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
mapping_cache.initialize(mapping, tria, fu, is_displacement_function);
{
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
VectorTools::interpolate(dof_handler, fu, vector);
{
- MappingQGeneric<dim> mapping(mapping_degree);
- MappingQCache<dim> mapping_cache(mapping_degree);
+ MappingQ<dim> mapping(mapping_degree);
+ MappingQCache<dim> mapping_cache(mapping_degree);
mapping_cache.initialize(mapping,
dof_handler,
vector,
transfer.build(dof_handler);
transfer.interpolate_to_mg(dof_handler, vectors, vector);
- MappingQGeneric<dim> mapping(mapping_degree);
- MappingQCache<dim> mapping_cache(mapping_degree);
+ MappingQ<dim> mapping(mapping_degree);
+ MappingQCache<dim> mapping_cache(mapping_degree);
mapping_cache.initialize(mapping,
dof_handler,
vectors,
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_fe_field.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/fe/mapping_q_cache.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::hyper_cube(tria, -1, 1);
- MappingQGeneric<dim> mapping(degree);
- MappingQCache<dim> mapping_cache(degree);
- Point<dim> shift;
+ MappingQ<dim> mapping(degree);
+ MappingQCache<dim> mapping_cache(degree);
+ Point<dim> shift;
for (unsigned int d = 0; d < dim; ++d)
shift[d] = -0.5 + 0.1 * d;
dof_handler.distribute_dofs(fe);
displacements.reinit(dof_handler.n_dofs());
- VectorTools::interpolate(MappingQGeneric<dim>(1),
+ VectorTools::interpolate(MappingQ<dim>(1),
dof_handler,
imposed_displacement,
displacements);
dof_handler.distribute_dofs(fe);
displacements.reinit(dof_handler.n_dofs());
- VectorTools::interpolate(MappingQGeneric<dim>(1),
+ VectorTools::interpolate(MappingQ<dim>(1),
dof_handler,
imposed_displacement,
displacements);
// Check InverseQuadraticApproximation used for the initial guess in
-// MappingQGeneric::transform_points_real_to_unit_cell
+// MappingQ::transform_points_real_to_unit_cell
#include <deal.II/base/logstream.h>
#include <deal.II/base/polynomial.h>
#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/mapping_fe_field.h>
#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/fe/mapping_q_internal.h>
#include <deal.II/grid/grid_generator.h>
{
deallog << "Testing " << dim << "D with point " << p << std::endl;
- FE_Q<dim> dummy(mapping_degree);
- MappingQGeneric<dim> mapping(mapping_degree);
+ FE_Q<dim> dummy(mapping_degree);
+ MappingQ<dim> mapping(mapping_degree);
FEValues<dim> fe_values(mapping,
dummy,
std::vector<unsigned int> renumber =
FETools::lexicographic_to_hierarchic_numbering<dim>(mapping_degree);
std::vector<Point<dim>> mapping_unit_support_points =
- internal::MappingQGenericImplementation::unit_support_points<dim>(
- mapping_points, renumber);
+ internal::MappingQImplementation::unit_support_points<dim>(mapping_points,
+ renumber);
for (const auto &cell : tria.active_cell_iterators())
{
deallog << "Affine approximation: "
<< cell->real_to_unit_cell_affine_approximation(p)
<< std::endl;
- internal::MappingQGenericImplementation::
+ internal::MappingQImplementation::
InverseQuadraticApproximation<dim, spacedim>
approx(fe_values.get_quadrature_points(),
mapping_unit_support_points);
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
FE_Nothing<dim> fe;
for (unsigned int degree = 6; degree < 7; ++degree)
{
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
QGauss<dim> quad(degree + 1);
FEValues<dim> fe_values(mapping, fe, quad, update_JxW_values);
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
FE_Nothing<dim> fe;
for (unsigned int degree = 1; degree < 7; ++degree)
{
- MappingQGeneric<dim> mapping(degree);
- QGauss<dim> quad(degree + 1);
- FEValues<dim> fe_values(mapping, fe, quad, update_JxW_values);
- double sum = 0.;
+ MappingQ<dim> mapping(degree);
+ QGauss<dim> quad(degree + 1);
+ FEValues<dim> fe_values(mapping, fe, quad, update_JxW_values);
+ double sum = 0.;
for (typename Triangulation<dim>::active_cell_iterator cell =
tria.begin_active();
cell != tria.end();
// ---------------------------------------------------------------------
-// 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 <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
real_points.push_back(
(i % 2 ? 0.05 * (static_cast<double>(i) - 10.) : 0.05 * i) * p);
std::vector<Point<dim>> unit_points(real_points.size());
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
mapping.transform_points_real_to_unit_cell(tria.begin(),
real_points,
unit_points);
// ---------------------------------------------------------------------
-// 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 <deal.II/base/quadrature_lib.h>
void
test(const unsigned int degree, const unsigned int n_q_points)
{
- MappingQGeneric<dim> mapping(degree);
- FE_Nothing<dim> dummy;
- QGaussLobatto<dim> quadrature(n_q_points);
- Quadrature<dim> quadrature_copy(quadrature.get_points());
+ MappingQ<dim> mapping(degree);
+ FE_Nothing<dim> dummy;
+ QGaussLobatto<dim> quadrature(n_q_points);
+ Quadrature<dim> quadrature_copy(quadrature.get_points());
Triangulation<dim> tria;
GridGenerator::hyper_ball(tria);
<< " 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<dim> fe_val(mapping, dummy, quadrature, update_quadrature_points);
// 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
#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/mapping_fe_field.h>
#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/fe/mapping_q_internal.h>
#include <deal.II/grid/grid_generator.h>
{
deallog << "Testing " << dim << "D with point " << p << std::endl;
- FE_Q<dim> dummy(mapping_degree);
- MappingQGeneric<dim> mapping(mapping_degree);
+ FE_Q<dim> dummy(mapping_degree);
+ MappingQ<dim> mapping(mapping_degree);
FEValues<dim> fe_values(mapping,
dummy,
if (GeometryInfo<dim>::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),
GridGenerator::hyper_ball(triangulation);
triangulation.set_manifold(0, boundary_description);
triangulation.refine_global(1);
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
Point<dim> p(-0.27999999999999992, -0.62999999999999989);
}
- MappingQGeneric<dim, spacedim> map(1);
+ MappingQ<dim, spacedim> map(1);
typename Triangulation<dim, spacedim>::active_cell_iterator cell =
triangulation.begin_active();
Triangulation<dim> triangulation;
GridGenerator::hyper_ball(triangulation);
- Point<dim> point;
- MappingQGeneric<dim> mapping(1);
+ Point<dim> point;
+ MappingQ<dim> mapping(1);
point[1] = -1. / (1 + std::sqrt(2.0)) / std::sqrt(2);
cells[0].material_id = 0;
triangulation.create_triangulation(points, cells, SubCellData());
- Point<dim> point(-0.29999999999999999, -0.29999999999999999);
- MappingQGeneric<dim> mapping(1);
+ Point<dim> point(-0.29999999999999999, -0.29999999999999999);
+ MappingQ<dim> mapping(1);
try
{
// of the following point in the
// reference coordinate system of
// the cell
- const Point<dim> p(-3.56413e+06, 1.74215e+06, 2.14762e+06);
- MappingQGeneric<dim> map(1);
+ const Point<dim> p(-3.56413e+06, 1.74215e+06, 2.14762e+06);
+ MappingQ<dim> map(1);
Triangulation<dim>::active_cell_iterator cell = triangulation.begin_active();
try
{
// of the following point in the
// reference coordinate system of
// the cell
- const Point<dim> p(-3.56413e+06, 1.74215e+06, 2.14762e+06);
- MappingQGeneric<dim> map(1);
+ const Point<dim> p(-3.56413e+06, 1.74215e+06, 2.14762e+06);
+ MappingQ<dim> map(1);
Triangulation<dim>::active_cell_iterator cell = triangulation.begin_active();
// the following call will fail
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
count += 100000;
}
- MappingQGeneric<dim> mapping(1);
- FE_Q<dim> fe(1);
- DoFHandler<dim> dof(tria);
+ MappingQ<dim> mapping(1);
+ FE_Q<dim> fe(1);
+ DoFHandler<dim> dof(tria);
dof.distribute_dofs(fe);
AffineConstraints<double> constraints;
constraints.close();
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
dof.distribute_mg_dofs();
deallog << "Number of DoFs: " << dof.n_dofs() << std::endl;
- MappingQGeneric<dim> mapping(fe_degree + 1);
+ MappingQ<dim> mapping(fe_degree + 1);
LaplaceOperator<dim, fe_degree, n_q_points_1d, number> fine_matrix;
fine_matrix.initialize(mapping, dof);
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
// check again, now using a mapping that displaces points
{
- MappingQGeneric<dim> mapping(3);
+ MappingQ<dim> mapping(3);
mf.reinit(mapping, dof, constraints, quad, data);
std::vector<unsigned int> n_cell_types(4, 0);
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/fe/fe_dgq.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
AffineConstraints<double> constraints;
constraints.close();
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
MatrixFree<dim, double> mf_data;
const QGauss<1> quad(degree);
// of degrees of freedom: " << dof.n_dofs() << std::endl; std::cout << "Number
// of constraints: " << constraints.n_constraints() << std::endl;
- MappingQGeneric<dim> mapping(dof.get_fe().degree);
+ MappingQ<dim> mapping(dof.get_fe().degree);
MatrixFree<dim, number> mf_data;
{
const QGauss<1> quad(n_q_points_1d);
deallog << " on " << dof.n_dofs() << " DoFs";
deallog << std::endl;
- MappingQGeneric<dim> mapping(dof.get_fe().degree + 1);
+ MappingQ<dim> mapping(dof.get_fe().degree + 1);
LinearAlgebra::distributed::Vector<double> in, out, out_dist;
deallog << " on " << dof.n_dofs() << " DoFs";
deallog << std::endl;
- MappingQGeneric<dim> mapping(dof.get_fe().degree + 1);
+ MappingQ<dim> mapping(dof.get_fe().degree + 1);
LinearAlgebra::distributed::BlockVector<double> in(1);
LinearAlgebra::distributed::BlockVector<double> out(1);
// of degrees of freedom: " << dof.n_dofs() << std::endl; std::cout << "Number
// of constraints: " << constraints.n_constraints() << std::endl;
- MappingQGeneric<dim> mapping(dof.get_fe().degree + 1);
+ MappingQ<dim> mapping(dof.get_fe().degree + 1);
Vector<number> in(dof.n_dofs()), out(dof.n_dofs());
Vector<number> out_dist(out);
// of degrees of freedom: " << dof.n_dofs() << std::endl;
// set up MatrixFree
- MappingQGeneric<dim> mapping(fe_degree);
- QGauss<1> quad(fe_degree + 1);
- MatrixFree<dim> mf_data;
+ MappingQ<dim> mapping(fe_degree);
+ QGauss<1> quad(fe_degree + 1);
+ MatrixFree<dim> mf_data;
mf_data.reinit(mapping, dof, constraints, quad);
SparsityPattern sparsity;
SparseMatrix<double> system_matrix;
// ---------------------------------------------------------------------
-// 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 <deal.II/base/function_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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 <deal.II/base/function_lib.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(std::max<unsigned int>(1, degree));
+ MappingQ<dim> mapping(std::max<unsigned int>(1, degree));
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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 <deal.II/base/function_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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 <deal.II/base/function_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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 <deal.II/base/function_lib.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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)
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
// ---------------------------------------------------------------------
-// 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)
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
else
GridGenerator::subdivided_hyper_cube(tria, 2, 0, 1);
- MappingQGeneric<dim> mapping(degree);
+ MappingQ<dim> mapping(degree);
deallog << "Mapping of degree " << degree << std::endl;
std::vector<Point<dim>> unit_points;
TrilinosWrappers::MPI::Vector vec_rel(locally_relevant_set);
vec_rel = vec;
- MappingQGeneric<dim> mapping(1);
- Vector<float> indicators(tr.n_active_cells());
+ MappingQ<dim> mapping(1);
+ Vector<float> indicators(tr.n_active_cells());
DerivativeApproximation::approximate_gradient(mapping,
dofh,
vec_rel,
setup_system();
parallel::distributed::Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
+ const MappingQ<dim> mapping;
const FiniteElement<dim> & fe;
DoFHandler<dim> dof_handler;
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
dofh.distribute_dofs(fe);
std::map<types::global_dof_index, Point<dim>> points;
- DoFTools::map_dofs_to_support_points(MappingQGeneric<dim>(1), dofh, points);
+ DoFTools::map_dofs_to_support_points(MappingQ<dim>(1), dofh, points);
if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
{
for (typename std::map<types::global_dof_index,
local.cells = true;
local.faces = faces;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
info_box.initialize_gauss_quadrature(1, 1, 1);
unsigned int n_local_constraints = 0;
std::map<types::global_dof_index, Point<dim>> support_points;
- DoFTools::map_dofs_to_support_points(MappingQGeneric<dim>(1),
+ DoFTools::map_dofs_to_support_points(MappingQ<dim>(1),
dof_handler,
support_points);
IndexSet constraints_lines = constraints.get_local_lines();
tria.prepare_coarsening_and_refinement();
Vector<double> sol_old(dh.n_dofs());
- VectorTools::interpolate(MappingQGeneric<dim>(1), dh, function, sol_old);
+ VectorTools::interpolate(MappingQ<dim>(1), dh, function, sol_old);
SolutionTransfer<dim> soltrans(dh);
soltrans.prepare_for_coarsening_and_refinement(sol_old);
tria.prepare_coarsening_and_refinement();
Vector<double> sol_old(dh.n_dofs());
- VectorTools::interpolate(MappingQGeneric<dim>(1), dh, function, sol_old);
+ VectorTools::interpolate(MappingQ<dim>(1), dh, function, sol_old);
SolutionTransfer<dim> soltrans(dh);
soltrans.prepare_for_pure_refinement();
output_results(const unsigned int cycle) const;
parallel::distributed::Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
+ const MappingQ<dim> mapping;
const FiniteElement<dim> & fe;
DoFHandler<dim> dof_handler;
output_results(const unsigned int cycle) const;
parallel::distributed::Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
+ const MappingQ<dim> mapping;
const FiniteElement<dim> & fe;
DoFHandler<dim> dof_handler;
void
refine_local();
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- FESystem<dim> fe;
- DoFHandler<dim> mg_dof_handler_renumbered;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ FESystem<dim> fe;
+ DoFHandler<dim> mg_dof_handler_renumbered;
const unsigned int degree;
std::vector<std::set<types::global_dof_index>> boundary_indices_renumbered;
void
refine_local();
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- FESystem<dim> fe;
- DoFHandler<dim> mg_dof_handler;
- DoFHandler<dim> mg_dof_handler_renumbered;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ FESystem<dim> fe;
+ DoFHandler<dim> mg_dof_handler;
+ DoFHandler<dim> mg_dof_handler_renumbered;
const unsigned int degree;
std::vector<std::set<types::global_dof_index>> boundary_indices,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
{
mg_matrices = 0.;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags =
update_values | update_gradients | update_hessians;
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
mg_interface_in = 0.;
mg_interface_out = 0.;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags =
update_values | update_gradients | update_hessians;
std::map<types::boundary_id, const Function<dim> *> dirichlet_boundary;
Functions::ZeroFunction<dim> homogeneous_dirichlet_bc(1);
dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
VectorTools::interpolate_boundary_values(mapping,
mg_dof_handler,
dirichlet_boundary,
void
output_results(const unsigned int cycle) const;
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- const FiniteElement<dim> & fe;
- DoFHandler<dim> dof_handler;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ const FiniteElement<dim> &fe;
+ DoFHandler<dim> dof_handler;
SparsityPattern sparsity;
SparseMatrix<double> matrix;
void
output_results(const unsigned int cycle) const;
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- const FiniteElement<dim> & fe;
- DoFHandler<dim> dof_handler;
- MGConstrainedDoFs mg_constraints;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ const FiniteElement<dim> &fe;
+ DoFHandler<dim> dof_handler;
+ MGConstrainedDoFs mg_constraints;
SparsityPattern sparsity;
SparseMatrix<double> matrix;
void
output_results(const unsigned int cycle) const;
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- const FiniteElement<dim> & fe;
- DoFHandler<dim> dof_handler;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ const FiniteElement<dim> &fe;
+ DoFHandler<dim> dof_handler;
SparsityPattern sparsity;
SparseMatrix<double> matrix;
void
output_results(const unsigned int cycle) const;
- Triangulation<dim> triangulation;
- const MappingQGeneric<dim> mapping;
- const FiniteElement<dim> & fe;
- DoFHandler<dim> dof_handler;
+ Triangulation<dim> triangulation;
+ const MappingQ<dim> mapping;
+ const FiniteElement<dim> &fe;
+ DoFHandler<dim> dof_handler;
SparsityPattern sparsity;
SparseMatrix<double> matrix;
Triangulation<dim> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(5 - dim);
- FE_DGQ<dim> fe(2);
- DoFHandler<dim> dof_handler(tria);
- Vector<double> solution;
- MappingQGeneric<dim> mapping(1);
- QMidpoint<dim> q_midpoint;
- FEValues<dim> fe_values(mapping, fe, q_midpoint, update_quadrature_points);
+ FE_DGQ<dim> fe(2);
+ DoFHandler<dim> dof_handler(tria);
+ Vector<double> solution;
+ MappingQ<dim> mapping(1);
+ QMidpoint<dim> q_midpoint;
+ FEValues<dim> fe_values(mapping, fe, q_midpoint, update_quadrature_points);
dof_handler.distribute_dofs(fe);
solution.reinit(dof_handler.n_dofs());
std::vector<Mapping<dim> *> maps;
// maps.push_back (new MappingCartesian<dim>);
- maps.push_back(new MappingQGeneric<dim>(1));
+ maps.push_back(new MappingQ<dim>(1));
maps.push_back(new MappingQ<dim>(2));
std::vector<FiniteElement<dim> *> elements;
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
void
check(const unsigned int refinement_1, const unsigned int refinement_2)
{
- MappingQGeneric<spacedim> mapping(1);
+ MappingQ<spacedim> mapping(1);
Triangulation<spacedim> tria_1, tria_2;
GridGenerator::hyper_cube(tria_1);
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
void
check(const unsigned int refinement_1, const unsigned int refinement_2)
{
- MappingQGeneric<spacedim> mapping(1);
+ MappingQ<spacedim> mapping(1);
Triangulation<spacedim> tria_1, tria_2;
GridGenerator::hyper_cube(tria_1);
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
void
check(const unsigned int refinement_1, const unsigned int refinement_2)
{
- MappingQGeneric<spacedim> mapping(1);
+ MappingQ<spacedim> mapping(1);
Triangulation<spacedim> tria_1, tria_2;
GridGenerator::hyper_cube(tria_1);
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
void
check(const unsigned int refinement_1, const unsigned int refinement_2)
{
- MappingQGeneric<spacedim> mapping(1);
+ MappingQ<spacedim> mapping(1);
Triangulation<spacedim> tria_1, tria_2;
GridGenerator::hyper_cube(tria_1);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_q.h>
-#include <deal.II/fe/mapping_q_generic.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_tools.h>
// use an explicit Q1 mapping. this will yield a zero solution
{
- VectorTools::project(
- MappingQGeneric<dim>(1), dh, cm, QGauss<dim>(3), F<dim>(), v);
+ VectorTools::project(MappingQ<dim>(1), dh, cm, QGauss<dim>(3), F<dim>(), v);
deallog << v.l2_norm() << std::endl;
Assert(v.l2_norm() == 0, ExcInternalError());
}
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- QGauss<dim - 1> quadrature(degree + 2);
- MappingQGeneric<dim> mapping(1);
+ QGauss<dim - 1> quadrature(degree + 2);
+ MappingQ<dim> mapping(1);
TestFunction<dim> f(degree - 1);
std::map<types::global_dof_index, double> boundary_constraints;
VectorType field(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
VectorTools::project<dim, VectorType, dim>(
- MappingQGeneric<dim>(1),
+ MappingQ<dim>(1),
dof_handler,
constraints,
quadrature_formula,
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
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<Point<3>> spoints(dh.n_dofs());
DoFTools::map_dofs_to_support_points(mapping2, dh, spoints);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_values.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
GridGenerator::hyper_shell(tr, Point<dim>(), 0.5, 1.0);
- MappingQGeneric<dim, spacedim> mapping(4);
+ MappingQ<dim, spacedim> mapping(4);
Particles::ParticleHandler<dim, spacedim> particle_handler(tr, mapping);
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/filtered_iterator.h>
#include <deal.II/grid/grid_generator.h>
GridGenerator::hyper_cube(background_triangulation, 0, 1);
background_triangulation.refine_global(6 - dim);
- const MappingQGeneric<dim> mapping(1);
+ const MappingQ<dim> mapping(1);
Particles::ParticleHandler<dim> particle_handler;
particle_handler.initialize(background_triangulation, mapping, 1);
#include <deal.II/fe/fe_q_iso_q1.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
Vector<double> euler_vector(dof_handler_dim.n_dofs());
VectorTools::get_position_vector(dof_handler_dim,
euler_vector,
- MappingQGeneric<dim, spacedim>(
- mapping_degree));
+ MappingQ<dim, spacedim>(mapping_degree));
MappingFEField<dim, spacedim> mapping(dof_handler_dim, euler_vector);
#include <deal.II/fe/fe_q_iso_q1.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
Vector<double> euler_vector(dof_handler_dim.n_dofs());
VectorTools::get_position_vector(dof_handler_dim,
euler_vector,
- MappingQGeneric<dim, spacedim>(
- mapping_degree));
+ MappingQ<dim, spacedim>(mapping_degree));
MappingFEField<dim, spacedim> mapping(dof_handler_dim, euler_vector);
#include <deal.II/fe/fe_q_iso_q1.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_out.h>
Vector<double> euler_vector(dof_handler_dim.n_dofs());
VectorTools::get_position_vector(dof_handler_dim,
euler_vector,
- MappingQGeneric<dim, spacedim>(
- mapping_degree));
+ MappingQ<dim, spacedim>(mapping_degree));
MappingFEField<dim, spacedim> mapping(dof_handler_dim, euler_vector);
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_fe.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_fe.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_in.h>
const unsigned int n_refinements_1 = 4;
const unsigned int n_refinements_2 = 4;
- const MappingQGeneric<dim> mapping_1(1);
- const FE_Q<dim> fe_1(2);
- const QGauss<dim> quad_1(3);
+ const MappingQ<dim> mapping_1(1);
+ const FE_Q<dim> fe_1(2);
+ const QGauss<dim> quad_1(3);
#if false
const MappingFE<dim> mapping_2(Simplex::FE_P<dim>(1));
const Simplex::FE_P<dim> fe_2(2);
const Simplex::QGauss<dim> quad_2(3);
#else
- const MappingQGeneric<dim> mapping_2(1);
- const FE_Q<dim> fe_2(2);
- const QGauss<dim> quad_2(3);
+ const MappingQ<dim> mapping_2(1);
+ const FE_Q<dim> fe_2(2);
+ const QGauss<dim> quad_2(3);
#endif
parallel::distributed::Triangulation<dim> tria_1(MPI_COMM_WORLD);
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_fe.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_fe.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_fe.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
hp::QCollection<dim> quadrature(QGaussSimplex<dim>(degree + 1),
QGauss<dim>(degree + 1));
- hp::MappingCollection<dim, spacedim> mapping(
- MappingFE<dim, spacedim>(FE_SimplexP<dim, spacedim>(1)),
- MappingQGeneric<dim, spacedim>(1));
+ hp::MappingCollection<dim, spacedim> mapping(MappingFE<dim, spacedim>(
+ FE_SimplexP<dim, spacedim>(1)),
+ MappingQ<dim, spacedim>(1));
Triangulation<dim, spacedim> tria;
GridGenerator::subdivided_hyper_cube_with_simplices_mix(tria,
GridGenerator::subdivided_hyper_cube(tria, 4);
hp::FECollection<dim> fe{FE_Q<2>(degree), FE_Q<2>(degree)};
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
QGauss<dim> quadrature(degree + 1);
DoFHandler<dim> dof_handler(tria);
{
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>>{
hp::QCollection<1>(QGauss<1>(i + 1))};
scratch_data.mesh_generator =
{
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>>{
hp::QCollection<2>(QGauss<2>(i + 1))};
scratch_data.mesh_generator =
{
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>>{
hp::QCollection<1>(QGauss<1>(i + 1))};
scratch_data.mesh_generator =
{
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>>{
hp::QCollection<2>(QGauss<2>(i + 1))};
scratch_data.mesh_generator =
const unsigned int this_mpi_process;
#ifdef HEX
- MappingQGeneric<dim, dim> mapping;
+ MappingQ<dim, dim> mapping;
#else
MappingFE<dim, dim> mapping;
#endif
const Quadrature<dim> quadrature_formula;
#ifdef HEX
- MappingQGeneric<dim, dim> mapping;
+ MappingQ<dim, dim> mapping;
#else
MappingFE<dim, dim> mapping;
#endif
Triangulation<dim> triangulation;
#ifdef HEX
- MappingQGeneric<dim, dim> mapping;
- FE_Q<dim> fe;
- QGauss<dim> quadrature;
+ MappingQ<dim, dim> mapping;
+ FE_Q<dim> fe;
+ QGauss<dim> quadrature;
#else
MappingFE<dim, dim> mapping;
FE_SimplexP<dim> fe;
MPI_Comm mpi_communicator;
#ifdef HEX
- MappingQGeneric<dim, dim> mapping;
+ MappingQ<dim, dim> mapping;
parallel::distributed::Triangulation<dim> triangulation;
FE_Q<dim> fe;
#else
#endif
#ifdef HEX
- MappingQGeneric<dim> mapping;
+ MappingQ<dim> mapping;
#else
MappingFE<dim> mapping;
#endif
solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients;
info_box.add_update_flags_all(update_flags);
solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients;
info_box.add_update_flags_all(update_flags);
solution.reinit(dof_handler.n_dofs());
system_rhs.reinit(dof_handler.n_dofs());
- MappingQGeneric<dim> mapping(1);
+ MappingQ<dim> mapping(1);
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients;
info_box.add_update_flags_all(update_flags);
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_fe_field.h>
-#include <deal.II/fe/mapping_q_generic.h>
+#include <deal.II/fe/mapping_q.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/tria.h>
// set up base high-order mapping
Vector<double> euler_vector_base(dof_handler_dim.n_dofs());
- VectorTools::get_position_vector(MappingQGeneric<dim, spacedim>(4),
+ VectorTools::get_position_vector(MappingQ<dim, spacedim>(4),
dof_handler_dim,
euler_vector_base);
MappingFEField<dim, spacedim> mapping_base(dof_handler_dim,
// clear manifold
tria.reset_all_manifolds();
- // output mesh with with MappingQGeneric(degree=4)
+ // output mesh with with MappingQ(degree=4)
{
DataOutBase::VtkFlags flags;
data_out.attach_dof_handler(dof_handler);
data_out.build_patches(
- MappingQGeneric<dim, spacedim>(4),
+ MappingQ<dim, spacedim>(4),
fe_degree + 1,
DataOut<dim, spacedim>::CurvedCellRegion::curved_inner_cells);
const Functions::ConstantFunction<dim> constant_function_1(1.0);
function_map[1] = &constant_function_1;
- VectorTools::interpolate_based_on_material_id(MappingQGeneric<dim>(1),
+ VectorTools::interpolate_based_on_material_id(MappingQ<dim>(1),
dof_handler,
function_map,
dst);