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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/dof_management/create_constraint_freedom_table.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
create_constraint_freedom_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 template <typename ValueType>
17 using View = Kokkos::View<ValueType, DeviceType>;
18 template <typename ValueType>
20
28
30 void operator()(size_t constraint) const {
31 {
32 const auto node_index = target_node_index(constraint);
34 for (auto component = 0U; component < num_active_dofs; ++component) {
37 }
38 }
39 if (GetNumberOfNodes(type(constraint)) == 2U) {
40 const auto node_index = base_node_index(constraint);
42 for (auto component = 0U; component < num_active_dofs; ++component) {
45 }
46 } else {
47 for (auto component = 0U; component < 6U; ++component) {
48 base_node_freedom_table(constraint, component) = 0UL;
49 }
50 }
51 }
52};
53
65template <typename DeviceType>
67 Constraints<DeviceType>& constraints, const State<DeviceType>& state
68) {
69 using RangePolicy = Kokkos::RangePolicy<typename DeviceType::execution_space>;
70 auto constraints_range = RangePolicy(0, constraints.num_constraints);
71
72 Kokkos::parallel_for(
73 "Create Constraint Node Freedom Table", constraints_range,
75 constraints.type, constraints.target_node_index, constraints.base_node_index,
77 constraints.base_node_freedom_table
78 }
79 );
80}
81
82} // namespace kynema::dof
Definition assemble_node_freedom_allocation_table.hpp:10
void create_constraint_freedom_table(Constraints< DeviceType > &constraints, const State< DeviceType > &state)
Creates node freedom tables for each the target and base nodes in the constraints.
Definition create_constraint_freedom_table.hpp:66
Container class for managing multiple constraints in a simulation.
Definition constraints.hpp:29
View< size_t * > base_node_index
Definition constraints.hpp:41
View< size_t * > target_node_index
Definition constraints.hpp:42
View< size_t *[6]> base_node_freedom_table
Definition constraints.hpp:50
size_t num_constraints
Definition constraints.hpp:35
View< constraints::ConstraintType * > type
Definition constraints.hpp:39
View< size_t *[6]> target_node_freedom_table
Definition constraints.hpp:51
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
View< size_t * > active_dofs
Definition state.hpp:26
View< size_t * > node_freedom_map_table
Definition state.hpp:27
A Kernel that creates the node freedom tables for each the target and base nodes for a given constrai...
Definition create_constraint_freedom_table.hpp:15
typename View< ValueType >::const_type ConstView
Definition create_constraint_freedom_table.hpp:19
Kokkos::View< ValueType, DeviceType > View
Definition create_constraint_freedom_table.hpp:17
View< size_t *[6]> base_node_freedom_table
Definition create_constraint_freedom_table.hpp:27
KOKKOS_FUNCTION void operator()(size_t constraint) const
Definition create_constraint_freedom_table.hpp:30
ConstView< constraints::ConstraintType * > type
Definition create_constraint_freedom_table.hpp:21
View< size_t *[6]> target_node_freedom_table
Definition create_constraint_freedom_table.hpp:26
ConstView< size_t * > node_freedom_map_table
Definition create_constraint_freedom_table.hpp:25
ConstView< size_t * > base_node_index
Definition create_constraint_freedom_table.hpp:23
ConstView< size_t * > active_dofs
Definition create_constraint_freedom_table.hpp:24
ConstView< size_t * > target_node_index
Definition create_constraint_freedom_table.hpp:22