1 #ifndef _COMPADRE_MISC_HPP_ 2 #define _COMPADRE_MISC_HPP_ 14 KOKKOS_INLINE_FUNCTION
15 XYZ(
double _x = 0.0,
double _y = 0.0,
double _z = 0.0) :
x(_x),
y(_y),
z(_z) {}
17 KOKKOS_INLINE_FUNCTION
20 XYZ(
const std::vector<scalar_type>& vec) :
x(vec[0]),
y(vec[1]),
z(vec[2]) {};
22 KOKKOS_INLINE_FUNCTION
28 KOKKOS_INLINE_FUNCTION
34 KOKKOS_INLINE_FUNCTION
40 KOKKOS_INLINE_FUNCTION
46 KOKKOS_INLINE_FUNCTION
52 KOKKOS_INLINE_FUNCTION
63 KOKKOS_INLINE_FUNCTION
74 KOKKOS_INLINE_FUNCTION
85 KOKKOS_INLINE_FUNCTION
87 return XYZ( vecA.
x + vecB.
x, vecA.
y + vecB.
y, vecA.
z + vecB.
z); }
89 KOKKOS_INLINE_FUNCTION
91 return XYZ( vecA.
x - vecB.
x, vecA.
y - vecB.
y, vecA.
z - vecB.
z); }
93 KOKKOS_INLINE_FUNCTION
95 return XYZ( vecA.
x * vecB.
x, vecA.
y * vecB.
y, vecA.
z * vecB.
z); }
97 KOKKOS_INLINE_FUNCTION
99 return XYZ( vecA.
x + constant, vecA.
y + constant, vecA.
z + constant); }
101 KOKKOS_INLINE_FUNCTION
103 return XYZ( vecA.
x + constant, vecA.
y + constant, vecA.
z + constant); }
105 KOKKOS_INLINE_FUNCTION
107 return XYZ( vecA.
x - constant, vecA.
y - constant, vecA.
z - constant); }
109 KOKKOS_INLINE_FUNCTION
111 return XYZ( constant - vecA.
x, constant - vecA.
y, constant - vecA.
z); }
113 KOKKOS_INLINE_FUNCTION
115 return XYZ( vecA.
x * constant, vecA.
y * constant, vecA.
z * constant); }
117 KOKKOS_INLINE_FUNCTION
119 return XYZ( vecA.
x * constant, vecA.
y * constant, vecA.
z * constant); }
121 KOKKOS_INLINE_FUNCTION
123 return XYZ( vecA.
x / constant, vecA.
y / constant, vecA.
z / constant); }
126 os <<
"(" << vec.
x <<
", " << vec.
y <<
", " << vec.
z <<
")" ;
return os; }
128 KOKKOS_INLINE_FUNCTION
138 KOKKOS_INLINE_FUNCTION
143 return dimension*added_alpha_size;
145 return added_alpha_size;
149 KOKKOS_INLINE_FUNCTION
158 RHS_row = RHS_col = N + added_coeff_size;
160 if (dense_solver_type !=
LU) {
164 RHS_row = RHS_col = N + added_coeff_size;
169 KOKKOS_INLINE_FUNCTION
179 out_row = M + added_alpha_size;
180 out_col = N + added_coeff_size;
182 if (dense_solver_type ==
LU) {
183 out_row = M + added_alpha_size;
184 out_col = N + added_coeff_size;
KOKKOS_INLINE_FUNCTION int getAdditionalAlphaSizeFromConstraint(DenseSolverType dense_solver_type, ConstraintType constraint_type)
KOKKOS_INLINE_FUNCTION scalar_type & operator[](const int i)
KOKKOS_INLINE_FUNCTION int getAdditionalCoeffSizeFromConstraintAndSpace(DenseSolverType dense_solver_type, ConstraintType constraint_type, ReconstructionSpace reconstruction_space, const int dimension)
Neumann Gradient Scalar Type.
KOKKOS_INLINE_FUNCTION XYZ operator-(const XYZ &vecA, const XYZ &vecB)
KOKKOS_INLINE_FUNCTION XYZ operator+(const XYZ &vecA, const XYZ &vecB)
KOKKOS_INLINE_FUNCTION XYZ operator+=(const XYZ &other)
KOKKOS_INLINE_FUNCTION XYZ(double _x=0.0, double _y=0.0, double _z=0.0)
KOKKOS_INLINE_FUNCTION XYZ operator*(double scalar)
KOKKOS_INLINE_FUNCTION XYZ operator*(const XYZ &vecA, const XYZ &vecB)
XYZ(const std::vector< scalar_type > &vec)
KOKKOS_INLINE_FUNCTION XYZ(const scalar_type *arry)
ReconstructionSpace
Space in which to reconstruct polynomial.
KOKKOS_INLINE_FUNCTION void getPDims(DenseSolverType dense_solver_type, ConstraintType constraint_type, ReconstructionSpace reconstruction_space, const int dimension, const int M, const int N, int &out_row, int &out_col)
KOKKOS_INLINE_FUNCTION XYZ operator-=(const XYZ &other)
std::ostream & operator<<(std::ostream &os, const XYZ &vec)
DenseSolverType
Dense solver type.
LU factorization performed on P^T*W*P matrix.
KOKKOS_INLINE_FUNCTION void getRHSDims(DenseSolverType dense_solver_type, ConstraintType constraint_type, ReconstructionSpace reconstruction_space, const int dimension, const int M, const int N, int &RHS_row, int &RHS_col)
KOKKOS_INLINE_FUNCTION XYZ operator*=(const double &scaling)
KOKKOS_INLINE_FUNCTION XYZ operator/(const XYZ &vecA, const scalar_type &constant)
Vector polynomial basis having # of components _dimensions, or (_dimensions-1) in the case of manifol...
ConstraintType
Constraint type.