Version: 5.1.6

MEDSPLITTER.MESHCollection Class Reference

#include <MEDSPLITTER_MESHCollection.hxx>

Public Member Functions

 MESHCollection ()
 MESHCollection (const MESHCollection &, Topology *, bool family_splitting=false, bool create_empty_groups=false)
 MESHCollection (const std::string &filename)
 MESHCollection (const std::string &filename, const std::string &meshname)
 ~MESHCollection ()
void write (const std::string &filename)
MESHCollectionDriverretrieveDriver ()
MESHCollectionDrivergetDriver () const
void setDriverType (MEDSPLITTER::DriverType type)
void buildCellGraph (MEDMEM::MEDSKYLINEARRAY *&array, int *&edgeweights)
TopologycreatePartition (int nbdomain, Graph::splitter_type type=Graph::METIS, const string &="", int *edgeweights=0, int *verticesweights=0)
TopologycreatePartition (const int *partition)
void getTypeList (int *cell_list, int nb_cells, MED_EN::medEntityMesh entity, MED_EN::medGeometryElement *type_list) const
void getCoordinates (int *node_list, int nb_nodes, double *coordinates) const
void getNodeConnectivity (const int *cell_list, int nb_cells, MED_EN::medEntityMesh, MED_EN::medGeometryElement type, int *type_connectivity) const
void getPolygonNodeConnectivity (const int *cell_list, int nb_cells, MED_EN::medEntityMesh entity, vector< int > &type_connectivity, vector< int > &connectivity_index) const
void getPolyhedraNodeConnectivity (const int *cell_list, int nb_cells, MED_EN::medEntityMesh entity, vector< int > &type_connectivity, vector< int > &connectivity_index, vector< int > &face_connectivity_index) const
void getFaceConnectivity (const int *cell_list, int nb_cells, MED_EN::medEntityMesh, MED_EN::medGeometryElement type, int *type_connectivity) const
int getMeshDimension () const
int getSpaceDimension () const
std::string getSystem () const
std::string getMeshName () const
std::vector< MEDMEM::MESH * > & getMesh ()
MEDMEM::MESHgetMesh (int) const
std::vector
< MEDMEM::CONNECTZONE * > & 
getCZ ()
TopologygetTopology () const
void setTopology (Topology *topology)
string getName () const
void setName (const string &name)
string getDescription () const
void setDescription (const string &name)
void castFamilies (const MESHCollection &old_collection)
 transfers families from an old MESHCollection to new mesh
void castSupport (const MESHCollection &old_collection, std::vector< const MEDMEM::SUPPORT * > old_support, std::vector< MEDMEM::SUPPORT * > new_support)
void castAllFields (const MESHCollection &old_collection)
 casts all the fields to the new mesh collection
void castField (const MESHCollection &old_collection, const string &fieldname, int itnumber, int ordernumber)
 casts one specific field to the new mesh collection
void setIndivisibleGroup (const string &a)
void buildConnectZones (int idomain)
 constructing connect zones
void buildConnectZones ()
bool isDimensionOK (MED_EN::medGeometryElement type, int dim)
void setSubdomainBoundaryCreates (bool flag)
bool getSubdomainBoundaryCreates ()
void setFamilySplitting (bool flag)
bool getFamilySplitting ()
void setCreateEmptyGroups (bool flag)
bool getCreateEmptyGroups ()
void createNodalConnectivity (const MESHCollection &initial_collection, int idomain, MED_EN::medEntityMesh entity)
 creates connectivities for a domain and an entity (face or cell)
void treatIndivisibleRegions (int *tag)
 creates the tags for indivisible groups
template<class T >
void castFields (const MESHCollection &old_collection, const string &fieldname, int itnumber, int ordernumber)
 projects a field from an old collection to the present one field is identified by (name, dt, it)
void getFaces (int idomain, std::map< MED_EN::medGeometryElement, vector< MEDSPLITTER_FaceModel * > > &)
MEDSPLITTER_FaceModelgetCommonFace (int ip1, int ilocal1, int ip2, int ilocal2, int face_index)

Data Fields

Topologym_topology
 link to mesh_collection topology
bool m_owns_topology
 control over topology
boost::shared_ptr< Graphm_cell_graph
 link to graph
MESHCollectionDriverm_driver
 Driver for read/write operations.
