Version: 6.5.0
Functions
Mesh I/O

Functions

int MEDMEM::GMESH::addDriver (driverTypes driverType, const std::string &fileName="Default File Name.med", const std::string &driverName="Default Mesh Name", MED_EN::med_mode_acces access=MED_EN::RDWR)
int MEDMEM::GMESH::addDriver (GENDRIVER &driver)
void MEDMEM::GMESH::rmDriver (int index=0)
virtual void MEDMEM::GMESH::read (int index=0)
virtual void MEDMEM::GMESH::read (const GENDRIVER &genDriver)
virtual void MEDMEM::GMESH::read (driverTypes driverType, const std::string &filename, const std::string &meshname)
virtual void MEDMEM::GMESH::write (int index=0) const
virtual void MEDMEM::GMESH::write (const GENDRIVER &genDriver, MED_EN::med_mode_acces medMode=MED_EN::WRONLY) const
virtual void MEDMEM::GMESH::write (driverTypes driverType, const std::string &filename, const std::string &meshname="", MED_EN::med_mode_acces medMode=MED_EN::WRONLY) const

Detailed Description

These methods describe how to read and write meshes. Generally speaking, meshes should be read via a constructor and should be written with the write() method.

Function Documentation

int GMESH::addDriver ( driverTypes  driverType,
const std::string &  fileName = "Default File Name.med",
const std::string &  driverName = "Default Mesh Name",
MED_EN::med_mode_acces  access = MED_EN::RDWR 
)

Add a MESH driver of type driverTypes (MED_DRIVER, ....) associated with file fileName. The meshname used in the file is driverName. addDriver returns an integer handler.

int GMESH::addDriver ( GENDRIVER &  driver)

Add an existing MESH driver.

void GMESH::rmDriver ( int  index = 0)

Remove an existing MESH driver.

void GMESH::read ( int  index = 0)
virtual

Read mesh from the file using given driver.

Parameters
index- index of driver to use for reading
void GMESH::read ( const GENDRIVER &  driver)
virtual

Reads GMESH using the given driver.

void GMESH::read ( driverTypes  driverType,
const std::string &  filename,
const std::string &  meshname 
)
virtual

Reads the GMESH.

Parameters
driverType- type of driver to use for reading
filename- file to read from
meshname- name of a mesh to read
void GMESH::write ( int  index = 0) const
virtual

Writes all the content of the MESH using driver referenced by the integer handle returned by a addDriver call.

Example :

//...
// Attaching the driver to file "output.med", meshname "Mesh"
int driver_handle = mesh.addDriver(MED_DRIVER, "output.med", "Mesh");
// Writing the content of mesh to the file
mesh.write(driver_handle);
void GMESH::write ( const GENDRIVER &  driver,
MED_EN::med_mode_acces  medMode = MED_EN::WRONLY 
) const
virtual

Writes all the content of the GMESH using the given driver.

void GMESH::write ( driverTypes  driverType,
const std::string &  filename,
const std::string &  meshname = "",
MED_EN::med_mode_acces  medMode = MED_EN::WRONLY 
) const
virtual

Writes all the content of the GMESH.

Parameters
driverType- type of driver to use for writing
filename- file to write into
meshname- mesh name
medMode- file access mode
Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS