Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

UserFuncExpr.h

Go to the documentation of this file.
00001 #ifndef USERFUNCEXPR_H
00002 #define USERFUNCEXPR_H
00003 
00004 #include "SundanceDefs.h"
00005 
00006 #include "FuncExprBase.h"
00007 #include "DenseSerialVector.h"
00008 #include "UserDefinedFunction.h"
00009 #include "Expr.h"
00010 
00011 namespace Sundance
00012 {
00013 
00014   using namespace TSF;
00015   using std::string;
00016 
00017   using std::ostream;
00018 
00019 
00020   /** \ingroup LowLevelSymbolics
00021    * A symbolic function that calls user-defined code for evaluation.
00022    */
00023 
00024   class UserFuncExpr : public FuncExprBase
00025     {
00026     public:
00027       /** \name Developer-only methods */
00028       //@{
00029       /** construct with a function object */
00030       UserFuncExpr(UserDefinedFunction* f, const string& name);
00031       /** */
00032       virtual ~UserFuncExpr(){;}
00033 
00034       // evaluation
00035 
00036       /** */
00037       virtual void evaluate(const WorkSet& workSet,
00038                             const QuadratureFamily& quadFamily,
00039                             DenseSerialVector& result) const ;
00040 
00041       /** */
00042       virtual void evaluate(const AbstractFunctionSpace& targetSpace,
00043                             const TSFArray<Cell>& cells,
00044                             const TSFArray<int>& cellIndices,
00045                             const TSFArray<int>& dofIndices,
00046                             const TSFArray<Point>& x,
00047                             DenseSerialVector& values) const ;
00048 
00049       // differentiation
00050       /** */
00051       virtual void derivative(const MultiIndex& d, Expr& result) const ;
00052 
00053       // ordering support
00054       /** */
00055       virtual bool operator==(const Expr& other) const ;
00056       /** */
00057       virtual bool operator<(const Expr& other) const ;
00058       /** */
00059       virtual int sortPriority() const {return USERFUNCEXPR;}
00060 
00061       // RTTI
00062       /** */
00063       virtual bool isUserFuncExpr() const {return true;}
00064 
00065       /** */
00066       virtual ExprBase* clone() const ;
00067 
00068       /** */
00069       virtual void print(ostream& os, bool paren=false) const ;
00070       //@}
00071     private:
00072       TSFSmartPtr<UserDefinedFunction> func_;
00073     };
00074 
00075 
00076 }
00077 #endif
00078 

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by