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

Albany_AbstractProblem.hpp

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 #ifndef ALBANY_ABSTRACTPROBLEM_HPP
00008 #define ALBANY_ABSTRACTPROBLEM_HPP
00009 
00010 #include <vector>
00011 #include <string>
00012 
00013 #include "Teuchos_RCP.hpp"
00014 #include "Teuchos_ParameterList.hpp"
00015 #include "Epetra_Map.h"
00016 #include "Epetra_Vector.h"
00017 
00018 #include "Albany_StateManager.hpp"
00019 #include "Albany_StateInfoStruct.hpp" // contains MeshSpecsStuct
00020 #include "Albany_AbstractFieldContainer.hpp" //has typedef needed to list the field requirements of the problem
00021 #include "Piro_NullSpaceUtils.hpp" // has defn of struct that holds null space info for ML
00022 
00023 #include "Phalanx.hpp"
00024 #include "Albany_DataTypes.hpp"
00025 #include "Albany_BCUtils.hpp"
00026 
00027 #include "PHAL_AlbanyTraits.hpp"
00028 #include "PHAL_Workset.hpp"
00029 #include "PHAL_Dimension.hpp"
00030 
00031 #include "Teuchos_VerboseObject.hpp"
00032 #include <Intrepid_FieldContainer.hpp>
00033 
00034 #include "Intrepid_HGRAD_LINE_C1_FEM.hpp"
00035 #include "Intrepid_HGRAD_LINE_Cn_FEM.hpp"
00036 #include "Intrepid_HGRAD_QUAD_C1_FEM.hpp"
00037 #include "Intrepid_HGRAD_QUAD_C2_FEM.hpp"
00038 #include "Intrepid_HGRAD_TRI_C1_FEM.hpp"
00039 #include "Intrepid_HGRAD_TRI_C2_FEM.hpp"
00040 #include "Intrepid_HGRAD_HEX_C1_FEM.hpp"
00041 #include "Intrepid_HGRAD_HEX_C2_FEM.hpp"
00042 #include "Intrepid_HGRAD_TET_C1_FEM.hpp"
00043 #include "Intrepid_HGRAD_TET_C2_FEM.hpp"
00044 #include "Intrepid_HGRAD_TET_COMP12_FEM.hpp"
00045 #include "Intrepid_FieldContainer.hpp"
00046 #include "Intrepid_DefaultCubatureFactory.hpp"
00047 #include "Shards_CellTopology.hpp"
00048 #include "PHAL_FactoryTraits.hpp"
00049 
00050 
00051 namespace Albany {
00052 
00053   class Application;
00054 
00055   enum FieldManagerChoice {BUILD_RESID_FM, BUILD_RESPONSE_FM, BUILD_STATE_FM};
00056 
00061   class AbstractProblem {
00062   public:
00063   
00065     AbstractProblem( const Teuchos::RCP<Teuchos::ParameterList>& params_,
00066                      const Teuchos::RCP<ParamLib>& paramLib_,
00067                      const int neq_ = 0);
00068 
00070     virtual ~AbstractProblem() {};
00071 
00073     unsigned int numEquations() const;
00074     void setNumEquations(const int neq_);
00075     unsigned int numStates() const;
00076 
00078     virtual int spatialDimension() const = 0;
00079 
00082     virtual void buildProblem(
00083       Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> >  meshSpecs,
00084       StateManager& stateMgr) = 0;
00085 
00086     // Build evaluators
00087     virtual Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> > 
00088     buildEvaluators(
00089       PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00090       const Albany::MeshSpecsStruct& meshSpecs,
00091       Albany::StateManager& stateMgr,
00092       Albany::FieldManagerChoice fmchoice,
00093       const Teuchos::RCP<Teuchos::ParameterList>& responseList) = 0;
00094 
00095     Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > > getFieldManager();
00096     Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > getDirichletFieldManager() ;
00097     Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > > getNeumannFieldManager();
00098 
00100     const Teuchos::RCP<Piro::MLRigidBodyModes>& getNullSpace(){ return rigidBodyModes; }
00101 
00103     virtual Teuchos::RCP<const Teuchos::ParameterList> getValidProblemParameters() const 
00104       {return getGenericProblemParams("Generic Problem List");};
00105 
00106     virtual void
00107       getAllocatedStates(
00108          Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00109          Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00110          ) const  {};
00111 
00113     const AbstractFieldContainer::FieldContainerRequirements getFieldRequirements(){ return requirements; }
00114 
00115   protected:
00116 
00119     Teuchos::RCP<Teuchos::ParameterList>
00120       getGenericProblemParams(std::string listname = "ProblemList") const;
00121 
00123     Teuchos::RCP<Teuchos::FancyOStream> out;
00124 
00126     unsigned int neq;
00127 
00129     Teuchos::RCP<Teuchos::ParameterList> params;
00130 
00132     Teuchos::RCP<ParamLib> paramLib;
00133 
00135     Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > > fm;
00136 
00138     Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > dfm;
00139 
00141     Teuchos::ArrayRCP<Teuchos::RCP<PHX::FieldManager<PHAL::AlbanyTraits> > > nfm;
00142 
00144     AbstractFieldContainer::FieldContainerRequirements requirements;
00145 
00147     Teuchos::RCP<Piro::MLRigidBodyModes> rigidBodyModes;
00148 
00149   private:
00150 
00152     AbstractProblem();
00153     AbstractProblem(const AbstractProblem&);
00154     
00156     AbstractProblem& operator=(const AbstractProblem&);
00157   };
00158 
00159   template <typename ProblemType>
00160   struct ConstructEvaluatorsOp {
00161     ProblemType& prob;
00162     PHX::FieldManager<PHAL::AlbanyTraits>& fm;
00163     const Albany::MeshSpecsStruct& meshSpecs;
00164     Albany::StateManager& stateMgr;
00165     Albany::FieldManagerChoice fmchoice;
00166     Teuchos::RCP<Teuchos::ParameterList> responseList;
00167     Teuchos::RCP< Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> > > tags;
00168     ConstructEvaluatorsOp(
00169       ProblemType& prob_,
00170       PHX::FieldManager<PHAL::AlbanyTraits>& fm_,
00171       const Albany::MeshSpecsStruct& meshSpecs_,
00172       Albany::StateManager& stateMgr_,
00173       Albany::FieldManagerChoice fmchoice_ = BUILD_RESID_FM,
00174       const Teuchos::RCP<Teuchos::ParameterList>& responseList_ = Teuchos::null)
00175       : prob(prob_), fm(fm_), meshSpecs(meshSpecs_), 
00176   stateMgr(stateMgr_), fmchoice(fmchoice_), responseList(responseList_) {
00177       tags = 
00178   Teuchos::rcp(new Teuchos::Array< Teuchos::RCP<const PHX::FieldTag> >);
00179     }
00180     template <typename T> void operator() (T x) {
00181       tags->push_back(
00182   prob.template constructEvaluators<T>(fm, meshSpecs, stateMgr, 
00183                fmchoice, responseList));
00184     }
00185   };
00186 
00187 }
00188 
00189 #endif // ALBANY_ABSTRACTPROBLEM_HPP

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