Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Albany_CahnHillProblem.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
00015
00016 Albany::CahnHillProblem::
00017 CahnHillProblem( const Teuchos::RCP<Teuchos::ParameterList>& params_,
00018 const Teuchos::RCP<ParamLib>& paramLib_,
00019 const int numDim_,
00020 const Teuchos::RCP<const Epetra_Comm>& comm_) :
00021 Albany::AbstractProblem(params_, paramLib_, 2),
00022 numDim(numDim_),
00023 haveNoise(false),
00024 comm(comm_)
00025 {
00026 }
00027
00028 Albany::CahnHillProblem::
00029 ~CahnHillProblem()
00030 {
00031 }
00032
00033 void
00034 Albany::CahnHillProblem::
00035 buildProblem(
00036 Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> > meshSpecs,
00037 Albany::StateManager& stateMgr)
00038 {
00039
00040 TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00041
00042 fm.resize(1);
00043 fm[0] = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00044 buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM,
00045 Teuchos::null);
00046
00047 if(meshSpecs[0]->nsNames.size() > 0)
00048
00049 constructDirichletEvaluators(meshSpecs[0]->nsNames);
00050
00051 }
00052
00053 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00054 Albany::CahnHillProblem::
00055 buildEvaluators(
00056 PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00057 const Albany::MeshSpecsStruct& meshSpecs,
00058 Albany::StateManager& stateMgr,
00059 Albany::FieldManagerChoice fmchoice,
00060 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00061 {
00062
00063
00064 ConstructEvaluatorsOp<CahnHillProblem> op(
00065 *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00066 boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00067 return *op.tags;
00068 }
00069
00070
00071 void
00072 Albany::CahnHillProblem::constructDirichletEvaluators(const std::vector<std::string>& nodeSetIDs)
00073 {
00074
00075 std::vector<std::string> bcNames(neq);
00076 bcNames[0] = "rho";
00077 Albany::BCUtils<Albany::DirichletTraits> bcUtils;
00078 dfm = bcUtils.constructBCEvaluators(nodeSetIDs, bcNames,
00079 this->params, this->paramLib);
00080 }
00081
00082 Teuchos::RCP<const Teuchos::ParameterList>
00083 Albany::CahnHillProblem::getValidProblemParameters() const
00084 {
00085 Teuchos::RCP<Teuchos::ParameterList> validPL =
00086 this->getGenericProblemParams("ValidCahnHillProblemParams");
00087
00088 Teuchos::Array<int> defaultPeriod;
00089
00090 validPL->set<double>("b", 0.0, "b value in equation 1.1");
00091 validPL->set<double>("gamma", 0.0, "gamma value in equation 2.2");
00092 validPL->set<double>("Langevin Noise SD", 0.0, "Standard deviation of the Langevin noise to apply");
00093 validPL->set<Teuchos::Array<int> >("Langevin Noise Time Period", defaultPeriod,
00094 "Time period to apply Langevin noise");
00095 validPL->set<bool>("Lump Mass", true, "Lump mass matrix in time derivative term");
00096
00097 return validPL;
00098 }
00099