Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Albany_LinComprNSProblem.hpp"
00008
00009 #include "Intrepid_FieldContainer.hpp"
00010 #include "Intrepid_DefaultCubatureFactory.hpp"
00011 #include "Shards_CellTopology.hpp"
00012 #include "PHAL_FactoryTraits.hpp"
00013 #include "Albany_Utils.hpp"
00014 #include "Albany_ProblemUtils.hpp"
00015 #include <string>
00016
00017
00018 Albany::LinComprNSProblem::
00019 LinComprNSProblem( const Teuchos::RCP<Teuchos::ParameterList>& params_,
00020 const Teuchos::RCP<ParamLib>& paramLib_,
00021 const int numDim_) :
00022 Albany::AbstractProblem(params_, paramLib_),
00023 numDim(numDim_)
00024 {
00025
00026 neq = params_->get("Number of PDE Equations", numDim);
00027 }
00028
00029 Albany::LinComprNSProblem::
00030 ~LinComprNSProblem()
00031 {
00032 }
00033
00034 void
00035 Albany::LinComprNSProblem::
00036 buildProblem(
00037 Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> > meshSpecs,
00038 Albany::StateManager& stateMgr)
00039 {
00040 using Teuchos::rcp;
00041
00042
00043 TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00044 fm.resize(1);
00045 fm[0] = rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00046 buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM,
00047 Teuchos::null);
00048 constructDirichletEvaluators(*meshSpecs[0]);
00049 }
00050
00051 Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00052 Albany::LinComprNSProblem::
00053 buildEvaluators(
00054 PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00055 const Albany::MeshSpecsStruct& meshSpecs,
00056 Albany::StateManager& stateMgr,
00057 Albany::FieldManagerChoice fmchoice,
00058 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00059 {
00060
00061
00062 ConstructEvaluatorsOp<LinComprNSProblem> op(
00063 *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00064 boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00065 return *op.tags;
00066 }
00067
00068 void
00069 Albany::LinComprNSProblem::constructDirichletEvaluators(
00070 const Albany::MeshSpecsStruct& meshSpecs)
00071 {
00072
00073 std::vector<std::string> dirichletNames(neq);
00074 for (int i=0; i<neq; i++) {
00075 std::stringstream s; s << "qFluct" << i;
00076 dirichletNames[i] = s.str();
00077 }
00078 Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00079 dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00080 this->params, this->paramLib);
00081 }
00082
00083 Teuchos::RCP<const Teuchos::ParameterList>
00084 Albany::LinComprNSProblem::getValidProblemParameters() const
00085 {
00086 Teuchos::RCP<Teuchos::ParameterList> validPL =
00087 this->getGenericProblemParams("ValidLinComprNSProblemParams");
00088
00089 validPL->set("Number of PDE Equations", 1, "Number of PDE Equations in LinComprNS equation set");
00090 validPL->sublist("Body Force", false, "");
00091 validPL->sublist("Equation Set", false, "");
00092
00093 return validPL;
00094 }
00095