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 AADAPT_ADAPTIVESOLUTIONMANAGER 00008 #define AADAPT_ADAPTIVESOLUTIONMANAGER 00009 00010 #include "Piro_Epetra_AdaptiveSolutionManager.hpp" 00011 #include "Piro_SolutionObserverBase.hpp" 00012 #include "Albany_AbstractDiscretization.hpp" 00013 #include "AAdapt_AdaptiveModelFactory.hpp" 00014 #include "AAdapt_SolutionObserver.hpp" 00015 00016 #include "Sacado_ScalarParameterLibrary.hpp" 00017 #include "Albany_StateManager.hpp" 00018 00019 00020 namespace AAdapt { 00021 00022 typedef Teuchos::RCP<Piro::SolutionObserverBase<double, const Thyra::VectorBase<double> > > AdaptSolutionObserverType; 00023 00024 class AdaptiveSolutionManager : public Piro::Epetra::AdaptiveSolutionManager { 00025 00026 public: 00027 AdaptiveSolutionManager( 00028 const Teuchos::RCP<Teuchos::ParameterList>& appParams, 00029 const Teuchos::RCP<Albany::AbstractDiscretization>& disc_, 00030 const Teuchos::RCP<const Epetra_Vector>& initial_guess); 00031 00032 virtual ~AdaptiveSolutionManager(); 00033 00035 void buildAdaptiveProblem(const Teuchos::RCP<ParamLib>& paramLib, 00036 Albany::StateManager& StateMgr, 00037 const Teuchos::RCP<const Epetra_Comm>& comm); 00038 00040 virtual bool adaptProblem(); 00041 00043 virtual Teuchos::RCP<AAdapt::AdaptiveModelFactory> modelFactory() const; 00044 00045 AdaptSolutionObserverType getSolObserver(){ return solutionObserver; } 00046 // Teuchos::RCP<SolutionObserver> getSolObserver(){ return solutionObserver; } 00047 00049 virtual void 00050 projectCurrentSolution(); 00051 00052 void scatterX(const Epetra_Vector& x, const Epetra_Vector* xdot, const Epetra_Vector* xdotdot); 00053 00054 00055 protected: 00056 00058 Teuchos::RCP<Albany::AbstractDiscretization> disc; 00059 00061 Teuchos::RCP<Teuchos::FancyOStream> out; 00062 00064 Teuchos::RCP<AAdapt::AdaptiveModelFactory> thyra_model_factory; 00065 00066 // AdaptSolutionObserverType solutionObserver; 00067 Teuchos::RCP<SolutionObserver> solutionObserver; 00068 00069 }; 00070 00071 } 00072 00073 #endif //ALBANY_ADAPTIVESOLUTIONMANAGER 00074 00075