|
Intrepid
|
00001 00002 // 00003 // File: Intrepid_Polylib.hpp 00004 // 00005 // For more information, please see: http://www.nektar.info 00006 // 00007 // The MIT License 00008 // 00009 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA), 00010 // Department of Aeronautics, Imperial College London (UK), and Scientific 00011 // Computing and Imaging Institute, University of Utah (USA). 00012 // 00013 // License for the specific language governing rights and limitations under 00014 // Permission is hereby granted, free of charge, to any person obtaining a 00015 // copy of this software and associated documentation files (the "Software"), 00016 // to deal in the Software without restriction, including without limitation 00017 // the rights to use, copy, modify, merge, publish, distribute, sublicense, 00018 // and/or sell copies of the Software, and to permit persons to whom the 00019 // Software is furnished to do so, subject to the following conditions: 00020 // 00021 // The above copyright notice and this permission notice shall be included 00022 // in all copies or substantial portions of the Software. 00023 // 00024 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00025 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00026 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00027 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00028 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00029 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00030 // DEALINGS IN THE SOFTWARE. 00031 // 00032 // Description: 00033 // This file is redistributed with the Intrepid package. It should be used 00034 // in accordance with the above MIT license, at the request of the authors. 00035 // This file is NOT covered by the usual Intrepid/Trilinos LGPL license. 00036 // 00037 // Origin: Nektar++ library, http://www.nektar.info, downloaded on 00038 // March 10, 2009. 00039 // 00041 00042 00050 #ifndef INTREPID_POLYLIB_HPP 00051 #define INTREPID_POLYLIB_HPP 00052 00053 #include "Intrepid_ConfigDefs.hpp" 00054 #include "Intrepid_Types.hpp" 00055 #include "Teuchos_TestForException.hpp" 00056 00057 namespace Intrepid { 00058 00152 enum EIntrepidPLPoly { 00153 PL_GAUSS=0, 00154 PL_GAUSS_RADAU_LEFT, 00155 PL_GAUSS_RADAU_RIGHT, 00156 PL_GAUSS_LOBATTO, 00157 PL_MAX 00158 }; 00159 00160 inline EIntrepidPLPoly & operator++(EIntrepidPLPoly &type) { 00161 return type = static_cast<EIntrepidPLPoly>(type+1); 00162 } 00163 00164 inline EIntrepidPLPoly operator++(EIntrepidPLPoly &type, int) { 00165 EIntrepidPLPoly oldval = type; 00166 ++type; 00167 return oldval; 00168 } 00169 00170 00178 class IntrepidPolylib { 00179 00180 public: 00181 00182 /* Points and weights */ 00183 00191 template<class Scalar> 00192 static void zwgj (Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta); 00193 00194 00202 template<class Scalar> 00203 static void zwgrjm (Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta); 00204 00205 00213 template<class Scalar> 00214 static void zwgrjp (Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta); 00215 00216 00224 template<class Scalar> 00225 static void zwglj (Scalar *z, Scalar *w, const int np, const Scalar alpha, const Scalar beta); 00226 00227 00228 00229 /* Derivative operators */ 00230 00239 template<class Scalar> 00240 static void Dgj (Scalar *D, const Scalar *z, const int np, const Scalar alpha, const Scalar beta); 00241 00242 00251 template<class Scalar> 00252 static void Dgrjm (Scalar *D, const Scalar *z, const int np, const Scalar alpha, const Scalar beta); 00253 00254 00263 template<class Scalar> 00264 static void Dgrjp (Scalar *D, const Scalar *z, const int np, const Scalar alpha, const Scalar beta); 00265 00266 00275 template<class Scalar> 00276 static void Dglj (Scalar *D, const Scalar *z, const int np, const Scalar alpha, const Scalar beta); 00277 00278 00279 00280 /* Lagrangian interpolants */ 00281 00301 template<class Scalar> 00302 static Scalar hgj (const int i, const Scalar z, const Scalar *zgj, 00303 const int np, const Scalar alpha, const Scalar beta); 00304 00305 00325 template<class Scalar> 00326 static Scalar hgrjm (const int i, const Scalar z, const Scalar *zgrj, 00327 const int np, const Scalar alpha, const Scalar beta); 00328 00329 00349 template<class Scalar> 00350 static Scalar hgrjp (const int i, const Scalar z, const Scalar *zgrj, 00351 const int np, const Scalar alpha, const Scalar beta); 00352 00353 00373 template<class Scalar> 00374 static Scalar hglj (const int i, const Scalar z, const Scalar *zglj, 00375 const int np, const Scalar alpha, const Scalar beta); 00376 00377 00378 00379 /* Interpolation operators */ 00380 00391 template<class Scalar> 00392 static void Imgj (Scalar *im, const Scalar *zgj, const Scalar *zm, const int nz, 00393 const int mz, const Scalar alpha, const Scalar beta); 00394 00395 00406 template<class Scalar> 00407 static void Imgrjm(Scalar *im, const Scalar *zgrj, const Scalar *zm, const int nz, 00408 const int mz, const Scalar alpha, const Scalar beta); 00409 00410 00421 template<class Scalar> 00422 static void Imgrjp(Scalar *im, const Scalar *zgrj, const Scalar *zm, const int nz, 00423 const int mz, const Scalar alpha, const Scalar beta); 00424 00425 00436 template<class Scalar> 00437 static void Imglj (Scalar *im, const Scalar *zglj, const Scalar *zm, const int nz, 00438 const int mz, const Scalar alpha, const Scalar beta); 00439 00440 00441 /* Polynomial functions */ 00442 00482 template<class Scalar> 00483 static void jacobfd (const int np, const Scalar *z, Scalar *poly_in, Scalar *polyd, 00484 const int n, const Scalar alpha, const Scalar beta); 00485 00486 00500 template<class Scalar> 00501 static void jacobd (const int np, const Scalar *z, Scalar *polyd, const int n, 00502 const Scalar alpha, const Scalar beta); 00503 00504 00505 00506 /* Helper functions. */ 00507 00514 template<class Scalar> 00515 static void Jacobz (const int n, Scalar *z, const Scalar alpha, const Scalar beta); 00516 00517 00540 template<class Scalar> 00541 static void JacZeros (const int n, Scalar *a, const Scalar alpha, const Scalar beta); 00542 00543 00567 template<class Scalar> 00568 static void TriQL (const int n, Scalar *d, Scalar *e); 00569 00570 00580 template<class Scalar> 00581 static Scalar gammaF (const Scalar x); 00582 00583 00584 }; // class IntrepidPolylib 00585 00586 } // end of Intrepid namespace 00587 00588 // include templated definitions 00589 #include <Intrepid_PolylibDef.hpp> 00590 00591 #endif
1.7.4