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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/compute_constraints_col_inds.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
compute_constraints_col_inds.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
5namespace kynema::solver {
6
11template <typename RowPtrType, typename IndicesType>
13 using RowPtrValueType = typename RowPtrType::value_type;
14 using IndicesValueType = typename IndicesType::value_type;
15 using DeviceType = typename RowPtrType::device_type;
16 template <typename ValueType>
17 using View = Kokkos::View<ValueType, DeviceType>;
18 template <typename ValueType>
20
27 typename RowPtrType::const_type row_ptrs;
29
32 const auto target_cols = target_active_dofs(constraint);
33 for (auto column = 0U; column < target_cols; ++column, ++dof_index) {
34 const auto index = target_node_freedom_table(constraint, column);
35 col_inds(dof_index) = static_cast<IndicesValueType>(index);
36 }
37 return dof_index;
38 }
39
42 const auto base_cols = base_active_dofs(constraint);
43 for (auto column = 0U; column < base_cols; ++column, ++dof_index) {
44 const auto index = base_node_freedom_table(constraint, column);
45 col_inds(dof_index) = static_cast<IndicesValueType>(index);
46 }
47 return dof_index;
48 }
49
51 void operator()(size_t constraint) const {
52 const auto first_row = row_range(constraint).first;
53 const auto end_row = row_range(constraint).second;
54 for (auto row = first_row; row < end_row; ++row) {
56 const auto second_index = CalculateTargetInds(constraint, initial_index);
58 }
59 }
60};
61
62} // namespace kynema::solver
Definition calculate_error_sum_squares.hpp:5
A Kernel for computing the system constraints' contribution to the column indicies for the CRS matrix...
Definition compute_constraints_col_inds.hpp:12
Kokkos::View< ValueType, DeviceType > View
Definition compute_constraints_col_inds.hpp:17
KOKKOS_FUNCTION void operator()(size_t constraint) const
Definition compute_constraints_col_inds.hpp:51
IndicesType col_inds
Definition compute_constraints_col_inds.hpp:28
KOKKOS_FUNCTION RowPtrValueType CalculateBaseInds(size_t constraint, RowPtrValueType dof_index) const
Definition compute_constraints_col_inds.hpp:41
typename IndicesType::value_type IndicesValueType
Definition compute_constraints_col_inds.hpp:14
RowPtrType::const_type row_ptrs
Definition compute_constraints_col_inds.hpp:27
ConstView< size_t *[6]> target_node_freedom_table
Definition compute_constraints_col_inds.hpp:25
typename RowPtrType::device_type DeviceType
Definition compute_constraints_col_inds.hpp:15
KOKKOS_FUNCTION RowPtrValueType CalculateTargetInds(size_t constraint, RowPtrValueType dof_index) const
Definition compute_constraints_col_inds.hpp:31
ConstView< Kokkos::pair< size_t, size_t > * > row_range
Definition compute_constraints_col_inds.hpp:26
size_t num_system_dofs
Definition compute_constraints_col_inds.hpp:21
ConstView< size_t *[6]> base_node_freedom_table
Definition compute_constraints_col_inds.hpp:24
ConstView< size_t * > target_active_dofs
Definition compute_constraints_col_inds.hpp:23
typename View< ValueType >::const_type ConstView
Definition compute_constraints_col_inds.hpp:19
typename RowPtrType::value_type RowPtrValueType
Definition compute_constraints_col_inds.hpp:13
ConstView< size_t * > base_active_dofs
Definition compute_constraints_col_inds.hpp:22