const UpdateFlags update_flags_cells,
const UpdateFlags update_flags_boundary_faces,
const UpdateFlags update_flags_inner_faces,
- const UpdateFlags update_flags_faces_by_cells);
+ const UpdateFlags update_flags_faces_by_cells,
+ const bool piola_transform = false);
/**
* Update the information in the given cells and faces that is the
const UpdateFlags update_flags_cells,
const UpdateFlags update_flags_boundary_faces,
const UpdateFlags update_flags_inner_faces,
- const UpdateFlags update_flags_faces_by_cells)
+ const UpdateFlags update_flags_faces_by_cells,
+ const bool piola_transform)
{
clear();
this->mapping_collection = mapping;
// the mapping that are independent of the FE
this->update_flags_cells =
MappingInfoStorage<dim, dim, VectorizedArrayType>::compute_update_flags(
- update_flags_cells, quad);
+ update_flags_cells, quad, piola_transform);
this->update_flags_boundary_faces =
((update_flags_inner_faces | update_flags_boundary_faces) &
update_quadrature_points ?
update_quadrature_points :
update_default) |
- (((update_flags_inner_faces | update_flags_boundary_faces) &
- (update_jacobian_grads | update_hessians)) != 0u ?
+ ((((update_flags_inner_faces | update_flags_boundary_faces) &
+ (update_jacobian_grads | update_hessians)) != 0u ||
+ (piola_transform &&
+ ((update_flags_inner_faces | update_flags_boundary_faces) &
+ update_gradients) != 0u)) ?
update_jacobian_grads :
update_default) |
update_normal_vectors | update_JxW_values | update_jacobians;
compute_update_flags(
const UpdateFlags update_flags,
const std::vector<dealii::hp::QCollection<spacedim>> &quads =
- std::vector<dealii::hp::QCollection<spacedim>>());
+ std::vector<dealii::hp::QCollection<spacedim>>(),
+ const bool piola_transform = false);
/**
* Prints a detailed summary of memory consumption in the different
UpdateFlags
MappingInfoStorage<structdim, spacedim, Number>::compute_update_flags(
const UpdateFlags update_flags,
- const std::vector<dealii::hp::QCollection<spacedim>> &quads)
+ const std::vector<dealii::hp::QCollection<spacedim>> &quads,
+ const bool piola_transform)
{
// this class is build around the evaluation of jacobians, so compute
// them in any case. The Jacobians will be inverted manually. Since we
// Jacobians (these two together will give use the gradients of the
// inverse Jacobians, which is what we need)
if ((update_flags & update_hessians) != 0u ||
- (update_flags & update_jacobian_grads) != 0u)
+ (update_flags & update_jacobian_grads) != 0u ||
+ (piola_transform && (update_flags & update_gradients) != 0u))
new_flags |= update_jacobian_grads;
if ((update_flags & update_quadrature_points) != 0u)
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_poly.h>
#include <deal.II/fe/fe_q_dg0.h>
+#include <deal.II/fe/fe_raviart_thomas.h>
#include <deal.II/hp/q_collection.h>
}
}
+ // Will the piola transform be used? If so we need to update
+ // the jacobian gradients in case of update_gradients on general cells.
+ bool piola_transform = false;
+ for (unsigned int no = 0, c = 0; no < dof_handler.size(); ++no)
+ for (unsigned int b = 0;
+ b < dof_handler[no]->get_fe(0).n_base_elements();
+ ++b, ++c)
+ for (unsigned int fe_no = 0;
+ fe_no < dof_handler[no]->get_fe_collection().size();
+ ++fe_no)
+ for (unsigned int nq = 0; nq < quad.size(); ++nq)
+ for (unsigned int q_no = 0; q_no < quad[nq].size(); ++q_no)
+ if (shape_info(c, nq, fe_no, q_no).element_type ==
+ internal::MatrixFreeFunctions::ElementType::
+ tensor_raviart_thomas)
+ piola_transform = true;
+
mapping_info.initialize(
dof_handler[0]->get_triangulation(),
cell_level_index,
additional_data.mapping_update_flags,
additional_data.mapping_update_flags_boundary_faces,
additional_data.mapping_update_flags_inner_faces,
- additional_data.mapping_update_flags_faces_by_cells);
+ additional_data.mapping_update_flags_faces_by_cells,
+ piola_transform);
mapping_is_initialized = true;
}