+template <int dim, int spacedim>
+void
+MappingCartesian<dim, spacedim>::maybe_update_volume_elements(
+ const InternalData &data) const
+{
+ if (data.update_each & update_volume_elements)
+ {
+ double volume = data.cell_extents[0];
+ for (unsigned int d = 1; d < dim; ++d)
+ volume *= data.cell_extents[d];
+ data.volume_element = volume;
+ }
+}
+
+
+
template <int dim, int spacedim>
void
MappingCartesian<dim, spacedim>::maybe_update_jacobians(
for (unsigned int i = 0; i < output_data.boundary_forms.size(); ++i)
output_data.boundary_forms[i] = J * output_data.normal_vectors[i];
- if (data.update_each & update_volume_elements)
- {
- J = data.cell_extents[0];
- for (unsigned int d = 1; d < dim; ++d)
- J *= data.cell_extents[d];
- data.volume_element = J;
- }
-
+ maybe_update_volume_elements(data);
maybe_update_jacobians(data, CellSimilarity::none, output_data);
maybe_update_jacobian_derivatives(data, CellSimilarity::none, output_data);
maybe_update_inverse_jacobians(data, CellSimilarity::none, output_data);
for (unsigned int i = 0; i < output_data.boundary_forms.size(); ++i)
output_data.boundary_forms[i] = J * output_data.normal_vectors[i];
- if (data.update_each & update_volume_elements)
- {
- J = data.cell_extents[0];
- for (unsigned int d = 1; d < dim; ++d)
- J *= data.cell_extents[d];
- data.volume_element = J;
- }
-
+ maybe_update_volume_elements(data);
maybe_update_jacobians(data, CellSimilarity::none, output_data);
maybe_update_jacobian_derivatives(data, CellSimilarity::none, output_data);
maybe_update_inverse_jacobians(data, CellSimilarity::none, output_data);