14#ifndef dealii_matrix_free_fe_evaluation_h
15#define dealii_matrix_free_fe_evaluation_h
92 typename VectorizedArrayType>
99 std::conditional_t<n_components_ == 1,
106 n_components_ == dim,
114 n_components_ == dim,
119 static constexpr unsigned int n_lanes = VectorizedArrayType::size();
158 template <
typename VectorType>
161 const VectorType &src,
162 const unsigned int first_index = 0,
163 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
196 template <
typename VectorType>
199 const VectorType &src,
200 const unsigned int first_index = 0,
201 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip());
234 template <
typename VectorType>
238 const unsigned int first_index = 0,
239 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip())
const;
279 template <
typename VectorType>
283 const unsigned int first_index = 0,
284 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip())
const;
289 template <
typename VectorType>
293 const unsigned int first_index = 0,
294 const std::bitset<n_lanes> &mask = std::bitset<n_lanes>().flip())
const;
370 typename = std::enable_if_t<n_components == n_components_local>>
373 const unsigned int q_point);
424 template <
int dim_ = dim,
425 typename = std::enable_if_t<dim_ == 1 && n_components == dim_>>
428 const unsigned int q_point);
447 const unsigned int q_point);
523 const unsigned int q_point);
532 template <
int dim_ = dim,
typename = std::enable_if_t<n_components_ == dim_>>
551 template <
int dim_ = dim,
typename = std::enable_if_t<n_components_ == dim_>>
554 const unsigned int q_point);
564 template <
int dim_ = dim,
typename = std::enable_if_t<n_components_ == dim_>>
583 template <
int dim_ = dim,
typename = std::enable_if_t<n_components_ == dim_>>
587 const unsigned int q_point);
597 template <
int dim_ = dim,
598 typename = std::enable_if_t<n_components_ == dim_ && dim_ != 1>>
615 template <
int dim_ = dim,
616 typename = std::enable_if_t<n_components_ == dim_ && dim != 1>>
658 const unsigned int dof_handler_index,
661 const unsigned int fe_degree,
662 const unsigned int n_q_points,
666 const unsigned int face_type);
740 template <
typename VectorType,
typename VectorOperation>
744 const std::array<VectorType *, n_components_> &vectors,
747 n_components_> &vectors_sm,
748 const std::bitset<n_lanes> &mask,
749 const bool apply_constraints =
true)
const;
758 template <
typename VectorType,
typename VectorOperation>
762 const std::array<VectorType *, n_components_> &vectors,
765 n_components_> &vectors_sm,
766 const std::bitset<n_lanes> &mask)
const;
775 template <
typename VectorType,
typename VectorOperation>
779 const std::array<VectorType *, n_components_> &vectors)
const;
1387 typename VectorizedArrayType>
1392 VectorizedArrayType>
1395 std::is_same_v<Number, typename VectorizedArrayType::value_type>,
1396 "Type of Number and of VectorizedArrayType do not match.");
1438 static constexpr unsigned int n_lanes = VectorizedArrayType::size();
1523 const unsigned int dof_handler_index = 0,
1537 const std::pair<unsigned int, unsigned int> &range,
1538 const unsigned int dof_handler_index = 0,
1649 template <
bool level_dof_access>
1671 const unsigned int given_n_q_points_1d);
1714 template <
typename VectorType>
1744 VectorizedArrayType *values_array,
1745 const bool sum_into_values =
false);
1760 template <
typename VectorType>
1763 VectorType &output_vector);
1847 int n_q_points_1d = fe_degree + 1,
1848 int n_components_ = 1,
1849 typename Number = double,
1855 VectorizedArrayType>
1858 std::is_same_v<Number, typename VectorizedArrayType::value_type>,
1859 "Type of Number and of VectorizedArrayType do not match.");
1901 static constexpr unsigned int n_lanes = VectorizedArrayType::size();
2003 const unsigned int dof_handler_index = 0,
2019 const std::pair<unsigned int, unsigned int> &range,
2021 const unsigned int dof_handler_index = 0,
2036 reinit(
const unsigned int face_batch_number);
2046 reinit(
const unsigned int cell_batch_number,
const unsigned int face_number);
2053 const unsigned int given_n_q_points_1d);
2117 template <
typename VectorType>
2133 const bool sum_into_values =
false);
2146 VectorizedArrayType *values_array,
2147 const bool sum_into_values =
false);
2164 const bool sum_into_values =
false);
2172 VectorizedArrayType *values_array,
2173 const bool sum_into_values =
false);
2186 template <
typename VectorType>
2189 VectorType &output_vector);
2194 template <
typename VectorType>
2197 const bool integrate_gradients,
2198 VectorType &output_vector);
2274 namespace MatrixFreeFunctions
2278 template <
int dim,
int degree>
2287 template <
int degree>
2290 static constexpr unsigned int value = degree + 1;
2306 template <
bool is_face,
2309 typename VectorizedArrayType>
2312 extract_initialization_data(
2314 const unsigned int dof_handler_index,
2315 const unsigned int first_selected_component,
2316 const unsigned int quadrature_index,
2317 const unsigned int fe_degree,
2318 const unsigned int n_q_points,
2319 const unsigned int active_fe_index_given,
2320 const unsigned int active_quad_index_given,
2321 const unsigned int face_type)
2324 InitializationData init_data;
2328 &internal::MatrixFreeFunctions::
2329 MappingInfoCellsOrFaces<dim, Number, is_face, VectorizedArrayType>::get(
2337 active_fe_index_given :
2343 active_quad_index_given :
2344 std::min<unsigned int>(
2347 (is_face ? std::max<unsigned int>(1, dim - 1) : 1) -
2376 typename VectorizedArrayType>
2381 VectorizedArrayType>::
2384 const unsigned int dof_handler_index,
2385 const unsigned int first_selected_component,
2386 const unsigned int quadrature_index,
2387 const unsigned int fe_degree,
2388 const unsigned int n_q_points,
2389 const bool is_interior_face,
2390 const unsigned int active_fe_index,
2391 const unsigned int active_quad_index,
2392 const unsigned int face_type)
2394 internal::extract_initialization_data<is_face>(matrix_free,
2396 first_selected_component,
2405 first_selected_component)
2406 , scratch_data_array(matrix_free.acquire_scratch_data())
2407 , matrix_free(&matrix_free)
2409 this->set_data_pointers(scratch_data_array, n_components_);
2411 this->dof_info->start_components.back() == 1 ||
2412 static_cast<int>(n_components_) <=
2414 this->dof_info->start_components
2415 [this->dof_info->component_to_base_index[first_selected_component] +
2417 first_selected_component,
2419 "You tried to construct a vector-valued evaluator with " +
2420 std::to_string(n_components) +
2421 " components. However, "
2422 "the current base element has only " +
2424 this->dof_info->start_components
2425 [this->dof_info->component_to_base_index[first_selected_component] +
2427 first_selected_component) +
2428 " components left when starting from local element index " +
2430 first_selected_component -
2431 this->dof_info->start_components
2432 [this->dof_info->component_to_base_index[first_selected_component]]) +
2433 " (global index " + std::to_string(first_selected_component) +
")"));
2445 typename VectorizedArrayType>
2450 VectorizedArrayType>::
2456 const unsigned int first_selected_component,
2460 other->mapped_geometry->get_quadrature() == quadrature ?
2461 other->mapped_geometry :
2463 MappingDataOnTheFly<dim, VectorizedArrayType>>(
2468 first_selected_component)
2469 , scratch_data_array(new
AlignedVector<VectorizedArrayType>())
2470 , matrix_free(nullptr)
2472 const unsigned int base_element_number =
2476 first_selected_component >=
2478 ExcMessage(
"The underlying element must at least contain as many "
2479 "components as requested by this class"));
2480 (void)base_element_number;
2484 Quadrature<(is_face ? dim - 1 : dim)>(quadrature),
2486 fe.component_to_base_index(first_selected_component).
first);
2488 this->set_data_pointers(scratch_data_array, n_components_);
2497 typename VectorizedArrayType>
2502 VectorizedArrayType>::
2507 VectorizedArrayType> &other)
2509 , scratch_data_array(other.matrix_free == nullptr ?
2511 other.matrix_free->acquire_scratch_data())
2512 , matrix_free(other.matrix_free)
2514 if (other.matrix_free ==
nullptr)
2521 this->mapped_geometry =
2522 std::make_shared<internal::MatrixFreeFunctions::
2523 MappingDataOnTheFly<dim, VectorizedArrayType>>(
2528 if constexpr (is_face ==
false)
2529 this->mapping_data = &this->mapped_geometry->get_data_storage();
2533 "face evaluators is not currently "
2539 this->mapped_geometry->get_data_storage().jacobians[0].begin();
2541 this->mapped_geometry->get_data_storage().JxW_values.begin();
2542 this->jacobian_gradients =
2543 this->mapped_geometry->get_data_storage().jacobian_gradients[0].begin();
2544 this->jacobian_gradients_non_inverse =
2545 this->mapped_geometry->get_data_storage()
2546 .jacobian_gradients_non_inverse[0]
2549 this->mapped_geometry->get_data_storage().quadrature_points.begin();
2552 this->set_data_pointers(scratch_data_array, n_components_);
2561 typename VectorizedArrayType>
2566 VectorizedArrayType> &
2572 VectorizedArrayType> &other)
2575 if (matrix_free ==
nullptr)
2578 delete scratch_data_array;
2587 matrix_free = other.matrix_free;
2589 if (other.matrix_free ==
nullptr)
2597 this->mapped_geometry =
2598 std::make_shared<internal::MatrixFreeFunctions::
2599 MappingDataOnTheFly<dim, VectorizedArrayType>>(
2604 if constexpr (is_face ==
false)
2605 this->mapping_data = &this->mapped_geometry->get_data_storage();
2609 "face evaluators is not currently "
2614 this->mapped_geometry->get_data_storage().jacobians[0].begin();
2616 this->mapped_geometry->get_data_storage().JxW_values.begin();
2617 this->jacobian_gradients =
2618 this->mapped_geometry->get_data_storage().jacobian_gradients[0].begin();
2619 this->jacobian_gradients_non_inverse =
2620 this->mapped_geometry->get_data_storage()
2621 .jacobian_gradients_non_inverse[0]
2624 this->mapped_geometry->get_data_storage().quadrature_points.begin();
2631 this->set_data_pointers(scratch_data_array, n_components_);
2642 typename VectorizedArrayType>
2647 VectorizedArrayType>::~FEEvaluationBase()
2649 if (matrix_free !=
nullptr)
2660 delete scratch_data_array;
2671 typename VectorizedArrayType>
2676 Assert(matrix_free !=
nullptr,
2678 "FEEvaluation was not initialized with a MatrixFree object!"));
2679 return *matrix_free;
2688 template <
typename VectorType,
bool>
2689 struct ConstBlockVectorSelector;
2691 template <
typename VectorType>
2692 struct ConstBlockVectorSelector<
VectorType, true>
2694 using BaseVectorType =
const typename VectorType::BlockType;
2697 template <
typename VectorType>
2698 struct ConstBlockVectorSelector<
VectorType, false>
2700 using BaseVectorType =
typename VectorType::BlockType;
2706 template <
typename VectorType,
bool>
2707 struct BlockVectorSelector;
2709 template <
typename VectorType>
2712 using BaseVectorType =
typename ConstBlockVectorSelector<
2714 std::is_const_v<VectorType>>::BaseVectorType;
2716 static BaseVectorType *
2717 get_vector_component(VectorType &vec,
const unsigned int component)
2720 return &vec.block(component);
2724 template <
typename VectorType>
2725 struct BlockVectorSelector<
VectorType, false>
2729 static BaseVectorType *
2730 get_vector_component(VectorType &vec,
const unsigned int component)
2749 template <
typename VectorType>
2750 struct BlockVectorSelector<
std::vector<VectorType>, false>
2754 static BaseVectorType *
2755 get_vector_component(std::vector<VectorType> &vec,
2756 const unsigned int component)
2763 template <
typename VectorType>
2764 struct BlockVectorSelector<
const std::vector<VectorType>, false>
2768 static const BaseVectorType *
2769 get_vector_component(
const std::vector<VectorType> &vec,
2770 const unsigned int component)
2777 template <
typename VectorType>
2778 struct BlockVectorSelector<
std::vector<VectorType *>, false>
2782 static BaseVectorType *
2783 get_vector_component(std::vector<VectorType *> &vec,
2784 const unsigned int component)
2791 template <
typename VectorType>
2792 struct BlockVectorSelector<
const std::vector<VectorType *>, false>
2796 static const BaseVectorType *
2797 get_vector_component(
const std::vector<VectorType *> &vec,
2798 const unsigned int component)
2805 template <
typename VectorType, std::
size_t N>
2806 struct BlockVectorSelector<
std::array<VectorType *, N>, false>
2810 static BaseVectorType *
2811 get_vector_component(std::array<VectorType *, N> &vec,
2812 const unsigned int component)
2826 typename VectorizedArrayType>
2827template <
typename VectorType,
typename VectorOperation>
2832 const std::array<VectorType *, n_components_> &src,
2835 n_components_> &src_sm,
2836 const std::bitset<n_lanes> &
mask,
2837 const bool apply_constraints)
const
2842 if (this->matrix_free ==
nullptr)
2844 read_write_operation_global(operation, src);
2851 if (this->n_fe_components == 1)
2852 for (
unsigned int comp = 0; comp < n_components; ++comp)
2854 Assert(src[comp] !=
nullptr,
2855 ExcMessage(
"The finite element underlying this FEEvaluation "
2856 "object is scalar, but you requested " +
2857 std::to_string(n_components) +
2858 " components via the template argument in "
2859 "FEEvaluation. In that case, you must pass an "
2860 "std::vector<VectorType> or a BlockVector to " +
2861 "read_dof_values and distribute_local_to_global."));
2873 const bool accesses_exterior_dofs =
2874 this->dof_access_index ==
2876 this->is_interior_face() ==
false;
2886 bool is_contiguous =
true;
2888 if (accesses_exterior_dofs)
2890 const std::array<unsigned int, n_lanes> &cells = this->get_cell_ids();
2891 const unsigned int n_filled_lanes =
2896 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
2897 if (
mask[v] ==
true &&
2900 [cells[v] / n_lanes] <
2903 is_contiguous = false;
2907 this->dof_access_index :
2908 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
2909 [this->cell] <
internal::MatrixFreeFunctions::DoFInfo::
2912 is_contiguous =
false;
2917 read_write_operation_contiguous(operation, src, src_sm,
mask);
2924 std::array<unsigned int, n_lanes> cells = this->get_cell_ids();
2926 const bool masking_is_active =
mask.count() < n_lanes;
2927 if (masking_is_active)
2928 for (
unsigned int v = 0; v < n_lanes; ++v)
2929 if (
mask[v] ==
false)
2932 std::bool_constant<internal::is_vectorizable<VectorType, Number>::value>
2935 const bool use_vectorized_path =
2936 !(masking_is_active || accesses_exterior_dofs);
2938 const std::size_t dofs_per_component = this->
data->dofs_per_component_on_cell;
2945 const bool separate_vectors =
2946 (n_components == 1 || this->n_fe_components == 1);
2950 [is_face ? this->dof_access_index :
2951 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
2952 [this->cell] ==
internal::MatrixFreeFunctions::DoFInfo::
2953 IndexStorageVariants::interleaved &&
2954 use_vectorized_path)
2956 const unsigned int *dof_indices =
2958 dof_info.
row_starts[this->cell * this->n_fe_components * n_lanes]
2962 [this->first_selected_component] *
2965 std::array<typename VectorType::value_type *, n_components> src_ptrs;
2966 if (separate_vectors)
2967 for (
unsigned int comp = 0; comp < n_components; ++comp)
2969 const_cast<typename VectorType::value_type *
>(src[comp]->
begin());
2972 const_cast<typename VectorType::value_type *
>(src[0]->begin());
2974 if (separate_vectors)
2975 for (
unsigned int i = 0; i < dofs_per_component;
2976 ++i, dof_indices += n_lanes)
2977 for (
unsigned int comp = 0; comp < n_components; ++comp)
2978 operation.process_dof_gather(
2983 this->values_dofs[comp * dofs_per_component + i],
2986 for (
unsigned int comp = 0; comp < n_components; ++comp)
2987 for (
unsigned int i = 0; i < dofs_per_component;
2988 ++i, dof_indices += n_lanes)
2989 operation.process_dof_gather(
2994 this->values_dofs[comp * dofs_per_component + i],
2999 std::array<VectorizedArrayType *, n_components> values_dofs;
3000 for (
unsigned int c = 0; c < n_components; ++c)
3001 values_dofs[c] =
const_cast<VectorizedArrayType *
>(this->values_dofs) +
3002 c * dofs_per_component;
3006 std::array<const unsigned int *, n_lanes> dof_indices;
3007 dof_indices.fill(
nullptr);
3012 bool has_constraints =
false;
3013 const unsigned int n_components_read =
3014 this->n_fe_components > 1 ? n_components : 1;
3018 for (
unsigned int v = 0; v < n_lanes; ++v)
3024 const std::pair<unsigned int, unsigned int> *my_index_start =
3025 &dof_info.
row_starts[cells[v] * this->n_fe_components +
3026 this->first_selected_component];
3031 if (my_index_start[n_components_read].
second !=
3032 my_index_start[0].
second)
3033 has_constraints =
true;
3036 dof_info.
dof_indices.data() + my_index_start[0].first;
3041 for (
unsigned int v = 0; v < n_lanes; ++v)
3046 const std::pair<unsigned int, unsigned int> *my_index_start =
3047 &dof_info.
row_starts[cells[v] * this->n_fe_components +
3048 this->first_selected_component];
3049 if (my_index_start[n_components_read].
second !=
3050 my_index_start[0].
second)
3051 has_constraints =
true;
3054 my_index_start[0].
first ||
3057 my_index_start[0].
first,
3060 dof_info.
dof_indices.data() + my_index_start[0].first;
3064 for (
unsigned int comp = 0; comp < n_components; ++comp)
3065 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3066 operation.process_empty(values_dofs[comp][i]);
3070 if (!has_constraints && apply_constraints)
3072 if (separate_vectors)
3074 for (
unsigned int v = 0; v < n_lanes; ++v)
3079 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3081 for (
unsigned int comp = 0; comp < n_components; ++comp)
3082 operation.process_dof(dof_indices[v][i],
3084 values_dofs[comp][i][v]);
3089 for (
unsigned int comp = 0; comp < n_components; ++comp)
3090 for (
unsigned int v = 0; v < n_lanes; ++v)
3095 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3096 if (dof_indices[v][comp * dofs_per_component + i] !=
3098 operation.process_dof(
3099 dof_indices[v][comp * dofs_per_component + i],
3101 values_dofs[comp][i][v]);
3113 for (
unsigned int v = 0; v < n_lanes; ++v)
3119 const unsigned int cell_dof_index =
3120 cell_index * this->n_fe_components + this->first_selected_component;
3121 unsigned int index_indicators =
3123 unsigned int next_index_indicators =
3124 dof_info.
row_starts[cell_dof_index + 1].second;
3128 if (apply_constraints ==
false &&
3136 [this->first_selected_component] +
3138 next_index_indicators = index_indicators;
3141 if (separate_vectors)
3143 unsigned int ind_local = 0;
3144 for (; index_indicators != next_index_indicators; ++index_indicators)
3146 const std::pair<unsigned short, unsigned short> indicator =
3149 for (
unsigned int j = 0; j < indicator.first; ++j)
3151 for (
unsigned int comp = 0; comp < n_components; ++comp)
3152 operation.process_dof(dof_indices[v][j],
3154 values_dofs[comp][ind_local + j][v]);
3156 ind_local += indicator.first;
3157 dof_indices[v] += indicator.first;
3162 for (
unsigned int comp = 0; comp < n_components; ++comp)
3163 operation.pre_constraints(values_dofs[comp][ind_local][v],
3170 for (; data_val != end_pool; ++data_val, ++dof_indices[v])
3172 for (
unsigned int comp = 0; comp < n_components; ++comp)
3173 operation.process_constraint(*dof_indices[v],
3178 for (
unsigned int comp = 0; comp < n_components; ++comp)
3179 operation.post_constraints(
value[comp],
3180 values_dofs[comp][ind_local][v]);
3186 for (; ind_local < dofs_per_component; ++dof_indices[v], ++ind_local)
3188 for (
unsigned int comp = 0; comp < n_components; ++comp)
3189 operation.process_dof(*dof_indices[v],
3191 values_dofs[comp][ind_local][v]);
3200 for (
unsigned int comp = 0; comp < n_components; ++comp)
3202 unsigned int ind_local = 0;
3205 for (; index_indicators != next_index_indicators;
3208 const std::pair<unsigned short, unsigned short> indicator =
3212 for (
unsigned int j = 0; j < indicator.first; ++j)
3214 operation.process_dof(
3217 values_dofs[comp][ind_local + j][v]);
3218 ind_local += indicator.first;
3219 dof_indices[v] += indicator.first;
3224 operation.pre_constraints(values_dofs[comp][ind_local][v],
3232 for (; data_val != end_pool; ++data_val, ++dof_indices[v])
3234 operation.process_constraint(*dof_indices[v],
3239 operation.post_constraints(
value,
3240 values_dofs[comp][ind_local][v]);
3247 for (; ind_local < dofs_per_component;
3248 ++dof_indices[v], ++ind_local)
3252 operation.process_dof(*dof_indices[v],
3254 values_dofs[comp][ind_local][v]);
3257 if (apply_constraints ==
true && comp + 1 < n_components)
3258 next_index_indicators =
3259 dof_info.
row_starts[cell_dof_index + comp + 2].second;
3271 typename VectorizedArrayType>
3272template <
typename VectorType,
typename VectorOperation>
3277 const std::array<VectorType *, n_components_> &src)
const
3281 const std::size_t dofs_per_component = this->
data->dofs_per_component_on_cell;
3282 unsigned int index = this->first_selected_component * dofs_per_component;
3283 for (
unsigned int comp = 0; comp < n_components; ++comp)
3285 for (
unsigned int i = 0; i < dofs_per_component; ++i, ++
index)
3287 operation.process_empty(
3288 this->values_dofs[comp * dofs_per_component + i]);
3289 operation.process_dof_global(
3290 local_dof_indices[this->
data->lexicographic_numbering[index]],
3292 this->values_dofs[comp * dofs_per_component + i][0]);
3303 typename VectorizedArrayType>
3304template <
typename VectorType,
typename VectorOperation>
3309 const std::array<VectorType *, n_components_> &src,
3312 n_components_> &vectors_sm,
3313 const std::bitset<n_lanes> &
mask)
const
3322 std::bool_constant<internal::is_vectorizable<VectorType, Number>::value>
3325 is_face ? this->dof_access_index :
3327 const unsigned int n_active_lanes =
mask.count();
3330 const std::vector<unsigned int> &dof_indices_cont =
3333 const std::size_t dofs_per_component = this->
data->dofs_per_component_on_cell;
3334 std::array<VectorizedArrayType *, n_components> values_dofs{{
nullptr}};
3335 for (
unsigned int c = 0; c < n_components; ++c)
3336 values_dofs[c] =
const_cast<VectorizedArrayType *
>(this->values_dofs) +
3337 c * dofs_per_component;
3341 const bool accesses_exterior_dofs =
3342 this->dof_access_index ==
3344 this->is_interior_face() ==
false;
3353 const bool separate_vectors =
3354 (n_components == 1 || this->n_fe_components == 1);
3360 interleaved_contiguous &&
3361 n_active_lanes == n_lanes && !accesses_exterior_dofs)
3363 const unsigned int dof_index =
3364 dof_indices_cont[this->cell * n_lanes] +
3367 [this->first_selected_component] *
3369 if (separate_vectors)
3370 for (
unsigned int comp = 0; comp < n_components; ++comp)
3371 operation.process_dofs_vectorized(dofs_per_component,
3377 operation.process_dofs_vectorized(dofs_per_component * n_components,
3385 const std::array<unsigned int, n_lanes> &cells = this->get_cell_or_face_ids();
3389 const unsigned int n_filled_lanes =
3392 const bool use_vectorized_path = n_filled_lanes == n_lanes &&
3393 n_active_lanes == n_lanes &&
3394 !accesses_exterior_dofs;
3396 if (vectors_sm[0] !=
nullptr)
3398 const auto compute_vector_ptrs = [&](
const unsigned int comp) {
3399 std::array<typename VectorType::value_type *, n_lanes> vector_ptrs{
3402 const auto upper_bound =
3403 std::min<unsigned int>(n_filled_lanes, n_lanes);
3404 for (
unsigned int v = 0; v < upper_bound; ++v)
3406 if (
mask[v] ==
false)
3408 vector_ptrs[v] =
nullptr;
3428 vector_ptrs[v] =
const_cast<typename VectorType::value_type *
>(
3429 vectors_sm[comp]->operator[](temp.first).
data() + temp.second +
3431 [this->active_fe_index][this->first_selected_component]);
3433 vector_ptrs[v] =
nullptr;
3435 for (
unsigned int v = n_filled_lanes; v < n_lanes; ++v)
3436 vector_ptrs[v] =
nullptr;
3441 if (use_vectorized_path)
3450 const unsigned int n_blocks = separate_vectors ? n_components : 1;
3451 const unsigned int block_size = separate_vectors ?
3452 dofs_per_component :
3453 dofs_per_component * n_components;
3454 for (
unsigned int comp = 0; comp <
n_blocks; ++comp)
3457 compute_vector_ptrs(separate_vectors ? comp : 0);
3458 operation.process_dofs_vectorized_transpose(block_size,
3467 for (
unsigned int comp = 0; comp < n_components; ++comp)
3469 auto vector_ptrs = compute_vector_ptrs(separate_vectors ? comp : 0);
3471 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3472 operation.process_empty(values_dofs[comp][i]);
3477 const unsigned int comp_offset =
3478 separate_vectors ? 0 : comp * dofs_per_component;
3479 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3480 if (
mask[v] ==
true)
3481 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3482 operation.process_dof(vector_ptrs[v][i + comp_offset],
3483 values_dofs[comp][i][v]);
3488 std::array<unsigned int, n_lanes> dof_indices{
3491 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3495 if (
mask[v] ==
true)
3497 dof_indices_cont[cells[v]] +
3500 [this->first_selected_component] *
3506 if (use_vectorized_path)
3512 if (separate_vectors)
3513 for (
unsigned int comp = 0; comp < n_components; ++comp)
3514 operation.process_dofs_vectorized_transpose(dofs_per_component,
3520 operation.process_dofs_vectorized_transpose(dofs_per_component *
3529 interleaved_contiguous_strided)
3531 std::array<typename VectorType::value_type *, n_components> src_ptrs{
3533 if (separate_vectors)
3534 for (
unsigned int comp = 0; comp < n_components; ++comp)
3535 src_ptrs[comp] =
const_cast<typename VectorType::value_type *
>(
3536 src[comp]->
begin());
3539 const_cast<typename VectorType::value_type *
>(src[0]->begin());
3541 if (separate_vectors)
3542 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3544 for (
unsigned int comp = 0; comp < n_components; ++comp)
3545 operation.process_dof_gather(dof_indices.data(),
3548 src_ptrs[comp] + i * n_lanes,
3549 values_dofs[comp][i],
3553 for (
unsigned int comp = 0; comp < n_components; ++comp)
3554 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3556 operation.process_dof_gather(
3559 (comp * dofs_per_component + i) * n_lanes,
3560 src_ptrs[0] + (comp * dofs_per_component + i) * n_lanes,
3561 values_dofs[comp][i],
3569 IndexStorageVariants::interleaved_contiguous_mixed_strides,
3571 std::array<typename VectorType::value_type *, n_components> src_ptrs{
3573 if (separate_vectors)
3574 for (
unsigned int comp = 0; comp < n_components; ++comp)
3575 src_ptrs[comp] =
const_cast<typename VectorType::value_type *
>(
3576 src[comp]->
begin());
3579 const_cast<typename VectorType::value_type *
>(src[0]->begin());
3581 const unsigned int *offsets =
3583 if (separate_vectors)
3584 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3586 for (
unsigned int comp = 0; comp < n_components; ++comp)
3587 operation.process_dof_gather(dof_indices.data(),
3591 values_dofs[comp][i],
3594 for (
unsigned int v = 0; v < n_lanes; ++v)
3595 dof_indices[v] += offsets[v];
3598 for (
unsigned int comp = 0; comp < n_components; ++comp)
3599 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3601 operation.process_dof_gather(dof_indices.data(),
3605 values_dofs[comp][i],
3608 for (
unsigned int v = 0; v < n_lanes; ++v)
3609 dof_indices[v] += offsets[v];
3614 for (
unsigned int comp = 0; comp < n_components; ++comp)
3616 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3617 operation.process_empty(values_dofs[comp][i]);
3618 if (accesses_exterior_dofs)
3620 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3621 if (
mask[v] ==
true)
3624 [ind][cells[v] / VectorizedArrayType::size()] ==
3628 if (separate_vectors)
3630 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3631 operation.process_dof(dof_indices[v] + i,
3633 values_dofs[comp][i][v]);
3637 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3638 operation.process_dof(dof_indices[v] + i +
3639 comp * dofs_per_component,
3641 values_dofs[comp][i][v]);
3646 const unsigned int offset =
3649 if (separate_vectors)
3651 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3652 operation.process_dof(dof_indices[v] + i * offset,
3654 values_dofs[comp][i][v]);
3658 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3659 operation.process_dof(
3661 (i + comp * dofs_per_component) * offset,
3663 values_dofs[comp][i][v]);
3674 if (separate_vectors)
3676 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3677 if (
mask[v] ==
true)
3678 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3679 operation.process_dof(dof_indices[v] + i,
3681 values_dofs[comp][i][v]);
3685 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3686 if (
mask[v] ==
true)
3687 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3688 operation.process_dof(dof_indices[v] + i +
3689 comp * dofs_per_component,
3691 values_dofs[comp][i][v]);
3696 const unsigned int *offsets =
3698 [ind][VectorizedArrayType::size() * this->cell];
3699 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3701 if (separate_vectors)
3702 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3704 if (
mask[v] ==
true)
3705 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3706 operation.process_dof(dof_indices[v] + i * offsets[v],
3708 values_dofs[comp][i][v]);
3712 for (
unsigned int v = 0; v < n_filled_lanes; ++v)
3713 if (
mask[v] ==
true)
3714 for (
unsigned int i = 0; i < dofs_per_component; ++i)
3715 operation.process_dof(
3717 (i + comp * dofs_per_component) * offsets[v],
3719 values_dofs[comp][i][v]);
3731 std::enable_if_t<!IsBlockVector<VectorType>::value,
VectorType> * =
nullptr>
3732 decltype(std::declval<VectorType>().begin())
3733 get_beginning(VectorType &vec)
3741 std::enable_if_t<IsBlockVector<VectorType>::value,
VectorType> * =
nullptr>
3742 typename VectorType::value_type *
3743 get_beginning(VectorType &)
3749 std::enable_if_t<has_shared_vector_data<VectorType>,
VectorType> * =
3751 const std::vector<ArrayView<const typename VectorType::value_type>> *
3752 get_shared_vector_data(VectorType *vec,
3753 const bool is_valid_mode_for_sm,
3754 const unsigned int active_fe_index,
3758 if (is_valid_mode_for_sm &&
3761 active_fe_index == 0)
3762 return &vec->shared_vector_data();
3768 std::enable_if_t<!has_shared_vector_data<VectorType>,
VectorType>
3770 const std::vector<ArrayView<const typename VectorType::value_type>> *
3771 get_shared_vector_data(VectorType *,
3779 template <
int n_components,
typename VectorType>
3781 std::array<
typename internal::BlockVectorSelector<
3786 const std::vector<
ArrayView<
const typename internal::BlockVectorSelector<
3790 get_vector_data(VectorType &src,
3791 const unsigned int first_index,
3792 const bool is_valid_mode_for_sm,
3793 const unsigned int active_fe_index,
3799 std::array<
typename internal::BlockVectorSelector<
3805 ArrayView<
const typename internal::BlockVectorSelector<
3811 for (
unsigned int d = 0;
d < n_components; ++
d)
3812 src_data.first[d] = internal::BlockVectorSelector<
3818 for (
unsigned int d = 0;
d < n_components; ++
d)
3819 src_data.second[d] = get_shared_vector_data(
3820 const_cast<typename internal::BlockVectorSelector<
3821 std::remove_const_t<VectorType>,
3823 *>(src_data.first[d]),
3824 is_valid_mode_for_sm,
3838 typename VectorizedArrayType>
3843 if (this->dof_info ==
nullptr ||
3845 this->dof_info->hanging_node_constraint_masks_comp.empty() ||
3846 this->dof_info->hanging_node_constraint_masks_comp
3847 [this->active_fe_index][this->first_selected_component] ==
false)
3850 std::array<internal::MatrixFreeFunctions::compressed_constraint_kind, n_lanes>
3851 constraint_mask{{internal::MatrixFreeFunctions::
3852 unconstrained_compressed_constraint_kind}};
3854 bool hn_available =
false;
3856 const std::array<unsigned int, n_lanes> &cells = this->get_cell_ids();
3858 for (
unsigned int v = 0; v < n_lanes; ++v)
3870 constraint_mask[v] =
mask;
3876 if (hn_available ==
false)
3881 this->
data->data.front().fe_degree,
3882 this->get_shape_info(),
3894 typename VectorizedArrayType>
3900 if (this->
data->element_type ==
3904 std::copy_n(this->values_quad,
3905 n_components * this->n_quadrature_points,
3906 this->values_from_gradients_quad);
3915 typename VectorizedArrayType>
3916template <
typename VectorType>
3920 const unsigned int first_index,
3921 const std::bitset<n_lanes> &
mask)
3923 const auto src_data = internal::get_vector_data<n_components_>(
3926 this->dof_info !=
nullptr &&
3927 this->dof_access_index ==
3929 this->active_fe_index,
3933 read_write_operation(reader, src_data.first, src_data.second,
mask,
true);
3935 apply_hanging_node_constraints(
false);
3939 this->dof_values_initialized =
true;
3949 typename VectorizedArrayType>
3950template <
typename VectorType>
3954 const unsigned int first_index,
3955 const std::bitset<n_lanes> &
mask)
3957 const auto src_data = internal::get_vector_data<n_components_>(
3960 this->dof_info !=
nullptr &&
3961 this->dof_access_index ==
3963 this->active_fe_index,
3967 read_write_operation(reader, src_data.first, src_data.second,
mask,
false);
3971 this->dof_values_initialized =
true;
3981 typename VectorizedArrayType>
3982template <
typename VectorType>
3986 const unsigned int first_index,
3987 const std::bitset<n_lanes> &
mask)
const
3991 Assert(this->dof_values_initialized ==
true,
3995 apply_hanging_node_constraints(
true);
3997 const auto dst_data = internal::get_vector_data<n_components_>(
4000 this->dof_info !=
nullptr &&
4001 this->dof_access_index ==
4003 this->active_fe_index,
4008 read_write_operation(distributor, dst_data.first, dst_data.second,
mask);
4017 typename VectorizedArrayType>
4018template <
typename VectorType>
4022 const unsigned int first_index,
4023 const std::bitset<n_lanes> &
mask)
const
4027 Assert(this->dof_values_initialized ==
true,
4031 const auto dst_data = internal::get_vector_data<n_components_>(
4034 this->dof_info !=
nullptr &&
4035 this->dof_access_index ==
4037 this->active_fe_index,
4041 read_write_operation(setter, dst_data.first, dst_data.second,
mask);
4050 typename VectorizedArrayType>
4051template <
typename VectorType>
4055 const unsigned int first_index,
4056 const std::bitset<n_lanes> &
mask)
const
4060 Assert(this->dof_values_initialized ==
true,
4064 const auto dst_data = internal::get_vector_data<n_components_>(
4067 this->dof_access_index ==
4069 this->active_fe_index,
4073 read_write_operation(setter, dst_data.first, dst_data.second,
mask,
false);
4086 typename VectorizedArrayType>
4097 if constexpr (n_components == 1)
4098 return this->values_dofs[dof];
4101 const std::size_t dofs = this->
data->dofs_per_component_on_cell;
4102 Tensor<1, n_components_, VectorizedArrayType> return_value;
4103 for (
unsigned int comp = 0; comp < n_components; ++comp)
4104 return_value[comp] = this->values_dofs[comp * dofs + dof];
4105 return return_value;
4115 typename VectorizedArrayType>
4123 get_value(
const unsigned int q_point)
const
4127 Assert(this->values_quad_initialized ==
true,
4132 if constexpr (n_components == 1)
4133 return this->values_quad[q_point];
4136 if (n_components == dim &&
4137 this->
data->element_type ==
4143 Assert(this->values_quad_initialized ==
true,
4148 Assert(this->J_value !=
nullptr,
4151 const std::size_t nqp = this->n_quadrature_points;
4159 const VectorizedArrayType inv_det =
4160 (dim == 2) ? this->jacobian[0][0][0] * this->jacobian[0][1][1] :
4161 this->jacobian[0][0][0] * this->jacobian[0][1][1] *
4162 this->jacobian[0][2][2];
4165 for (
unsigned int comp = 0; comp < n_components; ++comp)
4166 value_out[comp] = this->values_quad[comp * nqp + q_point] *
4167 jac[comp][comp] * inv_det;
4174 this->jacobian[q_point] :
4183 const VectorizedArrayType inv_det =
4184 (is_face && dim == 2 && this->get_face_no() < 2) ?
4188 for (
unsigned int comp = 0; comp < n_components; ++comp)
4190 value_out[comp] = this->values_quad[q_point] * jac[comp][0];
4191 for (
unsigned int e = 1;
e < dim; ++
e)
4193 this->values_quad[e * nqp + q_point] * jac[comp][e];
4194 value_out[comp] *= inv_det;
4199 else if (n_components == dim &&
4200 this->
data->element_type ==
4206 Assert(this->values_quad_initialized ==
true,
4211 Assert(this->J_value !=
nullptr,
4214 const std::size_t nqp = this->n_quadrature_points;
4226 for (
unsigned int comp = 0; comp < n_components; ++comp)
4227 value_out[comp] = this->values_quad[comp * nqp + q_point] *
4228 inv_transp_jac[comp][comp];
4235 this->jacobian[q_point] :
4239 for (
unsigned int comp = 0; comp < n_components; ++comp)
4242 this->values_quad[q_point] * inv_t_jac[comp][0];
4243 for (
unsigned int e = 1;
e < dim; ++
e)
4245 this->values_quad[e * nqp + q_point] * inv_t_jac[comp][e];
4252 const std::size_t nqp = this->n_quadrature_points;
4254 for (
unsigned int comp = 0; comp < n_components; ++comp)
4255 return_value[comp] = this->values_quad[comp * nqp + q_point];
4256 return return_value;
4267 typename VectorizedArrayType>
4273 VectorizedArrayType>::gradient_type
4279 Assert(this->gradients_quad_initialized ==
true,
4284 Assert(this->jacobian !=
nullptr,
4286 "update_gradients"));
4287 const std::size_t nqp = this->n_quadrature_points;
4289 if constexpr (n_components == dim && dim > 1)
4291 if (this->
data->element_type ==
4297 Assert(this->gradients_quad_initialized ==
true,
4302 Assert(this->jacobian !=
nullptr,
4304 "update_gradients"));
4305 const std::size_t nqp = this->n_quadrature_points;
4306 const std::size_t nqp_d = nqp * dim;
4309 this->gradients_quad + q_point * dim;
4320 const VectorizedArrayType inv_det =
4321 (dim == 2) ? this->jacobian[0][0][0] * this->jacobian[0][1][1] :
4322 this->jacobian[0][0][0] * this->jacobian[0][1][1] *
4323 this->jacobian[0][2][2];
4326 for (
unsigned int d = 0;
d < dim; ++
d)
4327 for (
unsigned int comp = 0; comp < n_components; ++comp)
4328 grad_out[comp][d] = gradients[comp * nqp_d + d] *
4330 (jac[comp][comp] * inv_det);
4342 const VectorizedArrayType inv_det =
4343 (is_face && dim == 2 && this->get_face_no() < 2) ?
4347 VectorizedArrayType tmp[dim][dim];
4349 for (
unsigned int d = 0;
d < dim; ++
d)
4350 for (
unsigned int e = 0;
e < dim; ++
e)
4353 for (
unsigned int f = 1; f < dim; ++f)
4354 tmp[d][e] += inv_t_jac[d][f] * gradients[e * nqp_d + f];
4356 for (
unsigned int comp = 0; comp < n_components; ++comp)
4357 for (
unsigned int d = 0;
d < dim; ++
d)
4359 VectorizedArrayType res = jac[comp][0] * tmp[
d][0];
4360 for (
unsigned int f = 1; f < dim; ++f)
4361 res += jac[comp][f] * tmp[d][f];
4363 grad_out[comp][
d] = res * inv_det;
4374 Assert(this->jacobian_gradients_non_inverse !=
nullptr,
4376 "update_hessians"));
4378 const auto jac_grad =
4379 this->jacobian_gradients_non_inverse[q_point];
4381 this->jacobian[q_point];
4385 const VectorizedArrayType inv_det =
4386 (is_face && dim == 2 && this->get_face_no() < 2) ?
4393 VectorizedArrayType tmp[dim][dim];
4394 for (
unsigned int d = 0;
d < dim; ++
d)
4395 for (
unsigned int e = 0;
e < dim; ++
e)
4398 for (
unsigned int f = 1; f < dim; ++f)
4399 tmp[e][d] += t_jac[f][d] * gradients[f * nqp_d + e];
4404 for (
unsigned int d = 0;
d < dim; ++
d)
4406 for (
unsigned int e = 0;
e < dim; ++
e)
4409 this->values_from_gradients_quad[e * nqp + q_point];
4410 for (
unsigned int f = 0, r = dim; f < dim; ++f)
4411 for (
unsigned int k = f + 1; k < dim; ++k, ++r)
4415 this->values_from_gradients_quad[f * nqp + q_point];
4418 this->values_from_gradients_quad[k * nqp + q_point];
4423 for (
unsigned int d = 0;
d < dim; ++
d)
4424 for (
unsigned int e = 0;
e < dim; ++
e)
4426 VectorizedArrayType res = tmp[0][
d] * inv_t_jac[
e][0];
4427 for (
unsigned int f = 1; f < dim; ++f)
4428 res += tmp[f][d] * inv_t_jac[e][f];
4429 grad_out[
d][
e] = res;
4435 VectorizedArrayType tmp3[dim], tmp4[dim];
4436 for (
unsigned int d = 0;
d < dim; ++
d)
4438 tmp3[
d] = inv_t_jac[0][
d] * jac_grad[
d][0];
4439 for (
unsigned int e = 1;
e < dim; ++
e)
4440 tmp3[d] += inv_t_jac[e][d] * jac_grad[d][e];
4442 for (
unsigned int e = 0, k = dim;
e < dim; ++
e)
4443 for (
unsigned int f = e + 1; f < dim; ++k, ++f)
4444 for (
unsigned int d = 0;
d < dim; ++
d)
4446 tmp3[f] += inv_t_jac[
d][
e] * jac_grad[k][
d];
4447 tmp3[
e] += inv_t_jac[
d][f] * jac_grad[k][
d];
4449 for (
unsigned int d = 0;
d < dim; ++
d)
4451 tmp4[
d] = tmp3[0] * inv_t_jac[
d][0];
4452 for (
unsigned int e = 1;
e < dim; ++
e)
4453 tmp4[d] += tmp3[e] * inv_t_jac[d][e];
4456 VectorizedArrayType tmp2[dim];
4457 for (
unsigned int d = 0;
d < dim; ++
d)
4460 t_jac[0][
d] * this->values_from_gradients_quad[q_point];
4461 for (
unsigned e = 1;
e < dim; ++
e)
4464 this->values_from_gradients_quad[e * nqp + q_point];
4467 for (
unsigned int d = 0;
d < dim; ++
d)
4468 for (
unsigned int e = 0;
e < dim; ++
e)
4470 grad_out[
d][
e] -= tmp4[
e] * tmp2[
d];
4474 grad_out[
d][
e] *= inv_det;
4485 for (
unsigned int comp = 0; comp < n_components; ++comp)
4486 for (
unsigned int d = 0;
d < dim; ++
d)
4488 this->gradients_quad[(comp * nqp + q_point) * dim +
d] *
4489 this->jacobian[0][
d][
d];
4498 for (
unsigned int comp = 0; comp < n_components; ++comp)
4499 for (
unsigned int d = 0;
d < dim; ++
d)
4502 jac[
d][0] * this->gradients_quad[(comp * nqp + q_point) * dim];
4503 for (
unsigned int e = 1;
e < dim; ++
e)
4504 grad_out[comp][d] +=
4506 this->gradients_quad[(comp * nqp + q_point) * dim +
e];
4509 if constexpr (n_components == 1)
4521 typename VectorizedArrayType>
4534 Assert(this->gradients_quad_initialized ==
true,
4538 Assert(this->normal_x_jacobian !=
nullptr,
4540 "update_gradients"));
4542 const std::size_t nqp = this->n_quadrature_points;
4546 for (
unsigned int comp = 0; comp < n_components; ++comp)
4548 this->gradients_quad[(comp * nqp + q_point) * dim + dim - 1] *
4549 (this->normal_x_jacobian[0][dim - 1]);
4552 const std::size_t
index =
4554 for (
unsigned int comp = 0; comp < n_components; ++comp)
4556 grad_out[comp] = this->gradients_quad[(comp * nqp + q_point) * dim] *
4557 this->normal_x_jacobian[
index][0];
4558 for (
unsigned int d = 1;
d < dim; ++
d)
4560 this->gradients_quad[(comp * nqp + q_point) * dim +
d] *
4561 this->normal_x_jacobian[
index][
d];
4564 if constexpr (n_components == 1)
4576 template <
typename VectorizedArrayType>
4579 const VectorizedArrayType *
const hessians,
4581 VectorizedArrayType (&tmp)[1][1])
4583 tmp[0][0] = jac[0][0] *
hessians[0];
4586 template <
typename VectorizedArrayType>
4589 const VectorizedArrayType *
const hessians,
4590 const unsigned int nqp,
4591 VectorizedArrayType (&tmp)[2][2])
4593 for (
unsigned int d = 0;
d < 2; ++
d)
4601 template <
typename VectorizedArrayType>
4604 const VectorizedArrayType *
const hessians,
4605 const unsigned int nqp,
4606 VectorizedArrayType (&tmp)[3][3])
4608 for (
unsigned int d = 0;
d < 3; ++
d)
4629 typename VectorizedArrayType>
4634 VectorizedArrayType>::hessian_type
4640 Assert(this->hessians_quad_initialized ==
true,
4645 Assert(this->jacobian !=
nullptr,
4655 const std::size_t nqp = this->n_quadrature_points;
4656 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
4661 for (
unsigned int comp = 0; comp < n_components; ++comp)
4663 for (
unsigned int d = 0;
d < dim; ++
d)
4664 hessian_out[comp][d][d] =
4665 this->hessians_quad[(comp * hdim + d) * nqp + q_point] *
4666 (jac[
d][
d] * jac[
d][
d]);
4672 hessian_out[comp][0][1] =
4673 this->hessians_quad[(comp * hdim + 2) * nqp + q_point] *
4674 (jac[0][0] * jac[1][1]);
4677 hessian_out[comp][0][1] =
4678 this->hessians_quad[(comp * hdim + 3) * nqp + q_point] *
4679 (jac[0][0] * jac[1][1]);
4680 hessian_out[comp][0][2] =
4681 this->hessians_quad[(comp * hdim + 4) * nqp + q_point] *
4682 (jac[0][0] * jac[2][2]);
4683 hessian_out[comp][1][2] =
4684 this->hessians_quad[(comp * hdim + 5) * nqp + q_point] *
4685 (jac[1][1] * jac[2][2]);
4690 for (
unsigned int d = 0;
d < dim; ++
d)
4691 for (
unsigned int e = d + 1;
e < dim; ++
e)
4692 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4698 for (
unsigned int comp = 0; comp < n_components; ++comp)
4700 VectorizedArrayType tmp[dim][dim];
4701 internal::hessian_unit_times_jac(
4702 jac, this->hessians_quad + comp * hdim * nqp + q_point, nqp, tmp);
4705 for (
unsigned int d = 0;
d < dim; ++
d)
4706 for (
unsigned int e = d;
e < dim; ++
e)
4708 hessian_out[comp][
d][
e] = jac[
d][0] * tmp[0][
e];
4709 for (
unsigned int f = 1; f < dim; ++f)
4710 hessian_out[comp][d][e] += jac[d][f] * tmp[f][e];
4717 for (
unsigned int d = 0;
d < dim; ++
d)
4718 for (
unsigned int e = d + 1;
e < dim; ++
e)
4719 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4725 const auto &jac_grad = this->jacobian_gradients[q_point];
4726 for (
unsigned int comp = 0; comp < n_components; ++comp)
4728 VectorizedArrayType tmp[dim][dim];
4729 internal::hessian_unit_times_jac(
4730 jac, this->hessians_quad + comp * hdim * nqp + q_point, nqp, tmp);
4733 for (
unsigned int d = 0;
d < dim; ++
d)
4734 for (
unsigned int e = d;
e < dim; ++
e)
4736 hessian_out[comp][
d][
e] = jac[
d][0] * tmp[0][
e];
4737 for (
unsigned int f = 1; f < dim; ++f)
4738 hessian_out[comp][d][e] += jac[d][f] * tmp[f][e];
4742 for (
unsigned int d = 0;
d < dim; ++
d)
4743 for (
unsigned int e = 0;
e < dim; ++
e)
4744 hessian_out[comp][d][d] +=
4746 this->gradients_quad[(comp * nqp + q_point) * dim +
e];
4749 for (
unsigned int d = 0, count = dim;
d < dim; ++
d)
4750 for (
unsigned int e = d + 1;
e < dim; ++
e, ++count)
4751 for (
unsigned int f = 0; f < dim; ++f)
4752 hessian_out[comp][d][e] +=
4753 jac_grad[count][f] *
4754 this->gradients_quad[(comp * nqp + q_point) * dim + f];
4757 for (
unsigned int d = 0;
d < dim; ++
d)
4758 for (
unsigned int e = d + 1;
e < dim; ++
e)
4759 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4762 if constexpr (n_components == 1)
4763 return hessian_out[0];
4774 typename VectorizedArrayType>
4779 VectorizedArrayType>::gradient_type
4786 Assert(this->hessians_quad_initialized ==
true,
4797 const std::size_t nqp = this->n_quadrature_points;
4798 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
4804 for (
unsigned int comp = 0; comp < n_components; ++comp)
4805 for (
unsigned int d = 0;
d < dim; ++
d)
4806 hessian_out[comp][d] =
4807 this->hessians_quad[(comp * hdim + d) * nqp + q_point] *
4808 (jac[
d][
d] * jac[
d][
d]);
4813 for (
unsigned int comp = 0; comp < n_components; ++comp)
4817 VectorizedArrayType tmp[dim][dim];
4818 internal::hessian_unit_times_jac(
4819 jac, this->hessians_quad + comp * hdim * nqp + q_point, nqp, tmp);
4823 for (
unsigned int d = 0;
d < dim; ++
d)
4825 hessian_out[comp][
d] = jac[
d][0] * tmp[0][
d];
4826 for (
unsigned int f = 1; f < dim; ++f)
4827 hessian_out[comp][d] += jac[d][f] * tmp[f][d];
4834 const auto &jac_grad = this->jacobian_gradients[q_point];
4835 for (
unsigned int comp = 0; comp < n_components; ++comp)
4839 VectorizedArrayType tmp[dim][dim];
4840 internal::hessian_unit_times_jac(
4841 jac, this->hessians_quad + comp * hdim * nqp + q_point, nqp, tmp);
4845 for (
unsigned int d = 0;
d < dim; ++
d)
4847 hessian_out[comp][
d] = jac[
d][0] * tmp[0][
d];
4848 for (
unsigned int f = 1; f < dim; ++f)
4849 hessian_out[comp][d] += jac[d][f] * tmp[f][d];
4852 for (
unsigned int d = 0;
d < dim; ++
d)
4853 for (
unsigned int e = 0;
e < dim; ++
e)
4854 hessian_out[comp][d] +=
4856 this->gradients_quad[(comp * nqp + q_point) * dim +
e];
4860 if constexpr (n_components == 1)
4861 return hessian_out[0];
4872 typename VectorizedArrayType>
4884 Assert(this->hessians_quad_initialized ==
true,
4889 const gradient_type hess_diag = get_hessian_diagonal(q_point);
4890 if constexpr (n_components == 1)
4892 VectorizedArrayType
sum = hess_diag[0];
4893 for (
unsigned int d = 1;
d < dim; ++
d)
4894 sum += hess_diag[d];
4900 for (
unsigned int comp = 0; comp < n_components; ++comp)
4902 laplacian_out[comp] = hess_diag[comp][0];
4903 for (
unsigned int d = 1;
d < dim; ++
d)
4904 laplacian_out[comp] += hess_diag[comp][d];
4906 return laplacian_out;
4916 typename VectorizedArrayType>
4927 Assert(this->hessians_quad_initialized ==
true,
4932 Assert(this->normal_x_jacobian !=
nullptr,
4934 "update_hessians"));
4938 const std::size_t nqp = this->n_quadrature_points;
4939 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
4943 const auto nxj = this->normal_x_jacobian[0];
4945 for (
unsigned int comp = 0; comp < n_components; ++comp)
4947 for (
unsigned int d = 0;
d < dim; ++
d)
4948 hessian_out[comp] +=
4949 this->hessians_quad[(comp * hdim + d) * nqp + q_point] *
4950 (nxj[
d]) * (nxj[d]);
4957 hessian_out[comp] +=
4958 this->hessians_quad[(comp * hdim + 2) * nqp + q_point] *
4962 hessian_out[comp] +=
4963 2. * this->hessians_quad[(comp * hdim + 3) * nqp + q_point] *
4965 hessian_out[comp] +=
4966 2. * this->hessians_quad[(comp * hdim + 4) * nqp + q_point] *
4968 hessian_out[comp] +=
4969 2. * this->hessians_quad[(comp * hdim + 5) * nqp + q_point] *
4980 const auto normal = this->normal_vector(q_point);
4981 const auto hessian = get_hessian(q_point);
4983 if constexpr (n_components == 1)
4984 hessian_out[0] =
hessian * normal * normal;
4986 for (
unsigned int comp = 0; comp < n_components; ++comp)
4987 hessian_out[comp] =
hessian[comp] * normal * normal;
4989 if constexpr (n_components == 1)
4990 return hessian_out[0];
5001 typename VectorizedArrayType>
5008 this->dof_values_initialized =
true;
5010 const std::size_t dofs = this->
data->dofs_per_component_on_cell;
5012 for (
unsigned int comp = 0; comp < n_components; ++comp)
5013 if constexpr (n_components == 1)
5014 this->values_dofs[comp * dofs + dof] = val_in;
5016 this->values_dofs[comp * dofs + dof] = val_in[comp];
5025 typename VectorizedArrayType>
5035 Assert(this->J_value !=
nullptr,
5040 this->values_quad_submitted =
true;
5043 const std::size_t nqp = this->n_quadrature_points;
5044 VectorizedArrayType *
values = this->values_quad + q_point;
5046 const VectorizedArrayType JxW =
5048 this->J_value[0] * this->quadrature_weights[q_point] :
5049 this->J_value[q_point];
5050 if constexpr (n_components == 1)
5051 values[0] = val_in * JxW;
5054 if (n_components == dim &&
5055 this->
data->element_type ==
5060 Assert(this->J_value !=
nullptr,
5066 this->values_quad_submitted =
true;
5069 VectorizedArrayType *
values = this->values_quad + q_point;
5070 const std::size_t nqp = this->n_quadrature_points;
5076 const VectorizedArrayType weight =
5077 this->quadrature_weights[q_point];
5079 for (
unsigned int comp = 0; comp < n_components; ++comp)
5080 values[comp * nqp] = val_in[comp] * weight * jac[comp][comp];
5087 this->jacobian[q_point] :
5092 const VectorizedArrayType fac =
5094 this->quadrature_weights[q_point] :
5096 this->J_value[q_point] :
5097 this->J_value[0] * this->quadrature_weights[q_point]) *
5098 ((dim == 2 && this->get_face_no() < 2) ?
5107 for (
unsigned int comp = 0; comp < n_components; ++comp)
5109 values[comp * nqp] = val_in[0] * jac[0][comp];
5110 for (
unsigned int e = 1;
e < dim; ++
e)
5111 values[comp * nqp] += val_in[e] * jac[e][comp];
5112 values[comp * nqp] *= fac;
5116 else if (n_components == dim &&
5117 this->
data->element_type ==
5122 Assert(this->J_value !=
nullptr,
5128 this->values_quad_submitted =
true;
5131 VectorizedArrayType *
values = this->values_quad + q_point;
5132 const std::size_t nqp = this->n_quadrature_points;
5139 const VectorizedArrayType det_jac =
5140 (dim == 2) ? this->jacobian[1][0][0] * this->jacobian[1][1][1] :
5141 this->jacobian[1][0][0] * this->jacobian[1][1][1] *
5142 this->jacobian[1][2][2];
5144 const VectorizedArrayType weight =
5145 this->quadrature_weights[q_point];
5148 for (
unsigned int comp = 0; comp < n_components; ++comp)
5149 values[comp * nqp] =
5150 val_in[comp] * weight * inv_t_jac[comp][comp] * det_jac;
5157 this->jacobian[q_point] :
5160 const VectorizedArrayType fac =
5162 this->J_value[q_point] :
5163 this->J_value[0] * this->quadrature_weights[q_point]);
5166 for (
unsigned int comp = 0; comp < n_components; ++comp)
5168 values[comp * nqp] = val_in[0] * inv_t_jac[0][comp];
5169 for (
unsigned int e = 1;
e < dim; ++
e)
5170 values[comp * nqp] += val_in[e] * inv_t_jac[e][comp];
5171 values[comp * nqp] *= fac;
5176 for (
unsigned int comp = 0; comp < n_components; ++comp)
5177 values[comp * nqp] = val_in[comp] * JxW;
5187 typename VectorizedArrayType>
5188template <
int,
typename>
5192 const unsigned int q_point)
5194 static_assert(n_components == 1,
5195 "Do not try to modify the default template parameters used for"
5196 " selectively enabling this function via std::enable_if!");
5197 submit_value(val_in[0], q_point);
5206 typename VectorizedArrayType>
5209 submit_gradient(
const gradient_type grad_in,
const unsigned int q_point)
5216 Assert(this->J_value !=
nullptr,
5218 "update_gradients"));
5219 Assert(this->jacobian !=
nullptr,
5221 "update_gradients"));
5224 this->gradients_quad_submitted =
true;
5227 if constexpr (dim > 1 && n_components == dim)
5229 if (this->
data->element_type ==
5239 Assert(this->J_value !=
nullptr,
5241 "update_gradients"));
5242 Assert(this->jacobian !=
nullptr,
5244 "update_gradients"));
5247 this->gradients_quad_submitted =
true;
5250 VectorizedArrayType *
gradients = this->gradients_quad + q_point * dim;
5251 VectorizedArrayType *
values =
5252 this->values_from_gradients_quad + q_point;
5253 const std::size_t nqp = this->n_quadrature_points;
5254 const std::size_t nqp_d = nqp * dim;
5264 const VectorizedArrayType weight =
5265 this->quadrature_weights[q_point];
5266 for (
unsigned int d = 0;
d < dim; ++
d)
5267 for (
unsigned int comp = 0; comp < n_components; ++comp)
5268 gradients[comp * nqp_d + d] = grad_in[comp][d] *
5270 (jac[comp][comp] * weight);
5282 const VectorizedArrayType fac =
5284 this->quadrature_weights[q_point] :
5285 this->J_value[0] * this->quadrature_weights[q_point] *
5286 ((dim == 2 && this->get_face_no() < 2) ?
5291 VectorizedArrayType tmp[dim][dim];
5292 for (
unsigned int d = 0;
d < dim; ++
d)
5293 for (
unsigned int e = 0;
e < dim; ++
e)
5295 tmp[
d][
e] = inv_t_jac[0][
d] * grad_in[
e][0];
5296 for (
unsigned int f = 1; f < dim; ++f)
5297 tmp[d][e] += inv_t_jac[f][d] * grad_in[e][f];
5299 for (
unsigned int comp = 0; comp < n_components; ++comp)
5300 for (
unsigned int d = 0;
d < dim; ++
d)
5302 VectorizedArrayType res = jac[0][comp] * tmp[
d][0];
5303 for (
unsigned int f = 1; f < dim; ++f)
5304 res += jac[f][comp] * tmp[d][f];
5313 const auto jac_grad =
5314 this->jacobian_gradients_non_inverse[q_point];
5316 this->jacobian[q_point];
5320 const VectorizedArrayType fac =
5321 (!is_face) ? this->quadrature_weights[q_point] :
5322 this->J_value[q_point] *
5323 ((dim == 2 && this->get_face_no() < 2) ?
5332 VectorizedArrayType tmp3[dim], tmp4[dim];
5333 for (
unsigned int d = 0;
d < dim; ++
d)
5335 tmp3[
d] = inv_t_jac[0][
d] * jac_grad[
d][0];
5336 for (
unsigned int e = 1;
e < dim; ++
e)
5337 tmp3[d] += inv_t_jac[e][d] * jac_grad[d][e];
5339 for (
unsigned int e = 0, k = dim;
e < dim; ++
e)
5340 for (
unsigned int f = e + 1; f < dim; ++k, ++f)
5341 for (
unsigned int d = 0;
d < dim; ++
d)
5343 tmp3[f] += inv_t_jac[
d][
e] * jac_grad[k][
d];
5344 tmp3[
e] += inv_t_jac[
d][f] * jac_grad[k][
d];
5346 for (
unsigned int d = 0;
d < dim; ++
d)
5348 tmp4[
d] = tmp3[0] * inv_t_jac[
d][0];
5349 for (
unsigned int e = 1;
e < dim; ++
e)
5350 tmp4[d] += tmp3[e] * inv_t_jac[d][e];
5356 VectorizedArrayType tmp[dim][dim];
5359 for (
unsigned int d = 0;
d < dim; ++
d)
5360 for (
unsigned int e = 0;
e < dim; ++
e)
5362 tmp[
d][
e] = inv_t_jac[0][
d] * grad_in_scaled[
e][0];
5363 for (
unsigned int f = 1; f < dim; ++f)
5364 tmp[d][e] += inv_t_jac[f][d] * grad_in_scaled[e][f];
5367 for (
unsigned int d = 0;
d < dim; ++
d)
5368 for (
unsigned int e = 0;
e < dim; ++
e)
5370 VectorizedArrayType res = t_jac[
d][0] * tmp[
e][0];
5371 for (
unsigned int f = 1; f < dim; ++f)
5372 res += t_jac[d][f] * tmp[e][f];
5379 VectorizedArrayType
value[dim];
5380 for (
unsigned int d = 0;
d < dim; ++
d)
5382 value[
d] = tmp[
d][0] * jac_grad[
d][0];
5383 for (
unsigned int e = 1;
e < dim; ++
e)
5384 value[d] += tmp[d][e] * jac_grad[d][e];
5386 for (
unsigned int e = 0, k = dim;
e < dim; ++
e)
5387 for (
unsigned int f = e + 1; f < dim; ++k, ++f)
5388 for (
unsigned int d = 0;
d < dim; ++
d)
5390 value[
e] += tmp[f][
d] * jac_grad[k][
d];
5391 value[f] += tmp[
e][
d] * jac_grad[k][
d];
5396 for (
unsigned int d = 0;
d < dim; ++
d)
5398 VectorizedArrayType tmp2 = grad_in_scaled[
d][0] * tmp4[0];
5399 for (
unsigned int e = 1;
e < dim; ++
e)
5400 tmp2 += grad_in_scaled[d][e] * tmp4[e];
5401 for (
unsigned int e = 0;
e < dim; ++
e)
5402 value[e] -= t_jac[e][d] * tmp2;
5405 for (
unsigned int d = 0;
d < dim; ++
d)
5406 values[d * nqp] =
value[d];
5412 const std::size_t nqp_d = this->n_quadrature_points * dim;
5413 VectorizedArrayType *
gradients = this->gradients_quad + q_point * dim;
5417 const VectorizedArrayType JxW =
5418 this->J_value[0] * this->quadrature_weights[q_point];
5424 std::array<VectorizedArrayType, dim> jac;
5425 for (
unsigned int d = 0;
d < dim; ++
d)
5426 jac[d] = this->jacobian[0][d][d];
5428 for (
unsigned int d = 0;
d < dim; ++
d)
5430 const VectorizedArrayType factor = this->jacobian[0][
d][
d] * JxW;
5431 if constexpr (n_components == 1)
5432 gradients[d] = grad_in[d] * factor;
5434 for (
unsigned int comp = 0; comp < n_components; ++comp)
5435 gradients[comp * nqp_d + d] = grad_in[comp][d] * factor;
5442 this->jacobian[q_point] :
5444 const VectorizedArrayType JxW =
5446 this->J_value[q_point] :
5447 this->J_value[0] * this->quadrature_weights[q_point];
5448 if constexpr (n_components == 1)
5449 for (
unsigned int d = 0;
d < dim; ++
d)
5451 VectorizedArrayType new_val = jac[0][
d] * grad_in[0];
5452 for (
unsigned int e = 1;
e < dim; ++
e)
5453 new_val += (jac[e][d] * grad_in[e]);
5457 for (
unsigned int comp = 0; comp < n_components; ++comp)
5458 for (
unsigned int d = 0;
d < dim; ++
d)
5460 VectorizedArrayType new_val = jac[0][
d] * grad_in[comp][0];
5461 for (
unsigned int e = 1;
e < dim; ++
e)
5462 new_val += (jac[e][d] * grad_in[comp][e]);
5474 typename VectorizedArrayType>
5475template <
int,
typename>
5479 const unsigned int q_point)
5481 static_assert(n_components == 1 && dim == 1,
5482 "Do not try to modify the default template parameters used for"
5483 " selectively enabling this function via std::enable_if!");
5484 submit_gradient(grad_in[0], q_point);
5493 typename VectorizedArrayType>
5499 Assert(this->normal_x_jacobian !=
nullptr,
5501 "update_gradients"));
5504 this->gradients_quad_submitted =
true;
5507 const std::size_t nqp_d = this->n_quadrature_points * dim;
5508 VectorizedArrayType *
gradients = this->gradients_quad + q_point * dim;
5512 const VectorizedArrayType JxW_jac = this->J_value[0] *
5513 this->quadrature_weights[q_point] *
5514 this->normal_x_jacobian[0][dim - 1];
5515 for (
unsigned int comp = 0; comp < n_components; ++comp)
5517 for (
unsigned int d = 0;
d < dim - 1; ++
d)
5518 gradients[comp * nqp_d + d] = VectorizedArrayType();
5519 if constexpr (n_components == 1)
5520 gradients[dim - 1] = grad_in * JxW_jac;
5522 gradients[comp * nqp_d + dim - 1] = grad_in[comp] * JxW_jac;
5527 const unsigned int index =
5530 this->normal_x_jacobian[
index];
5531 const VectorizedArrayType JxW =
5533 this->J_value[
index] * this->quadrature_weights[q_point] :
5534 this->J_value[
index];
5535 for (
unsigned int comp = 0; comp < n_components; ++comp)
5536 for (
unsigned int d = 0;
d < dim; ++
d)
5537 if constexpr (n_components == 1)
5540 gradients[comp * nqp_d +
d] = (grad_in[comp] * JxW) * jac[d];
5550 typename VectorizedArrayType>
5553 submit_hessian(
const hessian_type hessian_in,
const unsigned int q_point)
5560 Assert(this->J_value !=
nullptr,
5562 "update_hessians"));
5563 Assert(this->jacobian !=
nullptr,
5565 "update_hessians"));
5568 this->hessians_quad_submitted =
true;
5572 const std::size_t nqp = this->n_quadrature_points;
5573 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
5576 const VectorizedArrayType JxW =
5577 this->J_value[0] * this->quadrature_weights[q_point];
5580 for (
unsigned int d = 0;
d < dim; ++
d)
5582 const auto jac_d = this->jacobian[0][
d][
d];
5583 const VectorizedArrayType factor = jac_d * jac_d * JxW;
5584 for (
unsigned int comp = 0; comp < n_components; ++comp)
5585 if constexpr (n_components == 1)
5586 this->hessians_quad[
d * nqp + q_point] =
5587 hessian_in[
d][
d] * factor;
5589 this->hessians_quad[(comp * hdim +
d) * nqp + q_point] =
5590 hessian_in[comp][d][d] * factor;
5594 for (
unsigned int d = 1, off_dia = dim;
d < dim; ++
d)
5595 for (
unsigned int e = 0;
e <
d; ++
e, ++off_dia)
5597 const auto jac_d = this->jacobian[0][
d][
d];
5598 const auto jac_e = this->jacobian[0][
e][
e];
5599 const VectorizedArrayType factor = jac_d * jac_e * JxW;
5600 for (
unsigned int comp = 0; comp < n_components; ++comp)
5601 if constexpr (n_components == 1)
5602 this->hessians_quad[off_dia * nqp + q_point] =
5603 (hessian_in[
d][
e] + hessian_in[
e][
d]) * factor;
5605 this->hessians_quad[(comp * hdim + off_dia) * nqp + q_point] =
5606 (hessian_in[comp][d][e] + hessian_in[comp][e][d]) * factor;
5613 const VectorizedArrayType JxW =
5614 this->J_value[0] * this->quadrature_weights[q_point];
5615 for (
unsigned int comp = 0; comp < n_components; ++comp)
5618 if constexpr (n_components == 1)
5619 hessian_c = hessian_in;
5621 hessian_c = hessian_in[comp];
5624 VectorizedArrayType tmp[dim][dim];
5625 for (
unsigned int i = 0; i < dim; ++i)
5626 for (
unsigned int j = 0; j < dim; ++j)
5628 tmp[i][j] = hessian_c[i][0] * jac[0][j];
5629 for (
unsigned int k = 1; k < dim; ++k)
5630 tmp[i][j] += hessian_c[i][k] * jac[k][j];
5634 VectorizedArrayType tmp2[dim][dim];
5635 for (
unsigned int i = 0; i < dim; ++i)
5636 for (
unsigned int j = 0; j < dim; ++j)
5638 tmp2[i][j] = jac[0][i] * tmp[0][j];
5639 for (
unsigned int k = 1; k < dim; ++k)
5640 tmp2[i][j] += jac[k][i] * tmp[k][j];
5644 for (
unsigned int d = 0;
d < dim; ++
d)
5645 this->hessians_quad[(comp * hdim + d) * nqp + q_point] =
5649 for (
unsigned int d = 0, off_diag = dim;
d < dim; ++
d)
5650 for (
unsigned int e = d + 1;
e < dim; ++
e, ++off_diag)
5651 this->hessians_quad[(comp * hdim + off_diag) * nqp + q_point] =
5652 (tmp2[
d][
e] + tmp2[
e][
d]) * JxW;
5658 const VectorizedArrayType JxW = this->J_value[q_point];
5659 const auto &jac_grad = this->jacobian_gradients[q_point];
5660 for (
unsigned int comp = 0; comp < n_components; ++comp)
5663 if constexpr (n_components == 1)
5664 hessian_c = hessian_in;
5666 hessian_c = hessian_in[comp];
5669 VectorizedArrayType tmp[dim][dim];
5670 for (
unsigned int i = 0; i < dim; ++i)
5671 for (
unsigned int j = 0; j < dim; ++j)
5673 tmp[i][j] = hessian_c[i][0] * jac[0][j];
5674 for (
unsigned int k = 1; k < dim; ++k)
5675 tmp[i][j] += hessian_c[i][k] * jac[k][j];
5679 VectorizedArrayType tmp2[dim][dim];
5680 for (
unsigned int i = 0; i < dim; ++i)
5681 for (
unsigned int j = 0; j < dim; ++j)
5683 tmp2[i][j] = jac[0][i] * tmp[0][j];
5684 for (
unsigned int k = 1; k < dim; ++k)
5685 tmp2[i][j] += jac[k][i] * tmp[k][j];
5689 for (
unsigned int d = 0;
d < dim; ++
d)
5690 this->hessians_quad[(comp * hdim + d) * nqp + q_point] =
5694 for (
unsigned int d = 0, off_diag = dim;
d < dim; ++
d)
5695 for (
unsigned int e = d + 1;
e < dim; ++
e, ++off_diag)
5696 this->hessians_quad[(comp * hdim + off_diag) * nqp + q_point] =
5697 (tmp2[
d][
e] + tmp2[
e][
d]) * JxW;
5700 for (
unsigned int d = 0;
d < dim; ++
d)
5702 VectorizedArrayType
sum = 0;
5703 for (
unsigned int e = 0;
e < dim; ++
e)
5704 sum += hessian_c[e][e] * jac_grad[e][d];
5705 for (
unsigned int e = 0, count = dim;
e < dim; ++
e)
5706 for (
unsigned int f = e + 1; f < dim; ++f, ++count)
5708 (hessian_c[e][f] + hessian_c[f][e]) * jac_grad[count][
d];
5709 this->gradients_from_hessians_quad[(comp * nqp + q_point) * dim +
5722 typename VectorizedArrayType>
5726 const unsigned int q_point)
5733 Assert(this->J_value !=
nullptr,
5735 "update_hessians"));
5736 Assert(this->jacobian !=
nullptr,
5738 "update_hessians"));
5741 this->hessians_quad_submitted =
true;
5745 const std::size_t nqp = this->n_quadrature_points;
5746 constexpr unsigned int hdim = (dim * (dim + 1)) / 2;
5749 const VectorizedArrayType JxW =
5750 this->J_value[0] * this->quadrature_weights[q_point];
5752 const auto nxj = this->normal_x_jacobian[0];
5755 for (
unsigned int d = 0;
d < dim; ++
d)
5757 const auto nxj_d = nxj[
d];
5758 const VectorizedArrayType factor = nxj_d * nxj_d * JxW;
5759 for (
unsigned int comp = 0; comp < n_components; ++comp)
5760 if constexpr (n_components == 1)
5761 this->hessians_quad[
d * nqp + q_point] =
5762 normal_hessian_in * factor;
5764 this->hessians_quad[(comp * hdim +
d) * nqp + q_point] =
5765 normal_hessian_in[comp] * factor;
5769 for (
unsigned int d = 1, off_dia = dim;
d < dim; ++
d)
5770 for (
unsigned int e = 0;
e <
d; ++
e, ++off_dia)
5772 const auto jac_d = nxj[
d];
5773 const auto jac_e = nxj[
e];
5774 const VectorizedArrayType factor = jac_d * jac_e * JxW;
5775 for (
unsigned int comp = 0; comp < n_components; ++comp)
5776 if constexpr (n_components == 1)
5777 this->hessians_quad[off_dia * nqp + q_point] =
5778 2. * normal_hessian_in * factor;
5780 this->hessians_quad[(comp * hdim + off_dia) * nqp + q_point] =
5781 2. * normal_hessian_in[comp] * factor;
5786 const auto normal = this->normal_vector(q_point);
5787 const auto normal_projector =
outer_product(normal, normal);
5788 if constexpr (n_components == 1)
5789 submit_hessian(normal_hessian_in * normal_projector, q_point);
5793 for (
unsigned int comp = 0; comp < n_components; ++comp)
5794 tmp[comp] = normal_hessian_in[comp] * normal_projector;
5795 submit_hessian(tmp, q_point);
5806 typename VectorizedArrayType>
5818 Assert(this->values_quad_submitted ==
true,
5823 const std::size_t nqp = this->n_quadrature_points;
5824 for (
unsigned int q = 0; q < nqp; ++q)
5825 for (
unsigned int comp = 0; comp < n_components; ++comp)
5826 return_value[comp] += this->values_quad[comp * nqp + q];
5827 if constexpr (n_components == 1)
5828 return return_value[0];
5830 return return_value;
5839 typename VectorizedArrayType>
5840template <
int,
typename>
5845 static_assert(n_components == dim,
5846 "Do not try to modify the default template parameters used for"
5847 " selectively enabling this function via std::enable_if!");
5851 Assert(this->gradients_quad_initialized ==
true,
5855 Assert(this->jacobian !=
nullptr,
5857 "update_gradients"));
5859 VectorizedArrayType divergence;
5860 const std::size_t nqp = this->n_quadrature_points;
5863 this->
data->element_type ==
5866 VectorizedArrayType inv_det =
5869 this->jacobian[0][0][0] *
5870 ((dim == 2) ? this->jacobian[0][1][1] :
5871 this->jacobian[0][1][1] * this->jacobian[0][2][2]) :
5879 if (is_face && dim == 2 && this->get_face_no() < 2)
5883 divergence = this->gradients_quad[q_point * dim];
5884 for (
unsigned int d = 1;
d < dim; ++
d)
5885 divergence += this->gradients_quad[(d * nqp + q_point) * dim +
d];
5886 divergence *= inv_det;
5895 this->gradients_quad[q_point * dim] * this->jacobian[0][0][0];
5896 for (
unsigned int d = 1;
d < dim; ++
d)
5897 divergence += this->gradients_quad[(d * nqp + q_point) * dim +
d] *
5898 this->jacobian[0][
d][
d];
5905 this->jacobian[q_point] :
5907 divergence = jac[0][0] * this->gradients_quad[q_point * dim];
5908 for (
unsigned int e = 1;
e < dim; ++
e)
5909 divergence += jac[0][e] * this->gradients_quad[q_point * dim + e];
5910 for (
unsigned int d = 1;
d < dim; ++
d)
5911 for (
unsigned int e = 0;
e < dim; ++
e)
5913 jac[d][e] * this->gradients_quad[(d * nqp + q_point) * dim +
e];
5925 typename VectorizedArrayType>
5926template <
int,
typename>
5931 static_assert(n_components == dim,
5932 "Do not try to modify the default template parameters used for"
5933 " selectively enabling this function via std::enable_if!");
5936 const auto grad = get_gradient(q_point);
5937 VectorizedArrayType symmetrized[(dim * dim + dim) / 2];
5938 VectorizedArrayType half =
Number(0.5);
5939 for (
unsigned int d = 0;
d < dim; ++
d)
5940 symmetrized[d] = grad[d][d];
5946 symmetrized[2] = grad[0][1] + grad[1][0];
5947 symmetrized[2] *= half;
5950 symmetrized[3] = grad[0][1] + grad[1][0];
5951 symmetrized[3] *= half;
5952 symmetrized[4] = grad[0][2] + grad[2][0];
5953 symmetrized[4] *= half;
5954 symmetrized[5] = grad[1][2] + grad[2][1];
5955 symmetrized[5] *= half;
5969 typename VectorizedArrayType>
5970template <
int,
typename>
5976 VectorizedArrayType>::curl_type
5978 get_curl(
const unsigned int q_point)
const
5980 static_assert(dim > 1 && n_components == dim,
5981 "Do not try to modify the default template parameters used for"
5982 " selectively enabling this function via std::enable_if!");
5984 if (dim > 1 && this->
data->element_type ==
5992 Assert(this->gradients_quad_initialized ==
true,
5996 Assert(this->jacobian !=
nullptr,
5998 "update_gradients"));
6000 const std::size_t nqp = this->n_quadrature_points;
6001 const std::size_t nqp_d = nqp * dim;
6003 this->gradients_quad + q_point * dim;
6004 if constexpr (dim == 2)
6005 curl = gradients[1 * nqp_d + 0] - gradients[0 * nqp_d + 1];
6006 else if constexpr (dim == 3)
6018 VectorizedArrayType inv_det =
6019 this->jacobian[0][0][0] *
6020 ((dim == 2) ? this->jacobian[0][1][1] :
6021 this->jacobian[0][1][1] * this->jacobian[0][2][2]);
6026 if constexpr (dim == 2)
6029 for (
unsigned int d = 0;
d < (dim == 2 ? 1 : dim); ++
d)
6030 curl[d] *= jac[d][d] * inv_det;
6037 this->jacobian[q_point] :
6044 VectorizedArrayType inv_det =
determinant(inv_t_jac);
6048 if (is_face && dim == 2 && this->get_face_no() < 2)
6053 if constexpr (dim == 2)
6058 for (
unsigned int comp = 0; comp < dim; ++comp)
6060 curl_temp[comp] = curl[0] * jac[comp][0];
6061 for (
unsigned int e = 1;
e < dim; ++
e)
6062 curl_temp[comp] += jac[comp][e] * curl[e];
6064 for (
unsigned int comp = 0; comp < dim; ++comp)
6065 curl[comp] = curl_temp[comp] * inv_det;
6074 if constexpr (dim == 2)
6075 curl = grad[1][0] - grad[0][1];
6076 else if constexpr (dim == 3)
6078 curl[0] = grad[2][1] - grad[1][2];
6079 curl[1] = grad[0][2] - grad[2][0];
6080 curl[2] = grad[1][0] - grad[0][1];
6094 typename VectorizedArrayType>
6095template <
int,
typename>
6099 const unsigned int q_point)
6101 static_assert(n_components == dim,
6102 "Do not try to modify the default template parameters used for"
6103 " selectively enabling this function via std::enable_if!");
6110 Assert(this->J_value !=
nullptr,
6112 "update_gradients"));
6113 Assert(this->jacobian !=
nullptr,
6115 "update_gradients"));
6118 this->gradients_quad_submitted =
true;
6121 const std::size_t nqp_d = this->n_quadrature_points * dim;
6122 VectorizedArrayType *
gradients = this->gradients_quad + q_point * dim;
6124 if (this->
data->element_type ==
6131 const VectorizedArrayType fac =
6133 this->quadrature_weights[q_point] * div_in :
6135 this->J_value[q_point] :
6136 this->J_value[0] * this->quadrature_weights[q_point]) *
6139 this->jacobian[this->cell_type >
6143 Number((dim == 2 && this->get_face_no() < 2) ? -1 : 1);
6145 for (
unsigned int d = 0;
d < dim; ++
d)
6147 for (
unsigned int e = 0;
e < dim; ++
e)
6148 gradients[d * nqp_d + e] = (d == e) ? fac : 0.;
6150 this->divergence_is_requested =
true;
6157 const VectorizedArrayType fac =
6158 this->J_value[0] * this->quadrature_weights[q_point] * div_in;
6159 for (
unsigned int d = 0;
d < dim; ++
d)
6161 const VectorizedArrayType jac_dd = this->jacobian[0][
d][
d];
6162 for (
unsigned int e = 0;
e < dim; ++
e)
6163 gradients[d * nqp_d + e] = (d == e) ? fac * jac_dd : 0.;
6170 this->jacobian[q_point] :
6172 const VectorizedArrayType fac =
6174 this->J_value[q_point] :
6175 this->J_value[0] * this->quadrature_weights[q_point]) *
6177 for (
unsigned int d = 0;
d < dim; ++
d)
6179 for (
unsigned int e = 0;
e < dim; ++
e)
6180 gradients[d * nqp_d + e] = jac[d][e] * fac;
6192 typename VectorizedArrayType>
6193template <
int,
typename>
6198 const unsigned int q_point)
6200 static_assert(n_components == dim,
6201 "Do not try to modify the default template parameters used for"
6202 " selectively enabling this function via std::enable_if!");
6205 this->
data->element_type !=
6217 Assert(this->J_value !=
nullptr,
6219 "update_gradients"));
6220 Assert(this->jacobian !=
nullptr,
6222 "update_gradients"));
6225 this->gradients_quad_submitted =
true;
6228 const std::size_t nqp_d = this->n_quadrature_points * dim;
6229 VectorizedArrayType *
gradients = this->gradients_quad + dim * q_point;
6232 const VectorizedArrayType JxW =
6233 this->J_value[0] * this->quadrature_weights[q_point];
6235 for (
unsigned int d = 0;
d < dim; ++
d)
6236 gradients[d * nqp_d + d] =
6238 for (
unsigned int e = 0, counter = dim;
e < dim; ++
e)
6239 for (
unsigned int d = e + 1;
d < dim; ++
d, ++counter)
6241 const VectorizedArrayType
value =
6250 const VectorizedArrayType JxW =
6252 this->J_value[q_point] :
6253 this->J_value[0] * this->quadrature_weights[q_point];
6256 this->jacobian[q_point] :
6258 VectorizedArrayType weighted[dim][dim];
6259 for (
unsigned int i = 0; i < dim; ++i)
6261 for (
unsigned int i = 0, counter = dim; i < dim; ++i)
6262 for (
unsigned int j = i + 1; j < dim; ++j, ++counter)
6264 const VectorizedArrayType
value =
6266 weighted[i][j] =
value;
6267 weighted[j][i] =
value;
6269 for (
unsigned int comp = 0; comp < dim; ++comp)
6270 for (
unsigned int d = 0;
d < dim; ++
d)
6272 VectorizedArrayType new_val = jac[0][
d] * weighted[comp][0];
6273 for (
unsigned int e = 1;
e < dim; ++
e)
6274 new_val += jac[e][d] * weighted[comp][e];
6286 typename VectorizedArrayType>
6287template <
int,
typename>
6295 VectorizedArrayType>::curl_type curl,
6296 const unsigned int q_point)
6298 static_assert(n_components == dim,
6299 "Do not try to modify the default template parameters used for"
6300 " selectively enabling this function via std::enable_if!");
6304 if (this->
data->element_type ==
6307 curl_type curl_temp;
6311 Assert(this->J_value !=
nullptr,
6316 this->gradients_quad_submitted =
true;
6319 const std::size_t nqp_d = this->n_quadrature_points * dim;
6320 VectorizedArrayType *
gradients = this->gradients_quad + q_point * dim;
6326 const VectorizedArrayType weight = this->quadrature_weights[q_point];
6328 if constexpr (dim == 2)
6330 curl_temp = curl * weight;
6332 else if constexpr (dim == 3)
6334 for (
unsigned int comp = 0; comp < dim; ++comp)
6336 curl_temp[comp] = curl[comp] * jac[comp][comp] * weight;
6347 this->jacobian[q_point] :
6352 const VectorizedArrayType fac =
6354 this->quadrature_weights[q_point] :
6356 this->J_value[q_point] :
6357 this->J_value[0] * this->quadrature_weights[q_point]) *
6358 ((dim == 2 && this->get_face_no() < 2) ?
6366 if constexpr (dim == 2)
6368 curl_temp = curl * fac;
6370 else if constexpr (dim == 3)
6373 for (
unsigned int comp = 0; comp < n_components; ++comp)
6375 curl_temp[comp] = curl[0] * jac[0][comp];
6376 for (
unsigned int e = 1;
e < dim; ++
e)
6377 curl_temp[comp] += curl[e] * jac[e][comp];
6378 curl_temp[comp] *= fac;
6384 if constexpr (dim == 2)
6386 grad[1][0] = curl_temp;
6387 grad[0][1] = -curl_temp;
6391 else if constexpr (dim == 3)
6393 grad[2][1] = curl_temp[0];
6394 grad[1][2] = -curl_temp[0];
6395 grad[0][2] = curl_temp[1];
6396 grad[2][0] = -curl_temp[1];
6397 grad[1][0] = curl_temp[2];
6398 grad[0][1] = -curl_temp[2];
6405 for (
unsigned int d = 0;
d < dim; ++
d)
6407 for (
unsigned int comp = 0; comp < n_components; ++comp)
6408 gradients[comp * nqp_d + d] = grad[comp][d];
6413 if constexpr (dim == 2)
6418 else if constexpr (dim == 3)
6420 grad[2][1] = curl[0];
6421 grad[1][2] = -curl[0];
6422 grad[0][2] = curl[1];
6423 grad[2][0] = -curl[1];
6424 grad[1][0] = curl[2];
6425 grad[0][1] = -curl[2];
6430 submit_gradient(grad, q_point);
6443 typename VectorizedArrayType>
6449 VectorizedArrayType>::
6451 const unsigned int fe_no,
6452 const unsigned int quadrature_index,
6453 const unsigned int first_selected_component,
6454 const unsigned int active_fe_index,
6455 const unsigned int active_quad_index)
6456 : BaseClass(matrix_free,
6458 first_selected_component,
6466 , dofs_per_component(this->
data->dofs_per_component_on_cell)
6467 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
6468 , n_q_points(this->
data->n_q_points)
6470 check_template_arguments(fe_no, 0);
6480 typename VectorizedArrayType>
6486 VectorizedArrayType>::
6488 const std::pair<unsigned int, unsigned int> &range,
6489 const unsigned int dof_handler_index,
6490 const unsigned int quadrature_index,
6491 const unsigned int first_selected_component)
6495 first_selected_component,
6496 matrix_free.get_cell_active_fe_index(range, dof_handler_index))
6506 typename VectorizedArrayType>
6512 VectorizedArrayType>::
6517 const unsigned int first_selected_component)
6518 : BaseClass(mapping,
6522 first_selected_component,
6524 , dofs_per_component(this->
data->dofs_per_component_on_cell)
6525 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
6526 , n_q_points(this->
data->n_q_points)
6538 typename VectorizedArrayType>
6544 VectorizedArrayType>::
6548 const unsigned int first_selected_component)
6553 first_selected_component,
6555 , dofs_per_component(this->
data->dofs_per_component_on_cell)
6556 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
6557 , n_q_points(this->
data->n_q_points)
6569 typename VectorizedArrayType>
6575 VectorizedArrayType>::
6578 const unsigned int first_selected_component)
6579 : BaseClass(other.mapped_geometry->get_fe_values().get_mapping(),
6581 other.mapped_geometry->get_quadrature(),
6583 first_selected_component,
6585 , dofs_per_component(this->
data->dofs_per_component_on_cell)
6586 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
6587 , n_q_points(this->
data->n_q_points)
6599 typename VectorizedArrayType>
6608 , dofs_per_component(this->
data->dofs_per_component_on_cell)
6609 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
6610 , n_q_points(this->
data->n_q_points)
6622 typename VectorizedArrayType>
6628 VectorizedArrayType> &
6634 VectorizedArrayType>::operator=(
const FEEvaluation &other)
6636 BaseClass::operator=(other);
6648 typename VectorizedArrayType>
6655 VectorizedArrayType>::
6656 check_template_arguments(
const unsigned int dof_handler_index,
6657 const unsigned int first_selected_component)
6659 (void)dof_handler_index;
6660 (void)first_selected_component;
6663 this->
data->dofs_per_component_on_cell > 0,
6665 "There is nothing useful you can do with an FEEvaluation object with "
6666 "FE_Nothing, i.e., without DoFs! If you have passed to "
6667 "MatrixFree::reinit() a collection of finite elements also containing "
6668 "FE_Nothing, please check - before creating FEEvaluation - the category "
6669 "of the current range by calling either "
6670 "MatrixFree::get_cell_range_category(range) or "
6671 "MatrixFree::get_face_range_category(range). The returned category "
6672 "is the index of the active FE, which you can use to exclude "
6679 if ((
static_cast<unsigned int>(fe_degree) !=
6681 static_cast<unsigned int>(fe_degree) !=
6682 this->
data->data.front().fe_degree) ||
6683 n_q_points != this->n_quadrature_points)
6685 std::string message =
6686 "-------------------------------------------------------\n";
6688 "Illegal arguments in constructor/wrong template arguments!\n";
6689 message +=
" Called --> FEEvaluation<dim,";
6693 message +=
",Number>(data";
6711 if (
static_cast<unsigned int>(fe_degree) ==
6712 this->
data->data.front().fe_degree)
6714 proposed_dof_comp = dof_handler_index;
6715 proposed_fe_comp = first_selected_component;
6718 for (
unsigned int no = 0;
6721 for (
unsigned int nf = 0;
6724 if (this->matrix_free
6725 ->get_shape_info(no, 0, nf, this->active_fe_index, 0)
6727 .fe_degree ==
static_cast<unsigned int>(fe_degree))
6729 proposed_dof_comp = no;
6730 proposed_fe_comp = nf;
6734 this->mapping_data->descriptor[this->active_quad_index]
6736 proposed_quad_comp = this->quadrature_index;
6738 for (
unsigned int no = 0;
6744 .descriptor[this->active_quad_index]
6745 .n_q_points == n_q_points)
6747 proposed_quad_comp = no;
6754 if (proposed_dof_comp != first_selected_component)
6755 message +=
"Wrong vector component selection:\n";
6757 message +=
"Wrong quadrature formula selection:\n";
6758 message +=
" Did you mean FEEvaluation<dim,";
6762 message +=
",Number>(data";
6772 std::string correct_pos;
6773 if (proposed_dof_comp != dof_handler_index)
6774 correct_pos =
" ^ ";
6777 if (proposed_quad_comp != this->quadrature_index)
6778 correct_pos +=
" ^ ";
6781 if (proposed_fe_comp != first_selected_component)
6782 correct_pos +=
" ^\n";
6784 correct_pos +=
" \n";
6791 const unsigned int proposed_n_q_points_1d =
static_cast<unsigned int>(
6792 std::pow(1.001 * this->n_quadrature_points, 1. / dim));
6793 message +=
"Wrong template arguments:\n";
6794 message +=
" Did you mean FEEvaluation<dim,";
6799 message +=
",Number>(data";
6809 std::string correct_pos;
6810 if (this->
data->data.front().fe_degree !=
6811 static_cast<unsigned int>(fe_degree))
6815 if (proposed_n_q_points_1d != n_q_points_1d)
6816 correct_pos +=
" ^\n";
6818 correct_pos +=
" \n";
6819 message +=
" " + correct_pos;
6821 Assert(
static_cast<unsigned int>(fe_degree) ==
6822 this->
data->data.front().fe_degree &&
6823 n_q_points == this->n_quadrature_points,
6829 this->mapping_data->descriptor[this->active_quad_index].n_q_points);
6840 typename VectorizedArrayType>
6849 Assert(this->matrix_free !=
nullptr,
6850 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
6851 " Integer indexing is not possible."));
6859 const unsigned int offsets =
6860 this->mapping_data->data_index_offsets[
cell_index];
6861 this->jacobian = &this->mapping_data->jacobians[0][offsets];
6862 this->J_value = &this->mapping_data->JxW_values[offsets];
6863 if (!this->mapping_data->jacobian_gradients[0].empty())
6865 this->jacobian_gradients =
6866 this->mapping_data->jacobian_gradients[0].data() + offsets;
6867 this->jacobian_gradients_non_inverse =
6868 this->mapping_data->jacobian_gradients_non_inverse[0].data() + offsets;
6874 for (
unsigned int i = 0; i < n_lanes; ++i)
6875 this->cell_ids[i] =
cell_index * n_lanes + i;
6882 this->cell_ids[i] =
cell_index * n_lanes + i;
6883 for (; i < n_lanes; ++i)
6887 if (this->mapping_data->quadrature_points.empty() ==
false)
6889 &this->mapping_data->quadrature_points
6890 [this->mapping_data->quadrature_point_offsets[this->cell]];
6894 this->is_reinitialized =
true;
6895 this->dof_values_initialized =
false;
6896 this->values_quad_initialized =
false;
6897 this->gradients_quad_initialized =
false;
6898 this->hessians_quad_initialized =
false;
6909 typename VectorizedArrayType>
6916 VectorizedArrayType>
::reinit(
const std::array<
unsigned int,
6923 this->cell_ids = cell_ids;
6928 for (
unsigned int v = 0; v < n_lanes; ++v)
6942 if (this->mapped_geometry ==
nullptr)
6943 this->mapped_geometry =
6944 std::make_shared<internal::MatrixFreeFunctions::
6945 MappingDataOnTheFly<dim, VectorizedArrayType>>();
6947 auto &mapping_storage = this->mapped_geometry->get_data_storage();
6949 auto &this_jacobian_data = mapping_storage.jacobians[0];
6950 auto &this_J_value_data = mapping_storage.JxW_values;
6951 auto &this_jacobian_gradients_data = mapping_storage.jacobian_gradients[0];
6952 auto &this_jacobian_gradients_non_inverse_data =
6953 mapping_storage.jacobian_gradients_non_inverse[0];
6954 auto &this_quadrature_points_data = mapping_storage.quadrature_points;
6958 if (this_jacobian_data.size() != 2)
6959 this_jacobian_data.resize_fast(2);
6961 if (this_J_value_data.size() != 1)
6962 this_J_value_data.resize_fast(1);
6964 const auto &update_flags_cells =
6968 this_jacobian_gradients_data.size() != 1)
6970 this_jacobian_gradients_data.resize_fast(1);
6971 this_jacobian_gradients_non_inverse_data.resize_fast(1);
6975 this_quadrature_points_data.size() != 1)
6976 this_quadrature_points_data.resize_fast(1);
6980 if (this_jacobian_data.size() != this->n_quadrature_points)
6981 this_jacobian_data.resize_fast(this->n_quadrature_points);
6983 if (this_J_value_data.size() != this->n_quadrature_points)
6984 this_J_value_data.resize_fast(this->n_quadrature_points);
6986 const auto &update_flags_cells =
6990 this_jacobian_gradients_data.size() != this->n_quadrature_points)
6992 this_jacobian_gradients_data.resize_fast(this->n_quadrature_points);
6993 this_jacobian_gradients_non_inverse_data.resize_fast(
6994 this->n_quadrature_points);
6998 this_quadrature_points_data.size() != this->n_quadrature_points)
6999 this_quadrature_points_data.resize_fast(this->n_quadrature_points);
7003 this->jacobian = this_jacobian_data.data();
7004 this->J_value = this_J_value_data.data();
7005 this->jacobian_gradients = this_jacobian_gradients_data.data();
7006 this->jacobian_gradients_non_inverse =
7007 this_jacobian_gradients_non_inverse_data.data();
7011 for (
unsigned int v = 0; v < n_lanes; ++v)
7018 const unsigned int cell_batch_index =
cell_index / n_lanes;
7019 const unsigned int offsets =
7020 this->mapping_data->data_index_offsets[cell_batch_index];
7021 const unsigned int lane =
cell_index % n_lanes;
7023 if (this->cell_type <=
7027 for (
unsigned int q = 0; q < 2; ++q)
7028 for (
unsigned int i = 0; i < dim; ++i)
7029 for (
unsigned int j = 0; j < dim; ++j)
7030 this_jacobian_data[q][i][j][v] =
7031 this->mapping_data->jacobians[0][offsets + q][i][j][lane];
7033 const unsigned int q = 0;
7035 this_J_value_data[q][v] =
7036 this->mapping_data->JxW_values[offsets + q][lane];
7038 const auto &update_flags_cells =
7043 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7044 for (
unsigned int j = 0; j < dim; ++j)
7045 this_jacobian_gradients_data[q][i][j][v] =
7047 ->jacobian_gradients[0][offsets + q][i][j][lane];
7049 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7050 for (
unsigned int j = 0; j < dim; ++j)
7051 this_jacobian_gradients_non_inverse_data[q][i][j][v] =
7053 ->jacobian_gradients_non_inverse[0][offsets + q][i][j]
7058 for (
unsigned int i = 0; i < dim; ++i)
7059 this_quadrature_points_data[q][i][v] =
7060 this->mapping_data->quadrature_points
7062 ->quadrature_point_offsets[cell_batch_index] +
7068 const auto cell_type =
7072 for (
unsigned int q = 0; q < this->n_quadrature_points; ++q)
7074 const unsigned int q_src =
7080 this_J_value_data[q][v] =
7081 this->mapping_data->JxW_values[offsets + q_src][lane];
7083 for (
unsigned int i = 0; i < dim; ++i)
7084 for (
unsigned int j = 0; j < dim; ++j)
7085 this_jacobian_data[q][i][j][v] =
7087 ->jacobians[0][offsets + q_src][i][j][lane];
7089 const auto &update_flags_cells =
7094 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7095 for (
unsigned int j = 0; j < dim; ++j)
7096 this_jacobian_gradients_data[q][i][j][v] =
7098 ->jacobian_gradients[0][offsets + q_src][i][j][lane];
7100 for (
unsigned int i = 0; i < dim * (dim + 1) / 2; ++i)
7101 for (
unsigned int j = 0; j < dim; ++j)
7102 this_jacobian_gradients_non_inverse_data[q][i][j][v] =
7104 ->jacobian_gradients_non_inverse[0][offsets + q_src]
7117 this->mapping_data->quadrature_points
7119 ->quadrature_point_offsets[cell_batch_index] +
7123 this->mapping_data->jacobians[0][offsets + 1];
7125 for (
unsigned int d = 0;
d < dim; ++
d)
7129 this->descriptor->quadrature.point(q)[
d]);
7131 for (
unsigned int d = 0;
d < dim; ++
d)
7132 for (
unsigned int e = 0;
e < dim; ++
e)
7136 this->descriptor->quadrature.point(q)[
e]);
7138 for (
unsigned int i = 0; i < dim; ++i)
7139 this_quadrature_points_data[q][i][v] = point[i][lane];
7144 for (
unsigned int i = 0; i < dim; ++i)
7145 this_quadrature_points_data[q][i][v] =
7146 this->mapping_data->quadrature_points
7148 ->quadrature_point_offsets[cell_batch_index] +
7158 this->is_reinitialized =
true;
7159 this->dof_values_initialized =
false;
7160 this->values_quad_initialized =
false;
7161 this->gradients_quad_initialized =
false;
7162 this->hessians_quad_initialized =
false;
7173 typename VectorizedArrayType>
7174template <
bool level_dof_access>
7181 VectorizedArrayType>
::
7184 Assert(this->matrix_free ==
nullptr,
7185 ExcMessage(
"Cannot use initialization from cell iterator if "
7186 "initialized from MatrixFree object. Use variant for "
7187 "on the fly computation with arguments as for FEValues "
7190 this->mapped_geometry->reinit(
7192 this->local_dof_indices.resize(cell->get_fe().n_dofs_per_cell());
7193 if (level_dof_access)
7194 cell->get_mg_dof_indices(this->local_dof_indices);
7196 cell->get_dof_indices(this->local_dof_indices);
7200 this->is_reinitialized =
true;
7211 typename VectorizedArrayType>
7218 VectorizedArrayType>
::
7221 Assert(this->matrix_free == 0,
7222 ExcMessage(
"Cannot use initialization from cell iterator if "
7223 "initialized from MatrixFree object. Use variant for "
7224 "on the fly computation with arguments as for FEValues "
7227 this->mapped_geometry->reinit(cell);
7231 this->is_reinitialized =
true;
7242 typename VectorizedArrayType>
7249 VectorizedArrayType>::
7254 Assert(this->dof_values_initialized ==
true,
7257 evaluate(this->values_dofs, evaluation_flags);
7267 typename VectorizedArrayType>
7274 VectorizedArrayType>::
7275 evaluate(
const VectorizedArrayType *values_array,
7278 const bool hessians_on_general_cells =
7282 if (hessians_on_general_cells)
7285 if (this->
data->element_type ==
7291 if constexpr (fe_degree > -1)
7294 template run<fe_degree, n_q_points_1d>(n_components,
7295 evaluation_flag_actual,
7303 evaluation_flag_actual,
7304 const_cast<VectorizedArrayType *
>(values_array),
7308 this->store_values_for_gradients(evaluation_flag);
7312 this->values_quad_initialized =
7314 this->gradients_quad_initialized =
7316 this->hessians_quad_initialized =
7327 template <
typename Number,
7328 typename VectorizedArrayType,
7330 typename EvaluatorType,
7331 std::enable_if_t<internal::has_begin<VectorType> &&
7334 VectorizedArrayType *
7335 check_vector_access_inplace(
const EvaluatorType &fe_eval, VectorType &vector)
7341 const unsigned int cell = fe_eval.get_cell_or_face_batch_id();
7342 const auto &dof_info = fe_eval.get_dof_info();
7349 if (std::is_same_v<typename VectorType::value_type, Number> &&
7353 interleaved_contiguous &&
7354 reinterpret_cast<
std::size_t>(
7356 dof_info.dof_indices_contiguous
7357 [
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell]
7358 [cell * VectorizedArrayType::
size()]) %
7359 sizeof(VectorizedArrayType) ==
7362 return reinterpret_cast<VectorizedArrayType *
>(
7366 [cell * VectorizedArrayType::size()] +
7368 [fe_eval.get_active_fe_index()]
7369 [fe_eval.get_first_selected_component()] *
7370 VectorizedArrayType::size());
7379 template <
typename Number,
7380 typename VectorizedArrayType,
7382 typename EvaluatorType,
7383 std::enable_if_t<!internal::has_begin<VectorType> ||
7386 VectorizedArrayType *
7387 check_vector_access_inplace(
const EvaluatorType &, VectorType &)
7400 typename VectorizedArrayType>
7401template <
typename VectorType>
7408 VectorizedArrayType>::
7409 gather_evaluate(
const VectorType &input_vector,
7412 const VectorizedArrayType *src_ptr =
7413 internal::check_vector_access_inplace<Number, const VectorizedArrayType>(
7414 *
this, input_vector);
7415 if (src_ptr !=
nullptr)
7416 evaluate(src_ptr, evaluation_flag);
7419 this->read_dof_values(input_vector);
7420 evaluate(this->begin_dof_values(), evaluation_flag);
7431 typename VectorizedArrayType>
7438 VectorizedArrayType>::
7441 integrate(integration_flag, this->values_dofs);
7445 this->dof_values_initialized =
true;
7456 typename VectorizedArrayType>
7463 VectorizedArrayType>::
7465 VectorizedArrayType *values_array,
7466 const bool sum_into_values_array)
7471 Assert(this->values_quad_submitted ==
true,
7474 Assert(this->gradients_quad_submitted ==
true,
7477 Assert(this->hessians_quad_submitted ==
true,
7480 Assert(this->matrix_free !=
nullptr ||
7481 this->mapped_geometry->is_initialized(),
7487 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, and "
7488 "EvaluationFlags::hessians are supported."));
7494 unsigned int size = n_components * dim * n_q_points;
7497 for (
unsigned int i = 0; i <
size; ++i)
7498 this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
7502 for (
unsigned int i = 0; i <
size; ++i)
7503 this->gradients_quad[i] = this->gradients_from_hessians_quad[i];
7508 if (n_components == dim &&
7509 this->
data->element_type ==
7513 this->divergence_is_requested ==
false)
7515 unsigned int size = n_components * n_q_points;
7518 for (
unsigned int i = 0; i <
size; ++i)
7519 this->values_quad[i] += this->values_from_gradients_quad[i];
7523 for (
unsigned int i = 0; i <
size; ++i)
7524 this->values_quad[i] = this->values_from_gradients_quad[i];
7529 if constexpr (fe_degree > -1)
7532 template run<fe_degree, n_q_points_1d>(n_components,
7533 integration_flag_actual,
7536 sum_into_values_array);
7542 integration_flag_actual,
7545 sum_into_values_array);
7550 this->dof_values_initialized =
true;
7561 typename VectorizedArrayType>
7562template <
typename VectorType>
7569 VectorizedArrayType>::
7571 VectorType &destination)
7573 VectorizedArrayType *dst_ptr =
7574 internal::check_vector_access_inplace<Number, VectorizedArrayType>(
7575 *
this, destination);
7576 if (dst_ptr !=
nullptr)
7577 integrate(integration_flag, dst_ptr,
true);
7580 integrate(integration_flag, this->begin_dof_values());
7581 this->distribute_local_to_global(destination);
7592 typename VectorizedArrayType>
7599 VectorizedArrayType>::dof_indices()
const
7616 typename VectorizedArrayType>
7622 VectorizedArrayType>::
7625 const bool is_interior_face,
7626 const unsigned int dof_handler_index,
7627 const unsigned int quadrature_index,
7628 const unsigned int first_selected_component,
7629 const unsigned int active_fe_index,
7630 const unsigned int active_quad_index,
7631 const unsigned int face_type)
7632 : BaseClass(matrix_free,
7634 first_selected_component,
7642 , dofs_per_component(this->
data->dofs_per_component_on_cell)
7643 , dofs_per_cell(this->
data->dofs_per_component_on_cell * n_components_)
7644 , n_q_points(this->n_quadrature_points)
7654 typename VectorizedArrayType>
7660 VectorizedArrayType>::
7663 const std::pair<unsigned int, unsigned int> &range,
7664 const bool is_interior_face,
7665 const unsigned int dof_handler_index,
7666 const unsigned int quadrature_index,
7667 const unsigned int first_selected_component)
7672 first_selected_component,
7673 matrix_free.get_face_active_fe_index(range,
7676 matrix_free.get_face_info(range.
first).face_type)
7686 typename VectorizedArrayType>
7693 VectorizedArrayType>
::reinit(
const unsigned int face_index)
7695 Assert(this->mapped_geometry ==
nullptr,
7696 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
7697 " Integer indexing is not possible"));
7698 if (this->mapped_geometry !=
nullptr)
7701 this->cell = face_index;
7702 this->dof_access_index =
7703 this->is_interior_face() ?
7711 this->matrix_free->get_task_info().boundary_partition_data.back())
7712 Assert(this->is_interior_face(),
7714 "Boundary faces do not have a neighbor. When looping over "
7715 "boundary faces use FEFaceEvaluation with the parameter "
7716 "is_interior_face set to true. "));
7718 this->reinit_face(this->matrix_free->
get_face_info(face_index));
7723 this->face_ids[i] = face_index * n_lanes + i;
7724 for (; i < n_lanes; ++i)
7727 this->cell_type = this->matrix_free->
get_mapping_info().face_type[face_index];
7728 const unsigned int offsets =
7729 this->mapping_data->data_index_offsets[face_index];
7730 this->J_value = &this->mapping_data->JxW_values[offsets];
7731 this->normal_vectors = &this->mapping_data->normal_vectors[offsets];
7733 &this->mapping_data->jacobians[!this->is_interior_face()][offsets];
7734 this->normal_x_jacobian =
7736 ->normals_times_jacobians[!this->is_interior_face()][offsets];
7737 this->jacobian_gradients =
7738 this->mapping_data->jacobian_gradients[!this->is_interior_face()].data() +
7740 this->jacobian_gradients_non_inverse =
7742 ->jacobian_gradients_non_inverse[!this->is_interior_face()]
7746 if (this->mapping_data->quadrature_point_offsets.empty() ==
false)
7749 this->mapping_data->quadrature_point_offsets.size());
7751 this->mapping_data->quadrature_points.data() +
7752 this->mapping_data->quadrature_point_offsets[this->cell];
7757 this->is_reinitialized =
true;
7758 this->dof_values_initialized =
false;
7759 this->values_quad_initialized =
false;
7760 this->gradients_quad_initialized =
false;
7761 this->hessians_quad_initialized =
false;
7772 typename VectorizedArrayType>
7780 const unsigned int face_number)
7783 this->quadrature_index <
7786 "You must set MatrixFree::AdditionalData::mapping_update_flags_faces_by_cells to use the present reinit method."));
7790 Assert(this->mapped_geometry ==
nullptr,
7791 ExcMessage(
"FEEvaluation was initialized without a matrix-free object."
7792 " Integer indexing is not possible"));
7793 if (this->mapped_geometry !=
nullptr)
7798 .faces_by_cells_type[
cell_index][face_number];
7801 this->dof_access_index =
7804 if (this->is_interior_face() ==
false)
7809 for (
unsigned int i = 0; i < n_lanes; ++i)
7812 const unsigned int cell_this =
cell_index * n_lanes + i;
7814 unsigned int face_index =
7819 this->face_ids[i] = face_index;
7824 this->face_numbers[i] =
static_cast<std::uint8_t
>(-1);
7825 this->face_orientations[i] =
7833 auto cell_m = faces.cells_interior[face_index % n_lanes];
7834 auto cell_p = faces.cells_exterior[face_index % n_lanes];
7836 const bool face_identifies_as_interior = cell_m != cell_this;
7838 Assert(cell_m == cell_this || cell_p == cell_this,
7842 if (face_identifies_as_interior)
7844 this->cell_ids[i] = cell_m;
7845 this->face_numbers[i] = faces.interior_face_no;
7849 this->cell_ids[i] = cell_p;
7850 this->face_numbers[i] = faces.exterior_face_no;
7853 const bool orientation_interior_face = faces.face_orientation >= 8;
7855 faces.face_orientation % 8;
7856 if (face_identifies_as_interior != orientation_interior_face)
7859 ->reference_cell() ==
7860 ReferenceCells::get_hypercube<dim>(),
7864 .get_inverse_combined_orientation(face_orientation);
7866 this->face_orientations[i] = face_orientation;
7872 this->face_numbers[0] = face_number;
7877 for (
unsigned int i = 0; i < n_lanes; ++i)
7878 this->cell_ids[i] =
cell_index * n_lanes + i;
7886 this->cell_ids[i] =
cell_index * n_lanes + i;
7887 for (; i < n_lanes; ++i)
7890 for (
unsigned int i = 0; i < n_lanes; ++i)
7897 const unsigned int offsets =
7899 .face_data_by_cells[this->quadrature_index]
7904 .face_data_by_cells[this->quadrature_index]
7905 .JxW_values.size());
7907 .face_data_by_cells[this->quadrature_index]
7908 .JxW_values[offsets];
7910 .face_data_by_cells[this->quadrature_index]
7911 .normal_vectors[offsets];
7913 .face_data_by_cells[this->quadrature_index]
7914 .jacobians[!this->is_interior_face()][offsets];
7915 this->normal_x_jacobian =
7917 .face_data_by_cells[this->quadrature_index]
7918 .normals_times_jacobians[!this->is_interior_face()][offsets];
7919 this->jacobian_gradients =
7920 this->mapping_data->jacobian_gradients[!this->is_interior_face()].data() +
7922 this->jacobian_gradients_non_inverse =
7924 ->jacobian_gradients_non_inverse[!this->is_interior_face()]
7929 .face_data_by_cells[this->quadrature_index]
7930 .quadrature_point_offsets.empty() ==
false)
7932 const unsigned int index =
7936 .face_data_by_cells[this->quadrature_index]
7937 .quadrature_point_offsets.size());
7939 .face_data_by_cells[this->quadrature_index]
7940 .quadrature_points.data() +
7942 .face_data_by_cells[this->quadrature_index]
7943 .quadrature_point_offsets[
index];
7948 this->is_reinitialized =
true;
7949 this->dof_values_initialized =
false;
7950 this->values_quad_initialized =
false;
7951 this->gradients_quad_initialized =
false;
7952 this->hessians_quad_initialized =
false;
7963 typename VectorizedArrayType>
7970 VectorizedArrayType>::
7978 evaluate(this->values_dofs, evaluation_flag);
7988 typename VectorizedArrayType>
7995 VectorizedArrayType>::
7996 evaluate(
const VectorizedArrayType *values_array,
7999 Assert((evaluation_flag &
8002 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8003 "and EvaluationFlags::hessians are supported."));
8005 const bool hessians_on_general_cells =
8009 if (hessians_on_general_cells)
8012 if (this->
data->element_type ==
8018 if constexpr (fe_degree > -1)
8020 template
run<fe_degree, n_q_points_1d>(n_components,
8021 evaluation_flag_actual,
8026 n_components, evaluation_flag_actual, values_array, *
this);
8028 this->store_values_for_gradients(evaluation_flag);
8032 this->values_quad_initialized =
8034 this->gradients_quad_initialized =
8036 this->hessians_quad_initialized =
8048 typename VectorizedArrayType>
8055 VectorizedArrayType>::
8063 project_to_face(this->values_dofs, evaluation_flag);
8073 typename VectorizedArrayType>
8080 VectorizedArrayType>::
8081 project_to_face(
const VectorizedArrayType *values_array,
8084 Assert((evaluation_flag &
8087 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8088 "and EvaluationFlags::hessians are supported."));
8090 const bool hessians_on_general_cells =
8094 if (hessians_on_general_cells)
8097 if (this->
data->element_type ==
8103 if constexpr (fe_degree > -1)
8106 VectorizedArrayType>::template run<fe_degree>(n_components,
8107 evaluation_flag_actual,
8113 evaluation_flag_actual,
8127 typename VectorizedArrayType>
8134 VectorizedArrayType>::
8137 Assert((evaluation_flag &
8140 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8141 "and EvaluationFlags::hessians are supported."));
8143 const bool hessians_on_general_cells =
8147 if (hessians_on_general_cells)
8150 if (this->
data->element_type ==
8156 if constexpr (fe_degree > -1)
8159 VectorizedArrayType>::template run<fe_degree>(n_components,
8160 evaluation_flag_actual,
8166 this->store_values_for_gradients(evaluation_flag);
8170 this->values_quad_initialized =
8172 this->gradients_quad_initialized =
8174 this->hessians_quad_initialized =
8186 typename VectorizedArrayType>
8193 VectorizedArrayType>::
8195 const bool sum_into_values)
8197 integrate(integration_flag, this->values_dofs, sum_into_values);
8201 this->dof_values_initialized =
true;
8212 typename VectorizedArrayType>
8219 VectorizedArrayType>::
8221 VectorizedArrayType *values_array,
8222 const bool sum_into_values)
8224 Assert((integration_flag &
8227 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8228 "and EvaluationFlags::hessians are supported."));
8234 unsigned int size = n_components * dim * n_q_points;
8237 for (
unsigned int i = 0; i <
size; ++i)
8238 this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
8242 for (
unsigned int i = 0; i <
size; ++i)
8243 this->gradients_quad[i] = this->gradients_from_hessians_quad[i];
8248 if (this->
data->element_type ==
8252 this->divergence_is_requested ==
false)
8254 unsigned int size = n_components * n_q_points;
8257 for (
unsigned int i = 0; i <
size; ++i)
8258 this->values_quad[i] += this->values_from_gradients_quad[i];
8262 for (
unsigned int i = 0; i <
size; ++i)
8263 this->values_quad[i] = this->values_from_gradients_quad[i];
8268 if constexpr (fe_degree > -1)
8270 template
run<fe_degree, n_q_points_1d>(n_components,
8271 integration_flag_actual,
8278 integration_flag_actual,
8291 typename VectorizedArrayType>
8298 VectorizedArrayType>::
8301 Assert((integration_flag &
8304 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8305 "and EvaluationFlags::hessians are supported."));
8311 unsigned int size = n_components * dim * n_q_points;
8314 for (
unsigned int i = 0; i <
size; ++i)
8315 this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
8319 for (
unsigned int i = 0; i <
size; ++i)
8320 this->gradients_quad[i] = this->gradients_from_hessians_quad[i];
8325 if (this->
data->element_type ==
8329 this->divergence_is_requested ==
false)
8331 unsigned int size = n_components * n_q_points;
8334 for (
unsigned int i = 0; i <
size; ++i)
8335 this->values_quad[i] += this->values_from_gradients_quad[i];
8339 for (
unsigned int i = 0; i <
size; ++i)
8340 this->values_quad[i] = this->values_from_gradients_quad[i];
8345 if constexpr (fe_degree > -1)
8348 VectorizedArrayType>::template run<fe_degree>(n_components,
8349 integration_flag_actual,
8365 typename VectorizedArrayType>
8372 VectorizedArrayType>::
8374 const bool sum_into_values)
8376 collect_from_face(integration_flag, this->values_dofs, sum_into_values);
8380 this->dof_values_initialized =
true;
8391 typename VectorizedArrayType>
8398 VectorizedArrayType>::
8400 VectorizedArrayType *values_array,
8401 const bool sum_into_values)
8403 Assert((integration_flag &
8406 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8407 "and EvaluationFlags::hessians are supported."));
8414 if (this->
data->element_type ==
8418 this->divergence_is_requested ==
false)
8421 if constexpr (fe_degree > -1)
8424 VectorizedArrayType>::template run<fe_degree>(n_components,
8425 integration_flag_actual,
8432 integration_flag_actual,
8445 typename VectorizedArrayType>
8446template <
typename VectorType>
8453 VectorizedArrayType>::
8454 gather_evaluate(
const VectorType &input_vector,
8457 Assert((evaluation_flag &
8460 ExcMessage(
"Only EvaluationFlags::values, EvaluationFlags::gradients, "
8461 "and EvaluationFlags::hessians are supported."));
8463 const auto shared_vector_data = internal::get_shared_vector_data(
8465 this->dof_access_index ==
8467 this->active_fe_index,
8470 if (this->
data->data.front().fe_degree > 0 &&
8471 fast_evaluation_supported(this->
data->data.front().fe_degree,
8472 this->data->data.front().n_q_points_1d) &&
8475 typename VectorType::value_type,
8476 VectorizedArrayType>::
8477 supports(evaluation_flag,
8481 this->dof_info->index_storage_variants[this->dof_access_index]
8484 if constexpr (fe_degree > -1)
8488 typename VectorType::value_type,
8489 VectorizedArrayType>::template
run<fe_degree,
8493 internal::get_beginning<typename VectorType::value_type>(
8502 typename VectorType::value_type,
8503 VectorizedArrayType>::evaluate(n_components,
8505 internal::get_beginning<
8506 typename VectorType::value_type>(
8514 this->read_dof_values(input_vector);
8515 this->evaluate(evaluation_flag);
8521 this->gradients_quad_initialized =
8523 this->hessians_quad_initialized =
8535 typename VectorizedArrayType>
8536template <
typename VectorType>
8544 VectorizedArrayType>::integrate_scatter(
const bool integrate_values,
8545 const bool integrate_gradients,
8546 VectorType &destination)
8553 integrate_scatter(flag, destination);
8563 typename VectorizedArrayType>
8564template <
typename VectorType>
8571 VectorizedArrayType>::
8573 VectorType &destination)
8575 Assert((this->dof_access_index ==
8577 this->is_interior_face() ==
false) ==
false,
8580 const auto shared_vector_data = internal::get_shared_vector_data(
8582 this->dof_access_index ==
8584 this->active_fe_index,
8587 if (this->
data->data.front().fe_degree > 0 &&
8588 fast_evaluation_supported(this->
data->data.front().fe_degree,
8589 this->data->data.front().n_q_points_1d) &&
8592 typename VectorType::value_type,
8593 VectorizedArrayType>::
8594 supports(integration_flag,
8598 this->dof_info->index_storage_variants[this->dof_access_index]
8601 if constexpr (fe_degree > -1)
8605 typename VectorType::value_type,
8606 VectorizedArrayType>::template
run<fe_degree,
8610 internal::get_beginning<typename VectorType::value_type>(
8619 typename VectorType::value_type,
8620 VectorizedArrayType>::integrate(n_components,
8622 internal::get_beginning<
8623 typename VectorType::value_type>(
8631 integrate(integration_flag);
8632 this->distribute_local_to_global(destination);
8643 typename VectorizedArrayType>
8650 VectorizedArrayType>::dof_indices()
const
8663 typename VectorizedArrayType>
8670 VectorizedArrayType>::
8671 fast_evaluation_supported(
const unsigned int given_degree,
8672 const unsigned int given_n_q_points_1d)
8674 return fe_degree == -1 ?
8687 typename VectorizedArrayType>
8694 VectorizedArrayType>::
8695 fast_evaluation_supported(
const unsigned int given_degree,
8696 const unsigned int given_n_q_points_1d)
8698 return fe_degree == -1 ?
8711 typename VectorizedArrayType>
8718 VectorizedArrayType>::at_boundary()
const
8720 Assert(this->dof_access_index !=
8724 if (this->is_interior_face() ==
false)
8729 this->matrix_free->n_boundary_face_batches()))
8742 typename VectorizedArrayType>
8749 VectorizedArrayType>::boundary_id()
const
8751 Assert(this->dof_access_index !=
8768 typename VectorizedArrayType>
8776 VectorizedArrayType>::get_dofs_per_component_projected_to_face()
8778 return this->
data->dofs_per_component_on_face;
8788 typename VectorizedArrayType>
8795 VectorizedArrayType>::get_dofs_projected_to_face()
8797 return this->
data->dofs_per_component_on_face * n_components_;
value_type get_dof_value(const unsigned int dof) const
void read_write_operation_global(const VectorOperation &operation, const std::array< VectorType *, n_components_ > &vectors) const
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 submit_gradient(const Tensor< 2, 1, VectorizedArrayType > val_in, const unsigned int q_point)
void submit_normal_hessian(const value_type normal_hessian_in, const unsigned int q_point)
internal::CurlType< dim, VectorizedArrayType > curl_type
static constexpr unsigned int dimension
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< n_lanes > &mask, const bool apply_constraints=true) const
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)
void submit_divergence(const VectorizedArrayType div_in, const unsigned int q_point)
void submit_dof_value(const value_type val_in, const unsigned int dof)
std::vector< types::global_dof_index > local_dof_indices
void store_values_for_gradients(const EvaluationFlags::EvaluationFlags evaluation_flag)
void distribute_local_to_global(VectorType &dst, const unsigned int first_index=0, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip()) const
std::conditional_t< n_components_==1, Tensor< 2, dim, VectorizedArrayType >, std::conditional_t< n_components_==dim, Tensor< 3, dim, VectorizedArrayType >, Tensor< 1, n_components_, Tensor< 2, dim, VectorizedArrayType > > > > hessian_type
std::conditional_t< n_components_==1, Tensor< 1, dim, VectorizedArrayType >, std::conditional_t< n_components_==dim, Tensor< 2, dim, VectorizedArrayType >, Tensor< 1, n_components_, Tensor< 1, dim, VectorizedArrayType > > > > gradient_type
FEEvaluationBase(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_handler_index, const unsigned int first_selected_component, const unsigned int quadrature_index, 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 read_dof_values_plain(const VectorType &src, const unsigned int first_index=0, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
curl_type get_curl(const unsigned int q_point) const
VectorizedArrayType get_divergence(const unsigned int q_point) const
hessian_type get_hessian(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)
void submit_curl(const curl_type curl_in, const unsigned int q_point)
FEEvaluationBase & operator=(const FEEvaluationBase &other)
SymmetricTensor< 2, dim, VectorizedArrayType > get_symmetric_gradient(const unsigned int q_point) const
static constexpr unsigned int n_components
void submit_symmetric_gradient(const SymmetricTensor< 2, dim, VectorizedArrayType > grad_in, const unsigned int q_point)
gradient_type get_hessian_diagonal(const unsigned int q_point) const
void submit_value(const Tensor< 1, 1, VectorizedArrayType > val_in, const unsigned int q_point)
std::conditional_t< n_components_==1, VectorizedArrayType, Tensor< 1, n_components_, VectorizedArrayType > > value_type
const MatrixFree< dim, Number, VectorizedArrayType > & get_matrix_free() const
void apply_hanging_node_constraints(const bool transpose) const
void set_dof_values_plain(VectorType &dst, const unsigned int first_index=0, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip()) const
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< n_lanes > &mask) const
value_type integrate_value() const
FEEvaluationBase(const FEEvaluationBase &other)
void submit_hessian(const hessian_type hessian_in, const unsigned int q_point)
void set_dof_values(VectorType &dst, const unsigned int first_index=0, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip()) const
static constexpr unsigned int n_lanes
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
value_type get_normal_hessian(const unsigned int q_point) const
void read_dof_values(const VectorType &src, const unsigned int first_index=0, const std::bitset< n_lanes > &mask=std::bitset< n_lanes >().flip())
const MappingInfoStorageType::QuadratureDescriptor * descriptor
const MappingInfoStorageType * mapping_data
const ShapeInfoType * data
std::shared_ptr< internal::MatrixFreeFunctions::MappingDataOnTheFly< dim, Number > > mapped_geometry
const unsigned int active_fe_index
std::array< unsigned int, n_lanes > cell_ids
const unsigned int active_quad_index
const unsigned int quadrature_index
bool is_interior_face() const
FEEvaluationData & operator=(const FEEvaluationData &other)
const unsigned int first_selected_component
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
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)
void reinit(const std::array< unsigned int, n_lanes > &cell_ids)
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 EvaluationFlags::EvaluationFlags evaluation_flag)
FEEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const unsigned int dof_handler_index=0, const unsigned int quadrature_index=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 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)
FEEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const std::pair< unsigned int, unsigned int > &range, const unsigned int dof_handler_index=0, const unsigned int quadrature_index=0, const unsigned int first_selected_component=0)
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
typename BaseClass::value_type value_type
FEEvaluation & operator=(const FEEvaluation &other)
void integrate(const EvaluationFlags::EvaluationFlags integration_flag)
static constexpr unsigned int n_components
static constexpr unsigned int static_n_q_points
static constexpr unsigned int n_lanes
FEEvaluation(const FEEvaluation &other)
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(const EvaluationFlags::EvaluationFlags integration_flag, VectorizedArrayType *values_array, const bool sum_into_values=false)
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_handler_index=0, const unsigned int quadrature_index=0, const unsigned int first_selected_component=0)
void collect_from_face(const EvaluationFlags::EvaluationFlags integration_flag, VectorizedArrayType *values_array, const bool sum_into_values=false)
void integrate_scatter(const EvaluationFlags::EvaluationFlags integration_flag, VectorType &output_vector)
static constexpr unsigned int static_n_q_points_cell
void project_to_face(const EvaluationFlags::EvaluationFlags evaluation_flag)
static constexpr unsigned int tensor_dofs_per_cell
unsigned int get_dofs_per_component_projected_to_face()
void project_to_face(const VectorizedArrayType *values_array, const EvaluationFlags::EvaluationFlags evaluation_flag)
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
FEFaceEvaluation(const MatrixFree< dim, Number, VectorizedArrayType > &matrix_free, const bool is_interior_face=true, const unsigned int dof_handler_index=0, const unsigned int quadrature_index=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)
void evaluate(const EvaluationFlags::EvaluationFlags evaluation_flag)
void collect_from_face(const EvaluationFlags::EvaluationFlags integration_flag, const bool sum_into_values=false)
static constexpr unsigned int static_dofs_per_component
static constexpr unsigned int n_lanes
static constexpr unsigned int static_n_q_points
unsigned int get_dofs_projected_to_face()
static constexpr unsigned int dimension
typename BaseClass::gradient_type gradient_type
types::boundary_id boundary_id() const
void integrate(const EvaluationFlags::EvaluationFlags integration_flag, const bool sum_into_values=false)
void evaluate_in_face(const EvaluationFlags::EvaluationFlags evaluation_flag)
void integrate_scatter(const bool integrate_values, const bool integrate_gradients, VectorType &output_vector)
static constexpr unsigned int static_dofs_per_cell
void integrate_in_face(const EvaluationFlags::EvaluationFlags integration_flag)
std::pair< unsigned int, unsigned int > component_to_base_index(const unsigned int component) const
unsigned int element_multiplicity(const unsigned int index) const
Abstract base class for mapping classes.
const internal::MatrixFreeFunctions::TaskInfo & get_task_info() const
types::boundary_id get_boundary_id(const unsigned int face_batch_index) const
const Table< 3, unsigned int > & get_cell_and_face_to_plain_faces() const
unsigned int n_inner_face_batches() const
unsigned int n_active_entries_per_cell_batch(const unsigned int cell_batch_index) const
const internal::MatrixFreeFunctions::FaceToCellTopology< VectorizedArrayType::size()> & get_face_info(const unsigned int face_batch_index) const
const internal::MatrixFreeFunctions::DoFInfo & get_dof_info(const unsigned int dof_handler_index_component=0) const
AlignedVector< VectorizedArrayType > * acquire_scratch_data() const
const Number * constraint_pool_begin(const unsigned int pool_index) const
void release_scratch_data(const AlignedVector< VectorizedArrayType > *memory) const
DoFHandler< dim >::cell_iterator get_cell_iterator(const unsigned int cell_batch_index, const unsigned int lane_index, const unsigned int dof_handler_index=0) const
const internal::MatrixFreeFunctions::MappingInfo< dim, Number, VectorizedArrayType > & get_mapping_info() const
bool indices_initialized() const
const Number * constraint_pool_end(const unsigned int pool_index) const
unsigned int n_components() const
unsigned int n_active_entries_per_face_batch(const unsigned int face_batch_index) const
const internal::MatrixFreeFunctions::ShapeInfo< Number > & get_shape_info(const unsigned int dof_handler_index_component=0, const unsigned int quad_index=0, const unsigned int fe_base_element=0, const unsigned int hp_active_fe_index=0, const unsigned int hp_active_quad_index=0) const
unsigned int n_base_elements(const unsigned int dof_handler_index) const
constexpr const Number & access_raw_entry(const unsigned int unrolled_index) const
#define DEAL_II_ALWAYS_INLINE
#define DEAL_II_OPENMP_SIMD_PRAGMA
#define DEAL_II_NAMESPACE_OPEN
constexpr bool running_in_debug_mode()
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
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)
@ update_jacobian_grads
Gradient of volume element.
@ update_quadrature_points
Transformed quadrature points.
std::vector< index_type > data
The namespace for the EvaluationFlags enum.
EvaluationFlags
The EvaluationFlags enum.
Tpetra::Vector< Number, LO, GO, NodeType< MemorySpace > > VectorType
std::enable_if_t< IsBlockVector< VectorType >::value, unsigned int > n_blocks(const VectorType &vector)
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< 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)
* * * ScaleZFunction< dim, Number, components >::ScaleZFunction * component(component)
* * * RotationFunction< dim, Number >::RotationFunction Number(dim)
* * * * * * TimeRateUpdateFlags TimeRateRequest< ValueType, dim, Number > get_update_flags() const
* * * * std::vector< Number > ThermoPlasticMaterial< dim, ViscoplasticYieldLaw, Number >::get_state_parameters const
constexpr const ReferenceCell< dim > & get_hypercube()
T sum(const T &t, const MPI_Comm mpi_communicator)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
constexpr T pow(const T base, const int iexp)
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
std::conditional_t< dim==3, Tensor< 1, 3, NumberType >, std::conditional_t< dim==2, NumberType, std::monostate > > CurlType
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
void check_vector_compatibility(const VectorType &vec, const MatrixFree< dim, Number, VectorizedArrayType > &, const internal::MatrixFreeFunctions::DoFInfo &dof_info)
constexpr types::geometric_orientation invalid_geometric_orientation
constexpr unsigned int invalid_unsigned_int
constexpr types::boundary_id internal_face_boundary_id
constexpr types::geometric_orientation default_geometric_orientation
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)
std::uint8_t geometric_orientation
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< Number > &shape_info, const bool transpose, const std::array< MatrixFreeFunctions::compressed_constraint_kind, VectorizedArrayType::size()> &c_mask, VectorizedArrayType *values)
static void integrate(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, Number *values_dofs, FEEvaluationData< dim, Number, true > &fe_eval, const bool sum_into_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 evaluate_in_face(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, FEEvaluationData< dim, Number, true > &fe_eval)
static void integrate_in_face(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, FEEvaluationData< dim, Number, true > &fe_eval)
static void collect_from_face(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, Number *values_dofs, FEEvaluationData< dim, Number, true > &fe_eval, const bool sum_into_values)
static void project_to_face(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, const 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
unsigned int fe_index_from_degree(const unsigned int first_selected_component, const unsigned int fe_degree) const
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::vector< unsigned int > component_to_base_index
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
std::vector< QuadratureDescriptor > descriptor
unsigned int quad_index_from_n_q_points(const unsigned int n_q_points) const
std::vector< unsigned int > face_partition_data
constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
constexpr SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)