-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap for shp2msh and msh2vtu #66
Open
tStehling
wants to merge
28
commits into
Helmholtz-UFZ:main
Choose a base branch
from
tStehling:ogsTools
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+56,235
−0
Open
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
29da0c5
wrap for msh2vtu
tStehling 0fc4cc6
.
tStehling 95dceab
shp2msh wrap
tStehling 76842bb
...
tStehling 005f107
...
tStehling 31e00b8
finalization of shp2msh and msh2vtu wraps
tStehling ef2d9e4
Delete tools/ogs_tools directory
tStehling cd1871f
Delete tools/msh2vtu.xml
tStehling ad88581
Update msh2vtu.xml
tStehling b5abddd
Update shp2msh.xml
tStehling e6c40dd
Added macros
tStehling c881e3d
Wrapped AddLayer tool
tStehling 0d225d8
fixes according to comments
tStehling 9577071
fixes on shed.yml
tStehling 0caf414
. deleted
tStehling bee79e7
remove work in progress tools
tStehling 0d21443
removed work in progress files
tStehling ebf243b
wrap for generateStructuredMesh
tStehling 10388a1
cleaned
tStehling 4a6ca30
cleaned
tStehling c1a151c
changed .shed.yml
tStehling 4124587
Added directory structure
tStehling 0795e6a
directory struct
tStehling 6d18ae3
changed requirements
tStehling a1e1d82
.
tStehling dcf8b1d
.
tStehling 5dd6479
Move creator
bernt-matthias 6484643
Simplify requirements
bernt-matthias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: suite_ogs_tools | ||
owner: ufz | ||
description: A suite of tools for OpenGeoSys (ogs) | ||
long_description: | | ||
A suite of tools for ogs. | ||
categories: | ||
- Ecology | ||
remote_repository_url: https://gitlab.opengeosys.org/ogs/tools/ogstools | ||
homepage_url: https://www.opengeosys.org/ | ||
type: unrestricted | ||
auto_tool_repositories: | ||
name_template: "{{ tool_id }}" | ||
description_template: A suite of tools for OpenGeoSys (ogs) | ||
suite: | ||
name: suite_ogs_tools | ||
description: A suite of tools for ogs. | ||
long_description: | | ||
A suite of tools for ogs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<macros> | ||
<token name="@TOOL_VERSION@">0.4.0</token> | ||
<token name="@PROFILE@">23.0</token> | ||
<token name="@VERSION_SUFFIX@">0</token> | ||
|
||
<xml name="ogs_requirement"> | ||
<requirement type="package" version="@TOOL_VERSION@">ogstools</requirement> | ||
<yield/> | ||
|
||
</xml> | ||
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<xml name="ogs_citation"> | ||
<citations> | ||
<citation type="doi">10.5281/zenodo.13685289</citation> | ||
</citations> | ||
</xml> | ||
|
||
<xml name="creator"> | ||
<creator> | ||
<organization name="Helmholtz Centre for Environmental Research - UFZ" url ="https://www.ufz.de/"/> | ||
</creator> | ||
</xml> | ||
</macros> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
|
||
<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"/> | ||
<requirements> | ||
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<expand macro="ogs_requirement"/> | ||
</requirements> | ||
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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" 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}: boundary" from_work_dir="input_file_boundary.vtu" /> | ||
<data name="domain" format="xml" label="${tool.name}: domain" from_work_dir="input_file_domain.vtu" /> | ||
<data name="physical_group_Bottom" format="xml" label="${tool.name}: physical_group_Bottom" from_work_dir="input_file_physical_group_Bottom.vtu" /> | ||
<data name="physical_group_Left" format="xml" label="${tool.name}: physical_group_Left" from_work_dir="input_file_physical_group_Left.vtu" /> | ||
<data name="physical_group_Right" format="xml" label="${tool.name}: physical_group_Right" from_work_dir="input_file_physical_group_Right.vtu" /> | ||
<data name="physical_group_RockBed" format="xml" label="${tool.name}: physical_group_RockBed" from_work_dir="input_file_physical_group_RockBed.vtu" /> | ||
<data name="physical_group_SedimentLayer1" format="xml" label="${tool.name}: physical_group_SedimentLayer1" from_work_dir="input_file_physical_group_SedimentLayer1.vtu" /> | ||
<data name="physical_group_SedimentLayer2" format="xml" label="${tool.name}: physical_group_SedimentLayer2" from_work_dir="input_file_physical_group_SedimentLayer2.vtu" /> | ||
<data name="physical_group_SedimentLayer3" format="xml" label="${tool.name}: physical_group_SedimentLayer3" from_work_dir="input_file_physical_group_SedimentLayer3.vtu" /> | ||
<data name="physical_group_Top" format="xml" label="${tool.name}: 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<tool id="shp2msh" name="ogstools shp2msh" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> | ||
<description> | ||
Convert shp to msh | ||
</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
<token name="@VERSION_SUFFIX@">0</token> | ||
</macros> | ||
<expand macro="creator"/> | ||
<requirements> | ||
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<expand macro="ogs_requirement"/> | ||
</requirements> | ||
bernt-matthias marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<command detect_errors="exit_code"><![CDATA[ | ||
export SHAPE_RESTORE_SHX=YES && | ||
ln -s '$input_shp' input.shp && | ||
shp2msh --input input.shp --output output.vtu | ||
#if str($cellsize)!="": | ||
--cellsize '$cellsize' | ||
#end if | ||
'$meshing' | ||
'$simplify' | ||
]]></command> | ||
<inputs> | ||
<param name="input_shp" type="data" format="shp" label="Input SHP File" argument="-i"/> | ||
<param name="cellsize" type="float" min="40" optional="true" label="cellsize" argument="-c"/> | ||
<param name="meshing" type="select" label="meshing"> | ||
<option value="triangle" selected="true">Triangle</option> | ||
<option value="gmsh">Gmsh</option> | ||
</param> | ||
<param name="simplify" type="select" label="simplify"> | ||
<option value="simplified">Simplified</option> | ||
<option value="original" selected="true">Original</option> | ||
</param> | ||
</inputs> | ||
<outputs> | ||
<data name="output" format="xml" from_work_dir="output.vtu"/> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<param name="input_shp" value="circle.shp"/> | ||
<param name="cellsize" value="500.0"/> | ||
<param name="meshing" value= "triangle"/> | ||
<param name="simplify" value="simplified"/> | ||
<output name="output" value="output.vtu"/> | ||
</test> | ||
<test> | ||
<param name="input_shp" value="circle.shp"/> | ||
<param name="meshing" value= "gmsh"/> | ||
<param name="simplify" value="original"/> | ||
<output name="output" value="output2.vtu"/> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
**Overview:** | ||
This tool takes a shapefile (.shp) as input and creates a mesh using either the Triangle or GMSH method. | ||
The cellsize can be optionally specified, and the shapefile can be simplified before meshing. | ||
Output data has the format .vtu/ .vtk. | ||
|
||
**Inputs:** | ||
|
||
1. **Input Shape File:** The .shp file to be converted. | ||
2. **Cellsize:** Select the desired cellsize min=40. | ||
3. **Meshing:** Choose either triangle or gmsh. | ||
4. **Simplify:** Either the shapefiles are kept unchanged or they can be simplified. Choose between original and simplified. | ||
|
||
**Outputs:** | ||
|
||
**Output VTU Files:** The converted mesh as a VTU file. | ||
]]></help> | ||
<expand macro="ogs_citation"/> | ||
</tool> |
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to find a fitting category. I'm going to ask Lars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
galaxyproject/planemo#1483