#### 5.6` `Mesh Modification

After meshing is completed, it may be desirable to change features of the mesh without remeshing the whole volume. Mesh modification methods include tools for improving mesh quality, repositioning mesh elements, or changing mesh density. These methods can be applied on the whole model, or on small sections of the model without requiring remeshing the geometry, and without modifying the underlying geometry.

##### 5.6.1` `Mesh Smoothing

After generating the mesh, it is sometimes necessary to modify that mesh, either by changing the positions of the nodes or by removing the mesh altogether. Cubit contains a variety of mesh smoothing algorithms for this purpose. Node positions can also be fixed, either by specific node or by geometry entity, to restrict the application of smoothing to non-fixed nodes.

Mesh smoothing in Cubit operates in a similar fashion to mesh generation, i.e. it is a process whereby a smooth scheme is chosen and set, then a smooth command performs the actual smoothing. Like meshing algorithms, there is a variety of smoothing algorithms available, some of which apply to multiple geometry entity types and some which only apply to one specific type (these algorithms are described below.)

To smooth the mesh on a geometry entity

On the Command Panel, click on Mesh.

Click on Volume, Surface or Curve.

Click on the Smoothing action button.

Select the desired scheme from the drop-down menu.

Enter the appropriate values for Volume ID(s), Surface ID(s) or Curve ID(s). This can also be done using the Pick Widget function.

Depending on the scheme selected, optionally specify the Tolerance.

Enter any other appropriate settings.

Click Apply.

{curve|surface|volume} <range> Smooth Scheme <scheme>

where <scheme> is any acceptable smooth scheme described in this section. Also set any scheme-specific information, using the smooth scheme setting commands described below.

smooth curve <range>

smooth surface <range> [global]

smooth {body|volume|group} <range>

Groups of entities may be smoothed, by smoothing a group or a body.

If a Body is specified, the volumes in that Body are smoothed. If a Group is specified, only the volume meshes within these groups are smoothed - no smoothing of the surface meshes is performed.

##### 5.6.1.1` `Global Smoothing

When smoothing a set of surfaces, the keyword global can be added to the smooth command such as

smooth surface <range> [global]

If the smoothing algorithm for two neighboring surfaces are both allowed to move boundary nodes, then appending the "global" keyword will often result in a higher quality mesh near the curve(s) shared by those two surfaces.

##### 5.6.1.2` `Focused Smoothing on Groups of Mesh Entities

Meshed entities such as hexes or tris can be smoothed individually or in groups by specifying the entities in a list.

To smooth hexes and tets

On the Command Panel, click on Mesh.

Click on Hex or Tet.

Click on the Smooth action button.

Enter the appropriate value for Hex ID(s) or Tet ID(s). This can also be done using the Pick Widget function.

Optionally, specify the scheme.

Click Apply.

To smooth quads, tris and edges

On the Command Panel, click on Mesh.

Click on Quad, Tri or Edge.

Click on the Smooth action button.

Enter the appropriate value for Quad ID(s), Tri ID(s) or Edge ID(s). This can also be done using the Pick Widget function.

Optionally, specify the scheme.

Enter the appropriate value for Target Surface ID or Target Curve ID. This can also be done using the Pick Widget function.

Click Apply.

Smooth {Hex|Tet} <range>[Scheme {Equipotential|Laplacian|Random}]

Smooth {Face|Tri} <range>[Scheme {Laplacian|Centroid|Winslow}] [Target Surface <id>]

Smooth Edge <id_range> [Scheme Laplacian] [Target Surface <id>]

The smooth face|tri command is used to smooth individual faces or triangles. The target option is similar to the curve target option above. Faces or Tris can be smoothed to a surface that is not necessarily the owning surface; in fact, the faces or tris do not even have to be attached to any surface. This makes this option especially helpful for smoothing free meshes. Specifying a smooth scheme allows for relaxation based surface smoothers (i.e. centroid area pull, laplacian, winslow) to be utilized during targeted smoothing. It is not currently enabled for optimization based smoothing schemes.

