/home/runner/work/kynema/kynema/kynema/src/elements/springs/springs.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/elements/springs/springs.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
springs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
6
7namespace kynema {
8
13template <typename DeviceType>
14struct Springs {
15 template <typename ValueType>
16 using View = Kokkos::View<ValueType, DeviceType>;
17
18 size_t num_elems; //< Total number of elements
19
20 View<size_t*> num_nodes_per_element; //< This is always 2 for springs
23 View<size_t* [2][3]> element_freedom_table; //< Only translational DOFs for springs
24
25 View<double* [3]> x0; //< Initial distance vector between nodes
26 View<double*> l_ref; //< Initial length of springs
27 View<double*> k; //< Spring stiffness coefficients
28
31
32 explicit Springs(const size_t n_spring_elems)
35 Kokkos::view_alloc("num_nodes_per_element", Kokkos::WithoutInitializing), num_elems
36 ),
38 Kokkos::view_alloc("node_state_indices", Kokkos::WithoutInitializing), num_elems
39 ),
41 Kokkos::view_alloc("element_freedom_signature", Kokkos::WithoutInitializing), num_elems
42 ),
44 Kokkos::view_alloc("element_freedom_table", Kokkos::WithoutInitializing), num_elems
45 ),
50 Kokkos::view_alloc("residual_vector_terms", Kokkos::WithoutInitializing), num_elems
51 ),
53 Kokkos::view_alloc("stiffness_matrix_terms", Kokkos::WithoutInitializing), num_elems
54 ) {
55 Kokkos::deep_copy(num_nodes_per_element, 2); // Always 2 nodes per element
56 Kokkos::deep_copy(
58 ); // Springs only have translational DOFs
59 }
60};
61
62} // namespace kynema
Definition calculate_constraint_output.hpp:8
Contains field variables for spring elements to compute per-element contributions to the residual vec...
Definition springs.hpp:14
size_t num_elems
Definition springs.hpp:18
View< size_t *[2][3]> element_freedom_table
Definition springs.hpp:23
View< double * > l_ref
Definition springs.hpp:26
Springs(const size_t n_spring_elems)
Definition springs.hpp:32
View< size_t *[2]> node_state_indices
Definition springs.hpp:21
Kokkos::View< ValueType, DeviceType > View
Definition springs.hpp:16
View< dof::FreedomSignature *[2]> element_freedom_signature
Definition springs.hpp:22
View< double * > k
Definition springs.hpp:27
View< size_t * > num_nodes_per_element
Definition springs.hpp:20
View< double *[2][3]> residual_vector_terms
Definition springs.hpp:29
View< double *[3]> x0
Definition springs.hpp:25
View< double *[2][2][3][3]> stiffness_matrix_terms
Definition springs.hpp:30