Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include <fstream>
00008 #include "Teuchos_TestForException.hpp"
00009 #include "Phalanx_DataLayout.hpp"
00010 #include "Sacado_ParameterRegistration.hpp"
00011 #include "Intrepid_FunctionSpaceTools.hpp"
00012
00013 namespace PHAL {
00014
00015 template<typename EvalT, typename Traits>
00016 JouleHeating<EvalT, Traits>::
00017 JouleHeating(Teuchos::ParameterList& p) :
00018 potentialGrad(p.get<std::string>("Gradient Variable Name"),
00019 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Vector Data Layout")),
00020 potentialFlux(p.get<std::string>("Flux Variable Name"),
00021 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Vector Data Layout")),
00022 jouleHeating(p.get<std::string>("Source Name"),
00023 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout"))
00024 {
00025 Teuchos::RCP<PHX::DataLayout> vector_dl =
00026 p.get< Teuchos::RCP<PHX::DataLayout> >("QP Vector Data Layout");
00027 std::vector<PHX::DataLayout::size_type> dims;
00028 vector_dl->dimensions(dims);
00029 numQPs = dims[1];
00030 numDims = dims[2];
00031
00032 this->addEvaluatedField(jouleHeating);
00033 this->addDependentField(potentialGrad);
00034 this->addDependentField(potentialFlux);
00035 this->setName("Joule Heating"+PHX::TypeString<EvalT>::value);
00036 }
00037
00038
00039 template<typename EvalT, typename Traits>
00040 void JouleHeating<EvalT, Traits>::
00041 postRegistrationSetup(typename Traits::SetupData d,
00042 PHX::FieldManager<Traits>& fm)
00043 {
00044 this->utils.setFieldData(jouleHeating,fm);
00045 this->utils.setFieldData(potentialGrad,fm);
00046 this->utils.setFieldData(potentialFlux,fm);
00047 }
00048
00049
00050 template<typename EvalT, typename Traits>
00051 void JouleHeating<EvalT, Traits>::
00052 evaluateFields(typename Traits::EvalData workset)
00053 {
00054 Intrepid::FunctionSpaceTools::dotMultiplyDataData<ScalarT>
00055 (jouleHeating, potentialFlux, potentialGrad);
00056 }
00057
00058
00059 }