##### 5.6.1.3` `Smooth Tolerance

[Set] Smooth Tolerance <tol>

The default value for tol is 0.05. The maximum number of iterations may be set by the user. For volumes, the smooth tolerance and iterations may also be set by

Volume Smooth Tolerance <tol>

Volume Smooth Iterations <iters>

##### 5.6.1.4` `Boundary Mesh Smoothing

Where used in the smooth schemes below, the Free keyword permits the nodes lying on the bounding entities to "float" along those entities; without this keyword, boundary nodes remain fixed.

{Curve|Surface|Volume} <range> Node Position {Fixed|Free}

Node <range> Position {Fixed|Free}

{Curve|Surface|Volume} Mesh {Fixed|Free}

##### 5.6.1.5` `Adjust Boundary Orthogonal

Applies to: Surface Meshes

Summary: This smoother creates a near orthogonal grid and optionally will make an orthogonal grid if the geometry permits.

To adjust boundary orthogonal

On the Command Panel, click on Mesh and then Surface.

Click on the Smooth action button.

Select Orthogonal from the drop-down menu.

Enter in the appropriate values for Surface ID(s). This can also be done using the Pick Widget function.

Optionally enter in the appropriate settings for Normal to Curve and Fix Nodes On Curve.

Click Apply.

adjust boundary [orthogonal] {surface|group} <id_range> [Iterations <val>] [snap_to_normal [curve <id>] [fixed curve <id>]]

Adjust Boundary Orthogonal iteratively applies the centroidal area pull algorithm with free boundary nodes. This approximates the affects of an elliptical smoothing algorithm. This algorithm works best with mapped meshes which have an element aspect ratio close to 1. The snap_to_normal option is not allowed for non-mapped meshes.

Figure 1. The affect of the "adjust boundary orthogonal surface 1" on a chevron shape. Note that the nodes are pulled into the acute angles and the edges at the boundary are pulled into a position that is closer to perpendicular at the boundary.

With some geometries with a mapped mesh it is possible to draw a line that is orthogonal to a boundary curve along the entire u or v direction of the mesh. In these cases, this command optionally allows the user to specify the option snap_to_normal. Nodal lines will be created normal to the first curve this is found that will allow perpendicular element edges to span the mesh. The user may optionally specify a curve that is used as the perpendicular basis for projecting the edges.

An edge may also be set as fixed so that a subsequent adjust boundary orthogonal will not affect that edge. If both snap_to_normal and fixed are set, the curve ids MUST be identical.

Figure 2. The affect of adjust boundary orthogonal with the snap to normal curve option is shown. The resulting mesh is orthogonal to the given boundary and projects straight through the mesh.

The following is an example of how to use this command to create the desired grid in Cubit. Note that to get the desired orthogonal grid the user must adjust the surfaces one at a time.

reset

create surface ellipse major radius 2 minor radius 1 zplane

imprint volume 1with position 0 1 0

create curve offset curve 2 distance 1 extended

create curve offset curve 4 distance 2 extended

create surface skin curve 2 4

create surface skin curve 4 5

delete surface 1

merge all

surface all scheme map

mesh surf all

adjust boundary orthogonal surface 2 snap_to_normal curve 6

adjust boundary orthogonal surface 3snap_to_normal curve 4 fixed curve 4

##### 5.6.1.6` `Centroid Area Pull

Applies to: Surface Meshes

Summary: Attempts to create elements of equal area

To create elements of equal area

On the Command Panel, click on Mesh and then Surface.

Click on the Smooth action button.

Select Centroid Area from the drop-down menu.

Enter in the appropriate values for Surface ID(s). This can also be done using the Pick Widget function.

Click Apply.

Surface <range> Smooth Scheme Centroid Area Pull [Free]

This smooth scheme attempts to create elements of equal area. Each node is pulled toward the centroids of adjacent elements by forces proportional to the respective element areas (Jones, 74).

