MappingQ< dim, spacedim > Class Template Reference
[Mappings between reference and real cell]

Inheritance diagram for MappingQ< dim, spacedim >:

Inheritance graph
[legend]

List of all members.

Classes

class  ExcLaplaceVectorNotSet
class  InternalData

Public Member Functions

 MappingQ (const unsigned int p, const bool use_mapping_q_on_all_cells=false)
 MappingQ (const MappingQ< dim, spacedim > &mapping)
virtual ~MappingQ ()
virtual Point< spacedim > transform_unit_to_real_cell (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const
virtual Point< dim > transform_real_to_unit_cell (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const
virtual void transform (const VectorSlice< const std::vector< Tensor< 1, dim > > > input, VectorSlice< std::vector< Tensor< 1, spacedim > > > output, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const MappingType type) const
virtual void transform (const VectorSlice< const std::vector< Tensor< 2, dim > > > input, VectorSlice< std::vector< Tensor< 2, spacedim > > > output, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const MappingType type) const
unsigned int get_degree () const
virtual Mapping< dim, spacedim > * clone () const

Protected Member Functions

virtual void fill_fe_values (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Quadrature< dim > &quadrature, typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, typename std::vector< Point< spacedim > > &quadrature_points, std::vector< double > &JxW_values, std::vector< Tensor< 2, spacedim > > &jacobians, std::vector< Tensor< 3, spacedim > > &jacobian_grads, std::vector< Tensor< 2, spacedim > > &inverse_jacobians, std::vector< Point< spacedim > > &cell_normal_vectors, enum CellSimilarity::Similarity &cell_similarity) const
virtual void fill_fe_face_values (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim-1 > &quadrature, typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, typename std::vector< Point< dim > > &quadrature_points, std::vector< double > &JxW_values, typename std::vector< Tensor< 1, dim > > &exterior_form, typename std::vector< Point< dim > > &normal_vectors) const
virtual void fill_fe_subface_values (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int sub_no, const Quadrature< dim-1 > &quadrature, typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, typename std::vector< Point< dim > > &quadrature_points, std::vector< double > &JxW_values, typename std::vector< Tensor< 1, dim > > &exterior_form, typename std::vector< Point< dim > > &normal_vectors) const
virtual void add_line_support_points (const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< dim > > &a) const
virtual void add_quad_support_points (const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< dim > > &a) const

Private Member Functions

virtual Mapping< dim, spacedim >
::InternalDataBase * 
get_data (const UpdateFlags, const Quadrature< dim > &quadrature) const
virtual Mapping< dim, spacedim >
::InternalDataBase * 
get_face_data (const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const
virtual Mapping< dim, spacedim >
::InternalDataBase * 
get_subface_data (const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const
virtual void compute_shapes_virtual (const std::vector< Point< dim > > &unit_points, typename MappingQ1< dim, spacedim >::InternalData &data) const
void set_laplace_on_quad_vector (Table< 2, double > &loqvs) const
void set_laplace_on_hex_vector (Table< 2, double > &lohvs) const
void compute_laplace_vector (Table< 2, double > &lvs) const
void apply_laplace_vector (const Table< 2, double > &lvs, std::vector< Point< dim > > &a) const
virtual void compute_mapping_support_points (const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< dim > > &a) const
void compute_support_points_laplace (const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< dim > > &a) const

Private Attributes

Table< 2, doublelaplace_on_quad_vector
Table< 2, doublelaplace_on_hex_vector
const unsigned int degree
const unsigned int n_inner
const unsigned int n_outer
const TensorProductPolynomials
< dim > * 
tensor_pols
const unsigned int n_shape_functions
const std::vector< unsigned intrenumber
const bool use_mapping_q_on_all_cells
const FE_Q< dim > feq


Detailed Description

template<int dim, int spacedim = dim>
class MappingQ< dim, spacedim >

Mapping class that uses Qp-mappings on boundary cells. The mapping shape functions make use of tensor product polynomials with equidistant (on the unit cell) support points.

For more details about Qp-mappings, see the `mapping' report at deal.II/doc/reports/mapping_q/index.html in the `Reports' section of `Documentation'.

For more information about the spacedim template parameter check the documentation of FiniteElement or the one of Triangulation.

Author:
Ralf Hartmann, 2000, 2001, 2005; Guido Kanschat 2000, 2001

Constructor & Destructor Documentation

template<int dim, int spacedim = dim>
MappingQ< dim, spacedim >::MappingQ ( const unsigned int  p,
const bool  use_mapping_q_on_all_cells = false 
)

Constructor. p gives the degree of mapping polynomials on boundary cells.

The second argument determines whether the higher order mapping should also be used on interior cells. If its value is false (the default), the a lower-order mapping is used in the interior. This is sufficient for most cases where higher order mappings are only used to better approximate the boundary. In that case, cells bounded by straight lines are acceptable in the interior. However, there are cases where one would also like to use a higher order mapping in the interior. The MappingQEulerian class is one such case.

template<int dim, int spacedim = dim>
MappingQ< dim, spacedim >::MappingQ ( const MappingQ< dim, spacedim > &  mapping  ) 

Copy constructor. Performs a deep copy, i.e. duplicates what tensor_pols points to instead of simply copying the tensor_pols pointer as done by a default copy constructor.

template<int dim, int spacedim = dim>
virtual MappingQ< dim, spacedim >::~MappingQ (  )  [virtual]

Destructor.


Member Function Documentation

template<int dim, int spacedim = dim>
virtual Point<spacedim> MappingQ< dim, spacedim >::transform_unit_to_real_cell ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const Point< dim > &  p 
) const [virtual]

Transforms the point p on the unit cell to the point p_real on the real cell cell and returns p_real.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Point<dim> MappingQ< dim, spacedim >::transform_real_to_unit_cell ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const Point< spacedim > &  p 
) const [virtual]

Transforms the point p on the real cell to the point p_unit on the unit cell cell and returns p_unit.

Uses Newton iteration and the transform_unit_to_real_cell function.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::transform ( const VectorSlice< const std::vector< Tensor< 1, dim > > >  input,
VectorSlice< std::vector< Tensor< 1, spacedim > > >  output,
const typename Mapping< dim, spacedim >::InternalDataBase &  internal,
const MappingType  type 
) const [virtual]

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::transform ( const VectorSlice< const std::vector< Tensor< 2, dim > > >  input,
VectorSlice< std::vector< Tensor< 2, spacedim > > >  output,
const typename Mapping< dim, spacedim >::InternalDataBase &  internal,
const MappingType  type 
) const [virtual]

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
unsigned int MappingQ< dim, spacedim >::get_degree (  )  const

Return the degree of the mapping, i.e. the value which was passed to the constructor.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>* MappingQ< dim, spacedim >::clone (  )  const [virtual]

Return a pointer to a copy of the present object. The caller of this copy then assumes ownership of it.

Reimplemented from MappingQ1< dim, spacedim >.

Reimplemented in MappingC1< dim, spacedim >, and MappingQEulerian< dim, EulerVectorType, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::fill_fe_values ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const Quadrature< dim > &  quadrature,
typename Mapping< dim, spacedim >::InternalDataBase &  mapping_data,
typename std::vector< Point< spacedim > > &  quadrature_points,
std::vector< double > &  JxW_values,
std::vector< Tensor< 2, spacedim > > &  jacobians,
std::vector< Tensor< 3, spacedim > > &  jacobian_grads,
std::vector< Tensor< 2, spacedim > > &  inverse_jacobians,
std::vector< Point< spacedim > > &  cell_normal_vectors,
enum CellSimilarity::Similarity cell_similarity 
) const [protected, virtual]

Implementation of the interface in Mapping.

Reimplemented from MappingQ1< dim, spacedim >.

Reimplemented in MappingQEulerian< dim, EulerVectorType, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::fill_fe_face_values ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const unsigned int  face_no,
const Quadrature< dim-1 > &  quadrature,
typename Mapping< dim, spacedim >::InternalDataBase &  mapping_data,
typename std::vector< Point< dim > > &  quadrature_points,
std::vector< double > &  JxW_values,
typename std::vector< Tensor< 1, dim > > &  exterior_form,
typename std::vector< Point< dim > > &  normal_vectors 
) const [protected, virtual]

