shards Version of the Day
Shards_BasicTopologies.hpp
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 //
00005 //                Shards : Shared Discretization Tools
00006 //                 Copyright 2008 Sandia Corporation
00007 //
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Carter Edwards (hcedwar@sandia.gov),
00039 //                    Pavel Bochev (pbboche@sandia.gov), or
00040 //                    Denis Ridzal (dridzal@sandia.gov).
00041 //
00042 // ************************************************************************
00043 //@HEADER
00044 */
00045 
00046 #ifndef Shards_BasicTopologies_hpp
00047 #define Shards_BasicTopologies_hpp
00048 
00049 #include <iosfwd>
00050 #include <Shards_CellTopologyTraits.hpp>
00051 
00052 namespace shards {
00053 
00058 //----------------------------------------------------------------------
00059 
00061 struct Node : public CellTopologyTraits<0,0,0>
00062 {
00063 #ifndef DOXYGEN_COMPILE
00064   typedef Node base ;
00065 #endif /* DOXYGEN_COMPILE */
00066 };
00067  
00069 template<> const CellTopologyData * getCellTopologyData< Node >();
00070 
00071 //----------------------------------------------------------------------
00072 
00074 struct Particle : public CellTopologyTraits<1,1,1>
00075 {
00076 #ifndef DOXYGEN_COMPILE
00077   typedef Particle base ;
00078 #endif /* DOXYGEN_COMPILE */
00079 };
00080 
00082 template<> const CellTopologyData * getCellTopologyData< Particle >();
00083 
00084 //----------------------------------------------------------------------
00085 
00091 template< unsigned NodeCount = 2 > struct Line {};
00092 
00094 template<> const CellTopologyData * getCellTopologyData< Line<2> >();
00095 
00097 template<> const CellTopologyData * getCellTopologyData< Line<3> >();
00098 
00099 //----------------------------------------------------------------------
00100 
00106 template< unsigned NodeCount = 2 > struct Beam {};
00107 
00109 template<> const CellTopologyData * getCellTopologyData< Beam<2> >();
00110 
00112 template<> const CellTopologyData * getCellTopologyData< Beam<3> >();
00113 
00114 //----------------------------------------------------------------------
00115 
00121 template< unsigned NodeCount = 2 > struct ShellLine {};
00122 
00124 template<> const CellTopologyData * getCellTopologyData< ShellLine<2> >();
00125 
00127 template<> const CellTopologyData * getCellTopologyData< ShellLine<3> >();
00128 
00129 //----------------------------------------------------------------------
00130 
00153 template< unsigned NodeCount = 3 > struct Triangle {};
00154 
00156 template<> const CellTopologyData * getCellTopologyData< Triangle<3> >();
00157 
00159 template<> const CellTopologyData * getCellTopologyData< Triangle<6> >();
00160 
00162 template<> const CellTopologyData * getCellTopologyData< Triangle<4> >();
00163 
00164 //----------------------------------------------------------------------
00165 
00171 template< unsigned NodeCount = 3 > struct ShellTriangle {};
00172 
00174 template<> const CellTopologyData * getCellTopologyData< ShellTriangle<3> >();
00175 
00177 template<> const CellTopologyData * getCellTopologyData< ShellTriangle<6> >();
00178 
00179 //----------------------------------------------------------------------
00202 template< unsigned NodeCount = 4 > struct Quadrilateral {};
00203 
00205 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<4> >();
00206 
00208 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<8> >();
00209 
00211 template<> const CellTopologyData * getCellTopologyData< Quadrilateral<9> >();
00212 
00213 //----------------------------------------------------------------------
00214 
00220 template< unsigned NodeCount = 4 > struct ShellQuadrilateral {};
00221 
00223 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<4> >();
00224 
00226 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<8> >();
00227 
00229 template<> const CellTopologyData * getCellTopologyData< ShellQuadrilateral<9> >();
00230 
00231 //----------------------------------------------------------------------
00232 
00236 template< unsigned NodeCount = 4 > struct Tetrahedron ;
00237 
00239 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<4> >();
00240 
00242 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<10> >();
00243 
00245 template<> const CellTopologyData * getCellTopologyData< Tetrahedron<8> >();
00246 
00247 //----------------------------------------------------------------------
00248 
00252 template< unsigned NodeCount = 5 > struct Pyramid {};
00253 
00255 template<> const CellTopologyData * getCellTopologyData< Pyramid<5> >();
00256 
00258 template<> const CellTopologyData * getCellTopologyData< Pyramid<13> >();
00259 
00261 template<> const CellTopologyData * getCellTopologyData< Pyramid<14> >();
00262 
00263 //----------------------------------------------------------------------
00264 
00268 template< unsigned NodeCount = 6 > struct Wedge {};
00269 
00271 template<> const CellTopologyData * getCellTopologyData< Wedge<6> >();
00272 
00274 template<> const CellTopologyData * getCellTopologyData< Wedge<15> >();
00275 
00277 template<> const CellTopologyData * getCellTopologyData< Wedge<18> >();
00278 
00279 //----------------------------------------------------------------------
00280 
00359 template< unsigned NodeCount = 8 > struct Hexahedron {};
00360 
00362 template<> const CellTopologyData * getCellTopologyData< Hexahedron<8> >();
00363 
00365 template<> const CellTopologyData * getCellTopologyData< Hexahedron<20> >();
00366 
00368 template<> const CellTopologyData * getCellTopologyData< Hexahedron<27> >();
00369 
00370 //----------------------------------------------------------------------
00371 //----------------------------------------------------------------------
00372 
00373 #ifndef DOXYGEN_COMPILE
00374 
00375 //----------------------------------------------------------------------
00376 //----------------------------------------------------------------------
00377 // Topologies for Rank-1 cells.
00378 
00379 typedef IndexList< 0 , 1 , 2 > LineNodeMapIdentity ;
00380 typedef IndexList< 1 , 0 , 2 > LineNodeMapReversed ;
00381 
00382 typedef MakeTypeList< LineNodeMapIdentity , LineNodeMapReversed >::type
00383   LineNodePermutation ;
00384 
00385 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00386                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00387   LineNodePermutationPolarity;
00388 
00389 template<> struct Line<2> : public
00390   CellTopologyTraits< 1 , 2 , 2 ,
00391                       TypeListEnd, TypeListEnd,
00392                       TypeListEnd, TypeListEnd,
00393                       LineNodePermutation,
00394                       LineNodePermutationPolarity >
00395 { typedef Line<2> base ; };
00396 
00397 template<> struct Line<3> : public
00398   CellTopologyTraits< 1 , 2 , 3 ,
00399                       TypeListEnd, TypeListEnd,
00400                       TypeListEnd, TypeListEnd,
00401                       LineNodePermutation,
00402                       LineNodePermutationPolarity >
00403 { typedef Line<2> base ; };
00404 
00405 // Beam is a line with one edge:
00406 
00407 typedef
00408   MakeTypeList< LineNodeMapIdentity >::type BeamEdgeNodeMap ;
00409 
00410 template<> struct Beam<2> : public
00411   CellTopologyTraits< 2 , 2 , 2 ,
00412                       MakeTypeList< Line<2> >::type ,
00413                       BeamEdgeNodeMap >
00414 { typedef Beam<2> base ; };
00415 
00416 template<> struct Beam<3> : public
00417   CellTopologyTraits< 2 , 2 , 3 ,
00418                       MakeTypeList< Line<3> >::type ,
00419                       BeamEdgeNodeMap >
00420 { typedef Beam<2> base ; };
00421 
00422 // Shell-line has two edges:
00423 
00424 typedef
00425   MakeTypeList< LineNodeMapIdentity , LineNodeMapReversed >::type
00426     ShellLineEdgeNodeMap ;
00427 
00428 template<> struct ShellLine<2> : public
00429   CellTopologyTraits< 2 , 2 , 2 ,
00430                       MakeTypeList< Line<2> , Line<2> >::type ,
00431                       ShellLineEdgeNodeMap >
00432 { typedef ShellLine<2> base ; };
00433 
00434 template<> struct ShellLine<3> : public
00435   CellTopologyTraits< 2 , 2 , 3 ,
00436                       MakeTypeList< Line<3> , Line<3> >::type ,
00437                       ShellLineEdgeNodeMap >
00438 { typedef ShellLine<2> base ; };
00439 
00440 //----------------------------------------------------------------------
00441 //----------------------------------------------------------------------
00442 // Topologies for Rank-2 cells.
00443 
00444 typedef IndexList< 0, 1, 2,  3, 4, 5 > TriangleNodeMapIdentity ;
00445 typedef IndexList< 2, 0, 1,  5, 3, 4 > TriangleNodeMapPositive1 ;
00446 typedef IndexList< 1, 2, 0,  4, 5, 3 > TriangleNodeMapPositive2 ;
00447 typedef IndexList< 0, 2, 1,  5, 4, 3 > TriangleNodeMapReversed0 ;
00448 typedef IndexList< 2, 1, 0,  4, 3, 5 > TriangleNodeMapReversed1 ;
00449 typedef IndexList< 1, 0, 2,  3, 5, 4 > TriangleNodeMapReversed2 ;
00450 
00451 typedef MakeTypeList< TriangleNodeMapIdentity , 
00452                       TriangleNodeMapPositive1 , 
00453                       TriangleNodeMapPositive2 , 
00454                       TriangleNodeMapReversed0 , 
00455                       TriangleNodeMapReversed1 , 
00456                       TriangleNodeMapReversed2 >::type
00457   TriangleNodePermutation ;
00458 
00459 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00460                    CELL_PERMUTATION_POLARITY_POSITIVE,
00461                    CELL_PERMUTATION_POLARITY_POSITIVE,
00462                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00463                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00464                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00465   TriangleNodePermutationPolarity;
00466 
00467 typedef MakeTypeList< IndexList< 0 , 1 , 3 > ,
00468                       IndexList< 1 , 2 , 4 > ,
00469                       IndexList< 2 , 0 , 5 > >::type
00470   TriangleEdgeNodeMap ;
00471 
00472 template<> struct Triangle<3> : public
00473   CellTopologyTraits< 2 , 3 , 3 ,
00474                       MakeTypeList< Line<2>  ,
00475                                     Line<2>  ,
00476                                     Line<2>  >::type ,
00477                       TriangleEdgeNodeMap ,
00478                       TypeListEnd , TypeListEnd ,
00479                       TriangleNodePermutation ,
00480                       TriangleNodePermutationPolarity >
00481 { typedef Triangle<3> base ; };
00482 
00483 template<> struct Triangle<6> : public
00484   CellTopologyTraits< 2 , 3 , 6 ,
00485                       MakeTypeList< Line<3>  ,
00486                                     Line<3>  ,
00487                                     Line<3>  >::type ,
00488                       TriangleEdgeNodeMap ,
00489                       TypeListEnd , TypeListEnd ,
00490                       TriangleNodePermutation ,
00491                       TriangleNodePermutationPolarity >
00492 { typedef Triangle<3> base ; };
00493 
00494 typedef IndexList< 0, 1, 2,  3 > Triangle4_NodeMapIdentity ;
00495 typedef IndexList< 2, 0, 1,  3 > Triangle4_NodeMapPositive1 ;
00496 typedef IndexList< 1, 2, 0,  3 > Triangle4_NodeMapPositive2 ;
00497 typedef IndexList< 0, 2, 1,  3 > Triangle4_NodeMapReversed0 ;
00498 typedef IndexList< 2, 1, 0,  3 > Triangle4_NodeMapReversed1 ;
00499 typedef IndexList< 1, 0, 2,  3 > Triangle4_NodeMapReversed2 ;
00500 
00501 typedef MakeTypeList< Triangle4_NodeMapIdentity ,
00502                       Triangle4_NodeMapPositive1 , 
00503                       Triangle4_NodeMapPositive2 , 
00504                       Triangle4_NodeMapReversed0 , 
00505                       Triangle4_NodeMapReversed1 , 
00506                       Triangle4_NodeMapReversed2 >::type
00507   Triangle4_NodePermutation ;
00508 
00509 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00510                    CELL_PERMUTATION_POLARITY_POSITIVE,
00511                    CELL_PERMUTATION_POLARITY_POSITIVE,
00512                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00513                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00514                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00515   Triangle4_NodePermutationPolarity;
00516 
00517 template<> struct Triangle<4> : public
00518   CellTopologyTraits< 2 , 3 , 4 ,
00519                       MakeTypeList< Line<2>  ,
00520                                     Line<2>  ,
00521                                     Line<2>  >::type ,
00522                       TriangleEdgeNodeMap ,
00523                       TypeListEnd , TypeListEnd ,
00524                       Triangle4_NodePermutation ,
00525                       Triangle4_NodePermutationPolarity >
00526 { typedef Triangle<3> base ; };
00527 
00528 //------------------------------------------------------------------------
00529 
00530 typedef MakeTypeList< TriangleNodeMapIdentity ,
00531                       TriangleNodeMapReversed0 >::type
00532   ShellTriangleFaceNodeMap ;
00533 
00534 template<> struct ShellTriangle<3> : public
00535   CellTopologyTraits< 3 , 3 , 3 ,
00536                             MakeTypeList< Line<2>  ,
00537                                           Line<2>  ,
00538                                           Line<2>  >::type ,
00539                             TriangleEdgeNodeMap ,
00540                             MakeTypeList< Triangle<3>  ,
00541                                           Triangle<3>  >::type ,
00542                             ShellTriangleFaceNodeMap >
00543 { typedef ShellTriangle<3> base ; };
00544 
00545 template<> struct ShellTriangle<6> : public
00546   CellTopologyTraits< 3 , 3 , 6 ,
00547                             MakeTypeList< Line<3>  ,
00548                                           Line<3>  ,
00549                                           Line<3>  >::type ,
00550                             TriangleEdgeNodeMap ,
00551                             MakeTypeList< Triangle<6>  ,
00552                                           Triangle<6>  >::type ,
00553                             ShellTriangleFaceNodeMap >
00554 { typedef ShellTriangle<3> base ; };
00555 
00556 //----------------------------------------------------------------------
00557 
00558 // A permutation should either be the identity or reversed.
00559 // Simple (non-reversed) rotations should not happen in practice.
00560 
00561 typedef IndexList< 0, 1, 2, 3,  4, 5, 6, 7,  8 > QuadrilateralNodeMapIdentity ;
00562 typedef IndexList< 3, 0, 1, 2,  7, 4, 5, 6,  8 > QuadrilateralNodeMapPositive1 ;
00563 typedef IndexList< 2, 3, 0, 1,  6, 7, 4, 5,  8 > QuadrilateralNodeMapPositive2 ;
00564 typedef IndexList< 1, 2, 3, 0,  5, 6, 7, 4,  8 > QuadrilateralNodeMapPositive3 ;
00565 typedef IndexList< 0, 3, 2, 1,  7, 6, 5, 4,  8 > QuadrilateralNodeMapReversed0 ;
00566 typedef IndexList< 3, 2, 1, 0,  6, 5, 4, 7,  8 > QuadrilateralNodeMapReversed1 ;
00567 typedef IndexList< 2, 1, 0, 3,  5, 4, 7, 6,  8 > QuadrilateralNodeMapReversed2 ;
00568 typedef IndexList< 1, 0, 3, 2,  4, 7, 6, 5,  8 > QuadrilateralNodeMapReversed3 ;
00569 
00570 typedef MakeTypeList< QuadrilateralNodeMapIdentity ,
00571                       QuadrilateralNodeMapPositive1 ,
00572                       QuadrilateralNodeMapPositive2 ,
00573                       QuadrilateralNodeMapPositive3 ,
00574                       QuadrilateralNodeMapReversed0 ,
00575                       QuadrilateralNodeMapReversed1 ,
00576                       QuadrilateralNodeMapReversed2 ,
00577                       QuadrilateralNodeMapReversed3 >::type
00578   QuadrilateralNodePermutation ;
00579 
00580 typedef IndexList< CELL_PERMUTATION_POLARITY_POSITIVE,
00581                    CELL_PERMUTATION_POLARITY_POSITIVE,
00582                    CELL_PERMUTATION_POLARITY_POSITIVE,
00583                    CELL_PERMUTATION_POLARITY_POSITIVE,
00584                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00585                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00586                    CELL_PERMUTATION_POLARITY_NEGATIVE,
00587                    CELL_PERMUTATION_POLARITY_NEGATIVE >
00588   QuadrilateralNodePermutationPolarity;
00589 
00590 typedef MakeTypeList< IndexList< 0 , 1 ,  4 > ,
00591                       IndexList< 1 , 2 ,  5 > ,
00592                       IndexList< 2 , 3 ,  6 > ,
00593                       IndexList< 3 , 0 ,  7 > >::type
00594   QuadrilateralEdgeNodeMap ;
00595 
00596 template<> struct Quadrilateral<4> : public
00597   CellTopologyTraits< 2 , 4 , 4 ,
00598                             MakeTypeList< Line<2>  ,
00599                                           Line<2>  ,
00600                                           Line<2>  ,
00601                                           Line<2>  >::type ,
00602                             QuadrilateralEdgeNodeMap ,
00603                             TypeListEnd , TypeListEnd ,
00604                             QuadrilateralNodePermutation ,
00605                             QuadrilateralNodePermutationPolarity >
00606 { typedef Quadrilateral<4> base ; };
00607 
00608 template<> struct Quadrilateral<8> : public
00609   CellTopologyTraits< 2 , 4 , 8 ,
00610                             MakeTypeList< Line<3>  ,
00611                                           Line<3>  ,
00612                                           Line<3>  ,
00613                                           Line<3>  >::type ,
00614                             QuadrilateralEdgeNodeMap ,
00615                             TypeListEnd , TypeListEnd ,
00616                             QuadrilateralNodePermutation ,
00617                             QuadrilateralNodePermutationPolarity >
00618 { typedef Quadrilateral<4> base ; };
00619 
00620 template<> struct Quadrilateral<9> : public
00621   CellTopologyTraits< 2 , 4 , 9 ,
00622                             MakeTypeList< Line<3>  ,
00623                                           Line<3>  ,
00624                                           Line<3>  ,
00625                                           Line<3>  >::type ,
00626                             QuadrilateralEdgeNodeMap ,
00627                             TypeListEnd , TypeListEnd ,
00628                             QuadrilateralNodePermutation ,
00629                             QuadrilateralNodePermutationPolarity >
00630 { typedef Quadrilateral<4> base ; };
00631 
00632 //----------------------------------------------------------------------
00633 
00634 typedef MakeTypeList< QuadrilateralNodeMapIdentity ,
00635                       QuadrilateralNodeMapReversed0 >::type
00636   ShellQuadrilateralFaceNodeMap ;
00637 
00638 template<> struct ShellQuadrilateral<4> : public
00639   CellTopologyTraits< 3 , 4 , 4 ,
00640                             MakeTypeList< Line<2>  ,
00641                                           Line<2>  ,
00642                                           Line<2>  ,
00643                                           Line<2>  >::type ,
00644                             QuadrilateralEdgeNodeMap ,
00645                             MakeTypeList< Quadrilateral<4>  ,
00646                                           Quadrilateral<4>  >::type ,
00647                             ShellQuadrilateralFaceNodeMap >
00648 { typedef ShellQuadrilateral<4> base ; };
00649 
00650 template<> struct ShellQuadrilateral<8> : public
00651   CellTopologyTraits< 3 , 4 , 8 ,
00652                             MakeTypeList< Line<3>  ,
00653                                           Line<3>  ,
00654                                           Line<3>  ,
00655                                           Line<3>  >::type ,
00656                             QuadrilateralEdgeNodeMap ,
00657                             MakeTypeList< Quadrilateral<8>  ,
00658                                           Quadrilateral<8>  >::type ,
00659                             ShellQuadrilateralFaceNodeMap >
00660 { typedef ShellQuadrilateral<4> base ; };
00661 
00662 template<> struct ShellQuadrilateral<9> : public
00663   CellTopologyTraits< 3 , 4 , 9 ,
00664                             MakeTypeList< Line<3>  ,
00665                                           Line<3>  ,
00666                                           Line<3>  ,
00667                                           Line<3>  >::type ,
00668                             QuadrilateralEdgeNodeMap ,
00669                             MakeTypeList< Quadrilateral<9>  ,
00670                                           Quadrilateral<9>  >::type ,
00671                             ShellQuadrilateralFaceNodeMap >
00672 { typedef ShellQuadrilateral<4> base ; };
00673 
00674 //------------------------------------------------------------------------
00675 
00676 typedef MakeTypeList< IndexList< 0 , 1 , 4 > ,
00677                       IndexList< 1 , 2 , 5 > ,
00678                       IndexList< 2 , 0 , 6 > ,
00679                       IndexList< 0 , 3 , 7 > ,
00680                       IndexList< 1 , 3 , 8 > ,
00681                       IndexList< 2 , 3 , 9 > >::type
00682   TetrahedronEdgeNodeMap ;
00683 
00684 typedef MakeTypeList< IndexList< 0 , 1 , 3 ,   4 , 8 , 7 > ,
00685                       IndexList< 1 , 2 , 3 ,   5 , 9 , 8 > ,
00686                       IndexList< 0 , 3 , 2 ,   7 , 9 , 6 > ,
00687                       IndexList< 0 , 2 , 1 ,   6 , 5 , 4 > >::type
00688   TetrahedronSideNodeMap ;
00689 
00690 template<> struct Tetrahedron<4> : public
00691   CellTopologyTraits< 3 , 4 , 4 ,
00692                       MakeTypeList< Line<2>  ,
00693                                     Line<2>  ,
00694                                     Line<2>  ,
00695                                     Line<2>  ,
00696                                     Line<2>  ,
00697                                     Line<2>  >::type ,
00698                       TetrahedronEdgeNodeMap ,
00699                       MakeTypeList< Triangle<3>  ,
00700                                     Triangle<3>  ,
00701                                     Triangle<3>  ,
00702                                     Triangle<3>  >::type ,
00703                       TetrahedronSideNodeMap >
00704 { typedef Tetrahedron<4> base ; };
00705 
00706 template<> struct Tetrahedron<10> : public
00707   CellTopologyTraits< 3 , 4 , 10 ,
00708                       MakeTypeList< Line<3>  ,
00709                                     Line<3>  ,
00710                                     Line<3>  ,
00711                                     Line<3>  ,
00712                                     Line<3>  ,
00713                                     Line<3>  >::type ,
00714                       TetrahedronEdgeNodeMap ,
00715                       MakeTypeList< Triangle<6>  ,
00716                                     Triangle<6>  ,
00717                                     Triangle<6>  ,
00718                                     Triangle<6>  >::type ,
00719                       TetrahedronSideNodeMap >
00720 { typedef Tetrahedron<4> base ; };
00721 
00722 template<> struct Tetrahedron<8> : public
00723   CellTopologyTraits< 3 , 4 , 8 ,
00724                       MakeTypeList< Line<2>  ,
00725                                     Line<2>  ,
00726                                     Line<2>  ,
00727                                     Line<2>  ,
00728                                     Line<2>  ,
00729                                     Line<2>  >::type ,
00730                       TetrahedronEdgeNodeMap ,
00731                       MakeTypeList< Triangle<4>  ,
00732                                     Triangle<4>  ,
00733                                     Triangle<4>  ,
00734                                     Triangle<4>  >::type ,
00735                       TetrahedronSideNodeMap >
00736 { typedef Tetrahedron<4> base ; };
00737 
00738 //------------------------------------------------------------------------
00739 
00740 typedef
00741   MakeTypeList< IndexList< 0 , 1 ,   5 > ,
00742                 IndexList< 1 , 2 ,   6 > ,
00743                 IndexList< 2 , 3 ,   7 > ,
00744                 IndexList< 3 , 0 ,   8 > ,
00745                 IndexList< 0 , 4 ,   9 > ,
00746                 IndexList< 1 , 4 ,  10 > ,
00747                 IndexList< 2 , 4 ,  11 > ,
00748                 IndexList< 3 , 4 ,  12 > >::type
00749   PyramidEdgeNodeMap ;
00750 
00751 typedef
00752   MakeTypeList< IndexList< 0, 1, 4,     5, 10,  9 > ,
00753                 IndexList< 1, 2, 4,     6, 11, 10 > ,
00754                 IndexList< 2, 3, 4,     7, 12, 11 > ,
00755                 IndexList< 3, 0, 4,     8,  9, 12 > ,
00756                 IndexList< 0, 3, 2, 1,  8,  7,  6,  5,  13 > >::type
00757   PyramidFaceNodeMap ;
00758 
00759 template<> struct Pyramid<5> : public
00760   CellTopologyTraits< 3 , 5 , 5 ,
00761                       MakeTypeList< Line<2>  ,
00762                                     Line<2>  ,
00763                                     Line<2>  ,
00764                                     Line<2>  ,
00765                                     Line<2>  ,
00766                                     Line<2>  ,
00767                                     Line<2>  ,
00768                                     Line<2>  >::type ,
00769                       PyramidEdgeNodeMap ,
00770                       MakeTypeList< Triangle<3>  ,
00771                                     Triangle<3>  ,
00772                                     Triangle<3>  ,
00773                                     Triangle<3>  ,
00774                                     Quadrilateral<4>  >::type ,
00775                       PyramidFaceNodeMap >
00776 { typedef Pyramid<5> base ; };
00777 
00778 template<> struct Pyramid<13> : public
00779   CellTopologyTraits< 3 , 5 , 13 ,
00780                       MakeTypeList< Line<3>  ,
00781                                     Line<3>  ,
00782                                     Line<3>  ,
00783                                     Line<3>  ,
00784                                     Line<3>  ,
00785                                     Line<3>  ,
00786                                     Line<3>  ,
00787                                     Line<3>  >::type ,
00788                       PyramidEdgeNodeMap ,
00789                       MakeTypeList< Triangle<6>  ,
00790                                     Triangle<6>  ,
00791                                     Triangle<6>  ,
00792                                     Triangle<6>  ,
00793                                     Quadrilateral<8>  >::type ,
00794                       PyramidFaceNodeMap >
00795 { typedef Pyramid<5> base ; };
00796 
00797 template<> struct Pyramid<14> : public
00798   CellTopologyTraits< 3 , 5 , 14 ,
00799                       MakeTypeList< Line<3>  ,
00800                                     Line<3>  ,
00801                                     Line<3>  ,
00802                                     Line<3>  ,
00803                                     Line<3>  ,
00804                                     Line<3>  ,
00805                                     Line<3>  ,
00806                                     Line<3>  >::type ,
00807                       PyramidEdgeNodeMap ,
00808                       MakeTypeList< Triangle<6>  ,
00809                                     Triangle<6>  ,
00810                                     Triangle<6>  ,
00811                                     Triangle<6>  ,
00812                                     Quadrilateral<9>  >::type ,
00813                       PyramidFaceNodeMap >
00814 { typedef Pyramid<5> base ; };
00815 
00816 //------------------------------------------------------------------------
00817 
00818 typedef
00819   MakeTypeList< IndexList< 0 , 1 ,   6 > ,
00820                 IndexList< 1 , 2 ,   7 > ,
00821                 IndexList< 2 , 0 ,   8 > ,
00822                 IndexList< 3 , 4 ,  12 > ,
00823                 IndexList< 4 , 5 ,  13 > ,
00824                 IndexList< 5 , 3 ,  14 > ,
00825                 IndexList< 0 , 3 ,   9 > ,
00826                 IndexList< 1 , 4 ,  10 > ,
00827                 IndexList< 2 , 5 ,  11 >
00828   >::type WedgeEdgeNodeMap ;
00829 
00830 typedef
00831   MakeTypeList< IndexList< 0 , 1 , 4 , 3 ,   6 , 10 , 12 ,  9 ,  15 > ,
00832                 IndexList< 1 , 2 , 5 , 4 ,   7 , 11 , 13 , 10 ,  16 > ,
00833                 IndexList< 0 , 3 , 5 , 2 ,   9 , 14 , 11 ,  8 ,  17 > ,
00834                 IndexList< 0 , 2 , 1 ,       8 ,  7 ,  6 > ,
00835                 IndexList< 3 , 4 , 5 ,      12 , 13 , 14 >
00836   >::type WedgeFaceNodeMap ;
00837 
00838 template<> struct Wedge<6> : public
00839   CellTopologyTraits< 3 , 6 , 6 ,
00840                       MakeTypeList< Line<2>  ,
00841                                     Line<2>  ,
00842                                     Line<2>  ,
00843                                     Line<2>  ,
00844                                     Line<2>  ,
00845                                     Line<2>  ,
00846                                     Line<2>  ,
00847                                     Line<2>  ,
00848                                     Line<2>  >::type ,
00849                       WedgeEdgeNodeMap ,
00850                       MakeTypeList< Quadrilateral<4>  ,
00851                                     Quadrilateral<4>  ,
00852                                     Quadrilateral<4>  ,
00853                                     Triangle<3>  ,
00854                                     Triangle<3>  >::type ,
00855                       WedgeFaceNodeMap >
00856 { typedef Wedge<6> base ; };
00857 
00858 template<> struct Wedge<15> : public
00859   CellTopologyTraits< 3 , 6 , 15 ,
00860                       MakeTypeList< Line<3>  ,
00861                                     Line<3>  ,
00862                                     Line<3>  ,
00863                                     Line<3>  ,
00864                                     Line<3>  ,
00865                                     Line<3>  ,
00866                                     Line<3>  ,
00867                                     Line<3>  ,
00868                                     Line<3>  >::type ,
00869                       WedgeEdgeNodeMap ,
00870                       MakeTypeList< Quadrilateral<8>  ,
00871                                     Quadrilateral<8>  ,
00872                                     Quadrilateral<8>  ,
00873                                     Triangle<6>  ,
00874                                     Triangle<6>  >::type ,
00875                       WedgeFaceNodeMap >
00876 { typedef Wedge<6> base ; };
00877 
00878 template<> struct Wedge<18> : public
00879   CellTopologyTraits< 3 , 6 , 18 ,
00880                       MakeTypeList< Line<3>  ,
00881                                     Line<3>  ,
00882                                     Line<3>  ,
00883                                     Line<3>  ,
00884                                     Line<3>  ,
00885                                     Line<3>  ,
00886                                     Line<3>  ,
00887                                     Line<3>  ,
00888                                     Line<3>  >::type ,
00889                       WedgeEdgeNodeMap ,
00890                       MakeTypeList< Quadrilateral<9>  ,
00891                                     Quadrilateral<9>  ,
00892                                     Quadrilateral<9>  ,
00893                                     Triangle<6>  ,
00894                                     Triangle<6>  >::type ,
00895                       WedgeFaceNodeMap >
00896 { typedef Wedge<6> base ; };
00897 
00898 //------------------------------------------------------------------------
00899 
00900 typedef
00901   MakeTypeList< IndexList< 0 , 1 ,   8 > ,
00902                 IndexList< 1 , 2 ,   9 > ,
00903                 IndexList< 2 , 3 ,  10 > ,
00904                 IndexList< 3 , 0 ,  11 > ,
00905                 IndexList< 4 , 5 ,  16 > ,
00906                 IndexList< 5 , 6 ,  17 > ,
00907                 IndexList< 6 , 7 ,  18 > ,
00908                 IndexList< 7 , 4 ,  19 > ,
00909                 IndexList< 0 , 4 ,  12 > ,
00910                 IndexList< 1 , 5 ,  13 > ,
00911                 IndexList< 2 , 6 ,  14 > ,
00912                 IndexList< 3 , 7 ,  15 > >::type
00913   HexahedronEdgeNodeMap ;
00914 
00915 typedef
00916   MakeTypeList< IndexList< 0, 1, 5, 4,   8, 13, 16, 12,   25 > ,
00917                 IndexList< 1, 2, 6, 5,   9, 14, 17, 13,   24 > ,
00918                 IndexList< 2, 3, 7, 6,  10, 15, 18, 14,   26 > ,
00919                 IndexList< 0, 4, 7, 3,  12, 19, 15, 11,   23 > ,
00920                 IndexList< 0, 3, 2, 1,  11, 10,  9,  8,   21 > ,
00921                 IndexList< 4, 5, 6, 7,  16, 17, 18, 19,   22 > >::type
00922   HexahedronFaceNodeMap ;
00923 
00924 //----------------------------------------------------------------------
00925 
00926 template<> struct Hexahedron<8> : public
00927   CellTopologyTraits< 3 , 8 , 8 ,
00928                       MakeTypeList< Line<2>  ,
00929                                     Line<2>  ,
00930                                     Line<2>  ,
00931                                     Line<2>  ,
00932                                     Line<2>  ,
00933                                     Line<2>  ,
00934                                     Line<2>  ,
00935                                     Line<2>  ,
00936                                     Line<2>  ,
00937                                     Line<2>  ,
00938                                     Line<2>  ,
00939                                     Line<2>  >::type ,
00940                       HexahedronEdgeNodeMap ,
00941                       MakeTypeList< Quadrilateral<4>  ,
00942                                     Quadrilateral<4>  ,
00943                                     Quadrilateral<4>  ,
00944                                     Quadrilateral<4>  ,
00945                                     Quadrilateral<4>  ,
00946                                     Quadrilateral<4>  >::type ,
00947                       HexahedronFaceNodeMap >
00948 {
00949   typedef Hexahedron<8> base ;
00950 };
00951 
00952 template<> struct Hexahedron<20> : public
00953   CellTopologyTraits< 3 , 8 , 20 ,
00954                       MakeTypeList< Line<3>  ,
00955                                     Line<3>  ,
00956                                     Line<3>  ,
00957                                     Line<3>  ,
00958                                     Line<3>  ,
00959                                     Line<3>  ,
00960                                     Line<3>  ,
00961                                     Line<3>  ,
00962                                     Line<3>  ,
00963                                     Line<3>  ,
00964                                     Line<3>  ,
00965                                     Line<3>  >::type ,
00966                       HexahedronEdgeNodeMap ,
00967                       MakeTypeList< Quadrilateral<8>  ,
00968                                     Quadrilateral<8>  ,
00969                                     Quadrilateral<8>  ,
00970                                     Quadrilateral<8>  ,
00971                                     Quadrilateral<8>  ,
00972                                     Quadrilateral<8>  >::type ,
00973                       HexahedronFaceNodeMap >
00974 {
00975   typedef Hexahedron<8> base ;
00976 };
00977 
00978 template<> struct Hexahedron<27> : public
00979   CellTopologyTraits< 3 , 8 , 27 ,
00980                       MakeTypeList< Line<3>  ,
00981                                     Line<3>  ,
00982                                     Line<3>  ,
00983                                     Line<3>  ,
00984                                     Line<3>  ,
00985                                     Line<3>  ,
00986                                     Line<3>  ,
00987                                     Line<3>  ,
00988                                     Line<3>  ,
00989                                     Line<3>  ,
00990                                     Line<3>  ,
00991                                     Line<3>  >::type ,
00992                       HexahedronEdgeNodeMap ,
00993                       MakeTypeList< Quadrilateral<9>  ,
00994                                     Quadrilateral<9>  ,
00995                                     Quadrilateral<9>  ,
00996                                     Quadrilateral<9>  ,
00997                                     Quadrilateral<9>  ,
00998                                     Quadrilateral<9>  >::type ,
00999                       HexahedronFaceNodeMap >
01000 {
01001   typedef Hexahedron<8> base ;
01002 };
01003 
01004 //----------------------------------------------------------------------
01005 //  Polygons
01006 //----------------------------------------------------------------------
01007 
01012 template< unsigned NodeCount = 5 > struct Pentagon {};
01013 
01016 template<> const CellTopologyData * getCellTopologyData< Pentagon<5> >();
01017 
01018 // Describe vertex to edge connectivity
01019 typedef
01020 MakeTypeList< IndexList< 0 , 1 > ,
01021               IndexList< 1 , 2 > ,
01022               IndexList< 2 , 3 > ,
01023               IndexList< 3 , 4 > ,
01024               IndexList< 4 , 0 > >::type  PentagonEdgeNodeMap ;
01025 
01026 template<> struct Pentagon<5> : public
01027 CellTopologyTraits< 2 , 5 , 5 ,
01028                     MakeTypeList< Line<2>  ,
01029                                   Line<2>  ,
01030                                   Line<2>  ,
01031                                   Line<2>  ,
01032                                   Line<2>  >::type ,
01033                     PentagonEdgeNodeMap >
01034 { 
01035   typedef Pentagon<5> base ; 
01036 };
01037 
01038 //----------------------------------------------------------------------
01039 
01044 template< unsigned NodeCount = 6 > struct Hexagon {};
01045 
01048 template<> const CellTopologyData * getCellTopologyData< Hexagon<6> >();
01049 
01050 // Describe vertex to edge connectivity
01051 typedef
01052 MakeTypeList< IndexList< 0 , 1 > ,
01053               IndexList< 1 , 2 > ,
01054               IndexList< 2 , 3 > ,
01055               IndexList< 3 , 4 > ,
01056               IndexList< 4 , 5 > ,
01057               IndexList< 5 , 0> >::type  HexagonEdgeNodeMap ;
01058 
01059 template<> struct Hexagon<6> : public
01060 CellTopologyTraits< 2 , 6 , 6 ,
01061                     MakeTypeList< Line<2>  ,
01062                                   Line<2>  ,
01063                                   Line<2>  ,
01064                                   Line<2>  ,
01065                                   Line<2>  ,
01066                                   Line<2>  >::type ,
01067                     HexagonEdgeNodeMap >
01068 { 
01069   typedef Hexagon<6> base ; 
01070 };
01071 
01072 //------------------------------------------------------------------------
01074 template< class Traits > struct BasicTopologyOf ;
01075 
01077 template<> struct BasicTopologyOf< Node::Traits >
01078 { typedef Node type ; };
01079 
01081 template<> struct BasicTopologyOf< Particle::Traits >
01082 { typedef Particle type ; };
01083 
01085 template<> struct BasicTopologyOf< Line<2>::Traits >
01086 { typedef Line<2> type ; };
01087 
01089 template<> struct BasicTopologyOf< Line<3>::Traits >
01090 { typedef Line<3> type ; };
01091 
01093 template<> struct BasicTopologyOf< Beam<2>::Traits >
01094 { typedef Beam<2> type ; };
01095 
01097 template<> struct BasicTopologyOf< Beam<3>::Traits >
01098 { typedef Beam<3> type ; };
01099 
01101 template<> struct BasicTopologyOf< ShellLine<2>::Traits >
01102 { typedef ShellLine<2> type ; };
01103 
01105 template<> struct BasicTopologyOf< ShellLine<3>::Traits >
01106 { typedef ShellLine<3> type ; };
01107 
01109 template<> struct BasicTopologyOf< Triangle<3>::Traits >
01110 { typedef Triangle<3> type ; };
01111 
01113 template<> struct BasicTopologyOf< Triangle<6>::Traits >
01114 { typedef Triangle<6> type ; };
01115 
01117 template<> struct BasicTopologyOf< Triangle<4>::Traits >
01118 { typedef Triangle<4> type ; };
01119 
01121 template<> struct BasicTopologyOf< Quadrilateral<4>::Traits >
01122 { typedef Quadrilateral<4> type ; };
01123 
01125 template<> struct BasicTopologyOf< Quadrilateral<8>::Traits >
01126 { typedef Quadrilateral<8> type ; };
01127 
01129 template<> struct BasicTopologyOf< Quadrilateral<9>::Traits >
01130 { typedef Quadrilateral<9> type ; };
01131 
01133 template<> struct BasicTopologyOf< Pentagon<5>::Traits >
01134 { typedef Pentagon<5> type ; };
01135 
01137 template<> struct BasicTopologyOf< Hexagon<6>::Traits >
01138 { typedef Hexagon<6> type ; };
01139 
01141 template<> struct BasicTopologyOf< Tetrahedron<4>::Traits >
01142 { typedef Tetrahedron<4> type ; };
01143 
01145 template<> struct BasicTopologyOf< Tetrahedron<10>::Traits >
01146 { typedef Tetrahedron<10> type ; };
01147 
01149 template<> struct BasicTopologyOf< Tetrahedron<8>::Traits >
01150 { typedef Tetrahedron<8> type ; };
01151 
01153 template<> struct BasicTopologyOf< Pyramid<5>::Traits >
01154 { typedef Tetrahedron<5> type ; };
01155 
01157 template<> struct BasicTopologyOf< Pyramid<13>::Traits >
01158 { typedef Tetrahedron<13> type ; };
01159 
01161 template<> struct BasicTopologyOf< Pyramid<14>::Traits >
01162 { typedef Tetrahedron<14> type ; };
01163 
01165 template<> struct BasicTopologyOf< Wedge<6>::Traits >
01166 { typedef Wedge<6> type ; };
01167 
01169 template<> struct BasicTopologyOf< Wedge<15>::Traits >
01170 { typedef Wedge<15> type ; };
01171 
01173 template<> struct BasicTopologyOf< Wedge<18>::Traits >
01174 { typedef Wedge<18> type ; };
01175 
01177 template<> struct BasicTopologyOf< Hexahedron<8>::Traits >
01178 { typedef Hexahedron<8> type ; };
01179 
01181 template<> struct BasicTopologyOf< Hexahedron<20>::Traits >
01182 { typedef Hexahedron<20> type ; };
01183 
01185 template<> struct BasicTopologyOf< Hexahedron<27>::Traits >
01186 { typedef Hexahedron<27> type ; };
01187 
01188 //------------------------------------------------------------------------
01192 const unsigned * index_identity_array();
01193 
01194 
01203 const struct CellTopologyData_Subcell * subcell_nodes_array();
01204 
01207 std::ostream & operator << ( std::ostream &, const CellTopologyData &);
01208 
01209 #endif /* DOXYGEN_COMPILE */
01210 
01212 } // namespace shards
01213 
01214 #endif // Shards_BasicTopologies_hpp
01215 
 All Classes Functions Variables Typedefs Enumerator