##### 5.6.1.7` `Condition Number

Applies to: Triangular or Quadrilateral Surface Meshes, Tetrahedral or Hexahedral Volume Meshes. Does not apply to Mixed Element Meshes.

Summary: Optimizes the mesh condition number to produce well-shaped elements.

To use the condition number smoother

On the Command Panel, click on Mesh and then Surface.

Click on the Smooth action button.

Select Condition Number from the drop-down menu.

Enter in the appropriate values for Surface ID(s). This can also be done using the Pick Widget function.

Enter in the appropriate settings for Condition Number and Time (minutes).

Click Apply.

Surface <surface_id_range> Smooth Scheme Condition Number [beta <double=2.0>] [cpu <double=10>]

Discussion:

The condition number smoother is designed to be the most robust smoother in Cubit because it guarantees that if the initial mesh is non-inverted then the smoothed mesh will also be non-inverted. The price exacted for this capability is that this smoother is not as fast as some of the other smoothers.

Condition Number measures the distance of an element from the set of degenerate (non-convex or inverted) elements. Optimization of the condition number increases this distance and improves the shape quality of the elements. Condition number optimization requires that the given mesh contain no negative Jacobians. If the mesh contains negative Jacobians and this command is issued, Cubit automatically calls the Untangle smoother and attempts to remove the negative Jacobians. If successful, condition number smoothing occurs next; the resulting mesh should have no negative Jacobians. If untangling is unsuccessful, condition number smoothing is not performed.

There is no "fixed/free" option with this command; boundary nodes are always held fixed.

The command above only sets the smoothing scheme; to actually smooth the mesh one must subsequently issue the command "smooth surface <surface_id_range>" or "smooth volume <volume_id_range>".

Stopping Criteria: Smoothing will proceed until the objective function has been minimized or until one of two user input stopping criteria are satisfied. To input your own stopping criterion use the optional parameters ’beta’ and ’cpu’ in the command above. The value of beta is compared at each iteration to the maximum condition number in the mesh. If the maximum condition number is less than the value of beta, the iteration halts. In Cubit condition number ranges from 1.0 to infinity, with 1.0 being a perfectly shaped element. Thus the smaller the maximum condition number, the better the mesh shape quality. The default value of the beta parameter is 2.0. The value supplied for the "cpu" stopping criterion tells the code how many minutes to spend trying to optimize the mesh. The default value is 10 minutes. Optimization may also be halted by using "control-C" on your keyboard.

To view a detailed report of the smoothing in progress issue the command "set debug 91 on" prior to smoothing the surfaces or volumes. You will get a synopsis of whether or not untangling is needed first and whether the stopping criteria have been satisfied. In addition the following printout information is given for each iteration of the conjugate gradient numerical optimization:

iteration=n, evals=m, fcn=value1, dfmax=value2, time=value3 ave_cond=value4, max_cond=value5, min_jsc=value6

n is the iteration count, m is the number of objective function evaluations performed per iteration, value1 is the value of the objective function (this usually decreases monotonically), value2 is the norm of the gradient (does not always decrease monotonically), and value3 is the cumulative cpu time (in seconds) spent up to the current iteration. The minimum possible value of the objective function is zero but this is attained only for a perfect mesh. ave_cond, max_cond, and min_jsc are the average and maximum condition number, and the minimum scaled jacobian. ave_cond generally decreases monotonically because it is directly related to value1.

##### 5.6.1.8` `Edge Length

Applies to: Surfaces

Summary: This smoother tries to make all edge lengths equal

To use edge length smoothing

On the Command Panel, click on Mesh and then Surface.

Click on the Smooth action button.

Select Edge Length from the drop-down menu.

Click Apply.

Surface <range> Smooth Scheme Edge Length

