• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

FELIX_EpsilonL1L2_Def.hpp

Go to the documentation of this file.
00001 /********************************************************************\
00002 *            Albany, Copyright (2010) Sandia Corporation             *
00003 *                                                                    *
00004 * Notice: This computer software was prepared by Sandia Corporation, *
00005 * hereinafter the Contractor, under Contract DE-AC04-94AL85000 with  *
00006 * the Department of Energy (DOE). All rights in the computer software*
00007 * are reserved by DOE on behalf of the United States Government and  *
00008 * the Contractor as provided in the Contract. You are authorized to  *
00009 * use this computer software for Governmental purposes but it is not *
00010 * to be released or distributed to the public. NEITHER THE GOVERNMENT*
00011 * NOR THE CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR      *
00012 * ASSUMES ANY LIABILITY L1L2R THE USE OF THIS SOFTWARE. This notice    *
00013 * including this sentence must appear on any copies of this software.*
00014 *    Questions to Andy Salinger, agsalin@sandia.gov                  *
00015 \********************************************************************/
00016 
00017 
00018 #include "Teuchos_TestForException.hpp"
00019 #include "Phalanx_DataLayout.hpp"
00020 #include "Sacado_ParameterRegistration.hpp" 
00021 
00022 #include "Intrepid_FunctionSpaceTools.hpp"
00023 
00024 namespace FELIX {
00025 
00026 //**********************************************************************
00027 template<typename EvalT, typename Traits>
00028 EpsilonL1L2<EvalT, Traits>::
00029 EpsilonL1L2(const Teuchos::ParameterList& p,
00030             const Teuchos::RCP<Albany::Layouts>& dl) :
00031   Ugrad     (p.get<std::string> ("Gradient QP Variable Name"),dl->qp_vecgradient ),
00032   epsilonXX (p.get<std::string> ("FELIX EpsilonXX QP Variable Name"), dl->qp_scalar ), 
00033   epsilonYY (p.get<std::string> ("FELIX EpsilonYY QP Variable Name"), dl->qp_scalar ), 
00034   epsilonXY (p.get<std::string> ("FELIX EpsilonXY QP Variable Name"), dl->qp_scalar ), 
00035   epsilonB  (p.get<std::string> ("FELIX EpsilonB QP Variable Name"),  dl->qp_scalar ) 
00036 {
00037   Teuchos::ParameterList* visc_list = 
00038    p.get<Teuchos::ParameterList*>("Parameter List");
00039   
00040   this->addDependentField(Ugrad);
00041   
00042   this->addEvaluatedField(epsilonXX);
00043   this->addEvaluatedField(epsilonYY);
00044   this->addEvaluatedField(epsilonXY);
00045   this->addEvaluatedField(epsilonB);
00046 
00047   std::vector<PHX::DataLayout::size_type> dims;
00048   dl->qp_gradient->dimensions(dims);
00049   numQPs  = dims[1];
00050   numDims = dims[2];
00051 
00052   Teuchos::RCP<ParamLib> paramLib = p.get< Teuchos::RCP<ParamLib> >("Parameter Library"); 
00053   
00054   new Sacado::ParameterRegistration<EvalT, SPL_Traits>("Glen's Law Homotopy Parameter", this, paramLib);   
00055   
00056   this->setName("EpsilonL1L2"+PHX::TypeString<EvalT>::value);
00057 }
00058 
00059 //**********************************************************************
00060 template<typename EvalT, typename Traits>
00061 void EpsilonL1L2<EvalT, Traits>::
00062 postRegistrationSetup(typename Traits::SetupData d,
00063                       PHX::FieldManager<Traits>& fm)
00064 {
00065   this->utils.setFieldData(Ugrad,fm);
00066   this->utils.setFieldData(epsilonXX,fm); 
00067   this->utils.setFieldData(epsilonYY,fm); 
00068   this->utils.setFieldData(epsilonXY,fm); 
00069   this->utils.setFieldData(epsilonB,fm); 
00070 }
00071 
00072 //**********************************************************************
00073 template<typename EvalT,typename Traits>
00074 typename EpsilonL1L2<EvalT,Traits>::ScalarT& 
00075 EpsilonL1L2<EvalT,Traits>::getValue(const std::string &n)
00076 {
00077   return homotopyParam;
00078 }
00079 
00080 
00081 //**********************************************************************
00082 template<typename EvalT, typename Traits>
00083 void EpsilonL1L2<EvalT, Traits>::
00084 evaluateFields(typename Traits::EvalData workset)
00085 {
00086   for (std::size_t cell=0; cell < workset.numCells; ++cell) {
00087     for (std::size_t qp=0; qp < numQPs; ++qp) {
00088        epsilonXX(cell,qp) = Ugrad(cell,qp,0,0); 
00089        epsilonYY(cell,qp) = Ugrad(cell,qp,1,1); 
00090        epsilonXY(cell,qp) = 0.5*(Ugrad(cell,qp,0,1) + Ugrad(cell,qp,1,0)); 
00091        epsilonB(cell,qp)  = epsilonXX(cell,qp)*epsilonXX(cell,qp) + epsilonYY(cell,qp)*epsilonYY(cell,qp) 
00092                           + epsilonXX(cell,qp)*epsilonYY(cell,qp) + epsilonXY(cell,qp)*epsilonXY(cell,qp);   
00093     }
00094   }
00095 }
00096 }

Generated on Wed Mar 26 2014 18:36:38 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1