Quickstart

Preperation Plugin for FESOM Mesh Partitioning

Documentation Status GitHub

This plugin contains functionality to prepare files for the mesh partioner after the Triangle program has run.

Installation

To install the plugin, use:

pip install --user git+https://github.com/esm-tools-plugins/mesh_part_prep

Usage

From the command line:

$ mesh_part_prep <PATH_TO_MESH_FOLDER>

From an esm_tools script (as a plugin, which you can include in your recipe as mesh_part_prep and mesh_part_finish):

general:
    # Turn on the plugin (seperate from actually loading it):
    mesh_part_prep: True
    # Turn on copying the mesh to a desired location after completion
    mesh_part_finish: True

fesom_mesh_part:
    # Specify the raw mesh directory:
    mesh_dir: /some/path/to/mesh/dir
    # Where the finished, paritioned mesh should be placed:
    result_mesh_dir: /some/path/where/the/finished/mesh/should/be

Command Line Interface

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.

ESM Tools Plugin

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

Python Library Usage

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()

Indices and tables