Salome HOME
projects
/
tools
/
medcoupling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated copyright comment
[tools/medcoupling.git]
/
src
/
MEDPartitioner
/
MEDPARTITIONER_MeshCollection.hxx
diff --git
a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx
b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx
index 86cc9a146a55b1a38dbeaa84677c109545ea4bf2..4816631bbeb8e596c13c601b9ae27bf8f7b4f1e7 100644
(file)
--- a/
src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx
+++ b/
src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx
@@
-1,9
+1,9
@@
-// Copyright (C) 2007-20
13 CEA/DEN, EDF R&D
+// Copyright (C) 2007-20
24 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-23,8
+23,7
@@
#include "MEDPARTITIONER.hxx"
#include "MEDPARTITIONER_Graph.hxx"
#include "MEDPARTITIONER_Utils.hxx"
#include "MEDPARTITIONER.hxx"
#include "MEDPARTITIONER_Graph.hxx"
#include "MEDPARTITIONER_Utils.hxx"
-
-#include "MEDCouplingUMesh.hxx"
+#include "MEDCouplingSkyLineArray.hxx"
#include <map>
#include <vector>
#include <map>
#include <vector>
@@
-32,10
+31,11
@@
#include "BBTree.txx"
#include "BBTree.txx"
-namespace
ParaMEDMEM
+namespace
MEDCoupling
{
class MEDCouplingUMesh;
class DataArrayInt;
{
class MEDCouplingUMesh;
class DataArrayInt;
+ class MEDCouplingSkyLineArray;
}
namespace MEDPARTITIONER
}
namespace MEDPARTITIONER
@@
-43,12
+43,11
@@
namespace MEDPARTITIONER
class Topology;
class MeshCollectionDriver;
class ParaDomainSelector;
class Topology;
class MeshCollectionDriver;
class ParaDomainSelector;
- class SkyLineArray;
class ConnectZone;
class JointFinder;
typedef enum{MedAscii, MedXml, Undefined} DriverType;
class ConnectZone;
class JointFinder;
typedef enum{MedAscii, MedXml, Undefined} DriverType;
- typedef std::multimap<std::pair<int,
int>, std::pair<int,int
> > NodeMapping ;
+ typedef std::multimap<std::pair<int,
mcIdType>, std::pair<int,mcIdType
> > NodeMapping ;
typedef std::vector<std::pair<int,int> > NodeList;
class MEDPARTITIONER_EXPORT MeshCollection
typedef std::vector<std::pair<int,int> > NodeList;
class MEDPARTITIONER_EXPORT MeshCollection
@@
-75,9
+74,9
@@
namespace MEDPARTITIONER
void setDriverType(MEDPARTITIONER::DriverType type) { _driver_type=type; }
//creation of the cell graph
void setDriverType(MEDPARTITIONER::DriverType type) { _driver_type=type; }
//creation of the cell graph
- void buildCellGraph(MED
PARTITIONER::
SkyLineArray* & array,int *& edgeweights );
+ void buildCellGraph(MED
Coupling::MEDCoupling
SkyLineArray* & array,int *& edgeweights );
//creation of the cell graph
//creation of the cell graph
- void buildParallelCellGraph(MED
PARTITIONER::
SkyLineArray* & array,int *& edgeweights );
+ void buildParallelCellGraph(MED
Coupling::MEDCoupling
SkyLineArray* & array,int *& edgeweights );
//creation and partition of the associated graph
Topology* createPartition(int nbdomain, Graph::splitter_type type = Graph::METIS,
//creation and partition of the associated graph
Topology* createPartition(int nbdomain, Graph::splitter_type type = Graph::METIS,
@@
-89,29
+88,29
@@
namespace MEDPARTITIONER
//getting mesh dimension
int getMeshDimension() const;
int getNbOfLocalMeshes() const;
//getting mesh dimension
int getMeshDimension() const;
int getNbOfLocalMeshes() const;
- int getNbOfGlobalMeshes() const { return _mesh.size(); }
-
int
getNbOfLocalCells() const;
-
int
getNbOfLocalFaces() const;
+ int getNbOfGlobalMeshes() const { return
(int)
_mesh.size(); }
+
mcIdType
getNbOfLocalCells() const;
+
mcIdType
getNbOfLocalFaces() const;
//getting a reference to mesh vector
//getting a reference to mesh vector
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*>& getMesh();
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*>& getFaceMesh();
- std::vector<std::vector<
ParaMEDMEM
::MEDCouplingUMesh*> >& getGroupMeshes();
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*>& getMesh();
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*>& getFaceMesh();
+ std::vector<std::vector<
MEDCoupling
::MEDCouplingUMesh*> >& getGroupMeshes();
-
ParaMEDMEM
::MEDCouplingUMesh* getMesh(int idomain) const;
-
ParaMEDMEM
::MEDCouplingUMesh* getFaceMesh(int idomain);
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*>& getGroupMeshes(int idomain);
+
MEDCoupling
::MEDCouplingUMesh* getMesh(int idomain) const;
+
MEDCoupling
::MEDCouplingUMesh* getFaceMesh(int idomain);
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*>& getGroupMeshes(int idomain);
- std::vector<
ParaMEDMEM::DataArrayInt
*>& getCellFamilyIds() { return _cell_family_ids; }
- std::vector<
ParaMEDMEM::DataArrayInt
*>& getFaceFamilyIds() { return _face_family_ids; }
+ std::vector<
MEDCoupling::DataArrayIdType
*>& getCellFamilyIds() { return _cell_family_ids; }
+ std::vector<
MEDCoupling::DataArrayIdType
*>& getFaceFamilyIds() { return _face_family_ids; }
- std::map<std::string,
ParaMEDMEM::DataArrayInt
*>& getMapDataArrayInt() { return _map_dataarray_int; }
- std::map<std::string,
ParaMEDMEM
::DataArrayDouble*>& getMapDataArrayDouble() { return _map_dataarray_double; }
+ std::map<std::string,
MEDCoupling::DataArrayIdType
*>& getMapDataArrayInt() { return _map_dataarray_int; }
+ std::map<std::string,
MEDCoupling
::DataArrayDouble*>& getMapDataArrayDouble() { return _map_dataarray_double; }
- std::map<std::string,
int
>& getFamilyInfo() { return _family_info; }
+ std::map<std::string,
mcIdType
>& getFamilyInfo() { return _family_info; }
std::map<std::string, std::vector<std::string> >& getGroupInfo() { return _group_info; }
std::map<std::string, std::vector<std::string> >& getGroupInfo() { return _group_info; }
-
ParaMEDMEM
::DataArrayDouble* getField(std::string descriptionField, int iold);
+
MEDCoupling
::DataArrayDouble* getField(std::string descriptionField, int iold);
std::vector<std::string>& getFieldDescriptions() { return _field_descriptions; }
void prepareFieldDescriptions();
void filterFaceOnCell();
std::vector<std::string>& getFieldDescriptions() { return _field_descriptions; }
void prepareFieldDescriptions();
void filterFaceOnCell();
@@
-122,8
+121,9
@@
namespace MEDPARTITIONER
//getting a pointer to topology
Topology* getTopology() const ;
ParaDomainSelector* getParaDomainSelector() const { return _domain_selector; }
//getting a pointer to topology
Topology* getTopology() const ;
ParaDomainSelector* getParaDomainSelector() const { return _domain_selector; }
+ void setParaDomainSelector(ParaDomainSelector* pds) { _domain_selector = pds; }
//setting a new topology
//setting a new topology
- void setTopology(Topology* topology);
+ void setTopology(Topology* topology
, bool takeOwneship
);
//getting/setting the name of the global mesh (as opposed
//to the name of a subdomain \a nn, which is name_nn)
//getting/setting the name of the global mesh (as opposed
//to the name of a subdomain \a nn, which is name_nn)
@@
-131,50
+131,58
@@
namespace MEDPARTITIONER
void setName(const std::string& name) { _name=name; }
void setDomainNames(const std::string& name);
void setName(const std::string& name) { _name=name; }
void setDomainNames(const std::string& name);
+ void setNonEmptyMesh(int number) { _i_non_empty_mesh=number;}
+
//getting/setting the description of the global mesh
std::string getDescription() const { return _description; }
void setDescription(const std::string& name) { _description=name; }
//creates the node mapping between an old collection and the present one
void createNodeMapping(MeshCollection& initialCollection,
//getting/setting the description of the global mesh
std::string getDescription() const { return _description; }
void setDescription(const std::string& name) { _description=name; }
//creates the node mapping between an old collection and the present one
void createNodeMapping(MeshCollection& initialCollection,
- std::multimap<std::pair<int,
int>,std::pair<int,int
> >& nodeMapping);
+ std::multimap<std::pair<int,
mcIdType>,std::pair<int,mcIdType
> >& nodeMapping);
void castCellMeshes(MeshCollection& initialCollection,
void castCellMeshes(MeshCollection& initialCollection,
- std::vector<std::vector<std::vector<int> > >& new2oldIds);
+ std::vector<std::vector<std::vector<mcIdType> > >& new2oldIds,
+ std::vector<MEDCoupling::DataArrayIdType*> & o2nRenumber);
//creates faces on the new collection
void castFaceMeshes(MeshCollection& initialCollection,
//creates faces on the new collection
void castFaceMeshes(MeshCollection& initialCollection,
- const std::multimap<std::pair<int,
int>, std::pair<int,int
> >& nodeMapping,
- std::vector<std::vector<std::vector<
int
> > >& new2oldIds);
+ const std::multimap<std::pair<int,
mcIdType>, std::pair<int,mcIdType
> >& nodeMapping,
+ std::vector<std::vector<std::vector<
mcIdType
> > >& new2oldIds);
//constructing connect zones
//constructing connect zones
- void buildConnectZones();
+ void buildConnectZones( const NodeMapping& nodeMapping,
+ const std::vector<MEDCoupling::DataArrayIdType*> & o2nRenumber,
+ int nbInitialDomains );
+
+ // Find faces common with neighbor domains and put them in groups
+ void buildBoundaryFaces();
private:
private:
- void castIntField(std::vector<
ParaMEDMEM
::MEDCouplingUMesh*>& meshesCastFrom,
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*>& meshesCastTo,
- std::vector<
ParaMEDMEM::DataArrayInt
*>& arrayFrom,
+ void castIntField(std::vector<
MEDCoupling
::MEDCouplingUMesh*>& meshesCastFrom,
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*>& meshesCastTo,
+ std::vector<
MEDCoupling::DataArrayIdType
*>& arrayFrom,
std::string nameArrayTo);
void castAllFields(MeshCollection& initialCollection,
std::string nameArrayTo);
std::string nameArrayTo);
void castAllFields(MeshCollection& initialCollection,
std::string nameArrayTo);
- void findCommonDistantNodes(std::vector<std::vector<std::multimap<int,
int
> > >& commonDistantNodes);
+ void findCommonDistantNodes(std::vector<std::vector<std::multimap<int,
mcIdType
> > >& commonDistantNodes);
void remapIntField(int inew, int iold,
void remapIntField(int inew, int iold,
- const
ParaMEDMEM
::MEDCouplingUMesh& sourceMesh,
- const
ParaMEDMEM
::MEDCouplingUMesh& targetMesh,
- const
int
* fromArray,
+ const
MEDCoupling
::MEDCouplingUMesh& sourceMesh,
+ const
MEDCoupling
::MEDCouplingUMesh& targetMesh,
+ const
mcIdType
* fromArray,
std::string nameArrayTo,
const BBTreeOfDim* tree);
void remapDoubleField(int inew, int iold,
std::string nameArrayTo,
const BBTreeOfDim* tree);
void remapDoubleField(int inew, int iold,
-
ParaMEDMEM
::DataArrayDouble* fromArray,
+
MEDCoupling
::DataArrayDouble* fromArray,
std::string nameArrayTo,
std::string descriptionField);
std::string nameArrayTo,
std::string descriptionField);
- void createJointGroup( const std::vector<
int
>& faces,
+ void createJointGroup( const std::vector<
mcIdType
>& faces,
const int inew1,
const int inew2,
const bool is2nd );
const int inew1,
const int inew2,
const bool is2nd );
@@
-193,32
+201,29
@@
namespace MEDPARTITIONER
ParaDomainSelector* _domain_selector;
//links to meshes
ParaDomainSelector* _domain_selector;
//links to meshes
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*> _mesh;
- std::vector<
ParaMEDMEM
::MEDCouplingUMesh*> _face_mesh;
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*> _mesh;
+ std::vector<
MEDCoupling
::MEDCouplingUMesh*> _face_mesh;
//index of a non empty mesh within _mesh (in parallel mode all of meshes can be empty)
int _i_non_empty_mesh;
//index of a non empty mesh within _mesh (in parallel mode all of meshes can be empty)
int _i_non_empty_mesh;
- //links to connectzones
- std::vector<MEDPARTITIONER::ConnectZone*> _connect_zones;
-
//family ids storages
//family ids storages
- std::vector<
ParaMEDMEM::DataArrayInt
*> _cell_family_ids;
- std::vector<
ParaMEDMEM::DataArrayInt
*> _face_family_ids;
+ std::vector<
MEDCoupling::DataArrayIdType
*> _cell_family_ids;
+ std::vector<
MEDCoupling::DataArrayIdType
*> _face_family_ids;
//DataArrayInt* storages
//DataArrayInt* storages
- std::map<std::string,
ParaMEDMEM::DataArrayInt
*> _map_dataarray_int;
+ std::map<std::string,
MEDCoupling::DataArrayIdType
*> _map_dataarray_int;
//DataArrayDouble* storages
//DataArrayDouble* storages
- std::map<std::string,
ParaMEDMEM
::DataArrayDouble*> _map_dataarray_double;
+ std::map<std::string,
MEDCoupling
::DataArrayDouble*> _map_dataarray_double;
//fields to be partitioned
std::vector<std::string> _field_descriptions;
//group family conversion
//fields to be partitioned
std::vector<std::string> _field_descriptions;
//group family conversion
- std::map<std::string,
int
> _family_info;
+ std::map<std::string,
mcIdType
> _family_info;
std::map<std::string, std::vector<std::string> > _group_info;
std::map<std::string, std::vector<std::string> > _group_info;
- //list of groups that are not to be split
ted
+ //list of groups that are not to be split
std::vector<std::string> _indivisible_regions;
//name of global mesh
std::vector<std::string> _indivisible_regions;
//name of global mesh