Edge Length smoothing in Cubit is provided by MESQUITE, a mesh optimization toolkit by Argonne National Laboratory and Sandia National Laboratories. (See Brewer, et al. 2003 for more details on the MESQUITE toolkit.) This smooth scheme may be useful for lengthening the shortest edge length in paved meshes.

Interior node positions are adjusted in an optimization loop where the optimal element has an ideal shape (square) and has an area equal to the average element area of the input mesh.

NOTE: This smoother should be avoided when the mesh contains high aspect-ratio elements that the user wants to keep.

Because this smoother essentially tries to make all the edge lengths equal, it is designed to work well on meshes whose elements have aspect ratios close to 1. The farther from 1 the aspect ratio is, the less applicable this smoother will be.

##### 5.6.1.9` `Equipotential

Applies to: Volume Meshes

Summary: Attempts to equalize the volume of elements attached to each node

To use edge length smoothing

On the Command Panel, click on Mesh and then Volume.

Click on the Smoothing action button.

Select Equipotential from the drop-down menu.

Enter in the appropriate values for Volume ID(s). This can also be done using the Pick Widget function.

Optionally, select Specify Tolerance to set a specific Tolerance value.

Click Apply.

Volume <range> Smooth Scheme Equipotential [Free]

This smoother is a variation of the Equipotential (Jones, 74) algorithm that has been extended to manage non-regular grids (Tipton, 90). This method tends to equalize element volumes as it adjusts nodal locations. The advantage of the equipotential method is its tendency to "pull in" badly shaped meshes. This capability is not without cost: the equipotential method may take longer to converge or may be divergent. To impose an equipotential smooth on a volume, each element must be smoothed in every iteration–a typically expensive computation. While a Laplacian method can complete smoothing operations with only local nodal calculations, the equipotential method requires complete domain information to operate.

##### 5.6.1.10` `Laplacian

Applies to: Curve, Surface, and Volume meshes

Summary: Tries to make equal edge lengths

To use laplacian smoothing

On the Command Panel, click on Mesh.

Click on Volume, Surface or Curve.

Click on the Smoothing action button.

Select Laplacian from the drop-down menu.

Enter in the appropriate values for Volume ID(s), Surface ID(s) or Curve ID(s). This can also be done using the Pick Widget function.

Optionally, select Specify Tolerance to set a specific Tolerance value.

Click Apply.

{Surface|Volume} <range> Smooth Scheme Laplacian [Free] [Global]

The length-weighted Laplacian smoothing approach calculates an average element edge length around the mesh node being smoothed to weight the magnitude of the allowed node movement (Jones, 74). Therefore this smoother is highly sensitive to element edge lengths and tends to average these lengths to form better shaped elements. However, similar to the mapping transformations, the length-weighted Laplacian formulation has difficulty with highly concave regions.

Currently, the stopping criterion for curve smoothing is 0.005, i.e., nodes are no longer moved when smoothing moves the node less than 0.005 * the minimum edge length. The maximum number of smoothing iterations is the maximum of 100 and the number of nodes in the curve mesh. Neither of these parameters can currently be set by the user.

Using the global keyword when smoothing a group of surfaces will allow smoothing of mesh on shared curves to improve the quality of elements on both surfaces sharing that curve.

##### 5.6.1.11` `Mean Ratio

Applies to: Triangular or Quadrilateral Surface Meshes, Tetrahedral or Hexahedral Volume Meshes. Does not apply to Mixed Element Meshes.

Summary: Moves interior mesh nodes to optimize the average mean ratio metric value of the mesh.

To use mean ratio smoothing

On the Command Panel, click on Mesh.

Click on Volume or Surface.

Click on the Smoothing action button.

Select Mean Ratio from the drop-down menu.

Enter in the appropriate values for Volume ID(s) or Surface ID(s). This can also be done using the Pick Widget function.

Enter the appropriate value for Time (minutes).

Click Apply.

Surface <surface_id_range> Smooth Scheme Mean Ratio [cpu <double=10>]

