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 LCM {
00013
00014
00015 template<typename EvalT, typename Traits>
00016 MixtureThermalExpansion<EvalT, Traits>::
00017 MixtureThermalExpansion(const Teuchos::ParameterList& p) :
00018 biotCoefficient (p.get<std::string> ("Biot Coefficient Name"),
00019 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00020 porosity (p.get<std::string> ("Porosity Name"),
00021 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00022 alphaSkeleton (p.get<std::string> ("Skeleton Thermal Expansion Name"),
00023 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00024 alphaPoreFluid (p.get<std::string> ("Pore-Fluid Thermal Expansion Name"),
00025 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00026 J (p.get<std::string> ("DetDefGrad Name"),
00027 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00028 mixtureThermalExpansion (p.get<std::string> ("Mixture Thermal Expansion Name"),
00029 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") )
00030 {
00031 this->addDependentField(biotCoefficient);
00032 this->addDependentField(porosity);
00033 this->addDependentField(J);
00034 this->addDependentField(alphaPoreFluid);
00035 this->addDependentField(alphaSkeleton);
00036
00037 this->addEvaluatedField(mixtureThermalExpansion);
00038
00039 this->setName("Mixture Thermal Expansion"+PHX::TypeString<EvalT>::value);
00040
00041 Teuchos::RCP<PHX::DataLayout> scalar_dl =
00042 p.get< Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout");
00043 std::vector<PHX::DataLayout::size_type> dims;
00044 scalar_dl->dimensions(dims);
00045 numQPs = dims[1];
00046 }
00047
00048
00049 template<typename EvalT, typename Traits>
00050 void MixtureThermalExpansion<EvalT, Traits>::
00051 postRegistrationSetup(typename Traits::SetupData d,
00052 PHX::FieldManager<Traits>& fm)
00053 {
00054 this->utils.setFieldData(mixtureThermalExpansion,fm);
00055 this->utils.setFieldData(biotCoefficient,fm);
00056 this->utils.setFieldData(porosity,fm);
00057 this->utils.setFieldData(J,fm);
00058 this->utils.setFieldData(alphaSkeleton,fm);
00059 this->utils.setFieldData(alphaPoreFluid,fm);
00060 }
00061
00062
00063 template<typename EvalT, typename Traits>
00064 void MixtureThermalExpansion<EvalT, Traits>::
00065 evaluateFields(typename Traits::EvalData workset)
00066 {
00067
00068 for (std::size_t cell=0; cell < workset.numCells; ++cell) {
00069 for (std::size_t qp=0; qp < numQPs; ++qp) {
00070
00071 mixtureThermalExpansion(cell,qp) = (biotCoefficient(cell,qp)*J(cell,qp)-porosity(cell,qp))
00072 *alphaSkeleton(cell,qp) +
00073 porosity(cell,qp)*alphaPoreFluid(cell,qp);
00074
00075 }
00076 }
00077
00078 }
00079
00080
00081 }
00082