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 template<typename EvalT, typename Traits>
00016 StokesRm<EvalT, Traits>::
00017 StokesRm(const Teuchos::ParameterList& p,
00018 const Teuchos::RCP<Albany::Layouts>& dl) :
00019 pGrad (p.get<std::string> ("Pressure Gradient QP Variable Name"), dl->qp_vector),
00020 VGrad (p.get<std::string> ("Velocity Gradient QP Variable Name"), dl->qp_tensor),
00021 V (p.get<std::string> ("Velocity QP Variable Name"), dl->qp_vector),
00022 force (p.get<std::string> ("Body Force QP Variable Name"), dl->qp_vector),
00023 Rm (p.get<std::string> ("Rm Name"), dl->qp_vector)
00024
00025 {
00026 coordVec = PHX::MDField<MeshScalarT,Cell,QuadPoint,Dim>(
00027 p.get<std::string>("Coordinate Vector Name"), dl->qp_gradient);
00028 this->addDependentField(coordVec);
00029
00030 this->addDependentField(pGrad);
00031 this->addDependentField(VGrad);
00032 this->addDependentField(V);
00033 this->addDependentField(force);
00034 this->addEvaluatedField(Rm);
00035
00036 std::vector<PHX::DataLayout::size_type> dims;
00037 dl->node_qp_vector->dimensions(dims);
00038 numNodes = dims[1];
00039 numQPs = dims[2];
00040 numDims = dims[3];
00041
00042 this->setName("StokesRm"+PHX::TypeString<EvalT>::value);
00043 }
00044
00045
00046 template<typename EvalT, typename Traits>
00047 void StokesRm<EvalT, Traits>::
00048 postRegistrationSetup(typename Traits::SetupData d,
00049 PHX::FieldManager<Traits>& fm)
00050 {
00051 this->utils.setFieldData(pGrad,fm);
00052 this->utils.setFieldData(VGrad,fm);
00053 this->utils.setFieldData(V,fm);
00054 this->utils.setFieldData(force,fm);
00055 this->utils.setFieldData(coordVec,fm);
00056
00057 this->utils.setFieldData(Rm,fm);
00058 }
00059
00060
00061 template<typename EvalT, typename Traits>
00062 void StokesRm<EvalT, Traits>::
00063 evaluateFields(typename Traits::EvalData workset)
00064 {
00065 for (std::size_t cell=0; cell < workset.numCells; ++cell) {
00066 for (std::size_t qp=0; qp < numQPs; ++qp) {
00067 for (std::size_t i=0; i < numDims; ++i) {
00068 Rm(cell,qp,i) = 0;
00069 Rm(cell,qp,i) += pGrad(cell,qp,i)+force(cell,qp,i);
00070 }
00071 }
00072 }
00073 }
00074
00075 }
00076