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

FELIX_StokesL1L2.cpp

Go to the documentation of this file.
00001 /********************************************************************\
00002 *            Albany, Copyright (2010) Sandia Corporation             *
00003 *                                                                    *
00004 * Notice: This computer software was prepared by Sandia Corporation, *
00005 * hereinafter the Contractor, under Contract DE-AC04-94AL85000 with  *
00006 * the Department of Energy (DOE). All rights in the computer software*
00007 * are reserved by DOE on behalf of the United States Government and  *
00008 * the Contractor as provided in the Contract. You are authorized to  *
00009 * use this computer software for Governmental purposes but it is not *
00010 * to be released or distributed to the public. NEITHER THE GOVERNMENT*
00011 * NOR THE CONTRACTOR MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR      *
00012 * ASSUMES ANY LIABILITY L1L2R THE USE OF THIS SOFTWARE. This notice    *
00013 * including this sentence must appear on any copies of this software.*
00014 *    Questions to Andy Salinger, agsalin@sandia.gov                  *
00015 \********************************************************************/
00016 
00017 
00018 #include "FELIX_StokesL1L2.hpp"
00019 
00020 #include "Intrepid_FieldContainer.hpp"
00021 #include "Intrepid_DefaultCubatureFactory.hpp"
00022 #include "Shards_CellTopology.hpp"
00023 #include "PHAL_FactoryTraits.hpp"
00024 #include "Albany_Utils.hpp"
00025 #include "Albany_ProblemUtils.hpp"
00026 #include <string>
00027 
00028 
00029 FELIX::StokesL1L2::
00030 StokesL1L2( const Teuchos::RCP<Teuchos::ParameterList>& params_,
00031              const Teuchos::RCP<ParamLib>& paramLib_,
00032              const int numDim_) :
00033   Albany::AbstractProblem(params_, paramLib_),
00034   numDim(numDim_)
00035 {
00036   neq = 2; //there are 2 PDEs for L1L2 equations
00037 
00038   // Set the num PDEs for the null space object to pass to ML
00039   this->rigidBodyModes->setNumPDEs(neq);
00040 
00041   // Need to allocate a surface height and temperature fields in mesh database
00042   this->requirements.push_back("Surface Height");
00043   this->requirements.push_back("Temperature");
00044   this->requirements.push_back("Flow Factor");
00045 
00046 }
00047 
00048 FELIX::StokesL1L2::
00049 ~StokesL1L2()
00050 {
00051 }
00052 
00053 void
00054 FELIX::StokesL1L2::
00055 buildProblem(
00056   Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00057   Albany::StateManager& stateMgr)
00058 {
00059   using Teuchos::rcp;
00060 
00061   std::cout << "In StokesL1L2 Problem!" << std::endl; 
00062 
00063  /* Construct All Phalanx Evaluators */
00064   TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00065   fm.resize(1);
00066   fm[0]  = rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00067   buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, Albany::BUILD_RESID_FM, 
00068       Teuchos::null);
00069   constructDirichletEvaluators(*meshSpecs[0]);
00070 }
00071 
00072 Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00073 FELIX::StokesL1L2::
00074 buildEvaluators(
00075   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00076   const Albany::MeshSpecsStruct& meshSpecs,
00077   Albany::StateManager& stateMgr,
00078   Albany::FieldManagerChoice fmchoice,
00079   const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00080 {
00081   // Call constructeEvaluators<EvalT>(*rfm[0], *meshSpecs[0], stateMgr);
00082   // for each EvalT in PHAL::AlbanyTraits::BEvalTypes
00083   Albany::ConstructEvaluatorsOp<StokesL1L2> op(
00084     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00085   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00086   return *op.tags;
00087 }
00088 
00089 void
00090 FELIX::StokesL1L2::constructDirichletEvaluators(
00091         const Albany::MeshSpecsStruct& meshSpecs)
00092 {
00093    // Construct Dirichlet evaluators for all nodesets and names
00094    std::vector<std::string> dirichletNames(neq);
00095    for (int i=0; i<neq; i++) {
00096      std::stringstream s; s << "U" << i;
00097      dirichletNames[i] = s.str();
00098    }
00099    Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00100    dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00101                                           this->params, this->paramLib);
00102 }
00103 
00104 Teuchos::RCP<const Teuchos::ParameterList>
00105 FELIX::StokesL1L2::getValidProblemParameters() const
00106 {
00107   Teuchos::RCP<Teuchos::ParameterList> validPL =
00108     this->getGenericProblemParams("ValidStokesL1L2ProblemParams");
00109 
00110   validPL->sublist("FELIX Viscosity", false, "");
00111   validPL->sublist("Body Force", false, "");
00112   return validPL;
00113 }
00114 

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