Logically, they are input arguments to the fill_fe_values() functions, they are only
initialized in get_data() etc. Thus, make them const in the fill_fe_values functions.
There are places where mapping classes want to move data across from fill_fe_values
in terms of temporary arrays to the transform() function that may be called right
afterwards from FiniteElement::fill_fe_values(). In those cases, make these members
mutable.
* The determinant of the Jacobian in each quadrature point. Filled if
* #update_volume_elements.
*/
- std::vector<double> volume_elements;
+ mutable std::vector<double> volume_elements;
/**
* The positions of the mapped (generalized) support points.
CellSimilarity::Similarity
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &quadrature,
- InternalDataBase &internal,
+ const InternalDataBase &internal,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
std::vector<DerivativeForm<2,dim,spacedim> > &jacobian_grads,
std::vector<DerivativeForm<1,spacedim,dim> > &inverse_jacobians,
std::vector<Point<spacedim> > &cell_normal_vectors,
- const CellSimilarity::Similarity cell_similarity
- ) const=0;
+ const CellSimilarity::Similarity cell_similarity) const=0;
fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim-1> &quadrature,
- InternalDataBase &internal,
+ const InternalDataBase &internal,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_form,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1> &quadrature,
- InternalDataBase &internal,
+ const InternalDataBase &internal,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_form,
CellSimilarity::Similarity
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &quadrature,
- typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
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,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
std::vector<Point<dim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,dim> > &boundary_form,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1>& quadrature,
- typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
std::vector<Point<dim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,dim> > &boundary_form,
protected:
/**
* Storage for internal data of the scaling.
+ *
+ * This includes 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
{
* Length of the cell in different coordinate directions,
* <i>h<sub>x</sub></i>, <i>h<sub>y</sub></i>, <i>h<sub>z</sub></i>.
*/
- Tensor<1,dim> length;
+ mutable Tensor<1,dim> length;
/**
* The volume element
*/
- double volume_element;
+ mutable double volume_element;
/**
* Vector of all quadrature points. Especially, all points on all faces.
const unsigned int face_no,
const unsigned int sub_no,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<dim> > &quadrature_points,
std::vector<Point<dim> > &normal_vectors) const;
* Shape function at quadrature point. Shape functions are in tensor
* product order, so vertices must be reordered to obtain transformation.
*/
- double shape (const unsigned int qpoint,
- const unsigned int shape_nr) const;
+ const double &shape (const unsigned int qpoint,
+ const unsigned int shape_nr) const;
/**
* Shape function at quadrature point. See above.
/**
* Gradient of shape function in quadrature point. See above.
*/
- Tensor<1,dim> derivative (const unsigned int qpoint,
- const unsigned int shape_nr) const;
+ const Tensor<1,dim> &derivative (const unsigned int qpoint,
+ const unsigned int shape_nr) const;
/**
* Gradient of shape function in quadrature point. See above.
*
* Computed on each cell.
*/
- std::vector<DerivativeForm<1,dim, spacedim > > covariant;
+ mutable std::vector<DerivativeForm<1,dim, spacedim > > covariant;
/**
* Tensors of contravariant transformation at each of the quadrature
*
* Computed on each cell.
*/
- std::vector< DerivativeForm<1,dim,spacedim> > contravariant;
+ mutable std::vector< DerivativeForm<1,dim,spacedim> > contravariant;
/**
* Unit tangential vectors. Used for the computation of boundary forms and
/**
* Auxiliary vectors for internal use.
*/
- std::vector<std::vector<Tensor<1,spacedim> > > aux;
+ mutable std::vector<std::vector<Tensor<1,spacedim> > > aux;
/**
* Number of shape functions. If this is a Q1 mapping, then it is simply
const unsigned int npts,
const typename QProjector<dim>::DataSetDescriptor data_set,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points) const;
const unsigned int npts,
const typename QProjector<dim>::DataSetDescriptor data_set,
const std::vector<double> &weights,
- InternalData &mapping_data,
+ const InternalData &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_form,
CellSimilarity::Similarity
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
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,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1>& quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
template<int dim, int spacedim, class DH, class VECTOR>
inline
-double
+const double &
MappingFEField<dim,spacedim,DH,VECTOR>::InternalData::shape (const unsigned int qpoint,
const unsigned int shape_nr) const
{
template<int dim, int spacedim, class DH, class VECTOR>
inline
-Tensor<1,dim>
+const Tensor<1,dim> &
MappingFEField<dim,spacedim,DH,VECTOR>::InternalData::derivative (const unsigned int qpoint,
const unsigned int shape_nr) const
{
* If this flag is @p true we are on an interior cell and the @p
* mapping_q1_data is used.
*/
- bool use_mapping_q1_on_current_cell;
+ mutable bool use_mapping_q1_on_current_cell;
/**
* On interior cells @p MappingQ1 is used.
CellSimilarity::Similarity
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
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,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
typename std::vector<Tensor<1,spacedim> > &exterior_form,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1>& quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
typename std::vector<Tensor<1,spacedim> > &exterior_form,
* Shape function at quadrature point. Shape functions are in tensor
* product order, so vertices must be reordered to obtain transformation.
*/
- double shape (const unsigned int qpoint,
- const unsigned int shape_nr) const;
+ const double &shape (const unsigned int qpoint,
+ const unsigned int shape_nr) const;
/**
* Shape function at quadrature point. See above.
/**
* Gradient of shape function in quadrature point. See above.
*/
- Tensor<1,dim> derivative (const unsigned int qpoint,
- const unsigned int shape_nr) const;
+ const Tensor<1,dim> &derivative (const unsigned int qpoint,
+ const unsigned int shape_nr) const;
/**
* Gradient of shape function in quadrature point. See above.
/**
* Second derivative of shape function in quadrature point. See above.
*/
- Tensor<2,dim> second_derivative (const unsigned int qpoint,
- const unsigned int shape_nr) const;
+ 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.
*
* Computed on each cell.
*/
- std::vector<DerivativeForm<1,dim, spacedim > > covariant;
+ mutable std::vector<DerivativeForm<1,dim, spacedim > > covariant;
/**
* Tensors of contravariant transformation at each of the quadrature
*
* Computed on each cell.
*/
- std::vector< DerivativeForm<1,dim,spacedim> > contravariant;
+ mutable std::vector< DerivativeForm<1,dim,spacedim> > contravariant;
/**
* Unit tangential vectors. Used for the computation of boundary forms and
/**
* Auxiliary vectors for internal use.
*/
- std::vector<std::vector<Tensor<1,spacedim> > > aux;
+ mutable std::vector<std::vector<Tensor<1,spacedim> > > aux;
/**
* Stores the support points of the mapping shape functions on the @p
* cell_of_current_support_points.
*/
- std::vector<Point<spacedim> > mapping_support_points;
+ mutable std::vector<Point<spacedim> > mapping_support_points;
/**
* Stores the cell of which the @p mapping_support_points are stored.
*/
- typename Triangulation<dim,spacedim>::cell_iterator cell_of_current_support_points;
+ mutable typename Triangulation<dim,spacedim>::cell_iterator cell_of_current_support_points;
/**
* Default value of this flag is @p true. If <tt>*this</tt> is an object
CellSimilarity::Similarity
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
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,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
typename std::vector<Tensor<1,spacedim> > &boundary_form,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1>& quadrature,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
typename std::vector<Tensor<1,spacedim> > &boundary_form,
const unsigned int npts,
const DataSetDescriptor data_set,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points) const;
/**
const unsigned int npts,
const DataSetDescriptor data_set,
const std::vector<double> &weights,
- InternalData &mapping_data,
+ const InternalData &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_form,
template<int dim, int spacedim>
inline
-double
+const double &
MappingQ1<dim,spacedim>::InternalData::shape (const unsigned int qpoint,
const unsigned int shape_nr) const
{
template<int dim, int spacedim>
inline
-Tensor<1,dim>
+const Tensor<1,dim> &
MappingQ1<dim,spacedim>::InternalData::derivative (const unsigned int qpoint,
const unsigned int shape_nr) const
{
template <int dim, int spacedim>
inline
-Tensor<2,dim>
+const Tensor<2,dim> &
MappingQ1<dim,spacedim>::InternalData::second_derivative (const unsigned int qpoint,
const unsigned int shape_nr) const
{
const unsigned int face_no,
const unsigned int sub_no,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<dim> > &quadrature_points,
std::vector<Point<dim> > &normal_vectors) const
{
MappingCartesian<dim, spacedim>::
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector< DerivativeForm<1,dim,spacedim> > &jacobians,
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0, ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0, ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
std::vector<Point<dim> > dummy;
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
std::vector<Point<dim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,dim> > &boundary_forms,
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
compute_fill (cell, face_no, invalid_face_number,
CellSimilarity::none,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim, spacedim>::InternalDataBase &mapping_data,
std::vector<Point<dim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,dim> > &boundary_forms,
// data for this class. fails with
// an exception if that is not
// possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0, ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0, ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
compute_fill (cell, face_no, sub_no, CellSimilarity::none,
data,
MappingFEField<dim,spacedim,VECTOR,DH>::fill_fe_values (
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0, ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0, ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
const unsigned int n_q_points=q.size();
const CellSimilarity::Similarity updated_cell_similarity
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
const unsigned int n_q_points=q.size();
this->compute_fill_face (cell, face_no, numbers::invalid_unsigned_int,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
const unsigned int n_q_points=q.size();
this->compute_fill_face (cell, face_no, sub_no,
const unsigned int n_q_points,
const typename QProjector<dim>::DataSetDescriptor data_set,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points) const
{
const UpdateFlags update_flags(data.current_update_flags());
const unsigned int n_q_points,//npts
const typename QProjector<dim>::DataSetDescriptor data_set,
const std::vector<double> &weights,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_forms,
MappingQ<dim,spacedim>::fill_fe_values (
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0, ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0, ExcInternalError());
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
// check whether this cell needs the full mapping or can be treated by a
// reduced Q1 mapping, e.g. if the cell is in the interior of the domain
// depending on this result, use this or the other data object for the
// mapping.
- typename MappingQ1<dim,spacedim>::InternalData *
+ const typename MappingQ1<dim,spacedim>::InternalData *
p_data = (data.use_mapping_q1_on_current_cell
?
&data.mapping_q1_data
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
// check whether this cell needs the full mapping or can be treated by a
// reduced Q1 mapping, e.g. if the cell is entirely in the interior of the
// depending on this result, use this or the other data object for the
// mapping
- typename MappingQ1<dim,spacedim>::InternalData *p_data=0;
- if (data.use_mapping_q1_on_current_cell)
- p_data=&data.mapping_q1_data;
- else
- p_data=&data;
+ const typename MappingQ1<dim,spacedim>::InternalData *p_data
+ = (data.use_mapping_q1_on_current_cell
+ ?
+ &data.mapping_q1_data
+ :
+ &data);
const unsigned int n_q_points=q.size();
this->compute_fill_face (cell, face_no, numbers::invalid_unsigned_int,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &exterior_forms,
{
// convert data object to internal data for this class. fails with an
// exception if that is not possible
- Assert (dynamic_cast<InternalData *> (&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *> (&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &> (mapping_data);
+ const InternalData &data = static_cast<const InternalData &> (mapping_data);
// check whether this cell needs the full mapping or can be treated by a
// reduced Q1 mapping, e.g. if the cell is entirely in the interior of the
// depending on this result, use this or the other data object for the
// mapping
- typename MappingQ1<dim,spacedim>::InternalData *p_data=0;
- if (data.use_mapping_q1_on_current_cell)
- p_data=&data.mapping_q1_data;
- else
- p_data=&data;
+ const typename MappingQ1<dim,spacedim>::InternalData *p_data
+ = (data.use_mapping_q1_on_current_cell
+ ?
+ &data.mapping_q1_data
+ :
+ &data);
const unsigned int n_q_points=q.size();
this->compute_fill_face (cell, face_no, sub_no,
const unsigned int n_q_points,
const DataSetDescriptor data_set,
const CellSimilarity::Similarity cell_similarity,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points) const
{
const UpdateFlags update_flags(data.current_update_flags());
MappingQ1<dim,spacedim>::fill_fe_values (
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Quadrature<dim> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<DerivativeForm<1,dim,spacedim> > &jacobians,
const CellSimilarity::Similarity cell_similarity) const
{
// ensure that the following static_cast is really correct:
- Assert (dynamic_cast<InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &>(mapping_data);
+ const InternalData &data = static_cast<const InternalData &>(mapping_data);
const unsigned int n_q_points=q.size();
const unsigned int subface_no,
const unsigned int n_q_points,
const std::vector<double> &weights,
- typename dealii::MappingQ1<dim,spacedim>::InternalData &data,
+ const typename dealii::MappingQ1<dim,spacedim>::InternalData &data,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_forms,
std::vector<Point<spacedim> > &normal_vectors,
const unsigned int n_q_points,
const DataSetDescriptor data_set,
const std::vector<double> &weights,
- InternalData &data,
+ const InternalData &data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_forms,
fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_forms,
{
// ensure that the following cast
// is really correct:
- Assert (dynamic_cast<InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &>(mapping_data);
+ const InternalData &data = static_cast<const InternalData &>(mapping_data);
const unsigned int n_q_points = q.size();
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<dim-1> &q,
- typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
std::vector<Point<spacedim> > &quadrature_points,
std::vector<double> &JxW_values,
std::vector<Tensor<1,spacedim> > &boundary_forms,
{
// ensure that the following cast
// is really correct:
- Assert (dynamic_cast<InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
ExcInternalError());
- InternalData &data = static_cast<InternalData &>(mapping_data);
+ const InternalData &data = static_cast<const InternalData &>(mapping_data);
const unsigned int n_q_points = q.size();