SundancePointwiseUserDefFunctor.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                              Sundance
00005 //                 Copyright (2005) Sandia Corporation
00006 // 
00007 // Copyright (year first published) Sandia Corporation.  Under the terms 
00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
00009 // retains certain rights in this software.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //                                                                                 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA                                                                                
00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 
00026 // Sandia National Laboratories, Livermore, California, USA
00027 // 
00028 // ************************************************************************
00029 /* @HEADER@ */
00030 
00031 #ifndef SUNDANCE_POINTWISEUSERDEFFUNCTOR_H
00032 #define SUNDANCE_POINTWISEUSERDEFFUNCTOR_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMap.hpp"
00036 #include "SundanceUserDefFunctor.hpp"
00037 #include "SundanceMultiSet.hpp"
00038 #include "PlayaExceptions.hpp"
00039 #include "Teuchos_Array.hpp"
00040 #include "Teuchos_RefCountPtr.hpp"
00041 
00042 
00043 
00044 namespace Sundance
00045 {
00046   using namespace Sundance;
00047   using namespace Teuchos;
00048 
00049   
00050   
00051 
00052     /**
00053      * PointwiseUserDefFunctor0 is an implementation of UserDefFunctor for which
00054      * the user writes code to evaluate the function at a single quadrature point.
00055      * Looping over quadrature points is done by the this class.
00056      */
00057   class PointwiseUserDefFunctor0 : public UserDefFunctor
00058     {
00059     public:
00060       /** ctor */
00061       PointwiseUserDefFunctor0(const std::string& name, int domainDim, int rangeDim) ;
00062 
00063       /** */
00064       virtual ~PointwiseUserDefFunctor0(){;}
00065 
00066       /** */
00067       void evaluationCallback(int nPoints, int maxDiffOrder,
00068                               const double** in,
00069                               double** out) const ;
00070 
00071       /** */
00072       virtual void eval0(const double* in, double* out) const = 0 ;
00073 
00074       /** */
00075       virtual int maxOrder() const {return 0;}
00076 
00077     private:
00078     };
00079 
00080 
00081     /**
00082      * PointwiseUserDefFunctor1 is an implementation of UserDefFunctor for which
00083      * the user writes code to evaluate the function at a single quadrature point.
00084      * Looping over quadrature points is done by the this class.
00085      */
00086   class PointwiseUserDefFunctor1 : public PointwiseUserDefFunctor0
00087     {
00088     public:
00089       /** ctor */
00090       PointwiseUserDefFunctor1(const std::string& name, int domainDim, int rangeDim) ;
00091 
00092       /** */
00093       virtual ~PointwiseUserDefFunctor1(){;}
00094 
00095       /** */
00096       void evaluationCallback(int nPoints, int maxDiffOrder,
00097                               const double** in,
00098                               double** out) const ;
00099 
00100       /** */
00101       virtual void eval0(const double* in, double* out) const ;
00102 
00103       /** */
00104       virtual void eval1(const double* in, double* outVals, double* outDerivs) const = 0 ;
00105 
00106       /** */
00107       virtual int maxOrder() const {return 1;}
00108 
00109     private:
00110     };
00111 
00112 
00113     /**
00114      * PointwiseUserDefFunctor2 is an implementation of UserDefFunctor for which
00115      * the user writes code to evaluate the function at a single quadrature point.
00116      * Looping over quadrature points is done by the this class.
00117      */
00118   class PointwiseUserDefFunctor2 : public PointwiseUserDefFunctor1
00119     {
00120     public:
00121       /** ctor */
00122       PointwiseUserDefFunctor2(const std::string& name, int domainDim, int rangeDim) ;
00123 
00124       /** */
00125       virtual ~PointwiseUserDefFunctor2(){;}
00126 
00127       /** */
00128       void evaluationCallback(int nPoints, int maxDiffOrder,
00129                               const double** in,
00130                               double** out) const ;
00131 
00132       /** */
00133       virtual void eval0(const double* in, double* out) const ;
00134 
00135       /** */
00136       virtual void eval1(const double* in, double* outVals, double* outDerivs) const ;
00137 
00138       virtual void eval2(const double* in, double* outVals, double* outDerivs,
00139                          double* outDerivs2) const = 0 ;
00140 
00141       /** */
00142       virtual int maxOrder() const {return 2;}
00143 
00144     private:
00145     };
00146 
00147 
00148 }
00149 
00150 
00151 #endif

Site Contact