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 00008 #ifndef AADAPT_STKADAPT_HPP 00009 #define AADAPT_STKADAPT_HPP 00010 00011 #include "Teuchos_RCP.hpp" 00012 #include "Teuchos_ParameterList.hpp" 00013 00014 #include "AAdapt_AbstractAdapter.hpp" 00015 #include "Albany_GenericSTKMeshStruct.hpp" 00016 #include "Albany_STKDiscretization.hpp" 00017 00018 #include "Phalanx.hpp" 00019 #include "PHAL_Workset.hpp" 00020 #include "PHAL_Dimension.hpp" 00021 00022 #include "AAdapt_STKUnifSizeField.hpp" 00023 #include "UniformRefinerPattern.hpp" 00024 00025 namespace AAdapt { 00026 00027 template<class SizeField> 00028 00029 class STKAdapt : public AbstractAdapter { 00030 public: 00031 00032 STKAdapt(const Teuchos::RCP<Teuchos::ParameterList>& params_, 00033 const Teuchos::RCP<ParamLib>& paramLib_, 00034 Albany::StateManager& StateMgr_, 00035 const Teuchos::RCP<const Epetra_Comm>& comm_); 00037 ~STKAdapt(); 00038 00040 virtual bool queryAdaptationCriteria(); 00041 00043 virtual bool adaptMesh(const Epetra_Vector& solution, const Epetra_Vector& ovlp_solution); 00044 00046 virtual void solutionTransfer(const Epetra_Vector& oldSolution, 00047 Epetra_Vector& newSolution); 00048 00050 Teuchos::RCP<const Teuchos::ParameterList> getValidAdapterParameters() const; 00051 00052 private: 00053 00054 // Disallow copy and assignment 00055 STKAdapt(const STKAdapt&); 00056 STKAdapt& operator=(const STKAdapt&); 00057 00058 void printElementData(); 00059 00060 int numDim; 00061 int remeshFileIndex; 00062 std::string base_exo_filename; 00063 00064 00065 Teuchos::RCP<Albany::GenericSTKMeshStruct> genericMeshStruct; 00066 00067 Teuchos::RCP<Albany::AbstractDiscretization> disc; 00068 00069 Albany::STKDiscretization* stk_discretization; 00070 00071 Teuchos::RCP<stk::percept::PerceptMesh> eMesh; 00072 Teuchos::RCP<stk::adapt::UniformRefinerPatternBase> refinerPattern; 00073 00074 int num_iterations; 00075 00076 const Epetra_Vector* solution; 00077 const Epetra_Vector* ovlp_solution; 00078 00079 }; 00080 00081 } 00082 00083 // Define macros for explicit template instantiation 00084 #define STKADAPT_INSTANTIATE_TEMPLATE_CLASS_UNIFREFINE(name) \ 00085 template class name<AAdapt::STKUnifRefineField>; 00086 00087 #define STKADAPT_INSTANTIATE_TEMPLATE_CLASS(name) \ 00088 STKADAPT_INSTANTIATE_TEMPLATE_CLASS_UNIFREFINE(name) 00089 00090 00091 #endif //ALBANY_STKADAPT_HPP