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

Inheritance diagram for MappingQ1< dim, spacedim >:
Inheritance graph
[legend]

List of all members.

Classes

class  InternalData

Public Types

typedef QProjector< dim >
::DataSetDescriptor 
DataSetDescriptor

Public Member Functions

 MappingQ1 ()
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
virtual Mapping< dim, spacedim > * clone () const
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 > > &boundary_form, typename std::vector< Point< spacedim > > &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 > > &boundary_form, typename std::vector< Point< spacedim > > &normal_vectors) const
void compute_shapes (const std::vector< Point< dim > > &unit_points, InternalData &data) const
void compute_data (const UpdateFlags flags, const Quadrature< dim > &quadrature, const unsigned int n_orig_q_points, InternalData &data) const
void compute_face_data (const UpdateFlags flags, const Quadrature< dim > &quadrature, const unsigned int n_orig_q_points, InternalData &data) const
void compute_fill (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int npts, const DataSetDescriptor data_set, const enum CellSimilarity::Similarity cell_similarity, InternalData &data, std::vector< Point< spacedim > > &quadrature_points) const
void compute_fill_face (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const unsigned int npts, const DataSetDescriptor data_set, const std::vector< double > &weights, InternalData &mapping_data, std::vector< Point< dim > > &quadrature_points, std::vector< double > &JxW_values, std::vector< Tensor< 1, dim > > &boundary_form, std::vector< Point< spacedim > > &normal_vectors) const
virtual void compute_shapes_virtual (const std::vector< Point< dim > > &unit_points, InternalData &data) const
Point< spacedim > transform_unit_to_real_cell_internal (const InternalData &mdata) const
void transform_real_to_unit_cell_internal (const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, InternalData &mdata, Point< dim > &p_unit) const

Private Member Functions

virtual UpdateFlags update_once (const UpdateFlags flags) const
virtual UpdateFlags update_each (const UpdateFlags flags) const
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_mapping_support_points (const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim > > &a) const

Static Private Attributes

static const unsigned int n_shape_functions = GeometryInfo<dim>::vertices_per_cell

Detailed Description

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

Mapping of general quadrilateral/hexahedra by d-linear shape functions.

This function maps the unit cell to a general grid cell with straight lines in $d$ dimensions (remark that in 3D the surfaces may be curved, even if the edges are not). This is the well-known mapping for polyhedral domains.

Shape function for this mapping are the same as for the finite element FE_Q of order 1. Therefore, coupling these two yields an isoparametric element.

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

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

Member Typedef Documentation

template<int dim, int spacedim = dim>
typedef QProjector<dim>::DataSetDescriptor MappingQ1< dim, spacedim >::DataSetDescriptor

Declare a convenience typedef for the class that describes offsets into quadrature formulas projected onto faces and subfaces.


Constructor & Destructor Documentation

template<int dim, int spacedim = dim>
MappingQ1< dim, spacedim >::MappingQ1 (  ) 

Default constructor.


Member Function Documentation

template<int dim, int spacedim = dim>
virtual Point<spacedim> MappingQ1< 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.

Implements Mapping< dim, spacedim >.

Reimplemented in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Point<dim> MappingQ1< 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.

Implements Mapping< dim, spacedim >.

Reimplemented in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ1< 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 in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual void MappingQ1< 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 in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>* MappingQ1< 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.

Implements Mapping< dim, spacedim >.

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

template<int dim, int spacedim = dim>
virtual void MappingQ1< 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 [virtual]
template<int dim, int spacedim = dim>
virtual void MappingQ1< 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 > > &  boundary_form,
typename std::vector< Point< spacedim > > &  normal_vectors 
) const [virtual]

Implementation of the interface in Mapping.

template<int dim, int spacedim = dim>
virtual void MappingQ1< 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 > > &  boundary_form,
typename std::vector< Point< spacedim > > &  normal_vectors 
) const [virtual]

Implementation of the interface in Mapping.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::compute_shapes ( const std::vector< Point< dim > > &  unit_points,
InternalData data 
) const

Compute shape values and/or derivatives.

Calls either the compute_shapes_virtual of this class or that of the derived class, depending on whether data.is_mapping_q1_data equals true or false.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::compute_data ( const UpdateFlags  flags,
const Quadrature< dim > &  quadrature,
const unsigned int  n_orig_q_points,
InternalData data 
) const

Do the computations for the get_data functions. Here, the data vectors of InternalData are reinitialized to proper size and shape values are computed.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::compute_face_data ( const UpdateFlags  flags,
const Quadrature< dim > &  quadrature,
const unsigned int  n_orig_q_points,
InternalData data 
) const

