template<int dim, int spacedim>
MappingQ<dim,spacedim>::InternalData::InternalData (const unsigned int polynomial_degree)
:
- MappingQ1<dim,spacedim>::InternalData(polynomial_degree),
+ MappingQGeneric<dim,spacedim>::InternalData(polynomial_degree),
use_mapping_q1_on_current_cell(false)
{}
use_mapping_q_on_all_cells (use_mapping_q_on_all_cells
|| (dim != spacedim)),
feq(degree),
+ q1_mapping (this->use_mapping_q_on_all_cells
+ ?
+ 0
+ :
+ new MappingQ1<dim,spacedim>()),
line_support_points(degree+1)
{
Assert(n_inner+n_outer==Utilities::fixed_power<dim>(degree+1),
+template<int dim, int spacedim>
+MappingQ<dim,spacedim>::MappingQ (const MappingQ<dim,spacedim> &mapping)
+ :
+ MappingQ1<dim,spacedim>(mapping.get_degree()),
+ n_inner(mapping.n_inner),
+ n_outer(mapping.n_outer),
+ use_mapping_q_on_all_cells (mapping.use_mapping_q_on_all_cells),
+ feq(mapping.get_degree()),
+ q1_mapping (mapping.q1_mapping != 0
+ ?
+ dynamic_cast<MappingQ1<dim,spacedim>*>(mapping.q1_mapping->clone())
+ :
+ 0),
+ line_support_points(mapping.line_support_points)
+{
+ Assert(n_inner+n_outer==Utilities::fixed_power<dim>(this->polynomial_degree+1),
+ ExcInternalError());
+
+ // build laplace_on_quad_vector
+ if (this->polynomial_degree>1)
+ {
+ if (dim >= 2)
+ set_laplace_on_quad_vector(laplace_on_quad_vector);
+ if (dim >= 3)
+ set_laplace_on_hex_vector(laplace_on_hex_vector);
+ }
+}
+
+
+
template<int dim, int spacedim>
typename MappingQ<dim,spacedim>::InternalData *
MappingQ<dim,spacedim>::get_data (const UpdateFlags update_flags,
InternalData *data = new InternalData(this->polynomial_degree);
// fill the data of both the Q_p and the Q_1 objects in parallel
- Threads::TaskGroup<> tasks;
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize,
- data,
- update_flags,
- std_cxx11::cref(quadrature),
- quadrature.size())));
+ Threads::Task<>
+ task = Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize,
+ data,
+ update_flags,
+ std_cxx11::cref(quadrature),
+ quadrature.size())));
if (!use_mapping_q_on_all_cells)
- {
- 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())));
- }
+ data->mapping_q1_data.reset (q1_mapping->get_data (update_flags, quadrature));
- tasks.join_all ();
+ task.join ();
return data;
}
template<int dim, int spacedim>
-typename Mapping<dim,spacedim>::InternalDataBase *
+typename MappingQ<dim,spacedim>::InternalData *
MappingQ<dim,spacedim>::get_face_data (const UpdateFlags update_flags,
const Quadrature<dim-1>& quadrature) const
{
const Quadrature<dim> q (QProjector<dim>::project_to_all_faces(quadrature));
// fill the data of both the Q_p and the Q_1 objects in parallel
- Threads::TaskGroup<> tasks;
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
- data,
- update_flags,
- std_cxx11::cref(q),
- quadrature.size())));
+ Threads::Task<>
+ task = Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
+ data,
+ update_flags,
+ std_cxx11::cref(q),
+ quadrature.size())));
if (!use_mapping_q_on_all_cells)
- {
- 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())));
- }
+ data->mapping_q1_data.reset (q1_mapping->get_face_data (update_flags, quadrature));
- tasks.join_all ();
+ task.join ();
return data;
}
template<int dim, int spacedim>
-typename Mapping<dim,spacedim>::InternalDataBase *
+typename MappingQ<dim,spacedim>::InternalData *
MappingQ<dim,spacedim>::get_subface_data (const UpdateFlags update_flags,
const Quadrature<dim-1>& quadrature) const
{
const Quadrature<dim> q (QProjector<dim>::project_to_all_subfaces(quadrature));
// fill the data of both the Q_p and the Q_1 objects in parallel
- Threads::TaskGroup<> tasks;
- tasks += Threads::new_task (std_cxx11::function<void()>
- (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
- data,
- update_flags,
- std_cxx11::cref(q),
- quadrature.size())));
+ Threads::Task<>
+ task = Threads::new_task (std_cxx11::function<void()>
+ (std_cxx11::bind(&MappingQ1<dim,spacedim>::InternalData::initialize_face,
+ data,
+ update_flags,
+ std_cxx11::cref(q),
+ quadrature.size())));
if (!use_mapping_q_on_all_cells)
- {
- 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())));
- }
+ data->mapping_q1_data.reset (q1_mapping->get_subface_data (update_flags, quadrature));
- tasks.join_all ();
+ task.join ();
return data;
}
data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
|| cell->has_boundary_lines());
- // depending on this result, use this or the other data object for the
- // mapping.
- const typename MappingQ1<dim,spacedim>::InternalData *
- p_data = (data.use_mapping_q1_on_current_cell
- ?
- data.mapping_q1_data.get()
- :
- &data);
// call the base class. we need to ensure that the flag indicating whether
// we can use some similarity has to be modified - for a general MappingQ,
CellSimilarity::invalid_next_cell
:
cell_similarity);
- MappingQ1<dim,spacedim>::fill_fe_values(cell,
- updated_cell_similarity,
- quadrature,
- *p_data,
- output_data);
+
+ // depending on the results above, decide whether the Q1 mapping or
+ // the Qp mapping needs to handle this cell
+ if (data.use_mapping_q1_on_current_cell)
+ q1_mapping->fill_fe_values (cell,
+ updated_cell_similarity,
+ quadrature,
+ *data.mapping_q1_data,
+ output_data);
+ else
+ MappingQ1<dim,spacedim>::fill_fe_values(cell,
+ updated_cell_similarity,
+ quadrature,
+ data,
+ output_data);
return updated_cell_similarity;
}
data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
|| cell->has_boundary_lines());
- // depending on this result, use this or the other data object for the
- // mapping and call the function in the base class with this
- // data object to do the work
- const typename MappingQ1<dim,spacedim>::InternalData *p_data
- = (data.use_mapping_q1_on_current_cell
- ?
- data.mapping_q1_data.get()
- :
- &data);
- MappingQ1<dim,spacedim>::fill_fe_face_values(cell,
- face_no,
- quadrature,
- *p_data,
- output_data);
+ // depending on the results above, decide whether the Q1 mapping or
+ // the Qp mapping needs to handle this cell
+ if (data.use_mapping_q1_on_current_cell)
+ q1_mapping->fill_fe_face_values (cell,
+ face_no,
+ quadrature,
+ *data.mapping_q1_data,
+ output_data);
+ else
+ MappingQ1<dim,spacedim>::fill_fe_face_values(cell,
+ face_no,
+ quadrature,
+ data,
+ output_data);
}
data.use_mapping_q1_on_current_cell = !(use_mapping_q_on_all_cells
|| cell->has_boundary_lines());
- // depending on this result, use this or the other data object for the
- // mapping and call the function in the base class with this
- // data object to do the work
- const typename MappingQ1<dim,spacedim>::InternalData *p_data
- = (data.use_mapping_q1_on_current_cell
- ?
- data.mapping_q1_data.get()
- :
- &data);
- MappingQ1<dim,spacedim>::fill_fe_subface_values(cell,
- face_no,
- subface_no,
- quadrature,
- *p_data,
- output_data);
+ // depending on the results above, decide whether the Q1 mapping or
+ // the Qp mapping needs to handle this cell
+ if (data.use_mapping_q1_on_current_cell)
+ q1_mapping->fill_fe_subface_values (cell,
+ face_no,
+ subface_no,
+ quadrature,
+ *data.mapping_q1_data,
+ output_data);
+ else
+ MappingQ1<dim,spacedim>::fill_fe_subface_values(cell,
+ face_no,
+ subface_no,
+ quadrature,
+ data,
+ output_data);
}
// whether we should in fact work on the Q1 portion of it
if (const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data))
if (data->use_mapping_q1_on_current_cell)
- return MappingQ1<dim,spacedim>::transform (input, mapping_type, *data->mapping_q1_data, output);
+ return q1_mapping->transform (input, mapping_type, *data->mapping_q1_data, output);
// otherwise just stick with what we already had
MappingQ1<dim,spacedim>::transform(input, mapping_type, mapping_data, output);
// whether we should in fact work on the Q1 portion of it
if (const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data))
if (data->use_mapping_q1_on_current_cell)
- return MappingQ1<dim,spacedim>::transform (input, mapping_type, *data->mapping_q1_data, output);
+ return q1_mapping->transform (input, mapping_type, *data->mapping_q1_data, output);
// otherwise just stick with what we already had
MappingQ1<dim,spacedim>::transform(input, mapping_type, mapping_data, output);
// whether we should in fact work on the Q1 portion of it
if (const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data))
if (data->use_mapping_q1_on_current_cell)
- return MappingQ1<dim,spacedim>::transform (input, mapping_type, *data->mapping_q1_data, output);
+ return q1_mapping->transform (input, mapping_type, *data->mapping_q1_data, output);
// otherwise just stick with what we already had
MappingQ1<dim,spacedim>::transform(input, mapping_type, mapping_data, output);
// whether we should in fact work on the Q1 portion of it
if (const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data))
if (data->use_mapping_q1_on_current_cell)
- return MappingQ1<dim,spacedim>::transform (input, mapping_type, *data->mapping_q1_data, output);
+ return q1_mapping->transform (input, mapping_type, *data->mapping_q1_data, output);
// otherwise just stick with what we already had
MappingQ1<dim,spacedim>::transform(input, mapping_type, mapping_data, output);
// whether we should in fact work on the Q1 portion of it
if (const InternalData *data = dynamic_cast<const InternalData *>(&mapping_data))
if (data->use_mapping_q1_on_current_cell)
- return MappingQ1<dim,spacedim>::transform (input, mapping_type, *data->mapping_q1_data, output);
+ return q1_mapping->transform (input, mapping_type, *data->mapping_q1_data, output);
// otherwise just stick with what we already had
MappingQ1<dim,spacedim>::transform(input, mapping_type, mapping_data, output);