/home/runner/work/kynema/kynema/kynema/src/dof_management/compute_node_freedom_map_table.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/dof_management/compute_node_freedom_map_table.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
compute_node_freedom_map_table.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
6#include "state/state.hpp"
7
8namespace kynema::dof {
9
14template <typename DeviceType>
16 typename Kokkos::View<FreedomSignature*, DeviceType>::const_type node_freedom_allocation_table;
17 Kokkos::View<size_t*, DeviceType> node_freedom_map_table;
18
19 KOKKOS_FUNCTION
20 void operator()(size_t i, size_t& update, bool is_final) const {
21 const auto num_dof = count_active_dofs(node_freedom_allocation_table(i));
22 update += num_dof;
23 if (is_final) {
24 node_freedom_map_table(i + 1) = update;
25 }
26 }
27};
28
37template <typename DeviceType>
39 using RangePolicy = Kokkos::RangePolicy<typename DeviceType::execution_space>;
40 Kokkos::deep_copy(state.node_freedom_map_table, 0UL);
41 auto result = 0UL;
42 auto scan_range = RangePolicy(0, state.num_system_nodes - 1UL);
43 Kokkos::parallel_scan(
44 "Compute Node Freedom Map Table", scan_range,
47 },
48 result
49 );
50}
51
52} // namespace kynema::dof
Definition assemble_node_freedom_allocation_table.hpp:10
void compute_node_freedom_map_table(State< DeviceType > &state)
Compute the node freedom map table, a pointer map to the start of the degrees of freedom ofa given no...
Definition compute_node_freedom_map_table.hpp:38
KOKKOS_INLINE_FUNCTION size_t count_active_dofs(FreedomSignature x)
Counts the number of active degrees of freedom in a signature.
Definition freedom_signature.hpp:45
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
View< dof::FreedomSignature * > node_freedom_allocation_table
Definition state.hpp:25
size_t num_system_nodes
Definition state.hpp:23
View< size_t * > node_freedom_map_table
Definition state.hpp:27
A Scanning Kernel which to convert the number of active degrees of freedom per node to a pointer map ...
Definition compute_node_freedom_map_table.hpp:15
Kokkos::View< FreedomSignature *, DeviceType >::const_type node_freedom_allocation_table
Definition compute_node_freedom_map_table.hpp:16
Kokkos::View< size_t *, DeviceType > node_freedom_map_table
Definition compute_node_freedom_map_table.hpp:17
KOKKOS_FUNCTION void operator()(size_t i, size_t &update, bool is_final) const
Definition compute_node_freedom_map_table.hpp:20