mammos_mumag.tofly#

Convert unv mesh files to the fly format.

usage: tofly.py [-h] [-e DIMENSIONS] [UNV] [FLY]

Convert unv files to the fly format. Elements that belong to a group called ‘contact’ will be converted to their contact counterparts. First and secound order meshes are supported.

positional arguments:
UNV Path to the input file or ‘-’ for stdin. It must

already exist and be stored in the unv format. If ommited stdin will be used instead.

FLY Path to the output file or ‘-’ for stdout. Overridden

if it already exists. If ommited stdout will be used instead.

optional arguments:
-h, --help

show this help message and exit

-e DIMENSIONS, --exclude DIMENSIONS

Comma separated list of dimensions that shall be ignored while converting (e.g. ‘-e 1,2’ only converts 3D elements).

Functions

addTo(m, k, d)

convert(unv_path, fly_path[, exclude_list])

Convert mesh file from unv to fly.

convertElemsContact(index, groups, contact, ...)

convertNodes(nodes, unvFile, flyFile)

countUnvNodes(file)

filter(words, i, pattern)

findSection(file)

get_exclude_set(exclude_list)

indexElems(index, file, exclude)

indexNodes(nodes, file)

nextType(file)

parse(f, num, pattern)

parseElem(t, file)

parseGroups(groups, contact, file)

parseNode(file)

regIndex(t, data, index)

scanUnv(file, exclude)

skipSection(file)

static_vars(**kwargs)

writeBuffer(f, b, t[, m, i])

writeFly(nodes, groups, index, contact, ...)

writeFooter(fly)

writeFooter2(fly)

writeHeader(file)

Exceptions

exception mammos_mumag.tofly.EndOfFileError#
exception mammos_mumag.tofly.EndOfSectionError#
exception mammos_mumag.tofly.ParseError#
exception mammos_mumag.tofly.UnsupportedElementError#
mammos_mumag.tofly.addTo(m, k, d)#
mammos_mumag.tofly.convert(unv_path, fly_path, exclude_list=[1, 2])#

Convert mesh file from unv to fly.

Parameters:
  • unv_path (str | Path) – Input unv file path.

  • fly_path (str | Path) – Output fly file path.

  • exclude_list (list[int]) – List of dimensions to be excluded. Defaults to [1,2], so it will exclude 1D and 2D elements.

Return type:

None

mammos_mumag.tofly.convertElemsContact(index, groups, contact, unv, fly)#
mammos_mumag.tofly.convertNodes(nodes, unvFile, flyFile)#
mammos_mumag.tofly.countUnvNodes(file)#
mammos_mumag.tofly.filter(words, i, pattern)#
mammos_mumag.tofly.findSection(file)#
mammos_mumag.tofly.get_exclude_set(exclude_list)#
mammos_mumag.tofly.indexElems(index, file, exclude)#
mammos_mumag.tofly.indexNodes(nodes, file)#
mammos_mumag.tofly.nextType(file)#
mammos_mumag.tofly.parse(f, num, pattern)#
mammos_mumag.tofly.parseElem(t, file)#
mammos_mumag.tofly.parseGroups(groups, contact, file)#
mammos_mumag.tofly.parseNode(file)#
mammos_mumag.tofly.regIndex(t, data, index)#
mammos_mumag.tofly.scanUnv(file, exclude)#
mammos_mumag.tofly.skipSection(file)#
mammos_mumag.tofly.static_vars(**kwargs)#
mammos_mumag.tofly.writeBuffer(f, b, t, m=None, i=1)#
mammos_mumag.tofly.writeFly(nodes, groups, index, contact, unvFile, flyFile, exclude)#
mammos_mumag.tofly.writeFooter(fly)#
mammos_mumag.tofly.writeFooter2(fly)#
mammos_mumag.tofly.writeHeader(file)#