Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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;
00037
00038
00039 this->rigidBodyModes->setNumPDEs(neq);
00040
00041
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
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
00082
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
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