16 #include <Kokkos_Core.hpp> 19 #include <stk_util/environment/ReportHandler.hpp> 26 #include <type_traits> 43 template <
typename ViewType>
46 ViewType interpWeights{
"interpolation_weights"};
49 for (
unsigned ip = 0; ip < interpWeights.extent(0); ++ip) {
50 for (
unsigned n = 0; n < 27; ++n) {
51 interpWeights(ip, n) = interps[shape_index];
58 template <
typename ViewType>
61 ViewType referenceGradWeights{
"reference_gradient_weights"};
64 for (
unsigned ip = 0; ip < referenceGradWeights.extent(0); ++ip) {
65 for (
unsigned n = 0; n < 27; ++n) {
66 for (
unsigned d = 0; d < 3; ++d) {
67 referenceGradWeights(ip,n,d) = derivs[deriv_index];
72 return referenceGradWeights;
75 template <
typename ViewType>
78 ViewType interpWeights{
"interpolation_weights"};
81 for (
unsigned ip = 0; ip < interpWeights.extent(0); ++ip) {
82 for (
unsigned n = 0; n < 27; ++n) {
90 template <
typename ViewType>
93 ViewType referenceGradWeights{
"reference_gradient_weights"};
96 for (
unsigned ip = 0; ip < referenceGradWeights.extent(0); ++ip) {
97 for (
unsigned n = 0; n < 27; ++n) {
98 for (
unsigned d = 0; d < 3; ++d) {
99 referenceGradWeights(ip,n,d) =
shapeDerivs_[deriv_index];
104 return referenceGradWeights;
118 int gaussPointOrdinal)
const;
122 int gaussPointOrdinal)
const;
125 int s1Node,
int s2Node,
int s3Node,
126 int s1Ip,
int s2Ip,
int s3Ip)
const;
129 int s1Node,
int s2Node,
130 int s1Ip,
int s2Ip)
const;
145 const double *par_coord,
153 const double *isoParCoord,
158 const double *elemNodalCoord,
159 const double *pointCoord,
160 double *isoParCoord);
183 const double *par_coord,
191 using InterpWeightType = Kokkos::View<DoubleType[AlgTraits::numScvIp_][AlgTraits::nodesPerElement_]>;
192 using GradWeightType = Kokkos::View<DoubleType[AlgTraits::numScvIp_][AlgTraits::nodesPerElement_][AlgTraits::nDim_]>;
206 const double *coords,
211 {
return interpWeights_; }
214 {
return referenceGradWeights_; }
217 template <
typename GradViewType,
typename CoordViewType,
typename OutputViewType>
218 void weighted_volumes(GradViewType referenceGradWeights, CoordViewType coords, OutputViewType volume)
220 generic_determinant_3d<AlgTraits>(referenceGradWeights, coords, volume);
222 volume(ip) *= ipWeight_[ip];
228 void set_interior_info();
230 double jacobian_determinant(
246 using InterpWeightType = Kokkos::View<DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]>;
247 using GradWeightType = Kokkos::View<DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_][AlgTraits::nDim_]>;
276 const double *coords,
282 const double *coords,
290 const double *coords,
298 const int face_ordinal,
299 const double *coords,
305 const double *coords,
311 const int face_ordinal,
312 const double *isoParCoord,
313 const double *coords,
319 const int & side_ordinal,
321 const double *side_pcoords,
322 double *elem_pcoords);
329 const int ordinal,
const int node);
332 const int ordinal,
const int node);
337 {
return interpWeights_; }
340 {
return referenceGradWeights_; }
342 template <
typename GradViewType,
typename CoordViewType,
typename OutputViewType>
345 using ftype =
typename CoordViewType::value_type;
347 static_assert(std::is_same<ftype, typename OutputViewType::value_type>::value,
"Incompatiable value type for views");
348 static_assert(CoordViewType::Rank == 2,
"Coordinate view assumed to be 2D");
349 static_assert(OutputViewType::Rank == 2,
"area_vector view assumed to be 2D");
353 constexpr
int t_start = 1*ipsPerDirection;
354 constexpr
int s_start = 2*ipsPerDirection;
358 for (
int ip = 0; ip < t_start; ++ip) {
360 area_vector<Jacobian::U_DIRECTION>(ip, referenceGradWeights, coords, areav);
363 for (
int ip = t_start; ip < s_start; ++ip) {
365 area_vector<Jacobian::T_DIRECTION>(ip, referenceGradWeights, coords, areav);
370 area_vector<Jacobian::S_DIRECTION>(ip, referenceGradWeights, coords, areav);
373 for (
int ip = 0; ip < 216; ++ip) {
374 const ftype
weight = ipInfo_[ip].weight;
385 void set_interior_info();
386 void set_boundary_info();
388 template <Jacobian::Direction dir>
399 template <
int direction,
typename GradViewType,
typename CoordViewType,
typename OutputViewType>
400 void area_vector(
int ip, GradViewType referenceGradWeights, CoordViewType coords, OutputViewType areav)
405 using ftype =
typename CoordViewType::value_type;
407 static_assert(std::is_same<ftype, typename OutputViewType::value_type>::value,
408 "Incompatiable value type for views");
410 static_assert(CoordViewType::Rank == 2,
"Coordinate view assumed to be 2D");
411 static_assert(OutputViewType::Rank == 2,
"areav view assumed to be 2D");
413 ftype sjac[3][2] = { {0.0, 0.0}, {0.0, 0.0}, {0.0, 0.0} };
415 const ftype dn_ds1 = referenceGradWeights(ip, n, s1Component);
416 const ftype dn_ds2 = referenceGradWeights(ip, n, s2Component);
418 sjac[0][0] += dn_ds1 * coords(n,0);
419 sjac[0][1] += dn_ds2 * coords(n,0);
421 sjac[1][0] += dn_ds1 * coords(n,1);
422 sjac[1][1] += dn_ds2 * coords(n,1);
424 sjac[2][0] += dn_ds1 * coords(n,2);
425 sjac[2][1] += dn_ds2 * coords(n,2);
427 areav(ip, 0) = sjac[1][0] * sjac[2][1] - sjac[2][0] * sjac[1][1];
428 areav(ip, 1) = sjac[2][0] * sjac[0][1] - sjac[0][0] * sjac[2][1];
429 areav(ip, 2) = sjac[0][0] * sjac[1][1] - sjac[1][0] * sjac[0][1];
452 const double *coords,
457 const double *elemNodalCoord,
458 const double *pointCoord,
459 double *isoParCoord);
463 const double *isoParCoord,
469 const double *isoParCoord,
473 const double *isoParCoord,
474 const double *coords,
478 void set_interior_info();
490 void quad9_shape_fcn(
492 const double *par_coord,
496 void quad9_shape_deriv(
498 const double *par_coord,
502 void non_unit_face_normal(
503 const double *isoParCoord,
504 const double *elemNodalCoord,
505 double *normalVector);
int ipsPerFace_
Definition: Hex27CVFEM.h:438
Definition: Hex27CVFEM.h:244
virtual void eval_shape_derivs_at_ips()
Definition: Hex27CVFEM.C:302
virtual ~HexahedralP2Element()
Definition: Hex27CVFEM.h:37
Definition: ABLForcingAlgorithm.C:26
virtual void face_grad_op(const int nelem, const int face_ordinal, const double *coords, double *gradop, double *det_j, double *error)
Definition: MasterElement.h:152
std::vector< double > gaussAbscissae1D_
Definition: Hex27CVFEM.h:167
Definition: MasterElement.h:53
std::vector< double > expFaceShapeDerivs_
Definition: Hex27CVFEM.h:179
virtual const int * side_node_ordinals(int sideOrdinal)
Definition: MasterElement.h:237
double weight
Definition: Hex27CVFEM.h:111
GradWeightType referenceGradWeights_
Definition: Hex27CVFEM.h:433
virtual void eval_shape_functions_at_shifted_ips()
Definition: Hex27CVFEM.C:312
std::vector< double > scsEndLoc_
Definition: Hex27CVFEM.h:171
Kokkos::View< DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]> InterpWeightType
Definition: Hex27CVFEM.h:246
void GLLGLL_quadrature_weights()
virtual void eval_shape_derivs_at_shifted_ips()
Definition: Hex27CVFEM.C:322
virtual int opposingNodes(const int ordinal, const int node)
Definition: MasterElement.h:186
static constexpr int nodesPerElement_
Definition: AlgTraits.h:29
GradWeightType shiftedReferenceGradWeights_
Definition: Hex27CVFEM.h:238
virtual void general_shape_fcn(const int numIp, const double *isoParCoord, double *shpfc)
Definition: MasterElement.h:209
Definition: AlgTraits.h:27
virtual double isInElement(const double *elemNodalCoord, const double *pointCoord, double *isoParCoord)
Definition: Hex27CVFEM.C:119
const double scsDist_
Definition: Hex27CVFEM.h:162
const InterpWeightType & shape_function_values()
Definition: Hex27CVFEM.h:336
void weighted_area_vectors(GradViewType referenceGradWeights, CoordViewType coords, OutputViewType areav)
Definition: Hex27CVFEM.h:343
Definition: Hex27CVFEM.h:109
virtual const int * adjacentNodes()
Definition: MasterElement.h:170
Definition: MasterElement.h:42
virtual int opposingFace(const int ordinal, const int node)
Definition: MasterElement.h:190
std::vector< double > gaussAbscissae_
Definition: Hex27CVFEM.h:168
Jacobian::Direction direction
Definition: Hex27CVFEM.h:110
Kokkos::View< DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_][AlgTraits::nDim_]> GradWeightType
Definition: Hex27CVFEM.h:247
const GradWeightType & shape_function_derivatives()
Definition: Hex27CVFEM.h:339
GradWeightType shiftedReferenceGradWeights_
Definition: Hex27CVFEM.h:436
virtual void determinant(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType ** > &areav)
Definition: MasterElement.h:94
virtual ~Quad93DSCS()
Definition: Hex27CVFEM.h:446
std::vector< double > shapeDerivsShift_
Definition: Hex27CVFEM.h:178
void set_quadrature_rule()
Definition: Hex27CVFEM.C:67
#define POINTER_RESTRICT
Definition: MasterElement.h:29
std::vector< double > gaussAbscissaeShift_
Definition: Hex27CVFEM.h:169
void shifted_shape_fcn(double *shpfc)
Definition: Hex27CVFEM.C:280
const GradWeightType & shape_function_derivatives()
Definition: Hex27CVFEM.h:213
std::vector< double > shapeFunctions_
Definition: Hex27CVFEM.h:175
GradWeightType referenceGradWeights_
Definition: Hex27CVFEM.h:235
Definition: MasterElement.h:44
ViewType copy_interpolation_weights_to_view()
Definition: Hex27CVFEM.h:76
Definition: MasterElement.h:43
std::vector< double > gaussWeight_
Definition: Hex27CVFEM.h:170
ViewType copy_deriv_weights_to_view(const std::vector< double > &derivs)
Definition: Hex27CVFEM.h:59
void eval_shape_derivs_at_face_ips()
Definition: Hex27CVFEM.C:332
std::vector< int > stkNodeMap_
Definition: Hex27CVFEM.h:173
static constexpr int numScvIp_
Definition: AlgTraits.h:31
ViewType copy_deriv_weights_to_view()
Definition: Hex27CVFEM.h:91
void hex27_shape_fcn(int npts, const double *par_coord, double *shape_fcn) const
Definition: Hex27CVFEM.C:346
virtual void sidePcoords_to_elemPcoords(const int &side_ordinal, const int &npoints, const double *side_pcoords, double *elem_pcoords)
Definition: MasterElement.h:230
double tensor_product_weight(int s1Node, int s2Node, int s3Node, int s1Ip, int s2Ip, int s3Ip) const
Definition: Hex27CVFEM.C:231
virtual ~Hex27SCV()
Definition: Hex27CVFEM.h:196
void weighted_volumes(GradViewType referenceGradWeights, CoordViewType coords, OutputViewType volume)
Definition: Hex27CVFEM.h:218
const InterpWeightType & shape_function_values()
Definition: Hex27CVFEM.h:210
static constexpr int nDim_
Definition: AlgTraits.h:28
const int surfaceDimension_
Definition: Hex27CVFEM.h:510
void hex27_shape_deriv(int npts, const double *par_coord, double *shape_fcn) const
Definition: Hex27CVFEM.C:414
double gauss_point_location(int nodeOrdinal, int gaussPointOrdinal) const
Definition: Hex27CVFEM.C:206
HexahedralP2Element()
Definition: Hex27CVFEM.C:28
virtual void eval_shape_functions_at_ips()
Definition: Hex27CVFEM.C:292
virtual ~Hex27SCS()
Definition: Hex27CVFEM.h:251
std::vector< double > shapeFunctionsShift_
Definition: Hex27CVFEM.h:176
virtual void general_normal(const double *isoParCoord, const double *coords, double *normal)
Definition: MasterElement.h:224
std::vector< double > ipWeight_
Definition: Hex27CVFEM.h:240
virtual void grad_op(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv)
Definition: MasterElement.h:68
Definition: Hex27CVFEM.h:189
Direction
Definition: MasterElement.h:40
Kokkos::View< DoubleType[AlgTraits::numScvIp_][AlgTraits::nodesPerElement_][AlgTraits::nDim_]> GradWeightType
Definition: Hex27CVFEM.h:192
InterpWeightType shiftedInterpWeights_
Definition: Hex27CVFEM.h:237
Kokkos::View< T, Kokkos::LayoutRight, DeviceShmem, Kokkos::MemoryUnmanaged > SharedMemView
Definition: KokkosInterface.h:25
std::vector< double > ipWeight_
Definition: Hex27CVFEM.h:509
ViewType copy_interpolation_weights_to_view(const std::vector< double > &interps)
Definition: Hex27CVFEM.h:44
Definition: Hex27CVFEM.h:442
virtual const int * ipNodeMap(int ordinal=0)
Definition: MasterElement.h:174
const int nodes1D_
Definition: Hex27CVFEM.h:163
InterpWeightType interpWeights_
Definition: Hex27CVFEM.h:234
void area_vector(int ip, GradViewType referenceGradWeights, CoordViewType coords, OutputViewType areav)
Definition: Hex27CVFEM.h:400
virtual void gij(SharedMemView< DoubleType ** > coords, SharedMemView< DoubleType *** > gupper, SharedMemView< DoubleType *** > glower, SharedMemView< DoubleType *** > deriv)
Definition: MasterElement.h:99
int tensor_product_node_map(int i, int j, int k) const
Definition: Hex27CVFEM.C:197
std::vector< ContourData > ipInfo_
Definition: Hex27CVFEM.h:382
InterpWeightType shiftedInterpWeights_
Definition: Hex27CVFEM.h:435
double parametric_distance(const std::array< double, 3 > &x)
Definition: Hex27CVFEM.C:80
Kokkos::View< DoubleType[AlgTraits::numScvIp_][AlgTraits::nodesPerElement_]> InterpWeightType
Definition: Hex27CVFEM.h:191
virtual void interpolatePoint(const int &nComp, const double *isoParCoord, const double *field, double *result)
Definition: Hex27CVFEM.C:100
virtual void shifted_grad_op(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv)
Definition: MasterElement.h:74
std::vector< double > shapeDerivs_
Definition: Hex27CVFEM.h:177
virtual void general_face_grad_op(const int face_ordinal, const double *isoParCoord, const double *coords, double *gradop, double *det_j, double *error)
Definition: MasterElement.h:215
Definition: Hex27CVFEM.h:31
InterpWeightType interpWeights_
Definition: Hex27CVFEM.h:432
double shifted_gauss_point_location(int nodeOrdinal, int gaussPointOrdinal) const
Definition: Hex27CVFEM.C:219
const int numQuad_
Definition: Hex27CVFEM.h:164
static constexpr int numScsIp_
Definition: AlgTraits.h:30
void shape_fcn(double *shpfc)
Definition: Hex27CVFEM.C:270