SundanceCurveExpr.hpp
Go to the documentation of this file.
00001 /*
00002  * SundanceCurveExpr.hpp
00003  *
00004  *  Created on: Jun 7, 2011
00005  *      Author: benk
00006  */
00007 
00008 #ifndef SUNDANCECURVEEXPR_HPP_
00009 #define SUNDANCECURVEEXPR_HPP_
00010 
00011 #include "SundancePointwiseUserDefFunctor.hpp"
00012 #include "SundanceParametrizedCurve.hpp"
00013 
00014 namespace Sundance{
00015 
00016 /** class which serves as expression for interface (curve or surface) values */
00017 class CurveExpr : public PointwiseUserDefFunctor0
00018 {
00019 public:
00020     /** Ctor the input is a ParamCurve and an index for the scalar field */
00021   CurveExpr(const ParametrizedCurve& interface , int scalarFieldIndex)
00022     : PointwiseUserDefFunctor0("CurveExpr", interface.getCurveDim()+1 , 1)
00023       , interface_(interface) , scalarFieldIndex_(scalarFieldIndex){;}
00024 
00025     /** to evaluate the expression just pass the control to the interface object */
00026     void eval0(const double* vars, double* f) const {
00027       interface_.eval0( vars, f , scalarFieldIndex_ ) ;
00028     }
00029 
00030 private:
00031   const ParametrizedCurve& interface_;
00032   int scalarFieldIndex_;
00033 };
00034 
00035 //Expr CurveExpression(const ParametrizedCurve& interface , int scalarFieldIndex, const Expr& x, const Expr& y)
00036 //{
00037 //  return new UserDefOp( List(x,y), rcp(new CurveExpr(interface, scalarFieldIndex)));
00038 //}
00039 
00040 }
00041 
00042 #endif /* SUNDANCECURVEEXPR_HPP_ */

Site Contact