Volume <volume_id_range> Smooth Scheme Mean Ratio [cpu <double=10>]

Cubit includes a mean ratio smoother provided by MESQUITE, a mesh optimization toolkit by Argonne National Laboratory and Sandia National Laboratories. (See Brewer, et al. 2003 for more details on the MESQUITE toolkit.) This smoother is similar in purpose to the Condition Number smoother. However, the Mean Ratio smoother uses a second order optimization method, and therefore it will often reach a near-optimal mesh more quickly than the Condition Number smoother. The Mean Ratio smoother requires the initial mesh to be untangled, but the smoother is guaranteed to not tangle the mesh. If the user attempts to call the Mean Ratio smoother on a tangled mesh, an untangler will first attempt to untangle the mesh before calling the Mean Ratio smoother.

The Mean Ratio smoother’s optimization process terminates when one of the following three criteria is met:

The mesh is "close" to an optimal mesh configuration.

The maximum allotted time has been exceeded.

The user interrupts the smoothing process.

The user has control over the second and the third criteria only. For criterion 2, the default is for the smoother to terminate after ten minutes even if a near-optimal mesh has not been reached. The user can change this time bound by specifying the optional "cpu" argument in the command listed above. This argument takes a single, positive number that represents the time (in minutes) that will be used as a time bound. If the user wishes to terminate the process early, criteria three allows the user to "interrupt" (for example, on some platforms, by pressing CTRL-C) the process. If the process is terminated early, the mesh will not revert to the original node positions; Cubit will instead keep the partially optimized mesh.

##### 5.6.1.12` `Smart Laplacian

Applies to: Surface and Volume meshes

Summary: Tries to make equal edge lengths while ensuring no degradation in element shape

To use smart laplacian smoothing

On the Command Panel, click on Mesh.

Click on Volume or Surface.

Click on the Smoothing action button.

Select Smart Laplacian from the drop-down menu.

Enter in the appropriate values for Volume ID(s) or Surface ID(s). This can also be done using the Pick Widget function.

Click Apply.

{Surface|Volume} <range> Smooth Scheme Smart Laplacian

The Smart Laplacian smoothing approach is a variation on the standard Laplacian algorithm. The algorithm iteratively loops over the mesh and updates nodes based on the location of their neighbors. First, a patch of elements is formed around a given node. The quality of this patch is assessed to determine the quality of the worst shaped element. Then a new candidate node position is calculated as the average of the neighboring nodes. The quality of the patch is assessed again using the candidate node position. If there has been no degradation in the quality of the elements in the patch, the candidate node position is accepted; otherwise, the candidate node position is rejected and the node is returned to its previous position.

The Smart Laplacian smoother is intended to provide a reliable smoother that is nearly as fast as the Length-Weighted Laplacian smoother. Due to the dual goals of this smoother, making equal edge length and improving element shape, it will not always be able to make progress. However, it is often useful as a quick alternative to the more time-consuming optimization methods like Mean Ratio or Condition Number. When this smoother fails to make significant progress, the optimization methods can be tried.

The Smart Laplacian Smoother uses the Mean Ratio quality measure to assess element shape. This smoother is ensuring no degradation in the minimum Mean Ratio. The Mean Ratio smoother is optimizing the same metric, but it is attempting to improve the average Mean Ratio quality.

##### 5.6.1.13` `Untangle

Applies to: Triangular or Quadrilateral Surface Meshes Tetrahedral or Hexahedral Volume Meshes. Does not apply to Mixed Element Meshes.

Summary: Removes as many negative Jacobians from the mesh as possible by minimizing a certain objective function.

To use untangle smoothing

On the Command Panel, click on Mesh.

Click on Volume or Surface.

Click on the Smoothing action button.

Select Untangle from the drop-down menu.

Enter in the appropriate values for Volume ID(s) or Surface ID(s). This can also be done using the Pick Widget function.

Enter the appropriate values for Scaled Jacobian and Time (minutes).