Implementation of the interface in Mapping.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::fill_fe_subface_values ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const unsigned int  face_no,
const unsigned int  sub_no,
const Quadrature< dim-1 > &  quadrature,
typename Mapping< dim, spacedim >::InternalDataBase &  mapping_data,
typename std::vector< Point< dim > > &  quadrature_points,
std::vector< double > &  JxW_values,
typename std::vector< Tensor< 1, dim > > &  exterior_form,
typename std::vector< Point< dim > > &  normal_vectors 
) const [protected, virtual]

Implementation of the interface in Mapping.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::add_line_support_points ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
std::vector< Point< dim > > &  a 
) const [protected, virtual]

For dim=2,3. Append the support points of all shape functions located on bounding lines to the vector a. Points located on the line but not on vertices are not included.

Needed by the compute_support_points_laplace function . For dim=1 this function is empty.

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.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::add_quad_support_points ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
std::vector< Point< dim > > &  a 
) const [protected, virtual]

For dim=3. Append the support points of all shape functions located on bounding faces (quads in 3d) to the vector a. Points located on the quad but not on vertices are not included.

Needed by the compute_support_points_laplace function. For dim=1 and dim=2 this function is empty.

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.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ< dim, spacedim >::get_data ( const   UpdateFlags,
const Quadrature< dim > &  quadrature 
) const [private, virtual]

