SundanceEvalManager.cpp
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 
00032 #include "SundanceEvalManager.hpp"
00033 #include "SundanceOut.hpp"
00034 #include "SundanceAbstractEvalMediator.hpp"
00035 #include "SundanceEvalVector.hpp"
00036 #include "SundanceCoordExpr.hpp"
00037 #include "SundanceCellDiameterExpr.hpp"
00038 #include "SundanceCurveNormExpr.hpp"
00039 #include "SundanceCellVectorExpr.hpp"
00040 #include "SundanceDiscreteFuncElement.hpp"
00041 #include "SundanceMultiIndex.hpp"
00042 
00043 
00044 
00045 using namespace Sundance;
00046 using namespace Sundance;
00047 using namespace Sundance;
00048 using namespace Sundance;
00049 using namespace Teuchos;
00050 
00051 EvalManager::EvalManager()
00052   : verb_(0),
00053     region_(),
00054     mediator_()
00055 {}
00056 
00057 void EvalManager::setVerbosity(int verb)
00058 {
00059   verb_ = verb;
00060 //  if (mediator_.get()) mediator_->setVerbosity(verb);
00061 }
00062 
00063 void EvalManager::evalCoordExpr(const CoordExpr* expr,
00064                                 RCP<EvalVector>& result) const 
00065 {
00066 
00067   TimeMonitor timer(coordEvalTimer());
00068   TEST_FOR_EXCEPTION(mediator() == 0, InternalError,
00069                      "uninitialized mediator in "
00070                      "EvalManager::evalCoordExpr");
00071   mediator()->evalCoordExpr(expr, result);
00072 }
00073 
00074 
00075 void EvalManager::evalCellDiameterExpr(const CellDiameterExpr* expr,
00076                                 RCP<EvalVector>& result) const 
00077 {
00078   TEST_FOR_EXCEPTION(mediator() == 0, InternalError,
00079                      "uninitialized mediator in "
00080                      "EvalManager::evalCellDiameterExpr");
00081   mediator()->evalCellDiameterExpr(expr, result);
00082 }
00083 
00084 void EvalManager::evalCurveNormExpr(const CurveNormExpr* expr,
00085                                 RCP<EvalVector>& result) const
00086 {
00087   TEST_FOR_EXCEPTION(mediator() == 0, InternalError,
00088                      "uninitialized mediator in "
00089                      "EvalManager::evalCurveNormExpr");
00090   mediator()->evalCurveNormExpr(expr, result);
00091 }
00092 
00093 void EvalManager::evalCellVectorExpr(const CellVectorExpr* expr,
00094                                 RCP<EvalVector>& result) const 
00095 {
00096   TEST_FOR_EXCEPTION(mediator() == 0, InternalError,
00097                      "uninitialized mediator in "
00098                      "EvalManager::evalCellVectorExpr");
00099   mediator()->evalCellVectorExpr(expr, result);
00100 }
00101 
00102 
00103 void EvalManager::evalDiscreteFuncElement(const DiscreteFuncElement* expr,
00104                                           const Array<MultiIndex>& mi,
00105                                           Array<RCP<EvalVector> >& result) const 
00106 {
00107   TimeMonitor timer(discFuncEvalTimer());
00108 
00109   TEST_FOR_EXCEPTION(mediator() == 0, InternalError,
00110                      "uninitialized mediator in "
00111                      "EvalManager::evalDiscreteFuncElement");
00112 
00113   mediator()->evalDiscreteFuncElement(expr, mi, result);
00114 }
00115 
00116 
00117 RCP<EvalVector> EvalManager::popVector() const
00118 {
00119   return stack().popVector();
00120 }
00121 
00122 TempStack& EvalManager::stack()
00123 {
00124   static TempStack rtn;
00125   return rtn;
00126 }

Site Contact