/home/runner/work/kynema/kynema/kynema/src/solver/compute_num_system_dofs.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/compute_num_system_dofs.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
compute_num_system_dofs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
5namespace kynema::solver {
6
11template <typename DeviceType>
13 typename Kokkos::View<size_t*, DeviceType>::const_type active_dofs;
14
15 KOKKOS_FUNCTION
16 void operator()(size_t i, size_t& update) const { update += active_dofs(i); }
17};
18
26template <typename DeviceType>
27[[nodiscard]] inline size_t ComputeNumSystemDofs(
28 const typename Kokkos::View<size_t*, DeviceType>::const_type& active_dofs
29) {
30 auto total_system_dofs = 0UL;
31
32 using RangePolicy = Kokkos::RangePolicy<typename DeviceType::execution_space>;
33
34 Kokkos::parallel_reduce(
35 "ComputeNumSystemDofs", RangePolicy(0, active_dofs.extent(0)),
36 ComputeNumSystemDofsReducer<DeviceType>{active_dofs}, total_system_dofs
37 );
38 return total_system_dofs;
39}
40
41} // namespace kynema::solver
Definition calculate_error_sum_squares.hpp:5
size_t ComputeNumSystemDofs(const typename Kokkos::View< size_t *, DeviceType >::const_type &active_dofs)
Computes the total number of active degrees of freedom in the system.
Definition compute_num_system_dofs.hpp:27
A Reduction kernel which sums the number of active degrees of freedom at each node.
Definition compute_num_system_dofs.hpp:12
Kokkos::View< size_t *, DeviceType >::const_type active_dofs
Definition compute_num_system_dofs.hpp:13
KOKKOS_FUNCTION void operator()(size_t i, size_t &update) const
Definition compute_num_system_dofs.hpp:16