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

LaplaceBeltramiProblem.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 "LaplaceBeltramiProblem.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::LaplaceBeltramiProblem::
00017 LaplaceBeltramiProblem(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_),
00022   numDim(numDim_),
00023   comm(comm_) {
00024 
00025   std::string& method = params_->get("Method", "Laplace");
00026 
00027   if(method == "LaplaceBeltrami" ||
00028          method == "DispLaplaceBeltrami") // Two DOF vectors per node - solution and target solution
00029 
00030      this->setNumEquations(2 * numDim_);
00031 
00032   else
00033 
00034      this->setNumEquations(numDim_);
00035 
00036   // Ask the discretization to initialize the problem by copying the mesh coordinates into the initial guess
00037   //this->requirements.push_back("Initial Guess Coords");
00038 
00039 }
00040 
00041 Albany::LaplaceBeltramiProblem::
00042 ~LaplaceBeltramiProblem() {
00043 }
00044 
00045 void
00046 Albany::LaplaceBeltramiProblem::
00047 buildProblem(
00048   Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00049   Albany::StateManager& stateMgr) {
00050 
00051   /* Construct All Phalanx Evaluators */
00052   int physSets = meshSpecs.size();
00053   std::cout << "LaplaceBeltrami Problem Num MeshSpecs: " << physSets << std::endl;
00054   fm.resize(physSets);
00055 
00056   for(int ps = 0; ps < physSets; ps++) {
00057     fm[ps]  = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00058     buildEvaluators(*fm[ps], *meshSpecs[ps], stateMgr, BUILD_RESID_FM,
00059                     Teuchos::null);
00060   }
00061 
00062 
00063 
00064   if(meshSpecs[0]->nsNames.size() > 0) // Build a nodeset evaluator if nodesets are present
00065 
00066     constructDirichletEvaluators(meshSpecs[0]->nsNames);
00067 
00068 
00069 }
00070 
00071 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00072 Albany::LaplaceBeltramiProblem::
00073 buildEvaluators(
00074   PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00075   const Albany::MeshSpecsStruct& meshSpecs,
00076   Albany::StateManager& stateMgr,
00077   Albany::FieldManagerChoice fmchoice,
00078   const Teuchos::RCP<Teuchos::ParameterList>& responseList) {
00079 
00080   ConstructEvaluatorsOp<LaplaceBeltramiProblem> op(
00081     *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00082   boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00083   return *op.tags;
00084 }
00085 
00086 // Dirichlet BCs
00087 void
00088 Albany::LaplaceBeltramiProblem::constructDirichletEvaluators(const std::vector<std::string>& nodeSetIDs) {
00089   // Construct BC evaluators for all node sets and names
00090   std::vector<std::string> bcNames(numDim);
00091 //  bcNames[0] = "Identity";
00092   bcNames[0] = "X";
00093   if(numDim > 1)
00094     bcNames[1] = "Y";
00095   if(numDim > 2)
00096     bcNames[2] = "Z";
00097 
00098   Albany::BCUtils<Albany::DirichletTraits> bcUtils;
00099   dfm = bcUtils.constructBCEvaluators(nodeSetIDs, bcNames,
00100                                       this->params, this->paramLib, numDim);
00101 }
00102 
00103 
00104 Teuchos::RCP<const Teuchos::ParameterList>
00105 Albany::LaplaceBeltramiProblem::getValidProblemParameters() const {
00106   Teuchos::RCP<Teuchos::ParameterList> validPL =
00107     this->getGenericProblemParams("ValidLaplaceBeltramiProblemParams");
00108 
00109   validPL->set<std::string>("Method", "", "Smoothing method to use");
00110 
00111   return validPL;
00112 }
00113 

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