Introduction#
Description#
The Mesher module is provided in order to perform batch mesh manipulations and combinations to pre-existing meshes, and import and export Z-set format files 1example problems using the mesher can be found in $Z7PATH/test/Mesher_test/INP
and in $Z7PATH/test/Zmaster/MESHER
. These operations supersede the meshing utility programs previously supplied with Zebulon. The normal mode of operation is as a batch process launched with the command Zrun -m
prob. The utilities are however also supported in some other applications, such as the batch mesher commands of the Zmaster geom and mesh menus.
An important thing to remember is that the ASCII file represents the objects and configuration options for a particular calculation. The computational modules are then run sequentially in order to modify or generate the mesh. This is therefore the configuration of an object system, and not the activation of repeated “database” manipulation commands.
Batch mode#
For batch operation, an ASCII input file is submitted to the Zrun program to manipulate and combine any number of meshes. The operation will generate more files depending on the options chosen. The most
common use is to generate a new ASCII .geof
or binary .geo
file for use in a FEA calculation.
See the syntax description for ****mesher below for a detailed overview of the mesher syntax, with some examples.
Running in Zmaster#
The batch mesh operations in Zmaster operate on the current mesh (accessed under the Mesh command, or act on a newly generated mesh after all the Zmaster domains are generated (in the Geom command). This later operation happens after regenerating the mesh with the Mesh Domain button. The figure below shows the dialogs which get opened after selecting the Batch Mesher Create button in the geometry toolbar.
The operation of the graphical interface for running batch meshers is described more completely in the Zmaster manual. Here we want to remark on the connection between the command file syntax described in this chapter and the dialog creation.
The available meshers are listed in the bottom list box of the Mesher Create dialog with the exact names of the **
-level command option in this chapter. The ***
level commands are not available in Zmaster, so the operation always applies to the currently loaded mesh. In the figure above, the mesher option **extension
(see page extension ) is selected. Selecting either New or Modify will open up an edit dialog with the options equivalent to the *
-level options of the selected mesher. The option data fields can then be typed directly into the dialog box entries.
User extensions#
Because there are in fact many many things one may wish to do to a mesh in the course of building a model, the interface for adding new mesh transformation commands is especially flexible and easy to program. The details of how to create a mesher are described in the separate Z-set Developer handbook, with example code in the distribution $Z7PATH/User-project
directory.
****mesher
#
Description#
The basic syntax for meshing operations follows the same logic as other parts of the program. Meshing blocks are started with the four asterisk command ****mesher
. The mesher can load different portions of the final mesh as independent meshes. The successful mesher will therefore learn to create a series of meshing operations, modifications, and unions for a final mesh.
Note
There is a modified syntax for the mesher which can be used by Zmaster in the .mast
file. The ****master
command accepts the sub-command ***mesher
which indicates that transformation commands from this chapter are to be applied every time the mesh button is pressed. One can move those commands outside the Zmaster program by changing the command to ****mesher
and including a ***mesh
/**open
group.
Syntax#
The major meshing commands are as follows:
****mesher
\(~\,\) [ ***delete_file
fname ]
\(~\,\) [ ***global_parameter
param-definitions ]
\(~\,\) [ ***shell
shell-command ]
\(~\,\) [ ***function_declarations
functions ]
\(~\,\) [ ***mesh
name ]
\(~\,\) ….
***delete_file
This allows entry of file names to delete before running the meshers. Usually this will be the new mesh file name to ensure a clean state before running.
***function_declarations
This command allows entry of function declarations ahead of the mesher applications, so that complex pre-defined functions can be used where function selection is allowed (e.g. nsets and so on). See function_declaration and functions.
***global_parameter
This base-level command allows setting of global parameter definitions in the mesher input to customize behavior. See the reference section in the Release/Zmaster manual.
***mesh
This command opens a new mesh object which will be the subject of meshing operations. Use the
**open
command to load an existing mesh in for operations. Any number of**
-level transformation commands can then be applied to the mesh before the next***
-level command. At the occurrence of the next***
-level command, the mesh will be saved to disk with the problem name given as a parameter to***mesh
. Following***mesh
/**open
operations can re-open the mesh for further processing.***shell
This command can be used to launch external programs to generate sub-meshes or other operations. Probably the most useful purpose for this command is to run a Zmaster batch job. If the global parameter Error.HandlingShellError is set to 1, a non 0 system exit of this command will result in a Z-set error. By default Error.HandlingShellError is set to 0 and if the command invoked results in an error, Z-set will continue without raising any error.
Examples#
Example 1
An example of the mesher commands as output by Zmaster is as follows:
% in prob.mast
****mesher
**extension
*elset face
*distance 3.000000e+00
*num 1
****return
These lines will make the element set face
(which was created using one of the domain tools) to be extended into a 3d mesh every time the mesh-domains button is pressed. The mesher commands could be moved into the .inp
file to separate the process:
%
% in prob.inp.. importing prob_2d.geof a,d applying an
% extension into 3d.
%
****mesher
***mesh prob
**open prob_2d.geof
**extension
*elset face
*distance 3.000000e+00
*num 1
****return
Example 2
One feature of the batch mesher is the ability to step through multiple meshing steps in the same file. For example a multi-part mesh can be generated using a combination of Zmaster batch jobs, and mesher transformers and unions:
****mesher
***shell Zrun -B part1.mast % generate a new, 2d part1.geof
***mesh part1 % start creating the 3d, also part1.geof
**open part1.geof % open the 2d created from Zmaster batch
**extension % now start extensions
*elset ALL_ELEMENT
*new_elset solid
*prog 1
*distance 0.5
*num 2
*dir (0 0 1 )
**nset z=0
*plane 0. 0. 1. 0.
*limit 0.001
***shell Zrun -B part2.mast % a ***-level command closes the prev. mesh
***mesh part2 % start the part2 mesh independently
**open part2.geof % and in the same way as above. This lets
% % us generate complex meshes in 1 run
% etc
%
****return