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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/step/update_state_prediction.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
update_state_prediction.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <Kokkos_Profiling_ScopedRegion.hpp>
5
6#include "solver/solver.hpp"
8#include "state/state.hpp"
11#include "step_parameters.hpp"
12
13namespace kynema::step {
14
24template <typename DeviceType>
26 StepParameters& parameters, const Solver<DeviceType>& solver, State<DeviceType>& state
27) {
28 auto region = Kokkos::Profiling::ScopedRegion("Update State Prediction");
29 using RangePolicy = Kokkos::RangePolicy<typename DeviceType::execution_space>;
30 auto range_policy = RangePolicy(0, solver.num_system_nodes);
31 if (parameters.is_dynamic_solve) {
32 Kokkos::parallel_for(
33 "UpdateDynamicPrediction", range_policy,
35 parameters.h,
36 parameters.beta_prime,
37 parameters.gamma_prime,
40 solver.x,
41 state.q_delta,
42 state.v,
43 state.vd,
44 }
45 );
46 } else {
47 Kokkos::parallel_for(
48 "UpdateStaticPrediction", range_policy,
50 parameters.h,
53 solver.x,
54 state.q_delta,
55 }
56 );
57 }
58
59 Kokkos::parallel_for(
60 "CalculateDisplacement", range_policy,
62 parameters.h,
63 state.q_delta,
64 state.q_prev,
65 state.q,
66 }
67 );
68}
69
70} // namespace kynema::step
Definition assemble_constraints_matrix.hpp:11
void UpdateStatePrediction(StepParameters &parameters, const Solver< DeviceType > &solver, State< DeviceType > &state)
Updates the predicted next state values, based on computed solver solution, solver....
Definition update_state_prediction.hpp:25
This object manages the assembly and solution of linear system arising from the generalized-alpha bas...
Definition solver.hpp:21
size_t num_system_nodes
Definition solver.hpp:73
MultiVectorType x
Definition solver.hpp:79
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 *[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 * > node_freedom_map_table
Definition state.hpp:27
A Struct containing the paramters used to control the time stepping process.
Definition step_parameters.hpp:12
double gamma_prime
Definition step_parameters.hpp:20
double beta_prime
Definition step_parameters.hpp:21
bool is_dynamic_solve
Definition step_parameters.hpp:13
double h
Definition step_parameters.hpp:15
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 update the velocity, acceleration, and change in state at a node for a dynamic problem.
Definition update_dynamic_prediction.hpp:14
A Kernel to update the change in state at a node for a static problem.
Definition update_static_prediction.hpp:13