SundanceCurveEvalMediator.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_CURVEEVALMEDIATOR_H
00032 #define SUNDANCE_CURVEEVALMEDIATOR_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMap.hpp"
00036 #include "SundanceStdFwkEvalMediator.hpp"
00037 #include "SundanceQuadratureFamily.hpp"
00038 #include "SundanceBasisFamily.hpp"
00039 #include "SundanceOrderedTuple.hpp"
00040 #include "SundanceParametrizedCurve.hpp"
00041 
00042 namespace Sundance
00043 {
00044 using namespace Teuchos;
00045 
00046 /**
00047  * 
00048  */
00049 class CurveEvalMediator : public StdFwkEvalMediator
00050 {
00051 public:
00052 
00053 
00054   /** */
00055   CurveEvalMediator(const Mesh& mesh,
00056   const ParametrizedCurve& paramcurve ,
00057     int cellDim,
00058     const QuadratureFamily& quad);
00059 
00060 
00061   /** */
00062   virtual ~CurveEvalMediator(){;}
00063 
00064       
00065   /** Evaluate the given coordinate expression, putting
00066    * its numerical values in the given EvalVector. */
00067   virtual void evalCoordExpr(const CoordExpr* expr,
00068     RCP<EvalVector>& vec) const ;
00069       
00070   /** Evaluate the given discrete function, putting
00071    * its numerical values in the given EvalVector. */
00072   virtual void evalDiscreteFuncElement(const DiscreteFuncElement* expr,
00073     const Array<MultiIndex>& mi,
00074     Array<RCP<EvalVector> >& vec) const ;
00075 
00076   /** Evaluate the given cell diameter expression, putting
00077    * its numerical values in the given EvalVector. */
00078   virtual void evalCellDiameterExpr(const CellDiameterExpr* expr,
00079     RCP<EvalVector>& vec) const ;
00080 
00081   /** Evaluates one component of the normal vector to a given parameterized curve
00082    * i.e. x,y or z component of that vector in 3D <br>
00083    * , this method is only in the CurveEvalMediator class implemented */
00084   virtual void evalCurveNormExpr(const CurveNormExpr* expr,
00085     RCP<EvalVector>& vec) const ;
00086 
00087   /** Evaluate the given cell vector expression, putting
00088    * its numerical values in the given EvalVector. */
00089   virtual void evalCellVectorExpr(const CellVectorExpr* expr,
00090     RCP<EvalVector>& vec) const ;
00091             
00092   /** */
00093   virtual void setCellType(const CellType& cellType,
00094     const CellType& maxCellType,
00095     bool isInternalBdry) ;
00096 
00097   /** */
00098   virtual void print(std::ostream& os) const ;
00099 
00100   /** */
00101   RCP<Array<Array<Array<double> > > > getFacetRefBasisVals(const BasisFamily& basis, int diffOrder) const ;
00102 
00103   /** */
00104   int numQuadPts(const CellType& cellType) const ;
00105 
00106   static double& totalFlops() {static double rtn = 0; return rtn;}
00107 
00108       
00109 
00110   static void addFlops(const double& flops) {totalFlops() += flops;}
00111 
00112   /**
00113    * Return the number of different cases for which reference
00114    * basis functions must be evaluated. If we're on maximal cells,
00115    * this will be one. If we're on lower-dimensional cells, this will
00116    * be equal to the number of cellDim-dimensional facets of the maximal
00117    * cells.
00118    */
00119   int numEvaluationCases() const {return numEvaluationCases_;}
00120 
00121 
00122   /** */
00123   static Time& coordEvaluationTimer() ;
00124 
00125 private:
00126 
00127   /** */
00128   int numEvaluationCases_;
00129 
00130   /** */
00131   QuadratureFamily quad_;
00132 
00133   /** */
00134   int numQuadPtsForMaxCell_;
00135 
00136   /** */
00137   CellType maxCellType_;
00138 
00139   /** */
00140   CellType curveCellType_;
00141 
00142   /** */
00143   ParametrizedCurve paramcurve_;
00144       
00145 };
00146 }
00147 
00148 
00149 #endif /* SUNDANCE_CURVEEVALMEDIATOR_H */

Site Contact