Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __MEDMEM_MeshFuse_HXX__
00024 #define __MEDMEM_MeshFuse_HXX__
00025
00026 #include "MEDMEM_Meshing.hxx"
00027
00028 #include <vector>
00029 #include <map>
00030 #include <set>
00031
00032 namespace MEDMEM
00033 {
00037 class MeshFuse : public MESHING
00038 {
00039 public:
00040 MeshFuse();
00041 virtual ~MeshFuse();
00042
00043 void concatenate( const MESH* mesh, const std::vector<int>& node_glob_numbers );
00044
00045
00046 void append( MED_EN::medEntityMesh entity,
00047 std::vector<int>& glob_numbers,
00048 const std::vector<int>& add_glob_numbers );
00049
00050
00051 void setNodeNumbers( const std::vector<int>& node_glob_numbers );
00052
00053
00054 const std::vector<int> & getNodeNumbers() const { return _node_glob_numbers; }
00055
00056 private:
00057
00058 int makeNewNodeIds(const std::vector<int>& node_glob_numbers);
00059
00060 void expandCoordinates(int final_nb_nodes);
00061
00062 void expandConnectivity(int final_nb_nodes);
00063
00064 void updateNodeIds( CONNECTIVITY* connectivity );
00065
00066 struct TConnData
00067 {
00068 int _nb_elems;
00069 std::vector< int > _connectivity, _index;
00070
00071 TConnData(): _nb_elems(0) {}
00072 };
00073
00074 int appendConnectivity( TConnData& data,
00075 const MESH* mesh,
00076 MED_EN::medEntityMesh entity,
00077 MED_EN::medGeometryElement type);
00078
00079 template< class TSUPPORT >
00080 TSUPPORT* updateOldSupport(TSUPPORT* support) const;
00081
00082 template< class TSUPPORT >
00083 TSUPPORT* makeSupport(const TSUPPORT* add_support, TSUPPORT* same_name_support);
00084
00085 void expandSupports();
00086
00087 int getElemNbShift( const MED_EN::medEntityMesh& entity,
00088 MED_EN::medGeometryElement type,
00089 int which, bool prev ) const;
00090
00091 void uniteSupportElements(const SUPPORT* add_support,
00092 SUPPORT* old_support,
00093 MED_EN::medGeometryElement type,
00094 std::vector<int> & elements);
00095
00096 void makeNewElemIds(MED_EN::medEntityMesh entity,
00097 MED_EN::medGeometryElement type,
00098 std::vector< int > & new_ids);
00099
00100 void findEqualOldElements(MED_EN::medEntityMesh entity,
00101 MED_EN::medGeometryElement type,
00102 std::vector< int > & old_ids);
00103
00104 private:
00105
00106 const MESH* _mesh;
00107
00108 std::vector<int> _node_glob_numbers;
00109
00110
00111 std::map< MED_EN::medGeometryElement, std::vector<int> > _merged_of_type;
00112
00113 std::map< MED_EN::medGeometryElement, std::vector<int> > _equalo_of_type;
00114
00115
00116 std::map< MED_EN::medGeometryElement, std::vector<int> > _new_elem_ids_of_type;
00117
00118
00119
00120
00121
00122 enum { INIT_OLD=0, INIT_ADD, RSLT_ADD, NB_INDICES };
00123 typedef std::map< MED_EN::medGeometryElement, int > TNbOfGeom;
00124 vector< TNbOfGeom > _nb_index[NB_INDICES];
00125
00126 };
00127 }
00128
00129 #endif