* the documentation of FiniteElement or the one of Triangulation.
*
* @note Since the boundary description is closely tied to the unit cell
- * support points, new boundary descriptions need to explicitly use the Gauss-
- * Lobatto points.
+ * support points, new boundary descriptions need to explicitly use the
+ * Gauss-Lobatto points.
*
- * @author Ralf Hartmann, 2000, 2001, 2005; Guido Kanschat 2000, 2001
+ * @author Ralf Hartmann, 2000, 2001, 2005; Guido Kanschat 2000, 2001, Wolfgang Bangerth, 2015
*/
template <int dim, int spacedim=dim>
class MappingQ : public MappingQ1<dim,spacedim>
mutable bool use_mapping_q1_on_current_cell;
/**
- * A structure to store the corresponding information for the pure
+ * A pointer to a structure to store the information for the pure
* $Q_1$ mapping that is, by default, used on all interior cells.
*/
- typename MappingQ1<dim,spacedim>::InternalData mapping_q1_data;
+ std_cxx11::unique_ptr<typename MappingQ1<dim,spacedim>::InternalData> mapping_q1_data;
};
protected:
* Mapping of the reference to cell to a general
* quadrilateral/hexahedra by $d$-linear shape functions.
*
- * This mapping implemented by this class maps the reference (unit) cell
+ * The mapping implemented by this class maps the reference (unit) cell
* to a general grid cell with
* straight lines in $d$ dimensions. (Note, however, that in 3D the
* <i>faces</i> of a general, trilinearly mapped cell may be curved, even if the
* edges are not). This is the standard mapping used for polyhedral domains. It
- * is also the mapping used throughout deal.II for many functions that two
- * variants, one that allows to pass a mapping argument explicitly and one
+ * 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.
*
* The shape functions for this mapping are the same as for the finite element FE_Q
* of order 1. Therefore, coupling these two yields an isoparametric element.
*
- * @author Guido Kanschat, 2000, 2001; Ralf Hartmann, 2000, 2001, 2005
+ * @author Guido Kanschat, 2000, 2001; Ralf Hartmann, 2000, 2001, 2005, Wolfgang Bangerth, 2015
*/
template <int dim, int spacedim=dim>
class MappingQ1 : public MappingQGeneric<dim,spacedim>
/**
* Computes the support points of the mapping. For @p 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
+ * the vertices, as obtained by calling Mapping::get_vertices().
+ *
+ * By default, that function just computes the locations of the vertices as
+ * reported by the Triangulation. 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.
*/
- virtual void compute_mapping_support_points(
- const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- std::vector<Point<spacedim> > &a) const;
+ virtual
+ void
+ compute_mapping_support_points(const typename Triangulation<dim,spacedim>::cell_iterator &cell,
+ std::vector<Point<spacedim> > &a) const;
};
MappingQ<dim,spacedim>::InternalData::InternalData (const unsigned int polynomial_degree)
:
MappingQ1<dim,spacedim>::InternalData(polynomial_degree),
- use_mapping_q1_on_current_cell(false),
- mapping_q1_data(1)
+ use_mapping_q1_on_current_cell(false)
{}
std_cxx11::cref(quadrature),
quadrature.size())));
if (!use_mapping_q_on_all_cells)
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize,
- &data->mapping_q1_data,
- update_flags,
- std_cxx11::cref(quadrature),
- quadrature.size())));
- tasks.join_all ();
+ {
+ data->mapping_q1_data.reset (new typename MappingQ1<dim,spacedim>::InternalData(1));
+ tasks += Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize,
+ data->mapping_q1_data.get(),
+ update_flags,
+ std_cxx11::cref(quadrature),
+ quadrature.size())));
+ }
+ tasks.join_all ();
return data;
}
std_cxx11::cref(q),
quadrature.size())));
if (!use_mapping_q_on_all_cells)
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
- &data->mapping_q1_data,
- update_flags,
- std_cxx11::cref(q),
- quadrature.size())));
- tasks.join_all ();
+ {
+ data->mapping_q1_data.reset (new typename MappingQ1<dim,spacedim>::InternalData(1));
+ tasks += Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
+ data->mapping_q1_data.get(),
+ update_flags,
+ std_cxx11::cref(q),
+ quadrature.size())));
+ }
+ tasks.join_all ();
return data;
}
std_cxx11::cref(q),
quadrature.size())));
if (!use_mapping_q_on_all_cells)
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
- &data->mapping_q1_data,
- update_flags,
- std_cxx11::cref(q),
- quadrature.size())));
- tasks.join_all ();
+ {
+ data->mapping_q1_data.reset (new typename MappingQ1<dim,spacedim>::InternalData(1));
+ tasks += Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
+ data->mapping_q1_data.get(),
+ update_flags,
+ std_cxx11::cref(q),
+ quadrature.size())));
+ }
+ tasks.join_all ();
return data;
}
const typename MappingQ1<dim,spacedim>::InternalData *
p_data = (data.use_mapping_q1_on_current_cell
?
- &data.mapping_q1_data
+ data.mapping_q1_data.get()
:
&data);
const typename MappingQ1<dim,spacedim>::InternalData *p_data
= (data.use_mapping_q1_on_current_cell
?
- &data.mapping_q1_data
+ data.mapping_q1_data.get()
:
&data);
MappingQ1<dim,spacedim>::fill_fe_face_values(cell,
const typename MappingQ1<dim,spacedim>::InternalData *p_data
= (data.use_mapping_q1_on_current_cell
?
- &data.mapping_q1_data
+ data.mapping_q1_data.get()
:
&data);
MappingQ1<dim,spacedim>::fill_fe_subface_values(cell,
{
// If we only use the Q1-portion, we have to extract that data object
if (data->use_mapping_q1_on_current_cell)
- q1_data = &data->mapping_q1_data;
+ q1_data = data->mapping_q1_data.get();
}
// Now, q1_data should have the right tensors in it and we call the base
{
// If we only use the Q1-portion, we have to extract that data object
if (data->use_mapping_q1_on_current_cell)
- q1_data = &data->mapping_q1_data;
+ q1_data = data->mapping_q1_data.get();
}
// Now, q1_data should have the right tensors in it and we call the base
{
// If we only use the Q1-portion, we have to extract that data object
if (data->use_mapping_q1_on_current_cell)
- q1_data = &data->mapping_q1_data;
+ q1_data = data->mapping_q1_data.get();
}
// Now, q1_data should have the right tensors in it and we call the base
{
// If we only use the Q1-portion, we have to extract that data object
if (data->use_mapping_q1_on_current_cell)
- q1_data = &data->mapping_q1_data;
+ q1_data = data->mapping_q1_data.get();
}
// Now, q1_data should have the right tensors in it and we call the base
{
// If we only use the Q1-portion, we have to extract that data object
if (data->use_mapping_q1_on_current_cell)
- q1_data = &data->mapping_q1_data;
+ q1_data = data->mapping_q1_data.get();
}
// Now, q1_data should have the right tensors in it and we call the base
typename MappingQ1<dim,spacedim>::InternalData
*p_data = (mdata->use_mapping_q1_on_current_cell ?
- &mdata->mapping_q1_data :
+ mdata->mapping_q1_data.get() :
&*mdata);
compute_mapping_support_points(cell, p_data->mapping_support_points);