Cubit 15.7 User Documentation
Sculpt is a separate parallel application designed to generate all-hex meshes on complex geometries with little or no user interaction. Sculpt was developed as a separate application so that it can be run independently from Cubit on high performance computing platforms. It was also designed as a separable software library so it can be easily integrated as an in-situ meshing solution within other codes. Cubit provides a front end command line and GUI for the Sculpt application. The command will build the appropriate input files based on the current geometry and can also automatically invoke Sculpt to generate the mesh and bring the mesh back to Cubit.
Sculpt is a stand-alone executable, separate from Cubit. In order for Cubit to start up Sculpt, it must be on your system and accessible to Cubit. The default installation of Cubit should install files in the correct locations for this to occur. Check with Cubit support if it did not come with your installation or you are not able to locate it or any of its supporting applications.
To run Sculpt from Cubit, four executable files are needed:
To view the current path to these executables that Cubit will use, issue the following command from the Cubit command window
Sculpt Parallel Path List
See the Sculpt Parallel Path Command for more info on setting and customizing these paths.
The following image illustrates the process flow when the sculpt parallel command is used in Cubit.
For the Sculpt meshing process, a set of files, including a facet-based stl file are written to disk. The sculpt application is then started up which in turn invokes mpiexec to start up multiple instances of psculpt in parallel. psculpt then performs the meshing and writes one exodus file per processor. These files can then be combined using epu and then imported back into Cubit for viewing.
When using the Sculpt Parallel command in Cubit, several temporary files will be written to the current working directory. Because of this, it is important to set your working directory before using Sculpt to a desired location where you want these files placed.
The command syntax for preparing a model for Sculpt is:
Sculpt Parallel [[volume <ids>] [block <ids>]]
[processors <value>]
[fileroot '<root filename>']
[exodus '<exodus filename>']
[{OVERWRITE|no_overwrite}]
[absolute_path]
[{EXECUTE|no_execute}]
[size <value>|autosize <value>]
[box {align | location <options>|expand <value>}]
[smooth <value>]
[csmooth <value>]
[num_laplace <value>]
[max_opt_iters <value>]
[opt_threshold <value>]
[curve_opt_thresh <value>]
[max_pcol_iters <value>]
[pcol_threshold <value>]
[max_deg_iters <value>]
[deg_threshold <value>]
[xintervals <value>]
[yintervals <value>]
[zintervals <value>]
[gen_sideset <value>]
[{void|NO_VOID}]
[void_block <value>]
[stair <value>]
[htet <value>]
[pillow <value>]
[adapt_type <value>]
[adapt_threshold <value>]
[adapt_levels <value>]
[scale <value>]
[xtranslate <value>]
[ytranslate <value>]
[ztranslate <value>]
[{COMBINE|no_combine}]
[{IMPORT|no_import}]
[{SHOW|no_show}]
[{capture|NO_CAPTURE}]
[{CLEAN|no_clean}]
[{gen_input_file <filename>|no_gen_input_file}]
[debug <value>]
The following table is a summary of options that can be invoked from the Cubit sculpt parallel command. It includes an abbreviated description of the option as well as the option's default. If the option is not explicitly used in the command, the default value listed will be used. The Sculpt option is the corresponding command that can be used in a sculpt input file when sculpt is invoked directly from a terminal window. See Sculpt Application for more information.
Cubit Option | Description | Default | Sculpt Option |
---|---|---|---|
volume <ids> | block <ids> | List of volumes or blocks to include in the mesh. | Volume all | stl_file, diatom_file, cubit option |
processors <value> | Number of processors to use for meshing. | 4 | num_procs |
fileroot '<root filename>' | Root of file names for output. | sculpt_parallel | cubit option |
exodus '<exodus filename>' | Output Exodus mesh file name | <'root filename'> | exodus_file |
OVERWRITE | no_overwrite | Force overwrite of files in directory | overwrite | cubit option |
absolute_path | Use absolute path for filenames | OFF (relative path) | cubit_option |
EXECUTE | no_execute | Run sculpt or dump input files only | execute | cubit option |
size <value> | autosize <value> | Set size of cells in Cartesian grid | autosize 10 | cell_size, cubit option |
xintervals <value> yintervals <value> zintervals <value> | Number of cells in each coordinate direction in the overlay Cartesian grid | automatically computed from size | nelx, nely, nelz |
box align | Automatically align geometry to grid | OFF | align |
box location <options> | Define bounds of the Cartesian grid | Enclosing bounding box with 2.5 additional cells on each side | xmin, ymin, zmin, xmax, ymax, zmax, cubit option |
box expand <value> | Define Cartesian grid by expansion percentage from a tight bounding box. | OFF | bbox_expand |
smooth <value> | Smoothing method for volumes and surfaces | 1 | smooth |
csmooth <value> | Smoothing method for curves | 5 | csmooth |
num_laplace <value> | Number of Laplacian smoothing iterations | 2 | laplacian_iters |
max_opt_iters <value> | Maximum number of parallel Jacobi optimization iterations | 5 | max_opt_iters |
opt_threshold <value> | Stopping criteria for Jacobi optimization smoothing | 0.6 | opt_threshold |
curve_opt_thresh <value> | Metric at which curves are not honored | 0.1 | curve_opt_thresh |
max_pcol_iters <value> | Maximum number of parallel coloring smoothing iterations | 100 | max_pcol_iters |
pcol_threshold <value> | Stopping criteria for parallel color smoothing | 0.2 | max_pcol_iters |
max_deg_iters <value> | Maximum number of degenerate iterations | 0 | max_deg_iters |
deg_threshold <value> | Convert hexes below threshold to degenerates | 0.2 | deg_threshold |
gen_sidesets | Sideset and nodeset generation method | 0 | gen_sidesets |
void | Mesh void | OFF | mesh_void |
void_block | Block ID of void mesh | 0 | void_mat |
stair <value> | Generate Stair-step mesh | OFF | stair |
htet <value> | Convert hexes below quality threshold to tets | -1 | htet |
pillow <value> | Set pillowing criteria | 0 | pillow |
adapt_type <value> | Adaptive meshing type | 0 | adapt_type |
adapt_threshold <value> | Threshold for adaptive meshing | 0.25 * cell_size / adapt_levels^2 | adapt_threshold |
adapt_levels <value> | Number of levels of adaptive refinement | 2 | adapt_levels |
scale <value> | Scale mesh by factor | 1.0 | scale |
xtranslate <value> ytranslate <value> ztranslate <value> | Translate mesh in coordinate directions | 0.0 | xtranslate, ytranslate, ztranslate |
COMBINE | no_combine | Combine Exodus mesh files into a single mesh for import | combine | cubit option |
IMPORT | no_import | Import the mesh after mesh generation in Sculpt | import | cubit option |
SHOW | no_show | Echo the ouput of Sculpt to command line window | show | cubit option |
capture | NO_CAPTURE | Project boundary nodes to STL geometry (beta feature) | no_capture | capture |
CLEAN | no_clean | Delete temporary files generated during Sculpt run | clean | cubit option |
gen_input_file <file name> | no_gen_input_file | Generate a Sculpt input file with current settings | gen_input_file | cubit option |
debug <value> | Set a debug processor for debugging | -1 | cubit option |
volume <ids> | block <ids>
fileroot '<root filename>'
OVERWRITE | no_overwrite
absolute_path
By default, Cubit will write the relative path names of files used in the .run and .diatom files. To force absolute path names to be written, use the absolute_path option
EXECUTE | no_execute
size <value> | autosize <value>
The size option is the absolute cell size for the Cartesian grid and is the same as the cell_size option in sculpt. The autosize option is a value between 0 and 10. It represents a model independent size where 1 is the small size and 10 is large. This is the same scaling factor used in Cubit's auto sizing but is divided by ten. A size value will be computed from the selected autosize and used as the absolute cell size for the base Cartesian grid.
box location <options>
Location options define the bounds of the Cartesian grid. The first Location <option> defines the minimum Cartesian coordinate of the grid and the second, the maximum. The <options> can be any valid method for defining a coordinate location in cubit. In most cases the position option can be used. The default is computed as an enclosing bounding box with 2.5 additional cells on each side.
COMBINE | no_combine
If the no_combine option is used, following execution of Sculpt, the resulting exodus meshes will not be combined using the epu seacas tool. Otherwise the default will automatically combine the meshes generated by each processor into a single mesh. Note that epu should be installed on your system and the path to epu defined using the sculpt parallel path command. Epu is a code developed by Sandia National Laboratories and is part of the SEACAS tool suite. It combines multiple Exodus databases produced by a parallel application into a single Exodus database. The epu program should be included with distributions of Cubit beginning with Version 15.0.
IMPORT | no_import
If the no_import option is used, following execution of Sculpt, the result will be not be imported into Cubit as a free mesh. The default IMPORT option will automatically import the mesh that was generated in Sculpt. If the no_combine option has been used, then multiple free meshes will be imported with duplicate nodes and faces at processor domain boundaries. Otherwise a single free mesh, the result of the epu code, will be imported. Note that the resulting mesh will not be associated with the original geometry, however Block (material) definitions will be maintained. In addition, a separate group will be generated for each imported mesh (One per processor). The default will automatically import the mesh following mesh generation in Sculpt.
SHOW | no_show
If the no_show option is used, while the external Sculpt process is running, no ouput from the Sculpt application will be displayed to the command window. Otherwise, the default SHOW is used and output from the Sculpt application will be echoed to the Cubit command window. This option is only effective if the no_execute is not used.
CLEAN | no_clean
gen_input_file <file name> | no_gen_input_file
An input file with the given file name will be generated when the command is executed. This is a text file containing all sculpt options used in the command. The input file is intended to be used for batch execution of sculpt. To run sculpt from the operating system command line you would use the -i option. For example: sculpt -i myinputfile.i -j 4 where myinputfile.i is the name of the input file specified with the gen_input_file option and -j 4 is the number of processors to use.
debug <value> The debug option is used only as a developer debugging tool. It will set the debug processor and sleep upon execution to allow a debugger to be attached to the process.
The command for letting Cubit know where the Sculpt and related applications are located is:
This command defines the path to psculpt, epu and mpiexec on your system. In most cases, however, these paths should be automatically set provided Sculpt was successfully installed with your Cubit installation. The list option will list the current paths that Cubit will use for these tools. If an alternate path to these executables is desired, it is recommended that this command be used in the .cubit initialization file so that it wont be necessary to define these parameters every time Cubit is run.Sculpt Parallel Path [List|Psculpt|Epu|Mpiexec]
In most cases, the Sculpt tool can be used without adjusting default values. Depending on the characteristics of the geometry to be meshed, the default values may not yield adequate mesh quality. Upon completion, Sculpt reports to the command line, a summary of the mesh that was generated. This includes a summary of the mesh quality. Care should be taken to review this summary to ensure the minimum mesh quality is in a range suitable for analysis.
The element metric used for computing mesh quality in Sculpt is the Scaled Jacobian. This is a value between -1 and 1 that is a relative measure of the angles at the element's nodes. A value of 1 indicates a perfect 90 degree angle between each of its edges. In most cases a value less than zero, or negtive Jacobian element, indicates an unusable mesh. Sculpt's default settings try to achieve a minimum Scaled Jacobian of 0.2, which is normally usable in most analysis. The following discussion provides several options for adjusting the model or Sculpt parameters to help improve mesh quality.
Identify regions where hexes are poor quality and zoom in to these regions.quality hex all scaled jacobian
quality hex all draw mesh
The following examples use this simple geometry. Execute these commands prior to performing the example Sculpt Parallel command line operations
sphere rad 1
sphere rad 1
vol 2 mov x 2
cylinder rad 1 height 2
vol 3 rota 90 about y
vol 3 mov x 1
unite vol all
Figure 1. Geometry created from the above commands and used for the following examples.
This example illustrates use of Sculpt with all default options. So that we can view the result, we will also use the overwrite, combine and import options.
sculpt parallel
draw block all
The result of this operation is shown in Figure 2. For this example, behind the scenes, Cubit built an input file for Sculpt, ran it on 4 processors, combined the resulting 4 meshes, and subsequently imported the resulting mesh into Cubit. Note that Volume 1 remains "unmeshed" and we have created a free mesh that is not associated with a volume. The result of any Sculpt command is always an unassociated free mesh.
Figure 2. Free mesh generated from sculpt command
This example illustrates the use of the size and box options
delete mesh
sculpt parallel size 0.1 box location position -1.5 0 -1.5 location position 1 1.5 0
draw block all
In this case we have used the size option to define the base cell size for the grid. We have also used the box option to define a bounding box in which the mesh will be generated. Any geometry falling outside of the bounding box is ignored by Sculpt. Figure 3 shows the mesh generated with this command.
Figure 3. Sculpt "box" option limits the extent of the generated mesh.
In this example we illustrate the use of the void option:
delete mesh
sculpt parallel size 0.1 box location position -1.5 0 -1.5 location position 1 1.5 0 void
draw block all
The result is shown in figure 4. Notice that this example is precisely the same as the last with the exception of the addition of the void option. Mesh is generated in the space surrounding the volume out to the extent of the bounding box. In this case, an additional material block is defined and automatically assigned an ID of 2. The nodes and element faces at the interface between the two blocks are shared between the two materials.
Figure 4. Sculpt "void" operation generates mesh outside the volume.
In this example we illustrate the use of the sideset option.
Generating sidesets on the free mesh with Cubit: Sideset boundary conditions can be manually created on the resulting free mesh from Sculpt using the standard Sideset <sideset_id> Face <id_range> syntax. The Group Seed command is also useful in grouping faces based on a feature angle to be used in a single sideset.
Generating sidesets in Sculpt: Sculpt also provides several options for defining sidesets as part of the Sculpt run. The following illustrates one option:
delete mesh
sculpt parallel size 0.1 box location position -1.5 0 -1.5 location position 1 1.5 0 void sideset 2
list sideset all
draw sideset all
Once again we use the same syntax but add the sideset 2 option to automatically generate a series of sidesets. The list command should reveal that 10 sidesets were defined for this example with IDs 1 to 10. Figure 5 shows the result of the draw command showing all of the sidesets in different colors. Note that for the sideset 2 option, sidesets are created with the following criteria:
See the sideset option above for a description of other options for generating sidesets in Sculpt.
Figure 5. Automatic sidesets created using Sculpt
Begin by setting your working directory to a location that is convenient for placing example files
cd "path/to/my/sculpt/examples"
Next we issue the basic sculpt parallel command to mesh the volume
delete mesh
sculpt parallel processors 8 fileroot "bean" over no_execute
In this case, we used the no_execute option which does not invoke the Sculpt application. Instead it will write a series of files to the working directory. The fileroot option defines the base file name for the files that will be written; in this case "bean". We also use the processors option to set the number of processors to be used to 8.
To see the files that Cubit placed in the working directory, bring up a terminal window on your desktop and change directories to the current working directory (ie. cd path/to/my/sculpt/examples). A directory listing should reveal 3 files as shown in Figure 6.
Figure 6. Directory listing of files written from Cubit
The following describes the purpose of each of the resulting files:
Figure 7. Unix command line for running Sculpt generated by Cubit
To run sculpt on the same machine, from the terminal window in your current working directory you would issue the following command:
./bean.run
If Sculpt is to be run on a different machine, copy the files in the working directory to the other machine and issue the same command. Remember to change the path to the mpiexec and psculpt executables to match those on the new machine. For running on cluster machines that have scheduling of resources, check with your system administrator for how to submit a job for running.
After running Sculpt, Figure 8 shows the resulting files that would be written to the current working directory.
Figure 8. 8 Exodus files were generated and placed in working directory
Note that 8 exodus files have been generated, 1 from each processor. These files can be used by themselves or used as-is for use in a simlation, or they can be combined into a single file. The exodus files produced by Sculpt include all appropriate parallel communication information as defined by the Nemesis format. Nemesis is an extension of Sandia's Exodus II format that also includes appropriate parallel communication information.
To combine the resulting exodus files into a single file, we can use the epu tool. Epu should be included in your Cubit distribution, but may require you to set up appropriate paths for it to be recognized. To run epu on this model, use the following command from a unix terminal window:
epu -p 8 bean.diatom_result
The result should be a single file with the name bean.diatom_result.e. The mesh in this file can then be imported into Cubit. Switch back to your Cubit application and from the command line type the following command:
import mesh "bean.diatom_result.e" no_geom
The result should be the same mesh we generated previously that is shown in Figure 2.
delete mesh
cylinder rad 0.5 height 3
cylinder rad 0.5 height 3
vol 5 mov x 2
The resulting geometry should look like the image in Figure 9.
Figure 9. Geometry used to demonstrate multiple materials with Sculpt
Use this geometry to generate a mesh using Sculpt.
sculpt parallel size 0.075
draw block all
The resulting mesh should look like the image in Figure 10.
Figure 10. Mesh generated on multiple materials
Notice that one mesh block per volume was created. We should also note that no boolean operations were performed prior to building the mesh with Sculpt. In fact, volumes 4 and 5 were significantly overlapping volume 1. This would be an invalid condition for normal Cubit meshing operations. Figure 11 shows a cut-away image of the mesh using the Clipping Plane tool.
Figure 11. Cut-away of mesh generated on multiple materials
We should also note that imprint/merge operations typically needed, were also not required. While it is usually best to avoid overlaps to avoid ambiguities in the topology, Sculpt is able to generate a mesh giving precedence to the most recently defined materials. Merging is performed strictly by geometric proximity. Volumes closer than about one half the user input size will normally be automatically merged.
Next, we will examine the mesh quality of the free mesh. The following command will display a graphical representation of the Scaled Jacobian metric.
quality hex all scaled jacobian draw mesh
The result is shown in Figure 12. Note the elements (colored red) at the interface between materials are unacceptable for simulation. This is caused by the Sculpt algorithm projecting nodes to a common curve interface shared by the materials.
Figure 12. Mesh quality of multi-material mesh.
In most cases, the poor element quality at material interfaces can be improved by using the pillow option. Adding this option will direct Sculpt to add an additional layer of elements surrounding each surface. To see the result of pillowing, issue the following commands:
delete mesh
sculpt parallel size 0.075 over combine import pillow 1
quality hex all scaled jacobian draw mesh
Figure 13. Mesh quality of multi-material mesh using pillow option
The resulting mesh is showed in Figure 13. Note the improved mesh quality at the shared curve interface. A closer look at the mesh, shown in Figure 14. reveals the additional layer of hexes surrounding each surface that allows for improved mesh quality when compared with Figure 11. When generating meshes with multiple materials that must share common interfaces, the pillow option is usually recommended.
Figure 14. Cutaway of mesh reveals the additional layer of hexes surrounding each surface when the pillow option is used.