/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
32 // Update the state prediction for a DYNAMIC solve
33 if (parameters.is_dynamic_solve) {
34 Kokkos::parallel_for(
35 "UpdateDynamicPrediction", range_policy,
37 parameters.h,
38 parameters.beta_prime,
39 parameters.gamma_prime,
42 solver.x,
43 state.q_delta,
44 state.v,
45 state.vd,
46 }
47 );
48 } else {
49 // Update the state prediction for a STATIC solve
50 Kokkos::parallel_for(
51 "UpdateStaticPrediction", range_policy,
53 parameters.h,
56 solver.x,
57 state.q_delta,
58 }
59 );
60 }
61
62 Kokkos::parallel_for(
63 "CalculateDisplacement", range_policy,
65 parameters.h,
66 state.q_delta,
67 state.q_prev,
68 state.q,
69 }
70 );
71}
72
73} // 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