/home/runner/work/kynema/kynema/kynema/src/state/clone_state.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/state/clone_state.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
clone_state.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "state.hpp"
4
5namespace kynema {
6
16template <typename DeviceType>
18 using Kokkos::deep_copy;
19
20 auto clone = State<DeviceType>(old.num_system_nodes);
21 clone.time_step = old.time_step;
22 deep_copy(clone.ID, old.ID);
23 deep_copy(clone.node_freedom_allocation_table, old.node_freedom_allocation_table);
24 deep_copy(clone.node_freedom_map_table, old.node_freedom_map_table);
25 deep_copy(clone.x0, old.x0);
26 deep_copy(clone.x, old.x);
27 deep_copy(clone.q_delta, old.q_delta);
28 deep_copy(clone.q_prev, old.q_prev);
29 deep_copy(clone.q, old.q);
30 deep_copy(clone.v, old.v);
31 deep_copy(clone.vd, old.vd);
32 deep_copy(clone.a, old.a);
33 deep_copy(clone.f, old.f);
34 deep_copy(clone.tangent, old.tangent);
35 return clone;
36}
37
38} // namespace kynema
Definition calculate_constraint_output.hpp:8
State< DeviceType > CloneState(const State< DeviceType > &old)
Creates a new state object and performs a deep copy of the data in the old one. This is primarily for...
Definition clone_state.hpp:17
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
View< double *[7]> x0
Definition state.hpp:29
View< double *[6]> v
Definition state.hpp:34
View< double *[6]> a
Definition state.hpp:36
View< double *[7]> q_prev
Definition state.hpp:32
View< double *[7]> x
Definition state.hpp:30
View< double *[6][6]> tangent
Definition state.hpp:38
View< double *[6]> q_delta
Definition state.hpp:31
View< double *[7]> q
Definition state.hpp:33
View< double *[6]> vd
Definition state.hpp:35
View< dof::FreedomSignature * > node_freedom_allocation_table
Definition state.hpp:25
View< size_t * > ID
Definition state.hpp:24
size_t time_step
Definition state.hpp:22
size_t num_system_nodes
Definition state.hpp:23
View< size_t * > node_freedom_map_table
Definition state.hpp:27
View< double *[6]> f
Definition state.hpp:37