/home/runner/work/kynema/kynema/kynema/src/solver/calculate_error_sum_squares.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/calculate_error_sum_squares.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
calculate_error_sum_squares.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4
5namespace kynema::solver {
6
11template <typename DeviceType>
14 using TeamPolicy = typename Kokkos::TeamPolicy<typename DeviceType::execution_space>;
15 using member_type = typename TeamPolicy::member_type;
16 template <typename ValueType>
17 using View = Kokkos::View<ValueType, DeviceType>;
18 template <typename ValueType>
20 template <typename ValueType>
21 using LeftView = Kokkos::View<ValueType, Kokkos::LayoutLeft, DeviceType>;
22 template <typename ValueType>
24
25 double atol;
26 double rtol;
27 double h;
32
34 void operator()(size_t node, double& err) const {
35 const auto n_node_dofs = active_dofs(node);
36 const auto node_first_dof = node_freedom_map_table(node);
37 for (auto component = 0U; component < n_node_dofs; ++component) {
38 const auto pi = x(node_first_dof + component, 0);
39 const auto xi = q_delta(node, component) * h;
40 const auto err_sqrt = pi / (atol + rtol * Kokkos::abs(xi));
42 }
43 }
44};
45
50template <typename DeviceType>
53 template <typename ValueType>
54 using View = Kokkos::View<ValueType, DeviceType>;
55 template <typename ValueType>
57 template <typename ValueType>
58 using LeftView = Kokkos::View<ValueType, Kokkos::LayoutLeft, DeviceType>;
59 template <typename ValueType>
61
62 double atol;
63 double rtol;
68
70 void operator()(size_t constraint, double& err) const {
71 const auto first_index = row_range(constraint).first;
72 const auto max_index = row_range(constraint).second;
73 for (auto row = first_index; row < max_index; ++row) {
74 const auto pi = x(num_system_dofs + row, 0);
75 const auto xi = lambda(constraint, row - first_index);
76 const auto err_sqrt = pi / (atol + rtol * Kokkos::abs(xi));
78 }
79 }
80};
81
82} // namespace kynema::solver
Definition calculate_error_sum_squares.hpp:5
Reduction Kernel which calculates the sum of the squares of the error for each constraint for use in ...
Definition calculate_error_sum_squares.hpp:51
ConstView< double *[6]> lambda
Definition calculate_error_sum_squares.hpp:66
size_t num_system_dofs
Definition calculate_error_sum_squares.hpp:64
double rtol
Definition calculate_error_sum_squares.hpp:63
KOKKOS_INLINE_FUNCTION void operator()(size_t constraint, double &err) const
Definition calculate_error_sum_squares.hpp:70
Kokkos::View< ValueType, DeviceType > View
Definition calculate_error_sum_squares.hpp:54
typename View< ValueType >::const_type ConstView
Definition calculate_error_sum_squares.hpp:56
ConstLeftView< double *[1]> x
Definition calculate_error_sum_squares.hpp:67
double value_type
Definition calculate_error_sum_squares.hpp:52
ConstView< Kokkos::pair< size_t, size_t > * > row_range
Definition calculate_error_sum_squares.hpp:65
typename LeftView< ValueType >::const_type ConstLeftView
Definition calculate_error_sum_squares.hpp:60
Kokkos::View< ValueType, Kokkos::LayoutLeft, DeviceType > LeftView
Definition calculate_error_sum_squares.hpp:58
double atol
Definition calculate_error_sum_squares.hpp:62
Reduction Kernel which calculates the sum of the square of the errors for each node in the system for...
Definition calculate_error_sum_squares.hpp:12
double rtol
Definition calculate_error_sum_squares.hpp:26
Kokkos::View< ValueType, Kokkos::LayoutLeft, DeviceType > LeftView
Definition calculate_error_sum_squares.hpp:21
KOKKOS_INLINE_FUNCTION void operator()(size_t node, double &err) const
Definition calculate_error_sum_squares.hpp:34
typename Kokkos::TeamPolicy< typename DeviceType::execution_space > TeamPolicy
Definition calculate_error_sum_squares.hpp:14
ConstLeftView< double *[1]> x
Definition calculate_error_sum_squares.hpp:31
typename LeftView< ValueType >::const_type ConstLeftView
Definition calculate_error_sum_squares.hpp:23
double value_type
Definition calculate_error_sum_squares.hpp:13
double h
Definition calculate_error_sum_squares.hpp:27
double atol
Definition calculate_error_sum_squares.hpp:25
ConstView< size_t * > active_dofs
Definition calculate_error_sum_squares.hpp:28
typename View< ValueType >::const_type ConstView
Definition calculate_error_sum_squares.hpp:19
ConstView< double *[6]> q_delta
Definition calculate_error_sum_squares.hpp:30
typename TeamPolicy::member_type member_type
Definition calculate_error_sum_squares.hpp:15
ConstView< size_t * > node_freedom_map_table
Definition calculate_error_sum_squares.hpp:29
Kokkos::View< ValueType, DeviceType > View
Definition calculate_error_sum_squares.hpp:17