Prepare internal data structures and fill in values independent of the cell.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ< dim, spacedim >::get_face_data ( const UpdateFlags  flags,
const Quadrature< dim-1 > &  quadrature 
) const [private, virtual]

Prepare internal data structure for transformation of faces and fill in values independent of the cell.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ< dim, spacedim >::get_subface_data ( const UpdateFlags  flags,
const Quadrature< dim-1 > &  quadrature 
) const [private, virtual]

Prepare internal data structure for transformation of children of faces and fill in values independent of the cell.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::compute_shapes_virtual ( const std::vector< Point< dim > > &  unit_points,
typename MappingQ1< dim, spacedim >::InternalData data 
) const [private, virtual]

Compute shape values and/or derivatives.

template<int dim, int spacedim = dim>
void MappingQ< dim, spacedim >::set_laplace_on_quad_vector ( Table< 2, double > &  loqvs  )  const [private]

This function is needed by the constructor of MappingQ<dim,spacedim> for dim= 2 and 3.

For degree<4 this function sets the laplace_on_quad_vector to the hardcoded data. For degree>=4 and MappingQ<2> this vector is computed.

For the definition of the laplace_on_quad_vector please refer to equation (8) of the `mapping' report.

template<int dim, int spacedim = dim>
void MappingQ< dim, spacedim >::set_laplace_on_hex_vector ( Table< 2, double > &  lohvs  )  const [private]

This function is needed by the constructor of MappingQ<3>.

For degree==2 this function sets the laplace_on_hex_vector to the hardcoded data. For degree>2 this vector is computed.

For the definition of the laplace_on_hex_vector please refer to equation (8) of the `mapping' report.

template<int dim, int spacedim = dim>
void MappingQ< dim, spacedim >::compute_laplace_vector ( Table< 2, double > &  lvs  )  const [private]

Computes the laplace_on_quad(hex)_vector.

Called by the set_laplace_on_quad(hex)_vector functions if the data is not yet hardcoded.

