scallop dome pyformex logo

Previous topic

48. lima — Lindenmayer Systems

Next topic

50. nurbs — Using NURBS in pyFormex.

[FSF Associate Member]

Valid XHTML 1.0 Transitional

49. neu_exp — Gambit neutral file exporter.

This module contains some functions to export pyFormex mesh models to Gambit neutral files.

Classes defined in module neu_exp

Functions defined in module neu_exp

neu_exp.writeHeading(fil, nodes, elems, nbsets=0, heading='')

Write the heading of the Gambit neutral file.

nbsets: number of boundary condition sets (border patches).

neu_exp.writeNodes(fil, nodes)

Write nodal coordinates.

neu_exp.writeElems(fil, elems)

Write element connectivity.

neu_exp.writeGroup(fil, elems)

Write group of elements.

neu_exp.writeBCsets(fil, bcsets, elgeotype)

Write boundary condition sets of faces.

Parameters:

  • bcsets: a dict where the values are BorderFace arrays (see below).
  • elgeotype: element geometry type: 4 for hexahedrons, 6 for tetrahedrons.

BorderFace array: A set of border faces defined as a (n,2) shaped int array: echo row contains an element number (enr) and face number (fnr).

There are 2 ways to construct the BorderFace arrays:

# find border both as mesh and enr/fnr and keep correspondence:

  brde, brdfaces = M.getFreeEntities(level=-1,return_indices=True)
  brd = Mesh(M.coords, brde)

.. note: This needs further explanation. Gianluca?
# matchFaces: Given a volume mesh M and a surface meshes S, being

(part of) the border of M, BorderFace array for the surface S can be obtained from:

bf = M.matchFaces(S)[1]

See also http://combust.hit.edu.cn:8080/fluent/Gambit13_help/modeling_guide/mg0b.htm#mg0b01 for the description of the neu file syntax.

neu_exp.read_tetgen(filename)

Read a tetgen tetraeder model.

filename is the base of the path of the input files. For a filename ‘proj’, nodes are expected in ‘proj.1.node’ and elems are in file ‘proj.1.ele’.

neu_exp.write_neu(fil, mesh, bcsets=None, heading='generated with pyFormex')

Export a mesh as .neu file (For use in Gambit/Fluent)

  • fil: file name
  • mesh: pyFormex Mesh
  • heading: heading text to be shown in the gambit header
  • bcsets: dictionary of 2D arrays: {‘name1’: brdfaces1, ...}, see writeBCsets