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

LameProblem.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 "LameProblem.hpp"
00007 #include "Albany_Utils.hpp"
00008 #include "Albany_ProblemUtils.hpp"
00009 
00010 Albany::LameProblem::
00011 LameProblem(const Teuchos::RCP<Teuchos::ParameterList>& params_,
00012             const Teuchos::RCP<ParamLib>& paramLib_,
00013             const int numDim_,
00014             const Teuchos::RCP<const Epetra_Comm>& comm) :
00015   Albany::AbstractProblem(params_, paramLib_, numDim_),
00016   haveSource(false), haveMatDB(false)
00017 {
00018  
00019   std::string& method = params->get("Name", "Library of Advanced Materials for Engineering (LAME) ");
00020   *out << "Problem Name = " << method << std::endl;
00021   
00022   haveSource =  params->isSublist("Source Functions");
00023 
00024   if(params->isType<std::string>("MaterialDB Filename")){
00025         haveMatDB = true;
00026     mtrlDbFilename = params->get<std::string>("MaterialDB Filename");
00027     materialDB = Teuchos::rcp(new QCAD::MaterialDatabase(mtrlDbFilename, comm));
00028   }
00029 
00030   // currently only support 3D analyses
00031   TEUCHOS_TEST_FOR_EXCEPTION(neq != 3,
00032                      Teuchos::Exceptions::InvalidParameter,
00033                      "\nOnly three-dimensional analyses are suppored when using the Library of Advanced Materials for Engineering (LAME)\n");
00034 
00035 // the following function returns the problem information required for setting the rigid body modes (RBMs) for elasticity problems
00036 //written by IK, Feb. 2012
00037 
00038   int numScalar = 0;
00039   int nullSpaceDim = 0;
00040   if (numDim == 1) {nullSpaceDim = 0; }
00041   else {
00042     if (numDim == 2) {nullSpaceDim = 3; }
00043     if (numDim == 3) {nullSpaceDim = 6; }
00044   }
00045 
00046   rigidBodyModes->setParameters(numDim, numDim, numScalar, nullSpaceDim);
00047 
00048 }
00049 
00050 Albany::LameProblem::
00051 ~LameProblem()
00052 {
00053 }
00054 
00055 void
00056 Albany::LameProblem::
00057 buildProblem(
00058   Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00059   Albany::StateManager& stateMgr)
00060 {
00061   /* Construct All Phalanx Evaluators */
00062   int physSets = meshSpecs.size();
00063   std::cout << "Lame Num MeshSpecs: " << physSets << std::endl;
00064   fm.resize(physSets);
00065 
00066   for (int ps=0; ps<physSets; ps++) {
00067     fm[ps]  = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00068     buildEvaluators(*fm[ps], *meshSpecs[ps], stateMgr, BUILD_RESID_FM, 
00069         Teuchos::null);
00070   }
00071   constructDirichletEvaluators(*meshSpecs[0]);
00072 }
00073 
00074 Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00075 Albany::LameProblem::
00076 buildEvaluators(
00077   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00078   const Albany::MeshSpecsStruct& meshSpecs,
00079   Albany::StateManager& stateMgr,
00080   Albany::FieldManagerChoice fmchoice,
00081   const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00082 {
00083   // Call constructeEvaluators<EvalT>(*rfm[0], meshSpecs, stateMgr);
00084   // for each EvalT in PHAL::AlbanyTraits::BEvalTypes
00085   ConstructEvaluatorsOp<LameProblem> op(
00086     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00087   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00088   return *op.tags;
00089 }
00090 
00091 void
00092 Albany::LameProblem::constructDirichletEvaluators(
00093         const Albany::MeshSpecsStruct& meshSpecs)
00094 {
00095    // Construct Dirichlet evaluators for all nodesets and names
00096    std::vector<std::string> dirichletNames(neq);
00097    dirichletNames[0] = "X";
00098    if (neq>1) dirichletNames[1] = "Y";
00099    if (neq>2) dirichletNames[2] = "Z";
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::LameProblem::getValidProblemParameters() const
00107 {
00108   Teuchos::RCP<Teuchos::ParameterList> validPL =
00109     this->getGenericProblemParams("ValidLameProblemParams");
00110 
00111   validPL->set<std::string>("Lame Material Model", "", "The name of the LAME material model.");
00112   validPL->sublist("Lame Material Parameters", false, "");
00113   validPL->sublist("aveJ", false, "If true, the determinate of the deformation gradient for each integration point is replaced with the average value over all integration points in the element (produces constant volumetric response).");
00114   validPL->sublist("volaveJ", false, "If true, the determinate of the deformation gradient for each integration point is replaced with the volume-averaged value over all integration points in the element (produces constant volumetric response).");
00115   validPL->set<std::string>("MaterialDB Filename","materials.xml","Filename of material database xml file");
00116 
00117   return validPL;
00118 }
00119 

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