Intrepid
http://trilinos.sandia.gov/packages/docs/r10.6/packages/intrepid/src/Discretization/Basis/Intrepid_Basis.hpp
Go to the documentation of this file.
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).
00026 //
00027 // ************************************************************************
00028 // @HEADER
00029 
00035 #ifndef INTREPID_BASIS_HPP
00036 #define INTREPID_BASIS_HPP
00037 #include "Intrepid_ConfigDefs.hpp"
00038 #include "Intrepid_Types.hpp"
00039 #include "Intrepid_Utils.hpp"
00040 #include "Shards_CellTopology.hpp"
00041 
00042 namespace Intrepid {
00043     
00074 template<class Scalar, class ArrayScalar>
00075 class Basis {
00076 private:
00077 
00080   virtual void initializeTags() = 0;
00081   
00082 protected: 
00083   
00086   int basisCardinality_;
00087 
00090   int basisDegree_;
00091   
00095   shards::CellTopology basisCellTopology_;
00096   
00099   EBasis basisType_;
00100   
00103   ECoordinates basisCoordinates_;
00104   
00107   bool basisTagsAreSet_;
00108   
00120   std::vector<std::vector<int> > ordinalToTag_;
00121   
00133   std::vector<std::vector<std::vector<int> > > tagToOrdinal_;  
00134   
00135 public:
00136     
00139   virtual ~Basis() {}
00140   
00141         
00160   virtual void getValues(ArrayScalar &          outputValues,
00161                          const ArrayScalar &    inputPoints,
00162                          const EOperator        operatorType) const = 0;
00163   
00164     
00184   virtual void getValues(ArrayScalar &          outputValues,
00185                          const ArrayScalar &    inputPoints,
00186                          const ArrayScalar &    cellVertices,
00187                          const EOperator        operatorType = OPERATOR_VALUE) const = 0;
00188   
00193   virtual int getCardinality() const;
00194   
00195   
00200   virtual int getDegree() const;
00201   
00202   
00208   virtual const shards::CellTopology getBaseCellTopology() const;
00209 
00210   
00215   virtual EBasis getBasisType() const;
00216   
00217   
00222   virtual ECoordinates getCoordinateSystem() const;
00223   
00224   
00233   virtual int getDofOrdinal(const int subcDim,
00234                             const int subcOrd,
00235                             const int subcDofOrd);  
00236 
00238   virtual const std::vector<std::vector<std::vector<int> > > &getDofOrdinalData( );
00239 
00240   
00251   virtual const std::vector<int>&  getDofTag(const int dofOrd);
00252   
00253   
00262   virtual const std::vector<std::vector<int> >& getAllDofTags();
00263   
00264   
00265 
00266 
00267 }; // class Basis
00268 
00269 
00270 //--------------------------------------------------------------------------------------------//
00271 //                                                                                            //
00272 //                            Helper functions of the Basis class                             //
00273 //                                                                                            //
00274 //--------------------------------------------------------------------------------------------//
00275 
00276 //--------------------------------------------------------------------------------------------//
00277 //                                                                                            //            
00278 //                                        Argument checks                                     //
00279 //                                                                                            //            
00280 //--------------------------------------------------------------------------------------------//
00281 
00292 template<class Scalar, class ArrayScalar>
00293 void getValues_HGRAD_Args(ArrayScalar &                outputValues,
00294                           const ArrayScalar &          inputPoints,
00295                           const EOperator              operatorType,
00296                           const shards::CellTopology&  cellTopo,
00297                           const int                    basisCard);
00298 
00309 template<class Scalar, class ArrayScalar>
00310 void getValues_HCURL_Args(ArrayScalar &                outputValues,
00311                           const ArrayScalar &          inputPoints,
00312                           const EOperator              operatorType,
00313                           const shards::CellTopology&  cellTopo,
00314                           const int                    basisCard);
00315 
00326 template<class Scalar, class ArrayScalar>
00327 void getValues_HDIV_Args(ArrayScalar &                outputValues,
00328                           const ArrayScalar &          inputPoints,
00329                           const EOperator              operatorType,
00330                           const shards::CellTopology&  cellTopo,
00331                           const int                    basisCard);
00332 
00333 
00338 template<class ArrayScalar>
00339 class DofCoordsInterface {
00340 public:
00345    virtual ~DofCoordsInterface() = 0;
00346 
00353    virtual void getDofCoords(ArrayScalar & DofCoords) const = 0;
00354 };
00355 
00356 
00357 // include templated definitions
00358 #include <Intrepid_BasisDef.hpp>
00359   
00360 
00361 }// namespace Intrepid
00362 
00363 
00364 //--------------------------------------------------------------------------------------------//
00365 //                                                                                            //
00366 //                            D O C U M E N T A T I O N   P A G E S                           //   
00367 //                                                                                            //
00368 //--------------------------------------------------------------------------------------------//
00469 #endif