Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Teuchos_TestForException.hpp"
00008 #include "Phalanx_DataLayout.hpp"
00009
00010 #include "Intrepid_FunctionSpaceTools.hpp"
00011
00012 namespace FELIX {
00013
00014
00015
00016 template<typename EvalT, typename Traits>
00017 StokesTauM<EvalT, Traits>::
00018 StokesTauM(const Teuchos::ParameterList& p,
00019 const Teuchos::RCP<Albany::Layouts>& dl) :
00020 V (p.get<std::string> ("Velocity QP Variable Name"), dl->qp_vector),
00021 Gc (p.get<std::string> ("Contravarient Metric Tensor Name"), dl->qp_tensor),
00022 muFELIX (p.get<std::string> ("FELIX Viscosity QP Variable Name"), dl->qp_scalar),
00023 jacobian_det (p.get<std::string> ("Jacobian Det Name"), dl->qp_scalar ),
00024 TauM (p.get<std::string> ("Tau M Name"), dl->qp_scalar)
00025 {
00026 Teuchos::ParameterList* tauM_list =
00027 p.get<Teuchos::ParameterList*>("Parameter List");
00028
00029 delta = tauM_list->get("Delta", 1.0);
00030
00031 this->addDependentField(V);
00032 this->addDependentField(Gc);
00033 this->addDependentField(muFELIX);
00034 this->addDependentField(jacobian_det);
00035
00036 this->addEvaluatedField(TauM);
00037
00038 std::vector<PHX::DataLayout::size_type> dims;
00039 dl->qp_gradient->dimensions(dims);
00040 numQPs = dims[1];
00041 numDims = dims[2];
00042
00043
00044 normGc.resize(dims[0], numQPs);
00045
00046 this->setName("StokesTauM"+PHX::TypeString<EvalT>::value);
00047 }
00048
00049
00050 template<typename EvalT, typename Traits>
00051 void StokesTauM<EvalT, Traits>::
00052 postRegistrationSetup(typename Traits::SetupData d,
00053 PHX::FieldManager<Traits>& fm)
00054 {
00055 this->utils.setFieldData(V,fm);
00056 this->utils.setFieldData(Gc,fm);
00057 this->utils.setFieldData(muFELIX,fm);
00058 this->utils.setFieldData(jacobian_det,fm);
00059
00060 this->utils.setFieldData(TauM,fm);
00061 }
00062
00063
00064 template<typename EvalT, typename Traits>
00065 void StokesTauM<EvalT, Traits>::
00066 evaluateFields(typename Traits::EvalData workset)
00067 {
00068
00069 for (std::size_t cell=0; cell < workset.numCells; ++cell) {
00070 for (std::size_t qp=0; qp < numQPs; ++qp) {
00071 meshSize = 2.0*pow(jacobian_det(cell,qp), 1.0/numDims);
00072 TauM(cell, qp) = delta*meshSize*meshSize;
00073 }
00074 }
00075 }
00076
00077
00078 }
00079