Shards_BasicTopologies.hpp

00001 /*------------------------------------------------------------------------*/
00002 /*                  shards : Shared Discretization Tools                  */
00003 /*                Copyright (2008) Sandia Corporation                     */
00004 /*                                                                        */
00005 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00006 /*  license for use of this work by or on behalf of the U.S. Government.  */
00007 /*                                                                        */
00008 /*  This library is free software; you can redistribute it and/or modify  */
00009 /*  it under the terms of the GNU Lesser General Public License as        */
00010 /*  published by the Free Software Foundation; either version 2.1 of the  */
00011 /*  License, or (at your option) any later version.                       */
00012 /*                                                                        */
00013 /*  This library is distributed in the hope that it will be useful,       */
00014 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of        */
00015 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     */
00016 /*  Lesser General Public License for more details.                       */
00017 /*                                                                        */
00018 /*  You should have received a copy of the GNU Lesser General Public      */
00019 /*  License along with this library; if not, write to the Free Software   */
00020 /*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307   */
00021 /*  USA                                                                   */
00022 /*------------------------------------------------------------------------*/
00023 
00024 #ifndef Shards_BasicTopologies_hpp
00025 #define Shards_BasicTopologies_hpp
00026 
00027 #include <iosfwd>
00028 #include <Shards_CellTopologyTraits.hpp>
00029 
00030 namespace shards {
00031 
00036 //----------------------------------------------------------------------
00037 
00039 struct Node : public CellTopologyTraits<0,0,0>
00040 {
00041 #ifndef DOXYGEN_COMPILE
00042   typedef Node base ;
00043 #endif /* DOXYGEN_COMPILE */
00044 };
00045  
00047 template<> const CellTopologyData * getCellTopologyData< Node >();
00048 
00049 //----------------------------------------------------------------------
00050 
00052 struct Particle : public CellTopologyTraits<1,1,1>
00053 {
00054 #ifndef DOXYGEN_COMPILE
00055   typedef Particle base ;
00056 #endif /* DOXYGEN_COMPILE */
00057 };
00058 
00060 template<> const CellTopologyData * getCellTopologyData< Particle >();
00061 
00062 //----------------------------------------------------------------------
00063 
00069 template< unsigned NodeCount = 2 > struct Line {};
00070 
00072 template<> const CellTopologyData * getCellTopologyData< Line<2> >();
00073 
00075 template<> const CellTopologyData * getCellTopologyData< Line<3> >();
00076 
00077 //----------------------------------------------------------------------
00078 
00084 template< unsigned NodeCount = 2 > struct Beam {};
00085 
00087 template<> const CellTopologyData * getCellTopologyData< Beam<2> >();
00088 
00090 template<> const CellTopologyData * getCellTopologyData< Beam<3> >();
00091 
00092 //----------------------------------------------------------------------
00093 
00099 template< unsigned NodeCount = 2 > struct ShellLine {};
00100 
00102 template<> const CellTopologyData * getCellTopologyData< ShellLine<2> >();
00103 
00105 template<> const CellTopologyData * getCellTopologyData< ShellLine<3> >();
00106 
00107 //----------------------------------------------------------------------
00108 
00131 template< unsigned NodeCount = 3 > struct Triangle {};
00132 
00134 template<> const CellTopologyData * getCellTopologyData< Triangle<3> >();
00135 
00137 template<> const CellTopologyData * getCellTopologyData< Triangle<6> >();
00138 
00140 template<> const CellTopologyData * getCellTopologyData< Triangle<4> >();
00141 
00142 //----------------------------------------------------------------------
00143 
00149 template< unsigned NodeCount = 3 > struct ShellTriangle {};
00150 
00152 template<> const CellTopologyData * getCellTopologyData< ShellTriangle<3> >();
00153 
00155 template<> const CellTopologyData * getCellTopologyData< ShellTriangle<6> >();
00156 
00157 //----------------------------------------------------------------------
00180 template< unsigned NodeCount = 4 > struct Quadrilateral {};
00181 
00183 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<4> >();
00184 
00186 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<8> >();
00187 
00189 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<9> >();
00190 
00191 //----------------------------------------------------------------------
00192 
00198 template< unsigned NodeCount = 4 > struct ShellQuadrilateral {};
00199 
00201 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<4> >();
00202 
00204 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<8> >();
00205 
00207 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<9> >();
00208 
00209 //----------------------------------------------------------------------
00210 
00214 template< unsigned NodeCount = 4 > struct Tetrahedron ;
00215 
00217 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<4> >();
00218 
00220 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<10> >();
00221 
00223 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<8> >();
00224 
00225 //----------------------------------------------------------------------
00226 
00230 template< unsigned NodeCount = 5 > struct Pyramid {};
00231 
00233 template<> const CellTopologyData * getCellTopologyData< Pyramid<5> >();
00234 
00236 template<> const CellTopologyData * getCellTopologyData< Pyramid<13> >();
00237 
00239 template<> const CellTopologyData * getCellTopologyData< Pyramid<14> >();
00240 
00241 //----------------------------------------------------------------------
00242 
00246 template< unsigned NodeCount = 6 > struct Wedge {};
00247 
00249 template<> const CellTopologyData * getCellTopologyData< Wedge<6> >();
00250 
00252 template<> const CellTopologyData * getCellTopologyData< Wedge<15> >();
00253 
00255 template<> const CellTopologyData * getCellTopologyData< Wedge<18> >();
00256 
00257 //----------------------------------------------------------------------
00258 
00337 template< unsigned NodeCount = 8 > struct Hexahedron {};
00338 
00340 template<> const CellTopologyData * getCellTopologyData< Hexahedron<8> >();
00341 
00343 template<> const CellTopologyData * getCellTopologyData< Hexahedron<20> >();
00344 
00346 template<> const CellTopologyData * getCellTopologyData< Hexahedron<27> >();
00347 
00348 //----------------------------------------------------------------------
00349 //----------------------------------------------------------------------
00350 
00351 #ifndef DOXYGEN_COMPILE
00352 
00353 //----------------------------------------------------------------------
00354 //----------------------------------------------------------------------
00355 // Topologies for Rank-1 cells.
00356 
00357 typedef IndexList< 0 , 1 , 2 > LineNodeMapIdentity ;
00358 typedef IndexList< 1 , 0 , 2 > LineNodeMapReversed ;
00359 
00360 typedef MakeTypeList< LineNodeMapIdentity , LineNodeMapReversed >::type
00361   LineNodePermutation ;
00362 
00363 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00364                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00365   LineNodePermutationPolarity;
00366 
00367 template<> struct Line<2> : public
00368   CellTopologyTraits< 1 , 2 , 2 ,
00369                       TypeListEnd, TypeListEnd,
00370                       TypeListEnd, TypeListEnd,
00371                       LineNodePermutation,
00372                       LineNodePermutationPolarity >
00373 { typedef Line<2> base ; };
00374 
00375 template<> struct Line<3> : public
00376   CellTopologyTraits< 1 , 2 , 3 ,
00377                       TypeListEnd, TypeListEnd,
00378                       TypeListEnd, TypeListEnd,
00379                       LineNodePermutation,
00380                       LineNodePermutationPolarity >
00381 { typedef Line<2> base ; };
00382 
00383 // Beam is a line with one edge:
00384 
00385 typedef
00386   MakeTypeList< LineNodeMapIdentity >::type BeamEdgeNodeMap ;
00387 
00388 template<> struct Beam<2> : public
00389   CellTopologyTraits< 2 , 2 , 2 ,
00390                       MakeTypeList< Line<2> >::type ,
00391                       BeamEdgeNodeMap >
00392 { typedef Beam<2> base ; };
00393 
00394 template<> struct Beam<3> : public
00395   CellTopologyTraits< 2 , 2 , 3 ,
00396                       MakeTypeList< Line<3> >::type ,
00397                       BeamEdgeNodeMap >
00398 { typedef Beam<2> base ; };
00399 
00400 // Shell-line has two edges:
00401 
00402 typedef
00403   MakeTypeList< LineNodeMapIdentity , LineNodeMapReversed >::type
00404     ShellLineEdgeNodeMap ;
00405 
00406 template<> struct ShellLine<2> : public
00407   CellTopologyTraits< 2 , 2 , 2 ,
00408                       MakeTypeList< Line<2> , Line<2> >::type ,
00409                       ShellLineEdgeNodeMap >
00410 { typedef ShellLine<2> base ; };
00411 
00412 template<> struct ShellLine<3> : public
00413   CellTopologyTraits< 2 , 2 , 3 ,
00414                       MakeTypeList< Line<3> , Line<3> >::type ,
00415                       ShellLineEdgeNodeMap >
00416 { typedef ShellLine<2> base ; };
00417 
00418 //----------------------------------------------------------------------
00419 //----------------------------------------------------------------------
00420 // Topologies for Rank-2 cells.
00421 
00422 typedef IndexList< 0, 1, 2,  3, 4, 5 > TriangleNodeMapIdentity ;
00423 typedef IndexList< 2, 0, 1,  5, 3, 4 > TriangleNodeMapPositive1 ;
00424 typedef IndexList< 1, 2, 0,  4, 5, 3 > TriangleNodeMapPositive2 ;
00425 typedef IndexList< 0, 2, 1,  5, 4, 3 > TriangleNodeMapReversed0 ;
00426 typedef IndexList< 2, 1, 0,  4, 3, 5 > TriangleNodeMapReversed1 ;
00427 typedef IndexList< 1, 0, 2,  3, 5, 4 > TriangleNodeMapReversed2 ;
00428 
00429 typedef MakeTypeList< TriangleNodeMapIdentity , 
00430                       TriangleNodeMapPositive1 , 
00431                       TriangleNodeMapPositive2 , 
00432                       TriangleNodeMapReversed0 , 
00433                       TriangleNodeMapReversed1 , 
00434                       TriangleNodeMapReversed2 >::type
00435   TriangleNodePermutation ;
00436 
00437 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00438                    CELL_PERMUTATION_POLARITY_POSITIVE,
00439                    CELL_PERMUTATION_POLARITY_POSITIVE,
00440                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00441                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00442                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00443   TriangleNodePermutationPolarity;
00444 
00445 typedef MakeTypeList< IndexList< 0 , 1 , 3 > ,
00446                       IndexList< 1 , 2 , 4 > ,
00447                       IndexList< 2 , 0 , 5 > >::type
00448   TriangleEdgeNodeMap ;
00449 
00450 template<> struct Triangle<3> : public
00451   CellTopologyTraits< 2 , 3 , 3 ,
00452                       MakeTypeList< Line<2>  ,
00453                                     Line<2>  ,
00454                                     Line<2>  >::type ,
00455                       TriangleEdgeNodeMap ,
00456                       TypeListEnd , TypeListEnd ,
00457                       TriangleNodePermutation ,
00458                       TriangleNodePermutationPolarity >
00459 { typedef Triangle<3> base ; };
00460 
00461 template<> struct Triangle<6> : public
00462   CellTopologyTraits< 2 , 3 , 6 ,
00463                       MakeTypeList< Line<3>  ,
00464                                     Line<3>  ,
00465                                     Line<3>  >::type ,
00466                       TriangleEdgeNodeMap ,
00467                       TypeListEnd , TypeListEnd ,
00468                       TriangleNodePermutation ,
00469                       TriangleNodePermutationPolarity >
00470 { typedef Triangle<3> base ; };
00471 
00472 typedef IndexList< 0, 1, 2,  3 > Triangle4_NodeMapIdentity ;
00473 typedef IndexList< 2, 0, 1,  3 > Triangle4_NodeMapPositive1 ;
00474 typedef IndexList< 1, 2, 0,  3 > Triangle4_NodeMapPositive2 ;
00475 typedef IndexList< 0, 2, 1,  3 > Triangle4_NodeMapReversed0 ;
00476 typedef IndexList< 2, 1, 0,  3 > Triangle4_NodeMapReversed1 ;
00477 typedef IndexList< 1, 0, 2,  3 > Triangle4_NodeMapReversed2 ;
00478 
00479 typedef MakeTypeList< Triangle4_NodeMapIdentity ,
00480                       Triangle4_NodeMapPositive1 , 
00481                       Triangle4_NodeMapPositive2 , 
00482                       Triangle4_NodeMapReversed0 , 
00483                       Triangle4_NodeMapReversed1 , 
00484                       Triangle4_NodeMapReversed2 >::type
00485   Triangle4_NodePermutation ;
00486 
00487 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00488                    CELL_PERMUTATION_POLARITY_POSITIVE,
00489                    CELL_PERMUTATION_POLARITY_POSITIVE,
00490                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00491                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00492                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00493   Triangle4_NodePermutationPolarity;
00494 
00495 template<> struct Triangle<4> : public
00496   CellTopologyTraits< 2 , 3 , 4 ,
00497                       MakeTypeList< Line<2>  ,
00498                                     Line<2>  ,
00499                                     Line<2>  >::type ,
00500                       TriangleEdgeNodeMap ,
00501                       TypeListEnd , TypeListEnd ,
00502                       Triangle4_NodePermutation ,
00503                       Triangle4_NodePermutationPolarity >
00504 { typedef Triangle<3> base ; };
00505 
00506 //------------------------------------------------------------------------
00507 
00508 typedef MakeTypeList< TriangleNodeMapIdentity ,
00509                       TriangleNodeMapReversed0 >::type
00510   ShellTriangleFaceNodeMap ;
00511 
00512 template<> struct ShellTriangle<3> : public
00513   CellTopologyTraits< 3 , 3 , 3 ,
00514                             MakeTypeList< Line<2>  ,
00515                                           Line<2>  ,
00516                                           Line<2>  >::type ,
00517                             TriangleEdgeNodeMap ,
00518                             MakeTypeList< Triangle<3>  ,
00519                                           Triangle<3>  >::type ,
00520                             ShellTriangleFaceNodeMap >
00521 { typedef ShellTriangle<3> base ; };
00522 
00523 template<> struct ShellTriangle<6> : public
00524   CellTopologyTraits< 3 , 3 , 6 ,
00525                             MakeTypeList< Line<3>  ,
00526                                           Line<3>  ,
00527                                           Line<3>  >::type ,
00528                             TriangleEdgeNodeMap ,
00529                             MakeTypeList< Triangle<6>  ,
00530                                           Triangle<6>  >::type ,
00531                             ShellTriangleFaceNodeMap >
00532 { typedef ShellTriangle<3> base ; };
00533 
00534 //----------------------------------------------------------------------
00535 
00536 // A permutation should either be the identity or reversed.
00537 // Simple (non-reversed) rotations should not happen in practice.
00538 
00539 typedef IndexList< 0, 1, 2, 3,  4, 5, 6, 7,  8 > QuadrilateralNodeMapIdentity ;
00540 typedef IndexList< 3, 0, 1, 2,  7, 4, 5, 6,  8 > QuadrilateralNodeMapPositive1 ;
00541 typedef IndexList< 2, 3, 0, 1,  6, 7, 4, 5,  8 > QuadrilateralNodeMapPositive2 ;
00542 typedef IndexList< 1, 2, 3, 0,  5, 6, 7, 4,  8 > QuadrilateralNodeMapPositive3 ;
00543 typedef IndexList< 0, 3, 2, 1,  7, 6, 5, 4,  8 > QuadrilateralNodeMapReversed0 ;
00544 typedef IndexList< 3, 2, 1, 0,  6, 5, 4, 7,  8 > QuadrilateralNodeMapReversed1 ;
00545 typedef IndexList< 2, 1, 0, 3,  5, 4, 7, 6,  8 > QuadrilateralNodeMapReversed2 ;
00546 typedef IndexList< 1, 0, 3, 2,  4, 7, 6, 5,  8 > QuadrilateralNodeMapReversed3 ;
00547 
00548 typedef MakeTypeList< QuadrilateralNodeMapIdentity ,
00549                       QuadrilateralNodeMapPositive1 ,
00550                       QuadrilateralNodeMapPositive2 ,
00551                       QuadrilateralNodeMapPositive3 ,
00552                       QuadrilateralNodeMapReversed0 ,
00553                       QuadrilateralNodeMapReversed1 ,
00554                       QuadrilateralNodeMapReversed2 ,
00555                       QuadrilateralNodeMapReversed3 >::type
00556   QuadrilateralNodePermutation ;
00557 
00558 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00559                    CELL_PERMUTATION_POLARITY_POSITIVE,
00560                    CELL_PERMUTATION_POLARITY_POSITIVE,
00561                    CELL_PERMUTATION_POLARITY_POSITIVE,
00562                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00563                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00564                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00565                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00566   QuadrilateralNodePermutationPolarity;
00567 
00568 typedef MakeTypeList< IndexList< 0 , 1 ,  4 > ,
00569                       IndexList< 1 , 2 ,  5 > ,
00570                       IndexList< 2 , 3 ,  6 > ,
00571                       IndexList< 3 , 0 ,  7 > >::type
00572   QuadrilateralEdgeNodeMap ;
00573 
00574 template<> struct Quadrilateral<4> : public
00575   CellTopologyTraits< 2 , 4 , 4 ,
00576                             MakeTypeList< Line<2>  ,
00577                                           Line<2>  ,
00578                                           Line<2>  ,
00579                                           Line<2>  >::type ,
00580                             QuadrilateralEdgeNodeMap ,
00581                             TypeListEnd , TypeListEnd ,
00582                             QuadrilateralNodePermutation ,
00583                             QuadrilateralNodePermutationPolarity >
00584 { typedef Quadrilateral<4> base ; };
00585 
00586 template<> struct Quadrilateral<8> : public
00587   CellTopologyTraits< 2 , 4 , 8 ,
00588                             MakeTypeList< Line<3>  ,
00589                                           Line<3>  ,
00590                                           Line<3>  ,
00591                                           Line<3>  >::type ,
00592                             QuadrilateralEdgeNodeMap ,
00593                             TypeListEnd , TypeListEnd ,
00594                             QuadrilateralNodePermutation ,
00595                             QuadrilateralNodePermutationPolarity >
00596 { typedef Quadrilateral<4> base ; };
00597 
00598 template<> struct Quadrilateral<9> : public
00599   CellTopologyTraits< 2 , 4 , 9 ,
00600                             MakeTypeList< Line<3>  ,
00601                                           Line<3>  ,
00602                                           Line<3>  ,
00603                                           Line<3>  >::type ,
00604                             QuadrilateralEdgeNodeMap ,
00605                             TypeListEnd , TypeListEnd ,
00606                             QuadrilateralNodePermutation ,
00607                             QuadrilateralNodePermutationPolarity >
00608 { typedef Quadrilateral<4> base ; };
00609 
00610 //----------------------------------------------------------------------
00611 
00612 typedef MakeTypeList< QuadrilateralNodeMapIdentity ,
00613                       QuadrilateralNodeMapReversed0 >::type
00614   ShellQuadrilateralFaceNodeMap ;
00615 
00616 template<> struct ShellQuadrilateral<4> : public
00617   CellTopologyTraits< 3 , 4 , 4 ,
00618                             MakeTypeList< Line<2>  ,
00619                                           Line<2>  ,
00620                                           Line<2>  ,
00621                                           Line<2>  >::type ,
00622                             QuadrilateralEdgeNodeMap ,
00623                             MakeTypeList< Quadrilateral<4>  ,
00624                                           Quadrilateral<4>  >::type ,
00625                             ShellQuadrilateralFaceNodeMap >
00626 { typedef ShellQuadrilateral<4> base ; };
00627 
00628 template<> struct ShellQuadrilateral<8> : public
00629   CellTopologyTraits< 3 , 4 , 8 ,
00630                             MakeTypeList< Line<3>  ,
00631                                           Line<3>  ,
00632                                           Line<3>  ,
00633                                           Line<3>  >::type ,
00634                             QuadrilateralEdgeNodeMap ,
00635                             MakeTypeList< Quadrilateral<8>  ,
00636                                           Quadrilateral<8>  >::type ,
00637                             ShellQuadrilateralFaceNodeMap >
00638 { typedef ShellQuadrilateral<4> base ; };
00639 
00640 template<> struct ShellQuadrilateral<9> : public
00641   CellTopologyTraits< 3 , 4 , 9 ,
00642                             MakeTypeList< Line<3>  ,
00643                                           Line<3>  ,
00644                                           Line<3>  ,
00645                                           Line<3>  >::type ,
00646                             QuadrilateralEdgeNodeMap ,
00647                             MakeTypeList< Quadrilateral<9>  ,
00648                                           Quadrilateral<9>  >::type ,
00649                             ShellQuadrilateralFaceNodeMap >
00650 { typedef ShellQuadrilateral<4> base ; };
00651 
00652 //------------------------------------------------------------------------
00653 
00654 typedef MakeTypeList< IndexList< 0 , 1 , 4 > ,
00655                       IndexList< 1 , 2 , 5 > ,
00656                       IndexList< 2 , 0 , 6 > ,
00657                       IndexList< 0 , 3 , 7 > ,
00658                       IndexList< 1 , 3 , 8 > ,
00659                       IndexList< 2 , 3 , 9 > >::type
00660   TetrahedronEdgeNodeMap ;
00661 
00662 typedef MakeTypeList< IndexList< 0 , 1 , 3 ,   4 , 8 , 7 > ,
00663                       IndexList< 1 , 2 , 3 ,   5 , 9 , 8 > ,
00664                       IndexList< 0 , 3 , 2 ,   7 , 9 , 6 > ,
00665                       IndexList< 0 , 2 , 1 ,   6 , 5 , 4 > >::type
00666   TetrahedronSideNodeMap ;
00667 
00668 template<> struct Tetrahedron<4> : public
00669   CellTopologyTraits< 3 , 4 , 4 ,
00670                       MakeTypeList< Line<2>  ,
00671                                     Line<2>  ,
00672                                     Line<2>  ,
00673                                     Line<2>  ,
00674                                     Line<2>  ,
00675                                     Line<2>  >::type ,
00676                       TetrahedronEdgeNodeMap ,
00677                       MakeTypeList< Triangle<3>  ,
00678                                     Triangle<3>  ,
00679                                     Triangle<3>  ,
00680                                     Triangle<3>  >::type ,
00681                       TetrahedronSideNodeMap >
00682 { typedef Tetrahedron<4> base ; };
00683 
00684 template<> struct Tetrahedron<10> : public
00685   CellTopologyTraits< 3 , 4 , 10 ,
00686                       MakeTypeList< Line<3>  ,
00687                                     Line<3>  ,
00688                                     Line<3>  ,
00689                                     Line<3>  ,
00690                                     Line<3>  ,
00691                                     Line<3>  >::type ,
00692                       TetrahedronEdgeNodeMap ,
00693                       MakeTypeList< Triangle<6>  ,
00694                                     Triangle<6>  ,
00695                                     Triangle<6>  ,
00696                                     Triangle<6>  >::type ,
00697                       TetrahedronSideNodeMap >
00698 { typedef Tetrahedron<4> base ; };
00699 
00700 template<> struct Tetrahedron<8> : public
00701   CellTopologyTraits< 3 , 4 , 8 ,
00702                       MakeTypeList< Line<2>  ,
00703                                     Line<2>  ,
00704                                     Line<2>  ,
00705                                     Line<2>  ,
00706                                     Line<2>  ,
00707                                     Line<2>  >::type ,
00708                       TetrahedronEdgeNodeMap ,
00709                       MakeTypeList< Triangle<4>  ,
00710                                     Triangle<4>  ,
00711                                     Triangle<4>  ,
00712                                     Triangle<4>  >::type ,
00713                       TetrahedronSideNodeMap >
00714 { typedef Tetrahedron<4> base ; };
00715 
00716 //------------------------------------------------------------------------
00717 
00718 typedef
00719   MakeTypeList< IndexList< 0 , 1 ,   5 > ,
00720                 IndexList< 1 , 2 ,   6 > ,
00721                 IndexList< 2 , 3 ,   7 > ,
00722                 IndexList< 3 , 0 ,   8 > ,
00723                 IndexList< 0 , 4 ,   9 > ,
00724                 IndexList< 1 , 4 ,  10 > ,
00725                 IndexList< 2 , 4 ,  11 > ,
00726                 IndexList< 3 , 4 ,  12 > >::type
00727   PyramidEdgeNodeMap ;
00728 
00729 typedef
00730   MakeTypeList< IndexList< 0, 1, 4,     5, 10,  9 > ,
00731                 IndexList< 1, 2, 4,     6, 11, 10 > ,
00732                 IndexList< 2, 3, 4,     7, 12, 11 > ,
00733                 IndexList< 3, 0, 4,     8,  9, 12 > ,
00734                 IndexList< 0, 3, 2, 1,  8,  7,  6,  5,  13 > >::type
00735   PyramidFaceNodeMap ;
00736 
00737 template<> struct Pyramid<5> : public
00738   CellTopologyTraits< 3 , 5 , 5 ,
00739                       MakeTypeList< Line<2>  ,
00740                                     Line<2>  ,
00741                                     Line<2>  ,
00742                                     Line<2>  ,
00743                                     Line<2>  ,
00744                                     Line<2>  ,
00745                                     Line<2>  ,
00746                                     Line<2>  >::type ,
00747                       PyramidEdgeNodeMap ,
00748                       MakeTypeList< Triangle<3>  ,
00749                                     Triangle<3>  ,
00750                                     Triangle<3>  ,
00751                                     Triangle<3>  ,
00752                                     Quadrilateral<4>  >::type ,
00753                       PyramidFaceNodeMap >
00754 { typedef Pyramid<5> base ; };
00755 
00756 template<> struct Pyramid<13> : public
00757   CellTopologyTraits< 3 , 5 , 13 ,
00758                       MakeTypeList< Line<3>  ,
00759                                     Line<3>  ,
00760                                     Line<3>  ,
00761                                     Line<3>  ,
00762                                     Line<3>  ,
00763                                     Line<3>  ,
00764                                     Line<3>  ,
00765                                     Line<3>  >::type ,
00766                       PyramidEdgeNodeMap ,
00767                       MakeTypeList< Triangle<6>  ,
00768                                     Triangle<6>  ,
00769                                     Triangle<6>  ,
00770                                     Triangle<6>  ,
00771                                     Quadrilateral<8>  >::type ,
00772                       PyramidFaceNodeMap >
00773 { typedef Pyramid<5> base ; };
00774 
00775 template<> struct Pyramid<14> : public
00776   CellTopologyTraits< 3 , 5 , 14 ,
00777                       MakeTypeList< Line<3>  ,
00778                                     Line<3>  ,
00779                                     Line<3>  ,
00780                                     Line<3>  ,
00781                                     Line<3>  ,
00782                                     Line<3>  ,
00783                                     Line<3>  ,
00784                                     Line<3>  >::type ,
00785                       PyramidEdgeNodeMap ,
00786                       MakeTypeList< Triangle<6>  ,
00787                                     Triangle<6>  ,
00788                                     Triangle<6>  ,
00789                                     Triangle<6>  ,
00790                                     Quadrilateral<9>  >::type ,
00791                       PyramidFaceNodeMap >
00792 { typedef Pyramid<5> base ; };
00793 
00794 //------------------------------------------------------------------------
00795 
00796 typedef
00797   MakeTypeList< IndexList< 0 , 1 ,   6 > ,
00798                 IndexList< 1 , 2 ,   7 > ,
00799                 IndexList< 2 , 0 ,   8 > ,
00800                 IndexList< 3 , 4 ,  12 > ,
00801                 IndexList< 4 , 5 ,  13 > ,
00802                 IndexList< 5 , 3 ,  14 > ,
00803                 IndexList< 0 , 3 ,   9 > ,
00804                 IndexList< 1 , 4 ,  10 > ,
00805                 IndexList< 2 , 5 ,  11 >
00806   >::type WedgeEdgeNodeMap ;
00807 
00808 typedef
00809   MakeTypeList< IndexList< 0 , 1 , 4 , 3 ,   6 , 10 , 12 ,  9 ,  15 > ,
00810                 IndexList< 1 , 2 , 5 , 4 ,   7 , 11 , 13 , 10 ,  16 > ,
00811                 IndexList< 0 , 3 , 5 , 2 ,   9 , 14 , 11 ,  8 ,  17 > ,
00812                 IndexList< 0 , 2 , 1 ,       8 ,  7 ,  6 > ,
00813                 IndexList< 3 , 4 , 5 ,      12 , 13 , 14 >
00814   >::type WedgeFaceNodeMap ;
00815 
00816 template<> struct Wedge<6> : public
00817   CellTopologyTraits< 3 , 6 , 6 ,
00818                       MakeTypeList< Line<2>  ,
00819                                     Line<2>  ,
00820                                     Line<2>  ,
00821                                     Line<2>  ,
00822                                     Line<2>  ,
00823                                     Line<2>  ,
00824                                     Line<2>  ,
00825                                     Line<2>  ,
00826                                     Line<2>  >::type ,
00827                       WedgeEdgeNodeMap ,
00828                       MakeTypeList< Quadrilateral<4>  ,
00829                                     Quadrilateral<4>  ,
00830                                     Quadrilateral<4>  ,
00831                                     Triangle<3>  ,
00832                                     Triangle<3>  >::type ,
00833                       WedgeFaceNodeMap >
00834 { typedef Wedge<6> base ; };
00835 
00836 template<> struct Wedge<15> : public
00837   CellTopologyTraits< 3 , 6 , 15 ,
00838                       MakeTypeList< Line<3>  ,
00839                                     Line<3>  ,
00840                                     Line<3>  ,
00841                                     Line<3>  ,
00842                                     Line<3>  ,
00843                                     Line<3>  ,
00844                                     Line<3>  ,
00845                                     Line<3>  ,
00846                                     Line<3>  >::type ,
00847                       WedgeEdgeNodeMap ,
00848                       MakeTypeList< Quadrilateral<8>  ,
00849                                     Quadrilateral<8>  ,
00850                                     Quadrilateral<8>  ,
00851                                     Triangle<6>  ,
00852                                     Triangle<6>  >::type ,
00853                       WedgeFaceNodeMap >
00854 { typedef Wedge<6> base ; };
00855 
00856 template<> struct Wedge<18> : public
00857   CellTopologyTraits< 3 , 6 , 18 ,
00858                       MakeTypeList< Line<3>  ,
00859                                     Line<3>  ,
00860                                     Line<3>  ,
00861                                     Line<3>  ,
00862                                     Line<3>  ,
00863                                     Line<3>  ,
00864                                     Line<3>  ,
00865                                     Line<3>  ,
00866                                     Line<3>  >::type ,
00867                       WedgeEdgeNodeMap ,
00868                       MakeTypeList< Quadrilateral<9>  ,
00869                                     Quadrilateral<9>  ,
00870                                     Quadrilateral<9>  ,
00871                                     Triangle<6>  ,
00872                                     Triangle<6>  >::type ,
00873                       WedgeFaceNodeMap >
00874 { typedef Wedge<6> base ; };
00875 
00876 //------------------------------------------------------------------------
00877 
00878 typedef
00879   MakeTypeList< IndexList< 0 , 1 ,   8 > ,
00880                 IndexList< 1 , 2 ,   9 > ,
00881                 IndexList< 2 , 3 ,  10 > ,
00882                 IndexList< 3 , 0 ,  11 > ,
00883                 IndexList< 4 , 5 ,  16 > ,
00884                 IndexList< 5 , 6 ,  17 > ,
00885                 IndexList< 6 , 7 ,  18 > ,
00886                 IndexList< 7 , 4 ,  19 > ,
00887                 IndexList< 0 , 4 ,  12 > ,
00888                 IndexList< 1 , 5 ,  13 > ,
00889                 IndexList< 2 , 6 ,  14 > ,
00890                 IndexList< 3 , 7 ,  15 > >::type
00891   HexahedronEdgeNodeMap ;
00892 
00893 typedef
00894   MakeTypeList< IndexList< 0, 1, 5, 4,   8, 13, 16, 12,   25 > ,
00895                 IndexList< 1, 2, 6, 5,   9, 14, 17, 13,   24 > ,
00896                 IndexList< 2, 3, 7, 6,  10, 15, 18, 14,   26 > ,
00897                 IndexList< 0, 4, 7, 3,  12, 19, 15, 11,   23 > ,
00898                 IndexList< 0, 3, 2, 1,  11, 10,  9,  8,   21 > ,
00899                 IndexList< 4, 5, 6, 7,  16, 17, 18, 19,   22 > >::type
00900   HexahedronFaceNodeMap ;
00901 
00902 //----------------------------------------------------------------------
00903 
00904 template<> struct Hexahedron<8> : public
00905   CellTopologyTraits< 3 , 8 , 8 ,
00906                       MakeTypeList< Line<2>  ,
00907                                     Line<2>  ,
00908                                     Line<2>  ,
00909                                     Line<2>  ,
00910                                     Line<2>  ,
00911                                     Line<2>  ,
00912                                     Line<2>  ,
00913                                     Line<2>  ,
00914                                     Line<2>  ,
00915                                     Line<2>  ,
00916                                     Line<2>  ,
00917                                     Line<2>  >::type ,
00918                       HexahedronEdgeNodeMap ,
00919                       MakeTypeList< Quadrilateral<4>  ,
00920                                     Quadrilateral<4>  ,
00921                                     Quadrilateral<4>  ,
00922                                     Quadrilateral<4>  ,
00923                                     Quadrilateral<4>  ,
00924                                     Quadrilateral<4>  >::type ,
00925                       HexahedronFaceNodeMap >
00926 {
00927   typedef Hexahedron<8> base ;
00928 };
00929 
00930 template<> struct Hexahedron<20> : public
00931   CellTopologyTraits< 3 , 8 , 20 ,
00932                       MakeTypeList< Line<3>  ,
00933                                     Line<3>  ,
00934                                     Line<3>  ,
00935                                     Line<3>  ,
00936                                     Line<3>  ,
00937                                     Line<3>  ,
00938                                     Line<3>  ,
00939                                     Line<3>  ,
00940                                     Line<3>  ,
00941                                     Line<3>  ,
00942                                     Line<3>  ,
00943                                     Line<3>  >::type ,
00944                       HexahedronEdgeNodeMap ,
00945                       MakeTypeList< Quadrilateral<8>  ,
00946                                     Quadrilateral<8>  ,
00947                                     Quadrilateral<8>  ,
00948                                     Quadrilateral<8>  ,
00949                                     Quadrilateral<8>  ,
00950                                     Quadrilateral<8>  >::type ,
00951                       HexahedronFaceNodeMap >
00952 {
00953   typedef Hexahedron<8> base ;
00954 };
00955 
00956 template<> struct Hexahedron<27> : public
00957   CellTopologyTraits< 3 , 8 , 27 ,
00958                       MakeTypeList< Line<3>  ,
00959                                     Line<3>  ,
00960                                     Line<3>  ,
00961                                     Line<3>  ,
00962                                     Line<3>  ,
00963                                     Line<3>  ,
00964                                     Line<3>  ,
00965                                     Line<3>  ,
00966                                     Line<3>  ,
00967                                     Line<3>  ,
00968                                     Line<3>  ,
00969                                     Line<3>  >::type ,
00970                       HexahedronEdgeNodeMap ,
00971                       MakeTypeList< Quadrilateral<9>  ,
00972                                     Quadrilateral<9>  ,
00973                                     Quadrilateral<9>  ,
00974                                     Quadrilateral<9>  ,
00975                                     Quadrilateral<9>  ,
00976                                     Quadrilateral<9>  >::type ,
00977                       HexahedronFaceNodeMap >
00978 {
00979   typedef Hexahedron<8> base ;
00980 };
00981 
00982 //----------------------------------------------------------------------
00983 //  Polygons
00984 //----------------------------------------------------------------------
00985 
00990 template< unsigned NodeCount = 5 > struct Pentagon {};
00991 
00994 template<> const CellTopologyData * getCellTopologyData< Pentagon<5> >();
00995 
00996 // Describe vertex to edge connectivity
00997 typedef
00998 MakeTypeList< IndexList< 0 , 1 > ,
00999               IndexList< 1 , 2 > ,
01000               IndexList< 2 , 3 > ,
01001               IndexList< 3 , 4 > ,
01002               IndexList< 4 , 0 > >::type  PentagonEdgeNodeMap ;
01003 
01004 template<> struct Pentagon<5> : public
01005 CellTopologyTraits< 2 , 5 , 5 ,
01006                     MakeTypeList< Line<2>  ,
01007                                   Line<2>  ,
01008                                   Line<2>  ,
01009                                   Line<2>  ,
01010                                   Line<2>  >::type ,
01011                     PentagonEdgeNodeMap >
01012 { 
01013   typedef Pentagon<5> base ; 
01014 };
01015 
01016 //----------------------------------------------------------------------
01017 
01022 template< unsigned NodeCount = 6 > struct Hexagon {};
01023 
01026 template<> const CellTopologyData * getCellTopologyData< Hexagon<6> >();
01027 
01028 // Describe vertex to edge connectivity
01029 typedef
01030 MakeTypeList< IndexList< 0 , 1 > ,
01031               IndexList< 1 , 2 > ,
01032               IndexList< 2 , 3 > ,
01033               IndexList< 3 , 4 > ,
01034               IndexList< 4 , 5 > ,
01035               IndexList< 5 , 0> >::type  HexagonEdgeNodeMap ;
01036 
01037 template<> struct Hexagon<6> : public
01038 CellTopologyTraits< 2 , 6 , 6 ,
01039                     MakeTypeList< Line<2>  ,
01040                                   Line<2>  ,
01041                                   Line<2>  ,
01042                                   Line<2>  ,
01043                                   Line<2>  ,
01044                                   Line<2>  >::type ,
01045                     HexagonEdgeNodeMap >
01046 { 
01047   typedef Hexagon<6> base ; 
01048 };
01049 
01050 //------------------------------------------------------------------------
01052 template< class Traits > struct BasicTopologyOf ;
01053 
01055 template<> struct BasicTopologyOf< Node::Traits >
01056 { typedef Node type ; };
01057 
01059 template<> struct BasicTopologyOf< Particle::Traits >
01060 { typedef Particle type ; };
01061 
01063 template<> struct BasicTopologyOf< Line<2>::Traits >
01064 { typedef Line<2> type ; };
01065 
01067 template<> struct BasicTopologyOf< Line<3>::Traits >
01068 { typedef Line<3> type ; };
01069 
01071 template<> struct BasicTopologyOf< Beam<2>::Traits >
01072 { typedef Beam<2> type ; };
01073 
01075 template<> struct BasicTopologyOf< Beam<3>::Traits >
01076 { typedef Beam<3> type ; };
01077 
01079 template<> struct BasicTopologyOf< ShellLine<2>::Traits >
01080 { typedef ShellLine<2> type ; };
01081 
01083 template<> struct BasicTopologyOf< ShellLine<3>::Traits >
01084 { typedef ShellLine<3> type ; };
01085 
01087 template<> struct BasicTopologyOf< Triangle<3>::Traits >
01088 { typedef Triangle<3> type ; };
01089 
01091 template<> struct BasicTopologyOf< Triangle<6>::Traits >
01092 { typedef Triangle<6> type ; };
01093 
01095 template<> struct BasicTopologyOf< Triangle<4>::Traits >
01096 { typedef Triangle<4> type ; };
01097 
01099 template<> struct BasicTopologyOf< Quadrilateral<4>::Traits >
01100 { typedef Quadrilateral<4> type ; };
01101 
01103 template<> struct BasicTopologyOf< Quadrilateral<8>::Traits >
01104 { typedef Quadrilateral<8> type ; };
01105 
01107 template<> struct BasicTopologyOf< Quadrilateral<9>::Traits >
01108 { typedef Quadrilateral<9> type ; };
01109 
01111 template<> struct BasicTopologyOf< Pentagon<5>::Traits >
01112 { typedef Pentagon<5> type ; };
01113 
01115 template<> struct BasicTopologyOf< Hexagon<6>::Traits >
01116 { typedef Hexagon<6> type ; };
01117 
01119 template<> struct BasicTopologyOf< Tetrahedron<4>::Traits >
01120 { typedef Tetrahedron<4> type ; };
01121 
01123 template<> struct BasicTopologyOf< Tetrahedron<10>::Traits >
01124 { typedef Tetrahedron<10> type ; };
01125 
01127 template<> struct BasicTopologyOf< Tetrahedron<8>::Traits >
01128 { typedef Tetrahedron<8> type ; };
01129 
01131 template<> struct BasicTopologyOf< Pyramid<5>::Traits >
01132 { typedef Tetrahedron<5> type ; };
01133 
01135 template<> struct BasicTopologyOf< Pyramid<13>::Traits >
01136 { typedef Tetrahedron<13> type ; };
01137 
01139 template<> struct BasicTopologyOf< Pyramid<14>::Traits >
01140 { typedef Tetrahedron<14> type ; };
01141 
01143 template<> struct BasicTopologyOf< Wedge<6>::Traits >
01144 { typedef Wedge<6> type ; };
01145 
01147 template<> struct BasicTopologyOf< Wedge<15>::Traits >
01148 { typedef Wedge<15> type ; };
01149 
01151 template<> struct BasicTopologyOf< Wedge<18>::Traits >
01152 { typedef Wedge<18> type ; };
01153 
01155 template<> struct BasicTopologyOf< Hexahedron<8>::Traits >
01156 { typedef Hexahedron<8> type ; };
01157 
01159 template<> struct BasicTopologyOf< Hexahedron<20>::Traits >
01160 { typedef Hexahedron<20> type ; };
01161 
01163 template<> struct BasicTopologyOf< Hexahedron<27>::Traits >
01164 { typedef Hexahedron<27> type ; };
01165 
01166 //------------------------------------------------------------------------
01170 const unsigned * index_identity_array();
01171 
01172 
01181 const struct CellTopologyData_Subcell * subcell_nodes_array();
01182 
01185 std::ostream & operator << ( std::ostream &, const CellTopologyData &);
01186 
01187 #endif /* DOXYGEN_COMPILE */
01188 
01190 } // namespace shards
01191 
01192 #endif // Shards_BasicTopologies_hpp
01193 
Generated on Wed Mar 31 15:02:54 2010 for shards by  doxygen 1.6.3