/home/runner/work/kynema/kynema/kynema/src/step/predict_next_state.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/step/predict_next_state.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
predict_next_state.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <Kokkos_Profiling_ScopedRegion.hpp>
5
8#include "state/state.hpp"
9#include "step_parameters.hpp"
10
11namespace kynema::step {
12
13template <typename DeviceType>
14inline void PredictNextState(StepParameters& parameters, State<DeviceType>& state) {
15 auto region = Kokkos::Profiling::ScopedRegion("Predict Next State");
16
17 using RangePolicy = Kokkos::RangePolicy<typename DeviceType::execution_space>;
18
19 Kokkos::deep_copy(state.q_prev, state.q);
20
21 Kokkos::parallel_for(
22 "CalculateNextState", RangePolicy(0, state.v.extent(0)),
24 parameters.h,
25 parameters.alpha_f,
26 parameters.alpha_m,
27 parameters.beta,
28 parameters.gamma,
29 state.q_delta,
30 state.v,
31 state.vd,
32 state.a,
33 }
34 );
35
36 Kokkos::parallel_for(
37 "CalculateDisplacement", RangePolicy(0, state.q.extent(0)),
39 parameters.h,
40 state.q_delta,
41 state.q_prev,
42 state.q,
43 }
44 );
45
46 state.time_step++;
47}
48
49} // namespace kynema::step
Definition assemble_constraints_matrix.hpp:11
void PredictNextState(StepParameters &parameters, State< DeviceType > &state)
Definition predict_next_state.hpp:14
Container for storing the complete system state of the simulation at a given time increment.
Definition state.hpp:18
View< double *[6]> v
Definition state.hpp:34
View< double *[7]> q_prev
Definition state.hpp:32
View< double *[7]> q
Definition state.hpp:33
size_t time_step
Definition state.hpp:22
A Struct containing the paramters used to control the time stepping process.
Definition step_parameters.hpp:12
A Kernel for applying the computed change in state (displacement) to the previous state to get an est...
Definition calculate_displacement.hpp:14
A Kernel to predict the next state values before nonlinear iteration begins for a given time step.
Definition calculate_next_state.hpp:12