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

PoroElasticityProblem.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 "PoroElasticityProblem.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::PoroElasticityProblem::
00017 PoroElasticityProblem(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", "PoroElasticity ");
00026   *out << "Problem Name = " << method << std::endl;
00027   
00028   haveSource =  params->isSublist("Source Functions");
00029 
00030   matModel = params->sublist("Material Model").get("Model Name", "LinearElasticity");
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::PoroElasticityProblem::
00058 ~PoroElasticityProblem()
00059 {
00060 }
00061 
00062 void
00063 Albany::PoroElasticityProblem::
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::PoroElasticityProblem::
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<PoroElasticityProblem> 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::PoroElasticityProblem::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::PoroElasticityProblem::getValidProblemParameters() const
00111 {
00112   Teuchos::RCP<Teuchos::ParameterList> validPL =
00113     this->getGenericProblemParams("ValidPoroElasticityProblemParams");
00114   validPL->set<bool>("avgJ", false, "Flag to indicate the J should be averaged");
00115   validPL->set<bool>("volavgJ", false, "Flag to indicate the J should be volume averaged");
00116   validPL->set<bool>("weighted_Volume_Averaged_J", false, "Flag to indicate the J should be volume averaged with stabilization");
00117   validPL->sublist("Material Model", false, "");
00118   validPL->sublist("Porosity", false, "");
00119   validPL->sublist("Biot Coefficient", false, "");
00120   validPL->sublist("Biot Modulus", false, "");
00121   validPL->sublist("Thermal Conductivity", false, "");
00122   validPL->sublist("Kozeny-Carman Permeability", false, "");
00123   validPL->sublist("Elastic Modulus", false, "");
00124   validPL->sublist("Shear Modulus", false, "");
00125   validPL->sublist("Poissons Ratio", false, "");
00126   validPL->sublist("Stabilization Parameter", false, "");
00127 
00128 
00129   if (matModel == "CapExplicit" || matModel == "CapImplicit")
00130     {
00131     validPL->set<double>("A", false, "");
00132     validPL->set<double>("B", false, "");
00133     validPL->set<double>("C", false, "");
00134     validPL->set<double>("theta", false, "");
00135     validPL->set<double>("R", false, "");
00136     validPL->set<double>("kappa0", false, "");
00137     validPL->set<double>("W", false, "");
00138     validPL->set<double>("D1", false, "");
00139     validPL->set<double>("D2", false, "");
00140     validPL->set<double>("calpha", false, "");
00141     validPL->set<double>("psi", false, "");
00142     validPL->set<double>("N", false, "");
00143     validPL->set<double>("L", false, "");
00144     validPL->set<double>("phi", false, "");
00145     validPL->set<double>("Q", false, "");
00146     }
00147 
00148     if (matModel == "GursonSD")
00149     {
00150     validPL->set<double>("f0", false, "");
00151     validPL->set<double>("Y0", false, "");
00152     validPL->set<double>("kw", false, "");
00153     validPL->set<double>("N", false, "");
00154     validPL->set<double>("q1", false, "");
00155     validPL->set<double>("q2", false, "");
00156     validPL->set<double>("q3", false, "");
00157     validPL->set<double>("eN", false, "");
00158     validPL->set<double>("sN", false, "");
00159     validPL->set<double>("fN", false, "");
00160     validPL->set<double>("fc", false, "");
00161     validPL->set<double>("ff", false, "");
00162     validPL->set<double>("flag", false, "");
00163     }
00164 
00165   return validPL;
00166 }
00167 
00168 void
00169 Albany::PoroElasticityProblem::getAllocatedStates(
00170    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00171    Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00172    ) const
00173 {
00174   oldState_ = oldState;
00175   newState_ = newState;
00176 }
00177 

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