16 #include <deal.II/base/utilities.h> 17 #include <deal.II/base/polynomial.h> 18 #include <deal.II/base/quadrature.h> 19 #include <deal.II/base/quadrature_lib.h> 20 #include <deal.II/base/memory_consumption.h> 21 #include <deal.II/base/tensor_product_polynomials.h> 22 #include <deal.II/base/std_cxx11/unique_ptr.h> 23 #include <deal.II/lac/full_matrix.h> 24 #include <deal.II/grid/tria_iterator.h> 25 #include <deal.II/dofs/dof_accessor.h> 26 #include <deal.II/fe/mapping_q.h> 27 #include <deal.II/fe/fe_q.h> 28 #include <deal.II/fe/fe_values.h> 32 DEAL_II_NAMESPACE_OPEN
35 template<
int dim,
int spacedim>
38 use_mapping_q1_on_current_cell(false)
43 template<
int dim,
int spacedim>
55 template<
int dim,
int spacedim>
86 template<
int dim,
int spacedim>
89 polynomial_degree (mapping.polynomial_degree),
90 use_mapping_q_on_all_cells (mapping.use_mapping_q_on_all_cells),
93 q1_mapping (dynamic_cast<
MappingQGeneric<dim,spacedim>*>(mapping.q1_mapping->clone())),
96 qp_mapping (this->polynomial_degree>1
105 template<
int dim,
int spacedim>
109 return polynomial_degree;
114 template <
int dim,
int spacedim>
124 template<
int dim,
int spacedim>
128 return (q1_mapping->requires_update_flags(in)
130 qp_mapping->requires_update_flags(in));
135 template<
int dim,
int spacedim>
149 if (!use_mapping_q_on_all_cells)
150 data->
mapping_q1_data.reset (q1_mapping->get_data (update_flags, quadrature));
159 template<
int dim,
int spacedim>
173 if (!use_mapping_q_on_all_cells)
174 data->
mapping_q1_data.reset (q1_mapping->get_face_data (update_flags, quadrature));
183 template<
int dim,
int spacedim>
197 if (!use_mapping_q_on_all_cells)
198 data->
mapping_q1_data.reset (q1_mapping->get_subface_data (update_flags, quadrature));
208 template<
int dim,
int spacedim>
220 const InternalData &data =
static_cast<const InternalData &
> (internal_data);
224 data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
225 || cell->has_boundary_lines());
235 = ((data.use_mapping_q1_on_current_cell ==
false)
237 (this->polynomial_degree > 1)
245 if (data.use_mapping_q1_on_current_cell)
246 q1_mapping->fill_fe_values (cell,
247 updated_cell_similarity,
249 *data.mapping_q1_data,
252 qp_mapping->fill_fe_values(cell,
253 updated_cell_similarity,
255 *data.mapping_qp_data,
258 return updated_cell_similarity;
263 template<
int dim,
int spacedim>
267 const unsigned int face_no,
274 Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
276 const InternalData &data =
static_cast<const InternalData &
> (internal_data);
284 data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
285 || cell->has_boundary_lines());
289 if (data.use_mapping_q1_on_current_cell)
290 q1_mapping->fill_fe_face_values (cell,
293 *data.mapping_q1_data,
296 qp_mapping->fill_fe_face_values(cell,
299 *data.mapping_qp_data,
304 template<
int dim,
int spacedim>
308 const unsigned int face_no,
309 const unsigned int subface_no,
316 Assert (dynamic_cast<const InternalData *> (&internal_data) != 0,
318 const InternalData &data =
static_cast<const InternalData &
> (internal_data);
326 data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
327 || cell->has_boundary_lines());
331 if (data.use_mapping_q1_on_current_cell)
332 q1_mapping->fill_fe_subface_values (cell,
336 *data.mapping_q1_data,
339 qp_mapping->fill_fe_subface_values(cell,
343 *data.mapping_qp_data,
349 template<
int dim,
int spacedim>
365 q1_mapping->transform (input, mapping_type, *data->
mapping_q1_data, output);
368 qp_mapping->transform(input, mapping_type, *data->
mapping_qp_data, output);
373 template<
int dim,
int spacedim>
389 q1_mapping->transform (input, mapping_type, *data->
mapping_q1_data, output);
392 qp_mapping->transform(input, mapping_type, *data->
mapping_qp_data, output);
397 template<
int dim,
int spacedim>
413 q1_mapping->transform (input, mapping_type, *data->
mapping_q1_data, output);
416 qp_mapping->transform(input, mapping_type, *data->
mapping_qp_data, output);
421 template<
int dim,
int spacedim>
437 q1_mapping->transform (input, mapping_type, *data->
mapping_q1_data, output);
440 qp_mapping->transform(input, mapping_type, *data->
mapping_qp_data, output);
445 template<
int dim,
int spacedim>
460 q1_mapping->transform (input, mapping_type, *data->
mapping_q1_data, output);
463 qp_mapping->transform(input, mapping_type, *data->
mapping_qp_data, output);
468 template<
int dim,
int spacedim>
477 if (use_mapping_q_on_all_cells || cell->has_boundary_lines())
478 return qp_mapping->transform_unit_to_real_cell (cell, p);
480 return q1_mapping->transform_unit_to_real_cell (cell, p);
485 template<
int dim,
int spacedim>
491 if (cell->has_boundary_lines()
493 use_mapping_q_on_all_cells
496 return qp_mapping->transform_real_to_unit_cell(cell, p);
498 return q1_mapping->transform_real_to_unit_cell(cell, p);
503 template<
int dim,
int spacedim>
508 this->use_mapping_q_on_all_cells);
514 #include "mapping_q.inst" 517 DEAL_II_NAMESPACE_CLOSE
unsigned int get_degree() const
virtual InternalData * get_face_data(const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const
std_cxx11::shared_ptr< const MappingQGeneric< dim, spacedim > > q1_mapping
#define AssertDimension(dim1, dim2)
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const
virtual InternalData * get_subface_data(const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const
bool use_mapping_q1_on_current_cell
std_cxx11::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_q1_data
const bool use_mapping_q_on_all_cells
virtual std::size_t memory_consumption() const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const
#define Assert(cond, exc)
Abstract base class for mapping classes.
const unsigned int polynomial_degree
virtual Mapping< dim, spacedim > * clone() const
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std_cxx11::unique_ptr< typename MappingQGeneric< dim, spacedim >::InternalData > mapping_qp_data
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const
virtual InternalData * get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const
std_cxx11::shared_ptr< const MappingQGeneric< dim, spacedim > > qp_mapping
MappingQ(const unsigned int polynomial_degree, const bool use_mapping_q_on_all_cells=false)
virtual bool preserves_vertex_locations() const
Task< RT > new_task(const std_cxx11::function< RT()> &function)
static ::ExceptionBase & ExcInternalError()