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

Albany_Helmholtz2DProblem.cpp

Go to the documentation of this file.
00001 //*****************************************************************//
00002 //    Albany 2.0:  Copyright 2012 Sandia Corporation               //
00003 //    This Software is released under the BSD license detailed     //
00004 //    in the file "license.txt" in the top-level Albany directory  //
00005 //*****************************************************************//
00006 
00007 #include "Albany_Helmholtz2DProblem.hpp"
00008 #include "Albany_Utils.hpp"
00009 #include "Albany_ProblemUtils.hpp"
00010 
00011 Albany::Helmholtz2DProblem::
00012 Helmholtz2DProblem(
00013                          const Teuchos::RCP<Teuchos::ParameterList>& params_,
00014                          const Teuchos::RCP<ParamLib>& paramLib_) :
00015   Albany::AbstractProblem(params_, paramLib_, 2)
00016 {
00017 
00018   std::string& method = params->get("Name", "Helmholtz 2D Problem");
00019   *out << "Problem Name = " << method << std::endl;
00020   
00021   ksqr = params->get<double>("Ksqr",1.0);
00022 
00023   haveSource =  params->isSublist("Source Functions");
00024 }
00025 
00026 Albany::Helmholtz2DProblem::
00027 ~Helmholtz2DProblem()
00028 {
00029 }
00030 
00031 void
00032 Albany::Helmholtz2DProblem::
00033 buildProblem(
00034    Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00035    Albany::StateManager& stateMgr)
00036 {
00037   /* Construct All Phalanx Evaluators */
00038   TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00039   fm.resize(1);
00040   fm[0]  = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00041   buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM, 
00042       Teuchos::null);
00043   constructDirichletEvaluators(*meshSpecs[0]);
00044 }
00045 
00046 Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >
00047 Albany::Helmholtz2DProblem::
00048 buildEvaluators(
00049   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00050   const Albany::MeshSpecsStruct& meshSpecs,
00051   Albany::StateManager& stateMgr,
00052   Albany::FieldManagerChoice fmchoice,
00053   const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00054 {
00055   // Call constructeEvaluators<EvalT>(*rfm[0], *meshSpecs[0], stateMgr);
00056   // for each EvalT in PHAL::AlbanyTraits::BEvalTypes
00057   ConstructEvaluatorsOp<Helmholtz2DProblem> op(
00058     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00059   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00060   return *op.tags;
00061 }
00062 
00063 void
00064 Albany::Helmholtz2DProblem::constructDirichletEvaluators(
00065         const Albany::MeshSpecsStruct& meshSpecs)
00066 {
00067    // Construct Dirichlet evaluators for all nodesets and names
00068    std::vector<std::string> dirichletNames(neq);
00069    dirichletNames[0] = "U";
00070    dirichletNames[1] = "V";
00071    Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00072    dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00073                                           this->params, this->paramLib);
00074 }
00075 
00076 Teuchos::RCP<const Teuchos::ParameterList>
00077 Albany::Helmholtz2DProblem::getValidProblemParameters() const
00078 {
00079   Teuchos::RCP<Teuchos::ParameterList> validPL =
00080     this->getGenericProblemParams("ValidHelmhotz2DProblemParams");
00081   validPL->set<double>("Left BC", 0.0, "Value of Left BC [required]");
00082   validPL->set<double>("Right BC", 0.0, "Value to Right BC [required]");
00083   validPL->set<double>("Top BC", 0.0, "Value of Top BC [required]");
00084   validPL->set<double>("Bottom BC", 0.0, "Value to Bottom BC [required]");
00085   validPL->set<double>("Ksqr", 1.0, "Value of wavelength-squared [required]");
00086 
00087   return validPL;
00088 }

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