Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include "ThermoElasticityProblem.hpp"
00007 #include "Albany_Utils.hpp"
00008 #include "Albany_ProblemUtils.hpp"
00009 #include "Albany_EvaluatorUtils.hpp"
00010 #include "PHAL_AlbanyTraits.hpp"
00011
00012 Albany::ThermoElasticityProblem::
00013 ThermoElasticityProblem(const Teuchos::RCP<Teuchos::ParameterList>& params_,
00014 const Teuchos::RCP<ParamLib>& paramLib_,
00015 const int numDim_) :
00016 Albany::AbstractProblem(params_, paramLib_, numDim_ + 1),
00017 haveSource(false),
00018 numDim(numDim_)
00019 {
00020
00021 std::string& method = params->get("Name", "ThermoElasticity ");
00022 *out << "Problem Name = " << method << std::endl;
00023
00024 haveSource = params->isSublist("Source Functions");
00025
00026
00027
00028 #ifdef NUMBER_T_FIRST
00029 T_offset=0;
00030 X_offset=1;
00031 #else
00032 X_offset=0;
00033 T_offset=numDim;
00034 #endif
00035
00036
00037
00038
00039 int numScalar = 1;
00040 int nullSpaceDim = 0;
00041 if (numDim == 1) {nullSpaceDim = 0; }
00042 else {
00043 if (numDim == 2) {nullSpaceDim = 3; }
00044 if (numDim == 3) {nullSpaceDim = 6; }
00045 }
00046
00047 rigidBodyModes->setParameters(numDim + 1, numDim, numScalar, nullSpaceDim);
00048
00049 }
00050
00051 Albany::ThermoElasticityProblem::
00052 ~ThermoElasticityProblem()
00053 {
00054 }
00055
00056 void
00057 Albany::ThermoElasticityProblem::
00058 buildProblem(
00059 Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> > meshSpecs,
00060 Albany::StateManager& stateMgr)
00061 {
00062
00063 TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00064 fm.resize(1);
00065 fm[0] = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00066 buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM,
00067 Teuchos::null);
00068 constructDirichletEvaluators(*meshSpecs[0]);
00069 }
00070
00071 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00072 Albany::ThermoElasticityProblem::
00073 buildEvaluators(
00074 PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00075 const Albany::MeshSpecsStruct& meshSpecs,
00076 Albany::StateManager& stateMgr,
00077 Albany::FieldManagerChoice fmchoice,
00078 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00079 {
00080
00081
00082 ConstructEvaluatorsOp<ThermoElasticityProblem> op(
00083 *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00084 boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00085 return *op.tags;
00086 }
00087
00088 void
00089 Albany::ThermoElasticityProblem::constructDirichletEvaluators(
00090 const Albany::MeshSpecsStruct& meshSpecs)
00091 {
00092
00093 std::vector<std::string> dirichletNames(neq);
00094 dirichletNames[X_offset] = "X";
00095 if (numDim>1) dirichletNames[X_offset+1] = "Y";
00096 if (numDim>2) dirichletNames[X_offset+2] = "Z";
00097 dirichletNames[T_offset] = "T";
00098 Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00099 dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00100 this->params, this->paramLib);
00101 }
00102
00103 Teuchos::RCP<const Teuchos::ParameterList>
00104 Albany::ThermoElasticityProblem::getValidProblemParameters() const
00105 {
00106 Teuchos::RCP<Teuchos::ParameterList> validPL =
00107 this->getGenericProblemParams("ValidThermoElasticityProblemParams");
00108
00109 validPL->sublist("Elastic Modulus", false, "");
00110 validPL->sublist("Poissons Ratio", false, "");
00111
00112 return validPL;
00113 }
00114
00115 void
00116 Albany::ThermoElasticityProblem::getAllocatedStates(
00117 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00118 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00119 ) const
00120 {
00121 oldState_ = oldState;
00122 newState_ = newState;
00123 }
00124