16#ifndef dealii_cuda_fe_evaluation_h
17#define dealii_cuda_fe_evaluation_h
30#include <deal.II/matrix_free/cuda_matrix_free.templates.h>
33#include <Kokkos_Core.hpp>
69 int n_q_points_1d = fe_degree + 1,
71 typename Number =
double>
212 template <
typename Functor>
248 static_assert(
n_components_ == 1,
"This function only supports FE with one \
254 shared_data->values(i) =
255 src[data->local_to_global(cell_id, i)];
257 shared_data->team_member.team_barrier();
259 internal::resolve_hanging_nodes<dim, fe_degree, false>(
260 shared_data->team_member,
261 data->constraint_weights,
262 data->constraint_mask(cell_id),
263 shared_data->values);
277 static_assert(
n_components_ == 1,
"This function only supports FE with one \
280 internal::resolve_hanging_nodes<dim, fe_degree, true>(
281 shared_data->team_member,
282 data->constraint_weights,
283 data->constraint_mask(cell_id),
284 shared_data->values);
286 if (data->use_coloring)
291 dst[data->local_to_global(cell_id, i)] +=
292 shared_data->values(i);
297 Kokkos::parallel_for(
300 Kokkos::atomic_add(&dst[data->local_to_global(cell_id, i)],
301 shared_data->values(i));
328 data->shape_gradients,
329 data->co_shape_gradients);
333 shared_data->values, shared_data->gradients);
334 shared_data->team_member.team_barrier();
339 shared_data->gradients);
340 shared_data->team_member.team_barrier();
345 shared_data->team_member.team_barrier();
369 data->shape_gradients,
370 data->co_shape_gradients);
374 shared_data->values, shared_data->gradients);
379 shared_data->team_member.team_barrier();
384 shared_data->values, shared_data->gradients);
385 shared_data->team_member.team_barrier();
404 return shared_data->values(
q_point);
422 return shared_data->values(
q_point);
464 Number>::gradient_type
468 static_assert(
n_components_ == 1,
"This function only supports FE with one \
472 for (
unsigned int d_1 = 0;
d_1 < dim; ++
d_1)
475 for (
unsigned int d_2 = 0;
d_2 < dim; ++
d_2)
495 for (
unsigned int d_1 = 0;
d_1 < dim; ++
d_1)
498 for (
unsigned int d_2 = 0;
d_2 < dim; ++
d_2)
501 tmp * data->JxW(cell_id,
q_point);
512 template <
typename Functor>
519 [&](
const int &i) { func(this, i); });
520 shared_data->team_member.team_barrier();
531 constexpr unsigned int
static constexpr unsigned int tensor_dofs_per_cell
void integrate(const bool integrate_val, const bool integrate_grad)
value_type get_value(int q_point) const
value_type get_dof_value(int q_point) const
SharedData< dim, Number > * shared_data
void distribute_local_to_global(Number *dst) const
static constexpr unsigned int dimension
void evaluate(const bool evaluate_val, const bool evaluate_grad)
static constexpr unsigned int n_q_points
gradient_type get_gradient(int q_point) const
static constexpr unsigned int n_components
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)
friend class FEEvaluation
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
constexpr T pow(const T base, const int iexp)
#define DEAL_II_HOST_DEVICE