15#ifndef dealii_portable_fe_evaluation_h
16#define dealii_portable_fe_evaluation_h
27#include <deal.II/matrix_free/portable_matrix_free.templates.h>
30#include <Kokkos_Core.hpp>
67 int n_q_points_1d = fe_degree + 1,
68 int n_components_ = 1,
69 typename Number =
double>
153 DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
154 "Use the version taking EvaluationFlags.")
157 evaluate(const
bool evaluate_val, const
bool evaluate_grad);
176 DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
180 integrate(const
bool integrate_val, const
bool integrate_grad);
236 template <typename Functor>
272 static_assert(n_components_ == 1,
"This function only supports FE with one \
275 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
278 shared_data->values(i) =
279 src[data->local_to_global(cell_id, i)];
283 internal::resolve_hanging_nodes<dim, fe_degree, false>(
285 data->constraint_weights,
301 static_assert(n_components_ == 1,
"This function only supports FE with one \
304 internal::resolve_hanging_nodes<dim, fe_degree, true>(
306 data->constraint_weights,
310 if (
data->use_coloring)
312 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
315 dst[data->local_to_global(cell_id, i)] +=
316 shared_data->values(i);
321 Kokkos::parallel_for(
324 Kokkos::atomic_add(&dst[data->local_to_global(cell_id, i)],
325 shared_data->values(i));
351 data->shape_gradients,
352 data->co_shape_gradients);
357 evaluator_tensor_product.evaluate_values_and_gradients(
363 evaluator_tensor_product.evaluate_gradients(
shared_data->values,
369 evaluator_tensor_product.evaluate_values(
shared_data->values);
383 const bool evaluate_val,
384 const bool evaluate_grad)
410 data->shape_gradients,
411 data->co_shape_gradients);
416 evaluator_tensor_product.integrate_values_and_gradients(
421 evaluator_tensor_product.integrate_values(
shared_data->values);
426 evaluator_tensor_product.template integrate_gradients<false>(
441 const bool integrate_val,
442 const bool integrate_grad)
528 static_assert(n_components_ == 1,
"This function only supports FE with one \
532 for (
unsigned int d_1 = 0; d_1 < dim; ++d_1)
535 for (
unsigned int d_2 = 0; d_2 < dim; ++d_2)
536 tmp +=
data->inv_jacobian(
cell_id, q_point, d_2, d_1) *
555 for (
unsigned int d_1 = 0; d_1 < dim; ++d_1)
558 for (
unsigned int d_2 = 0; d_2 < dim; ++d_2)
559 tmp +=
data->inv_jacobian(
cell_id, q_point, d_1, d_2) * grad_in[d_2];
572 template <
typename Functor>
577 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
579 [&](
const int &i) { func(this, i); });
591 constexpr unsigned int
static constexpr unsigned int n_q_points
SharedData< dim, Number > * shared_data
void integrate(const EvaluationFlags::EvaluationFlags integration_flag)
static constexpr unsigned int dimension
static constexpr unsigned int n_components
value_type get_value(int q_point) const
static constexpr unsigned int tensor_dofs_per_cell
value_type get_dof_value(int q_point) const
Tensor< 1, dim, Number > gradient_type
void evaluate(const EvaluationFlags::EvaluationFlags evaluate_flag)
void distribute_local_to_global(Number *dst) const
gradient_type get_gradient(int q_point) const
typename MatrixFree< dim, Number >::Data data_type
void read_dof_values(const Number *src)
void submit_dof_value(const value_type &val_in, int q_point)
void submit_value(const value_type &val_in, int q_point)
void submit_gradient(const gradient_type &grad_in, int q_point)
void apply_for_each_quad_point(const Functor &func)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
The namespace for the EvaluationFlags enum.
EvaluationFlags
The EvaluationFlags enum.
constexpr T pow(const T base, const int iexp)
#define DEAL_II_HOST_DEVICE