Compadre
1.5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
src
constraints
Compadre_CreateConstraints.hpp
Go to the documentation of this file.
1
#ifndef _CREATE_CONSTRAINTS_
2
#define _CREATE_CONSTRAINTS_
3
4
#include "
Compadre_GMLS.hpp
"
5
6
namespace
Compadre
{
7
8
KOKKOS_INLINE_FUNCTION
9
void
evaluateConstraints
(
scratch_matrix_right_type
M,
scratch_matrix_right_type
PsqrtW,
const
ConstraintType
constraint_type,
const
ReconstructionSpace
reconstruction_space,
const
int
NP,
const
double
cutoff_p,
const
int
dimension,
const
int
num_neighbors = 0,
scratch_matrix_right_type
* T = NULL) {
10
if
(constraint_type ==
ConstraintType::NEUMANN_GRAD_SCALAR
) {
11
if
(reconstruction_space ==
ReconstructionSpace::ScalarTaylorPolynomial
12
|| reconstruction_space ==
ReconstructionSpace::VectorOfScalarClonesTaylorPolynomial
) {
13
// Fill in the bottom right entry for PsqrtW
14
PsqrtW(num_neighbors, PsqrtW.extent(1)-1) = 1.0;
15
16
// Fill in the last column and row of M
17
for
(
int
i=0; i<dimension; ++i) {
18
M(M.extent(0)-1, i+1) = (1.0/cutoff_p)*(*T)(dimension-1,i);
19
M(i+1, M.extent(0)-1) = (1.0/cutoff_p)*(*T)(dimension-1,i);
20
}
21
}
else
if
(reconstruction_space ==
ReconstructionSpace::VectorTaylorPolynomial
) {
22
// Fill in the bottom right of PsqrtW
23
for
(
int
i=0; i<dimension; ++i) {
24
PsqrtW(num_neighbors, PsqrtW.extent(1) - 1 - i) = 1.0;
25
}
26
27
// Fill in the last column and row of M
28
for
(
int
i=0; i<dimension; ++i) {
29
for
(
int
j=0; j<dimension; ++j) {
30
M(i*NP, M.extent(0) - 1 - j) = (*T)(dimension-1,i);
31
M(M.extent(0) - 1 - j, i*NP) = (*T)(dimension-1,i);
32
}
33
}
34
}
35
}
36
}
37
38
}
39
#endif
Compadre_GMLS.hpp
scratch_matrix_right_type
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Definition
Compadre_Typedefs.hpp:59
Compadre
Definition
Compadre_ApplyTargetEvaluations.hpp:5
Compadre::ConstraintType
ConstraintType
Constraint type.
Definition
Compadre_Operators.hpp:226
Compadre::NEUMANN_GRAD_SCALAR
@ NEUMANN_GRAD_SCALAR
Neumann Gradient Scalar Type.
Definition
Compadre_Operators.hpp:230
Compadre::evaluateConstraints
KOKKOS_INLINE_FUNCTION void evaluateConstraints(scratch_matrix_right_type M, scratch_matrix_right_type PsqrtW, const ConstraintType constraint_type, const ReconstructionSpace reconstruction_space, const int NP, const double cutoff_p, const int dimension, const int num_neighbors=0, scratch_matrix_right_type *T=NULL)
Definition
Compadre_CreateConstraints.hpp:9
Compadre::ReconstructionSpace
ReconstructionSpace
Space in which to reconstruct polynomial.
Definition
Compadre_Operators.hpp:95
Compadre::VectorTaylorPolynomial
@ VectorTaylorPolynomial
Vector polynomial basis having # of components _dimensions, or (_dimensions-1) in the case of manifol...
Definition
Compadre_Operators.hpp:101
Compadre::ScalarTaylorPolynomial
@ ScalarTaylorPolynomial
Definition
Compadre_Operators.hpp:99
Compadre::VectorOfScalarClonesTaylorPolynomial
@ VectorOfScalarClonesTaylorPolynomial
Definition
Compadre_Operators.hpp:104
Generated by
1.17.0