10#ifndef Shards_BasicTopologies_hpp
11#define Shards_BasicTopologies_hpp
14#include <Shards_CellTopologyTraits.hpp>
27#ifndef DOXYGEN_COMPILE
40#ifndef DOXYGEN_COMPILE
55template<
unsigned NodeCount = 2 >
struct Line {};
70template<
unsigned NodeCount = 2 >
struct Beam {};
85template<
unsigned NodeCount = 2 >
struct ShellLine {};
117template<
unsigned NodeCount = 3 >
struct Triangle {};
219template<
unsigned NodeCount = 5 >
struct Pyramid {};
235template<
unsigned NodeCount = 6 >
struct Wedge {};
340#ifndef DOXYGEN_COMPILE
350 LineNodePermutation ;
352typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
353 CELL_PERMUTATION_POLARITY_NEGATIVE >
354 LineNodePermutationPolarity;
356template<>
struct Line<2> :
public
358 TypeListEnd, TypeListEnd,
359 TypeListEnd, TypeListEnd,
361 LineNodePermutationPolarity >
364template<>
struct Line<3> :
public
365 CellTopologyTraits< 1 , 2 , 3 ,
366 TypeListEnd, TypeListEnd,
367 TypeListEnd, TypeListEnd,
369 LineNodePermutationPolarity >
370{
typedef Line<2> base ; };
377template<>
struct Beam<2> :
public
379 MakeTypeList< Line<2> >::type ,
381{
typedef Beam<2> base ; };
383template<>
struct Beam<3> :
public
385 MakeTypeList< Line<3> >::type ,
387{
typedef Beam<2> base ; };
393 ShellLineEdgeNodeMap ;
397 MakeTypeList< Line<2> , Line<2> >::type ,
398 ShellLineEdgeNodeMap >
399{
typedef ShellLine<2> base ; };
403 MakeTypeList< Line<3> , Line<3> >::type ,
404 ShellLineEdgeNodeMap >
405{
typedef ShellLine<2> base ; };
419 TriangleNodeMapPositive1 ,
420 TriangleNodeMapPositive2 ,
421 TriangleNodeMapReversed0 ,
422 TriangleNodeMapReversed1 ,
423 TriangleNodeMapReversed2 >::type
424 TriangleNodePermutation ;
426typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
427 CELL_PERMUTATION_POLARITY_POSITIVE,
428 CELL_PERMUTATION_POLARITY_POSITIVE,
429 CELL_PERMUTATION_POLARITY_NEGATIVE,
430 CELL_PERMUTATION_POLARITY_NEGATIVE,
431 CELL_PERMUTATION_POLARITY_NEGATIVE >
432 TriangleNodePermutationPolarity;
437 TriangleEdgeNodeMap ;
439template<>
struct Triangle<3> :
public
441 MakeTypeList< Line<2> ,
444 TriangleEdgeNodeMap ,
445 TypeListEnd , TypeListEnd ,
446 TriangleNodePermutation ,
447 TriangleNodePermutationPolarity >
448{
typedef Triangle<3> base ; };
450template<>
struct Triangle<6> :
public
452 MakeTypeList< Line<3> ,
455 TriangleEdgeNodeMap ,
456 TypeListEnd , TypeListEnd ,
457 TriangleNodePermutation ,
458 TriangleNodePermutationPolarity >
459{
typedef Triangle<3> base ; };
469 Triangle4_NodeMapPositive1 ,
470 Triangle4_NodeMapPositive2 ,
471 Triangle4_NodeMapReversed0 ,
472 Triangle4_NodeMapReversed1 ,
473 Triangle4_NodeMapReversed2 >::type
474 Triangle4_NodePermutation ;
476typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
477 CELL_PERMUTATION_POLARITY_POSITIVE,
478 CELL_PERMUTATION_POLARITY_POSITIVE,
479 CELL_PERMUTATION_POLARITY_NEGATIVE,
480 CELL_PERMUTATION_POLARITY_NEGATIVE,
481 CELL_PERMUTATION_POLARITY_NEGATIVE >
482 Triangle4_NodePermutationPolarity;
484template<>
struct Triangle<4> :
public
486 MakeTypeList< Line<2> ,
489 TriangleEdgeNodeMap ,
490 TypeListEnd , TypeListEnd ,
491 Triangle4_NodePermutation ,
492 Triangle4_NodePermutationPolarity >
493{
typedef Triangle<3> base ; };
498 TriangleNodeMapReversed0 >::type
499 ShellTriangleFaceNodeMap ;
503 MakeTypeList< Line<2> ,
506 TriangleEdgeNodeMap ,
507 MakeTypeList< Triangle<3> ,
508 Triangle<3> >::type ,
509 ShellTriangleFaceNodeMap >
510{
typedef ShellTriangle<3> base ; };
514 MakeTypeList< Line<3> ,
517 TriangleEdgeNodeMap ,
518 MakeTypeList< Triangle<6> ,
519 Triangle<6> >::type ,
520 ShellTriangleFaceNodeMap >
521{
typedef ShellTriangle<3> base ; };
538 QuadrilateralNodeMapPositive1 ,
539 QuadrilateralNodeMapPositive2 ,
540 QuadrilateralNodeMapPositive3 ,
541 QuadrilateralNodeMapReversed0 ,
542 QuadrilateralNodeMapReversed1 ,
543 QuadrilateralNodeMapReversed2 ,
544 QuadrilateralNodeMapReversed3 >::type
545 QuadrilateralNodePermutation ;
547typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
548 CELL_PERMUTATION_POLARITY_POSITIVE,
549 CELL_PERMUTATION_POLARITY_POSITIVE,
550 CELL_PERMUTATION_POLARITY_POSITIVE,
551 CELL_PERMUTATION_POLARITY_NEGATIVE,
552 CELL_PERMUTATION_POLARITY_NEGATIVE,
553 CELL_PERMUTATION_POLARITY_NEGATIVE,
554 CELL_PERMUTATION_POLARITY_NEGATIVE >
555 QuadrilateralNodePermutationPolarity;
561 QuadrilateralEdgeNodeMap ;
565 MakeTypeList< Line<2> ,
569 QuadrilateralEdgeNodeMap ,
570 TypeListEnd , TypeListEnd ,
571 QuadrilateralNodePermutation ,
572 QuadrilateralNodePermutationPolarity >
573{
typedef Quadrilateral<4> base ; };
577 MakeTypeList< Line<3> ,
581 QuadrilateralEdgeNodeMap ,
582 TypeListEnd , TypeListEnd ,
583 QuadrilateralNodePermutation ,
584 QuadrilateralNodePermutationPolarity >
585{
typedef Quadrilateral<4> base ; };
589 MakeTypeList< Line<3> ,
593 QuadrilateralEdgeNodeMap ,
594 TypeListEnd , TypeListEnd ,
595 QuadrilateralNodePermutation ,
596 QuadrilateralNodePermutationPolarity >
597{
typedef Quadrilateral<4> base ; };
602 QuadrilateralNodeMapReversed0 >::type
603 ShellQuadrilateralFaceNodeMap ;
607 MakeTypeList< Line<2> ,
611 QuadrilateralEdgeNodeMap ,
612 MakeTypeList< Quadrilateral<4> ,
613 Quadrilateral<4> >::type ,
614 ShellQuadrilateralFaceNodeMap >
615{
typedef ShellQuadrilateral<4> base ; };
619 MakeTypeList< Line<3> ,
623 QuadrilateralEdgeNodeMap ,
624 MakeTypeList< Quadrilateral<8> ,
625 Quadrilateral<8> >::type ,
626 ShellQuadrilateralFaceNodeMap >
627{
typedef ShellQuadrilateral<4> base ; };
631 MakeTypeList< Line<3> ,
635 QuadrilateralEdgeNodeMap ,
636 MakeTypeList< Quadrilateral<9> ,
637 Quadrilateral<9> >::type ,
638 ShellQuadrilateralFaceNodeMap >
639{
typedef ShellQuadrilateral<4> base ; };
649 TetrahedronEdgeNodeMap ;
655 TetrahedronSideNodeMap ;
659 MakeTypeList< Line<2> ,
665 TetrahedronEdgeNodeMap ,
666 MakeTypeList< Triangle<3> ,
669 Triangle<3> >::type ,
670 TetrahedronSideNodeMap >
671{
typedef Tetrahedron<4> base ; };
675 MakeTypeList< Line<3> ,
681 TetrahedronEdgeNodeMap ,
682 MakeTypeList< Triangle<6> ,
685 Triangle<6> >::type ,
686 TetrahedronSideNodeMap >
687{
typedef Tetrahedron<4> base ; };
691 MakeTypeList< Line<3> ,
697 TetrahedronEdgeNodeMap ,
698 MakeTypeList< Triangle<6> ,
701 Triangle<6> >::type ,
702 TetrahedronSideNodeMap >
703{
typedef Tetrahedron<4> base ; };
707 MakeTypeList< Line<2> ,
713 TetrahedronEdgeNodeMap ,
714 MakeTypeList< Triangle<4> ,
717 Triangle<4> >::type ,
718 TetrahedronSideNodeMap >
719{
typedef Tetrahedron<4> base ; };
742template<>
struct Pyramid<5> :
public
744 MakeTypeList< Line<2> ,
753 MakeTypeList< Triangle<3> ,
757 Quadrilateral<4> >::type ,
759{
typedef Pyramid<5> base ; };
761template<>
struct Pyramid<13> :
public
763 MakeTypeList< Line<3> ,
772 MakeTypeList< Triangle<6> ,
776 Quadrilateral<8> >::type ,
778{
typedef Pyramid<5> base ; };
780template<>
struct Pyramid<14> :
public
782 MakeTypeList< Line<3> ,
791 MakeTypeList< Triangle<6> ,
795 Quadrilateral<9> >::type ,
797{
typedef Pyramid<5> base ; };
811 >::type WedgeEdgeNodeMap ;
819 >::type WedgeFaceNodeMap ;
821template<>
struct Wedge<6> :
public
823 MakeTypeList< Line<2> ,
833 MakeTypeList< Quadrilateral<4> ,
837 Triangle<3> >::type ,
839{
typedef Wedge<6> base ; };
841template<>
struct Wedge<15> :
public
843 MakeTypeList< Line<3> ,
853 MakeTypeList< Quadrilateral<8> ,
857 Triangle<6> >::type ,
859{
typedef Wedge<6> base ; };
861template<>
struct Wedge<18> :
public
863 MakeTypeList< Line<3> ,
873 MakeTypeList< Quadrilateral<9> ,
877 Triangle<6> >::type ,
879{
typedef Wedge<6> base ; };
896 HexahedronEdgeNodeMap ;
905 HexahedronFaceNodeMap ;
911 MakeTypeList< Line<2> ,
923 HexahedronEdgeNodeMap ,
924 MakeTypeList< Quadrilateral<4> ,
929 Quadrilateral<4> >::type ,
930 HexahedronFaceNodeMap >
932 typedef Hexahedron<8> base ;
937 MakeTypeList< Line<3> ,
949 HexahedronEdgeNodeMap ,
950 MakeTypeList< Quadrilateral<8> ,
955 Quadrilateral<8> >::type ,
956 HexahedronFaceNodeMap >
958 typedef Hexahedron<8> base ;
963 MakeTypeList< Line<3> ,
975 HexahedronEdgeNodeMap ,
976 MakeTypeList< Quadrilateral<9> ,
981 Quadrilateral<9> >::type ,
982 HexahedronFaceNodeMap >
984 typedef Hexahedron<8> base ;
995template<
unsigned NodeCount = 5 >
struct Pentagon {};
1009template<>
struct Pentagon<5> :
public
1011 MakeTypeList< Line<2> ,
1016 PentagonEdgeNodeMap >
1018 typedef Pentagon<5> base ;
1027template<
unsigned NodeCount = 6 >
struct Hexagon {};
1042template<>
struct Hexagon<6> :
public
1044 MakeTypeList< Line<2> ,
1050 HexagonEdgeNodeMap >
1052 typedef Hexagon<6> base ;
1057template<
class Traits >
struct BasicTopologyOf ;
1060template<>
struct BasicTopologyOf<
Node::Traits >
1061{
typedef Node type ; };
1064template<>
struct BasicTopologyOf<
Particle::Traits >
1065{
typedef Particle type ; };
1068template<>
struct BasicTopologyOf<
Line<2>::Traits >
1069{
typedef Line<2> type ; };
1072template<>
struct BasicTopologyOf<
Line<3>::Traits >
1073{
typedef Line<3> type ; };
1076template<>
struct BasicTopologyOf<
Beam<2>::Traits >
1077{
typedef Beam<2> type ; };
1080template<>
struct BasicTopologyOf<
Beam<3>::Traits >
1081{
typedef Beam<3> type ; };
1084template<>
struct BasicTopologyOf<
ShellLine<2>::Traits >
1085{
typedef ShellLine<2> type ; };
1088template<>
struct BasicTopologyOf<
ShellLine<3>::Traits >
1089{
typedef ShellLine<3> type ; };
1092template<>
struct BasicTopologyOf<
Triangle<3>::Traits >
1093{
typedef Triangle<3> type ; };
1096template<>
struct BasicTopologyOf<
Triangle<6>::Traits >
1097{
typedef Triangle<6> type ; };
1100template<>
struct BasicTopologyOf<
Triangle<4>::Traits >
1101{
typedef Triangle<4> type ; };
1104template<>
struct BasicTopologyOf<
Quadrilateral<4>::Traits >
1105{
typedef Quadrilateral<4> type ; };
1108template<>
struct BasicTopologyOf<
Quadrilateral<8>::Traits >
1109{
typedef Quadrilateral<8> type ; };
1112template<>
struct BasicTopologyOf<
Quadrilateral<9>::Traits >
1113{
typedef Quadrilateral<9> type ; };
1116template<>
struct BasicTopologyOf< Pentagon<5>::Traits >
1117{
typedef Pentagon<5> type ; };
1120template<>
struct BasicTopologyOf< Hexagon<6>::Traits >
1121{
typedef Hexagon<6> type ; };
1124template<>
struct BasicTopologyOf<
Tetrahedron<4>::Traits >
1125{
typedef Tetrahedron<4> type ; };
1128template<>
struct BasicTopologyOf<
Tetrahedron<10>::Traits >
1129{
typedef Tetrahedron<10> type ; };
1132template<>
struct BasicTopologyOf<
Tetrahedron<11>::Traits >
1133{
typedef Tetrahedron<11> type ; };
1136template<>
struct BasicTopologyOf<
Tetrahedron<8>::Traits >
1137{
typedef Tetrahedron<8> type ; };
1140template<>
struct BasicTopologyOf<
Pyramid<5>::Traits >
1141{
typedef Tetrahedron<5> type ; };
1144template<>
struct BasicTopologyOf<
Pyramid<13>::Traits >
1145{
typedef Tetrahedron<13> type ; };
1148template<>
struct BasicTopologyOf<
Pyramid<14>::Traits >
1149{
typedef Tetrahedron<14> type ; };
1152template<>
struct BasicTopologyOf<
Wedge<6>::Traits >
1153{
typedef Wedge<6> type ; };
1156template<>
struct BasicTopologyOf<
Wedge<15>::Traits >
1157{
typedef Wedge<15> type ; };
1160template<>
struct BasicTopologyOf<
Wedge<18>::Traits >
1161{
typedef Wedge<18> type ; };
1164template<>
struct BasicTopologyOf<
Hexahedron<8>::Traits >
1165{
typedef Hexahedron<8> type ; };
1168template<>
struct BasicTopologyOf<
Hexahedron<20>::Traits >
1169{
typedef Hexahedron<20> type ; };
1172template<>
struct BasicTopologyOf<
Hexahedron<27>::Traits >
1173{
typedef Hexahedron<27> type ; };
1179const unsigned * index_identity_array();
1190const struct CellTopologyData_Subcell * subcell_nodes_array();
const CellTopologyData * getCellTopologyData< Particle >()
Singleton for Particle topology.
std::ostream & operator<<(std::ostream &, const CellTopology &)
Overloaded << operator for CellTopologyData objects.
const CellTopologyData * getCellTopologyData< Node >()
Singleton for Node topology.
struct CellTopologyData CellTopologyData
Self-typedef.
const CellTopologyData * getCellTopologyData()
Return a CellTopology singleton for the given cell topology traits.
A simple 'C' struct of cell topology attributes.
Topological traits: Dimension = 2, Edges = 1, Vertices = 2, and Nodes = 2 or 3.
Compile-time traits for a cell topology.
Topological traits: Dimension = 3, Sides = 6, Edges = 12, Vertices = 8, and Nodes = 8,...
Compile-time list of indices.
Topological traits: Dimension = 1, Vertices = 2, Nodes = 2 or 3.
Member typedef ... type ; is a type list constructed from the template arguments.
TypeListClean< dirty_type >::type type
The constructed type list.
Topological traits: Dimension = 0, Vertices = 0, Nodes = 0.
Topological traits: Dimension = 0, Vertices = 1, Nodes = 1.
Topological traits: Dimension = 3, Sides = 5, Edges = 8, Vertices = 5, and Nodes = 5,...
Topological traits: Dimension = 2, Edges = 4, Vertices = 4, and Nodes = 4, 8, or 9.
Topological traits: Dimension = 2, Edges = 2, Vertices = 2, and Nodes = 2 or 3.
Topological traits: Dimension = 2, Sides = 2, Edges = 4, Vertices = 4, and Nodes = 4,...
Topological traits: Dimension = 3, Sides = 2, Edges = 3, Vertices = 3, and Nodes = 3 or 6.
Topological traits: Dimension = 3, Sides = 4, Edges = 6, Vertices = 4, and Nodes = 4 or 10.
Topological traits: Dimension = 2, Edges = 3, Vertices = 3, and Nodes = 3 or 6.
Topological traits: Dimension = 3, Sides = 5, Edges = 9, Vertices = 6, and Nodes = 6,...