Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
MasterElement.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 Sandia Corporation. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 
8 
9 #ifndef MasterElement_h
10 #define MasterElement_h
11 
13 
14 #include <AlgTraits.h>
15 
16 // NGP-based includes
17 #include "SimdInterface.h"
18 #include "KokkosInterface.h"
19 
20 #include <vector>
21 #include <cstdlib>
22 #include <stdexcept>
23 #include <string>
24 #include <array>
25 
26 #ifdef __INTEL_COMPILER
27 #define POINTER_RESTRICT restrict
28 #else
29 #define POINTER_RESTRICT __restrict__
30 #endif
31 
32 namespace stk {
33  struct topology;
34 }
35 
36 namespace sierra{
37 namespace nalu{
38 
39 namespace Jacobian{
41 {
45 };
46 }
47 
48 struct ElementDescription;
49 class MasterElement;
50 
51 
52 
54 {
55 public:
56  MasterElement();
57  virtual ~MasterElement();
58 
59  // NGP-ready methods first
60  virtual void shape_fcn(
62  throw std::runtime_error("shape_fcn using SharedMemView is not implemented");}
63 
64  virtual void shifted_shape_fcn(
66  throw std::runtime_error("shifted_shape_fcn using SharedMemView is not implemented");}
67 
68  virtual void grad_op(
72  throw std::runtime_error("grad_op using SharedMemView is not implemented");}
73 
74  virtual void shifted_grad_op(
78  throw std::runtime_error("shifted_grad_op using SharedMemView is not implemented");}
79 
80  virtual void grad_op_fem(
85  throw std::runtime_error("grad_op using SharedMemView is not implemented");}
86 
87  virtual void shifted_grad_op_fem(
92  throw std::runtime_error("shifted_grad_op using SharedMemView is not implemented");}
93 
94  virtual void determinant(
97  throw std::runtime_error("determinant using SharedMemView is not implemented");}
98 
99  virtual void gij(
104  throw std::runtime_error("gij using SharedMemView is not implemented");
105  }
106 
107  virtual void determinant(
110  throw std::runtime_error("scv determinant using SharedMemView is not implemented");
111  }
112 
113  // non-NGP-ready methods second
114  virtual void determinant(
115  const int nelem,
116  const double *coords,
117  double *volume,
118  double * error ) {
119  throw std::runtime_error("determinant not implemented");}
120 
121  virtual void grad_op(
122  const int nelem,
123  const double *coords,
124  double *gradop,
125  double *deriv,
126  double *det_j,
127  double * error ) {
128  throw std::runtime_error("grad_op not implemented");}
129 
130  virtual void shifted_grad_op(
131  const int nelem,
132  const double *coords,
133  double *gradop,
134  double *deriv,
135  double *det_j,
136  double * error ) {
137  throw std::runtime_error("grad_op not implemented");}
138 
139  virtual void gij(
140  const double *coords,
141  double *gupperij,
142  double *glowerij,
143  double *deriv) {
144  throw std::runtime_error("gij not implemented");}
145 
146  virtual void nodal_grad_op(
147  const int nelem,
148  double *deriv,
149  double * error ) {
150  throw std::runtime_error("nodal_grad_op not implemented");}
151 
152  virtual void face_grad_op(
153  const int nelem,
154  const int face_ordinal,
155  const double *coords,
156  double *gradop,
157  double *det_j,
158  double * error ) {
159  throw std::runtime_error("face_grad_op not implemented; avoid this element type at open bcs, walls and symms");}
160 
161  virtual void shifted_face_grad_op(
162  const int nelem,
163  const int face_ordinal,
164  const double *coords,
165  double *gradop,
166  double *det_j,
167  double * error ) {
168  throw std::runtime_error("shifted_face_grad_op not implemented");}
169 
170  virtual const int * adjacentNodes() {
171  throw std::runtime_error("adjacentNodes not implementedunknown bc");
172  return NULL;}
173 
174  virtual const int * ipNodeMap(int ordinal = 0) {
175  throw std::runtime_error("ipNodeMap not implemented");
176  return NULL;}
177 
178  virtual void shape_fcn(
179  double *shpfc) {
180  throw std::runtime_error("shape_fcn not implemented"); }
181 
182  virtual void shifted_shape_fcn(
183  double *shpfc) {
184  throw std::runtime_error("shifted_shape_fcn not implemented"); }
185 
186  virtual int opposingNodes(
187  const int ordinal, const int node) {
188  throw std::runtime_error("adjacentNodes not implemented"); }
189 
190  virtual int opposingFace(
191  const int ordinal, const int node) {
192  throw std::runtime_error("opposingFace not implemented");
193  return 0; }
194 
195  virtual double isInElement(
196  const double *elemNodalCoord,
197  const double *pointCoord,
198  double *isoParCoord) {
199  throw std::runtime_error("isInElement not implemented");
200  return 1.0e6; }
201 
202  virtual void interpolatePoint(
203  const int &nComp,
204  const double *isoParCoord,
205  const double *field,
206  double *result) {
207  throw std::runtime_error("interpolatePoint not implemented"); }
208 
209  virtual void general_shape_fcn(
210  const int numIp,
211  const double *isoParCoord,
212  double *shpfc) {
213  throw std::runtime_error("general_shape_fcn not implement"); }
214 
215  virtual void general_face_grad_op(
216  const int face_ordinal,
217  const double *isoParCoord,
218  const double *coords,
219  double *gradop,
220  double *det_j,
221  double * error ) {
222  throw std::runtime_error("general_face_grad_op not implemented");}
223 
224  virtual void general_normal(
225  const double *isoParCoord,
226  const double *coords,
227  double *normal) {
228  throw std::runtime_error("general_normal not implemented");}
229 
231  const int & side_ordinal,
232  const int & npoints,
233  const double *side_pcoords,
234  double *elem_pcoords) {
235  throw std::runtime_error("sidePcoords_to_elemPcoords");}
236 
237  virtual const int* side_node_ordinals(int sideOrdinal) {
238  throw std::runtime_error("side_node_ordinals not implemented");
239  }
240 
241  double isoparametric_mapping(const double b, const double a, const double xi) const;
242  bool within_tolerance(const double & val, const double & tol);
243  double vector_norm_sq(const double * vect, int len);
244 
245  int nDim_;
249 
250  std::vector<int> lrscv_;
251  std::vector<int> ipNodeMap_;
252  std::vector<int> oppNode_;
253  std::vector<int> oppFace_;
254  std::vector<double> intgLoc_;
255  std::vector<double> intgLocShift_;
256  std::vector<double> intgExpFace_;
257  std::vector<double> intgExpFaceShift_;
258  std::vector<double> nodeLoc_;
259  std::vector<int> sideNodeOrdinals_;
260  std::vector<int> sideOffset_;
261 
262  // FEM
263  std::vector<double>weights_;
264 };
265 
266 // Tet 4 subcontrol volume
267 class TetSCV : public MasterElement
268 {
269 public:
270 
271  TetSCV();
272  virtual ~TetSCV();
273 
274  const int * ipNodeMap(int ordinal = 0);
275 
276  void determinant(
277  const int nelem,
278  const double *coords,
279  double *areav,
280  double * error );
281 
282  void shape_fcn(
283  double *shpfc);
284 
285  void shifted_shape_fcn(
286  double *shpfc);
287 
288  void tet_shape_fcn(
289  const int &npts,
290  const double *par_coord,
291  double* shape_fcn);
292 };
293 
294 // Tet 4 subcontrol surface
295 class TetSCS : public MasterElement
296 {
297 public:
298 
299  TetSCS();
300  virtual ~TetSCS();
301 
302  const int * ipNodeMap(int ordinal = 0);
303 
304  void determinant(
305  const int nelem,
306  const double *coords,
307  double *areav,
308  double * error );
309 
310  void grad_op(
311  const int nelem,
312  const double *coords,
313  double *gradop,
314  double *deriv,
315  double *det_j,
316  double * error );
317 
318  void shifted_grad_op(
319  const int nelem,
320  const double *coords,
321  double *gradop,
322  double *deriv,
323  double *det_j,
324  double * error );
325 
326  void face_grad_op(
327  const int nelem,
328  const int face_ordinal,
329  const double *coords,
330  double *gradop,
331  double *det_j,
332  double * error );
333 
334  void shifted_face_grad_op(
335  const int nelem,
336  const int face_ordinal,
337  const double *coords,
338  double *gradop,
339  double *det_j,
340  double * error );
341 
342  void gij(
343  const double *coords,
344  double *gupperij,
345  double *glowerij,
346  double *deriv);
347 
348  const int * adjacentNodes();
349 
350  void shape_fcn(
351  double *shpfc);
352 
353  void shifted_shape_fcn(
354  double *shpfc);
355 
356  void tet_shape_fcn(
357  const int &npts,
358  const double *par_coord,
359  double* shape_fcn);
360 
361  int opposingNodes(
362  const int ordinal, const int node);
363 
364  int opposingFace(
365  const int ordinal, const int node);
366 
367  double isInElement(
368  const double *elemNodalCoord,
369  const double *pointCoord,
370  double *isoParCoord);
371 
372  void interpolatePoint(
373  const int &nComp,
374  const double *isoParCoord,
375  const double *field,
376  double *result);
377 
378  void general_shape_fcn(
379  const int numIp,
380  const double *isoParCoord,
381  double *shpfc);
382 
383  void general_face_grad_op(
384  const int face_ordinal,
385  const double *isoParCoord,
386  const double *coords,
387  double *gradop,
388  double *det_j,
389  double * error );
390 
391  void sidePcoords_to_elemPcoords(
392  const int & side_ordinal,
393  const int & npoints,
394  const double *side_pcoords,
395  double *elem_pcoords);
396 
397  // helper
398  double parametric_distance(const std::vector<double> &x);
399 
400  const int* side_node_ordinals(int sideOrdinal) final;
401 
402 };
403 
404 // Pyramid 5 subcontrol volume
405 class PyrSCV : public MasterElement
406 {
407 public:
408 
409  PyrSCV();
410  virtual ~PyrSCV();
411 
412  const int * ipNodeMap(int ordinal = 0);
413 
414  void determinant(
415  const int nelem,
416  const double *coords,
417  double *areav,
418  double * error );
419 
420  void shape_fcn(
421  double *shpfc);
422 
423  void shifted_shape_fcn(
424  double *shpfc);
425 
426  void pyr_shape_fcn(
427  const int &npts,
428  const double *par_coord,
429  double* shape_fcn);
430 };
431 
432 // Pyramid 5 subcontrol surface
433 class PyrSCS : public MasterElement
434 {
435 public:
436 
437  PyrSCS();
438  virtual ~PyrSCS();
439 
440  const int * ipNodeMap(int ordinal = 0);
441 
442  void determinant(
443  const int nelem,
444  const double *coords,
445  double *areav,
446  double * error );
447 
448  void grad_op(
449  const int nelem,
450  const double *coords,
451  double *gradop,
452  double *deriv,
453  double *det_j,
454  double * error );
455 
456  void shifted_grad_op(
457  const int nelem,
458  const double *coords,
459  double *gradop,
460  double *deriv,
461  double *det_j,
462  double * error );
463 
464  void pyr_derivative(
465  const int npts,
466  const double *intLoc,
467  double *deriv);
468 
469  void gij(
470  const double *coords,
471  double *gupperij,
472  double *glowerij,
473  double *deriv);
474 
475  const int * adjacentNodes();
476 
477  void shape_fcn(
478  double *shpfc);
479 
480  void shifted_shape_fcn(
481  double *shpfc);
482 
483  void pyr_shape_fcn(
484  const int &npts,
485  const double *par_coord,
486  double* shape_fcn);
487 
488  void sidePcoords_to_elemPcoords(
489  const int & side_ordinal,
490  const int & npoints,
491  const double *side_pcoords,
492  double *elem_pcoords);
493 
494  int opposingNodes(
495  const int ordinal, const int node);
496 
497  int opposingFace(
498  const int ordinal, const int node);
499 
500  void face_grad_op(
501  const int nelem,
502  const int face_ordinal,
503  const double *coords,
504  double *gradop,
505  double *det_j,
506  double *error);
507 
508  void shifted_face_grad_op(
509  const int nelem,
510  const int face_ordinal,
511  const double *coords,
512  double *gradop,
513  double *det_j,
514  double * error );
515 
516  void general_face_grad_op(
517  const int face_ordinal,
518  const double *isoParCoord,
519  const double *coords,
520  double *gradop,
521  double *det_j,
522  double *error);
523 
524  const int* side_node_ordinals(int sideOrdinal) final;
525 
526  double parametric_distance(const std::array<double,3>& x);
527 
528  double isInElement(
529  const double *elemNodalCoord,
530  const double *pointCoord,
531  double *isoParCoord);
532 
533  void interpolatePoint(
534  const int &nComp,
535  const double *isoParCoord,
536  const double *field,
537  double *result);
538 };
539 
540 // Wedge 6 subcontrol volume
541 class WedSCV : public MasterElement
542 {
543 public:
544  WedSCV();
545  virtual ~WedSCV();
546 
547  const int * ipNodeMap(int ordinal = 0);
548 
549  void determinant(
550  const int nelem,
551  const double *coords,
552  double *areav,
553  double * error );
554 
555  void shape_fcn(
556  double *shpfc);
557 
558  void shifted_shape_fcn(
559  double *shpfc);
560 
561  void wedge_shape_fcn(
562  const int &npts,
563  const double *par_coord,
564  double* shape_fcn);
565 };
566 
567 // Wedge 6 subcontrol surface
568 class WedSCS : public MasterElement
569 {
570 public:
571  WedSCS();
572  virtual ~WedSCS();
573 
574  const int * ipNodeMap(int ordinal = 0);
575 
576  void determinant(
577  const int nelem,
578  const double *coords,
579  double *areav,
580  double * error );
581 
582  void grad_op(
583  const int nelem,
584  const double *coords,
585  double *gradop,
586  double *deriv,
587  double *det_j,
588  double * error );
589 
590  void shifted_grad_op(
591  const int nelem,
592  const double *coords,
593  double *gradop,
594  double *deriv,
595  double *det_j,
596  double * error );
597 
598  void wedge_derivative(
599  const int npts,
600  const double *intLoc,
601  double *deriv);
602 
603  void face_grad_op(
604  const int nelem,
605  const int face_ordinal,
606  const double *coords,
607  double *gradop,
608  double *det_j,
609  double * error );
610 
611  void shifted_face_grad_op(
612  const int nelem,
613  const int face_ordinal,
614  const double *coords,
615  double *gradop,
616  double *det_j,
617  double * error );
618 
619  void gij(
620  const double *coords,
621  double *gupperij,
622  double *glowerij,
623  double *deriv);
624 
625  const int * adjacentNodes();
626 
627  int opposingNodes(
628  const int ordinal, const int node);
629 
630  int opposingFace(
631  const int ordinal, const int node);
632 
633  void shape_fcn(
634  double *shpfc);
635 
636  void shifted_shape_fcn(
637  double *shpfc);
638 
639  double isInElement(
640  const double *elemNodalCoord,
641  const double *pointCoord,
642  double *isoParCoord);
643 
644  void interpolatePoint(
645  const int &nComp,
646  const double *isoParCoord,
647  const double *field,
648  double *result);
649 
650  void wedge_shape_fcn(
651  const int &npts,
652  const double *par_coord,
653  double* shape_fcn);
654 
655  void general_face_grad_op(
656  const int face_ordinal,
657  const double *isoParCoord,
658  const double *coords,
659  double *gradop,
660  double *det_j,
661  double * error );
662 
663  void sidePcoords_to_elemPcoords(
664  const int & side_ordinal,
665  const int & npoints,
666  const double *side_pcoords,
667  double *elem_pcoords);
668 
669  // helper functions to isInElement
670  double parametric_distance( const double X, const double Y);
671  double parametric_distance( const std::vector<double> &x);
672 
673  const int* side_node_ordinals(int sideOrdinal) final;
674 
675 };
676 
677 // 2D Quad 4 subcontrol volume
678 class Quad2DSCV : public MasterElement
679 {
680 public:
681  Quad2DSCV();
682  virtual ~Quad2DSCV();
683 
684  const int * ipNodeMap(int ordinal = 0);
685 
686  void determinant(
687  const int nelem,
688  const double *coords,
689  double *areav,
690  double * error );
691 
692  void shape_fcn(
693  double *shpfc);
694 
695  void shifted_shape_fcn(
696  double *shpfc);
697 
698  void quad_shape_fcn(
699  const int &npts,
700  const double *par_coord,
701  double* shape_fcn);
702 };
703 
704 // 2D Quad 4 subcontrol surface
705 class Quad2DSCS : public MasterElement
706 {
707 public:
708  Quad2DSCS();
709  virtual ~Quad2DSCS();
710 
711  const int * ipNodeMap(int ordinal = 0);
712 
713  void determinant(
714  const int nelem,
715  const double *coords,
716  double *areav,
717  double * error );
718 
719  void grad_op(
720  const int nelem,
721  const double *coords,
722  double *gradop,
723  double *deriv,
724  double *det_j,
725  double * error );
726 
727  void shifted_grad_op(
728  const int nelem,
729  const double *coords,
730  double *gradop,
731  double *deriv,
732  double *det_j,
733  double * error );
734 
735  void face_grad_op(
736  const int nelem,
737  const int face_ordinal,
738  const double *coords,
739  double *gradop,
740  double *det_j,
741  double * error );
742 
743  void shifted_face_grad_op(
744  const int nelem,
745  const int face_ordinal,
746  const double *coords,
747  double *gradop,
748  double *det_j,
749  double * error );
750 
751  void gij(
752  const double *coords,
753  double *gupperij,
754  double *gij,
755  double *deriv);
756 
757  const int * adjacentNodes();
758 
759  int opposingNodes(
760  const int ordinal, const int node);
761 
762  int opposingFace(
763  const int ordinal, const int node);
764 
765  void shape_fcn(
766  double *shpfc);
767 
768  void shifted_shape_fcn(
769  double *shpfc);
770 
771  void quad_shape_fcn(
772  const int &npts,
773  const double *par_coord,
774  double* shape_fcn);
775 
776  double isInElement(
777  const double *elemNodalCoord,
778  const double *pointCoord,
779  double *isoParCoord);
780 
781  void interpolatePoint(
782  const int &nComp,
783  const double *isoParCoord,
784  const double *field,
785  double *result);
786 
787  void general_shape_fcn(
788  const int numIp,
789  const double *isoParCoord,
790  double *shpfc);
791 
792  void general_face_grad_op(
793  const int face_ordinal,
794  const double *isoParCoord,
795  const double *coords,
796  double *gradop,
797  double *det_j,
798  double * error );
799 
800  void sidePcoords_to_elemPcoords(
801  const int & side_ordinal,
802  const int & npoints,
803  const double *side_pcoords,
804  double *elem_pcoords);
805 
806  const int* side_node_ordinals(int sideOrdinal) final;
807 };
808 
810 {
811 public:
813 
816 
817  void shape_fcn(double *shpfc);
818  void shifted_shape_fcn(double *shpfc);
819 protected:
820  struct ContourData {
822  double weight;
823  };
824 
825  void set_quadrature_rule();
826  void GLLGLL_quadrature_weights();
827 
828  int tensor_product_node_map(int i, int j) const;
829 
830  double gauss_point_location(
831  int nodeOrdinal,
832  int gaussPointOrdinal) const;
833 
834  double shifted_gauss_point_location(
835  int nodeOrdinal,
836  int gaussPointOrdinal) const;
837 
838  double tensor_product_weight(
839  int s1Node, int s2Node,
840  int s1Ip, int s2Ip) const;
841 
842  double tensor_product_weight(int s1Node, int s1Ip) const;
843 
844  double parametric_distance(const std::array<double, 2>& x);
845 
846  virtual void interpolatePoint(
847  const int &nComp,
848  const double *isoParCoord,
849  const double *field,
850  double *result);
851 
852  virtual double isInElement(
853  const double *elemNodalCoord,
854  const double *pointCoord,
855  double *isoParCoord);
856 
857  virtual void sidePcoords_to_elemPcoords(
858  const int & side_ordinal,
859  const int & npoints,
860  const double *side_pcoords,
861  double *elem_pcoords);
862 
863  void eval_shape_functions_at_ips();
864  void eval_shape_functions_at_shifted_ips();
865 
866  void eval_shape_derivs_at_ips();
867  void eval_shape_derivs_at_shifted_ips();
868 
869  void eval_shape_derivs_at_face_ips();
870 
871  const double scsDist_;
872  const int nodes1D_;
873  int numQuad_;
874 
875  //quadrature info
876  std::vector<double> gaussAbscissae1D_;
877  std::vector<double> gaussAbscissae_;
878  std::vector<double> gaussAbscissaeShift_;
879  std::vector<double> gaussWeight_;
880 
881  std::vector<int> stkNodeMap_;
882  std::vector<double> scsEndLoc_;
883 
884  std::vector<double> shapeFunctions_;
885  std::vector<double> shapeFunctionsShift_;
886  std::vector<double> shapeDerivs_;
887  std::vector<double> shapeDerivsShift_;
888  std::vector<double> expFaceShapeDerivs_;
889 private:
890  void quad9_shape_fcn(
891  int npts,
892  const double *par_coord,
893  double* shape_fcn
894  ) const;
895 
896  void quad9_shape_deriv(
897  int npts,
898  const double *par_coord,
899  double* shape_fcn
900  ) const;
901 };
902 
903 // 3D Quad 27 subcontrol volume
905 {
906 public:
907  Quad92DSCV();
908  virtual ~Quad92DSCV() {}
909 
910  const int * ipNodeMap(int ordinal = 0);
911 
912  void determinant(
913  const int nelem,
914  const double *coords,
915  double *areav,
916  double * error );
917 
918 private:
919  void set_interior_info();
920 
921  double jacobian_determinant(
922  const double *POINTER_RESTRICT elemNodalCoords,
923  const double *POINTER_RESTRICT shapeDerivs ) const;
924 
925  std::vector<double> ipWeight_;
926 };
927 
928 // 3D Hex 27 subcontrol surface
930 {
931 public:
932  Quad92DSCS();
933  virtual ~Quad92DSCS() {}
934 
935  void determinant(
936  const int nelem,
937  const double *coords,
938  double *areav,
939  double * error );
940 
941  void grad_op(
942  const int nelem,
943  const double *coords,
944  double *gradop,
945  double *deriv,
946  double *det_j,
947  double * error );
948 
949  void shifted_grad_op(
950  const int nelem,
951  const double *coords,
952  double *gradop,
953  double *deriv,
954  double *det_j,
955  double * error );
956 
957  void face_grad_op(
958  const int nelem,
959  const int face_ordinal,
960  const double *coords,
961  double *gradop,
962  double *det_j,
963  double * error );
964 
965  void gij(
966  const double *coords,
967  double *gupperij,
968  double *glowerij,
969  double *deriv);
970 
971  const int * adjacentNodes();
972 
973  const int * ipNodeMap(int ordinal = 0);
974 
975  int opposingNodes(
976  const int ordinal, const int node);
977 
978  int opposingFace(
979  const int ordinal, const int node);
980 
981  const int* side_node_ordinals(int sideOrdinal) final;
982 
983 
984 private:
985  void set_interior_info();
986  void set_boundary_info();
987 
988  template <Jacobian::Direction direction> void
989  area_vector(
990  const double *POINTER_RESTRICT elemNodalCoords,
991  double *POINTER_RESTRICT shapeDeriv,
992  double *POINTER_RESTRICT areaVector ) const;
993 
994  std::vector<ContourData> ipInfo_;
996 };
997 
998 // 2D Tri 3 subcontrol volume
999 class Tri2DSCV : public MasterElement
1000 {
1001 public:
1002  Tri2DSCV();
1003  virtual ~Tri2DSCV();
1004 
1005  const int * ipNodeMap(int ordinal = 0);
1006 
1007  void determinant(
1008  const int nelem,
1009  const double *coords,
1010  double *areav,
1011  double * error );
1012 
1013  void shape_fcn(
1014  double *shpfc);
1015 
1016  void shifted_shape_fcn(
1017  double *shpfc);
1018 
1019  void tri_shape_fcn(
1020  const int &npts,
1021  const double *par_coord,
1022  double* shape_fcn);
1023 
1024 };
1025 
1026 // 2D Tri 3 subcontrol surface
1027 class Tri2DSCS : public MasterElement
1028 {
1029 public:
1030  Tri2DSCS();
1031  virtual ~Tri2DSCS();
1032 
1033  const int * ipNodeMap(int ordinal = 0);
1034 
1035  void determinant(
1036  const int nelem,
1037  const double *coords,
1038  double *areav,
1039  double * error );
1040 
1041  void grad_op(
1042  const int nelem,
1043  const double *coords,
1044  double *gradop,
1045  double *deriv,
1046  double *det_j,
1047  double * error );
1048 
1049  void shifted_grad_op(
1050  const int nelem,
1051  const double *coords,
1052  double *gradop,
1053  double *deriv,
1054  double *det_j,
1055  double * error );
1056 
1057  void face_grad_op(
1058  const int nelem,
1059  const int face_ordinal,
1060  const double *coords,
1061  double *gradop,
1062  double *det_j,
1063  double * error );
1064 
1065  void shifted_face_grad_op(
1066  const int nelem,
1067  const int face_ordinal,
1068  const double *coords,
1069  double *gradop,
1070  double *det_j,
1071  double * error );
1072 
1073  void gij(
1074  const double *coords,
1075  double *gupperij,
1076  double *glowerij,
1077  double *deriv);
1078 
1079  const int * adjacentNodes();
1080 
1081  void shape_fcn(
1082  double *shpfc);
1083 
1084  void shifted_shape_fcn(
1085  double *shpfc);
1086 
1087  void tri_shape_fcn(
1088  const int &npts,
1089  const double *par_coord,
1090  double* shape_fcn);
1091 
1092  int opposingNodes(
1093  const int ordinal, const int node);
1094 
1095  int opposingFace(
1096  const int ordinal, const int node);
1097 
1098  double isInElement(
1099  const double *elemNodalCoord,
1100  const double *pointCoord,
1101  double *isoParCoord);
1102 
1103  void interpolatePoint(
1104  const int &nComp,
1105  const double *isoParCoord,
1106  const double *field,
1107  double *result);
1108 
1109  double tri_parametric_distance(
1110  const std::vector<double> &x);
1111 
1112  void general_face_grad_op(
1113  const int face_ordinal,
1114  const double *isoParCoord,
1115  const double *coords,
1116  double *gradop,
1117  double *det_j,
1118  double * error );
1119 
1120  void sidePcoords_to_elemPcoords(
1121  const int & side_ordinal,
1122  const int & npoints,
1123  const double *side_pcoords,
1124  double *elem_pcoords);
1125 
1126  const int* side_node_ordinals(int sideOrdinal) final;
1127 
1128 
1129 };
1130 
1131 // 3D Quad 4
1132 class Quad3DSCS : public MasterElement
1133 {
1134 public:
1135 
1136  Quad3DSCS();
1137  virtual ~Quad3DSCS();
1138 
1139  const int * ipNodeMap(int ordinal = 0);
1140 
1141  void determinant(
1142  const int nelem,
1143  const double *coords,
1144  double *areav,
1145  double * error );
1146 
1147  void shape_fcn(
1148  double *shpfc);
1149 
1150  void shifted_shape_fcn(
1151  double *shpfc);
1152 
1153  double isInElement(
1154  const double *elemNodalCoord,
1155  const double *pointCoord,
1156  double *isoParCoord);
1157 
1158  void interpolatePoint(
1159  const int &nComp,
1160  const double *isoParCoord,
1161  const double *field,
1162  double *result);
1163 
1164  void general_shape_fcn(
1165  const int numIp,
1166  const double *isoParCoord,
1167  double *shpfc);
1168 
1169  void general_normal(
1170  const double *isoParCoord,
1171  const double *coords,
1172  double *normal);
1173 
1174  void non_unit_face_normal(
1175  const double * par_coord,
1176  const double * elem_nodal_coor,
1177  double * normal_vector );
1178 
1179  double parametric_distance(const std::vector<double> &x);
1180 
1181  const double elemThickness_;
1182 };
1183 
1184 // 3D Tri 3
1185 class Tri3DSCS : public MasterElement
1186 {
1187 public:
1188 
1189  Tri3DSCS();
1190  virtual ~Tri3DSCS();
1191 
1192  const int * ipNodeMap(int ordinal = 0);
1193 
1194  void determinant(
1195  const int nelem,
1196  const double *coords,
1197  double *areav,
1198  double * error );
1199 
1200  void shape_fcn(
1201  double *shpfc);
1202 
1203  void shifted_shape_fcn(
1204  double *shpfc);
1205 
1206  void tri_shape_fcn(
1207  const int &npts,
1208  const double *par_coord,
1209  double* shape_fcn);
1210 
1211  double isInElement(
1212  const double *elemNodalCoord,
1213  const double *pointCoord,
1214  double *isoParCoord);
1215 
1216  double parametric_distance(
1217  const std::vector<double> &x);
1218 
1219  void interpolatePoint(
1220  const int &nComp,
1221  const double *isoParCoord,
1222  const double *field,
1223  double *result);
1224 
1225  void general_shape_fcn(
1226  const int numIp,
1227  const double *isoParCoord,
1228  double *shpfc);
1229 
1230  void general_normal(
1231  const double *isoParCoord,
1232  const double *coords,
1233  double *normal);
1234 };
1235 
1236 // edge 2d
1237 class Edge2DSCS : public MasterElement
1238 {
1239 public:
1240  Edge2DSCS();
1241  virtual ~Edge2DSCS();
1242 
1243  const int * ipNodeMap(int ordinal = 0);
1244 
1245  void determinant(
1246  const int nelem,
1247  const double *coords,
1248  double *areav,
1249  double * error );
1250 
1251  void shape_fcn(
1252  double *shpfc);
1253 
1254  void shifted_shape_fcn(
1255  double *shpfc);
1256 
1257  double isInElement(
1258  const double *elemNodalCoord,
1259  const double *pointCoord,
1260  double *isoParCoord);
1261 
1262  void interpolatePoint(
1263  const int &nComp,
1264  const double *isoParCoord,
1265  const double *field,
1266  double *result);
1267 
1268  void general_shape_fcn(
1269  const int numIp,
1270  const double *isoParCoord,
1271  double *shpfc);
1272 
1273  void general_normal(
1274  const double *isoParCoord,
1275  const double *coords,
1276  double *normal);
1277 
1278  double parametric_distance(const std::vector<double> &x);
1279 
1280  const double elemThickness_;
1281 };
1282 
1283 // edge 2d
1285 {
1286 public:
1287  Edge32DSCS();
1288  virtual ~Edge32DSCS() {}
1289 
1290  const int * ipNodeMap(int ordinal = 0);
1291 
1292  void determinant(
1293  const int nelem,
1294  const double *coords,
1295  double *areav,
1296  double * error );
1297 
1298  void shape_fcn(
1299  double *shpfc);
1300 
1301  void shifted_shape_fcn(
1302  double *shpfc);
1303 
1304  void interpolatePoint(
1305  const int &nComp,
1306  const double *isoParCoord,
1307  const double *field,
1308  double *result);
1309 
1310 private:
1311  void area_vector(
1312  const double *POINTER_RESTRICT coords,
1313  const double s,
1314  double *POINTER_RESTRICT areaVector) const;
1315 
1316  std::vector<double> ipWeight_;
1317 };
1318 
1319 } // namespace nalu
1320 } // namespace Sierra
1321 
1322 #endif
std::vector< ContourData > ipInfo_
Definition: MasterElement.h:994
virtual ~QuadrilateralP2Element()
Definition: MasterElement.h:815
Definition: ElementDescription.h:27
virtual void shifted_shape_fcn(SharedMemView< DoubleType ** > &shpfc)
Definition: MasterElement.h:64
std::vector< double > intgLoc_
Definition: MasterElement.h:254
virtual ~Quad92DSCS()
Definition: MasterElement.h:933
std::vector< int > lrscv_
Definition: MasterElement.h:250
virtual void interpolatePoint(const int &nComp, const double *isoParCoord, const double *field, double *result)
Definition: MasterElement.h:202
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
Definition: MasterElement.h:53
virtual void determinant(const int nelem, const double *coords, double *volume, double *error)
Definition: MasterElement.h:114
std::vector< double > scsEndLoc_
Definition: MasterElement.h:882
virtual const int * side_node_ordinals(int sideOrdinal)
Definition: MasterElement.h:237
virtual void grad_op(const int nelem, const double *coords, double *gradop, double *deriv, double *det_j, double *error)
Definition: MasterElement.h:121
virtual void determinant(SharedMemView< DoubleType ** > coords, SharedMemView< DoubleType * > volume)
Definition: MasterElement.h:107
std::vector< double > ipWeight_
Definition: MasterElement.h:1316
double weight
Definition: MasterElement.h:822
virtual int opposingNodes(const int ordinal, const int node)
Definition: MasterElement.h:186
std::vector< double > expFaceShapeDerivs_
Definition: MasterElement.h:888
virtual void shifted_face_grad_op(const int nelem, const int face_ordinal, const double *coords, double *gradop, double *det_j, double *error)
Definition: MasterElement.h:161
virtual void shifted_grad_op(const int nelem, const double *coords, double *gradop, double *deriv, double *det_j, double *error)
Definition: MasterElement.h:130
int numIntPoints_
Definition: MasterElement.h:247
virtual void general_shape_fcn(const int numIp, const double *isoParCoord, double *shpfc)
Definition: MasterElement.h:209
virtual ~Quad92DSCV()
Definition: MasterElement.h:908
int nodesPerElement_
Definition: MasterElement.h:246
std::vector< double > shapeFunctionsShift_
Definition: MasterElement.h:885
Definition: MasterElement.h:1284
virtual void shape_fcn(SharedMemView< DoubleType ** > &shpfc)
Definition: MasterElement.h:60
virtual double isInElement(const double *elemNodalCoord, const double *pointCoord, double *isoParCoord)
Definition: MasterElement.h:195
Definition: MasterElement.h:541
virtual const int * adjacentNodes()
Definition: MasterElement.h:170
Definition: MasterElement.h:42
Definition: Algorithm.h:14
virtual void shape_fcn(double *shpfc)
Definition: MasterElement.h:178
virtual int opposingFace(const int ordinal, const int node)
Definition: MasterElement.h:190
STK SIMD Interface.
Definition: MasterElement.h:705
std::vector< double > gaussAbscissae_
Definition: MasterElement.h:877
virtual void determinant(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType ** > &areav)
Definition: MasterElement.h:94
#define POINTER_RESTRICT
Definition: MasterElement.h:29
Definition: MasterElement.h:1132
std::vector< double > nodeLoc_
Definition: MasterElement.h:258
Definition: MasterElement.h:44
std::vector< int > oppFace_
Definition: MasterElement.h:253
Definition: MasterElement.h:43
std::vector< double > shapeDerivsShift_
Definition: MasterElement.h:887
std::vector< double > shapeFunctions_
Definition: MasterElement.h:884
std::vector< double > intgExpFace_
Definition: MasterElement.h:256
Definition: MasterElement.h:295
const double scsDist_
Definition: MasterElement.h:871
#define X
Definition: MasterElement.h:433
virtual void sidePcoords_to_elemPcoords(const int &side_ordinal, const int &npoints, const double *side_pcoords, double *elem_pcoords)
Definition: MasterElement.h:230
int nDim_
Definition: MasterElement.h:245
const double elemThickness_
Definition: MasterElement.h:1280
virtual void grad_op_fem(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv, SharedMemView< DoubleType * > &det_j)
Definition: MasterElement.h:80
Definition: MasterElement.h:904
virtual ~Edge32DSCS()
Definition: MasterElement.h:1288
std::vector< int > sideNodeOrdinals_
Definition: MasterElement.h:259
Jacobian::Direction direction
Definition: MasterElement.h:821
Definition: MasterElement.h:1185
Definition: MasterElement.h:1027
std::vector< int > oppNode_
Definition: MasterElement.h:252
virtual void general_normal(const double *isoParCoord, const double *coords, double *normal)
Definition: MasterElement.h:224
virtual void grad_op(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv)
Definition: MasterElement.h:68
Definition: MasterElement.h:1237
double scaleToStandardIsoFac_
Definition: MasterElement.h:248
Definition: MasterElement.h:405
Direction
Definition: MasterElement.h:40
std::vector< double > shapeDerivs_
Definition: MasterElement.h:886
Kokkos::View< T, Kokkos::LayoutRight, DeviceShmem, Kokkos::MemoryUnmanaged > SharedMemView
Definition: KokkosInterface.h:25
int ipsPerFace_
Definition: MasterElement.h:995
Definition: MasterElement.h:929
std::vector< double > intgExpFaceShift_
Definition: MasterElement.h:257
virtual const int * ipNodeMap(int ordinal=0)
Definition: MasterElement.h:174
std::vector< int > ipNodeMap_
Definition: MasterElement.h:251
std::vector< int > stkNodeMap_
Definition: MasterElement.h:881
Definition: MasterElement.h:267
virtual void gij(SharedMemView< DoubleType ** > coords, SharedMemView< DoubleType *** > gupper, SharedMemView< DoubleType *** > glower, SharedMemView< DoubleType *** > deriv)
Definition: MasterElement.h:99
std::vector< double > intgLocShift_
Definition: MasterElement.h:255
const double tol
Definition: UnitTestUtils.h:56
const int nodes1D_
Definition: MasterElement.h:872
virtual void gij(const double *coords, double *gupperij, double *glowerij, double *deriv)
Definition: MasterElement.h:139
Definition: MasterElement.h:999
Definition: AlgTraits.h:72
Definition: MasterElement.h:568
const double elemThickness_
Definition: MasterElement.h:1181
virtual void shifted_grad_op(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv)
Definition: MasterElement.h:74
#define Y
std::vector< double > ipWeight_
Definition: MasterElement.h:925
std::vector< double > weights_
Definition: MasterElement.h:263
virtual void shifted_grad_op_fem(SharedMemView< DoubleType ** > &coords, SharedMemView< DoubleType *** > &gradop, SharedMemView< DoubleType *** > &deriv, SharedMemView< DoubleType * > &det_j)
Definition: MasterElement.h:87
std::vector< double > gaussWeight_
Definition: MasterElement.h:879
Definition: MasterElement.h:809
std::vector< double > gaussAbscissae1D_
Definition: MasterElement.h:876
int numQuad_
Definition: MasterElement.h:873
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
virtual void nodal_grad_op(const int nelem, double *deriv, double *error)
Definition: MasterElement.h:146
std::vector< double > gaussAbscissaeShift_
Definition: MasterElement.h:878
std::vector< int > sideOffset_
Definition: MasterElement.h:260
Definition: MasterElement.h:678
virtual void shifted_shape_fcn(double *shpfc)
Definition: MasterElement.h:182