|
Intrepid
|
00001 // @HEADER 00002 // ************************************************************************ 00003 // 00004 // Intrepid Package 00005 // Copyright (2007) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Pavel Bochev (pbboche@sandia.gov) or 00025 // Denis Ridzal (dridzal@sandia.gov) or 00026 // Robert Kirby (robert.c.kirby@ttu.edu 00027 // 00028 // ************************************************************************ 00029 // @HEADER 00030 00038 #ifndef INTREPID_POINTTOOLS_HPP 00039 #define INTREPID_POINTTOOLS_HPP 00040 00041 #include "Shards_CellTopology.hpp" 00042 #include "Teuchos_TestForException.hpp" 00043 #include "Intrepid_Polylib.hpp" 00044 #include "Intrepid_FieldContainer.hpp" 00045 #include "Intrepid_CellTools.hpp" 00046 #include <stdexcept> 00047 00048 namespace Intrepid { 00049 00182 class PointTools { 00183 public: 00201 static int getLatticeSize( const shards::CellTopology& cellType , 00202 const int order , 00203 const int offset = 0 ); 00204 00221 template<class Scalar, class ArrayType> 00222 static void getLattice( ArrayType &pts , 00223 const shards::CellTopology& cellType , 00224 const int order , 00225 const int offset = 0 , 00226 const EPointType pointType = POINTTYPE_EQUISPACED ); 00227 00234 template<class Scalar, class ArrayType> 00235 static void getGaussPoints( ArrayType &pts , 00236 const int order ); 00237 00238 00239 private: 00255 template<class Scalar, class ArrayTypeOut, class ArrayTypeIn1, class ArrayTypeIn2> 00256 static void cartToBaryTriangle( ArrayTypeOut & baryValues , 00257 const ArrayTypeIn1 & cartValues , 00258 const ArrayTypeIn2 & vertices ); 00259 00260 00277 template<class Scalar, class ArrayTypeOut, class ArrayTypeIn1, class ArrayTypeIn2> 00278 static void baryToCartTriangle( ArrayTypeOut & cartValues , 00279 const ArrayTypeIn1 & baryValues , 00280 const ArrayTypeIn2 & vertices ); 00281 00282 00299 template<class Scalar, class ArrayTypeOut, class ArrayTypeIn1, class ArrayTypeIn2> 00300 static void cartToBaryTetrahedron( ArrayTypeOut & baryValues , 00301 const ArrayTypeIn1 & cartValues , 00302 const ArrayTypeIn2 & vertices ); 00303 00320 template<class Scalar, class ArrayTypeOut, class ArrayTypeIn1, class ArrayTypeIn2> 00321 static void baryToCartTetrahedron( ArrayTypeOut & cartValues , 00322 const ArrayTypeIn1 & baryValues , 00323 const ArrayTypeIn2 & vertices ); 00324 00325 00341 template<class Scalar, class ArrayType> 00342 static void getEquispacedLattice( const shards::CellTopology& cellType , 00343 ArrayType &points , 00344 const int order , 00345 const int offset = 0 ); 00346 00347 00363 template<class Scalar, class ArrayType> 00364 static void getWarpBlendLattice( const shards::CellTopology& cellType , 00365 ArrayType &points , 00366 const int order , 00367 const int offset = 0); 00368 00369 00384 template<class Scalar, class ArrayType> 00385 static void getEquispacedLatticeLine( ArrayType &points , 00386 const int order , 00387 const int offset = 0 ); 00388 00403 template<class Scalar, class ArrayType> 00404 static void getEquispacedLatticeTriangle( ArrayType &points , 00405 const int order , 00406 const int offset = 0 ); 00407 00422 template<class Scalar, class ArrayType> 00423 static void getEquispacedLatticeTetrahedron( ArrayType &points , 00424 const int order , 00425 const int offset = 0 ); 00426 00441 template<class Scalar, class ArrayType> 00442 static void getWarpBlendLatticeLine( ArrayType &points , 00443 const int order , 00444 const int offset = 0 ); 00445 00452 template<class Scalar, class ArrayType> 00453 static void warpFactor( const int order , 00454 const ArrayType &xnodes , 00455 const ArrayType &xout , 00456 ArrayType &warp ); 00457 00472 template<class Scalar, class ArrayType> 00473 static void getWarpBlendLatticeTriangle(ArrayType &points , 00474 const int order , 00475 const int offset = 0 ); 00476 00490 template<class Scalar, class ArrayType> 00491 static void getWarpBlendLatticeTetrahedron( ArrayType &points , 00492 const int order , 00493 const int offset = 0 ); 00494 00495 00506 template<class Scalar, class ArrayType> 00507 static void warpShiftFace3D( const int order , 00508 const Scalar pval , 00509 const ArrayType &L1, 00510 const ArrayType &L2, 00511 const ArrayType &L3, 00512 const ArrayType &L4, 00513 ArrayType &dxy); 00514 00524 template<class Scalar, class ArrayType> 00525 static void evalshift( const int order , 00526 const Scalar pval , 00527 const ArrayType &L1 , 00528 const ArrayType &L2 , 00529 const ArrayType &L3 , 00530 ArrayType &dxy ); 00531 00538 template<class Scalar, class ArrayType> 00539 static void evalwarp( ArrayType &warp , 00540 const int order , 00541 const ArrayType &xnodes , 00542 const ArrayType &xout ); 00543 00544 00545 }; // end class PointTools 00546 00547 } // end namespace Intrepid 00548 00549 // include templated definitions 00550 #include <Intrepid_PointToolsDef.hpp> 00551 00552 #endif
1.7.4