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

Albany_AbstractProblem.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 #include "Albany_AbstractProblem.hpp"
00007 
00008 // Generic implementations that can be used by derived problems
00009 
00010 Albany::AbstractProblem::AbstractProblem(
00011          const Teuchos::RCP<Teuchos::ParameterList>& params_,
00012          const Teuchos::RCP<ParamLib>& paramLib_,
00013          const int neq_) :
00014   out(Teuchos::VerboseObjectBase::getDefaultOStream()),
00015   neq(neq_),
00016   params(params_),
00017   paramLib(paramLib_),
00018   rigidBodyModes(Teuchos::rcp(new Piro::MLRigidBodyModes(neq_)))
00019 {}
00020 
00021 unsigned int 
00022 Albany::AbstractProblem::numEquations() const 
00023 {
00024   TEUCHOS_TEST_FOR_EXCEPTION( neq <= 0,
00025                     Teuchos::Exceptions::InvalidParameter,
00026                     "A Problem must have at least 1 equation: "<<neq);
00027   return neq;
00028 }
00029 
00030 void
00031 Albany::AbstractProblem::setNumEquations(const int neq_)
00032 { 
00033   neq = neq_; 
00034   rigidBodyModes->setNumPDEs(neq_);
00035 }
00036 
00037 
00038 Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > >
00039 Albany::AbstractProblem::getFieldManager()
00040 { return fm; }
00041 
00042 Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> >
00043 Albany::AbstractProblem::getDirichletFieldManager()
00044 { return dfm; }
00045 
00046 Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > >
00047 Albany::AbstractProblem::getNeumannFieldManager()
00048 { return nfm; }
00049 
00050 Teuchos::RCP<Teuchos::ParameterList>
00051 Albany::AbstractProblem::getGenericProblemParams(std::string listname) const
00052 {
00053   Teuchos::RCP<Teuchos::ParameterList> validPL =
00054      Teuchos::rcp(new Teuchos::ParameterList(listname));;
00055   validPL->set<std::string>("Name", "", "String to designate Problem Class");
00056   validPL->set<int>("Number of Spatial Processors", -1, "Number of spatial processors in multi-level parallelism");
00057   validPL->set<bool>("Enable Cubit Shape Parameters", false, "Flag to enable shape change capability");
00058   validPL->set<std::string>("Cubit Base Filename", "", "Base name of three Cubit files");
00059   validPL->set<int>("Phalanx Graph Visualization Detail", 0,
00060                     "Flag to select outpuy of Phalanx Graph and level of detail");
00061   validPL->set<bool>("Use Physics-Based Preconditioner", false, 
00062       "Flag to create signal that this problem will creat its own preconditioner");
00063 
00064   validPL->sublist("Initial Condition", false, "");
00065   validPL->sublist("Initial Condition Dot", false, "");
00066   validPL->sublist("Source Functions", false, "");
00067   validPL->sublist("Absorption", false, "");
00068   validPL->sublist("Response Functions", false, "");
00069   validPL->sublist("Parameters", false, "");
00070   validPL->sublist("Teko", false, "");
00071   validPL->sublist("Dirichlet BCs", false, "");
00072   validPL->sublist("Neumann BCs", false, "");
00073   validPL->sublist("Adaptation", false, "");
00074   validPL->sublist("Catalyst", false, "");
00075   validPL->set<bool>("Solve Adjoint", false, "");
00076 
00077   validPL->set<bool>("Ignore Residual In Jacobian", false, 
00078          "Ignore residual calculations while computing the Jacobian (only generally appropriate for linear problems)");
00079   validPL->set<double>("Perturb Dirichlet", 0.0, 
00080          "Add this (small) perturbation to the diagonal to prevent Mass Matrices from being singular for Dirichlets)");
00081 
00082   validPL->sublist("Model Order Reduction", false, "Specify the options relative to model order reduction");
00083 
00084   // Candidates for deprecation. Pertain to the solution rather than the problem definition.
00085   validPL->set<std::string>("Solution Method", "Steady", "Flag for Steady, Transient, or Continuation");
00086   validPL->set<double>("Homotopy Restart Step", 1., "Flag for Felix Homotopy Restart Step");
00087   validPL->set<std::string>("Second Order", "No", "Flag to indicate that a transient problem has two time derivs");
00088   validPL->set<bool>("Print Response Expansion", true, "");
00089 
00090   // Deprecated parameters, kept solely for backward compatibility
00091   validPL->set<bool>("Compute Sensitivities", true, "Deprecated; Use parameter located under \"Piro\"/\"Analysis\"/\"Solve\" instead.");
00092   validPL->set<bool>("Stochastic", false, "Deprecated; Unused; Run using AlbanySG executable and specify SG parameters under \"Piro\"");
00093   validPL->sublist("Stochastic Galerkin", false, "Deprecated; Unused; Run using AlbanySG executable and specify SG parameters under \"Piro\"");
00094 
00095   return validPL;
00096 }

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