• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ThermoMechanicalProblem.cpp

Go to the documentation of this file.
00001 //*****************************************************************//
00002 //    Albany 2.0:  Copyright 2012 Sandia Corporation               //
00003 //    This Software is released under the BSD license detailed     //
00004 //    in the file "license.txt" in the top-level Albany directory  //
00005 //*****************************************************************//
00006 #include "ThermoMechanicalProblem.hpp"
00007 #include "Albany_Utils.hpp"
00008 #include "Albany_ProblemUtils.hpp"
00009 #include "Albany_EvaluatorUtils.hpp"
00010 #include "PHAL_AlbanyTraits.hpp"
00011 
00012 Albany::ThermoMechanicalProblem::
00013 ThermoMechanicalProblem(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", "ThermoMechanical");
00022   *out << "Problem Name = " << method << std::endl;
00023   
00024   haveSource =  params->isSublist("Source Functions");
00025 
00026 // Changing this ifdef changes ordering from  (X,Y,T) to (T,X,Y)
00027 //#define NUMBER_T_FIRST
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   model = params->sublist("Material Model").get("Model Name","ThermoMechanical");
00037 
00038 // the following function returns the problem information required for setting the rigid body modes (RBMs) for elasticity problems
00039 //written by IK, Feb. 2012
00040 
00041   int numScalar = 1;
00042   int nullSpaceDim = 0;
00043   if (numDim == 1) {nullSpaceDim = 0; }
00044   else {
00045     if (numDim == 2) {nullSpaceDim = 3; }
00046     if (numDim == 3) {nullSpaceDim = 6; }
00047   }
00048 
00049   rigidBodyModes->setParameters(numDim + 1, numDim, numScalar, nullSpaceDim);
00050 
00051 }
00052 
00053 Albany::ThermoMechanicalProblem::
00054 ~ThermoMechanicalProblem()
00055 {
00056 }
00057 
00058 void
00059 Albany::ThermoMechanicalProblem::
00060 buildProblem(
00061   Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00062   Albany::StateManager& stateMgr)
00063 {
00064   /* Construct All Phalanx Evaluators */
00065   TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00066   fm.resize(1);
00067   fm[0]  = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00068   buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM, 
00069       Teuchos::null);
00070   constructDirichletEvaluators(*meshSpecs[0]);
00071 }
00072 
00073 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00074 Albany::ThermoMechanicalProblem::
00075 buildEvaluators(
00076   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00077   const Albany::MeshSpecsStruct& meshSpecs,
00078   Albany::StateManager& stateMgr,
00079   Albany::FieldManagerChoice fmchoice,
00080   const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00081 {
00082   // Call constructeEvaluators<EvalT>(*rfm[0], *meshSpecs[0], stateMgr);
00083   // for each EvalT in PHAL::AlbanyTraits::BEvalTypes
00084   ConstructEvaluatorsOp<ThermoMechanicalProblem> op(
00085     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00086   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00087   return *op.tags;
00088 }
00089 
00090 void
00091 Albany::ThermoMechanicalProblem::constructDirichletEvaluators(
00092         const Albany::MeshSpecsStruct& meshSpecs)
00093 {
00094   // Construct Dirichlet evaluators for all nodesets and names
00095   std::vector<std::string> dirichletNames(neq);
00096   dirichletNames[X_offset] = "X";
00097   if (numDim>1) dirichletNames[X_offset+1] = "Y";
00098   if (numDim>2) dirichletNames[X_offset+2] = "Z";
00099   dirichletNames[T_offset] = "T";
00100   Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00101   dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00102                                        this->params, this->paramLib);
00103 }
00104 
00105 Teuchos::RCP<const Teuchos::ParameterList>
00106 Albany::ThermoMechanicalProblem::getValidProblemParameters() const
00107 {
00108   Teuchos::RCP<Teuchos::ParameterList> validPL =
00109     this->getGenericProblemParams("ValidThermoMechanicalProblemParams");
00110 
00111   validPL->sublist("Thermal Conductivity", false, "");
00112   validPL->sublist("Bulk Modulus", false, "");
00113   validPL->sublist("Shear Modulus", false, "");
00114   validPL->sublist("Hardening Modulus", false, "");
00115   validPL->sublist("Saturation Modulus", false, "");
00116   validPL->sublist("Saturation Exponent", false, "");
00117   validPL->sublist("Yield Strength", false, "");
00118   validPL->set<RealType>("Reference Temperature", false, "");
00119   validPL->set<RealType>("Thermal Expansion Coefficient", false, "");
00120   validPL->set<RealType>("Density", false, "");
00121   validPL->set<RealType>("Heat Capacity", false, "");
00122   validPL->sublist("Material Model", false, "");
00123   validPL->set<bool>("volavgJ", false, "Flag to indicate the J should be volume averaged");
00124   validPL->set<bool>("weighted_Volume_Averaged_J", false, "Flag to indicate the J should be volume averaged with stabilization");
00125 
00126   return validPL;
00127 }
00128 
00129 void
00130 Albany::ThermoMechanicalProblem::getAllocatedStates(
00131    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00132    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00133    ) const
00134 {
00135   oldState_ = oldState;
00136   newState_ = newState;
00137 }
00138 

Generated on Wed Mar 26 2014 18:36:45 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1