FeResPost Web Site                     FeResPost Online User Manual

I.1.8 “Gmsh” methods

The “writeGmsh” method defined in generic “DataBase” class is used to create a Gmsh result file in which parts of the model and of the Results are saved for later visualization. The purpose of the method is to allow the user to visualize parts of the model and Results. An example of use of the method is as follows:

    db.writeGmsh("brol.gmsh",0,[[res,"stress","ElemCenters"],'  
                                         [displ,"displ","Nodes"]],'  
                                        [[skelGrp,"mesh slat"]],'  
                                        [[skelGrp,"skel slat"]])

The method has six parameters:

1.
A string containing the name of the file in which the model and Results will be output.
2.
An integer corresponding to the id of a coordinate system in which the positions are located and in which the components of Result values are expressed. The coordinate system must be defined in the dataBase db and must be a rectangular one.
3.
An Array containing the Results to be stored in Gmsh file. Each element of the Array is An Array of three elements:
4.
An Array containing the Meshes to be stored in Gmsh file. Each element of the Array is An Array of two elements:
5.
An Array containing the parts of the model for which a “skeleton” shall be saved in the Gmsh file. (A skeleton is a representation of the mesh with only a few edges.)
6.
A logical parameter specifying whether a binary output is requested. If the parameter is “true” a binary output is done, otherwise, the output is an ASCII one. The parameter is optional and binary output is the default. A binary output is significantly faster than an ASCII one.

Parameters 3, 4 and 5 are optional. They can be a void Array or replaced by nil argument. All the last nil parameters may be omitted. Parameter 6 is optional too. If no pair of key-values is found for a Result to be printed. Nothing is output in the gmsh file.

It is the responsibility of the user to provide Results that associate values to a single valid key. Otherwise, an error message is issued and exception is thrown. In particular, as Results written in GMSH files are not layered, the user should be careful not to output multi-layered Results. The details in error message output are controlled by the debugging verbosity level. (See I.6.6.)

Note also that if the values that the user try to output are not correct, a substitution is done: Inifinite float values are replaced by MAXFLOAT value, NaN values are replaced by MINFLOAT value. (Of course it is advised to output Result objects with valid values.)

The “writeGmshMesh” method defined in generic “DataBase” class saves a Gmsh mesh file. The method has up to four arguments (last argument is optional):

1.
A String containing the name of the file in which the mesh is output.
2.
An integer argument corresponding to the coordinate system in which the nodes are expressed.
3.
A Group corresponding to the entities to be saved in the mesh file.
4.
An optional Boolean argument specifying whether the mesh is output in binary format. The default value of the argument is “true” and corresponds to a binary output.

An example of use follows:

        db.writeGmshMesh("brol.msh",0,skelGrp,false)