Do the computations for the get_face_data functions. Here, the data vectors of InternalData are reinitialized to proper size and shape values and derivatives are computed. Furthermore unit_tangential vectors of the face are computed.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::compute_fill ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const unsigned int  npts,
const DataSetDescriptor  data_set,
const enum CellSimilarity::Similarity  cell_similarity,
InternalData data,
std::vector< Point< spacedim > > &  quadrature_points 
) const

Do the computation for the fill_* functions.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::compute_fill_face ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const unsigned int  face_no,
const unsigned int  subface_no,
const unsigned int  npts,
const DataSetDescriptor  data_set,
const std::vector< double > &  weights,
InternalData mapping_data,
std::vector< Point< dim > > &  quadrature_points,
std::vector< double > &  JxW_values,
std::vector< Tensor< 1, dim > > &  boundary_form,
std::vector< Point< spacedim > > &  normal_vectors 
) const

Do the computation for the fill_* functions.

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

Compute shape values and/or derivatives.

template<int dim, int spacedim = dim>
Point<spacedim> MappingQ1< dim, spacedim >::transform_unit_to_real_cell_internal ( const InternalData mdata  )  const

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

This function is called by transform_unit_to_real_cell and multiply (through the Newton iteration) by transform_real_to_unit_cell_internal.

Takes a reference to an InternalData that must already include the shape values at point p and the mapping support points of the cell.

This InternalData argument avoids multiple computations of the shape values at point p and especially multiple computations of the mapping support points.

template<int dim, int spacedim = dim>
void MappingQ1< dim, spacedim >::transform_real_to_unit_cell_internal ( const typename Triangulation< dim, spacedim >::cell_iterator &  cell,
const Point< spacedim > &  p,
InternalData mdata,
Point< dim > &  p_unit 
) const

Transforms the point p on the real cell to the point p_unit on the unit cell cell by a Newton iteration.

Takes a reference to an InternalData that is assumed to be previously created by the get_data function with UpdateFlags including update_transformation_values and update_transformation_gradients and a one point Quadrature including the given point p_unit. Hence this function assumes that mdata already includes the transformation shape values and gradients computed at p_unit.

These assumptions should be fulfilled by the calling function. That is up to now only the function transform_real_to_unit_cell and its overloaded versions. mdata will be changed by this function.

template<int dim, int spacedim = dim>
virtual UpdateFlags MappingQ1< dim, spacedim >::update_once ( const UpdateFlags  flags  )  const [private, virtual]

Implementation of the interface in Mapping.

Description of effects:

  • if update_quadrature_points is required, the output will contain update_transformation_values. This computes the values of the transformation basis polynomials at the unit cell quadrature points.
  • if any of update_covariant_transformation, update_contravariant_transformation, update_JxW_values, update_boundary_forms, update_normal_vectors is required, the output will contain update_transformation_gradients to compute derivatives of the transformation basis polynomials.

Implements Mapping< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual UpdateFlags MappingQ1< dim, spacedim >::update_each ( const UpdateFlags  flags  )  const [private, virtual]

Implementation of the interface in Mapping.

Description of effects if flags contains:

  • update_quadrature_points is copied to the output to compute the quadrature points on the real cell.
  • update_JxW_values is copied and requires update_boundary_forms on faces. The latter, because the surface element is just the norm of the boundary form.
  • update_normal_vectors is copied and requires update_boundary_forms. The latter, because the normal vector is the normalized boundary form.
  • update_covariant_transformation is copied and requires update_contravariant_transformation, since it is computed as the inverse of the latter.
  • update_JxW_values is copied and requires update_contravariant_transformation, since it is computed as one over determinant of the latter.
  • update_boundary_forms is copied and requires update_contravariant_transformation, since the boundary form is computed as the contravariant image of the normal vector to the unit cell.

Implements Mapping< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ1< 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.

Implements Mapping< dim, spacedim >.

Reimplemented in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ1< 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.

Implements Mapping< dim, spacedim >.

Reimplemented in MappingQ< dim, spacedim >.

template<int dim, int spacedim = dim>
virtual Mapping<dim,spacedim>::InternalDataBase* MappingQ1< 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.

Implements Mapping< dim, spacedim >.

Reimplemented in MappingQ< dim, spacedim >.

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

Computes the support points of the mapping. For MappingQ1 these are the vertices. However, other classes may override this function. 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.


Member Data Documentation

template<int dim, int spacedim = dim>
const unsigned int MappingQ1< dim, spacedim >::n_shape_functions = GeometryInfo<dim>::vertices_per_cell [static, private]

Number of shape functions. Is simply the number of vertices per cell for the Q1 mapping.

Reimplemented in MappingQ< dim, spacedim >.


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

deal.II documentation generated on Mon Nov 23 22:57:53 2009 by doxygen 1.6.1