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>
66 int n_q_points_1d = fe_degree + 1,
67 int n_components_ = 1,
68 typename Number =
double>
155 evaluate(const
bool evaluate_val, const
bool evaluate_grad);
177 integrate(const
bool integrate_val, const
bool integrate_grad);
233 template <typename Functor>
269 static_assert(n_components_ == 1,
"This function only supports FE with one \
272 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
275 shared_data->values(i) =
276 src[data->local_to_global(cell_id, i)];
280 internal::resolve_hanging_nodes<dim, fe_degree, false>(
282 data->constraint_weights,
298 static_assert(n_components_ == 1,
"This function only supports FE with one \
301 internal::resolve_hanging_nodes<dim, fe_degree, true>(
303 data->constraint_weights,
307 if (
data->use_coloring)
309 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
312 dst[data->local_to_global(cell_id, i)] +=
313 shared_data->values(i);
318 Kokkos::parallel_for(
321 Kokkos::atomic_add(&dst[data->local_to_global(cell_id, i)],
322 shared_data->values(i));
348 data->shape_gradients,
349 data->co_shape_gradients);
354 evaluator_tensor_product.evaluate_values_and_gradients(
360 evaluator_tensor_product.evaluate_gradients(
shared_data->values,
366 evaluator_tensor_product.evaluate_values(
shared_data->values);
380 const bool evaluate_val,
381 const bool evaluate_grad)
407 data->shape_gradients,
408 data->co_shape_gradients);
413 evaluator_tensor_product.integrate_values_and_gradients(
418 evaluator_tensor_product.integrate_values(
shared_data->values);
423 evaluator_tensor_product.template integrate_gradients<false>(
438 const bool integrate_val,
439 const bool integrate_grad)
525 static_assert(n_components_ == 1,
"This function only supports FE with one \
529 for (
unsigned int d_1 = 0; d_1 < dim; ++d_1)
532 for (
unsigned int d_2 = 0; d_2 < dim; ++d_2)
533 tmp +=
data->inv_jacobian(
cell_id, q_point, d_2, d_1) *
552 for (
unsigned int d_1 = 0; d_1 < dim; ++d_1)
555 for (
unsigned int d_2 = 0; d_2 < dim; ++d_2)
556 tmp +=
data->inv_jacobian(
cell_id, q_point, d_1, d_2) * grad_in[d_2];
569 template <
typename Functor>
574 Kokkos::parallel_for(Kokkos::TeamThreadRange(
shared_data->team_member,
576 [&](
const int &i) { func(this, i); });
588 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_DEPRECATED_WITH_COMMENT(comment)
#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