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 #if !defined(AAdapt_TopologyMOdification_hpp) 00009 #define AAdapt_TopologyMOdification_hpp 00010 00011 #include <Teuchos_RCP.hpp> 00012 #include <Teuchos_ParameterList.hpp> 00013 00014 #include <Phalanx.hpp> 00015 #include <PHAL_Workset.hpp> 00016 #include <PHAL_Dimension.hpp> 00017 00018 #include "AAdapt_AbstractAdapter.hpp" 00019 // Uses LCM Topology util class 00020 // Note that all topology functions are in Albany::LCM namespace 00021 #include "Topology.h" 00022 #include "Fracture.h" 00023 #include "Albany_STKDiscretization.hpp" 00024 00025 namespace AAdapt { 00026 00030 class TopologyMod : public AbstractAdapter { 00031 public: 00032 00036 TopologyMod(const Teuchos::RCP<Teuchos::ParameterList>& params_, 00037 const Teuchos::RCP<ParamLib>& paramLib_, 00038 Albany::StateManager& StateMgr_, 00039 const Teuchos::RCP<const Epetra_Comm>& comm_); 00040 00044 ~TopologyMod(); 00045 00050 virtual 00051 bool 00052 queryAdaptationCriteria(); 00053 00057 virtual 00058 bool 00059 adaptMesh(const Epetra_Vector& solution, const Epetra_Vector& ovlp_solution); 00060 00064 virtual 00065 void 00066 solutionTransfer(const Epetra_Vector& old_solution, 00067 Epetra_Vector& new_solution); 00068 00072 Teuchos::RCP<const Teuchos::ParameterList> 00073 getValidAdapterParameters() const; 00074 00075 private: 00076 00080 TopologyMod(); 00081 TopologyMod(const TopologyMod&); 00082 TopologyMod& operator=(const TopologyMod&); 00083 00087 void showElemToNodes(); 00088 00092 void showRelations(); 00093 00097 int accumulateFractured(int num_fractured); 00098 00103 std::vector<std::vector<double> > avg_stresses_; 00104 00107 void getGlobalOpenList(std::map<stk::mesh::EntityKey, bool>& local_entity_open, 00108 std::map<stk::mesh::EntityKey, bool>& global_entity_open); 00109 00113 stk::mesh::BulkData* bulk_data_; 00114 00115 Teuchos::RCP<Albany::AbstractSTKMeshStruct> stk_mesh_struct_; 00116 00117 Teuchos::RCP<Albany::AbstractDiscretization> discretization_; 00118 00119 Albany::STKDiscretization* stk_discretization_; 00120 00121 stk::mesh::fem::FEMMetaData* meta_data_; 00122 00123 stk::mesh::EntityRank node_rank_; 00124 stk::mesh::EntityRank edge_rank_; 00125 stk::mesh::EntityRank face_rank_; 00126 stk::mesh::EntityRank element_rank_; 00127 00128 Teuchos::RCP<LCM::AbstractFractureCriterion> fracture_criterion_; 00129 Teuchos::RCP<LCM::Topology> topology_; 00130 00132 std::vector<stk::mesh::Entity*> fractured_faces_; 00133 00136 00137 std::vector<std::vector<stk::mesh::Entity*> > old_elem_to_node_; 00138 00140 std::vector<std::vector<stk::mesh::Entity*> > new_elem_to_node_; 00141 00142 int num_dim_; 00143 int remesh_file_index_; 00144 std::string base_exo_filename_; 00145 00146 }; 00147 00148 } 00149 00150 #endif //ALBANY_TOPOLOGYMOD_HPP