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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/step/assemble_constraints_matrix.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
assemble_constraints_matrix.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <Kokkos_Profiling_ScopedRegion.hpp>
5
9#include "solver/solver.hpp"
10
11namespace kynema::step {
12template <typename DeviceType>
15) {
16 auto region = Kokkos::Profiling::ScopedRegion("Assemble Constraints Matrix");
17
18 using TeamPolicy = Kokkos::TeamPolicy<typename DeviceType::execution_space>;
19
20 auto constraint_policy =
21 TeamPolicy(static_cast<int>(constraints.num_constraints), Kokkos::AUTO());
22
23 Kokkos::parallel_for(
24 "CopyConstraintsToSparseMatrix", constraint_policy,
26 solver.num_system_dofs, constraints.row_range, constraints.base_node_freedom_signature,
28 constraints.target_node_freedom_table, constraints.base_gradient_terms,
29 constraints.target_gradient_terms, solver.A
30 }
31 );
32
33 Kokkos::parallel_for(
34 "CopyConstraintsTransposeToSparseMatrix", constraint_policy,
36 solver.num_system_dofs, constraints.row_range, constraints.base_node_freedom_signature,
39 constraints.target_gradient_transpose_terms, solver.A
40 }
41 );
42}
43} // namespace kynema::step
Definition assemble_constraints_matrix.hpp:11
void AssembleConstraintsMatrix(Solver< DeviceType > &solver, Constraints< DeviceType > &constraints)
Definition assemble_constraints_matrix.hpp:13
Container class for managing multiple constraints in a simulation.
Definition constraints.hpp:29
View< dof::FreedomSignature * > base_node_freedom_signature
Definition constraints.hpp:46
View< double *[6][6]> base_gradient_transpose_terms
Definition constraints.hpp:73
View< double *[6][6]> base_gradient_terms
Definition constraints.hpp:71
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
View< double *[6][6]> target_gradient_terms
Definition constraints.hpp:72
size_t num_constraints
Definition constraints.hpp:35
View< double *[6][6]> target_gradient_transpose_terms
Definition constraints.hpp:74
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
CrsMatrixType A
Definition solver.hpp:77
size_t num_system_dofs
Definition solver.hpp:74
KokkosSparse::CrsMatrix< ValueType, IndexType, DeviceType, void, IndexType > CrsMatrixType
Definition solver.hpp:65
A Kernel which copies the gradient matrix contributions for the base and target node of a constraint ...
Definition copy_constraints_to_sparse_matrix.hpp:15
A Kernel which copies the transpose gradient matrix contributions for the base and target node of a c...
Definition copy_constraints_transpose_to_sparse_matrix.hpp:15