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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/compute_col_inds.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
compute_col_inds.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
7
8namespace kynema::solver {
9
14template <typename RowPtrType, typename IndicesType>
16 template <typename ValueType>
17 using View = Kokkos::View<ValueType, typename RowPtrType::device_type>;
18 template <typename ValueType>
20
22 typename RowPtrType::value_type num_non_zero, size_t num_system_dofs,
23 const ConstView<size_t*>& active_dofs, const ConstView<size_t*>& node_freedom_map_table,
24 const ConstView<size_t*>& num_nodes_per_element,
25 const ConstView<size_t**>& node_state_indices, const ConstView<size_t*>& base_active_dofs,
26 const ConstView<size_t*>& target_active_dofs,
27 const ConstView<size_t* [6]>& base_node_freedom_table,
28 const ConstView<size_t* [6]>& target_node_freedom_table,
29 const ConstView<Kokkos::pair<size_t, size_t>*>& row_range,
30 const typename RowPtrType::const_type& row_ptrs
31 ) {
32 using RangePolicy = Kokkos::RangePolicy<typename RowPtrType::execution_space>;
33
34 const auto col_inds = IndicesType(
35 Kokkos::view_alloc("col_inds", Kokkos::WithoutInitializing),
36 static_cast<size_t>(num_non_zero)
37 );
38
39 const auto num_nodes = active_dofs.extent(0);
40 const auto num_constraints = row_range.extent(0);
41
42 Kokkos::parallel_for(
43 "ComputeSystemColInds", RangePolicy(0, num_nodes),
45 num_system_dofs, active_dofs, node_freedom_map_table, num_nodes_per_element,
46 node_state_indices, base_active_dofs, target_active_dofs, base_node_freedom_table,
47 target_node_freedom_table, row_range, row_ptrs, col_inds
48 }
49 );
50
51 Kokkos::parallel_for(
52 "ComputeConstraintsColInds", RangePolicy(0, num_constraints),
54 num_system_dofs, base_active_dofs, target_active_dofs, base_node_freedom_table,
55 target_node_freedom_table, row_range, row_ptrs, col_inds
56 }
57 );
58
59 return col_inds;
60 }
61};
62} // namespace kynema::solver
Definition calculate_error_sum_squares.hpp:5
The top level function object for computing the column indicies for the CRS matrix to be solved at ea...
Definition compute_col_inds.hpp:15
typename View< ValueType >::const_type ConstView
Definition compute_col_inds.hpp:19
Kokkos::View< ValueType, typename RowPtrType::device_type > View
Definition compute_col_inds.hpp:17
static IndicesType invoke(typename RowPtrType::value_type num_non_zero, size_t num_system_dofs, const ConstView< size_t * > &active_dofs, const ConstView< size_t * > &node_freedom_map_table, const ConstView< size_t * > &num_nodes_per_element, const ConstView< size_t ** > &node_state_indices, const ConstView< size_t * > &base_active_dofs, const ConstView< size_t * > &target_active_dofs, const ConstView< size_t *[6]> &base_node_freedom_table, const ConstView< size_t *[6]> &target_node_freedom_table, const ConstView< Kokkos::pair< size_t, size_t > * > &row_range, const typename RowPtrType::const_type &row_ptrs)
Definition compute_col_inds.hpp:21