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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/step/assemble_constraints_residual.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
assemble_constraints_residual.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <Kokkos_Profiling_ScopedRegion.hpp>
5
10#include "solver/solver.hpp"
11
12namespace kynema::step {
13
14template <typename DeviceType>
17) {
18 auto resid_region = Kokkos::Profiling::ScopedRegion("Assemble Constraints Residual");
19
20 if (constraints.num_constraints == 0) {
21 return;
22 }
23
24 auto range_policy =
25 Kokkos::RangePolicy<typename DeviceType::execution_space>(0, constraints.num_constraints);
26
27 Kokkos::parallel_for(
28 "ContributeConstraintsSystemResidualToVector", range_policy,
30 constraints.target_node_freedom_table, constraints.target_active_dofs,
31 constraints.system_residual_terms, solver.b
32 }
33 );
34
35 Kokkos::parallel_for(
36 "ContributeLambdaToVector", range_policy,
41 solver.b
42 }
43 );
44
45 Kokkos::parallel_for(
46 "CopyConstraintsResidualToVector", range_policy,
48 solver.num_system_dofs, constraints.row_range, constraints.residual_terms, solver.b
49 }
50 );
51}
52
53} // namespace kynema::step
Definition assemble_constraints_matrix.hpp:11
void AssembleConstraintsResidual(Solver< DeviceType > &solver, Constraints< DeviceType > &constraints)
Definition assemble_constraints_residual.hpp:15
Container class for managing multiple constraints in a simulation.
Definition constraints.hpp:29
View< size_t * > target_active_dofs
Definition constraints.hpp:49
View< dof::FreedomSignature * > base_node_freedom_signature
Definition constraints.hpp:46
View< double *[6]> residual_terms
Definition constraints.hpp:67
View< double *[6]> base_lambda_residual_terms
Definition constraints.hpp:68
View< double *[6]> system_residual_terms
Definition constraints.hpp:70
View< Kokkos::pair< size_t, size_t > * > row_range
Definition constraints.hpp:45
View< dof::FreedomSignature * > target_node_freedom_signature
Definition constraints.hpp:47
View< size_t *[6]> base_node_freedom_table
Definition constraints.hpp:50
size_t num_constraints
Definition constraints.hpp:35
View< double *[6]> target_lambda_residual_terms
Definition constraints.hpp:69
View< size_t *[6]> target_node_freedom_table
Definition constraints.hpp:51
This object manages the assembly and solution of linear system arising from the generalized-alpha bas...
Definition solver.hpp:21
MultiVectorType b
Definition solver.hpp:78
size_t num_system_dofs
Definition solver.hpp:74
A Kernel which sums the system residual contributions for a constraint's target node into the correct...
Definition contribute_constraints_system_residual_to_vector.hpp:12
A kernel which contributes the constraint Lagrange multiplier terms to the correct locations in the g...
Definition contribute_lambda_to_vector.hpp:14
A Kernel which copies the residual contributions for each constraint to their correct location in the...
Definition copy_constraints_residual_to_vector.hpp:12