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_RandomFracture_hpp) 00009 #define AAdapt_RandomFracture_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 RandomFracture : public AbstractAdapter { 00031 public: 00032 00036 RandomFracture(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 ~RandomFracture(); 00045 00050 virtual 00051 bool 00052 queryAdaptationCriteria(); 00053 00058 virtual 00059 bool 00060 adaptMesh(const Epetra_Vector& solution, const Epetra_Vector& ovlp_solution); 00061 00065 virtual 00066 void 00067 solutionTransfer(const Epetra_Vector& oldSolution, 00068 Epetra_Vector& newSolution); 00069 00073 Teuchos::RCP<const Teuchos::ParameterList> 00074 getValidAdapterParameters() const; 00075 00076 private: 00077 00081 RandomFracture(); 00082 RandomFracture(const RandomFracture&); 00083 RandomFracture& operator=(const RandomFracture&); 00084 00085 void showTopLevelRelations(); 00086 00090 void showElemToNodes(); 00091 00095 void showRelations(); 00096 void showRelations(int level, const stk::mesh::Entity& ent); 00097 00102 int accumulateFractured(int num_fractured); 00103 00106 void getGlobalOpenList(std::map<stk::mesh::EntityKey, bool>& local_entity_open, 00107 std::map<stk::mesh::EntityKey, bool>& global_entity_open); 00108 00109 // Build topology object from ../LCM/utils/topology.h 00110 00114 stk::mesh::BulkData* bulk_data_; 00115 00119 stk::mesh::fem::FEMMetaData* meta_data_; 00120 00121 Teuchos::RCP<Albany::AbstractSTKMeshStruct> stk_mesh_struct_; 00122 00123 Teuchos::RCP<Albany::AbstractDiscretization> discretization_; 00124 00125 Albany::STKDiscretization* stk_discretization_; 00126 00127 stk::mesh::EntityRank node_rank_; 00128 stk::mesh::EntityRank edge_rank_; 00129 stk::mesh::EntityRank face_rank_; 00130 stk::mesh::EntityRank element_rank_; 00131 00132 Teuchos::RCP<LCM::AbstractFractureCriterion> fracture_criterion_; 00133 Teuchos::RCP<LCM::Topology> topology_; 00134 00136 std::vector<stk::mesh::Entity*> fractured_faces_; 00137 00140 00141 std::vector<std::vector<stk::mesh::Entity*> > old_elem_to_node_; 00142 00144 std::vector<std::vector<stk::mesh::Entity*> > new_elem_to_node_; 00145 00146 int num_dim_; 00147 int remesh_file_index_; 00148 std::string base_exo_filename_; 00149 00150 int fracture_interval_; 00151 double fracture_probability_; 00152 }; 00153 00154 } 00155 00156 #endif //ALBANY_RANDOM_HPP