Click Apply.

Surface <surface_id_range> Smooth Scheme Untangle [beta <double=0.02>] [cpu <double=10>]

Volume <volume_id_range> Smooth Scheme Untangle [beta <double=0.02>] [cpu <double=10>]

Discussion:

The Untangle ’smoother’ is designed to eliminate negative Jacobians from a given mesh by moving nodes to appropriate locations. If a mesh node is not involved in causing a negative Jacobian it will not be moved. If a mesh has no negative Jacobians, the Untangler will not move any of the nodes. This smoother is not magic: if an untangled mesh does not exist for the given mesh topology, the untangler will not untangle the mesh. Instead, it will do the best it can and exit gracefully. An untangled mesh produced by this smoother will often have poor shape quality; in that case it is recommended that untangling be followed by condition number smoothing. The untangle smoother is automatically called by the condition number smoother.

There is no "fixed/free" option with this command; boundary nodes are always held fixed. As a result, users should be aware that the volume untangler cannot succeed if the volume contains a surface mesh which contains a negative Jacobian. In that case, one must first remove the surface mesh negative Jacobians by invoking the surface Untangler and then invoke the volume Untangler.

The command above only sets the smoothing scheme; to actually smooth the mesh one must subsequently issue the command smooth surface <surface_id_range> or smooth volume <volume_id_range>.

Stopping Criteria: Untangling will proceed until the objective function has been minimized or the optional user input cpu has been satisfied. The latter stopping criterion tells the code how many minutes to spend trying to untangle the mesh. The default value is 10 minutes. Optimization may also be halted by using "control-C" on your keyboard.

Beta Parameter: An optional user input parameter beta plays a role in determining the optimal mesh. Optimization proceeds until the minimum scaled Jacobian of the mesh is (roughly) greater than beta. To remove negative Jacobians one would need beta=0 (however, as a safety margin, we choose beta=0.02 as the default). To further improve the scaled Jacobian of the mesh, input a larger value of "beta". If a mesh with all scaled Jacobians greater than "beta" does not exist, optimization will continue until the cpu time stopping criterion has been met. Therefore, it is best not to use "beta" values too large (say, greater than 0.2) without also decreasing the cpu time limit.

Iteration=n, Evals=m, Fcn=value1, dfmax=value2, time=value3 min_jsc=value4

##### 5.6.1.14` `Winslow

Applies to: Surface meshes

Summary: Elliptic smoothing technique for structured and unstructured surface meshes

To use winslow smoothing

On the Command Panel, click on Mesh and then Surface.

Click on the Smooth action button.

Select Winslow from the drop-down menu.

Enter the appropriate values for Surface ID(s). This can also be done using the Pick Widget function.

Click Apply.

Surface <range> Smooth Scheme Winslow [Free]

Winslow elliptic smoothing (Knupp, 98) is based on solving Laplaces equation with the independent and dependent variables interchanged. The method is widely used in conjunction with the mapping and submapping methods to give smooth meshes with positive Jacobians, even on non-convex two-dimensional regions. The method has been extended in Cubit to work on unstructured meshes.

##### 5.6.2` `Align Mesh

Align Mesh Surface <id> [CloseTo] Surface <id> [Tolerance <tol>]

Align Mesh Curve <id> [CloseTo] Curve <id> [Tolerance <tol>]

Align Mesh Node <id> [CloseTo] Node <id> [Tolerance <tol>]

And example of this is given as follows:

brick x 10

volume 1 copy move 11

surface all except 10 6 vis off

transparent

graphics perspective off

at 5.552503 3.832384 0.134127

from 34.651051 3.640138 -0.193121

up 0.006514 0.999945 -0.008172

mesh surface all

surface 6 smooth scheme randomize free

smooth surface 6

node 432 move 0 0 -0.2

align mesh node 944 node 432

node 432 move 0 0 0.4

align mesh curve 23 closeto curve 12

align mesh surf 10 closeto surf 6