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

TLPoroPlasticityProblem.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 "TLPoroPlasticityProblem.hpp"
00007 
00008 #include "Intrepid_FieldContainer.hpp"
00009 #include "Intrepid_DefaultCubatureFactory.hpp"
00010 #include "Shards_CellTopology.hpp"
00011 
00012 #include "Albany_Utils.hpp"
00013 #include "Albany_ProblemUtils.hpp"
00014 
00015 
00016 Albany::TLPoroPlasticityProblem::
00017 TLPoroPlasticityProblem(const Teuchos::RCP<Teuchos::ParameterList>& params_,
00018       const Teuchos::RCP<ParamLib>& paramLib_,
00019       const int numDim_) :
00020   Albany::AbstractProblem(params_, paramLib_, numDim_ + 1), // additional DOF for pore pressure
00021   haveSource(false),
00022   numDim(numDim_)
00023 {
00024  
00025   std::string& method = params->get("Name", "Total Lagrangian PoroPlasticity ");
00026   *out << "Problem Name = " << method << std::endl;
00027   
00028   haveSource =  params->isSublist("Source Functions");
00029 
00030   matModel = params->sublist("Material Model").get("Model Name", "Neohookean");
00031 
00032 // Changing this ifdef changes ordering from  (X,Y,T) to (T,X,Y)
00033 //#define NUMBER_T_FIRST
00034 #ifdef NUMBER_T_FIRST
00035   T_offset=0;
00036   X_offset=1;
00037 #else
00038   X_offset=0;
00039   T_offset=numDim;
00040 #endif
00041 
00042 // the following function returns the problem information required for setting the rigid body modes (RBMs) for elasticity problems
00043 //written by IK, Feb. 2012
00044 
00045   int numScalar = 1;
00046   int nullSpaceDim = 0;
00047   if (numDim == 1) {nullSpaceDim = 0; }
00048   else {
00049     if (numDim == 2) {nullSpaceDim = 3; }
00050     if (numDim == 3) {nullSpaceDim = 6; }
00051   }
00052 
00053   rigidBodyModes->setParameters(numDim + 1, numDim, numScalar, nullSpaceDim);
00054 
00055 }
00056 
00057 Albany::TLPoroPlasticityProblem::
00058 ~TLPoroPlasticityProblem()
00059 {
00060 }
00061 
00062 void
00063 Albany::TLPoroPlasticityProblem::
00064 buildProblem(
00065   Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00066   Albany::StateManager& stateMgr)
00067 {
00068   /* Construct All Phalanx Evaluators */
00069   TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00070   fm.resize(1);
00071   fm[0]  = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00072   buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM, 
00073       Teuchos::null);
00074   constructDirichletEvaluators(*meshSpecs[0]);
00075 }
00076 
00077 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00078 Albany::TLPoroPlasticityProblem::
00079 buildEvaluators(
00080   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00081   const Albany::MeshSpecsStruct& meshSpecs,
00082   Albany::StateManager& stateMgr,
00083   Albany::FieldManagerChoice fmchoice,
00084   const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00085 {
00086   // Call constructeEvaluators<EvalT>(*rfm[0], *meshSpecs[0], stateMgr);
00087   // for each EvalT in PHAL::AlbanyTraits::BEvalTypes
00088   ConstructEvaluatorsOp<TLPoroPlasticityProblem> op(
00089     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00090   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00091   return *op.tags;
00092 }
00093 
00094 void
00095 Albany::TLPoroPlasticityProblem::constructDirichletEvaluators(
00096         const Albany::MeshSpecsStruct& meshSpecs)
00097 {
00098   // Construct Dirichlet evaluators for all nodesets and names
00099   std::vector<std::string> dirichletNames(neq);
00100   dirichletNames[X_offset] = "X";
00101   if (numDim>1) dirichletNames[X_offset+1] = "Y";
00102   if (numDim>2) dirichletNames[X_offset+2] = "Z";
00103   dirichletNames[T_offset] = "T";
00104   Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00105   dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00106                                        this->params, this->paramLib);
00107 }
00108 
00109 Teuchos::RCP<const Teuchos::ParameterList>
00110 Albany::TLPoroPlasticityProblem::getValidProblemParameters() const
00111 {
00112   Teuchos::RCP<Teuchos::ParameterList> validPL =
00113     this->getGenericProblemParams("ValidTLPoroPlasticityProblemParams");
00114 
00115   validPL->sublist("Material Model", false, "");
00116   validPL->set<bool>("avgJ", false, "Flag to indicate the J should be averaged");
00117   validPL->set<bool>("volavgJ", false, "Flag to indicate the J should be volume averaged");
00118   validPL->set<bool>("weighted_Volume_Averaged_J", false, "Flag to indicate the J should be volume averaged with stabilization");
00119   validPL->sublist("Porosity", false, "");
00120   validPL->sublist("Biot Coefficient", false, "");
00121   validPL->sublist("Biot Modulus", false, "");
00122   validPL->sublist("Thermal Conductivity", false, "");
00123   validPL->sublist("Kozeny-Carman Permeability", false, "");
00124   validPL->sublist("Elastic Modulus", false, "");
00125   validPL->sublist("Shear Modulus", false, "");
00126   validPL->sublist("Poissons Ratio", false, "");
00127   //validPL->sublist("Stabilization Parameter", false, "");
00128   validPL->set<RealType>("Stabilization Parameter", false, "");
00129   if (matModel=="J2"){
00130    validPL->set<bool>("Compute Dislocation Density Tensor", false, "Flag to compute the dislocaiton density tensor (only for 3D)");
00131    validPL->sublist("Hardening Modulus", false, "");
00132    validPL->sublist("Saturation Modulus", false, "");
00133    validPL->sublist("Saturation Exponent", false, "");
00134    validPL->sublist("Yield Strength", false, "");
00135   }
00136 
00137   return validPL;
00138 }
00139 
00140 void
00141 Albany::TLPoroPlasticityProblem::getAllocatedStates(
00142    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00143    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00144    ) const
00145 {
00146   oldState_ = oldState;
00147   newState_ = newState;
00148 }
00149 

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