17#ifndef dealii_matrix_free_fe_evaluation_h
18#define dealii_matrix_free_fe_evaluation_h
93 typename VectorizedArrayType>
143 template <
typename VectorType>
147 const std::bitset<VectorizedArrayType::size()> &mask =
148 std::bitset<VectorizedArrayType::size()>().
flip());
178 template <
typename VectorType>
182 const std::bitset<VectorizedArrayType::size()> &mask =
183 std::bitset<VectorizedArrayType::size()>().
flip());
216 template <
typename VectorType>
221 const std::bitset<VectorizedArrayType::size()> &mask =
222 std::bitset<VectorizedArrayType::size()>().
flip())
const;
262 template <
typename VectorType>
266 const std::bitset<VectorizedArrayType::size()> &mask =
267 std::bitset<VectorizedArrayType::size()>().
flip())
const;
272 template <
typename VectorType>
277 const std::bitset<VectorizedArrayType::size()> &mask =
278 std::bitset<VectorizedArrayType::size()>().
flip())
const;
501 Tensor<1, (dim == 2 ? 1 : dim), VectorizedArrayType>
600 const unsigned int dof_no,
603 const unsigned int fe_degree,
604 const unsigned int n_q_points,
608 const unsigned int face_type);
682 template <
typename VectorType,
typename VectorOperation>
686 const std::array<VectorType *, n_components_> &vectors,
690 const std::bitset<VectorizedArrayType::size()> &mask,
700 template <
typename VectorType,
typename VectorOperation>
704 const std::array<VectorType *, n_components_> &vectors,
708 const std::bitset<VectorizedArrayType::size()> &mask)
const;
717 template <
typename VectorType,
typename VectorOperation>
721 const std::array<VectorType *, n_components_> &vectors)
const;
767 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
768 "Type of Number and of VectorizedArrayType do not match.");
790 const unsigned int dof_no,
793 const unsigned int fe_degree,
794 const unsigned int n_q_points,
834template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
839 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
840 "Type of Number and of VectorizedArrayType do not match.");
947 const unsigned int dof_no,
950 const unsigned int fe_degree,
951 const unsigned int n_q_points,
992template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
997 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
998 "Type of Number and of VectorizedArrayType do not match.");
1041 Tensor<1, (dim == 2 ? 1 : dim), VectorizedArrayType>
1125 const unsigned int dof_no,
1128 const unsigned int dofs_per_cell,
1129 const unsigned int n_q_points,
1168template <
typename Number,
bool is_face,
typename VectorizedArrayType>
1173 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
1174 "Type of Number and of VectorizedArrayType do not match.");
1306 const unsigned int dof_no,
1309 const unsigned int fe_degree,
1310 const unsigned int n_q_points,
1910 typename VectorizedArrayType>
1915 VectorizedArrayType>
1918 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
1919 "Type of Number and of VectorizedArrayType do not match.");
2041 const unsigned int dof_no = 0,
2042 const unsigned int quad_no = 0,
2055 const std::pair<unsigned int, unsigned int> &
range,
2056 const unsigned int dof_no = 0,
2057 const unsigned int quad_no = 0,
2167 template <
bool level_dof_access>
2251 template <
typename VectorType>
2259 template <
typename VectorType>
2322 template <
typename VectorType>
2330 template <
typename VectorType>
2418 int n_q_points_1d = fe_degree + 1,
2420 typename Number = double,
2426 VectorizedArrayType>
2429 std::is_same<Number, typename VectorizedArrayType::value_type>::value,
2430 "Type of Number and of VectorizedArrayType do not match.");
2569 const unsigned int dof_no = 0,
2570 const unsigned int quad_no = 0,
2585 const std::pair<unsigned int, unsigned int> &
range,
2587 const unsigned int dof_no = 0,
2588 const unsigned int quad_no = 0,
2675 template <
typename VectorType>
2683 template <
typename VectorType>
2738 template <
typename VectorType>
2746 template <
typename VectorType>
2812 namespace MatrixFreeFunctions
2816 template <
int dim,
int degree>
2825 template <
int degree>
2828 static constexpr unsigned int value = degree + 1;
2847 typename VectorizedArrayType>
2852 const unsigned int dof_no,
2853 const unsigned int first_selected_component,
2854 const unsigned int quad_no,
2855 const unsigned int fe_degree,
2856 const unsigned int n_q_points,
2859 const unsigned int face_type)
2866 &internal::MatrixFreeFunctions::
2867 MappingInfoCellsOrFaces<dim, Number, is_face, VectorizedArrayType>::get(
2868 matrix_free.get_mapping_info(), quad_no);
2872 init_data.dof_info->fe_index_from_degree(first_selected_component,
2881 std::min<unsigned int>(
init_data.active_fe_index,
2884 init_data.mapping_data->quad_index_from_n_q_points(n_q_points);
2886 init_data.shape_info = &matrix_free.get_shape_info(
2889 init_data.dof_info->component_to_base_index[first_selected_component],
2895 (
init_data.active_quad_index * std::max<unsigned int>(1, dim - 1) +
2911 typename VectorizedArrayType>
2916 VectorizedArrayType>
::
2919 const unsigned int dof_no,
2920 const unsigned int first_selected_component,
2921 const unsigned int quad_no,
2922 const unsigned int fe_degree,
2923 const unsigned int n_q_points,
2924 const bool is_interior_face,
2925 const unsigned int active_fe_index,
2926 const unsigned int active_quad_index,
2927 const unsigned int face_type)
2931 first_selected_component,
2940 first_selected_component)
2941 , scratch_data_array(matrix_free.acquire_scratch_data())
2942 , matrix_free(&matrix_free)
2946 this->dof_info->start_components.back() == 1 ||
2949 this->dof_info->start_components
2950 [
this->dof_info->component_to_base_index[first_selected_component] +
2952 first_selected_component,
2954 "You tried to construct a vector-valued evaluator with " +
2955 std::to_string(n_components) +
2956 " components. However, "
2957 "the current base element has only " +
2959 this->dof_info->start_components
2960 [
this->dof_info->component_to_base_index[first_selected_component] +
2962 first_selected_component) +
2963 " components left when starting from local element index " +
2965 first_selected_component -
2966 this->dof_info->start_components
2967 [
this->dof_info->component_to_base_index[first_selected_component]]) +
2968 " (global index " + std::to_string(first_selected_component) +
")"));
2980 typename VectorizedArrayType>
2985 VectorizedArrayType>
::
2991 const unsigned int first_selected_component,
2995 other->mapped_geometry->get_quadrature() == quadrature ?
2996 other->mapped_geometry :
2998 MappingDataOnTheFly<dim, VectorizedArrayType>>(
3003 first_selected_component)
3008 fe.component_to_base_index(first_selected_component).first;
3011 first_selected_component >=
3013 ExcMessage(
"The underlying element must at least contain as many "
3014 "components as requested by this class"));
3022 fe.component_to_base_index(first_selected_component).
first);
3033 typename VectorizedArrayType>
3038 VectorizedArrayType>
::
3043 VectorizedArrayType> &
other)
3047 other.matrix_free->acquire_scratch_data())
3048 , matrix_free(
other.matrix_free)
3050 if (
other.matrix_free ==
nullptr)
3058 this->mapped_geometry =
3059 std::make_shared<internal::MatrixFreeFunctions::
3060 MappingDataOnTheFly<dim, VectorizedArrayType>>(
3061 other.mapped_geometry->get_fe_values().get_mapping(),
3062 other.mapped_geometry->get_quadrature(),
3063 other.mapped_geometry->get_fe_values().get_update_flags());
3064 this->mapping_data = &this->mapped_geometry->get_data_storage();
3068 this->mapped_geometry->get_data_storage().jacobians[0].begin();
3070 this->mapped_geometry->get_data_storage().JxW_values.begin();
3071 this->jacobian_gradients =
3072 this->mapped_geometry->get_data_storage().jacobian_gradients[0].begin();
3073 this->jacobian_gradients_non_inverse =
3074 this->mapped_geometry->get_data_storage()
3075 .jacobian_gradients_non_inverse[0]
3078 this->mapped_geometry->get_data_storage().quadrature_points.begin();
3090 typename VectorizedArrayType>
3095 VectorizedArrayType> &
3101 VectorizedArrayType> &
other)
3104 if (matrix_free ==
nullptr)
3107 delete scratch_data_array;
3111 matrix_free->release_scratch_data(scratch_data_array);
3116 matrix_free =
other.matrix_free;
3118 if (
other.matrix_free ==
nullptr)
3127 this->mapped_geometry =
3128 std::make_shared<internal::MatrixFreeFunctions::
3129 MappingDataOnTheFly<dim, VectorizedArrayType>>(
3130 other.mapped_geometry->get_fe_values().get_mapping(),
3131 other.mapped_geometry->get_quadrature(),
3132 other.mapped_geometry->get_fe_values().get_update_flags());
3134 this->mapping_data = &this->mapped_geometry->get_data_storage();
3136 this->mapped_geometry->get_data_storage().jacobians[0].begin();
3138 this->mapped_geometry->get_data_storage().JxW_values.begin();
3139 this->jacobian_gradients =
3140 this->mapped_geometry->get_data_storage().jacobian_gradients[0].begin();
3141 this->jacobian_gradients_non_inverse =
3142 this->mapped_geometry->get_data_storage()
3143 .jacobian_gradients_non_inverse[0]
3146 this->mapped_geometry->get_data_storage().quadrature_points.begin();
3150 scratch_data_array = matrix_free->acquire_scratch_data();
3164 typename VectorizedArrayType>
3169 VectorizedArrayType>::~FEEvaluationBase()
3171 if (matrix_free !=
nullptr)
3175 matrix_free->release_scratch_data(scratch_data_array);
3182 delete scratch_data_array;
3193 typename VectorizedArrayType>
3198 Assert(matrix_free !=
nullptr,
3200 "FEEvaluation was not initialized with a MatrixFree object!"));
3201 return *matrix_free;
3210 template <
typename VectorType,
bool>
3213 template <
typename VectorType>
3219 template <
typename VectorType>
3228 template <
typename VectorType,
bool>
3231 template <
typename VectorType>
3242 return &
vec.block(component);
3246 template <
typename VectorType>
3271 template <
typename VectorType>
3278 const unsigned int component)
3281 return &
vec[component];
3285 template <
typename VectorType>
3292 const unsigned int component)
3295 return &
vec[component];
3299 template <
typename VectorType>
3306 const unsigned int component)
3309 return vec[component];
3313 template <
typename VectorType>
3320 const unsigned int component)
3323 return vec[component];
3334 typename VectorizedArrayType>
3335template <
typename VectorType,
typename VectorOperation>
3340 const std::array<VectorType *, n_components_> &src,
3344 const std::bitset<VectorizedArrayType::size()> &
mask,
3350 if (this->matrix_free ==
nullptr)
3352 read_write_operation_global(operation, src);
3359 if (this->n_fe_components == 1)
3360 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3363 ExcMessage(
"The finite element underlying this FEEvaluation "
3364 "object is scalar, but you requested " +
3365 std::to_string(n_components) +
3366 " components via the template argument in "
3367 "FEEvaluation. In that case, you must pass an "
3368 "std::vector<VectorType> or a BlockVector to " +
3369 "read_dof_values and distribute_local_to_global."));
3389 bool is_contiguous =
true;
3391 if (
is_face && !this->interior_face &&
3392 (this->dof_access_index ==
3395 const std::array<
unsigned int, VectorizedArrayType::size()> &cells =
3396 this->get_cell_ids();
3403 if (
mask[v] ==
true &&
3406 [cells[v] / VectorizedArrayType::size()] <
3409 is_contiguous =
false;
3413 this->dof_access_index :
3414 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
3415 [
this->cell] <
internal::MatrixFreeFunctions::DoFInfo::
3416 IndexStorageVariants::contiguous)
3418 is_contiguous =
false;
3423 read_write_operation_contiguous(operation, src,
src_sm,
mask);
3430 constexpr unsigned int n_lanes = VectorizedArrayType::size();
3432 std::array<
unsigned int, VectorizedArrayType::size()> cells =
3433 this->get_cell_ids();
3437 for (
unsigned int v = 0; v < n_lanes; ++v)
3438 if (
mask[v] ==
false)
3449 [
this->first_selected_component])
3450 for (
unsigned int v = 0; v < n_lanes; ++v)
3458 std::integral_constant<
bool,
3459 internal::is_vectorizable<VectorType, Number>::value>
3464 const std::size_t dofs_per_component = this->data->dofs_per_component_on_cell;
3465 std::array<VectorizedArrayType *, n_components> values_dofs;
3466 for (
unsigned int c = 0; c < n_components; ++c)
3467 values_dofs[c] =
const_cast<VectorizedArrayType *
>(this->values_dofs) +
3468 c * dofs_per_component;
3473 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
3474 [
this->cell] ==
internal::MatrixFreeFunctions::DoFInfo::
3475 IndexStorageVariants::interleaved &&
3478 const unsigned int *dof_indices =
3480 dof_info.
row_starts[this->cell * this->n_fe_components * n_lanes]
3484 [this->first_selected_component] *
3486 if (n_components == 1 || this->n_fe_components == 1)
3487 for (
unsigned int i = 0; i < dofs_per_component;
3488 ++i, dof_indices += n_lanes)
3489 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3490 operation.process_dof_gather(dof_indices,
3493 values_dofs[
comp][i],
3496 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3497 for (
unsigned int i = 0; i < dofs_per_component;
3498 ++i, dof_indices += n_lanes)
3499 operation.process_dof_gather(
3506 std::array<const unsigned int *, n_lanes> dof_indices;
3507 dof_indices.fill(
nullptr);
3514 this->n_fe_components > 1 ? n_components : 1;
3518 for (
unsigned int v = 0; v < n_lanes; ++v)
3525 &dof_info.
row_starts[cells[v] * this->n_fe_components +
3526 this->first_selected_component];
3541 for (
unsigned int v = 0; v < n_lanes; ++v)
3547 &dof_info.
row_starts[cells[v] * this->n_fe_components +
3548 this->first_selected_component];
3558 dof_info.hanging_node_constraint_masks_comp
3559 [
this->active_fe_index][
this->first_selected_component])
3573 if (std::count_if(cells.begin(), cells.end(), [](
const auto i) {
3574 return i != numbers::invalid_unsigned_int;
3576 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3577 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3578 operation.process_empty(values_dofs[
comp][i]);
3584 if (n_components == 1 || this->n_fe_components == 1)
3586 for (
unsigned int v = 0; v < n_lanes; ++v)
3591 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3592 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3593 operation.process_dof(dof_indices[v][i],
3595 values_dofs[
comp][i][v]);
3600 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3601 for (
unsigned int v = 0; v < n_lanes; ++v)
3606 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3607 operation.process_dof(
3608 dof_indices[v][
comp * dofs_per_component + i],
3610 values_dofs[
comp][i][v]);
3622 for (
unsigned int v = 0; v < n_lanes; ++v)
3629 cell_index * this->n_fe_components + this->first_selected_component;
3631 this->n_fe_components > 1 ? n_components : 1;
3647 dof_info.hanging_node_constraint_masks_comp
3648 [
this->active_fe_index][
this->first_selected_component])))
3657 [this->first_selected_component] +
3662 if (n_components == 1 || this->n_fe_components == 1)
3667 const std::pair<unsigned short, unsigned short>
indicator =
3671 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3672 operation.process_dof(dof_indices[v][
j],
3681 Number
value[n_components];
3682 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3687 this->matrix_free->constraint_pool_begin(
indicator.second);
3689 this->matrix_free->constraint_pool_end(
indicator.second);
3691 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3692 operation.process_constraint(*dof_indices[v],
3697 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3706 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3707 operation.process_dof(*dof_indices[v],
3718 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3726 const std::pair<unsigned short, unsigned short>
indicator =
3731 operation.process_dof(dof_indices[v][
j],
3744 this->matrix_free->constraint_pool_begin(
indicator.second);
3746 this->matrix_free->constraint_pool_end(
indicator.second);
3749 operation.process_constraint(*dof_indices[v],
3754 operation.post_constraints(
value,
3766 operation.process_dof(*dof_indices[v],
3785 typename VectorizedArrayType>
3786template <
typename VectorType,
typename VectorOperation>
3791 const std::array<VectorType *, n_components_> &src)
const
3795 const std::size_t dofs_per_component = this->data->dofs_per_component_on_cell;
3796 unsigned int index = this->first_selected_component * dofs_per_component;
3797 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3799 for (
unsigned int i = 0; i < dofs_per_component; ++i, ++
index)
3801 operation.process_empty(
3802 this->values_dofs[
comp * dofs_per_component + i]);
3803 operation.process_dof_global(
3804 local_dof_indices[this->data->lexicographic_numbering[
index]],
3806 this->values_dofs[
comp * dofs_per_component + i][0]);
3817 typename VectorizedArrayType>
3818template <
typename VectorType,
typename VectorOperation>
3823 const std::array<VectorType *, n_components_> &src,
3827 const std::bitset<VectorizedArrayType::size()> &
mask)
const
3836 std::integral_constant<
bool,
3837 internal::is_vectorizable<VectorType, Number>::value>
3840 is_face ? this->dof_access_index :
3842 const unsigned int n_lanes =
mask.count();
3848 const std::size_t dofs_per_component = this->data->dofs_per_component_on_cell;
3849 std::array<VectorizedArrayType *, n_components> values_dofs;
3850 for (
unsigned int c = 0; c < n_components; ++c)
3851 values_dofs[c] =
const_cast<VectorizedArrayType *
>(this->values_dofs) +
3852 c * dofs_per_component;
3860 interleaved_contiguous &&
3861 n_lanes == VectorizedArrayType::size()) &&
3863 this->dof_access_index ==
3864 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell &&
3868 const unsigned int dof_index =
3872 [this->first_selected_component] *
3873 VectorizedArrayType::size();
3874 if (n_components == 1 || this->n_fe_components == 1)
3875 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3876 operation.process_dofs_vectorized(dofs_per_component,
3882 operation.process_dofs_vectorized(dofs_per_component * n_components,
3890 const std::array<
unsigned int, VectorizedArrayType::size()> &cells =
3891 this->get_cell_or_face_ids();
3899 (this->dof_access_index ==
3901 this->is_interior_face() ==
false) ||
3902 (!
is_face && !this->is_interior_face());
3907 std::array<
typename VectorType::value_type *,
3908 VectorizedArrayType::size()>
3911 const auto upper_bound =
3912 std::min<unsigned int>(
n_filled_lanes, VectorizedArrayType::size());
3913 for (
unsigned int v = 0; v < upper_bound; ++v)
3915 if (
mask[v] ==
false)
3940 [this->active_fe_index][this->first_selected_component]);
3944 for (
unsigned int v =
n_filled_lanes; v < VectorizedArrayType::size();
3952 n_lanes == VectorizedArrayType::size() && !
is_ecl)
3954 if (n_components == 1 || this->n_fe_components == 1)
3956 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3959 operation.process_dofs_vectorized_transpose(
3969 operation.process_dofs_vectorized_transpose(dofs_per_component *
3977 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
3980 (n_components == 1 || this->n_fe_components == 1) ?
comp : 0);
3982 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3983 operation.process_empty(values_dofs[
comp][i]);
3985 if (n_components == 1 || this->n_fe_components == 1)
3988 if (
mask[v] ==
true)
3989 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3991 values_dofs[
comp][i][v]);
3996 if (
mask[v] ==
true)
3997 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3998 operation.process_dof(
4000 values_dofs[
comp][i][v]);
4006 unsigned int dof_indices[VectorizedArrayType::size()];
4012 if (
mask[v] ==
true)
4017 [this->first_selected_component] *
4023 for (
unsigned int v =
n_filled_lanes; v < VectorizedArrayType::size(); ++v)
4029 n_lanes == VectorizedArrayType::size() && !
is_ecl)
4035 if (n_components == 1 || this->n_fe_components == 1)
4036 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4037 operation.process_dofs_vectorized_transpose(dofs_per_component,
4043 operation.process_dofs_vectorized_transpose(dofs_per_component *
4052 interleaved_contiguous_strided)
4054 if (n_components == 1 || this->n_fe_components == 1)
4055 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4057 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4058 operation.process_dof_gather(dof_indices,
4060 i * VectorizedArrayType::size(),
4061 values_dofs[
comp][i],
4065 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4066 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4068 operation.process_dof_gather(dof_indices,
4070 (
comp * dofs_per_component + i) *
4071 VectorizedArrayType::size(),
4072 values_dofs[
comp][i],
4080 IndexStorageVariants::interleaved_contiguous_mixed_strides,
4084 [
ind][VectorizedArrayType::size() * this->cell];
4085 if (n_components == 1 || this->n_fe_components == 1)
4086 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4088 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4089 operation.process_dof_gather(dof_indices,
4092 values_dofs[
comp][i],
4095 for (
unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
4099 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4100 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4102 operation.process_dof_gather(dof_indices,
4105 values_dofs[
comp][i],
4108 for (
unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
4114 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4116 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4117 operation.process_empty(values_dofs[
comp][i]);
4122 if (n_components == 1 || this->n_fe_components == 1)
4125 if (
mask[v] ==
true)
4126 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4127 operation.process_dof(dof_indices[v] + i,
4129 values_dofs[
comp][i][v]);
4134 if (
mask[v] ==
true)
4135 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4136 operation.process_dof(dof_indices[v] + i +
4137 comp * dofs_per_component,
4139 values_dofs[
comp][i][v]);
4146 [
ind][VectorizedArrayType::size() * this->cell];
4149 if (n_components == 1 || this->n_fe_components == 1)
4152 if (
mask[v] ==
true)
4153 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4154 operation.process_dof(dof_indices[v] + i *
offsets[v],
4156 values_dofs[
comp][i][v]);
4161 if (
mask[v] ==
true)
4162 for (
unsigned int i = 0; i < dofs_per_component; ++i)
4163 operation.process_dof(dof_indices[v] +
4164 (i +
comp * dofs_per_component) *
4167 values_dofs[
comp][i][v]);
4177 typename VectorType,
4178 std::enable_if_t<!IsBlockVector<VectorType>::value, VectorType> * =
nullptr>
4179 decltype(std::declval<VectorType>().begin())
4187 typename VectorType,
4188 std::enable_if_t<IsBlockVector<VectorType>::value, VectorType> * =
nullptr>
4189 typename VectorType::value_type *
4195 template <
typename VectorType,
4196 std::enable_if_t<has_shared_vector_data<VectorType>, VectorType> * =
4198 const std::vector<ArrayView<const typename VectorType::value_type>> *
4201 const unsigned int active_fe_index,
4208 active_fe_index == 0)
4209 return &
vec->shared_vector_data();
4214 template <
typename VectorType,
4215 std::enable_if_t<!has_shared_vector_data<VectorType>, VectorType>
4217 const std::vector<ArrayView<const typename VectorType::value_type>> *
4226 template <
int n_components,
typename VectorType>
4228 std::array<
typename internal::BlockVectorSelector<
4233 const std::vector<
ArrayView<
const typename internal::BlockVectorSelector<
4240 const unsigned int active_fe_index,
4246 std::array<
typename internal::BlockVectorSelector<
4252 ArrayView<
const typename internal::BlockVectorSelector<
4258 for (
unsigned int d = 0;
d < n_components; ++
d)
4259 src_data.first[d] = internal::BlockVectorSelector<
4265 for (
unsigned int d = 0;
d < n_components; ++
d)
4267 const_cast<typename internal::BlockVectorSelector<
4268 typename std::remove_const<VectorType>::type,
4285 typename VectorizedArrayType>
4290 if (this->dof_info ==
nullptr ||
4292 this->dof_info->hanging_node_constraint_masks_comp.
size() == 0 ||
4293 this->dof_info->hanging_node_constraint_masks_comp
4294 [
this->active_fe_index][
this->first_selected_component] ==
false)
4297 constexpr unsigned int n_lanes = VectorizedArrayType::size();
4298 std::array<internal::MatrixFreeFunctions::compressed_constraint_kind, n_lanes>
4303 const std::array<
unsigned int, VectorizedArrayType::size()> &cells =
4304 this->get_cell_ids();
4306 for (
unsigned int v = 0; v < n_lanes; ++v)
4318 constraint_mask[v] =
mask;
4329 this->data->data.front().fe_degree,
4330 this->get_shape_info(),
4342 typename VectorizedArrayType>
4343template <
typename VectorType>
4348 const std::bitset<VectorizedArrayType::size()> &
mask)
4350 const auto src_data = internal::get_vector_data<n_components_>(
4353 this->dof_access_index ==
4355 this->active_fe_index,
4361 apply_hanging_node_constraints(
false);
4364 this->dof_values_initialized =
true;
4374 typename VectorizedArrayType>
4375template <
typename VectorType>
4380 const std::bitset<VectorizedArrayType::size()> &
mask)
4382 const auto src_data = internal::get_vector_data<n_components_>(
4385 this->dof_access_index ==
4387 this->active_fe_index,
4394 this->dof_values_initialized =
true;
4404 typename VectorizedArrayType>
4405template <
typename VectorType>
4411 const std::bitset<VectorizedArrayType::size()> &
mask)
const
4414 Assert(this->dof_values_initialized ==
true,
4418 apply_hanging_node_constraints(
true);
4420 const auto dst_data = internal::get_vector_data<n_components_>(
4423 this->dof_access_index ==
4425 this->active_fe_index,
4439 typename VectorizedArrayType>
4440template <
typename VectorType>
4445 const std::bitset<VectorizedArrayType::size()> &
mask)
const
4448 Assert(this->dof_values_initialized ==
true,
4452 const auto dst_data = internal::get_vector_data<n_components_>(
4455 this->dof_access_index ==
4457 this->active_fe_index,
4470 typename VectorizedArrayType>
4471template <
typename VectorType>
4477 const std::bitset<VectorizedArrayType::size()> &
mask)
const
4480 Assert(this->dof_values_initialized ==
true,
4484 const auto dst_data = internal::get_vector_data<n_components_>(
4487 this->dof_access_index ==
4489 this->active_fe_index,
4506 typename VectorizedArrayType>
4512 const std::size_t dofs = this->data->dofs_per_component_on_cell;
4514 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4515 return_value[
comp] = this->values_dofs[
comp * dofs + dof];
4516 return return_value;
4525 typename VectorizedArrayType>
4531 Assert(this->values_quad_initialized ==
true,
4536 const std::size_t
nqp = this->n_quadrature_points;
4538 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4540 return return_value;
4549 typename VectorizedArrayType>
4556 Assert(this->gradients_quad_initialized ==
true,
4561 Assert(this->jacobian !=
nullptr,
4563 "update_gradients"));
4564 const std::size_t
nqp = this->n_quadrature_points;
4570 for (
unsigned int d = 0;
d < dim; ++
d)
4571 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4574 this->jacobian[0][
d][
d];
4583 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4584 for (
unsigned int d = 0;
d < dim; ++
d)
4588 for (
unsigned int e = 1;
e < dim; ++
e)
4603 typename VectorizedArrayType>
4610 Assert(this->gradients_quad_initialized ==
true,
4614 Assert(this->normal_x_jacobian !=
nullptr,
4616 "update_gradients"));
4618 const std::size_t
nqp = this->n_quadrature_points;
4622 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4625 (this->normal_x_jacobian[0][dim - 1]);
4628 const std::size_t
index =
4630 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4633 this->normal_x_jacobian[
index][0];
4634 for (
unsigned int d = 1;
d < dim; ++
d)
4637 this->normal_x_jacobian[
index][
d];
4649 template <
typename VectorizedArrayType>
4652 const VectorizedArrayType *
const hessians,
4654 VectorizedArrayType (&tmp)[1][1])
4659 template <
typename VectorizedArrayType>
4662 const VectorizedArrayType *
const hessians,
4663 const unsigned int nqp,
4664 VectorizedArrayType (&tmp)[2][2])
4666 for (
unsigned int d = 0;
d < 2; ++
d)
4674 template <
typename VectorizedArrayType>
4677 const VectorizedArrayType *
const hessians,
4678 const unsigned int nqp,
4679 VectorizedArrayType (&tmp)[3][3])
4681 for (
unsigned int d = 0;
d < 3; ++
d)
4702 typename VectorizedArrayType>
4708 Assert(this->hessians_quad_initialized ==
true,
4713 Assert(this->jacobian !=
nullptr,
4723 const std::size_t
nqp = this->n_quadrature_points;
4724 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
4729 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4731 for (
unsigned int d = 0;
d < dim; ++
d)
4758 for (
unsigned int d = 0;
d < dim; ++
d)
4759 for (
unsigned int e = d + 1;
e < dim; ++
e)
4766 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4768 VectorizedArrayType tmp[dim][dim];
4769 internal::hessian_unit_times_jac(
4773 for (
unsigned int d = 0;
d < dim; ++
d)
4774 for (
unsigned int e = d;
e < dim; ++
e)
4777 for (
unsigned int f = 1; f < dim; ++f)
4785 for (
unsigned int d = 0;
d < dim; ++
d)
4786 for (
unsigned int e = d + 1;
e < dim; ++
e)
4794 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4796 VectorizedArrayType tmp[dim][dim];
4797 internal::hessian_unit_times_jac(
4801 for (
unsigned int d = 0;
d < dim; ++
d)
4802 for (
unsigned int e = d;
e < dim; ++
e)
4805 for (
unsigned int f = 1; f < dim; ++f)
4810 for (
unsigned int d = 0;
d < dim; ++
d)
4811 for (
unsigned int e = 0;
e < dim; ++
e)
4817 for (
unsigned int d = 0,
count = dim;
d < dim; ++
d)
4818 for (
unsigned int e = d + 1;
e < dim; ++
e, ++
count)
4819 for (
unsigned int f = 0; f < dim; ++f)
4825 for (
unsigned int d = 0;
d < dim; ++
d)
4826 for (
unsigned int e = d + 1;
e < dim; ++
e)
4839 typename VectorizedArrayType>
4846 Assert(this->hessians_quad_initialized ==
true,
4857 const std::size_t
nqp = this->n_quadrature_points;
4858 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
4864 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4865 for (
unsigned int d = 0;
d < dim; ++
d)
4873 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4877 VectorizedArrayType tmp[dim][dim];
4878 internal::hessian_unit_times_jac(
4883 for (
unsigned int d = 0;
d < dim; ++
d)
4886 for (
unsigned int f = 1; f < dim; ++f)
4895 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4899 VectorizedArrayType tmp[dim][dim];
4900 internal::hessian_unit_times_jac(
4905 for (
unsigned int d = 0;
d < dim; ++
d)
4908 for (
unsigned int f = 1; f < dim; ++f)
4912 for (
unsigned int d = 0;
d < dim; ++
d)
4913 for (
unsigned int e = 0;
e < dim; ++
e)
4928 typename VectorizedArrayType>
4935 Assert(this->hessians_quad_initialized ==
true,
4942 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4945 for (
unsigned int d = 1;
d < dim; ++
d)
4957 typename VectorizedArrayType>
4961 const unsigned int dof)
4964 this->dof_values_initialized =
true;
4966 const std::size_t dofs = this->data->dofs_per_component_on_cell;
4968 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
4978 typename VectorizedArrayType>
4988 Assert(this->J_value !=
nullptr,
4992 this->values_quad_submitted =
true;
4995 const std::size_t
nqp = this->n_quadrature_points;
4998 const VectorizedArrayType JxW =
4999 this->J_value[0] * this->quadrature_weights[
q_point];
5000 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5005 const VectorizedArrayType JxW = this->J_value[
q_point];
5006 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5017 typename VectorizedArrayType>
5028 Assert(this->J_value !=
nullptr,
5030 "update_gradients"));
5031 Assert(this->jacobian !=
nullptr,
5033 "update_gradients"));
5035 this->gradients_quad_submitted =
true;
5038 const std::size_t
nqp = this->n_quadrature_points;
5041 const VectorizedArrayType JxW =
5042 this->J_value[0] * this->quadrature_weights[
q_point];
5043 std::array<VectorizedArrayType, dim>
jac;
5044 for (
unsigned int d = 0;
d < dim; ++
d)
5045 jac[d] = this->jacobian[0][d][d];
5046 for (
unsigned int d = 0;
d < dim; ++
d)
5048 const VectorizedArrayType factor =
jac[
d] * JxW;
5049 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5060 const VectorizedArrayType JxW =
5063 this->J_value[0] * this->quadrature_weights[
q_point];
5064 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5065 for (
unsigned int d = 0;
d < dim; ++
d)
5068 for (
unsigned int e = 1;
e < dim; ++
e)
5082 typename VectorizedArrayType>
5090 Assert(this->normal_x_jacobian !=
nullptr,
5092 "update_gradients"));
5094 this->gradients_quad_submitted =
true;
5097 const std::size_t
nqp = this->n_quadrature_points;
5100 const VectorizedArrayType
JxW_jac = this->J_value[0] *
5101 this->quadrature_weights[
q_point] *
5102 this->normal_x_jacobian[0][dim - 1];
5103 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5105 for (
unsigned int d = 0;
d < dim - 1; ++
d)
5107 VectorizedArrayType();
5114 const unsigned int index =
5117 this->normal_x_jacobian[
index];
5118 const VectorizedArrayType JxW =
5120 this->J_value[
index] * this->quadrature_weights[
q_point] :
5122 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5124 for (
unsigned int d = 0;
d < dim; ++
d)
5137 typename VectorizedArrayType>
5149 Assert(this->J_value !=
nullptr,
5151 "update_hessians"));
5152 Assert(this->jacobian !=
nullptr,
5154 "update_hessians"));
5156 this->hessians_quad_submitted =
true;
5160 const std::size_t
nqp = this->n_quadrature_points;
5161 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
5164 const VectorizedArrayType JxW =
5165 this->J_value[0] * this->quadrature_weights[
q_point];
5168 for (
unsigned int d = 0;
d < dim; ++
d)
5170 const auto jac_d = this->jacobian[0][
d][
d];
5171 const VectorizedArrayType factor =
jac_d *
jac_d * JxW;
5172 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5178 for (
unsigned int d = 1,
off_dia = dim;
d < dim; ++
d)
5179 for (
unsigned int e = 0;
e <
d; ++
e, ++
off_dia)
5181 const auto jac_d = this->jacobian[0][
d][
d];
5182 const auto jac_e = this->jacobian[0][
e][
e];
5183 const VectorizedArrayType factor =
jac_d *
jac_e * JxW;
5184 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5193 const VectorizedArrayType JxW =
5194 this->J_value[0] * this->quadrature_weights[
q_point];
5195 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5198 VectorizedArrayType tmp[dim][dim];
5199 for (
unsigned int i = 0; i < dim; ++i)
5200 for (
unsigned int j = 0;
j < dim; ++
j)
5203 for (
unsigned int k = 1;
k < dim; ++
k)
5208 VectorizedArrayType
tmp2[dim][dim];
5209 for (
unsigned int i = 0; i < dim; ++i)
5210 for (
unsigned int j = 0;
j < dim; ++
j)
5213 for (
unsigned int k = 1;
k < dim; ++
k)
5218 for (
unsigned int d = 0;
d < dim; ++
d)
5223 for (
unsigned int d = 0,
off_diag = dim;
d < dim; ++
d)
5224 for (
unsigned int e = d + 1;
e < dim; ++
e, ++
off_diag)
5232 const VectorizedArrayType JxW = this->J_value[
q_point];
5234 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5237 VectorizedArrayType tmp[dim][dim];
5238 for (
unsigned int i = 0; i < dim; ++i)
5239 for (
unsigned int j = 0;
j < dim; ++
j)
5242 for (
unsigned int k = 1;
k < dim; ++
k)
5247 VectorizedArrayType
tmp2[dim][dim];
5248 for (
unsigned int i = 0; i < dim; ++i)
5249 for (
unsigned int j = 0;
j < dim; ++
j)
5252 for (
unsigned int k = 1;
k < dim; ++
k)
5257 for (
unsigned int d = 0;
d < dim; ++
d)
5262 for (
unsigned int d = 0,
off_diag = dim;
d < dim; ++
d)
5263 for (
unsigned int e = d + 1;
e < dim; ++
e, ++
off_diag)
5268 for (
unsigned int d = 0;
d < dim; ++
d)
5270 VectorizedArrayType
sum = 0;
5271 for (
unsigned int e = 0;
e < dim; ++
e)
5273 for (
unsigned int e = 0,
count = dim;
e < dim; ++
e)
5274 for (
unsigned int f = e + 1; f < dim; ++f, ++
count)
5277 this->gradients_from_hessians_quad[(
comp * dim +
d) *
nqp +
5290 typename VectorizedArrayType>
5297 Assert(this->values_quad_submitted ==
true,
5302 const std::size_t
nqp = this->n_quadrature_points;
5303 for (
unsigned int q = 0;
q <
nqp; ++
q)
5304 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5305 return_value[
comp] += this->values_quad[
comp *
nqp +
q];
5306 return (return_value);
5318 typename VectorizedArrayType>
5323 VectorizedArrayType>
::
5326 const unsigned int dof_no,
5327 const unsigned int first_selected_component,
5328 const unsigned int quad_no,
5329 const unsigned int fe_degree,
5330 const unsigned int n_q_points,
5331 const bool is_interior_face,
5332 const unsigned int active_fe_index,
5333 const unsigned int active_quad_index,
5334 const unsigned int face_type)
5338 first_selected_component,
5354 typename VectorizedArrayType>
5359 VectorizedArrayType>
::
5365 const unsigned int first_selected_component,
5372 first_selected_component,
5382 typename VectorizedArrayType>
5387 VectorizedArrayType>
::
5392 VectorizedArrayType> &
other)
5403 typename VectorizedArrayType>
5408 VectorizedArrayType> &
5414 VectorizedArrayType> &
other)
5429template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5433 const unsigned int dof_no,
5434 const unsigned int first_selected_component,
5435 const unsigned int quad_no,
5436 const unsigned int fe_degree,
5437 const unsigned int n_q_points,
5438 const bool is_interior_face,
5439 const unsigned int active_fe_index,
5440 const unsigned int active_quad_index,
5441 const unsigned int face_type)
5445 first_selected_component,
5457template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5464 const unsigned int first_selected_component,
5471 first_selected_component,
5477template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5487template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5500template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5503 const unsigned int dof)
const
5506 return this->values_dofs[dof];
5511template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5514 const unsigned int q_point)
const
5517 Assert(this->values_quad_initialized ==
true,
5521 return this->values_quad[
q_point];
5526template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5531 return BaseClass::get_normal_derivative(
q_point)[0];
5536template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5539 const unsigned int q_point)
const
5545 Assert(this->gradients_quad_initialized ==
true,
5550 Assert(this->jacobian !=
nullptr,
5552 "update_gradients"));
5556 const std::size_t
nqp = this->n_quadrature_points;
5559 for (
unsigned int d = 0;
d < dim; ++
d)
5561 this->gradients_quad[d *
nqp +
q_point] * this->jacobian[0][d][d];
5570 for (
unsigned int d = 0;
d < dim; ++
d)
5573 for (
unsigned int e = 1;
e < dim; ++
e)
5582template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5585 const unsigned int q_point)
const
5587 return BaseClass::get_hessian(
q_point)[0];
5592template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5597 return BaseClass::get_hessian_diagonal(
q_point)[0];
5602template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5603inline VectorizedArrayType
5605 const unsigned int q_point)
const
5607 return BaseClass::get_laplacian(
q_point)[0];
5612template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5618 this->dof_values_initialized =
true;
5621 this->values_dofs[dof] =
val_in;
5626template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5629 const VectorizedArrayType
val_in,
5636 Assert(this->J_value !=
nullptr,
5640 this->values_quad_submitted =
true;
5645 const VectorizedArrayType JxW =
5646 this->J_value[0] * this->quadrature_weights[
q_point];
5657template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5668template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5676 BaseClass::submit_normal_derivative(
grad,
q_point);
5681template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5691 Assert(this->J_value !=
nullptr,
5693 "update_gradients"));
5694 Assert(this->jacobian !=
nullptr,
5696 "update_gradients"));
5698 this->gradients_quad_submitted =
true;
5701 const std::size_t
nqp = this->n_quadrature_points;
5704 const VectorizedArrayType JxW =
5705 this->J_value[0] * this->quadrature_weights[
q_point];
5709 std::array<VectorizedArrayType, dim>
jac;
5710 for (
unsigned int d = 0;
d < dim; ++
d)
5711 jac[d] = this->jacobian[0][d][d];
5713 for (
unsigned int d = 0;
d < dim; ++
d)
5723 const VectorizedArrayType JxW =
5726 this->J_value[0] * this->quadrature_weights[
q_point];
5727 for (
unsigned int d = 0;
d < dim; ++
d)
5730 for (
unsigned int e = 1;
e < dim; ++
e)
5739template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5752template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5753inline VectorizedArrayType
5757 return BaseClass::integrate_value()[0];
5765template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5769 const unsigned int dof_no,
5770 const unsigned int first_selected_component,
5771 const unsigned int quad_no,
5772 const unsigned int fe_degree,
5773 const unsigned int n_q_points,
5774 const bool is_interior_face,
5775 const unsigned int active_fe_index,
5776 const unsigned int active_quad_index,
5777 const unsigned int face_type)
5781 first_selected_component,
5793template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5800 const unsigned int first_selected_component,
5807 first_selected_component,
5813template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5823template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5835template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5838 const unsigned int q_point)
const
5840 if (this->data->element_type ==
5845 Assert(this->values_quad_initialized ==
true,
5850 Assert(this->J_value !=
nullptr,
5853 const std::size_t
nqp = this->n_quadrature_points;
5861 const VectorizedArrayType
inv_det =
5862 (dim == 2) ? this->jacobian[0][0][0] * this->jacobian[0][1][1] :
5863 this->jacobian[0][0][0] *
this->jacobian[0][1][1] *
5864 this->jacobian[0][2][2];
5867 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5884 const VectorizedArrayType
inv_det =
5885 (
is_face && dim == 2 && this->get_face_no() < 2) ?
5889 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5893 for (
unsigned int e = 1;
e < dim; ++
e)
5903 return BaseClass::get_value(
q_point);
5907template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
5912 if (this->data->element_type ==
5917 Assert(this->gradients_quad_initialized ==
true,
5922 Assert(this->jacobian !=
nullptr,
5924 "update_gradients"));
5925 const std::size_t
nqp = this->n_quadrature_points;
5935 const VectorizedArrayType
inv_det =
5936 (dim == 2) ? this->jacobian[0][0][0] * this->jacobian[0][1][1] :
5937 this->jacobian[0][0][0] *
this->jacobian[0][1][1] *
5938 this->jacobian[0][2][2];
5941 for (
unsigned int d = 0;
d < dim; ++
d)
5942 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5955 const VectorizedArrayType
inv_det =
5956 (
is_face && dim == 2 && this->get_face_no() < 2) ?
5960 VectorizedArrayType tmp;
5962 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
5963 for (
unsigned int d = 0;
d < dim; ++
d)
5966 for (
unsigned int f = 0; f < dim; ++f)
5967 for (
unsigned int e = 0;
e < dim; ++
e)
5969 this->gradients_quad[(f * dim + e) *
nqp +
q_point];
5982 Assert(this->jacobian_gradients_non_inverse !=
nullptr,
5984 "update_hessians"));
5992 const VectorizedArrayType
inv_det =
5993 (
is_face && dim == 2 && this->get_face_no() < 2) ?
5997 VectorizedArrayType tmp;
5999 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6000 for (
unsigned int d = 0;
d < dim; ++
d)
6003 for (
unsigned int f = 0; f < dim; ++f)
6004 for (
unsigned int e = 0;
e < dim; ++
e)
6006 this->gradients_quad[(f * dim + e) *
nqp +
q_point];
6017 for (
unsigned int i = 0; i < dim; ++i)
6018 for (
unsigned int j = 0;
j < dim; ++
j)
6022 for (
unsigned int f = 1; f < dim; ++f)
6029 for (
unsigned int i = 0; i < dim; ++i)
6030 for (
unsigned int j = 0;
j < dim; ++
j)
6033 for (
unsigned int f = 0; f < dim; ++f)
6034 for (
unsigned int n = 0; n < dim; ++n)
6035 for (
unsigned int m = 0; m < dim; ++m)
6048 for (
unsigned int i = 0; i < dim; ++i)
6049 for (
unsigned int j = 0;
j < dim; ++
j)
6052 for (
unsigned int r = 0, f = dim; r < dim; ++r)
6053 for (
unsigned int k = r + 1;
k < dim; ++
k, ++f)
6060 for (
unsigned int n = 0; n < dim; ++n)
6061 for (
unsigned int m = 0; m < dim; ++m)
6075 return BaseClass::get_gradient(
q_point);
6081template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6087 Assert(this->gradients_quad_initialized ==
true,
6091 Assert(this->jacobian !=
nullptr,
6093 "update_gradients"));
6095 VectorizedArrayType divergence;
6096 const std::size_t
nqp = this->n_quadrature_points;
6098 if (this->data->element_type ==
6105 const VectorizedArrayType
inv_det =
6106 (dim == 2) ? this->jacobian[0][0][0] * this->jacobian[0][1][1] :
6107 this->jacobian[0][0][0] *
this->jacobian[0][1][1] *
6108 this->jacobian[0][2][2];
6112 for (
unsigned int d = 1;
d < dim; ++
d)
6120 const VectorizedArrayType
inv_det =
6122 this->jacobian[this->cell_type >
6126 Number((
is_face && dim == 2 &&
this->get_face_no() < 2) ? -1 : 1);
6130 for (
unsigned int d = 1;
d < dim; ++
d)
6141 divergence = this->gradients_quad[
q_point] * this->jacobian[0][0][0];
6142 for (
unsigned int d = 1;
d < dim; ++
d)
6143 divergence += this->gradients_quad[(dim * d + d) *
nqp +
q_point] *
6144 this->jacobian[0][
d][
d];
6153 divergence =
jac[0][0] * this->gradients_quad[
q_point];
6154 for (
unsigned int e = 1;
e < dim; ++
e)
6155 divergence +=
jac[0][e] * this->gradients_quad[e *
nqp +
q_point];
6156 for (
unsigned int d = 1;
d < dim; ++
d)
6157 for (
unsigned int e = 0;
e < dim; ++
e)
6159 jac[d][e] * this->gradients_quad[(d * dim + e) *
nqp +
q_point];
6167template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6174 VectorizedArrayType
symmetrized[(dim * dim + dim) / 2];
6175 VectorizedArrayType
half = Number(0.5);
6176 for (
unsigned int d = 0;
d < dim; ++
d)
6202template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6204 Tensor<1, (dim == 2 ? 1 : dim), VectorizedArrayType>
6206 const unsigned int q_point)
const
6210 Tensor<1, (dim == 2 ? 1 : dim), VectorizedArrayType> curl;
6216 "Computing the curl in 1d is not a useful operation"));
6234template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6239 return BaseClass::get_hessian_diagonal(
q_point);
6244template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6247 const unsigned int q_point)
const
6250 Assert(this->hessians_quad_initialized ==
true,
6254 return BaseClass::get_hessian(
q_point);
6258template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6264 if (this->data->element_type ==
6269 Assert(this->J_value !=
nullptr,
6274 this->values_quad_submitted =
true;
6277 const std::size_t
nqp = this->n_quadrature_points;
6282 const VectorizedArrayType weight = this->quadrature_weights[
q_point];
6284 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6302 const VectorizedArrayType
fac =
6304 this->quadrature_weights[
q_point] :
6308 ((dim == 2 &&
this->get_face_no() < 2) ?
6313 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6317 for (
unsigned int e = 1;
e < dim; ++
e)
6330template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6336 if (this->data->element_type ==
6345 Assert(this->J_value !=
nullptr,
6347 "update_gradients"));
6348 Assert(this->jacobian !=
nullptr,
6350 "update_gradients"));
6352 this->gradients_quad_submitted =
true;
6355 const std::size_t
nqp = this->n_quadrature_points;
6363 const VectorizedArrayType weight = this->quadrature_weights[
q_point];
6364 for (
unsigned int d = 0;
d < dim; ++
d)
6365 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6378 const VectorizedArrayType
fac =
6381 ((dim == 2 &&
this->get_face_no() < 2) ?
6386 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6387 for (
unsigned int d = 0;
d < dim; ++
d)
6389 VectorizedArrayType tmp = 0;
6390 for (
unsigned int f = 0; f < dim; ++f)
6391 for (
unsigned int e = 0;
e < dim; ++
e)
6409 const VectorizedArrayType
fac =
6411 this->quadrature_weights[
q_point] :
6416 VectorizedArrayType tmp;
6418 for (
unsigned int comp = 0;
comp < n_components; ++
comp)
6419 for (
unsigned int d = 0;
d < dim; ++
d)
6422 for (
unsigned int f = 0; f < dim; ++f)
6423 for (
unsigned int e = 0;
e < dim; ++
e)
6436 for (
unsigned int f = 0; f < dim; ++f)
6439 for (
unsigned int i = 0; i < dim; ++i)
6440 for (
unsigned int j = 0;
j < dim; ++
j)
6443 for (
unsigned int m = 0; m < dim; ++m)
6444 for (
unsigned int k = 0;
k < dim; ++
k)
6448 this->values_from_gradients_quad[f *
nqp +
q_point] = tmp *
fac;
6456 for (
unsigned int r = 0, f = dim; r < dim; ++r)
6457 for (
unsigned int k = r + 1;
k < dim; ++
k, ++f)
6460 for (
unsigned int j = 1;
j < dim; ++
j)
6462 for (
unsigned int i = 1; i < dim; ++i)
6463 for (
unsigned int j = 0;
j < dim; ++
j)
6465 this->values_from_gradients_quad[r *
nqp +
q_point] +=
6469 for (
unsigned int j = 1;
j < dim; ++
j)
6471 for (
unsigned int i = 1; i < dim; ++i)
6472 for (
unsigned int j = 0;
j < dim; ++
j)
6474 this->values_from_gradients_quad[
k *
nqp +
q_point] +=
6479 for (
unsigned int n = 0; n < dim; ++n)
6482 for (
unsigned int r = 0, f = dim; r < dim; ++r)
6483 for (
unsigned int k = r + 1;
k < dim; ++
k, ++f)
6484 for (
unsigned int i = 0; i < dim; ++i)
6485 for (
unsigned int j = 0;
j < dim; ++
j)
6486 for (
unsigned int m = 0; m < dim; ++m)
6491 this->values_from_gradients_quad[n *
nqp +
q_point] -=
6505template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6512 if (this->data->element_type ==
6528template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6538 Assert(this->J_value !=
nullptr,
6540 "update_gradients"));
6541 Assert(this->jacobian !=
nullptr,
6543 "update_gradients"));
6545 this->gradients_quad_submitted =
true;
6548 const std::size_t
nqp = this->n_quadrature_points;
6549 if (this->data->element_type ==
6556 const VectorizedArrayType
fac =
6568 Number((dim == 2 &&
this->get_face_no() < 2) ? -1 : 1);
6570 for (
unsigned int d = 0;
d < dim; ++
d)
6573 for (
unsigned int e = d + 1;
e < dim; ++
e)
6576 VectorizedArrayType();
6578 VectorizedArrayType();
6581 this->divergence_is_requested =
true;
6588 const VectorizedArrayType
fac =
6589 this->J_value[0] * this->quadrature_weights[
q_point] *
div_in;
6590 for (
unsigned int d = 0;
d < dim; ++
d)
6593 (
fac * this->jacobian[0][d][d]);
6594 for (
unsigned int e = d + 1;
e < dim; ++
e)
6597 VectorizedArrayType();
6599 VectorizedArrayType();
6609 const VectorizedArrayType
fac =
6612 this->J_value[0] * this->quadrature_weights[
q_point]) *
6614 for (
unsigned int d = 0;
d < dim; ++
d)
6616 for (
unsigned int e = 0;
e < dim; ++
e)
6617 this->gradients_quad[(d * dim + e) *
nqp +
q_point] =
6626template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6634 this->data->element_type !=
6645 Assert(this->J_value !=
nullptr,
6647 "update_gradients"));
6648 Assert(this->jacobian !=
nullptr,
6650 "update_gradients"));
6652 this->gradients_quad_submitted =
true;
6655 const std::size_t
nqp = this->n_quadrature_points;
6658 const VectorizedArrayType JxW =
6659 this->J_value[0] * this->quadrature_weights[
q_point];
6660 for (
unsigned int d = 0;
d < dim; ++
d)
6661 this->gradients_quad[(d * dim + d) *
nqp +
q_point] =
6662 (
sym_grad.access_raw_entry(d) * JxW * this->jacobian[0][
d][
d]);
6663 for (
unsigned int e = 0, counter = dim;
e < dim; ++
e)
6664 for (
unsigned int d = e + 1;
d < dim; ++
d, ++counter)
6666 const VectorizedArrayType
value =
6667 sym_grad.access_raw_entry(counter) * JxW;
6669 value * this->jacobian[0][d][d];
6671 value * this->jacobian[0][e][e];
6677 const VectorizedArrayType JxW =
6680 this->J_value[0] * this->quadrature_weights[
q_point];
6685 VectorizedArrayType
weighted[dim][dim];
6686 for (
unsigned int i = 0; i < dim; ++i)
6688 for (
unsigned int i = 0, counter = dim; i < dim; ++i)
6689 for (
unsigned int j = i + 1;
j < dim; ++
j, ++counter)
6691 const VectorizedArrayType
value =
6692 sym_grad.access_raw_entry(counter) * JxW;
6697 for (
unsigned int d = 0;
d < dim; ++
d)
6700 for (
unsigned int e = 1;
e < dim; ++
e)
6709template <
int dim,
typename Number,
bool is_face,
typename VectorizedArrayType>
6721 "Testing by the curl in 1d is not a useful operation"));
6724 grad[1][0] = curl[0];
6725 grad[0][1] = -curl[0];
6728 grad[2][1] = curl[0];
6729 grad[1][2] = -curl[0];
6730 grad[0][2] = curl[1];
6731 grad[2][0] = -curl[1];
6732 grad[1][0] = curl[2];
6733 grad[0][1] = -curl[2];
6745template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6749 const unsigned int dof_no,
6750 const unsigned int first_selected_component,
6751 const unsigned int quad_no,
6752 const unsigned int fe_degree,
6753 const unsigned int n_q_points,
6754 const bool is_interior_face,
6755 const unsigned int active_fe_index,
6756 const unsigned int active_quad_index,
6757 const unsigned int face_type)
6761 first_selected_component,
6773template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6780 const unsigned int first_selected_component,
6787 first_selected_component,
6793template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6802template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6814template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6817 const unsigned int dof)
const
6820 return this->values_dofs[dof];
6825template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6828 const unsigned int q_point)
const
6831 Assert(this->values_quad_initialized ==
true,
6835 return this->values_quad[
q_point];
6840template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6843 const unsigned int q_point)
const
6849 Assert(this->gradients_quad_initialized ==
true,
6867template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6870 const unsigned int q_point)
const
6872 return get_gradient(
q_point)[0];
6877template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6882 return BaseClass::get_normal_derivative(
q_point)[0];
6887template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6890 const unsigned int q_point)
const
6892 return BaseClass::get_hessian(
q_point)[0];
6897template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6902 return BaseClass::get_hessian_diagonal(
q_point)[0];
6907template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6910 const unsigned int q_point)
const
6912 return BaseClass::get_laplacian(
q_point)[0];
6917template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6923 this->dof_values_initialized =
true;
6926 this->values_dofs[dof] =
val_in;
6931template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6934 const VectorizedArrayType
val_in,
6942 this->values_quad_submitted =
true;
6947 const VectorizedArrayType JxW = this->J_value[
q_point];
6952 const VectorizedArrayType JxW =
6953 this->J_value[0] * this->quadrature_weights[
q_point];
6960template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6971template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6982template <
typename Number,
bool is_face,
typename VectorizedArrayType>
6985 const VectorizedArrayType
grad_in,
6993 this->gradients_quad_submitted =
true;
7000 const VectorizedArrayType JxW =
7003 this->J_value[0] * this->quadrature_weights[
q_point];
7010template <
typename Number,
bool is_face,
typename VectorizedArrayType>
7021template <
typename Number,
bool is_face,
typename VectorizedArrayType>
7029 BaseClass::submit_normal_derivative(
grad,
q_point);
7034template <
typename Number,
bool is_face,
typename VectorizedArrayType>
7044template <
typename Number,
bool is_face,
typename VectorizedArrayType>
7056template <
typename Number,
bool is_face,
typename VectorizedArrayType>
7057inline VectorizedArrayType
7061 return BaseClass::integrate_value()[0];
7074 typename VectorizedArrayType>
7080 VectorizedArrayType>
::
7082 const unsigned int fe_no,
7083 const unsigned int quad_no,
7084 const unsigned int first_selected_component,
7085 const unsigned int active_fe_index,
7086 const unsigned int active_quad_index)
7087 : BaseClass(matrix_free,
7089 first_selected_component,
7096 , dofs_per_component(
this->data->dofs_per_component_on_cell)
7098 , n_q_points(
this->data->n_q_points)
7100 check_template_arguments(
fe_no, 0);
7110 typename VectorizedArrayType>
7116 VectorizedArrayType>
::
7118 const std::pair<unsigned int, unsigned int> &
range,
7119 const unsigned int dof_no,
7120 const unsigned int quad_no,
7121 const unsigned int first_selected_component)
7125 first_selected_component,
7126 matrix_free.get_cell_active_fe_index(
range))
7136 typename VectorizedArrayType>
7142 VectorizedArrayType>
::
7147 const unsigned int first_selected_component)
7148 : BaseClass(mapping,
7152 first_selected_component,
7154 , dofs_per_component(
this->data->dofs_per_component_on_cell)
7156 , n_q_points(
this->data->n_q_points)
7168 typename VectorizedArrayType>
7174 VectorizedArrayType>
::
7178 const unsigned int first_selected_component)
7183 first_selected_component,
7185 , dofs_per_component(
this->data->dofs_per_component_on_cell)
7187 , n_q_points(
this->data->n_q_points)
7199 typename VectorizedArrayType>
7205 VectorizedArrayType>
::
7208 const unsigned int first_selected_component)
7209 : BaseClass(
other.mapped_geometry->get_fe_values().get_mapping(),
7211 other.mapped_geometry->get_quadrature(),
7212 other.mapped_geometry->get_fe_values().get_update_flags(),
7213 first_selected_component,
7215 , dofs_per_component(
this->data->dofs_per_component_on_cell)
7217 , n_q_points(
this->data->n_q_points)
7229 typename VectorizedArrayType>
7238 , dofs_per_component(
this->data->dofs_per_component_on_cell)
7240 , n_q_points(
this->data->n_q_points)
7252 typename VectorizedArrayType>
7258 VectorizedArrayType> &
7266 BaseClass::operator=(
other);
7278 typename VectorizedArrayType>
7285 VectorizedArrayType>
::
7287 const unsigned int first_selected_component)
7290 (void)first_selected_component;
7293 this->data->dofs_per_component_on_cell > 0,
7295 "There is nothing useful you can do with an FEEvaluation object with "
7296 "FE_Nothing, i.e., without DoFs! If you have passed to "
7297 "MatrixFree::reinit() a collection of finite elements also containing "
7298 "FE_Nothing, please check - before creating FEEvaluation - the category "
7299 "of the current range by calling either "
7300 "MatrixFree::get_cell_range_category(range) or "
7301 "MatrixFree::get_face_range_category(range). The returned category "
7302 "is the index of the active FE, which you can use to exclude "
7309 static_cast<unsigned int>(fe_degree) !=
7310 this->data->
data.front().fe_degree) ||
7311 n_q_points !=
this->n_quadrature_points)
7314 "-------------------------------------------------------\n";
7315 message +=
"Illegal arguments in constructor/wrong template arguments!\n";
7316 message +=
" Called --> FEEvaluation<dim,";
7336 if (
static_cast<unsigned int>(fe_degree) ==
7337 this->data->data.front().fe_degree)
7343 for (
unsigned int no = 0;
no < this->matrix_free->n_components();
7345 for (
unsigned int nf = 0;
7346 nf < this->matrix_free->n_base_elements(
no);
7348 if (this->matrix_free
7349 ->get_shape_info(
no, 0,
nf, this->active_fe_index, 0)
7351 .fe_degree ==
static_cast<unsigned int>(fe_degree))
7358 this->mapping_data->descriptor[
this->active_quad_index]
7362 for (
unsigned int no = 0;
7363 no < this->matrix_free->get_mapping_info().cell_data.
size();
7365 if (this->matrix_free->get_mapping_info()
7367 .descriptor[this->active_quad_index]
7368 .n_q_points == n_q_points)
7378 message +=
"Wrong vector component selection:\n";
7380 message +=
"Wrong quadrature formula selection:\n";
7381 message +=
" Did you mean FEEvaluation<dim,";
7413 std::pow(1.001 * this->n_quadrature_points, 1. / dim));
7414 message +=
"Wrong template arguments:\n";
7415 message +=
" Did you mean FEEvaluation<dim,";
7429 if (this->data->data.front().fe_degree !=
7430 static_cast<unsigned int>(fe_degree))
7440 Assert(
static_cast<unsigned int>(fe_degree) ==
7441 this->data->data.front().fe_degree &&
7442 n_q_points ==
this->n_quadrature_points,
7448 this->mapping_data->descriptor[
this->active_quad_index].n_q_points);
7459 typename VectorizedArrayType>
7468 Assert(this->matrix_free !=
nullptr,
7469 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
7470 " Integer indexing is not possible."));
7476 this->matrix_free->get_mapping_info().get_cell_type(
cell_index);
7479 this->mapping_data->data_index_offsets[
cell_index];
7480 this->jacobian = &this->mapping_data->jacobians[0][
offsets];
7481 this->J_value = &this->mapping_data->JxW_values[
offsets];
7482 if (!this->mapping_data->jacobian_gradients[0].empty())
7484 this->jacobian_gradients =
7485 this->mapping_data->jacobian_gradients[0].
data() +
offsets;
7486 this->jacobian_gradients_non_inverse =
7487 this->mapping_data->jacobian_gradients_non_inverse[0].
data() +
offsets;
7490 if (this->matrix_free->n_active_entries_per_cell_batch(
this->cell) ==
7491 VectorizedArrayType::size())
7494 for (
unsigned int i = 0; i < VectorizedArrayType::size(); ++i)
7495 this->cell_ids[i] =
cell_index * VectorizedArrayType::size() + i;
7500 for (; i < this->matrix_free->n_active_entries_per_cell_batch(this->cell);
7502 this->cell_ids[i] =
cell_index * VectorizedArrayType::size() + i;
7503 for (; i < VectorizedArrayType::size(); ++i)
7507 if (this->mapping_data->quadrature_points.empty() ==
false)
7508 this->quadrature_points =
7509 &this->mapping_data->quadrature_points
7510 [
this->mapping_data->quadrature_point_offsets[
this->cell]];
7513 this->is_reinitialized =
true;
7514 this->dof_values_initialized =
false;
7515 this->values_quad_initialized =
false;
7516 this->gradients_quad_initialized =
false;
7517 this->hessians_quad_initialized =
false;
7528 typename VectorizedArrayType>
7535 VectorizedArrayType>
::
7536 reinit(
const std::array<
unsigned int, VectorizedArrayType::size()> &cell_ids)
7542 this->cell_ids = cell_ids;
7547 for (
unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
7556 this->matrix_free->get_mapping_info().get_cell_type(
7561 if (this->mapped_geometry ==
nullptr)
7562 this->mapped_geometry =
7563 std::make_shared<internal::MatrixFreeFunctions::
7564 MappingDataOnTheFly<dim, VectorizedArrayType>>();
7577 if (this->mapping_data->jacobians[0].size() > 0)
7580 if (this->mapping_data->JxW_values.size() > 0)
7583 if (this->mapping_data->jacobian_gradients[0].size() > 0)
7586 if (this->mapping_data->jacobian_gradients_non_inverse[0].size() > 0)
7589 if (this->mapping_data->quadrature_points.size() > 0)
7594 if (this->mapping_data->jacobians[0].size() > 0)
7597 if (this->mapping_data->JxW_values.size() > 0)
7600 if (this->mapping_data->jacobian_gradients[0].size() > 0)
7603 if (this->mapping_data->jacobian_gradients_non_inverse[0].size() > 0)
7605 this->n_quadrature_points);
7607 if (this->mapping_data->quadrature_points.size() > 0)
7615 this->jacobian_gradients_non_inverse =
7620 for (
unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
7631 const unsigned int lane =
cell_index % VectorizedArrayType::size();
7633 if (this->cell_type <=
7637 const unsigned int q = 0;
7639 if (this->mapping_data->JxW_values.size() > 0)
7641 this->mapping_data->JxW_values[
offsets +
q][lane];
7643 if (this->mapping_data->jacobians[0].size() > 0)
7644 for (
unsigned int q = 0;
q < 2; ++
q)
7645 for (
unsigned int i = 0; i < dim; ++i)
7646 for (
unsigned int j = 0;
j < dim; ++
j)
7648 this->mapping_data->jacobians[0][
offsets +
q][i][
j][lane];
7650 if (this->mapping_data->jacobian_gradients[0].size() > 0)
7651 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7652 for (
unsigned int j = 0;
j < dim; ++
j)
7655 ->jacobian_gradients[0][
offsets +
q][i][
j][lane];
7657 if (this->mapping_data->jacobian_gradients_non_inverse[0].size() > 0)
7658 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7659 for (
unsigned int j = 0;
j < dim; ++
j)
7662 ->jacobian_gradients_non_inverse[0][
offsets +
q][i][
j]
7665 if (this->mapping_data->quadrature_points.size() > 0)
7666 for (
unsigned int i = 0; i < dim; ++i)
7668 this->mapping_data->quadrature_points
7676 const auto cell_type =
7677 this->matrix_free->get_mapping_info().get_cell_type(
7680 for (
unsigned int q = 0;
q < this->n_quadrature_points; ++
q)
7682 const unsigned int q_src =
7688 if (this->mapping_data->JxW_values.size() > 0)
7692 if (this->mapping_data->jacobians[0].size() > 0)
7693 for (
unsigned int i = 0; i < dim; ++i)
7694 for (
unsigned int j = 0;
j < dim; ++
j)
7699 if (this->mapping_data->jacobian_gradients[0].size() > 0)
7700 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7701 for (
unsigned int j = 0;
j < dim; ++
j)
7706 if (this->mapping_data->jacobian_gradients_non_inverse[0].size() >
7708 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7709 for (
unsigned int j = 0;
j < dim; ++
j)
7712 ->jacobian_gradients_non_inverse[0][
offsets +
q_src][i]
7715 if (this->mapping_data->quadrature_points.size() > 0)
7724 this->mapping_data->quadrature_points
7730 this->mapping_data->jacobians[0][
offsets + 1];
7732 for (
unsigned int d = 0;
d < dim; ++
d)
7735 static_cast<Number
>(
7736 this->descriptor->quadrature.point(
q)[
d]);
7738 for (
unsigned int d = 0;
d < dim; ++
d)
7739 for (
unsigned int e = 0;
e < dim; ++
e)
7742 static_cast<Number
>(
7743 this->descriptor->quadrature.point(
q)[
e]);
7745 for (
unsigned int i = 0; i < dim; ++i)
7751 for (
unsigned int i = 0; i < dim; ++i)
7753 this->mapping_data->quadrature_points
7764 this->is_reinitialized =
true;
7765 this->dof_values_initialized =
false;
7766 this->values_quad_initialized =
false;
7767 this->gradients_quad_initialized =
false;
7768 this->hessians_quad_initialized =
false;
7779 typename VectorizedArrayType>
7780template <
bool level_dof_access>
7787 VectorizedArrayType>
::
7790 Assert(this->matrix_free ==
nullptr,
7791 ExcMessage(
"Cannot use initialization from cell iterator if "
7792 "initialized from MatrixFree object. Use variant for "
7793 "on the fly computation with arguments as for FEValues "
7796 this->mapped_geometry->reinit(
7798 this->local_dof_indices.resize(cell->get_fe().n_dofs_per_cell());
7799 if (level_dof_access)
7800 cell->get_mg_dof_indices(this->local_dof_indices);
7802 cell->get_dof_indices(this->local_dof_indices);
7805 this->is_reinitialized =
true;
7816 typename VectorizedArrayType>
7823 VectorizedArrayType>
::
7826 Assert(this->matrix_free == 0,
7827 ExcMessage(
"Cannot use initialization from cell iterator if "
7828 "initialized from MatrixFree object. Use variant for "
7829 "on the fly computation with arguments as for FEValues "
7832 this->mapped_geometry->reinit(cell);
7835 this->is_reinitialized =
true;
7846 typename VectorizedArrayType>
7858 Assert(this->dof_values_initialized ==
true,
7861 evaluate(this->values_dofs,
7873 typename VectorizedArrayType>
7880 VectorizedArrayType>
::
7884 Assert(this->dof_values_initialized ==
true,
7897 typename VectorizedArrayType>
7904 VectorizedArrayType>::evaluate(
const VectorizedArrayType
7927 typename VectorizedArrayType>
7934 VectorizedArrayType>
::
7945 if (this->data->element_type ==
7967 this->values_quad_initialized =
true;
7969 this->gradients_quad_initialized =
true;
7971 this->hessians_quad_initialized =
true;
7982 typename VectorizedArrayType>
7983template <
typename VectorType>
7991 VectorizedArrayType>::gather_evaluate(
const VectorType &
input_vector,
8012 template <
typename Number,
8013 typename VectorizedArrayType,
8014 typename VectorType,
8016 std::enable_if_t<internal::has_begin<VectorType> &&
8018 VectorType> * =
nullptr>
8019 VectorizedArrayType *
8026 const unsigned int cell = fe_eval.get_cell_or_face_batch_id();
8027 const auto & dof_info = fe_eval.get_dof_info();
8034 if (std::is_same<typename VectorType::value_type, Number>::value &&
8038 interleaved_contiguous &&
8041 dof_info.dof_indices_contiguous
8042 [
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
8043 [cell * VectorizedArrayType::size()]) %
8044 sizeof(VectorizedArrayType) ==
8047 return reinterpret_cast<VectorizedArrayType *
>(
8051 [cell * VectorizedArrayType::size()] +
8053 [fe_eval.get_active_fe_index()]
8054 [fe_eval.get_first_selected_component()] *
8055 VectorizedArrayType::size());
8064 template <
typename Number,
8065 typename VectorizedArrayType,
8066 typename VectorType,
8068 std::enable_if_t<!internal::has_begin<VectorType> ||
8070 VectorType> * =
nullptr>
8071 VectorizedArrayType *
8085 typename VectorizedArrayType>
8086template <
typename VectorType>
8093 VectorizedArrayType>
::
8097 const VectorizedArrayType *
src_ptr =
8098 internal::check_vector_access_inplace<Number, const VectorizedArrayType>(
8116 typename VectorizedArrayType>
8129 this->dof_values_initialized =
true;
8140 typename VectorizedArrayType>
8147 VectorizedArrayType>
::
8153 this->dof_values_initialized =
true;
8164 typename VectorizedArrayType>
8189 typename VectorizedArrayType>
8196 VectorizedArrayType>
::
8203 Assert(this->values_quad_submitted ==
true,
8206 Assert(this->gradients_quad_submitted ==
true,
8209 Assert(this->hessians_quad_submitted ==
true,
8212 Assert(this->matrix_free !=
nullptr ||
8213 this->mapped_geometry->is_initialized(),
8219 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, and "
8220 "EvaluationFlags::hessians are supported."));
8226 unsigned int size = n_components * dim * n_q_points;
8229 for (
unsigned int i = 0; i < size; ++i)
8230 this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
8234 for (
unsigned int i = 0; i < size; ++i)
8235 this->gradients_quad[i] = this->gradients_from_hessians_quad[i];
8240 if (this->data->element_type ==
8244 this->divergence_is_requested ==
false)
8246 unsigned int size = n_components * n_q_points;
8249 for (
unsigned int i = 0; i < size; ++i)
8250 this->values_quad[i] += this->values_from_gradients_quad[i];
8254 for (
unsigned int i = 0; i < size; ++i)
8255 this->values_quad[i] = this->values_from_gradients_quad[i];
8280 this->dof_values_initialized =
true;
8291 typename VectorizedArrayType>
8292template <
typename VectorType>
8319 typename VectorizedArrayType>
8320template <
typename VectorType>
8327 VectorizedArrayType>
::
8331 VectorizedArrayType *
dst_ptr =
8332 internal::check_vector_access_inplace<Number, VectorizedArrayType>(
8350 typename VectorizedArrayType>
8357 VectorizedArrayType>::dof_indices()
const
8359 return {0U, dofs_per_cell};
8373 typename VectorizedArrayType>
8379 VectorizedArrayType>
::
8382 const bool is_interior_face,
8383 const unsigned int dof_no,
8384 const unsigned int quad_no,
8385 const unsigned int first_selected_component,
8386 const unsigned int active_fe_index,
8387 const unsigned int active_quad_index,
8388 const unsigned int face_type)
8389 : BaseClass(matrix_free,
8391 first_selected_component,
8399 , dofs_per_component(
this->data->dofs_per_component_on_cell)
8401 , n_q_points(
this->n_quadrature_points)
8411 typename VectorizedArrayType>
8417 VectorizedArrayType>
::
8420 const std::pair<unsigned int, unsigned int> &
range,
8421 const bool is_interior_face,
8422 const unsigned int dof_no,
8423 const unsigned int quad_no,
8424 const unsigned int first_selected_component)
8429 first_selected_component,
8430 matrix_free.get_face_active_fe_index(
range,
8432 numbers::invalid_unsigned_int,
8433 matrix_free.get_face_info(
range.
first).face_type)
8443 typename VectorizedArrayType>
8450 VectorizedArrayType>
::reinit(
const unsigned int face_index)
8452 Assert(this->mapped_geometry ==
nullptr,
8453 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
8454 " Integer indexing is not possible"));
8455 if (this->mapped_geometry !=
nullptr)
8458 this->cell = face_index;
8459 this->dof_access_index =
8460 this->is_interior_face() ?
8466 this->matrix_free->get_task_info().face_partition_data.back() &&
8468 this->matrix_free->get_task_info().boundary_partition_data.back())
8469 Assert(this->is_interior_face(),
8471 "Boundary faces do not have a neighbor. When looping over "
8472 "boundary faces use FEFaceEvaluation with the parameter "
8473 "is_interior_face set to true. "));
8475 this->reinit_face(this->matrix_free->get_face_info(face_index));
8478 for (; i < this->matrix_free->n_active_entries_per_face_batch(this->cell);
8480 this->face_ids[i] = face_index * VectorizedArrayType::size() + i;
8481 for (; i < VectorizedArrayType::size(); ++i)
8484 this->cell_type = this->matrix_free->get_mapping_info().face_type[face_index];
8486 this->mapping_data->data_index_offsets[face_index];
8487 this->J_value = &this->mapping_data->JxW_values[
offsets];
8488 this->normal_vectors = &this->mapping_data->normal_vectors[
offsets];
8490 &this->mapping_data->jacobians[!this->is_interior_face()][
offsets];
8491 this->normal_x_jacobian =
8493 ->normals_times_jacobians[!this->is_interior_face()][
offsets];
8494 this->jacobian_gradients =
8495 this->mapping_data->jacobian_gradients[!this->is_interior_face()].
data() +
8497 this->jacobian_gradients_non_inverse =
8499 ->jacobian_gradients_non_inverse[!this->is_interior_face()]
8503 if (this->mapping_data->quadrature_point_offsets.empty() ==
false)
8506 this->mapping_data->quadrature_point_offsets.size());
8508 this->mapping_data->quadrature_points.data() +
8509 this->mapping_data->quadrature_point_offsets[this->cell];
8513 this->is_reinitialized =
true;
8514 this->dof_values_initialized =
false;
8515 this->values_quad_initialized =
false;
8516 this->gradients_quad_initialized =
false;
8517 this->hessians_quad_initialized =
false;
8528 typename VectorizedArrayType>
8536 const unsigned int face_number)
8540 this->matrix_free->get_mapping_info().face_data_by_cells.
size(),
8542 "You must set MatrixFree::AdditionalData::mapping_update_flags_faces_by_cells to use the present reinit method."));
8545 this->matrix_free->get_mapping_info().cell_type.
size());
8546 Assert(this->mapped_geometry ==
nullptr,
8547 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
8548 " Integer indexing is not possible"));
8549 if (this->mapped_geometry !=
nullptr)
8553 this->cell_type = this->matrix_free->get_mapping_info()
8554 .faces_by_cells_type[
cell_index][face_number];
8557 this->dof_access_index =
8560 constexpr unsigned int n_lanes = VectorizedArrayType::size();
8562 if (this->is_interior_face() ==
false)
8567 for (
unsigned int i = 0; i < n_lanes; ++i)
8572 unsigned int face_index =
8573 this->matrix_free->get_cell_and_face_to_plain_faces()(
cell_index,
8577 this->face_ids[i] = face_index;
8582 this->face_numbers[i] =
static_cast<std::uint8_t
>(-1);
8583 this->face_orientations[i] =
static_cast<std::uint8_t
>(-1);
8588 this->matrix_free->get_face_info(face_index / n_lanes);
8590 auto cell_m = faces.cells_interior[face_index % n_lanes];
8591 auto cell_p = faces.cells_exterior[face_index % n_lanes];
8601 this->cell_ids[i] =
cell_m;
8602 this->face_numbers[i] = faces.interior_face_no;
8606 this->cell_ids[i] =
cell_p;
8607 this->face_numbers[i] = faces.exterior_face_no;
8611 unsigned int face_orientation = faces.face_orientation % 8;
8614 constexpr std::array<std::uint8_t, 8> table{
8615 {0, 1, 2, 3, 6, 5, 4, 7}};
8616 face_orientation = table[face_orientation];
8618 this->face_orientations[i] = face_orientation;
8623 this->face_orientations[0] = 0;
8624 this->face_numbers[0] = face_number;
8625 for (
unsigned int i = 0; i < n_lanes; ++i)
8626 this->cell_ids[i] =
cell_index * n_lanes + i;
8627 for (
unsigned int i = 0; i < n_lanes; ++i)
8629 this->matrix_free->get_cell_and_face_to_plain_faces()(
cell_index,
8635 this->matrix_free->get_mapping_info()
8636 .face_data_by_cells[this->quad_no]
8640 this->matrix_free->get_mapping_info()
8641 .face_data_by_cells[
this->quad_no]
8642 .JxW_values.
size());
8643 this->J_value = &this->matrix_free->get_mapping_info()
8644 .face_data_by_cells[this->quad_no]
8646 this->normal_vectors = &this->matrix_free->get_mapping_info()
8647 .face_data_by_cells[this->quad_no]
8649 this->jacobian = &this->matrix_free->get_mapping_info()
8650 .face_data_by_cells[this->quad_no]
8651 .jacobians[!this->is_interior_face()][
offsets];
8652 this->normal_x_jacobian =
8653 &this->matrix_free->get_mapping_info()
8654 .face_data_by_cells[this->quad_no]
8655 .normals_times_jacobians[!this->is_interior_face()][
offsets];
8656 this->jacobian_gradients =
8657 this->mapping_data->jacobian_gradients[!this->is_interior_face()].
data() +
8659 this->jacobian_gradients_non_inverse =
8661 ->jacobian_gradients_non_inverse[!this->is_interior_face()]
8665 if (this->matrix_free->get_mapping_info()
8666 .face_data_by_cells[
this->quad_no]
8667 .quadrature_point_offsets.
empty() ==
false)
8669 const unsigned int index =
8672 this->matrix_free->get_mapping_info()
8673 .face_data_by_cells[
this->quad_no]
8674 .quadrature_point_offsets.
size());
8676 .face_data_by_cells[this->quad_no]
8677 .quadrature_points.
data() +
8678 this->matrix_free->get_mapping_info()
8679 .face_data_by_cells[this->quad_no]
8680 .quadrature_point_offsets[
index];
8684 this->is_reinitialized =
true;
8685 this->dof_values_initialized =
false;
8686 this->values_quad_initialized =
false;
8687 this->gradients_quad_initialized =
false;
8688 this->hessians_quad_initialized =
false;
8699 typename VectorizedArrayType>
8723 typename VectorizedArrayType>
8730 VectorizedArrayType>
::
8747 typename VectorizedArrayType>
8754 VectorizedArrayType>::evaluate(
const VectorizedArrayType
8774 typename VectorizedArrayType>
8781 VectorizedArrayType>
::
8788 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8789 "and EvaluationFlags::hessians are supported."));
8798 if (this->data->element_type ==
8816 this->values_quad_initialized =
true;
8818 this->gradients_quad_initialized =
true;
8820 this->hessians_quad_initialized =
true;
8831 typename VectorizedArrayType>
8838 VectorizedArrayType>
::
8844 this->dof_values_initialized =
true;
8855 typename VectorizedArrayType>
8868 this->dof_values_initialized =
true;
8879 typename VectorizedArrayType>
8906 typename VectorizedArrayType>
8913 VectorizedArrayType>
::
8920 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8921 "and EvaluationFlags::hessians are supported."));
8927 unsigned int size = n_components * dim * n_q_points;
8930 for (
unsigned int i = 0; i < size; ++i)
8931 this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
8935 for (
unsigned int i = 0; i < size; ++i)
8936 this->gradients_quad[i] = this->gradients_from_hessians_quad[i];
8941 if (this->data->element_type ==
8945 this->divergence_is_requested ==
false)
8947 unsigned int size = n_components * n_q_points;
8950 for (
unsigned int i = 0; i < size; ++i)
8951 this->values_quad[i] += this->values_from_gradients_quad[i];
8955 for (
unsigned int i = 0; i < size; ++i)
8956 this->values_quad[i] = this->values_from_gradients_quad[i];
8979 typename VectorizedArrayType>
8980template <
typename VectorType>
8988 VectorizedArrayType>::gather_evaluate(
const VectorType &
input_vector,
9007 typename VectorizedArrayType>
9008template <
typename VectorType>
9015 VectorizedArrayType>
::
9022 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
9023 "and EvaluationFlags::hessians are supported."));
9025 const auto shared_vector_data = internal::get_shared_vector_data(
9027 this->dof_access_index ==
9029 this->active_fe_index,
9032 if (this->data->data.front().fe_degree > 0 &&
9033 fast_evaluation_supported(this->data->data.front().fe_degree,
9034 this->
data->data.front().n_q_points_1d) &&
9037 typename VectorType::value_type,
9038 VectorizedArrayType>::
9043 this->dof_info->index_storage_variants[
this->dof_access_index]
9050 typename VectorType::value_type,
9055 internal::get_beginning<typename VectorType::value_type>(
9064 typename VectorType::value_type,
9065 VectorizedArrayType>::evaluate(n_components,
9067 internal::get_beginning<
9068 typename VectorType::value_type>(
9082 this->values_quad_initialized =
true;
9084 this->gradients_quad_initialized =
true;
9086 this->hessians_quad_initialized =
true;
9097 typename VectorizedArrayType>
9098template <
typename VectorType>
9125 typename VectorizedArrayType>
9126template <
typename VectorType>
9133 VectorizedArrayType>
::
9137 Assert((this->dof_access_index ==
9139 this->is_interior_face() ==
false) ==
false,
9142 const auto shared_vector_data = internal::get_shared_vector_data(
9144 this->dof_access_index ==
9146 this->active_fe_index,
9149 if (this->data->data.front().fe_degree > 0 &&
9150 fast_evaluation_supported(this->data->data.front().fe_degree,
9151 this->
data->data.front().n_q_points_1d) &&
9154 typename VectorType::value_type,
9155 VectorizedArrayType>::
9160 this->dof_info->index_storage_variants[
this->dof_access_index]
9167 typename VectorType::value_type,
9172 internal::get_beginning<typename VectorType::value_type>(
9181 typename VectorType::value_type,
9182 VectorizedArrayType>::integrate(n_components,
9184 internal::get_beginning<
9185 typename VectorType::value_type>(
9205 typename VectorizedArrayType>
9212 VectorizedArrayType>::dof_indices()
const
9214 return {0U, dofs_per_cell};
9224 typename VectorizedArrayType>
9231 VectorizedArrayType>
::
9235 return fe_degree == -1 ?
9248 typename VectorizedArrayType>
9255 VectorizedArrayType>
::
9259 return fe_degree == -1 ?
9272 typename VectorizedArrayType>
9279 VectorizedArrayType>::at_boundary()
const
9281 Assert(this->dof_access_index !=
9285 if (this->is_interior_face() ==
false)
9287 else if (this->
cell < this->matrix_free->n_inner_face_batches())
9289 else if (this->cell < (this->matrix_free->n_inner_face_batches() +
9290 this->matrix_free->n_boundary_face_batches()))
9303 typename VectorizedArrayType>
9310 VectorizedArrayType>::boundary_id()
const
9312 Assert(this->dof_access_index !=
9317 return this->matrix_free->get_boundary_id(this->cell);
value_type * data() const noexcept
FEEvaluationAccess(const FEEvaluationAccess &other)
hessian_type get_hessian(unsigned int q_point) const
value_type get_value(const unsigned int q_point) const
value_type integrate_value() const
void submit_normal_derivative(const value_type grad_in, const unsigned int q_point)
value_type get_laplacian(const unsigned int q_point) const
void submit_value(const gradient_type val_in, const unsigned int q_point)
value_type get_normal_derivative(const unsigned int q_point) const
void submit_normal_derivative(const gradient_type grad_in, const unsigned int q_point)
gradient_type get_hessian_diagonal(const unsigned int q_point) const
void submit_dof_value(const value_type val_in, const unsigned int dof)
void submit_gradient(const value_type grad_in, const unsigned int q_point)
void submit_hessian(const hessian_type hessian_in, const unsigned int q_point)
gradient_type get_gradient(const unsigned int q_point) const
FEEvaluationAccess & operator=(const FEEvaluationAccess &other)
VectorizedArrayType value_type
void submit_gradient(const Tensor< 2, 1, VectorizedArrayType > grad_in, const unsigned int q_point)
FEEvaluationAccess(const Mapping< 1 > &mapping, const FiniteElement< 1 > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, const FEEvaluationData< 1, VectorizedArrayType, is_face > *other)
value_type get_divergence(const unsigned int q_point) const
value_type get_dof_value(const unsigned int dof) const
FEEvaluationAccess(const MatrixFree< 1, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int fe_degree, const unsigned int n_q_points, const bool is_interior_face=true, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int, const unsigned int face_type=numbers::invalid_unsigned_int)
void submit_gradient(const gradient_type grad_in, const unsigned int q_point)
void submit_value(const value_type val_in, const unsigned int q_point)
value_type get_value(const unsigned int q_point) const
void submit_dof_value(const value_type val_in, const unsigned int dof)
value_type get_dof_value(const unsigned int dof) const
gradient_type get_hessian_diagonal(const unsigned int q_point) const
void submit_normal_derivative(const value_type grad_in, const unsigned int q_point)
void submit_value(const Tensor< 1, 1, VectorizedArrayType > val_in, const unsigned int q_point)
FEEvaluationAccess(const FEEvaluationAccess &other)
FEEvaluationAccess(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int fe_degree, const unsigned int n_q_points, const bool is_interior_face=true, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int, const unsigned int face_type=numbers::invalid_unsigned_int)
value_type get_laplacian(const unsigned int q_point) const
hessian_type get_hessian(unsigned int q_point) const
FEEvaluationAccess(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, const FEEvaluationData< dim, VectorizedArrayType, is_face > *other)
VectorizedArrayType value_type
FEEvaluationAccess & operator=(const FEEvaluationAccess &other)
value_type get_normal_derivative(const unsigned int q_point) const
value_type integrate_value() const
void submit_value(const value_type val_in, const unsigned int q_point)
void submit_gradient(const gradient_type grad_in, const unsigned int q_point)
void submit_hessian(const hessian_type hessian_in, const unsigned int q_point)
gradient_type get_gradient(const unsigned int q_point) const
FEEvaluationAccess(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int dofs_per_cell, const unsigned int n_q_points, const bool is_interior_face=true, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int, const unsigned int face_type=numbers::invalid_unsigned_int)
FEEvaluationAccess(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, const FEEvaluationData< dim, VectorizedArrayType, is_face > *other)
FEEvaluationAccess(const FEEvaluationAccess &other)
void submit_gradient(const gradient_type grad_in, const unsigned int q_point)
value_type get_value(const unsigned int q_point) const
FEEvaluationAccess & operator=(const FEEvaluationAccess &other)
Tensor< 3, dim, VectorizedArrayType > get_hessian(const unsigned int q_point) const
VectorizedArrayType get_divergence(const unsigned int q_point) const
Tensor< 1,(dim==2 ? 1 :dim), VectorizedArrayType > get_curl(const unsigned int q_point) const
void submit_curl(const Tensor< 1, dim==2 ? 1 :dim, VectorizedArrayType > curl_in, const unsigned int q_point)
gradient_type get_gradient(const unsigned int q_point) const
void submit_gradient(const Tensor< 1, dim, Tensor< 1, dim, VectorizedArrayType > > grad_in, const unsigned int q_point)
gradient_type get_hessian_diagonal(const unsigned int q_point) const
void submit_divergence(const VectorizedArrayType div_in, const unsigned int q_point)
void submit_value(const Tensor< 1, dim, VectorizedArrayType > val_in, const unsigned int q_point)
SymmetricTensor< 2, dim, VectorizedArrayType > get_symmetric_gradient(const unsigned int q_point) const
void submit_symmetric_gradient(const SymmetricTensor< 2, dim, VectorizedArrayType > grad_in, const unsigned int q_point)
Tensor< 1, n_components_, VectorizedArrayType > value_type
FEEvaluationAccess(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, const FEEvaluationData< dim, VectorizedArrayType, is_face > *other)
static constexpr unsigned int dimension
Tensor< 1, n_components_, Tensor< 1, dim, VectorizedArrayType > > gradient_type
FEEvaluationAccess(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int fe_degree, const unsigned int n_q_points, const bool is_interior_face=true, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int, const unsigned int face_type=numbers::invalid_unsigned_int)
FEEvaluationAccess(const FEEvaluationAccess &other)
FEEvaluationAccess & operator=(const FEEvaluationAccess &other)
static constexpr unsigned int n_components
value_type get_dof_value(const unsigned int dof) const
Tensor< 1, n_components_, Tensor< 2, dim, VectorizedArrayType > > get_hessian(const unsigned int q_point) const
void read_write_operation_global(const VectorOperation &operation, const std::array< VectorType *, n_components_ > &vectors) const
void read_dof_values_plain(const VectorType &src, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip())
value_type get_laplacian(const unsigned int q_point) const
AlignedVector< VectorizedArrayType > * scratch_data_array
gradient_type get_gradient(const unsigned int q_point) const
void distribute_local_to_global(VectorType &dst, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip()) const
static constexpr unsigned int dimension
void submit_gradient(const gradient_type grad_in, const unsigned int q_point)
void submit_value(const value_type val_in, const unsigned int q_point)
Tensor< 1,(dim==2 ? 1 :dim), VectorizedArrayType > get_curl(const unsigned int q_point) const
void submit_dof_value(const value_type val_in, const unsigned int dof)
std::vector< types::global_dof_index > local_dof_indices
void set_dof_values(VectorType &dst, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip()) const
void submit_symmetric_gradient(const SymmetricTensor< 2, dim, VectorizedArrayType > grad_in, const unsigned int q_point)
VectorizedArrayType get_divergence(const unsigned int q_point) const
FEEvaluationBase(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component, const FEEvaluationData< dim, VectorizedArrayType, is_face > *other)
FEEvaluationBase & operator=(const FEEvaluationBase &other)
void read_dof_values(const VectorType &src, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip())
void submit_divergence(const VectorizedArrayType div_in, const unsigned int q_point)
static constexpr unsigned int n_components
gradient_type get_hessian_diagonal(const unsigned int q_point) const
void read_write_operation(const VectorOperation &operation, const std::array< VectorType *, n_components_ > &vectors, const std::array< const std::vector< ArrayView< const typename VectorType::value_type > > *, n_components_ > &vectors_sm, const std::bitset< VectorizedArrayType::size()> &mask, const bool apply_constraints=true) const
const MatrixFree< dim, Number, VectorizedArrayType > & get_matrix_free() const
void apply_hanging_node_constraints(const bool transpose) const
FEEvaluationBase(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int fe_degree, const unsigned int n_q_points, const bool is_interior_face, const unsigned int active_fe_index, const unsigned int active_quad_index, const unsigned int face_type)
void submit_normal_derivative(const value_type grad_in, const unsigned int q_point)
void read_write_operation_contiguous(const VectorOperation &operation, const std::array< VectorType *, n_components_ > &vectors, const std::array< const std::vector< ArrayView< const typename VectorType::value_type > > *, n_components_ > &vectors_sm, const std::bitset< VectorizedArrayType::size()> &mask) const
value_type integrate_value() const
FEEvaluationBase(const FEEvaluationBase &other)
void submit_hessian(const hessian_type hessian_in, const unsigned int q_point)
SymmetricTensor< 2, dim, VectorizedArrayType > get_symmetric_gradient(const unsigned int q_point) const
const MatrixFree< dim, Number, VectorizedArrayType > * matrix_free
value_type get_normal_derivative(const unsigned int q_point) const
value_type get_value(const unsigned int q_point) const
void submit_curl(const Tensor< 1, dim==2 ? 1 :dim, VectorizedArrayType > curl_in, const unsigned int q_point)
void set_dof_values_plain(VectorType &dst, const unsigned int first_index=0, const std::bitset< VectorizedArrayType::size()> &mask=std::bitset< VectorizedArrayType::size()>().flip()) const
const unsigned int quad_no
const unsigned int active_fe_index
std::array< unsigned int, n_lanes > cell_ids
const unsigned int active_quad_index
bool is_interior_face() const
FEEvaluationData & operator=(const FEEvaluationData &other)
const unsigned int first_selected_component
void integrate_scatter(const bool integrate_values, const bool integrate_gradients, VectorType &output_vector)
FEEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const std::pair< unsigned int, unsigned int > &range, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0)
const unsigned int dofs_per_component
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
FEEvaluation(const Mapping< dim > &mapping, const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component=0)
const unsigned int n_q_points
void integrate(const bool integrate_values, const bool integrate_gradients)
void reinit(const std::array< unsigned int, VectorizedArrayType::size()> &cell_ids)
FEEvaluation(const FiniteElement< dim > &fe, const Quadrature< 1 > &quadrature, const UpdateFlags update_flags, const unsigned int first_selected_component=0)
void reinit(const typename Triangulation< dim >::cell_iterator &cell)
static bool fast_evaluation_supported(const unsigned int given_degree, const unsigned int given_n_q_points_1d)
void integrate_scatter(const EvaluationFlags::EvaluationFlags integration_flag, VectorType &output_vector)
void reinit(const unsigned int cell_batch_index)
FEEvaluation(const FiniteElement< dim > &fe, const FEEvaluationData< dim, VectorizedArrayType, false > &other, const unsigned int first_selected_component=0)
void reinit(const TriaIterator< DoFCellAccessor< dim, dim, level_dof_access > > &cell)
void evaluate(const bool evaluate_values, const bool evaluate_gradients, const bool evaluate_hessians=false)
void evaluate(const EvaluationFlags::EvaluationFlags evaluation_flag)
static constexpr unsigned int tensor_dofs_per_cell
void evaluate(const VectorizedArrayType *values_array, const EvaluationFlags::EvaluationFlags evaluation_flag)
typename BaseClass::gradient_type gradient_type
void integrate(const EvaluationFlags::EvaluationFlags integration_flag, VectorizedArrayType *values_array, const bool sum_into_values=false)
static constexpr unsigned int dimension
void gather_evaluate(const VectorType &input_vector, const EvaluationFlags::EvaluationFlags evaluation_flag)
const unsigned int dofs_per_cell
static constexpr unsigned int static_dofs_per_cell
void gather_evaluate(const VectorType &input_vector, const bool evaluate_values, const bool evaluate_gradients, const bool evaluate_hessians=false)
typename BaseClass::value_type value_type
FEEvaluation & operator=(const FEEvaluation &other)
void integrate(const EvaluationFlags::EvaluationFlags integration_flag)
static constexpr unsigned int n_components
void evaluate(const VectorizedArrayType *values_array, const bool evaluate_values, const bool evaluate_gradients, const bool evaluate_hessians=false)
FEEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int)
static constexpr unsigned int static_n_q_points
FEEvaluation(const FEEvaluation &other)
void integrate(const bool integrate_values, const bool integrate_gradients, VectorizedArrayType *values_array)
void check_template_arguments(const unsigned int fe_no, const unsigned int first_selected_component)
static constexpr unsigned int static_dofs_per_component
typename BaseClass::value_type value_type
std_cxx20::ranges::iota_view< unsigned int, unsigned int > dof_indices() const
void integrate_scatter(const EvaluationFlags::EvaluationFlags integration_flag, VectorType &output_vector)
static constexpr unsigned int static_n_q_points_cell
static constexpr unsigned int tensor_dofs_per_cell
const unsigned int dofs_per_component
void reinit(const unsigned int face_batch_number)
const unsigned int n_q_points
void gather_evaluate(const VectorType &input_vector, const EvaluationFlags::EvaluationFlags evaluation_flag)
void reinit(const unsigned int cell_batch_number, const unsigned int face_number)
static bool fast_evaluation_supported(const unsigned int given_degree, const unsigned int given_n_q_points_1d)
void evaluate(const VectorizedArrayType *values_array, const EvaluationFlags::EvaluationFlags evaluation_flag)
const unsigned int dofs_per_cell
static constexpr unsigned int n_components
void gather_evaluate(const VectorType &input_vector, const bool evaluate_values, const bool evaluate_gradients)
void integrate(const bool integrate_values, const bool integrate_gradients, VectorizedArrayType *values_array)
void evaluate(const VectorizedArrayType *values_array, const bool evaluate_values, const bool evaluate_gradients)
void evaluate(const EvaluationFlags::EvaluationFlags evaluation_flag)
void evaluate(const bool evaluate_values, const bool evaluate_gradients)
FEFaceEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const std::pair< unsigned int, unsigned int > &range, const bool is_interior_face=true, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0)
void integrate(const EvaluationFlags::EvaluationFlags integration_flag)
void integrate(const EvaluationFlags::EvaluationFlags integration_flag, VectorizedArrayType *values_array)
static constexpr unsigned int static_dofs_per_component
static constexpr unsigned int static_n_q_points
FEFaceEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const bool is_interior_face=true, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0, const unsigned int active_fe_index=numbers::invalid_unsigned_int, const unsigned int active_quad_index=numbers::invalid_unsigned_int, const unsigned int face_type=numbers::invalid_unsigned_int)
static constexpr unsigned int dimension
typename BaseClass::gradient_type gradient_type
types::boundary_id boundary_id() const
void integrate_scatter(const bool integrate_values, const bool integrate_gradients, VectorType &output_vector)
static constexpr unsigned int static_dofs_per_cell
void integrate(const bool integrate_values, const bool integrate_gradients)
#define DEAL_II_ALWAYS_INLINE
#define DEAL_II_OPENMP_SIMD_PRAGMA
#define DEAL_II_DEPRECATED
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcAccessToUninitializedField()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcNotInitialized()
static ::ExceptionBase & ExcMatrixFreeAccessToUninitializedMappingField(std::string arg1)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
The namespace for the EvaluationFlags enum.
EvaluationFlags
The EvaluationFlags enum.
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
void quadrature_points(const Triangulation< dim, spacedim > &triangulation, const Quadrature< dim > &quadrature, const std::vector< std::vector< BoundingBox< spacedim > > > &global_bounding_boxes, ParticleHandler< dim, spacedim > &particle_handler, const Mapping< dim, spacedim > &mapping=(ReferenceCells::get_hypercube< dim >() .template get_default_linear_mapping< dim, spacedim >()), const std::vector< std::vector< double > > &properties={})
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
VectorType::value_type * begin(VectorType &V)
T sum(const T &t, const MPI_Comm mpi_communicator)
constexpr T pow(const T base, const int iexp)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
void run(const Iterator &begin, const std_cxx20::type_identity_t< Iterator > &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
constexpr compressed_constraint_kind unconstrained_compressed_constraint_kind
void check_vector_compatibility(const VectorType &vec, const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const internal::MatrixFreeFunctions::DoFInfo &dof_info)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
const types::boundary_id internal_face_boundary_id
static const unsigned int invalid_unsigned_int
boost::integer_range< IncrementableType > iota_view
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
static void integrate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, Number *values_dofs, FEEvaluationData< dim, Number, false > &eval, const bool sum_into_values_array=false)
static void evaluate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, const Number *values_dofs, FEEvaluationData< dim, Number, false > &eval)
static bool fast_evaluation_supported(const unsigned int given_degree, const unsigned int n_q_points_1d)
static void evaluate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, const Number *values_dofs, FEEvaluationData< dim, Number, false > &fe_eval)
static void integrate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, Number *values_dofs, FEEvaluationData< dim, Number, false > &fe_eval, const bool sum_into_values_array)
static void apply(const unsigned int n_components, const unsigned int fe_degree, const MatrixFreeFunctions::ShapeInfo< VectorizedArrayType > &shape_info, const bool transpose, const std::array< MatrixFreeFunctions::compressed_constraint_kind, VectorizedArrayType::size()> &c_mask, VectorizedArrayType *values)
static void evaluate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, const Number *values_dofs, FEEvaluationData< dim, Number, true > &fe_eval)
static bool fast_evaluation_supported(const unsigned int given_degree, const unsigned int n_q_points_1d)
static void integrate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, Number *values_dofs, FEEvaluationData< dim, Number, true > &fe_eval)
static constexpr unsigned int value
@ dof_access_face_exterior
@ dof_access_face_interior
std::vector< std::pair< unsigned short, unsigned short > > constraint_indicator
std::vector< std::pair< unsigned int, unsigned int > > row_starts
std::vector< std::vector< unsigned int > > component_dof_indices_offset
std::vector< std::vector< bool > > hanging_node_constraint_masks_comp
std::vector< unsigned int > dof_indices
std::vector< compressed_constraint_kind > hanging_node_constraint_masks
std::array< std::vector< unsigned int >, 3 > dof_indices_interleave_strides
std::array< std::vector< std::pair< unsigned int, unsigned int > >, 3 > dof_indices_contiguous_sm
std::vector< unsigned int > row_starts_plain_indices
std::array< std::vector< unsigned int >, 3 > dof_indices_contiguous
std::vector< unsigned int > plain_dof_indices
std::array< std::vector< unsigned char >, 3 > n_vectorization_lanes_filled
std::vector< unsigned int > dof_indices_interleaved
std::array< std::vector< IndexStorageVariants >, 3 > index_storage_variants
DEAL_II_HOST constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)