mesh_part_prep Package

mesh_part_prep Package

A preprocessort for the mesh partitioner

cli Module

The command line interface for mesh_part_prep allows you to run preperatory steps needed to transform the output files generated by the Triangle program into METIS compatible input files.

After installation, you can use:

mesh_part_prep --help

usage: mesh_part_prep [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] mesh_dir

positional arguments:
  mesh_dir              Path to the unpartioned mesh directory

optional arguments:
  -h, --help            show this help message and exit
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --log {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Set the logging level

The only required argument is the path to the mesh:

mesh_part_prep /some/path/goes/here

In this case, the level information is prepended to the aux3d.out file.

mesh_part_prep.cli.main()[source]
mesh_part_prep.cli.parse_args()[source]

Parsers command line arguments

plugin Module

There is also a esm-tools plugin to prepare files for the FESOM Mesh Generator.

This consists of two parts, first to prepare the aux3d.out file, and secondly to move the resulting mesh files into a common directory.

In your recipe, you can include the following elements after the installation:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
compute:
        recipe:
                - "mesh_part_prep"
                - "_create_setup_folders"
                - "_create_component_folders"
                - "initialize_experiment_logfile"
                - "_write_finalized_config"
                - "copy_tools_to_thisrun"
                - "_copy_preliminary_files_from_experiment_to_thisrun"
                - "_show_simulation_info"
                - "copy_files_to_thisrun"
                - "modify_namelists"
                - "modify_files"
                - "create_new_files"
                - "prepare_coupler_files"
                - "add_batch_hostfile"
                - "copy_files_to_work"
                - "write_simple_runscript"
                - "report_missing_files"
                - "database_entry"
                - "submit"
                - "mesh_part_finish"

You configuration should include the following to set up the plugin correctly:

general:
    mesh_part_prep: True
    mesh_part_finish: True

fesom_mesh_part:
    mesh_dir: /path/to/your/Triangle/output/dir 
    result_mesh_dir: /some/path
    part: 288 # For example, you could set a different partitioning here
mesh_part_prep.plugin.copy_and_overwrite(from_path, to_path)[source]

Removes to path and copies over from path

mesh_part_prep.plugin.cp(src, dst)[source]
mesh_part_prep.plugin.deep_dict_update(d, mesh_dir, new_mesh_dir)[source]
mesh_part_prep.plugin.esm_mesh_part_finish(config)[source]

Finishes up a mesh by copying the paritioned mesh into a folder

mesh_part_prep.plugin.esm_mesh_part_prep(config)[source]

Runs a pre-process script for the mesh partioner to generate 3D information

mesh_part_prep Module

The Python module allows you to prepare a Triangle output for use with the mesh partitioner.

A minimal example:

>>> from mesh_part_prep import RawMesh
>>> path = "/some/path/with/a/triangle/output"
>>> rm = RawMesh(path)
>>> rm.process()
exception mesh_part_prep.mesh_part_prep.MeshPartPrepError[source]

Bases: Exception

Raise this when prepping the raw mesh fails

class mesh_part_prep.mesh_part_prep.RawMesh(path)[source]

Bases: object

A representation of the raw mesh (after Triangle, before MeshPart)

process()[source]

Processes files to generate a partitioned FESOM-2.0 mesh using the METIS mesh partitioner from a standard Triangle output