Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "FELIX_StokesFO.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 FELIX::StokesFO::
00019 StokesFO( 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 neq = 2;
00026
00027
00028 this->rigidBodyModes->setNumPDEs(neq);
00029
00030
00031 this->requirements.push_back("Surface Height");
00032 this->requirements.push_back("Temperature");
00033 this->requirements.push_back("Basal Friction");
00034 this->requirements.push_back("Thickness");
00035 this->requirements.push_back("Flow Factor");
00036 this->requirements.push_back("Surface Velocity");
00037 this->requirements.push_back("Velocity RMS");
00038 }
00039
00040 FELIX::StokesFO::
00041 ~StokesFO()
00042 {
00043 }
00044
00045 void
00046 FELIX::StokesFO::
00047 buildProblem(
00048 Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> > meshSpecs,
00049 Albany::StateManager& stateMgr)
00050 {
00051 using Teuchos::rcp;
00052
00053
00054 TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00055 fm.resize(1);
00056 fm[0] = rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00057 buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, Albany::BUILD_RESID_FM,
00058 Teuchos::null);
00059 constructDirichletEvaluators(*meshSpecs[0]);
00060
00061 if(meshSpecs[0]->ssNames.size() > 0)
00062 constructNeumannEvaluators(meshSpecs[0]);
00063 }
00064
00065 Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00066 FELIX::StokesFO::
00067 buildEvaluators(
00068 PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00069 const Albany::MeshSpecsStruct& meshSpecs,
00070 Albany::StateManager& stateMgr,
00071 Albany::FieldManagerChoice fmchoice,
00072 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00073 {
00074
00075
00076 Albany::ConstructEvaluatorsOp<StokesFO> op(
00077 *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00078 boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00079 return *op.tags;
00080 }
00081
00082 void
00083 FELIX::StokesFO::constructDirichletEvaluators(
00084 const Albany::MeshSpecsStruct& meshSpecs)
00085 {
00086
00087 std::vector<std::string> dirichletNames(neq);
00088 for (int i=0; i<neq; i++) {
00089 std::stringstream s; s << "U" << i;
00090 dirichletNames[i] = s.str();
00091 }
00092 Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00093 dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00094 this->params, this->paramLib);
00095 }
00096
00097
00098 void
00099 FELIX::StokesFO::constructNeumannEvaluators(const Teuchos::RCP<Albany::MeshSpecsStruct>& meshSpecs)
00100 {
00101
00102
00103
00104
00105 Albany::BCUtils<Albany::NeumannTraits> nbcUtils;
00106
00107
00108
00109 if(!nbcUtils.haveBCSpecified(this->params)) {
00110 return;
00111 }
00112
00113
00114
00115
00116
00117 std::vector<std::string> neumannNames(neq + 1);
00118 Teuchos::Array<Teuchos::Array<int> > offsets;
00119 offsets.resize(neq + 1);
00120
00121 neumannNames[0] = "U0";
00122 offsets[0].resize(1);
00123 offsets[0][0] = 0;
00124 offsets[neq].resize(neq);
00125 offsets[neq][0] = 0;
00126
00127 if (neq>1){
00128 neumannNames[1] = "U1";
00129 offsets[1].resize(1);
00130 offsets[1][0] = 1;
00131 offsets[neq][1] = 1;
00132 }
00133
00134 if (neq>2){
00135 neumannNames[2] = "U2";
00136 offsets[2].resize(1);
00137 offsets[2][0] = 2;
00138 offsets[neq][2] = 2;
00139 }
00140
00141 neumannNames[neq] = "all";
00142
00143
00144
00145 std::vector<std::string> condNames(5);
00146 Teuchos::ArrayRCP<std::string> dof_names(1);
00147 dof_names[0] = "Velocity";
00148
00149
00150 if(numDim == 2)
00151 condNames[0] = "(dFluxdx, dFluxdy)";
00152 else if(numDim == 3)
00153 condNames[0] = "(dFluxdx, dFluxdy, dFluxdz)";
00154 else
00155 TEUCHOS_TEST_FOR_EXCEPTION(true, Teuchos::Exceptions::InvalidParameter,
00156 std::endl << "Error: Sidesets only supported in 2 and 3D." << std::endl);
00157
00158 condNames[1] = "dFluxdn";
00159 condNames[2] = "basal";
00160 condNames[3] = "P";
00161 condNames[4] = "lateral";
00162
00163 nfm.resize(1);
00164
00165 nfm[0] = nbcUtils.constructBCEvaluators(meshSpecs, neumannNames, dof_names, true, 0,
00166 condNames, offsets, dl,
00167 this->params, this->paramLib);
00168
00169
00170 }
00171
00172 Teuchos::RCP<const Teuchos::ParameterList>
00173 FELIX::StokesFO::getValidProblemParameters() const
00174 {
00175 Teuchos::RCP<Teuchos::ParameterList> validPL =
00176 this->getGenericProblemParams("ValidStokesFOProblemParams");
00177
00178 validPL->sublist("FELIX Viscosity", false, "");
00179 validPL->sublist("Equation Set", false, "");
00180 validPL->sublist("Body Force", false, "");
00181 return validPL;
00182 }
00183