+template <int dim, int spacedim>
+void
+MappingCartesian<dim, spacedim>::maybe_update_jacobians(
+ const InternalData & data,
+ const CellSimilarity::Similarity cell_similarity,
+ internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
+ &output_data) const
+{
+ // "compute" Jacobian at the quadrature points, which are all the
+ // same
+ if (data.update_each & update_jacobians)
+ if (cell_similarity != CellSimilarity::translation)
+ for (unsigned int i = 0; i < output_data.jacobians.size(); ++i)
+ {
+ output_data.jacobians[i] = DerivativeForm<1, dim, spacedim>();
+ for (unsigned int j = 0; j < dim; ++j)
+ output_data.jacobians[i][j][j] = data.cell_extents[j];
+ }
+}
+
+
+
template <int dim, int spacedim>
void
MappingCartesian<dim, spacedim>::maybe_update_inverse_jacobians(
for (unsigned int i = 0; i < output_data.JxW_values.size(); ++i)
output_data.JxW_values[i] = J * quadrature.weight(i);
}
- // "compute" Jacobian at the quadrature points, which are all the
- // same
- if (data.update_each & update_jacobians)
- if (cell_similarity != CellSimilarity::translation)
- for (unsigned int i = 0; i < output_data.jacobians.size(); ++i)
- {
- output_data.jacobians[i] = DerivativeForm<1, dim, spacedim>();
- for (unsigned int j = 0; j < dim; ++j)
- output_data.jacobians[i][j][j] = data.cell_extents[j];
- }
+
+ maybe_update_jacobians(data, cell_similarity, output_data);
maybe_update_jacobian_derivatives(data, cell_similarity, output_data);
maybe_update_inverse_jacobians(data, cell_similarity, output_data);
ExcNotImplemented());
output_data.initialize(unit_points.size(), update_flags);
- const unsigned int n_points = unit_points.size();
InternalData data;
data.update_each = update_flags;
data,
output_data.quadrature_points);
- for (unsigned int i = 0; i < n_points; ++i)
- {
- if (update_flags & update_jacobians)
- {
- output_data.jacobians[i] = DerivativeForm<1, dim, spacedim>();
- for (unsigned int j = 0; j < dim; ++j)
- output_data.jacobians[i][j][j] = data.cell_extents[j];
- }
- }
-
+ maybe_update_jacobians(data, CellSimilarity::none, output_data);
maybe_update_inverse_jacobians(data, CellSimilarity::none, output_data);
}
data.volume_element = J;
}
- if (data.update_each & update_jacobians)
- for (unsigned int i = 0; i < output_data.jacobians.size(); ++i)
- {
- output_data.jacobians[i] = DerivativeForm<1, dim, spacedim>();
- for (unsigned int d = 0; d < dim; ++d)
- output_data.jacobians[i][d][d] = data.cell_extents[d];
- }
-
+ 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);
}
data.volume_element = J;
}
- if (data.update_each & update_jacobians)
- for (unsigned int i = 0; i < output_data.jacobians.size(); ++i)
- {
- output_data.jacobians[i] = DerivativeForm<1, dim, spacedim>();
- for (unsigned int d = 0; d < dim; ++d)
- output_data.jacobians[i][d][d] = data.cell_extents[d];
- }
-
+ 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);
}