comparison neper_tessellation.xml @ 0:03bbcfd3d708 draft default tip

"planemo upload for repository https://github.com/ximg-chess/galaxytools/tree/master/tools/neper commit 9f77ab5ee7831c00b3a27e02ec8e59d95e6fb9cf"
author ximgchess
date Thu, 07 Jul 2022 12:31:10 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:03bbcfd3d708
1 <tool id="neper_tessellation" name="Neper Tessellation" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@" python_template_version="3.5">
2 <description>generates polycrystals as tessellations</description>
3 <macros>
4 <import>macros.xml</import>
5 <token name="@VERSION_SUFFIX@">0</token>
6
7 <xml name="cells">
8 <conditional name="cells">
9 <param name="format" argument="-n" type="select" label="Specify cells by">
10 <option value="number">number</option>
11 <option value="from_morpho">from_morpho</option>
12 <option value="expression"></option>
13 </param>
14 <when value="number">
15 <param name="number_of_cells" argument="-n" type="integer" value="10" min="1" label="the number of cells of the tessellation"/>
16 </when>
17 <when value="from_morpho">
18 </when>
19 <when value="expression">
20 </when>
21 </conditional>
22 </xml>
23 <token name="@CELLS@">
24 #if $cells.format == 'number'
25 -n $cells.number_of_cells
26 #elif $cells.format == 'from_morpho'
27 -n from_morpho
28 #end if
29 </token>
30
31 <xml name="tessellation">
32 <conditional name="tessellation">
33 <param name="dim" argument="-dim" type="select" label="Dimensions">
34 <option value="3" selected="true">3D</option>
35 <option value="2">2D</option>
36 </param>
37 <when value="3">
38 <conditional name="domain">
39 <param name="shape" argument="-domain" type="select" label="Domain">
40 <option value="cube">cube</option>
41 <option value="cylinder">cylinder</option>
42 <option value="sphere">sphere</option>
43 </param>
44 <when value="cube">
45 <param name="size_x" type="float" value="1.0" min="0.0" label="size x"/>
46 <param name="size_y" type="float" value="1.0" min="0.0" label="size y"/>
47 <param name="size_z" type="float" value="1.0" min="0.0" label="size z"/>
48 </when>
49 <when value="cylinder">
50 <param name="height" type="float" value="1.0" min="0.0" label="height"/>
51 <param name="diameter" type="float" value="1.0" min="0.0" label="diameter"/>
52 </when>
53 <when value="sphere">
54 <param name="diameter" type="float" value="1.0" min="0.0" label="diameter"/>
55 </when>
56 </conditional>
57 </when>
58 <when value="2">
59 <conditional name="domain">
60 <param name="shape" argument="-domain" type="select" label="Domain">
61 <option value="square">square</option>
62 <option value="circle">circle</option>
63 </param>
64 <when value="square">
65 <param name="size_x" type="float" value="1.0" min="0.0" label="size x"/>
66 <param name="size_y" type="float" value="1.0" min="0.0" label="size y"/>
67 </when>
68 <when value="circle">
69 <param name="diameter" type="float" value="1.0" min="0.0" label="diameter"/>
70 </when>
71 </conditional>
72 </when>
73 </conditional>
74 </xml>
75 <token name="@TESSELLATION@">
76 -dim $tessellation.dim
77 #if $tessellation.domain.shape == 'cube'
78 -domain "${tessellation.domain.shape}($tessellation.domain.size_x,$tessellation.domain.size_y,$tessellation.domain.size_z)"
79 #elif $tessellation.domain.shape == 'cylinder'
80 -domain "${tessellation.domain.shape}($tessellation.domain.height,$tessellation.domain.diameter)"
81 #elif $tessellation.domain.shape == 'sphere'
82 -domain "${tessellation.domain.shape}($tessellation.domain.diameter)"
83 #elif $tessellation.domain.shape == 'square'
84 -domain "${tessellation.domain.shape}($tessellation.domain.size_x,$tessellation.domain.size_y)"
85 #elif $tessellation.domain.shape == 'circle'
86 -domain "${tessellation.domain.shape}($tessellation.domain.diameter)"
87 #end if
88 </token>
89
90 <xml name="morpho">
91 <conditional name="morpho">
92 <param name="morpho_type" argument="-morpho" type="select" label="Morphology">
93 <option value="voronoi" selected="true">voronoi</option>
94 <option value="tesr">tesr file</option>
95 <option value="gg">graingrowth</option>
96 </param>
97 <when value="voronoi">
98 </when>
99 <when value="tesr">
100 <param name="tesr_file" type="data" format="neper.tesr" label="tesr file" help="Use -n from_morpho"/>
101 <param name="pts_region" type="select" optional="true" label="control points region">
102 <option value="surf">surface voxels</option>
103 <option value="all">all voxels</option>
104 </param>
105 <param name="pts_res" type="float" value="" min="1.0" optional="true" label="control points resolution" help="average number of control points along a direction of a grain"/>
106 </when>
107 <when value="gg">
108 </when>
109 </conditional>
110 </xml>
111 <token name="@MORPHO@">
112 #if $morpho.morpho_type == 'tesr'
113 -morpho "tesr:file($morpho.tesr_file)"
114 #set $pts = []
115 #if $morpho.pts_region
116 #silent $pts.append('region=' + str($morpho.pts_region))
117 #end if
118 #if $morpho.pts_res
119 #silent $pts.append('res=' + str($morpho.pts_res))
120 #end if
121 #if $pts
122 #set $args = ','.join($pts)
123 -morphooptiobj "tesr:pts($args)"
124 #end if
125 #end if
126 </token>
127
128 <xml name="morphooptistop">
129 <section name="morphooptistop" expanded="false" title="Set Optimization Stop Criteria">
130 <param argument="-eps" type="float" value="" optional="true" label="Absolute error on objective function"/>
131 <param argument="-reps" type="float" value="" optional="true" label="Relative error on objective function"/>
132 <param argument="-xeps" type="float" value="" optional="true" label="Absolute error on components of the solution vector"/>
133 <param argument="-xreps" type="float" value="" optional="true" label="Relative error on components of the solution vector"/>
134 <param argument="-itermax" type="integer" value="" min="1" optional="true" label="After n iterations"/>
135 <param argument="-loopmax" type="integer" value="" min="1" optional="true" label="After n iteration loops"/>
136 <param argument="-time" type="float" value="" optional="true" label="After n seconds"/>
137 </section>
138 </xml>
139 <token name="@MORPHOOPTISTOP@">
140 #set $stops = []
141 #if $morphooptistop.eps
142 #silent $stops.append('eps=' + str($morphooptistop.eps))
143 #end if
144 #if $morphooptistop.reps
145 #silent $stops.append('reps=' + str($morphooptistop.reps))
146 #end if
147 #if $morphooptistop.xeps
148 #silent $stops.append('xeps=' + str($morphooptistop.xeps))
149 #end if
150 #if $morphooptistop.xreps
151 #silent $stops.append('xreps=' + str($morphooptistop.xreps))
152 #end if
153 #if $morphooptistop.itermax
154 #silent $stops.append('itermax=' + str($morphooptistop.itermax))
155 #end if
156 #if $morphooptistop.loopmax
157 #silent $stops.append('loopmax=' + str($morphooptistop.loopmax))
158 #end if
159 #if $morphooptistop.time
160 #silent $stops.append('time=' + str($morphooptistop.time))
161 #end if
162 #if $stops
163 #set $stopargs = ','.join($stops)
164 -morphooptistop "$stopargs"
165 #end if
166 </token>
167
168 <xml name="regularization">
169 <conditional name="regularization">
170 <param name="regularize" argument="-regularization" type="select" label="Regularize tessellation">
171 <option value="0">No</option>
172 <option value="1">Yes</option>
173 </param>
174 <when value="0"/>
175 <when value="1">
176 <param name="fmax" argument="-fmax" type="float" value="20.0" min="0.0" max="180.0" label="face flatness fault (in degrees)"
177 help="The flatness fault is the maxi- mum angle between the normals at two locations on a face."/>
178 <param name="mloop" argument="-mloop" type="integer" value="2" min="1" label="maximum number of regularization loops"/>
179 </when>
180 </conditional>
181 </xml>
182 <token name="@REGULARIZATION@">
183 -reg $regularization.regularize
184 #if $regularization.regularize == '1'
185 -fmax $regularization.fmax
186 -mloop $regularization.mloop
187 #end if
188 </token>
189
190 <xml name="output_options">
191 <section name="output_options" expanded="false" title="Output_options">
192 <param name="tesrformat" argument="-tesrformat" type="select" optional="true" label="TESR format">
193 <option value="ascii">ASCII</option>
194 <option value="binary8">8-bit binary / unsigned char-type</option>
195 <option value="binary16">16-bit binary / short-type little endian</option>
196 <option value="binary16_big">16-bit binary / short-type big endian</option>
197 <option value="binary32">32-bit binary / int-type little endian</option>
198 <option value="binary32_big">32-bit binary / int-type big endian</option>
199 </param>
200 <param name="tesrsize" argument="-tesrsize" type="text" value="" optional="true" label="TESR size">
201 <help><![CDATA[
202 Specify the number of points of a raster tessellation along a direction of the domain. In case of a domain of different lengths along the different directions, the argument stands for the geometrical average of the number of points along the different directions, so that the raster points are as close to cubic as possible. To specify different values along the x, y and z directions, combine the values with ‘:’. Default value: 20
203 ]]></help>
204 <validator type="regex" message="integer sizes">[1-9]\d(:[1-9]\d+){,2}</validator>
205 </param>
206 <!-- macro for oridescriptor -->
207 </section>
208 </xml>
209 <token name="@OUTPUT_OPTIONS@">
210 #if 'tesr' in $format
211 #if $output_options.tesrformat:
212 -tesrformat '$output_options.tesrformat'
213 #end if
214 #if $output_options.tesrsize:
215 -tesrsize '$output_options.tesrsize'
216 #end if
217 #end if
218 </token>
219 </macros>
220 <expand macro="requirements" />
221 <expand macro="version_command" />
222 <command detect_errors="exit_code"><![CDATA[
223 neper -T
224 @CELLS@
225 @TESSELLATION@
226 @MORPHO@
227 @MORPHOOPTISTOP@
228 @TRANSFORM@
229 @REGULARIZATION@
230 @OUTPUT_OPTIONS@
231 -format "$format"
232 -o output
233 | grep -v '%$' | tee 'neper.log'
234 ]]></command>
235 <inputs>
236 <expand macro="cells"/>
237 <expand macro="tessellation"/>
238 <expand macro="morpho"/>
239 <expand macro="morphooptistop"/>
240 <expand macro="transform"/>
241 <expand macro="regularization"/>
242 <expand macro="output_options"/>
243 <param name="format" argument="-format" type="select" multiple="true" optional="false" label="Output format">
244 <option value="tess" selected="true">Neper scalar tessellation file (.tess)</option>
245 <option value="tesr">Neper raster tessellation file (.tesr)</option>
246 <option value="vtk">VTK raster file (.vtk)</option>
247 <option value="geo">Gmsh geometry file (.geo)</option>
248 <option value="ply">Polygon File Format file (.ply)</option>
249 </param>
250 </inputs>
251 <outputs>
252 <data name="log" format="txt" label="${tool.name} on ${on_string} log" from_work_dir="neper.log"/>
253 <data name="output_tess" format="neper.tess" label="${tool.name} on ${on_string} tess" from_work_dir="output.tess">
254 <filter>'tess' in format</filter>
255 </data>
256 <data name="output_tesr" format="neper.tesr" label="${tool.name} on ${on_string} tesr" from_work_dir="output.tesr">
257 <filter>'tesr' in format</filter>
258 </data>
259 <data name="output_vtk" format="vtkbinary" label="${tool.name} on ${on_string} vtk" from_work_dir="output.vtk">
260 <filter>'vtk' in format</filter>
261 </data>
262 <data name="output_ply" format="plyascii" label="${tool.name} on ${on_string} ply" from_work_dir="output.ply">
263 <filter>'ply' in format</filter>
264 </data>
265 <data name="output_geo" format="gmsh.geo" label="${tool.name} on ${on_string} geo" from_work_dir="output.geo">
266 <filter>'geo' in format</filter>
267 </data>
268 </outputs>
269 <tests>
270 <!-- Test-1 neper -T -n 4 -->
271 <test>
272 <conditional name="cells">
273 <param name="format" value="number"/>
274 <param name="number_of_cells" value="4"/>
275 </conditional>
276 <output name="output_tess">
277 <assert_contents>
278 <has_text text="***tess" />
279 <has_text_matching expression="[*][*]cell\n 4\n [*]id\n 1 2 3 4\n"/>
280 </assert_contents>
281 </output>
282 </test>
283 <!-- Test neper -T -n from_morpho -domain "cube(0.5,0.5,0.5)" -morpho "tesr:file(example_tesr.tesr)" -morphooptiobj "tesr:pts(region=surf,res=7)" -morphooptistop itermax=30 -reg 1 -->
284 </tests>
285 <help><![CDATA[
286 **Neper Tessellation**
287
288 @NEPER_HELP@
289
290 Neper Tessellation Module *-T* generates polycrystals as tessellations. The two main capabilities are:
291
292 (i) the generation of tessellations from cell properties (e.g. a size distribution)
293 (ii) the genera- tion of multiscale tessellations (i.e. including cell subdivisions).
294
295 These capabilities can also be used together. Tessellations are Laguerre (or Voronoi) tessellations and are therefore composed of convex cells. Once generated, the tessellations can be “regularized” by removing their smallest features (edges and faces), which then enables good-quality meshing with module -M. Periodicity conditions can be prescribed. Crystal orientations are pro- vided for the cells.
296
297 The output is a tessellation file written at a scalar (vectorial) or raster format. Scalar tessellations are intended to be passed to modules -M and -V while raster tessellations can be used by FFT solvers.
298
299 ]]></help>
300 <expand macro="citations" />
301 </tool>