17 #ifndef dealii_matrix_free_fe_evaluation_h 18 #define dealii_matrix_free_fe_evaluation_h 21 #include <deal.II/base/array_view.h> 22 #include <deal.II/base/config.h> 23 #include <deal.II/base/exceptions.h> 24 #include <deal.II/base/smartpointer.h> 26 #include <deal.II/base/template_constraints.h> 27 #include <deal.II/base/vectorization.h> 28 #include <deal.II/matrix_free/mapping_data_on_the_fly.h> 29 #include <deal.II/matrix_free/matrix_free.h> 30 #include <deal.II/matrix_free/shape_info.h> 31 #include <deal.II/matrix_free/evaluation_kernels.h> 32 #include <deal.II/matrix_free/tensor_product_kernels.h> 33 #include <deal.II/matrix_free/evaluation_selector.h> 35 #include <deal.II/lac/vector_operation.h> 37 DEAL_II_NAMESPACE_OPEN
46 template <
typename>
class Vector;
54 template <
int dim,
int fe_degree,
int n_q_points_1d = fe_degree+1,
55 int n_components_ = 1,
typename Number =
double >
class FEEvaluation;
83 template <
int dim,
int n_components_,
typename Number,
bool is_face=false>
87 typedef Number number_type;
90 static constexpr
unsigned int dimension = dim;
91 static constexpr
unsigned int n_components = n_components_;
170 template <
typename VectorType>
172 const unsigned int first_index = 0);
202 template <
typename VectorType>
204 const unsigned int first_index = 0);
229 template <
typename VectorType>
231 const unsigned int first_index = 0)
const;
259 template <
typename VectorType>
261 const unsigned int first_index = 0)
const;
298 const unsigned int dof);
325 const unsigned int q_point);
366 const unsigned int q_point);
386 const unsigned int q_point);
649 const std::vector<unsigned int> &
674 const unsigned int dof_no,
677 const unsigned int fe_degree,
678 const unsigned int n_q_points,
715 template <
int n_components_other>
745 template <
typename VectorType,
typename VectorOperation>
748 VectorType *vectors[],
749 const bool apply_constraints =
true)
const;
758 template <
typename VectorType,
typename VectorOperation>
761 VectorType *vectors[])
const;
770 template <
typename VectorType,
typename VectorOperation>
773 VectorType *vectors[])
const;
1020 std::shared_ptr<internal::MatrixFreeFunctions::MappingDataOnTheFly<dim,Number> >
mapped_geometry;
1045 template <
int,
int,
int,
int,
typename>
friend class FEEvaluation;
1059 template <
int dim,
int n_components_,
typename Number,
bool is_face>
1063 typedef Number number_type;
1066 static constexpr
unsigned int dimension = dim;
1067 static constexpr
unsigned int n_components = n_components_;
1079 const unsigned int dof_no,
1082 const unsigned int fe_degree,
1083 const unsigned int n_q_points,
1090 template <
int n_components_other>
1122 template <
int dim,
typename Number,
bool is_face>
1126 typedef Number number_type;
1129 static constexpr
unsigned int dimension = dim;
1139 const unsigned int dof);
1148 const unsigned int q_point);
1153 const unsigned int q_point);
1166 const unsigned int q_point);
1171 const unsigned int q_point);
1199 const unsigned int dof_no,
1202 const unsigned int fe_degree,
1203 const unsigned int n_q_points,
1210 template <
int n_components_other>
1242 template <
int dim,
typename Number,
bool is_face>
1246 typedef Number number_type;
1249 static constexpr
unsigned int dimension = dim;
1250 static constexpr
unsigned int n_components = dim;
1277 get_curl (
const unsigned int q_point)
const;
1291 const unsigned int q_point);
1302 const unsigned int q_point);
1313 const unsigned int q_point);
1324 const unsigned int q_point);
1331 const unsigned int q_point);
1342 const unsigned int dof_no,
1345 const unsigned int dofs_per_cell,
1346 const unsigned int n_q_points,
1353 template <
int n_components_other>
1384 template <
typename Number,
bool is_face>
1388 typedef Number number_type;
1391 static constexpr
unsigned int dimension = 1;
1401 const unsigned int dof);
1410 const unsigned int q_point);
1415 const unsigned int q_point);
1428 const unsigned int q_point);
1433 const unsigned int q_point);
1438 const unsigned int q_point);
1443 const unsigned int q_point);
1471 const unsigned int dof_no,
1474 const unsigned int fe_degree,
1475 const unsigned int n_q_points,
1482 template <
int n_components_other>
2048 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
2149 const unsigned int dof_no = 0,
2150 const unsigned int quad_no = 0,
2205 template <
int n_components_other>
2234 void reinit (
const unsigned int cell_batch_index);
2248 template <
typename DoFHandlerType,
bool level_dof_access>
2272 void evaluate (
const bool evaluate_values,
2273 const bool evaluate_gradients,
2274 const bool evaluate_hessians =
false);
2289 const bool evaluate_values,
2290 const bool evaluate_gradients,
2291 const bool evaluate_hessians =
false);
2306 template <
typename VectorType>
2308 const bool evaluate_values,
2309 const bool evaluate_gradients,
2310 const bool evaluate_hessians =
false);
2322 void integrate (
const bool integrate_values,
2323 const bool integrate_gradients);
2336 void integrate (
const bool integrate_values,
2337 const bool integrate_gradients,
2353 template <
typename VectorType>
2355 const bool integrate_gradients,
2356 VectorType &output_vector);
2432 template <
int dim,
int fe_degree,
int n_q_points_1d = fe_degree+1,
2433 int n_components_ = 1,
typename Number =
double >
2543 const unsigned int dof_no = 0,
2544 const unsigned int quad_no = 0,
2562 void reinit (
const unsigned int face_batch_number);
2571 void reinit(
const unsigned int cell_batch_number,
2572 const unsigned int face_number);
2584 void evaluate (
const bool evaluate_values,
2585 const bool evaluate_gradients);
2600 const bool evaluate_values,
2601 const bool evaluate_gradients);
2614 template <
typename VectorType>
2616 const bool evaluate_values,
2617 const bool evaluate_gradients);
2628 void integrate (
const bool integrate_values,
2629 const bool integrate_gradients);
2639 void integrate (
const bool integrate_values,
2640 const bool integrate_gradients,
2654 template <
typename VectorType>
2656 const bool integrate_gradients,
2657 VectorType &output_vector);
2700 const bool gradients);
2707 namespace MatrixFreeFunctions
2711 template <
int dim,
int degree>
2712 struct DGP_dofs_per_component
2715 static constexpr
unsigned int value =
2716 (DGP_dofs_per_component<dim-1,degree>::value * (degree+dim)) / dim;
2720 template <
int degree>
2721 struct DGP_dofs_per_component<1,degree>
2723 static constexpr
unsigned int value = degree+1;
2737 template <
int dim,
int n_components_,
typename Number,
bool is_face>
2741 const unsigned int dof_no,
2742 const unsigned int first_selected_component,
2743 const unsigned int quad_no_in,
2744 const unsigned int fe_degree,
2745 const unsigned int n_q_points,
2746 const bool is_interior_face)
2748 scratch_data_array (data_in.acquire_scratch_data()),
2749 quad_no (quad_no_in),
2750 n_fe_components (data_in.get_dof_info(dof_no).start_components.back()),
2751 active_fe_index (fe_degree !=
numbers::invalid_unsigned_int ?
2752 data_in.get_dof_info(dof_no).fe_index_from_degree
2753 (first_selected_component, fe_degree)
2756 active_quad_index (fe_degree !=
numbers::invalid_unsigned_int ?
2758 data_in.get_mapping_info().face_data[quad_no_in].
2759 quad_index_from_n_q_points(n_q_points)
2761 data_in.get_mapping_info().cell_data[quad_no_in].
2762 quad_index_from_n_q_points(n_q_points))
2765 n_quadrature_points(fe_degree !=
numbers::invalid_unsigned_int ? n_q_points :
2767 data_in.get_shape_info
2768 (dof_no, quad_no_in, active_fe_index, active_quad_index).n_q_points_face
2770 data_in.get_shape_info
2771 (dof_no, quad_no_in, active_fe_index, active_quad_index).n_q_points)),
2772 matrix_info (&data_in),
2773 dof_info (&data_in.get_dof_info(dof_no)),
2774 mapping_data (
internal::MatrixFreeFunctions::MappingInfoCellsOrFaces<dim,Number,is_face>::get(data_in.get_mapping_info(), quad_no)),
2775 data (&data_in.get_shape_info
2776 (dof_no, quad_no_in,
2777 dof_info->component_to_base_index[first_selected_component],
2778 active_fe_index, active_quad_index)),
2781 normal_vectors (nullptr),
2782 normal_x_jacobian (nullptr),
2783 quadrature_weights (mapping_data->descriptor[active_quad_index].quadrature_weights.begin()),
2784 cell (
numbers::invalid_unsigned_int),
2785 is_interior_face (is_interior_face),
2786 dof_access_index (is_face ?
2788 internal::MatrixFreeFunctions::DoFInfo::dof_access_face_interior
2790 internal::MatrixFreeFunctions::DoFInfo::dof_access_face_exterior)
2792 internal::MatrixFreeFunctions::DoFInfo::dof_access_cell),
2794 dof_values_initialized (false),
2795 values_quad_initialized (false),
2796 gradients_quad_initialized(false),
2797 hessians_quad_initialized (false),
2798 values_quad_submitted (false),
2799 gradients_quad_submitted (false),
2800 first_selected_component (first_selected_component)
2802 set_data_pointers();
2808 n_quadrature_points);
2810 mapping_data->descriptor[active_quad_index].n_q_points);
2812 (int)n_components_ <=
2814 ExcMessage(
"You tried to construct a vector-valued evaluator with " +
2816 "the current base element has only " +
2818 +
" components left when starting from local element index " +
2829 template <
int dim,
int n_components_,
typename Number,
bool is_face>
2830 template <
int n_components_other>
2837 const unsigned int first_selected_component,
2841 quad_no (
numbers::invalid_unsigned_int),
2842 n_fe_components (n_components_),
2843 active_fe_index (
numbers::invalid_unsigned_int),
2844 active_quad_index (
numbers::invalid_unsigned_int),
2846 matrix_info (nullptr),
2848 mapping_data (nullptr),
2850 data (new
internal::MatrixFreeFunctions::ShapeInfo<
VectorizedArray<Number>> (quadrature, fe, fe.component_to_base_index(first_selected_component).first)),
2853 normal_vectors (nullptr),
2854 normal_x_jacobian (nullptr),
2855 quadrature_weights (nullptr),
2858 is_interior_face (true),
2859 dof_access_index (
internal::MatrixFreeFunctions::DoFInfo::dof_access_cell),
2860 dof_values_initialized (false),
2861 values_quad_initialized (false),
2862 gradients_quad_initialized(false),
2863 hessians_quad_initialized (false),
2864 values_quad_submitted (false),
2865 gradients_quad_submitted (false),
2868 first_selected_component (first_selected_component)
2870 set_data_pointers();
2873 if (other !=
nullptr &&
2879 (mapping, quadrature, update_flags);
2883 jacobian = mapped_geometry->get_data_storage().jacobians[0].begin();
2884 J_value = mapped_geometry->get_data_storage().JxW_values.begin();
2886 const unsigned int base_element_number =
2890 ExcMessage(
"The underlying element must at least contain as many " 2891 "components as requested by this class"));
2892 (void) base_element_number;
2897 template <
int dim,
int n_components_,
typename Number,
bool is_face>
2902 scratch_data_array (other.matrix_info == nullptr ?
2904 other.matrix_info->acquire_scratch_data()),
2905 quad_no (other.quad_no),
2906 n_fe_components (other.n_fe_components),
2907 active_fe_index (other.active_fe_index),
2908 active_quad_index (other.active_quad_index),
2909 n_quadrature_points(other.n_quadrature_points),
2910 matrix_info (other.matrix_info),
2911 dof_info (other.dof_info),
2912 mapping_data (other.mapping_data),
2913 data (other.matrix_info == nullptr ?
2918 normal_vectors (nullptr),
2919 normal_x_jacobian (nullptr),
2920 quadrature_weights (other.matrix_info == nullptr ? nullptr :
2921 mapping_data->descriptor[active_quad_index].quadrature_weights.begin()),
2922 cell (
numbers::invalid_unsigned_int),
2924 is_interior_face (other.is_interior_face),
2925 dof_access_index (other.dof_access_index),
2926 dof_values_initialized (false),
2927 values_quad_initialized (false),
2928 gradients_quad_initialized(false),
2929 hessians_quad_initialized (false),
2930 values_quad_submitted (false),
2931 gradients_quad_submitted (false),
2932 first_selected_component (other.first_selected_component)
2934 set_data_pointers();
2939 mapped_geometry.reset
2941 MappingDataOnTheFly<dim,Number>(other.
mapped_geometry->get_fe_values().get_mapping(),
2944 mapping_data = &mapped_geometry->get_data_storage();
2947 jacobian = mapped_geometry->get_data_storage().jacobians[0].begin();
2948 J_value = mapped_geometry->get_data_storage().JxW_values.begin();
2954 template <
int dim,
int n_components_,
typename Number,
bool is_face>
2967 if (matrix_info ==
nullptr)
2970 delete scratch_data_array;
2990 set_data_pointers();
2992 quadrature_weights = (mapping_data !=
nullptr ?
2993 mapping_data->descriptor[active_quad_index].quadrature_weights.begin()
3004 mapped_geometry.reset
3006 MappingDataOnTheFly<dim,Number>(other.
mapped_geometry->get_fe_values().get_mapping(),
3010 mapping_data = &mapped_geometry->get_data_storage();
3011 jacobian = mapped_geometry->get_data_storage().jacobians[0].begin();
3012 J_value = mapped_geometry->get_data_storage().JxW_values.begin();
3020 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3024 if (matrix_info !=
nullptr)
3035 delete scratch_data_array;
3039 scratch_data_array =
nullptr;
3044 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3052 const unsigned int tensor_dofs_per_component =
3053 Utilities::fixed_power<dim>(this->data->
fe_degree+1);
3057 const unsigned int shift = std::max(tensor_dofs_per_component+1, dofs_per_component)*
3058 n_components_*3 + 2 * n_quadrature_points;
3059 const unsigned int allocated_size = shift + n_components_ * dofs_per_component
3060 + (n_components_*(dim*dim+2*dim+1)*n_quadrature_points);
3061 scratch_data_array->resize_fast(allocated_size);
3064 for (
unsigned int c=0; c<n_components_; ++c)
3066 this->values_dofs[c] = scratch_data_array->begin() + c*dofs_per_component;
3067 this->values_quad[c] = scratch_data_array->begin() +
3069 for (
unsigned int d=0;
d<dim; ++
d)
3070 this->gradients_quad[c][d] = scratch_data_array->begin() +
3071 n_components*(dofs_per_component+n_quadrature_points) +
3072 (c*dim+d)*n_quadrature_points;
3073 for (
unsigned int d=0;
d<(dim*dim+dim)/2; ++
d)
3074 this->hessians_quad[c][d] = scratch_data_array->begin() +
3075 n_components*((dim+1)*n_quadrature_points + dofs_per_component) +
3076 (c*(dim*dim+dim)+d)*n_quadrature_points;
3078 scratch_data = scratch_data_array->begin() + n_components_ * dofs_per_component
3079 + (n_components_*(dim*dim+2*dim+1)*n_quadrature_points);
3084 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3090 return get_mapping_data_index_offset();
3095 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3101 if (matrix_info == 0)
3106 return this->mapping_data->data_index_offsets[cell];
3112 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3123 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3134 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3145 for (
unsigned int q=0; q<this->n_quadrature_points; ++q)
3146 JxW_values[q] = J * this->quadrature_weights[q];
3149 for (
unsigned int q=0; q<n_quadrature_points; ++q)
3150 JxW_values[q] = J_value[q];
3155 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3156 inline DEAL_II_ALWAYS_INLINE
3164 return normal_vectors[0];
3166 return normal_vectors[q_index];
3171 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3172 inline DEAL_II_ALWAYS_INLINE
3181 return J_value[0] * this->quadrature_weights[q_index];
3184 return J_value[q_index];
3189 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3200 return jacobian[q_index];
3205 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3216 const unsigned int *cells =
3220 for (
unsigned int i=0; i<VectorizedArray<Number>::n_array_elements; ++i)
3234 template <
typename VectorType>
3236 typename VectorType::value_type &
3237 vector_access (VectorType &vec,
3238 const unsigned int entry)
3248 template <
typename Number>
3252 const unsigned int entry)
3262 template <
typename VectorType>
3264 void check_vector_compatibility (
const VectorType &vec,
3274 template <
typename Number>
3282 ExcMessage(
"The parallel layout of the given vector is not " 3283 "compatible with the parallel partitioning in MatrixFree. " 3284 "Use MatrixFree::initialize_dof_vector to get a " 3285 "compatible vector."));
3289 template <
typename Number>
3292 template <
typename VectorType>
3293 void process_dof (
const unsigned int index,
3297 res = vector_access (vec, index);
3300 template <
typename VectorType>
3301 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3302 const unsigned int *dof_indices,
3305 std::integral_constant<bool,true>)
const 3307 ::vectorized_load_and_transpose(dofs_per_cell, vec.begin(),
3308 dof_indices, dof_values);
3312 template <
typename VectorType>
3313 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3314 const unsigned int *dof_indices,
3317 std::integral_constant<bool,false>)
const 3319 for (
unsigned int d=0;
d<dofs_per_cell; ++
d)
3320 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3321 dof_values[d][v] = vector_access(vec, dof_indices[v]+d);
3326 template <
typename VectorType>
3327 void process_dof_gather (
const unsigned int *indices,
3329 const unsigned int constant_offset,
3331 std::integral_constant<bool, true>)
const 3333 res.
gather(vec.begin()+constant_offset, indices);
3338 template <
typename VectorType>
3339 void process_dof_gather (
const unsigned int *indices,
3341 const unsigned int constant_offset,
3343 std::integral_constant<bool, false>)
const 3345 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3346 res[v] = vector_access(vec, indices[v]+constant_offset);
3349 template <
typename VectorType>
3354 res =
const_cast<const VectorType &
>(vec)(index);
3357 void pre_constraints (
const Number &,
3363 template <
typename VectorType>
3364 void process_constraint (
const unsigned int index,
3365 const Number weight,
3369 res += weight * vector_access (vec, index);
3372 void post_constraints (
const Number &sum,
3373 Number &write_pos)
const 3385 template <
typename Number>
3386 struct VectorDistributorLocalToGlobal
3388 template <
typename VectorType>
3389 void process_dof (
const unsigned int index,
3393 vector_access (vec, index) += res;
3396 template <
typename VectorType>
3397 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3398 const unsigned int *dof_indices,
3401 std::integral_constant<bool,true>)
const 3403 vectorized_transpose_and_store(
true, dofs_per_cell, dof_values,
3404 dof_indices, vec.begin());
3407 template <
typename VectorType>
3408 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3409 const unsigned int *dof_indices,
3412 std::integral_constant<bool,false>)
const 3414 for (
unsigned int d=0;
d<dofs_per_cell; ++
d)
3415 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3416 vector_access(vec, dof_indices[v]+d) += dof_values[
d][v];
3421 template <
typename VectorType>
3422 void process_dof_gather (
const unsigned int *indices,
3424 const unsigned int constant_offset,
3426 std::integral_constant<bool, true>)
const 3428 #if DEAL_II_COMPILER_VECTORIZATION_LEVEL < 3 3429 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3430 vector_access(vec, indices[v]+constant_offset) += res[v];
3434 tmp.
gather(vec.begin()+constant_offset, indices);
3436 tmp.
scatter(indices, vec.begin()+constant_offset);
3442 template <
typename VectorType>
3443 void process_dof_gather (
const unsigned int *indices,
3445 const unsigned int constant_offset,
3447 std::integral_constant<bool, false>)
const 3449 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3450 vector_access(vec, indices[v]+constant_offset) += res[v];
3453 template <
typename VectorType>
3461 void pre_constraints (
const Number &input,
3467 template <
typename VectorType>
3468 void process_constraint (
const unsigned int index,
3469 const Number weight,
3473 vector_access (vec, index) += weight * res;
3476 void post_constraints (
const Number &,
3488 template <
typename Number>
3491 template <
typename VectorType>
3492 void process_dof (
const unsigned int index,
3496 vector_access (vec, index) = res;
3499 template <
typename VectorType>
3500 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3501 const unsigned int *dof_indices,
3504 std::integral_constant<bool,true>)
const 3506 vectorized_transpose_and_store(
false, dofs_per_cell, dof_values,
3507 dof_indices, vec.begin());
3510 template <
typename VectorType,
bool booltype>
3511 void process_dofs_vectorized_transpose (
const unsigned int dofs_per_cell,
3512 const unsigned int *dof_indices,
3515 std::integral_constant<bool,false>)
const 3517 for (
unsigned int i=0; i<dofs_per_cell; ++i)
3518 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3519 vector_access(vec, dof_indices[v]+i) = dof_values[i][v];
3522 template <
typename VectorType>
3523 void process_dof_gather (
const unsigned int *indices,
3525 const unsigned int constant_offset,
3527 std::integral_constant<bool, true>)
const 3529 res.
scatter(indices, vec.begin()+constant_offset);
3532 template <
typename VectorType>
3533 void process_dof_gather (
const unsigned int *indices,
3535 const unsigned int constant_offset,
3537 std::integral_constant<bool, false>)
const 3539 for (
unsigned int v=0; v<VectorizedArray<Number>::n_array_elements; ++v)
3540 vector_access(vec, indices[v]+constant_offset) = res[v];
3543 template <
typename VectorType>
3551 void pre_constraints (
const Number &,
3556 template <
typename VectorType>
3557 void process_constraint (
const unsigned int,
3564 void post_constraints (
const Number &,
3577 template <
typename VectorType,
bool>
3578 struct BlockVectorSelector {};
3580 template <
typename VectorType>
3581 struct BlockVectorSelector<VectorType,true>
3583 typedef typename VectorType::BlockType BaseVectorType;
3585 static BaseVectorType *get_vector_component (VectorType &vec,
3586 const unsigned int component)
3589 return &vec.block(component);
3593 template <
typename VectorType>
3594 struct BlockVectorSelector<VectorType,false>
3596 typedef VectorType BaseVectorType;
3598 static BaseVectorType *get_vector_component (VectorType &vec,
3599 const unsigned int component)
3618 template <
typename VectorType>
3619 struct BlockVectorSelector<
std::vector<VectorType>,false>
3621 typedef VectorType BaseVectorType;
3623 static BaseVectorType *get_vector_component (std::vector<VectorType> &vec,
3624 const unsigned int component)
3627 return &vec[component];
3631 template <
typename VectorType>
3632 struct BlockVectorSelector<
std::vector<VectorType *>,false>
3634 typedef VectorType BaseVectorType;
3636 static BaseVectorType *get_vector_component (std::vector<VectorType *> &vec,
3637 const unsigned int component)
3640 return vec[component];
3647 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3648 template <
typename VectorType,
typename VectorOperation>
3654 const bool apply_constraints)
const 3659 if (matrix_info ==
nullptr)
3661 read_write_operation_global(operation, src);
3668 if (n_fe_components == 1)
3670 internal::check_vector_compatibility (*src[comp], *dof_info);
3673 internal::check_vector_compatibility (*src[0], *dof_info);
3684 read_write_operation_contiguous(operation, src);
3697 const unsigned int *dof_indices =
3699 dof_info->
row_starts[cell*n_fe_components*n_vectorization].first+
3702 for (
unsigned int i=0; i<dofs_per_component; ++i, dof_indices += n_vectorization)
3704 operation.process_dof_gather (dof_indices, *src[comp], 0,
3705 values_dofs[comp][i],
3706 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
3709 for (
unsigned int i=0; i<dofs_per_component; ++i, dof_indices += n_vectorization)
3710 operation.process_dof_gather (dof_indices,
3711 *src[0], 0, values_dofs[comp][i],
3712 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
3716 const unsigned int *dof_indices[n_vectorization];
3720 unsigned int cells_copied[n_vectorization];
3721 const unsigned int *cells;
3722 unsigned int n_vectorization_actual =
3724 bool has_constraints =
false;
3728 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3737 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3740 has_constraints = has_constraints &&
3742 dof_info->
row_starts[cells[v]*n_fe_components+first_selected_component].second;
3744 dof_info->
row_starts[cells[v]*n_fe_components+first_selected_component].first;
3746 for (
unsigned int v=n_vectorization_actual; v<n_vectorization; ++v)
3747 dof_indices[v] =
nullptr;
3752 const unsigned int n_components_read = n_fe_components > 1 ?
n_components : 1;
3753 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3755 if (dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+n_components_read].second !=
3756 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].second)
3757 has_constraints =
true;
3758 Assert(dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+n_components_read].first ==
3759 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first ||
3760 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first <
3762 ExcIndexRange(0, dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first,
3765 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].first;
3767 for (
unsigned int v=n_vectorization_actual; v<n_vectorization; ++v)
3768 dof_indices[v] =
nullptr;
3773 if (!has_constraints)
3775 if (n_vectorization_actual < n_vectorization)
3777 for (
unsigned int i=0; i<dofs_per_component; ++i)
3778 operation.process_empty(values_dofs[comp][i]);
3781 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3782 for (
unsigned int i=0; i<dofs_per_component; ++i)
3784 operation.process_dof (dof_indices[v][i], *src[comp],
3785 values_dofs[comp][i][v]);
3790 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3791 for (
unsigned int i=0; i<dofs_per_component; ++i)
3792 operation.process_dof (dof_indices[v][comp*dofs_per_component+i],
3793 *src[0], values_dofs[comp][i][v]);
3803 if (n_vectorization_actual < n_vectorization)
3805 for (
unsigned int i=0; i<dofs_per_component; ++i)
3806 operation.process_empty(values_dofs[comp][i]);
3807 for (
unsigned int v=0; v<n_vectorization_actual; ++v)
3809 unsigned int index_indicators, next_index_indicators;
3810 const unsigned int n_components_read = n_fe_components > 1 ?
n_components : 1;
3813 index_indicators = dof_info->
row_starts[cells[v]*n_fe_components+first_selected_component].second;
3814 next_index_indicators = dof_info->
row_starts[cells[v]*n_fe_components+first_selected_component+1].second;
3818 index_indicators = dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].second;
3819 next_index_indicators = dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+1].second;
3822 if (apply_constraints ==
false &&
3823 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component].second !=
3824 dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+n_components_read].second)
3835 next_index_indicators = index_indicators;
3841 Assert(src[c] !=
nullptr,
3842 ExcMessage(
"The finite element underlying this FEEvaluation " 3843 "object is scalar, but you requested " +
3845 " components via the template argument in " 3846 "FEEvaluation. In that case, you must pass an " 3847 "std::vector<VectorType> or a BlockVector to " +
3848 "read_dof_values and distribute_local_to_global."));
3850 unsigned int ind_local = 0;
3851 for ( ; index_indicators != next_index_indicators; ++index_indicators)
3853 const std::pair<unsigned short,unsigned short> indicator =
3856 for (
unsigned int j=0; j<indicator.first; ++j)
3858 operation.process_dof (dof_indices[v][j], *src[comp],
3859 values_dofs[comp][ind_local+j][v]);
3861 ind_local += indicator.first;
3862 dof_indices[v] += indicator.first;
3868 operation.pre_constraints (values_dofs[comp][ind_local][v],
3871 const Number *data_val =
3873 const Number *end_pool =
3875 for ( ; data_val != end_pool; ++data_val, ++dof_indices[v])
3877 operation.process_constraint (*dof_indices[v], *data_val,
3878 *src[comp], value[comp]);
3881 operation.post_constraints (value[comp],
3882 values_dofs[comp][ind_local][v]);
3888 for (; ind_local < dofs_per_component; ++dof_indices[v], ++ind_local)
3890 operation.process_dof (*dof_indices[v], *src[comp],
3891 values_dofs[comp][ind_local][v]);
3902 unsigned int ind_local = 0;
3905 for ( ; index_indicators != next_index_indicators; ++index_indicators)
3907 const std::pair<unsigned short,unsigned short> indicator =
3911 for (
unsigned int j=0; j<indicator.first; ++j)
3912 operation.process_dof (dof_indices[v][j], *src[0],
3913 values_dofs[comp][ind_local+j][v]);
3914 ind_local += indicator.first;
3915 dof_indices[v] += indicator.first;
3920 operation.pre_constraints (values_dofs[comp][ind_local][v], value);
3922 const Number *data_val =
3924 const Number *end_pool =
3927 for ( ; data_val != end_pool; ++data_val, ++dof_indices[v])
3928 operation.process_constraint (*dof_indices[v], *data_val,
3931 operation.post_constraints (value, values_dofs[comp][ind_local][v]);
3938 for (; ind_local<dofs_per_component; ++dof_indices[v], ++ind_local)
3941 operation.process_dof (*dof_indices[v], *src[0],
3942 values_dofs[comp][ind_local][v]);
3945 if (apply_constraints ==
true)
3948 next_index_indicators = dof_info->
row_starts[cells[v]*n_fe_components+first_selected_component+comp+2].second;
3950 next_index_indicators = dof_info->
row_starts[(cell*n_vectorization+v)*n_fe_components+first_selected_component+comp+2].second;
3959 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3960 template <
typename VectorType,
typename VectorOperation>
3965 VectorType *src[])
const 3974 operation.process_empty(values_dofs[comp][i]);
3976 *src[0], values_dofs[comp][i][0]);
3983 template <
int dim,
int n_components_,
typename Number,
bool is_face>
3984 template <
typename VectorType,
typename VectorOperation>
3989 VectorType *src[])
const 3998 std::integral_constant<bool,std::is_same<typename VectorType::value_type,Number>::value>
4003 const std::vector<unsigned int> &dof_indices_cont
4005 const unsigned int vectorization_populated =
4008 for (
unsigned int v=0; v<vectorization_populated; ++v)
4011 for (
unsigned int v=vectorization_populated; v<VectorizedArray<Number>::n_array_elements; ++v)
4022 *src[comp], values_dofs[comp],
4027 dof_indices, *src[0],
4035 operation.process_empty(values_dofs[comp][i]);
4037 for (
unsigned int v=0; v<vectorization_populated; ++v)
4039 operation.process_dof (dof_indices[v]+i, *src[comp],
4040 values_dofs[comp][i][v]);
4042 for (
unsigned int v=0; v<vectorization_populated; ++v)
4045 *src[0], values_dofs[comp][i][v]);
4051 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4052 template <
typename VectorType>
4057 const unsigned int first_index)
4061 typename internal::BlockVectorSelector<VectorType,
4064 src_data[d] = internal::BlockVectorSelector<VectorType,
IsBlockVector<VectorType>::value>::get_vector_component(const_cast<VectorType &>(src), d+first_index);
4066 internal::VectorReader<Number> reader;
4067 read_write_operation (reader, src_data,
true);
4070 dof_values_initialized =
true;
4076 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4077 template <
typename VectorType>
4082 const unsigned int first_index)
4086 typename internal::BlockVectorSelector<VectorType,
4089 src_data[d] = internal::BlockVectorSelector<VectorType,
IsBlockVector<VectorType>::value>::get_vector_component(const_cast<VectorType &>(src), d+first_index);
4091 internal::VectorReader<Number> reader;
4092 read_write_operation (reader, src_data,
false);
4095 dof_values_initialized =
true;
4101 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4102 template <
typename VectorType>
4107 const unsigned int first_index)
const 4109 Assert (dof_values_initialized==
true,
4114 typename internal::BlockVectorSelector<VectorType,
4119 internal::VectorDistributorLocalToGlobal<Number> distributor;
4120 read_write_operation (distributor, dst_data);
4125 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4126 template <
typename VectorType>
4131 const unsigned int first_index)
const 4133 Assert (dof_values_initialized==
true,
4138 typename internal::BlockVectorSelector<VectorType,
4143 internal::VectorSetter<Number> setter;
4144 read_write_operation (setter, dst_data);
4152 template <
int dim,
int n_components,
typename Number,
bool is_face>
4154 const std::vector<unsigned int> &
4163 template <
int dim,
int n_components,
typename Number,
bool is_face>
4170 scratch_data_array->end()-
4176 template <
int dim,
int n_components,
typename Number,
bool is_face>
4182 return &values_dofs[0][0];
4187 template <
int dim,
int n_components,
typename Number,
bool is_face>
4194 dof_values_initialized =
true;
4196 return &values_dofs[0][0];
4201 template <
int dim,
int n_components,
typename Number,
bool is_face>
4207 Assert (values_quad_initialized || values_quad_submitted,
4209 return &values_quad[0][0];
4214 template <
int dim,
int n_components,
typename Number,
bool is_face>
4221 values_quad_initialized =
true;
4222 values_quad_submitted =
true;
4224 return &values_quad[0][0];
4229 template <
int dim,
int n_components,
typename Number,
bool is_face>
4235 Assert (gradients_quad_initialized || gradients_quad_submitted,
4237 return &gradients_quad[0][0][0];
4242 template <
int dim,
int n_components,
typename Number,
bool is_face>
4249 gradients_quad_submitted =
true;
4250 gradients_quad_initialized =
true;
4252 return &gradients_quad[0][0][0];
4257 template <
int dim,
int n_components,
typename Number,
bool is_face>
4264 return &hessians_quad[0][0][0];
4269 template <
int dim,
int n_components,
typename Number,
bool is_face>
4276 hessians_quad_initialized =
true;
4278 return &hessians_quad[0][0][0];
4283 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4284 inline DEAL_II_ALWAYS_INLINE
4292 return_value[comp] = this->values_dofs[comp][dof];
4293 return return_value;
4298 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4299 inline DEAL_II_ALWAYS_INLINE
4304 Assert (this->values_quad_initialized==
true,
4309 return_value[comp] = this->values_quad[comp][q_point];
4310 return return_value;
4315 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4316 inline DEAL_II_ALWAYS_INLINE
4321 Assert (this->gradients_quad_initialized==
true,
4333 for (
unsigned int d=0;
d<dim; ++
d)
4334 grad_out[comp][d] = (this->gradients_quad[comp][d][q_point] *
4343 for (
unsigned int d=0;
d<dim; ++
d)
4345 grad_out[comp][
d] = jac[
d][0] *
4346 this->gradients_quad[comp][0][q_point];
4347 for (
unsigned int e=1;
e<dim; ++
e)
4348 grad_out[comp][d] += jac[d][e] *
4349 this->gradients_quad[comp][e][q_point];
4357 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4358 inline DEAL_II_ALWAYS_INLINE
4364 Assert (this->gradients_quad_initialized==
true,
4372 grad_out[comp] = this->gradients_quad[comp][dim-1][q_point] *
4373 (this->normal_x_jacobian[0][dim-1]);
4376 const unsigned int index =
4380 grad_out[comp] = this->gradients_quad[comp][0][q_point] *
4381 this->normal_x_jacobian[index][0];
4382 for (
unsigned int d=1;
d<dim; ++
d)
4383 grad_out[comp] += this->gradients_quad[comp][d][q_point] *
4384 this->normal_x_jacobian[index][d];
4396 template <
typename Number>
4401 const unsigned int q_point,
4404 tmp[0][0] = jac[0][0] * hessians_quad[0][q_point];
4407 template <
typename Number>
4412 const unsigned int q_point,
4415 for (
unsigned int d=0;
d<2; ++
d)
4417 tmp[0][
d] = (jac[
d][0] * hessians_quad[0][q_point] +
4418 jac[
d][1] * hessians_quad[2][q_point]);
4419 tmp[1][
d] = (jac[
d][0] * hessians_quad[2][q_point] +
4420 jac[
d][1] * hessians_quad[1][q_point]);
4424 template <
typename Number>
4429 const unsigned int q_point,
4432 for (
unsigned int d=0;
d<3; ++
d)
4434 tmp[0][
d] = (jac[
d][0] * hessians_quad[0][q_point] +
4435 jac[
d][1] * hessians_quad[3][q_point] +
4436 jac[
d][2] * hessians_quad[4][q_point]);
4437 tmp[1][
d] = (jac[
d][0] * hessians_quad[3][q_point] +
4438 jac[
d][1] * hessians_quad[1][q_point] +
4439 jac[
d][2] * hessians_quad[5][q_point]);
4440 tmp[2][
d] = (jac[
d][0] * hessians_quad[4][q_point] +
4441 jac[
d][1] * hessians_quad[5][q_point] +
4442 jac[
d][2] * hessians_quad[2][q_point]);
4449 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4456 Assert (this->hessians_quad_initialized==
true,
4470 for (
unsigned int d=0;
d<dim; ++
d)
4472 hessian_out[comp][
d][
d] = (this->hessians_quad[comp][
d][q_point] *
4473 jac[
d][
d] * jac[
d][
d]);
4479 hessian_out[comp][0][1] = (this->hessians_quad[comp][2][q_point] *
4480 jac[0][0] * jac[1][1]);
4483 hessian_out[comp][0][1] = (this->hessians_quad[comp][3][q_point] *
4484 jac[0][0] * jac[1][1]);
4485 hessian_out[comp][0][2] = (this->hessians_quad[comp][4][q_point] *
4486 jac[0][0] * jac[2][2]);
4487 hessian_out[comp][1][2] = (this->hessians_quad[comp][5][q_point] *
4488 jac[1][1] * jac[2][2]);
4493 for (
unsigned int e=d+1;
e<dim; ++
e)
4494 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4505 internal::hessian_unit_times_jac (jac, this->hessians_quad[comp],
4509 for (
unsigned int d=0;
d<dim; ++
d)
4510 for (
unsigned int e=d;
e<dim; ++
e)
4512 hessian_out[comp][
d][
e] = jac[
d][0] * tmp[0][
e];
4513 for (
unsigned int f=1; f<dim; ++f)
4514 hessian_out[comp][d][e] += jac[d][f] * tmp[f][e];
4521 for (
unsigned int d=0;
d<dim; ++
d)
4522 for (
unsigned int e=d+1;
e<dim; ++
e)
4523 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4530 mapping_data->jacobian_gradients[1-this->is_interior_face][this->mapping_data->data_index_offsets[this->cell]+q_point];
4536 internal::hessian_unit_times_jac (jac, this->hessians_quad[comp],
4540 for (
unsigned int d=0;
d<dim; ++
d)
4541 for (
unsigned int e=d;
e<dim; ++
e)
4543 hessian_out[comp][
d][
e] = jac[
d][0] * tmp[0][
e];
4544 for (
unsigned int f=1; f<dim; ++f)
4545 hessian_out[comp][d][e] += jac[d][f] * tmp[f][e];
4549 for (
unsigned int d=0;
d<dim; ++
d)
4550 for (
unsigned int e=0;
e<dim; ++
e)
4551 hessian_out[comp][d][d] += (jac_grad[d][e] *
4552 this->gradients_quad[comp][e][q_point]);
4555 for (
unsigned int d=0, count=dim;
d<dim; ++
d)
4556 for (
unsigned int e=d+1;
e<dim; ++
e, ++count)
4557 for (
unsigned int f=0; f<dim; ++f)
4558 hessian_out[comp][d][e] += (jac_grad[count][f] *
4559 this->gradients_quad[comp][f][q_point]);
4562 for (
unsigned int d=0;
d<dim; ++
d)
4563 for (
unsigned int e=d+1;
e<dim; ++
e)
4564 hessian_out[comp][e][d] = hessian_out[comp][d][e];
4572 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4579 Assert (this->hessians_quad_initialized==
true,
4593 for (
unsigned int d=0;
d<dim; ++
d)
4594 hessian_out[comp][d] = (this->hessians_quad[comp][d][q_point] *
4595 jac[d][d] * jac[d][d]);
4605 internal::hessian_unit_times_jac (jac, this->hessians_quad[comp],
4610 for (
unsigned int d=0;
d<dim; ++
d)
4612 hessian_out[comp][
d] = jac[
d][0] * tmp[0][
d];
4613 for (
unsigned int f=1; f<dim; ++f)
4614 hessian_out[comp][d] += jac[d][f] * tmp[f][d];
4622 mapping_data->jacobian_gradients[0][this->mapping_data->data_index_offsets[this->cell]+q_point];
4628 internal::hessian_unit_times_jac (jac, this->hessians_quad[comp],
4633 for (
unsigned int d=0;
d<dim; ++
d)
4635 hessian_out[comp][
d] = jac[
d][0] * tmp[0][
d];
4636 for (
unsigned int f=1; f<dim; ++f)
4637 hessian_out[comp][d] += jac[d][f] * tmp[f][d];
4640 for (
unsigned int d=0;
d<dim; ++
d)
4641 for (
unsigned int e=0;
e<dim; ++
e)
4642 hessian_out[comp][d] += (jac_grad[d][e] *
4643 this->gradients_quad[comp][e][q_point]);
4651 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4658 Assert (this->hessians_quad_initialized==
true,
4664 = get_hessian_diagonal(q_point);
4667 laplacian_out[comp] = hess_diag[comp][0];
4668 for (
unsigned int d=1;
d<dim; ++
d)
4669 laplacian_out[comp] += hess_diag[comp][d];
4671 return laplacian_out;
4676 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4677 inline DEAL_II_ALWAYS_INLINE
4681 const unsigned int dof)
4684 this->dof_values_initialized =
true;
4688 this->values_dofs[comp][dof] = val_in[comp];
4693 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4694 inline DEAL_II_ALWAYS_INLINE
4698 const unsigned int q_point)
4704 this->values_quad_submitted =
true;
4711 this->values_quad[comp][q_point] = val_in[comp] * JxW;
4717 this->values_quad[comp][q_point] = val_in[comp] * JxW;
4723 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4724 inline DEAL_II_ALWAYS_INLINE
4729 const unsigned int q_point)
4734 this->gradients_quad_submitted =
true;
4743 for (
unsigned int d=0;
d<dim; ++
d)
4744 this->gradients_quad[comp][d][q_point] = (grad_in[comp][d] *
4745 jacobian[0][d][d] * JxW);
4751 jacobian[q_point] : jacobian[0];
4754 J_value[q_point] : J_value[0] * quadrature_weights[q_point];
4756 for (
unsigned int d=0;
d<dim; ++
d)
4759 for (
unsigned int e=1;
e<dim; ++
e)
4760 new_val += (jac[e][d] * grad_in[comp][e]);
4761 this->gradients_quad[comp][
d][q_point] = new_val * JxW;
4768 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4769 inline DEAL_II_ALWAYS_INLINE
4773 const unsigned int q_point)
4777 this->gradients_quad_submitted =
true;
4784 for (
unsigned int d=0;
d<dim-1; ++
d)
4786 this->gradients_quad[comp][dim-1][q_point] =
4787 grad_in[comp] * (this->normal_x_jacobian[0][dim-1] *
4788 this->J_value[0] * this->quadrature_weights[q_point]);
4792 const unsigned int index =
4797 this->J_value[index];
4799 factor = factor * this->quadrature_weights[q_point];
4800 for (
unsigned int d=0;
d<dim; ++
d)
4801 this->gradients_quad[comp][d][q_point] = factor *
4802 this->normal_x_jacobian[index][d];
4810 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4818 Assert (this->values_quad_submitted ==
true,
4823 return_value[comp] = this->values_quad[comp][0];
4824 const unsigned int n_q_points = this->n_quadrature_points;
4825 for (
unsigned int q=1; q<n_q_points; ++q)
4827 return_value[comp] += this->values_quad[comp][q];
4828 return (return_value);
4836 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4840 const unsigned int dof_no,
4841 const unsigned int first_selected_component,
4842 const unsigned int quad_no_in,
4843 const unsigned int fe_degree,
4844 const unsigned int n_q_points,
4845 const bool is_interior_face)
4848 (data_in, dof_no, first_selected_component, quad_no_in, fe_degree, n_q_points,
4854 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4855 template <
int n_components_other>
4862 const unsigned int first_selected_component,
4865 FEEvaluationBase <dim,n_components_,Number,is_face>(mapping, fe, quadrature, update_flags,
4866 first_selected_component, other)
4871 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4881 template <
int dim,
int n_components_,
typename Number,
bool is_face>
4896 template <
int dim,
typename Number,
bool is_face>
4900 const unsigned int dof_no,
4901 const unsigned int first_selected_component,
4902 const unsigned int quad_no_in,
4903 const unsigned int fe_degree,
4904 const unsigned int n_q_points,
4905 const bool is_interior_face)
4908 (data_in, dof_no, first_selected_component, quad_no_in, fe_degree, n_q_points,
4914 template <
int dim,
typename Number,
bool is_face>
4915 template <
int n_components_other>
4922 const unsigned int first_selected_component,
4925 FEEvaluationBase <dim,1,Number,is_face> (mapping, fe, quadrature, update_flags,
4926 first_selected_component, other)
4931 template <
int dim,
typename Number,
bool is_face>
4941 template <
int dim,
typename Number,
bool is_face>
4953 template <
int dim,
typename Number,
bool is_face>
4954 inline DEAL_II_ALWAYS_INLINE
4960 return this->values_dofs[0][dof];
4965 template <
int dim,
typename Number,
bool is_face>
4966 inline DEAL_II_ALWAYS_INLINE
4971 Assert (this->values_quad_initialized==
true,
4974 return this->values_quad[0][q_point];
4979 template <
int dim,
typename Number,
bool is_face>
4980 inline DEAL_II_ALWAYS_INLINE
4985 return BaseClass::get_normal_derivative(q_point)[0];
4990 template <
int dim,
typename Number,
bool is_face>
4991 inline DEAL_II_ALWAYS_INLINE
4999 Assert (this->gradients_quad_initialized==
true,
5009 for (
unsigned int d=0;
d<dim; ++
d)
5010 grad_out[d] = (this->gradients_quad[0][d][q_point] *
5011 this->jacobian[0][d][d]);
5019 for (
unsigned int d=0;
d<dim; ++
d)
5021 grad_out[
d] = jac[
d][0] * this->gradients_quad[0][0][q_point];
5022 for (
unsigned int e=1;
e<dim; ++
e)
5023 grad_out[d] += jac[d][e] * this->gradients_quad[0][e][q_point];
5031 template <
int dim,
typename Number,
bool is_face>
5037 return BaseClass::get_hessian(q_point)[0];
5042 template <
int dim,
typename Number,
bool is_face>
5048 return BaseClass::get_hessian_diagonal(q_point)[0];
5053 template <
int dim,
typename Number,
bool is_face>
5059 return BaseClass::get_laplacian(q_point)[0];
5064 template <
int dim,
typename Number,
bool is_face>
5066 void DEAL_II_ALWAYS_INLINE
5069 const unsigned int dof)
5072 this->dof_values_initialized =
true;
5075 this->values_dofs[0][dof] = val_in;
5080 template <
int dim,
typename Number,
bool is_face>
5082 void DEAL_II_ALWAYS_INLINE
5085 const unsigned int q_index)
5091 this->values_quad_submitted =
true;
5096 this->values_quad[0][q_index] = val_in * JxW;
5100 this->values_quad[0][q_index] = val_in * this->J_value[q_index];
5106 template <
int dim,
typename Number,
bool is_face>
5107 inline DEAL_II_ALWAYS_INLINE
5111 const unsigned int q_point)
5113 submit_value(val_in[0], q_point);
5118 template <
int dim,
typename Number,
bool is_face>
5119 inline DEAL_II_ALWAYS_INLINE
5123 const unsigned int q_point)
5127 BaseClass::submit_normal_derivative(grad, q_point);
5132 template <
int dim,
typename Number,
bool is_face>
5133 inline DEAL_II_ALWAYS_INLINE
5137 const unsigned int q_index)
5142 this->gradients_quad_submitted =
true;
5150 this->quadrature_weights[q_index];
5151 for (
unsigned int d=0;
d<dim; ++
d)
5152 this->gradients_quad[0][d][q_index] = (grad_in[d] *
5153 this->jacobian[0][d][d] *
5161 this->jacobian[q_index] : this->jacobian[0];
5164 this->J_value[q_index] : this->J_value[0] * this->quadrature_weights[q_index];
5165 for (
unsigned int d=0;
d<dim; ++
d)
5168 for (
unsigned int e=1;
e<dim; ++
e)
5169 new_val += jac[e][d] * grad_in[e];
5170 this->gradients_quad[0][
d][q_index] = new_val * JxW;
5177 template <
int dim,
typename Number,
bool is_face>
5183 return BaseClass::integrate_value()[0];
5192 template <
int dim,
typename Number,
bool is_face>
5196 const unsigned int dof_no,
5197 const unsigned int first_selected_component,
5198 const unsigned int quad_no_in,
5199 const unsigned int fe_degree,
5200 const unsigned int n_q_points,
5201 const bool is_interior_face)
5204 (data_in, dof_no, first_selected_component, quad_no_in, fe_degree, n_q_points,
5210 template <
int dim,
typename Number,
bool is_face>
5211 template <
int n_components_other>
5218 const unsigned int first_selected_component,
5221 FEEvaluationBase <dim,dim,Number,is_face> (mapping, fe, quadrature, update_flags,
5222 first_selected_component, other)
5227 template <
int dim,
typename Number,
bool is_face>
5237 template <
int dim,
typename Number,
bool is_face>
5249 template <
int dim,
typename Number,
bool is_face>
5250 inline DEAL_II_ALWAYS_INLINE
5255 return BaseClass::get_gradient (q_point);
5260 template <
int dim,
typename Number,
bool is_face>
5261 inline DEAL_II_ALWAYS_INLINE
5266 Assert (this->gradients_quad_initialized==
true,
5276 divergence = (this->gradients_quad[0][0][q_point] *
5277 this->jacobian[0][0][0]);
5278 for (
unsigned int d=1;
d<dim; ++
d)
5279 divergence += (this->gradients_quad[d][d][q_point] *
5280 this->jacobian[0][d][d]);
5287 this->jacobian[q_point] : this->jacobian[0];
5288 divergence = (jac[0][0] * this->gradients_quad[0][0][q_point]);
5289 for (
unsigned int e=1;
e<dim; ++
e)
5290 divergence += (jac[0][e] * this->gradients_quad[0][e][q_point]);
5291 for (
unsigned int d=1;
d<dim; ++
d)
5292 for (
unsigned int e=0;
e<dim; ++
e)
5293 divergence += (jac[d][e] * this->gradients_quad[d][e][q_point]);
5300 template <
int dim,
typename Number,
bool is_face>
5301 inline DEAL_II_ALWAYS_INLINE
5310 for (
unsigned int d=0;
d<dim; ++
d)
5311 symmetrized[d] = grad[d][d];
5317 symmetrized[2] = grad[0][1] + grad[1][0];
5318 symmetrized[2] *= half;
5321 symmetrized[3] = grad[0][1] + grad[1][0];
5322 symmetrized[3] *= half;
5323 symmetrized[4] = grad[0][2] + grad[2][0];
5324 symmetrized[4] *= half;
5325 symmetrized[5] = grad[1][2] + grad[2][1];
5326 symmetrized[5] *= half;
5336 template <
int dim,
typename Number,
bool is_face>
5337 inline DEAL_II_ALWAYS_INLINE
5340 ::get_curl (
const unsigned int q_point)
const 5349 ExcMessage(
"Computing the curl in 1d is not a useful operation"));
5352 curl[0] = grad[1][0] - grad[0][1];
5355 curl[0] = grad[2][1] - grad[1][2];
5356 curl[1] = grad[0][2] - grad[2][0];
5357 curl[2] = grad[1][0] - grad[0][1];
5367 template <
int dim,
typename Number,
bool is_face>
5368 inline DEAL_II_ALWAYS_INLINE
5373 return BaseClass::get_hessian_diagonal (q_point);
5378 template <
int dim,
typename Number,
bool is_face>
5379 inline DEAL_II_ALWAYS_INLINE
5384 Assert (this->hessians_quad_initialized==
true,
5387 return BaseClass::get_hessian(q_point);
5392 template <
int dim,
typename Number,
bool is_face>
5393 inline DEAL_II_ALWAYS_INLINE
5397 const unsigned int q_point)
5399 BaseClass::submit_gradient (grad_in, q_point);
5404 template <
int dim,
typename Number,
bool is_face>
5405 inline DEAL_II_ALWAYS_INLINE
5410 const unsigned int q_point)
5412 BaseClass::submit_gradient(grad_in, q_point);
5417 template <
int dim,
typename Number,
bool is_face>
5418 inline DEAL_II_ALWAYS_INLINE
5422 const unsigned int q_point)
5427 this->gradients_quad_submitted =
true;
5435 this->quadrature_weights[q_point] * div_in;
5436 for (
unsigned int d=0;
d<dim; ++
d)
5438 this->gradients_quad[
d][
d][q_point] = (fac *
5439 this->jacobian[0][
d][
d]);
5440 for (
unsigned int e=d+1;
e<dim; ++
e)
5451 this->jacobian[q_point] : this->jacobian[0];
5454 this->J_value[q_point] : this->J_value[0] *
5455 this->quadrature_weights[q_point]) * div_in;
5456 for (
unsigned int d=0;
d<dim; ++
d)
5458 for (
unsigned int e=0;
e<dim; ++
e)
5459 this->gradients_quad[d][e][q_point] = jac[d][e] * fac;
5466 template <
int dim,
typename Number,
bool is_face>
5467 inline DEAL_II_ALWAYS_INLINE
5472 const unsigned int q_point)
5480 this->gradients_quad_submitted =
true;
5488 for (
unsigned int d=0;
d<dim; ++
d)
5489 this->gradients_quad[d][d][q_point] = (sym_grad.access_raw_entry(d) *
5491 this->jacobian[0][
d][
d]);
5492 for (
unsigned int e=0, counter=dim;
e<dim; ++
e)
5493 for (
unsigned int d=e+1;
d<dim; ++
d, ++counter)
5496 this->gradients_quad[
e][
d][q_point] = (value *
5497 this->jacobian[0][
d][
d]);
5498 this->gradients_quad[
d][
e][q_point] = (value *
5499 this->jacobian[0][
e][
e]);
5507 this->J_value[q_point] : this->J_value[0] * this->quadrature_weights[q_point];
5510 this->jacobian[q_point] : this->jacobian[0];
5512 for (
unsigned int i=0; i<dim; ++i)
5513 weighted[i][i] = sym_grad.access_raw_entry(i) * JxW;
5514 for (
unsigned int i=0, counter=dim; i<dim; ++i)
5515 for (
unsigned int j=i+1; j<dim; ++j, ++counter)
5518 weighted[i][j] = value;
5519 weighted[j][i] = value;
5521 for (
unsigned int comp=0; comp<dim; ++comp)
5522 for (
unsigned int d=0;
d<dim; ++
d)
5525 for (
unsigned int e=1;
e<dim; ++
e)
5526 new_val += jac[e][d] * weighted[comp][e];
5527 this->gradients_quad[comp][
d][q_point] = new_val;
5534 template <
int dim,
typename Number,
bool is_face>
5535 inline DEAL_II_ALWAYS_INLINE
5539 const unsigned int q_point)
5546 ExcMessage(
"Testing by the curl in 1d is not a useful operation"));
5549 grad[1][0] = curl[0];
5550 grad[0][1] = -curl[0];
5553 grad[2][1] = curl[0];
5554 grad[1][2] = -curl[0];
5555 grad[0][2] = curl[1];
5556 grad[2][0] = -curl[1];
5557 grad[1][0] = curl[2];
5558 grad[0][1] = -curl[2];
5563 submit_gradient (grad, q_point);
5570 template <
typename Number,
bool is_face>
5574 const unsigned int dof_no,
5575 const unsigned int first_selected_component,
5576 const unsigned int quad_no_in,
5577 const unsigned int fe_degree,
5578 const unsigned int n_q_points,
5579 const bool is_interior_face)
5582 (data_in, dof_no, first_selected_component, quad_no_in, fe_degree, n_q_points,
5588 template <
typename Number,
bool is_face>
5589 template <
int n_components_other>
5596 const unsigned int first_selected_component,
5599 FEEvaluationBase <1,1,Number,is_face> (mapping, fe, quadrature, update_flags,
5600 first_selected_component, other)
5605 template <
typename Number,
bool is_face>
5615 template <
typename Number,
bool is_face>
5627 template <
typename Number,
bool is_face>
5628 inline DEAL_II_ALWAYS_INLINE
5634 return this->values_dofs[0][dof];
5639 template <
typename Number,
bool is_face>
5640 inline DEAL_II_ALWAYS_INLINE
5645 Assert (this->values_quad_initialized==
true,
5648 return this->values_quad[0][q_point];
5653 template <
typename Number,
bool is_face>
5654 inline DEAL_II_ALWAYS_INLINE
5662 Assert (this->gradients_quad_initialized==
true,
5668 this->jacobian[q_point] : this->jacobian[0];
5671 grad_out[0] = jac[0][0] * this->gradients_quad[0][0][q_point];
5678 template <
typename Number,
bool is_face>
5679 inline DEAL_II_ALWAYS_INLINE
5684 return BaseClass::get_normal_derivative(q_point)[0];
5689 template <
typename Number,
bool is_face>
5690 inline DEAL_II_ALWAYS_INLINE
5695 return BaseClass::get_hessian(q_point)[0];
5700 template <
typename Number,
bool is_face>
5701 inline DEAL_II_ALWAYS_INLINE
5706 return BaseClass::get_hessian_diagonal(q_point)[0];
5711 template <
typename Number,
bool is_face>
5712 inline DEAL_II_ALWAYS_INLINE
5717 return BaseClass::get_laplacian(q_point)[0];
5722 template <
typename Number,
bool is_face>
5723 inline DEAL_II_ALWAYS_INLINE
5724 void DEAL_II_ALWAYS_INLINE
5727 const unsigned int dof)
5730 this->dof_values_initialized =
true;
5733 this->values_dofs[0][dof] = val_in;
5738 template <
typename Number,
bool is_face>
5739 inline DEAL_II_ALWAYS_INLINE
5743 const unsigned int q_point)
5748 this->values_quad_submitted =
true;
5753 this->values_quad[0][q_point] = val_in * JxW;
5758 this->values_quad[0][q_point] = val_in * JxW;
5764 template <
typename Number,
bool is_face>
5765 inline DEAL_II_ALWAYS_INLINE
5769 const unsigned int q_point)
5771 submit_value(val_in[0], q_point);
5776 template <
typename Number,
bool is_face>
5777 inline DEAL_II_ALWAYS_INLINE
5781 const unsigned int q_point)
5783 submit_gradient(grad_in[0], q_point);
5788 template <
typename Number,
bool is_face>
5789 inline DEAL_II_ALWAYS_INLINE
5793 const unsigned int q_point)
5798 this->gradients_quad_submitted =
true;
5803 this->jacobian[q_point] : this->jacobian[0];
5806 this->J_value[q_point] : this->J_value[0] * this->quadrature_weights[q_point];
5808 this->gradients_quad[0][0][q_point] = jac[0][0] * grad_in * JxW;
5813 template <
typename Number,
bool is_face>
5814 inline DEAL_II_ALWAYS_INLINE
5818 const unsigned int q_point)
5822 BaseClass::submit_normal_derivative(grad, q_point);
5827 template <
typename Number,
bool is_face>
5828 inline DEAL_II_ALWAYS_INLINE
5832 const unsigned int q_point)
5834 BaseClass::submit_normal_derivative(grad_in, q_point);
5839 template <
typename Number,
bool is_face>
5845 return BaseClass::integrate_value()[0];
5854 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5859 const unsigned int fe_no,
5860 const unsigned int quad_no,
5861 const unsigned int first_selected_component)
5863 BaseClass (data_in, fe_no, first_selected_component, quad_no, fe_degree, static_n_q_points),
5864 dofs_per_component (this->data->dofs_per_component_on_cell),
5865 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
5866 n_q_points (this->data->n_q_points)
5868 check_template_arguments(fe_no, 0);
5873 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5881 const unsigned int first_selected_component)
5883 BaseClass (mapping, fe, quadrature, update_flags,
5884 first_selected_component,
5886 dofs_per_component (this->data->dofs_per_component_on_cell),
5887 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
5888 n_q_points (this->data->n_q_points)
5895 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5902 const unsigned int first_selected_component)
5904 BaseClass (
StaticMappingQ1<dim>::mapping, fe, quadrature, update_flags,
5905 first_selected_component,
5907 dofs_per_component (this->data->dofs_per_component_on_cell),
5908 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
5909 n_q_points (this->data->n_q_points)
5916 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5918 template <
int n_components_other>
5923 const unsigned int first_selected_component)
5925 BaseClass (other.mapped_geometry->get_fe_values().get_mapping(),
5926 fe, other.mapped_geometry->get_quadrature(),
5927 other.mapped_geometry->get_fe_values().get_update_flags(),
5928 first_selected_component, &other),
5929 dofs_per_component (this->data->dofs_per_component_on_cell),
5930 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
5931 n_q_points (this->data->n_q_points)
5938 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5945 dofs_per_component (this->data->dofs_per_component_on_cell),
5946 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
5947 n_q_points (this->data->n_q_points)
5954 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5961 BaseClass::operator=(other);
5968 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
5974 const unsigned int first_selected_component)
5977 (void)first_selected_component;
5983 static_cast<unsigned int>(fe_degree) != this->data->
fe_degree)
5985 n_q_points != this->n_quadrature_points)
5987 std::string message =
5988 "-------------------------------------------------------\n";
5989 message +=
"Illegal arguments in constructor/wrong template arguments!\n";
5990 message +=
" Called --> FEEvaluation<dim,";
5994 message +=
",Number>(data";
6010 if (static_cast<unsigned int>(fe_degree) == this->data->
fe_degree)
6012 proposed_dof_comp = dof_no;
6013 proposed_fe_comp = first_selected_component;
6016 for (
unsigned int no=0; no<this->matrix_info->
n_components(); ++no)
6017 for (
unsigned int nf=0; nf<this->matrix_info->
n_base_elements(no); ++nf)
6019 ==
static_cast<unsigned int>(fe_degree))
6021 proposed_dof_comp = no;
6022 proposed_fe_comp = nf;
6026 this->mapping_data->descriptor[this->active_quad_index].n_q_points)
6027 proposed_quad_comp = this->quad_no;
6029 for (
unsigned int no=0; no<this->matrix_info->get_mapping_info().cell_data.size(); ++no)
6030 if (this->matrix_info->get_mapping_info().cell_data[no].descriptor[this->active_quad_index].n_q_points
6033 proposed_quad_comp = no;
6040 if (proposed_dof_comp != first_selected_component)
6041 message +=
"Wrong vector component selection:\n";
6043 message +=
"Wrong quadrature formula selection:\n";
6044 message +=
" Did you mean FEEvaluation<dim,";
6048 message +=
",Number>(data";
6056 std::string correct_pos;
6057 if (proposed_dof_comp != dof_no)
6058 correct_pos =
" ^ ";
6061 if (proposed_quad_comp != this->quad_no)
6062 correct_pos +=
" ^ ";
6065 if (proposed_fe_comp != first_selected_component)
6066 correct_pos +=
" ^\n";
6068 correct_pos +=
" \n";
6069 message +=
" " + correct_pos;
6073 const unsigned int proposed_n_q_points_1d =
static_cast<unsigned int>(std::pow(1.001*this->n_quadrature_points,1./dim));
6074 message +=
"Wrong template arguments:\n";
6075 message +=
" Did you mean FEEvaluation<dim,";
6079 message +=
",Number>(data";
6087 std::string correct_pos;
6088 if (this->data->
fe_degree != static_cast<unsigned int>(fe_degree))
6092 if (proposed_n_q_points_1d != n_q_points_1d)
6093 correct_pos +=
" ^\n";
6095 correct_pos +=
" \n";
6096 message +=
" " + correct_pos;
6098 Assert (static_cast<unsigned int>(fe_degree) == this->data->
fe_degree &&
6099 n_q_points == this->n_quadrature_points,
6104 this->mapping_data->descriptor[this->active_quad_index].n_q_points);
6110 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6115 ::reinit (
const unsigned int cell_index)
6117 Assert (this->mapped_geometry ==
nullptr,
6118 ExcMessage(
"FEEvaluation was initialized without a matrix-free object." 6119 " Integer indexing is not possible"));
6120 if (this->mapped_geometry !=
nullptr)
6125 this->cell = cell_index;
6126 this->cell_type = this->matrix_info->get_mapping_info().get_cell_type(cell_index);
6128 const unsigned int offsets = this->mapping_data->data_index_offsets[cell_index];
6129 this->jacobian = &this->mapping_data->jacobians[0][offsets];
6130 this->J_value = &this->mapping_data->JxW_values[offsets];
6133 this->dof_values_initialized =
false;
6134 this->values_quad_initialized =
false;
6135 this->gradients_quad_initialized =
false;
6136 this->hessians_quad_initialized =
false;
6142 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6144 template <
typename DoFHandlerType,
bool level_dof_access>
6150 Assert(this->matrix_info ==
nullptr,
6151 ExcMessage(
"Cannot use initialization from cell iterator if " 6152 "initialized from MatrixFree object. Use variant for " 6153 "on the fly computation with arguments as for FEValues " 6157 this->local_dof_indices.resize(cell->get_fe().dofs_per_cell);
6158 if (level_dof_access)
6159 cell->get_mg_dof_indices(this->local_dof_indices);
6161 cell->get_dof_indices(this->local_dof_indices);
6166 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6173 Assert(this->matrix_info == 0,
6174 ExcMessage(
"Cannot use initialization from cell iterator if " 6175 "initialized from MatrixFree object. Use variant for " 6176 "on the fly computation with arguments as for FEValues " 6179 this->mapped_geometry->reinit(cell);
6184 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6191 if (this->matrix_info ==
nullptr)
6193 Assert ((this->mapped_geometry->get_fe_values().get_update_flags() |
6199 Assert(this->mapping_data->quadrature_point_offsets.empty() ==
false,
6205 const unsigned int n_q_points_1d_actual =
6206 fe_degree == -1 ? this->data->
n_q_points_1d : n_q_points_1d;
6212 &this->mapping_data->quadrature_points[this->mapping_data->quadrature_point_offsets[this->cell]];
6219 return quadrature_points[q];
6221 point[0] = quadrature_points[q%n_q_points_1d_actual][0];
6222 point[1] = quadrature_points[q/n_q_points_1d_actual][1];
6225 point[0] = quadrature_points[q%n_q_points_1d_actual][0];
6226 point[1] = quadrature_points[(q/n_q_points_1d_actual)%n_q_points_1d_actual][1];
6227 point[2] = quadrature_points[q/(n_q_points_1d_actual*n_q_points_1d_actual)][2];
6236 return quadrature_points[q];
6241 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6247 const bool evaluate_gradients,
6248 const bool evaluate_hessians)
6250 Assert (this->dof_values_initialized ==
true,
6252 evaluate(this->values_dofs[0], evaluate_values, evaluate_gradients, evaluate_hessians);
6257 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6263 const bool evaluate_values,
6264 const bool evaluate_gradients,
6265 const bool evaluate_hessians)
6269 this->values_quad[0],
6270 this->gradients_quad[0][0], this->hessians_quad[0][0], this->scratch_data,
6271 evaluate_values, evaluate_gradients, evaluate_hessians);
6274 if (evaluate_values ==
true)
6275 this->values_quad_initialized =
true;
6276 if (evaluate_gradients ==
true)
6277 this->gradients_quad_initialized =
true;
6278 if (evaluate_hessians ==
true)
6279 this->hessians_quad_initialized =
true;
6285 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6287 template <
typename VectorType>
6292 const bool evaluate_values,
6293 const bool evaluate_gradients,
6294 const bool evaluate_hessians)
6296 this->read_dof_values(input_vector);
6297 evaluate(this->begin_dof_values(), evaluate_values, evaluate_gradients,
6303 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6309 const bool integrate_gradients)
6311 integrate(integrate_values, integrate_gradients, this->values_dofs[0]);
6314 this->dof_values_initialized =
true;
6320 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6326 const bool integrate_gradients,
6329 if (integrate_values ==
true)
6330 Assert (this->values_quad_submitted ==
true,
6332 if (integrate_gradients ==
true)
6333 Assert (this->gradients_quad_submitted ==
true,
6335 Assert(this->matrix_info !=
nullptr ||
6339 ::integrate (*this->data, values_array, this->values_quad[0],
6340 this->gradients_quad[0][0], this->scratch_data,
6341 integrate_values, integrate_gradients);
6344 this->dof_values_initialized =
true;
6350 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6352 template <
typename VectorType>
6357 const bool integrate_gradients,
6358 VectorType &destination)
6360 integrate(integrate_values, integrate_gradients, this->begin_dof_values());
6361 this->distribute_local_to_global(destination);
6370 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6375 const bool is_interior_face,
6376 const unsigned int dof_no,
6377 const unsigned int quad_no,
6378 const unsigned int first_selected_component)
6380 BaseClass(matrix_free, dof_no, first_selected_component, quad_no, fe_degree,
6381 static_n_q_points, is_interior_face),
6382 dofs_per_component (this->data->dofs_per_component_on_cell),
6383 dofs_per_cell (this->data->dofs_per_component_on_cell *n_components_),
6384 n_q_points (this->data->n_q_points_face)
6390 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6399 template <
int dim,
int fe_degree,
int n_q_po
ints_1d,
int n_components_,
typename Number>
6403 ::reinit (
const unsigned int face_index)
6405 Assert (this->mapped_geometry ==
nullptr,
6406 ExcMessage(
"FEEvaluation was initialized without a matrix-free object." 6407 " Integer indexing is not possible"));
6408 if (this->mapped_geometry !=
nullptr)
6411 this->cell = face_index;
6412 this->dof_access_index = this->is_interior_face ?
6421 Assert(this->is_interior_face,
ExcMessage(
"Boundary faces do not have a neighbor"));
6425 if (this->is_interior_face ==
true)
6431 this->face_orientation = 0;
6438 this->face_orientation = 0;
6441 this->values_quad_submitted =
false;
6443 this->cell_type = this->matrix_info->get_mapping_info().face_type[face_index];
6444 const unsigned int offsets = this->mapping_data->data_index_offsets[face_index];
6445 this->J_value = &this->mapping_data->JxW_values[offsets];
6446 this->normal_vectors = &this->mapping_data->normal_vectors[offsets];
6447 this->jacobian = &this->mapping_data->jacobians[!this->is_interior_face][offsets];
6448 this->normal_x_jacobian = &this->mapping_data->normals_times_jacobians[!this->is_interior_face][offsets];
6451 this->dof_values_initialized =
false;
6452 this->values_quad_initialized =
false;
6453 this->gradients_quad_initialized =
false;
6454 this->hessians_quad_initialized =
false;
6460 template <
int dim,
int fe_degree,
int n_q_po
ints_1d,
int n_components_,
typename Number>
6464 ::reinit (
const unsigned int cell_index,
6465 const unsigned int face_number)
6467 Assert(this->quad_no < this->matrix_info->get_mapping_info().face_data_by_cells.size(),
6468 ExcMessage(
"You must set MatrixFree::AdditionalData::mapping_update_flags_faces_by_cells to use the present reinit method."));
6470 AssertIndexRange(cell_index, this->matrix_info->get_mapping_info().cell_type.size());
6471 Assert (this->mapped_geometry ==
nullptr,
6472 ExcMessage(
"FEEvaluation was initialized without a matrix-free object." 6473 " Integer indexing is not possible"));
6474 Assert (this->is_interior_face==
true,
6475 ExcMessage(
"Cell-based FEFaceEvaluation::reinit only possible for the " 6476 "interior face with second argument to constructor as true"));
6477 if (this->mapped_geometry !=
nullptr)
6481 this->cell_type = this->matrix_info->get_mapping_info().cell_type[cell_index];
6482 this->cell = cell_index;
6483 this->face_orientation = 0;
6485 this->face_no = face_number;
6488 const unsigned int offsets =
6489 this->matrix_info->get_mapping_info().face_data_by_cells[this->quad_no].
6492 face_data_by_cells[this->quad_no].JxW_values.size());
6493 this->J_value = &this->matrix_info->get_mapping_info().
6494 face_data_by_cells[this->quad_no].JxW_values[offsets];
6495 this->normal_vectors = &this->matrix_info->get_mapping_info().
6496 face_data_by_cells[this->quad_no].normal_vectors[offsets];
6497 this->jacobian = &this->matrix_info->get_mapping_info().
6498 face_data_by_cells[this->quad_no].jacobians[0][offsets];
6499 this->normal_x_jacobian = &this->matrix_info->get_mapping_info().
6500 face_data_by_cells[this->quad_no].normals_times_jacobians[0][offsets];
6503 this->dof_values_initialized =
false;
6504 this->values_quad_initialized =
false;
6505 this->gradients_quad_initialized =
false;
6506 this->hessians_quad_initialized =
false;
6512 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components,
6518 const bool evaluate_gradients)
6522 evaluate(this->values_dofs[0], evaluate_values, evaluate_gradients);
6527 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components,
6533 const bool evaluate_values,
6534 const bool evaluate_gradients)
6536 if (!(evaluate_values + evaluate_gradients))
6539 const unsigned int static_dofs_per_face = fe_degree > -1 ?
6541 const unsigned int dofs_per_face = fe_degree > -1 ?
6542 static_dofs_per_face :
6551 constexpr
unsigned int stack_array_size_threshold = 100;
6556 if (static_dofs_per_face < stack_array_size_threshold)
6557 temp1 = &temp_data[0];
6559 temp1 = this->scratch_data;
6561 internal::FEFaceNormalEvaluationImpl<dim,fe_degree,n_components,VectorizedArray<Number> >
6562 ::template interpolate<true,false>(*this->data, values_array, temp1,
6563 evaluate_gradients, this->face_no);
6565 const unsigned int n_q_points_1d_actual = fe_degree > -1 ? n_q_points_1d : 0;
6566 if (fe_degree > -1 &&
6568 this->data->element_type<=internal::MatrixFreeFunctions::tensor_symmetric)
6569 internal::FEFaceEvaluationImpl<true,dim,fe_degree,n_q_points_1d_actual,n_components,VectorizedArray<Number> >
6570 ::evaluate_in_face(*this->data, temp1, this->begin_values(), this->begin_gradients(),
6572 evaluate_values, evaluate_gradients, this->subface_index);
6574 internal::FEFaceEvaluationImpl<false,dim,fe_degree,n_q_points_1d_actual,n_components,VectorizedArray<Number> >
6575 ::evaluate_in_face(*this->data, temp1, this->begin_values(), this->begin_gradients(),
6577 evaluate_values, evaluate_gradients, this->subface_index);
6579 if (this->face_orientation)
6580 adjust_for_face_orientation(
false, evaluate_values, evaluate_gradients);
6583 if (evaluate_values ==
true)
6584 this->values_quad_initialized =
true;
6585 if (evaluate_gradients ==
true)
6586 this->gradients_quad_initialized =
true;
6592 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components,
6598 const bool integrate_gradients)
6600 integrate(integrate_values, integrate_gradients, this->values_dofs[0]);
6603 this->dof_values_initialized =
true;
6609 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components,
6615 const bool integrate_gradients,
6618 if (!(integrate_values + integrate_gradients))
6621 if (this->face_orientation)
6622 adjust_for_face_orientation(
true, integrate_values, integrate_gradients);
6624 const unsigned int static_dofs_per_face = fe_degree > -1 ?
6626 const unsigned int dofs_per_face = fe_degree > -1 ?
6627 static_dofs_per_face :
6630 constexpr
unsigned int stack_array_size_threshold = 100;
6635 if (static_dofs_per_face < stack_array_size_threshold)
6636 temp1 = &temp_data[0];
6638 temp1 = this->scratch_data;
6640 const unsigned int n_q_points_1d_actual = fe_degree > -1 ? n_q_points_1d : 0;
6641 if (fe_degree > -1 &&
6643 this->data->element_type<=internal::MatrixFreeFunctions::tensor_symmetric)
6644 internal::FEFaceEvaluationImpl<true,dim,fe_degree,n_q_points_1d_actual,n_components,VectorizedArray<Number> >
6645 ::integrate_in_face(*this->data, temp1, this->begin_values(),
6646 this->begin_gradients(),
6648 integrate_values, integrate_gradients, this->subface_index);
6650 internal::FEFaceEvaluationImpl<false,dim,fe_degree,n_q_points_1d_actual,n_components,VectorizedArray<Number> >
6651 ::integrate_in_face(*this->data, temp1, this->begin_values(),
6652 this->begin_gradients(),
6654 integrate_values, integrate_gradients, this->subface_index);
6656 internal::FEFaceNormalEvaluationImpl<dim,fe_degree,n_components,VectorizedArray<Number> >
6657 ::template interpolate<false,false>(*this->data, temp1, values_array, integrate_gradients, this->face_no);
6662 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6664 template <
typename VectorType>
6669 const bool evaluate_values,
6670 const bool evaluate_gradients)
6672 const unsigned int side = this->face_no%2;
6673 const unsigned int dofs_per_face = fe_degree > -1 ?
6677 constexpr
unsigned int stack_array_size_threshold = 100;
6680 n_components_ * 2 * dofs_per_face : 1];
6682 if (dofs_per_face < stack_array_size_threshold)
6683 temp1 = &temp_data[0];
6685 temp1 = this->scratch_data;
6687 internal::VectorReader<Number> reader;
6692 this->dof_info->n_vectorization_lanes_filled[this->dof_access_index][this->cell] ==
6695 ((evaluate_gradients ==
false && this->data->nodal_at_cell_boundaries ==
true) ||
6696 (this->data->element_type == internal::MatrixFreeFunctions::tensor_symmetric_hermite &&
6701 if (evaluate_gradients ==
true &&
6702 this->data->element_type == internal::MatrixFreeFunctions::tensor_symmetric_hermite)
6708 this->data->shape_data_on_face[0][fe_degree+1];
6710 this->data->shape_data_on_face[0][fe_degree+2];
6714 const unsigned int *index_array = &this->data->face_to_cell_index_hermite(this->face_no,0);
6715 for (
unsigned int i=0; i<dofs_per_face; ++i)
6717 const unsigned int ind1 = index_array[2*i];
6718 const unsigned int ind2 = index_array[2*i+1];
6719 for (
unsigned int comp=0; comp<n_components_; ++comp)
6721 reader.process_dof_gather(indices, input_vector,
6722 ind1+comp*static_dofs_per_component +
6724 temp1[i+2*comp*dofs_per_face],
6725 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6727 reader.process_dof_gather(indices, input_vector,
6728 ind2+comp*static_dofs_per_component +
6731 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6732 temp1[i+dofs_per_face+2*comp*dofs_per_face] =
6733 grad_weight0 * temp1[i+2*comp*dofs_per_face] +
6734 grad_weight1 * grad;
6742 const unsigned int *index_array = &this->data->face_to_cell_index_nodal(this->face_no,0);
6743 for (
unsigned int i=0; i<dofs_per_face; ++i)
6744 for (
unsigned int comp=0; comp<n_components_; ++comp)
6746 const unsigned int ind = index_array[i];
6747 reader.process_dof_gather(indices, input_vector,
6748 ind+comp*static_dofs_per_component +
6750 temp1[i+comp*2*dofs_per_face],
6751 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6757 this->read_dof_values(input_vector);
6758 internal::FEFaceNormalEvaluationImpl<dim,fe_degree,n_components_,VectorizedArray<Number> >
6759 ::template interpolate<true,false>(*this->data, this->values_dofs[0], temp1,
6760 evaluate_gradients, this->face_no);
6763 if (fe_degree > -1 &&
6765 this->data->element_type <= internal::MatrixFreeFunctions::tensor_symmetric)
6766 internal::FEFaceEvaluationImpl<true,dim,fe_degree,n_q_points_1d,n_components_,VectorizedArray<Number> >
6767 ::evaluate_in_face(*this->data, temp1, this->values_quad[0],
6768 this->gradients_quad[0][0], this->scratch_data +
6769 2*n_components_*dofs_per_face,
6770 evaluate_values, evaluate_gradients, this->subface_index);
6772 internal::FEFaceEvaluationImpl<false,dim,fe_degree,n_q_points_1d,n_components_,VectorizedArray<Number> >
6773 ::evaluate_in_face(*this->data, temp1, this->values_quad[0],
6774 this->gradients_quad[0][0], this->scratch_data +
6775 2*n_components_*dofs_per_face,
6776 evaluate_values, evaluate_gradients, this->subface_index);
6778 if (this->face_orientation)
6779 adjust_for_face_orientation(
false, evaluate_values, evaluate_gradients);
6782 if (evaluate_values ==
true)
6783 this->values_quad_initialized =
true;
6784 if (evaluate_gradients ==
true)
6785 this->gradients_quad_initialized =
true;
6791 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6793 template <
typename VectorType>
6798 const bool integrate_gradients,
6799 VectorType &destination)
6801 const unsigned int side = this->face_no%2;
6802 const unsigned int dofs_per_face = fe_degree > -1 ?
6806 constexpr
unsigned int stack_array_size_threshold = 100;
6809 n_components_ * 2 * dofs_per_face : 1];
6811 if (dofs_per_face < stack_array_size_threshold)
6812 temp1 = &temp_data[0];
6814 temp1 = this->scratch_data;
6816 if (this->face_orientation)
6817 adjust_for_face_orientation(
true, integrate_values, integrate_gradients);
6818 if (fe_degree > -1 &&
6820 this->data->element_type <= internal::MatrixFreeFunctions::tensor_symmetric)
6821 internal::FEFaceEvaluationImpl<true,dim,fe_degree,n_q_points_1d,n_components_,VectorizedArray<Number> >
6822 ::integrate_in_face(*this->data, temp1, this->values_quad[0],
6823 this->gradients_quad[0][0], this->scratch_data +
6824 2*n_components_*dofs_per_face,
6825 integrate_values, integrate_gradients, this->subface_index);
6827 internal::FEFaceEvaluationImpl<false,dim,fe_degree,n_q_points_1d,n_components_,VectorizedArray<Number> >
6828 ::integrate_in_face(*this->data, temp1, this->values_quad[0],
6829 this->gradients_quad[0][0], this->scratch_data +
6830 2*n_components_*dofs_per_face,
6831 integrate_values, integrate_gradients, this->subface_index);
6834 this->dof_values_initialized =
true;
6837 internal::VectorDistributorLocalToGlobal<Number> writer;
6842 this->dof_info->n_vectorization_lanes_filled[this->dof_access_index][this->cell] ==
6845 ((integrate_gradients ==
false && this->data->nodal_at_cell_boundaries ==
true) ||
6846 (this->data->element_type == internal::MatrixFreeFunctions::tensor_symmetric_hermite &&
6852 if (integrate_gradients ==
true &&
6853 this->data->element_type == internal::MatrixFreeFunctions::tensor_symmetric_hermite)
6858 const VectorizedArray<Number> grad_weight0 = (side ? -1. : 1.) * this->data->shape_data_on_face[0][fe_degree+1];
6859 const VectorizedArray<Number> grad_weight1 = (side ? -1. : 1.) * this->data->shape_data_on_face[0][fe_degree+2];
6862 const unsigned int *index_array = &this->data->face_to_cell_index_hermite(this->face_no,0);
6863 for (
unsigned int i=0; i<dofs_per_face; ++i)
6865 const unsigned int ind1 = index_array[2*i];
6866 const unsigned int ind2 = index_array[2*i+1];
6867 for (
unsigned int comp=0; comp<n_components_; ++comp)
6870 + grad_weight0 * temp1[i+dofs_per_face+2*comp*dofs_per_face];
6872 grad_weight1 * temp1[i+dofs_per_face+2*comp*dofs_per_face];
6873 writer.process_dof_gather(indices, destination,
6874 comp*static_dofs_per_component+ind1 +
6877 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6878 writer.process_dof_gather(indices, destination,
6879 comp*static_dofs_per_component+ind2 +
6882 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6890 const unsigned int *index_array = &this->data->face_to_cell_index_nodal(this->face_no,0);
6891 for (
unsigned int i=0; i<dofs_per_face; ++i)
6893 const unsigned int ind = index_array[i];
6894 for (
unsigned int comp=0; comp<n_components_; ++comp)
6895 writer.process_dof_gather(indices, destination,
6896 comp*static_dofs_per_component+ind +
6897 this->dof_info->component_dof_indices_offset[this->active_fe_index][this->first_selected_component],
6898 temp1[i+2*comp*dofs_per_face],
6899 std::integral_constant<
bool, std::is_same<typename VectorType::value_type,Number>::value>());
6905 internal::FEFaceNormalEvaluationImpl<dim,fe_degree,n_components_,VectorizedArray<Number> >
6906 ::template interpolate<false,false>(*this->data, temp1, this->values_dofs[0],
6907 integrate_gradients, this->face_no);
6908 this->distribute_local_to_global(destination);
6914 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components,
6921 const bool gradients)
6924 const unsigned int *orientations =
6925 &this->mapping_data->descriptor[this->active_fe_index].face_orientations[this->face_orientation][0];
6931 for (
unsigned int q=0; q<n_q_points; ++q)
6932 tmp_values[orientations[q]] = this->values_quad[c][q];
6934 for (
unsigned int q=0; q<n_q_points; ++q)
6935 tmp_values[q] = this->values_quad[c][orientations[q]];
6936 for (
unsigned int q=0; q<n_q_points; ++q)
6937 this->values_quad[c][q] = tmp_values[q];
6939 if (gradients ==
true)
6940 for (
unsigned int d=0;
d<dim; ++
d)
6943 for (
unsigned int q=0; q<n_q_points; ++q)
6944 tmp_values[orientations[q]] = this->gradients_quad[c][d][q];
6946 for (
unsigned int q=0; q<n_q_points; ++q)
6947 tmp_values[q] = this->gradients_quad[c][d][orientations[q]];
6948 for (
unsigned int q=0; q<n_q_points; ++q)
6949 this->gradients_quad[c][d][q] = tmp_values[q];
6956 template <
int dim,
int fe_degree,
int n_q_points_1d,
int n_components_,
6964 if (this->dof_access_index < 2)
6966 Assert(this->mapping_data->quadrature_point_offsets.empty() ==
false,
6968 AssertIndexRange(this->cell, this->mapping_data->quadrature_point_offsets.size());
6969 return this->mapping_data->quadrature_points[this->mapping_data->quadrature_point_offsets[this->cell]+q];
6973 Assert(this->matrix_info->get_mapping_info().face_data_by_cells
6974 [this->quad_no].quadrature_point_offsets.empty() ==
false,
6977 AssertIndexRange(index, this->matrix_info->get_mapping_info().face_data_by_cells
6978 [this->quad_no].quadrature_point_offsets.size());
6979 return this->matrix_info->get_mapping_info().face_data_by_cells[this->quad_no].
6980 quadrature_points[this->matrix_info->get_mapping_info().face_data_by_cells
6981 [this->quad_no].quadrature_point_offsets[index]+q];
6990 #endif // ifndef DOXYGEN 6993 DEAL_II_NAMESPACE_CLOSE
gradient_type get_gradient(const unsigned int q_point) const
const unsigned int active_quad_index
std::vector< unsigned int > plain_dof_indices
bool gradients_quad_submitted
static const unsigned int invalid_unsigned_int
const Number * constraint_pool_begin(const unsigned int pool_index) const
unsigned int dofs_per_component_on_cell
void set_dof_values(VectorType &dst, const unsigned int first_index=0) const
const VectorizedArray< Number > * begin_hessians() const
#define AssertDimension(dim1, dim2)
const MatrixFree< dim, Number > * matrix_info
void submit_divergence(const VectorizedArray< Number > div_in, const unsigned int q_point)
bool values_quad_initialized
void check_template_arguments(const unsigned int fe_no, const unsigned int first_selected_component)
void submit_symmetric_gradient(const SymmetricTensor< 2, dim, VectorizedArray< Number > > grad_in, const unsigned int q_point)
void distribute_local_to_global(VectorType &dst, const unsigned int first_index=0) const
FEEvaluationAccess< dim, n_components_, Number, true > BaseClass
FEEvaluation & operator=(const FEEvaluation &other)
const internal::MatrixFreeFunctions::FaceToCellTopology< VectorizedArray< Number >::n_array_elements > & get_face_info(const unsigned int face_batch_number) const
internal::MatrixFreeFunctions::GeometryType get_cell_type() const
internal::MatrixFreeFunctions::GeometryType cell_type
static ::ExceptionBase & ExcAccessToUninitializedField()
std::vector< unsigned int > component_to_base_index
const internal::MatrixFreeFunctions::TaskInfo & get_size_info() const
constexpr unsigned int pow(const unsigned int base, const unsigned int iexp)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Point< spacedim > point(const gp_Pnt &p, const double &tolerance=1e-10)
std::vector< IndexStorageVariants > index_storage_variants[3]
Point< dim, VectorizedArray< Number > > quadrature_point(const unsigned int q_point) const
const unsigned int dofs_per_cell
BaseClass::value_type value_type
unsigned int n_components() const
void evaluate(const bool evaluate_values, const bool evaluate_gradients, const bool evaluate_hessians=false)
void integrate(const bool integrate_values, const bool integrate_gradients)
const MappingInfoStorage< dim, dim, Number > & get_data_storage() const
void submit_normal_derivative(const value_type grad_in, const unsigned int q_point)
static constexpr unsigned int static_dofs_per_cell
unsigned char face_orientation
#define AssertIndexRange(index, range)
std::shared_ptr< const Utilities::MPI::Partitioner > vector_partitioner
ArrayView< VectorizedArray< Number > > get_scratch_data() const
void submit_curl(const Tensor< 1, dim==2?1:dim, VectorizedArray< Number > > curl_in, const unsigned int q_point)
const Tensor< 2, dim, VectorizedArray< Number > > * jacobian
FEEvaluationBase & operator=(const FEEvaluationBase &other)
const unsigned int active_fe_index
std::vector< std::pair< unsigned short, unsigned short > > constraint_indicator
const VectorizedArray< Number > * begin_dof_values() const
void integrate_scatter(const bool integrate_values, const bool integrate_gradients, VectorType &output_vector)
const internal::MatrixFreeFunctions::ShapeInfo< VectorizedArray< Number > > * data
Transformed quadrature points.
static ::ExceptionBase & ExcNotInitialized()
const Tensor< 1, dim, VectorizedArray< Number > > * normal_x_jacobian
std::vector< unsigned int > cell_partition_data
void read_dof_values(const VectorType &src, const unsigned int first_index=0)
VectorizedArray< Number > read_cell_data(const AlignedVector< VectorizedArray< Number > > &array) const
bool values_quad_submitted
static constexpr unsigned int n_components
FEEvaluationAccess & operator=(const FEEvaluationAccess &other)
AlignedVector< VectorizedArray< Number > > * scratch_data_array
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
void scatter(const unsigned int *offsets, Number *base_ptr) const
std::vector< unsigned int > dof_indices
SymmetricTensor< 2, dim, VectorizedArray< Number > > get_symmetric_gradient(const unsigned int q_point) const
value_type integrate_value() const
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
const unsigned int dofs_per_component
void fill_JxW_values(AlignedVector< VectorizedArray< Number > > &JxW_values) const
std::shared_ptr< internal::MatrixFreeFunctions::MappingDataOnTheFly< dim, Number > > mapped_geometry
value_type get_value(const unsigned int q_point) const
void read_write_operation_contiguous(const VectorOperation &operation, VectorType *vectors[]) const
void submit_value(const value_type val_in, const unsigned int q_point)
VectorizedArray< Number > JxW(const unsigned int q_index) const
std::vector< unsigned char > n_vectorization_lanes_filled[3]
AlignedVector< VectorizedArray< Number > > * acquire_scratch_data() const
unsigned int vectorization_length
const Number * quadrature_weights
static constexpr unsigned int tensor_dofs_per_cell
void read_dof_values_plain(const VectorType &src, const unsigned int first_index=0)
const unsigned int dofs_per_cell
internal::MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index
static ::ExceptionBase & ExcMessage(std::string arg1)
const unsigned int n_q_points
gradient_type get_hessian_diagonal(const unsigned int q_point) const
value_type get_laplacian(const unsigned int q_point) const
const internal::MatrixFreeFunctions::ShapeInfo< VectorizedArray< Number > > & get_shape_info() const
std::pair< unsigned int, unsigned int > component_to_base_index(const unsigned int component) const
T sum(const T &t, const MPI_Comm &mpi_communicator)
unsigned int global_dof_index
VectorizedArray< Number > get_divergence(const unsigned int q_point) const
std::vector< unsigned int > dof_indices_interleaved
const unsigned int quad_no
VectorizedArray< Number > * scratch_data
#define Assert(cond, exc)
unsigned int element_multiplicity(const unsigned int index) const
const internal::MatrixFreeFunctions::DoFInfo * dof_info
const VectorizedArray< Number > * begin_values() const
unsigned int subface_index
std::vector< unsigned int > row_starts_plain_indices
unsigned int n_q_points_face
#define DeclException0(Exception0)
std::vector< unsigned int > boundary_partition_data
const Number * constraint_pool_end(const unsigned int pool_index) const
void read_write_operation_global(const VectorOperation &operation, VectorType *vectors[]) const
std::vector< std::pair< unsigned int, unsigned int > > row_starts
const internal::MatrixFreeFunctions::ShapeInfo< VectorizedArray< 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 get_mapping_data_index_offset() const
void reinit(const unsigned int face_batch_number)
VectorizedArray< Number > * gradients_quad[n_components][dim]
VectorizedArray< Number > pow(const ::VectorizedArray< Number > &x, const Number p)
BaseClass::gradient_type gradient_type
static constexpr unsigned int static_dofs_per_cell
friend class FEEvaluationBase
void gather_evaluate(const VectorType &input_vector, const bool evaluate_values, const bool evaluate_gradients)
unsigned char subface_index
const VectorizedArray< Number > * J_value
bool mapping_initialized() const
bool hessians_quad_initialized
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
void reinit(const unsigned int cell_batch_index)
void adjust_for_face_orientation(const bool integrate, const bool values, const bool gradients)
void integrate(const bool integrate_values, const bool integrate_gradients)
BaseClass::value_type value_type
static constexpr unsigned int n_components
std::vector< unsigned int > face_partition_data
static constexpr unsigned int static_n_q_points_cell
unsigned char exterior_face_no
FEFaceEvaluation(const MatrixFree< dim, Number > &matrix_free, const bool is_interior_face=true, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0)
void release_scratch_data(const AlignedVector< VectorizedArray< Number > > *memory) const
unsigned int n_q_points_1d
void evaluate(const bool evaluate_values, const bool evaluate_gradients)
Tensor< 1, n_components_, Tensor< 2, dim, VectorizedArray< Number > > > get_hessian(const unsigned int q_point) const
VectorizedArray< Number > * hessians_quad[n_components][(dim *(dim+1))/2]
const internal::MatrixFreeFunctions::MappingInfoStorage<(is_face?dim-1:dim), dim, Number > * mapping_data
value_type get_dof_value(const unsigned int dof) const
static constexpr unsigned int static_n_q_points
std::vector< unsigned int > dof_indices_contiguous[3]
const unsigned int n_q_points
std::vector< std::vector< unsigned int > > component_dof_indices_offset
VectorizedArray< Number > * values_dofs[n_components]
const VectorizedArray< Number > * begin_gradients() const
static constexpr unsigned int tensor_dofs_per_cell
unsigned int get_cell_data_number() const
static constexpr unsigned int dimension
bool partitioners_are_compatible(const Utilities::MPI::Partitioner &part) const
Number local_element(const size_type local_index) const
unsigned int n_base_elements(const unsigned int dof_handler_index) const
static constexpr unsigned int static_dofs_per_component
const unsigned int n_quadrature_points
Tensor< 2, dim, VectorizedArray< Number > > inverse_jacobian(const unsigned int q_index) const
void gather(const Number *base_ptr, const unsigned int *offsets)
void read_write_operation(const VectorOperation &operation, VectorType *vectors[], const bool apply_constraints=true) const
const unsigned int dofs_per_component
static ::ExceptionBase & ExcNotImplemented()
Tensor< 1, dim, VectorizedArray< Number > > get_normal_vector(const unsigned int q_point) const
std::vector< types::global_dof_index > local_dof_indices
value_type get_normal_derivative(const unsigned int q_point) const
Tensor< 1,(dim==2?1:dim), VectorizedArray< Number > > get_curl(const unsigned int q_point) const
bool indices_initialized() const
static constexpr unsigned int dimension
bool dof_values_initialized
void gather_evaluate(const VectorType &input_vector, const bool evaluate_values, const bool evaluate_gradients, const bool evaluate_hessians=false)
VectorizedArray< Number > * values_quad[n_components]
void submit_dof_value(const value_type val_in, const unsigned int dof)
bool gradients_quad_initialized
std::vector< unsigned int > start_components
void integrate_scatter(const bool integrate_values, const bool integrate_gradients, VectorType &output_vector)
std::vector< unsigned int > lexicographic_numbering
FEEvaluation(const MatrixFree< dim, Number > &matrix_free, const unsigned int dof_no=0, const unsigned int quad_no=0, const unsigned int first_selected_component=0)
static constexpr unsigned int static_dofs_per_component
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
FEEvaluationAccess(const MatrixFree< dim, Number > &matrix_free, const unsigned int dof_no, const unsigned int first_selected_component, const unsigned int quad_no, const unsigned int fe_degree, const unsigned int n_q_points, const bool is_interior_face=true)
unsigned int face_orientation
static constexpr unsigned int static_n_q_points
unsigned char interior_face_no
const Tensor< 1, dim, VectorizedArray< Number > > * normal_vectors
Point< dim, VectorizedArray< Number > > quadrature_point(const unsigned int q_point) const
BaseClass::gradient_type gradient_type
const std::vector< unsigned int > & get_internal_dof_numbering() const
const unsigned int n_fe_components
const internal::MatrixFreeFunctions::TaskInfo & get_task_info() const
void submit_gradient(const gradient_type grad_in, const unsigned int q_point)
const unsigned int first_selected_component
static ::ExceptionBase & ExcInternalError()
FEEvaluationAccess< dim, n_components_, Number, false > BaseClass