|
Sierra Toolkit Version of the Day
|
00001 /*------------------------------------------------------------------------*/ 00002 /* Copyright 2010 Sandia Corporation. */ 00003 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ 00004 /* license for use of this work by or on behalf of the U.S. Government. */ 00005 /* Export of this program may require a license from the */ 00006 /* United States Government. */ 00007 /*------------------------------------------------------------------------*/ 00008 00009 #ifndef stk_mesh_PartImpl_hpp 00010 #define stk_mesh_PartImpl_hpp 00011 00012 //---------------------------------------------------------------------- 00013 00014 #include <iosfwd> 00015 #include <string> 00016 #include <vector> 00017 00018 #include <stk_util/util/CSet.hpp> 00019 #include <stk_mesh/base/Types.hpp> 00020 00021 //---------------------------------------------------------------------- 00022 00023 namespace stk { 00024 namespace mesh { 00025 namespace impl { 00026 00027 class PartImpl { 00028 public: 00029 00033 MetaData & mesh_meta_data() const { return *m_mesh_meta_data ; } 00034 00042 unsigned primary_entity_rank() const { return m_entity_rank ; } 00043 00045 const std::string & name() const { return m_name ; } 00046 00050 unsigned mesh_meta_data_ordinal() const { return m_universe_ordinal ; } 00051 00053 const PartVector & supersets() const { return m_supersets ; } 00054 00056 const PartVector & subsets() const { return m_subsets ; } 00057 00059 const PartVector & intersection_of() const { return m_intersect ; } 00060 00062 const std::vector<PartRelation> & relations() const { return m_relations ; } 00063 00065 bool operator == ( const PartImpl & rhs ) const { return this == & rhs ; } 00066 00068 bool operator != ( const PartImpl & rhs ) const { return this != & rhs ; } 00069 00071 template<class A> 00072 const A * attribute() const { return m_attribute.template get<A>(); } 00073 00074 explicit PartImpl( MetaData * ); 00075 00076 void add_part_to_subset( Part & part); 00077 void add_part_to_superset( Part & part ); 00078 void add_relation( PartRelation relation ); 00079 void set_intersection_of( const PartVector & ); 00080 00081 template<class T> 00082 const T * declare_attribute_with_delete( const T *); 00083 template<class T> 00084 const T * declare_attribute_no_delete( const T *); 00085 00089 PartImpl( MetaData * meta, const std::string & name, 00090 EntityRank rank, size_t ordinal); 00091 00092 ~PartImpl(); 00093 00094 private: 00095 00096 #ifndef DOXYGEN_COMPILE 00097 00098 PartImpl(); 00099 PartImpl( const PartImpl & ); 00100 PartImpl & operator = ( const PartImpl & ); 00101 00102 const std::string m_name ; 00103 CSet m_attribute ; 00104 PartVector m_subsets ; 00105 PartVector m_supersets ; 00106 PartVector m_intersect ; 00107 std::vector<PartRelation> m_relations ; 00108 MetaData * const m_mesh_meta_data ; 00109 const unsigned m_universe_ordinal ; 00110 const unsigned m_entity_rank ; 00111 00112 #endif /* DOXYGEN_COMPILE */ 00113 00114 }; 00115 00116 template<class T> 00117 inline 00118 const T * 00119 PartImpl::declare_attribute_with_delete( const T * a ) 00120 { 00121 return m_attribute.template insert_with_delete<T>( a ); 00122 } 00123 00124 template<class T> 00125 inline 00126 const T * 00127 PartImpl::declare_attribute_no_delete( const T * a ) 00128 { 00129 return m_attribute.template insert_no_delete<T>( a ); 00130 } 00131 00132 } // namespace impl 00133 } // namespace mesh 00134 } // namespace stk 00135 00136 //---------------------------------------------------------------------- 00137 //---------------------------------------------------------------------- 00138 00139 #endif 00140