For the definition of the laplace_on_quad(hex)_vector please refer to equation (8) of the `mapping' report.

template<int dim, int spacedim = dim>
void MappingQ< dim, spacedim >::apply_laplace_vector ( const Table< 2, double > &  lvs,
std::vector< Point< dim > > &  a 
) const [private]

Takes a laplace_on_hex(quad)_vector and applies it to the vector a to compute the inner support points as a linear combination of the exterior points.

The vector a initially contains the locations of the n_outer points, the n_inner computed inner points are appended.

See equation (7) of the `mapping' report.

template<int dim, int spacedim = dim>
virtual void MappingQ< dim, spacedim >::compute_mapping_support_points ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
std::vector< Point< dim > > &  a 
) const [private, virtual]

Computes the support points of the mapping.

template<int dim, int spacedim = dim>
void MappingQ< dim, spacedim >::compute_support_points_laplace ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
std::vector< Point< dim > > &  a 
) const [private]

Computes all support points of the mapping shape functions. The inner support points (ie. support points in quads for 2d, in hexes for 3d) are computed using the solution of a Laplace equation with the position of the outer support points as boundary values, in order to make the transformation as smooth as possible.


Member Data Documentation

template<int dim, int spacedim = dim>
Table<2,double> MappingQ< dim, spacedim >::laplace_on_quad_vector [private]

Needed by the laplace_on_quad function (for dim==2). Filled by the constructor.

Sizes: laplace_on_quad_vector.size()= number of inner unit_support_points laplace_on_quad_vector[i].size()= number of outer unit_support_points, i.e. unit_support_points on the boundary of the quad

For the definition of this vector see equation (8) of the `mapping' report.

template<int dim, int spacedim = dim>
Table<2,double> MappingQ< dim, spacedim >::laplace_on_hex_vector [private]

Needed by the laplace_on_hex function (for dim==3). Filled by the constructor.

For the definition of this vector see equation (8) of the `mapping' report.

template<int dim, int spacedim = dim>
const unsigned int MappingQ< dim, spacedim >::degree [private]

Degree p of the polynomials used as shape functions for the Qp mapping of cells at the boundary.

template<int dim, int spacedim = dim>
const unsigned int MappingQ< dim, spacedim >::n_inner [private]

Number of inner mapping shape functions.

template<int dim, int spacedim = dim>
const unsigned int MappingQ< dim, spacedim >::n_outer [private]

Number of mapping shape functions on the boundary.

template<int dim, int spacedim = dim>
const TensorProductPolynomials<dim>* MappingQ< dim, spacedim >::tensor_pols [private]

Pointer to the dim-dimensional tensor product polynomials used as shape functions for the Qp mapping of cells at the boundary.

template<int dim, int spacedim = dim>
const unsigned int MappingQ< dim, spacedim >::n_shape_functions [private]

Number of the Qp tensor product shape functions.

Reimplemented from MappingQ1< dim, spacedim >.

template<int dim, int spacedim = dim>
const std::vector<unsigned int> MappingQ< dim, spacedim >::renumber [private]

Mapping from lexicographic to to the Qp shape function numbering. Its size is dofs_per_cell.

template<int dim, int spacedim = dim>
const bool MappingQ< dim, spacedim >::use_mapping_q_on_all_cells [private]

If this flag is set true then MappingQ is used on all cells, not only on boundary cells.

template<int dim, int spacedim = dim>
const FE_Q<dim> MappingQ< dim, spacedim >::feq [private]

An FE_Q object which is only needed in 3D, since it knows how to reorder shape functions/DoFs on non-standard faces. This is used to reorder support points in the same way. We could make this a pointer to prevent construction in 1D and 2D, but since memory and time requirements are not particularly high this seems unnecessary at the moment.


The documentation for this class was generated from the following file:

deal.II documentation generated on Sat Aug 15 16:52:06 2009 by doxygen 1.5.9