view msh2vtu.xml @ 0:be04ecda594e draft default tip

planemo upload for repository https://github.com/Helmholtz-UFZ/galaxy-tools/tree/main/tools/ogstools commit 406e30ee3cd2ab7762f1195328c06d547516690f
author ufz
date Thu, 06 Mar 2025 16:53:19 +0000
parents
children
line wrap: on
line source


<tool id="msh2vtu" name="OGSTools msh2vtu" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>
        Convert msh to UnstructuredGrid (vtk)
    </description>
    <macros>
        <import>macros.xml</import>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <expand macro="creator"/>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        ln -s '$input_file' input_file.msh &&
        msh2vtu input_file.msh 
            -d '$dim' 
            $delz $swapxy $reindex $keep_ids $ascii
            -l '$log_level'
    ]]></command>
    <inputs>
        <param name="input_file" type="data" format="gmsh.msh" label="Input GMSH File"/>
        <param name="dim" type="select" label="Set dimensionality of the mesh" argument="-d">
            <option value="1">1D</option>
            <option value="2">2D</option>
            <option value="3">3D</option>
        </param>
        <param name="delz" type="boolean" value="false" truevalue="-z" falsevalue="" label="Delete Z Coordinate" optional="true" argument="-z"/>
        <param name="swapxy" type="boolean" value="false" truevalue="-s" falsevalue="" label="Swap XY Coordinates" optional="true" argument="-s"/>
        <param name="reindex" type="boolean" value="false" truevalue="-r" falsevalue="" label="Reindex" optional="true" argument="-r"/>
        <param name="keep_ids" type="boolean" value="false" truevalue="-k" falsevalue="" label="Keep IDs" optional="true" argument="-k"/>
        <param name="ascii" type="boolean" value="false" truevalue="-a" falsevalue="" label="ASCII Output" optional="true" argument="-a"/>
        <param name="log_level" type="select" label="Log Level" argument="-l">
            <option value="ERROR" selected="true">ERROR</option>
            <option value="DEBUG">DEBUG</option>
            <option value="INFO">INFO</option>
            <option value="WARNING">WARNING</option>
        </param>
    </inputs>
    <outputs>
        <data name="boundary" format="xml" label="${tool.name} on ${on_string}: boundary" from_work_dir="input_file_boundary.vtu" />
        <data name="domain" format="xml" label="${tool.name} on ${on_string}: domain" from_work_dir="input_file_domain.vtu" />
        <data name="physical_group_Bottom" format="xml" label="${tool.name} on ${on_string}: physical_group_Bottom" from_work_dir="input_file_physical_group_Bottom.vtu" />
        <data name="physical_group_Left" format="xml" label="${tool.name} on ${on_string}: physical_group_Left" from_work_dir="input_file_physical_group_Left.vtu" />
        <data name="physical_group_Right" format="xml" label="${tool.name} on ${on_string}: physical_group_Right" from_work_dir="input_file_physical_group_Right.vtu" />
        <data name="physical_group_RockBed" format="xml" label="${tool.name} on ${on_string}: physical_group_RockBed" from_work_dir="input_file_physical_group_RockBed.vtu" />
        <data name="physical_group_SedimentLayer1" format="xml" label="${tool.name} on ${on_string}: physical_group_SedimentLayer1" from_work_dir="input_file_physical_group_SedimentLayer1.vtu" />
        <data name="physical_group_SedimentLayer2" format="xml" label="${tool.name} on ${on_string}: physical_group_SedimentLayer2" from_work_dir="input_file_physical_group_SedimentLayer2.vtu" />
        <data name="physical_group_SedimentLayer3" format="xml" label="${tool.name} on ${on_string}: physical_group_SedimentLayer3" from_work_dir="input_file_physical_group_SedimentLayer3.vtu" />
        <data name="physical_group_Top" format="xml" label="${tool.name} on ${on_string}: physical_group_Top" from_work_dir="input_file_physical_group_Top.vtu" />
    </outputs>
    <tests>
        <test>
            <param name="input_file" value="geolayers_2d.msh"/>
            <param name="dim" value="2"/>
            <param name="delz" value="True"/>
            <param name="swapxy" value="True"/>
            <param name="reindex" value="True"/>
            <param name="keep_ids" value="True"/>
            <param name="ascii" value="True"/>
            <param name="log_level" value="DEBUG"/>
            <output name="boundary" file="input_file_boundary.vtu"/>
            <output name="domain" file="input_file_domain.vtu"/>
            <output name="physical_group_Bottom" file="input_file_physical_group_Bottom.vtu"/>
            <output name="physical_group_Left" file="input_file_physical_group_Left.vtu"/>
            <output name="physical_group_Right" file="input_file_physical_group_Right.vtu"/>
            <output name="physical_group_RockBed" file="input_file_physical_group_RockBed.vtu"/>
            <output name="physical_group_SedimentLayer1" file="input_file_physical_group_SedimentLayer1.vtu"/>
            <output name="physical_group_SedimentLayer2" file="input_file_physical_group_SedimentLayer2.vtu"/>
            <output name="physical_group_SedimentLayer3" file="input_file_physical_group_SedimentLayer3.vtu"/>
            <output name="physical_group_Top" file="input_file_physical_group_Top.vtu"/> 
        </test>
    </tests>
    <help><![CDATA[
    **Overview:**

        msh2vtu is a application that converts a Gmsh (.msh) file for use in OGS by extracting domain-, boundary- and physical group-submeshes and saves them in a set of files in the vtu format.
        Supported element types:
        - lines (linear and quadratic) in 1D
        - triangles and quadrilaterals (linear and quadratic) in 2D
        - tetra- and hexahedrons (linear and quadratic) in 3D

    **Inputs:**

        1. **Input GMSH File:** The GMSH (.msh) file to be converted.
        2. **Mesh Dimension (dim):** Select the desired mesh dimension (1, 2, or 3).
        3. **Delete Z Coordinate (delz):** Boolean flag to remove the Z coordinate from the mesh (for 2D meshes with z=0).
        4. **Swap XY Coordinates (swapxy):** Boolean flag to swap the X and Y coordinates.
        5. **Reindex (reindex):** Renumber physical group / region / Material IDs to be renumbered beginning with zero.
        6. **Keep IDs (keep_ids):** By default, rename gmsh:physical to MaterialIDs and change type of corresponding cell data to INT32. If True, this is skipped.
        7. **ASCII Output (ascii):** Boolean flag to output the file in ASCII format instead of binary.
        8. **Log Level (log_level):** Set the level of logging details (DEBUG, INFO, WARNING, ERROR).

    **Outputs:**

        **Output VTU Files:** The converted mesh file as a set of files with VTU format.
    ]]></help>
    <expand macro="ogs_citation"/>
</tool>