std::vector< MEDMEM::MESH * > m_mesh
 links to meshes
std::vector
< MEDMEM::CONNECTZONE * > 
m_connect_zones
 links to connectzones
std::vector< std::string > m_indivisible_regions
 list of groups that are not to be splitted
string m_name
 name of global mesh
string m_description
 description of global mesh
DriverType m_driver_type
 specifies the driver associated to the collection
bool m_subdomain_boundary_creates
bool m_family_splitting
bool m_create_empty_groups

Constructor & Destructor Documentation

MESHCollection::MESHCollection (  ) 
MESHCollection::MESHCollection ( const MESHCollection initial_collection,
Topology topology,
bool  family_splitting = false,
bool  create_empty_groups = false 
)

constructor creating a new mesh collection (mesh series + topology) from an old collection and a new topology

On output, the constructor has built the meshes corresponding to the new mesh collection. The new topology has been updated so that face and node mappings are included. The families have been cast to their projections in the new topology.

Parameters:
initial_collection collection from which the data (coordinates, connectivity) are taken
topology topology containing the cell mappings

References MEDSPLITTER.MESHCollection.castFamilies(), MEDSPLITTER.Topology.createFaceMapping(), MEDSPLITTER.MESHCollection.createNodalConnectivity(), MEDSPLITTER.MESHCollection.getMeshDimension(), MEDSPLITTER.MESHCollection.getName(), MEDSPLITTER.MESHCollection.getSpaceDimension(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, med_field_anal.mesh_name, MEDSPLITTER.Topology.nbDomain(), SCRUTE_MED, MEDMEM.MESHING.setMeshDimension(), MEDMEM.MESH.setName(), and MEDMEM.MESHING.setSpaceDimension().

MESHCollection::MESHCollection ( const std::string &  filename  ) 

constructing the MESH collection from a distributed file

Parameters:
filename name of the master file containing the list of all the MED files

References MEDSPLITTER.MESHCollection.m_driver, MEDSPLITTER.MESHCollection.m_driver_type, MEDSPLITTER.MedAscii, MEDSPLITTER.MedXML, and MEDSPLITTER.MESHCollectionDriver.read().

MESHCollection::MESHCollection ( const std::string &  filename,
const std::string &  meshname 
)

constructing the MESH collection from a sequential MED-file

Parameters:
filename MED file
meshname name of the mesh that is to be read

References MEDSPLITTER.MESHCollectionDriver.readSeq(), and MEDSPLITTER.MESHCollection.retrieveDriver().

MESHCollection::~MESHCollection (  ) 

Member Function Documentation

void MESHCollection::write ( const std::string &  filename  ) 

constructing the MESH collection from a file

The method creates as many MED-files as there are domains in the collection. It also creates a master file that lists all the MED files. The MED files created in ths manner contain joints that describe the connectivity between subdomains.

Parameters:
filename name of the master file that will contain the list of the MED files

References MEDSPLITTER.MESHCollection.buildConnectZones(), MEDSPLITTER.MESHCollection.m_driver, MEDSPLITTER.MESHCollection.m_topology, MEDSPLITTER.Topology.nbDomain(), MEDSPLITTER.MESHCollection.retrieveDriver(), and MEDSPLITTER.MESHCollectionDriver.write().

MESHCollectionDriver * MESHCollection::retrieveDriver (  ) 
MESHCollectionDriver * MESHCollection::getDriver (  )  const

gets an existing driver

References MEDSPLITTER.MESHCollection.m_driver.

void MEDSPLITTER.MESHCollection.setDriverType ( MEDSPLITTER::DriverType  type  ) 
void MESHCollection::buildCellGraph ( MEDMEM::MEDSKYLINEARRAY *&  array,
int *&  edgeweights 
)
Topology * MESHCollection::createPartition ( int  nbdomain,
Graph::splitter_type  split = Graph::METIS,
const string &  options_string = "",
int user_edge_weights = 0,
int user_vertices_weights = 0 
)

Creates the partition corresponding to the cell graph and the partition number

Parameters:
nbdomain number of subdomains for the newly created graph

returns a topology based on the new graph

user-defined weights

References MEDSPLITTER.MESHCollection.buildCellGraph(), MEDSPLITTER.MESHCollection.getMeshDimension(), MEDSPLITTER.MESHCollection.m_cell_graph, MESSAGE_MED, MEDSPLITTER.Graph.METIS, and MEDSPLITTER.Graph.SCOTCH.

Topology * MESHCollection::createPartition ( const int partition  ) 

Creates a topology for a partition specified by the user

Parameters:
table user-specified partition (for each cell contains the domain number from 0 to n-1)

returns a topology based on the new partition

References MEDSPLITTER.MESHCollection.buildCellGraph(), MEDSPLITTER.MESHCollection.getMeshDimension(), MEDSPLITTER.MESHCollection.m_cell_graph, MEDSPLITTER.MESHCollection.m_topology, and MEDSPLITTER.Topology.nbCells().

void MESHCollection::getTypeList ( int cell_list,
int  nb_cells,
MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement type_list 
) const

gets the list of types for global numbers cell_list

Parameters:
cell_list list of global numbers
entity entity type
type_list on output, list of types for the cells given in cell_list

References MEDSPLITTER.Topology.convertGlobalCellList(), MEDSPLITTER.Topology.convertGlobalFaceList(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, and MESSAGE_MED.

void MESHCollection::getCoordinates ( int node_list,
int  nb_nodes,
double coordinates 
) const

gets the list of coordinates for a given list of global node numbers

The vector containing the coordinates on output should have been allocated at a dimension m_space_dimension * nb_nodes before the call

Parameters:
node_list list of global node numbers
nb_nodes number of nodes in the list
coordinates on output, contains the coordinates

References MEDSPLITTER.Topology.convertGlobalNodeList(), MEDSPLITTER.MESHCollection.getSpaceDimension(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, and MED_EN.MED_FULL_INTERLACE.

void MESHCollection::getNodeConnectivity ( const int cell_list,
int  nb_cells,
MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement  type,
int type_connectivity 
) const

gets the connectivity for a certain type

The output array type_connectivity should have been allocated at dimension nbnode_per_type* nb_cells before the call

Parameters:
cell_list list of elements (global cell numbers) for which the connectivity is required
nb_cells number of elements
entity type of entity for which the nodal connectivity is required
type type of the elements for which the connectivity is required
type_connectivity on output contains the connectivity of all the elements of the list

References testRenumbering.conn, testRenumbering.conn_index, MEDSPLITTER.Topology.convertGlobalCellList(), MEDSPLITTER.Topology.convertGlobalFaceList(), MEDSPLITTER.Topology.convertNodeToGlobal(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_FULL_INTERLACE, MED_EN.MED_NODAL, and MEDSPLITTER.Topology.nbDomain().

void MESHCollection::getPolygonNodeConnectivity ( const int cell_list,
int  nb_cells,
MED_EN::medEntityMesh  entity,
vector< int > &  type_connectivity,
vector< int > &  connectivity_index 
) const

gets the connectivity for MED_POLYGON type

Parameters:
cell_list list of elements (global cell numbers) for which the connectivity is required
nb_cells number of elements
entity type of entity for which the nodal connectivity is required
type_connectivity on output contains the connectivity of all the elements of the list
connectivity_index on output contains the connectivity index for all polygons

References testRenumbering.conn, testRenumbering.conn_face_index, testRenumbering.conn_index, MEDSPLITTER.Topology.convertGlobalCellList(), MEDSPLITTER.Topology.convertGlobalFaceList(), MEDSPLITTER.Topology.convertNodeToGlobal(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_NODAL, MED_EN.MED_POLYGON, and MEDSPLITTER.Topology.nbDomain().

void MESHCollection::getPolyhedraNodeConnectivity ( const int cell_list,
int  nb_cells,
MED_EN::medEntityMesh  entity,
vector< int > &  type_connectivity,
vector< int > &  connectivity_index,
vector< int > &  face_connectivity_index 
) const

gets the connectivity for MED_POLYHEDRA type

Parameters:
cell_list list of elements (global cell numbers) for which the connectivity is required
nb_cells number of elements
entity type of entity for which the nodal connectivity is required
type_connectivity on output contains the connectivity of all the elements of the list
connectivity_index on output contains the connectivity index for all polygons

References testRenumbering.conn, testRenumbering.conn_face_index, testRenumbering.conn_index, MEDSPLITTER.Topology.convertGlobalCellList(), MEDSPLITTER.Topology.convertGlobalFaceList(), MEDSPLITTER.Topology.convertNodeToGlobal(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_NODAL, MED_EN.MED_POLYHEDRA, and MEDSPLITTER.Topology.nbDomain().

void MESHCollection::getFaceConnectivity ( const int cell_list,
int  nb_cells,
MED_EN::medEntityMesh  entity,
MED_EN::medGeometryElement  type,
int type_connectivity 
) const

gets the descending connectivity for a certain type

The output array type_connectivity should have been allocated at dimension nbnode_per_type* nb_cells before the call

Parameters:
cell_list list of elements (global cell numbers) for which the connectivity is required
nb_cells number of elements
entity type of entity for which the nodal connectivity is required
type type of the elements for which the connectivity is required
type_connectivity on output contains the connectivity of all the elements of the list

References testRenumbering.conn, MEDSPLITTER.Topology.convertFaceToGlobal(), MEDSPLITTER.Topology.convertGlobalCellList(), MEDSPLITTER.Topology.convertGlobalFaceList(), MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_CELL, MED_EN.MED_DESCENDING, MED_EN.MED_EDGE, MED_EN.MED_FACE, MED_EN.MED_FULL_INTERLACE, MEDSPLITTER.Topology.nbDomain(), and medClient_test.types.

int MESHCollection::getMeshDimension (  )  const

retrieves the mesh dimension

References MEDSPLITTER.MESHCollection.m_mesh.

int MESHCollection::getSpaceDimension (  )  const

retrieves the space dimension

References MEDSPLITTER.MESHCollection.m_mesh.

string MESHCollection::getSystem (  )  const

retrieves the type of coordinates system

References MEDSPLITTER.MESHCollection.m_mesh.

string MESHCollection::getMeshName (  )  const

retrieves the name of the mesh

References MEDSPLITTER.MESHCollection.m_mesh.

vector< MEDMEM::MESH * > & MESHCollection::getMesh (  ) 
MEDMEM::MESH * MESHCollection::getMesh ( int  idomain  )  const
vector< MEDMEM::CONNECTZONE * > & MESHCollection::getCZ (  ) 
Topology * MESHCollection::getTopology (  )  const
void MESHCollection::setTopology ( Topology topology  ) 
string MEDSPLITTER.MESHCollection.getName (  )  const
void MEDSPLITTER.MESHCollection.setName ( const string &  name  ) 
string MEDSPLITTER.MESHCollection.getDescription (  )  const
void MEDSPLITTER.MESHCollection.setDescription ( const string &  name  ) 
void MESHCollection::castFamilies ( const MESHCollection old_collection  ) 
void MESHCollection::castSupport ( const MESHCollection old_collection,
std::vector< const MEDMEM::SUPPORT * >  old_support,
std::vector< MEDMEM::SUPPORT * >  new_support 
)
void MESHCollection::castAllFields ( const MESHCollection old_collection  ) 
void MESHCollection::castField ( const MESHCollection old_collection,
const string &  fieldname,
int  itnumber,
int  ordernumber 
)

casts one specific field to the new mesh collection

References MEDSPLITTER.MESHCollection.getDriver(), MEDSPLITTER.MESHCollectionDriver.getFieldType(), and medClient_test.type.

void MESHCollection::setIndivisibleGroup ( const string &  a  ) 
void MESHCollection::buildConnectZones ( int  idomain  ) 
void MESHCollection::buildConnectZones (  ) 

building Connect Zones for storing the informations of the connectivity

References MEDMEM.MESHING.addGroup(), med_test1.begin, MEDSPLITTER.Topology.computeCellCellCorrespondencies(), MEDSPLITTER.Topology.computeNodeNodeCorrespondencies(), testRenumbering.conn, medClient_test.connectivity, MEDSPLITTER.Topology.convertGlobalFace(), face, MEDSPLITTER.MESHCollection.getCommonFace(), MEDMEM.MESH.getElementType(), MEDSPLITTER.Topology.getFaceNumber(), MEDSPLITTER.MESHCollection.getFaces(), MEDSPLITTER.MESHCollection.getMeshDimension(), MEDSPLITTER.MEDSPLITTER_FaceModel.getType(), medClient_test.index, MEDSPLITTER.MESHCollection.m_cell_graph, MEDSPLITTER.MESHCollection.m_connect_zones, MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_subdomain_boundary_creates, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_CELL, MED_EN.MED_EDGE, MED_EN.MED_FACE, MEDSPLITTER.Topology.nbDomain(), MEDSPLITTER.Topology.recreateFaceMapping(), MEDMEM.MESHING.setConnectivity(), MEDMEM.CONNECTZONE.setDistantDomainNumber(), MEDMEM.CONNECTZONE.setDistantMesh(), MEDMEM.SUPPORT.setEntity(), MEDMEM.CONNECTZONE.setEntityCorresp(), MEDMEM.SUPPORT.setGeometricType(), MEDMEM.CONNECTZONE.setLocalDomainNumber(), MEDMEM.CONNECTZONE.setLocalMesh(), MEDMEM.SUPPORT.setMesh(), MEDMEM.SUPPORT.setName(), MEDSPLITTER.MESHCollection.setName(), MEDMEM.CONNECTZONE.setNodeCorresp(), MEDMEM.SUPPORT.setNumber(), MEDMEM.SUPPORT.setNumberOfElements(), MEDMEM.MESHING.setNumberOfElements(), MEDMEM.SUPPORT.setNumberOfGeometricType(), MEDMEM.MESHING.setNumberOfTypes(), MEDMEM.MESHING.setTypes(), test_NonCoincidentDEC.size, medClient_test.type, medClient_test.types, and batchmode_medcorba_test.value.

bool MEDSPLITTER.MESHCollection.isDimensionOK ( MED_EN::medGeometryElement  type,
int  dim 
)
void MEDSPLITTER.MESHCollection.setSubdomainBoundaryCreates ( bool  flag  ) 
bool MEDSPLITTER.MESHCollection.getSubdomainBoundaryCreates (  ) 
void MEDSPLITTER.MESHCollection.setFamilySplitting ( bool  flag  ) 
bool MEDSPLITTER.MESHCollection.getFamilySplitting (  ) 
void MEDSPLITTER.MESHCollection.setCreateEmptyGroups ( bool  flag  ) 
bool MEDSPLITTER.MESHCollection.getCreateEmptyGroups (  ) 
void MESHCollection::createNodalConnectivity ( const MESHCollection initial_collection,
int  idomain,
MED_EN::medEntityMesh  entity 
)
void MESHCollection::treatIndivisibleRegions ( int indivisible_tag  ) 

creates the tags for indivisible groups

Browses the domains and the regions that have been marked as indivisible in order to create a vector the dimlension of which is the total number of cells, and that contains 0 if the cell belongs to no indivisible group and that contains an integer corresponding to the group otherwise.

Parameters:
indivisible_tag on input is an int* allocated as int[nbcells] on output contains the tags

References MEDSPLITTER.Topology.convertCellToGlobal(), MEDMEM.SUPPORT.getName(), MEDMEM.SUPPORT.getNumber(), MEDMEM.SUPPORT.getNumberOfElements(), med_test1.group, MEDSPLITTER.MESHCollection.m_indivisible_regions, MEDSPLITTER.MESHCollection.m_mesh, MEDSPLITTER.MESHCollection.m_topology, MED_EN.MED_ALL_ELEMENTS, MED_EN.MED_CELL, MEDSPLITTER.Topology.nbCells(), MEDSPLITTER.Topology.nbDomain(), and MEDSPLITTER.trim().

template<class T >
void MEDSPLITTER.MESHCollection.castFields ( const MESHCollection old_collection,
const string &  fieldname,
int  itnumber,
int  ordernumber 
)

projects a field from an old collection to the present one field is identified by (name, dt, it)

void MESHCollection::getFaces ( int  idomain,
std::map< MED_EN::medGeometryElement, vector< MEDSPLITTER_FaceModel * > > &  face_map 
)
MEDSPLITTER_FaceModel * MESHCollection::getCommonFace ( int  ip1,
int  ilocal1,
int  ip2,
int  ilocal2,
int  face_index 
)

Field Documentation

link to mesh_collection topology

control over topology

link to graph

Driver for read/write operations.

links to meshes

links to connectzones

list of groups that are not to be splitted

name of global mesh

description of global mesh

specifies the driver associated to the collection

flag specifying that the splitter should create boundary constituent entity so that they are written in joints

flag specifying that families must be preserved by the splitting

flag specifying that groups must be created on all domains, even if they are empty