Smooth a 2D or 3D mesh object.
For adaptive smoothing see the radapt command. smooth takes a 2D or 3D mesh object and moves nodes, without changing the connectivity of the grid, in order to improve the aspect ratios and distribution of elements in the mesh.
There are nine smoothing algorithms available:
2D | 2D and 3D | 3D |
---|---|---|
esug | laplace | mega |
elliptic | aspect | network |
random | lpfilter | geometry |
For all commands:
position
results in the positions of nodes being changed. Other options have not been implemented.
ifirst,ilast,istride
is the selection of points designated by node numbers or pset,get,pname. 1,0,0 will select all.
The internal variable maxiter_sm (default=25) controls the maximum number of iterations and can be changed using the assign command. e.g. (assign /// maxiter_sm/10).
smooth/position/esug elliptic random/ [ifirst,ilast,istride ]/[control]
esug
Elliptic Smoothing for Unstructured Grids with guards against folding. This is the default for 2D mesh objects. It can only be used on triangular 2D mesh objects.
Ref.: Randolph E. Bank and R. Kent Smith, “Mesh Smoothing Using A Posteriori Error Estimates”, SIAM J. Num. Anal. Vol. 34, Issue 3, pp. 979-997, 1997.
elliptic
similar to esug except the ‘guards’ which prevent a grid from folding are turned off. (Thus esug is preferred.)
random
a node’s position is set to a randomly weighted average position of its neighbors. ‘Guards’ keep the elements from inverting.
control
(default 0 ) from standard smoothing scheme to 1 which causes the scheme to be progressively more controlled, at 1 there is no mesh movement.
smooth/position/aspect // [ifirst,ilast,istride]/ [toldamage] smooth/position/lpfilter // [ifirst,ilast,istride] /[filtdeg]/[k_pb]/network smooth/position/laplace / [ifisrt,ilast,istride]/[rlxwt]/[ntimes]/[nwtty]/[useisn]/[extrnbr]
aspect
Adjusts node positions such that the aspect ratio of the elements is improved.
toldamge
(default is infinity) is the damage tolerance, so it can be used as a general smooth which has the effect of improving worst aspect ratio.lpfilter
This smooths surface networks by a low-pass filtering of the coordinate data.
fltdeg
(default 30)k_pb
(default 0.1)laplace
On a 3D tetahedral mesh moves a node to the average position of its neighbors where neighbor is defined as the set of nodes connected to the candidate node by an edge where the node types (itp1) and node constraints (icr1) are a ‘subset’ of the candidate node type and constraints. A node will not be moved if the result is an inverted element. The following controls may be supplied:
rlxwt
(default 0.5 ) weight for underrelaxed Laplacian smothingntimes
(default 5 ) number of smoothing iterationsnwttry
(default 3 ) number of attempts to not tangle the mesh by halving the smoothing weight.useisn
(default 1 ) means interface nodes are smoothed based along an edge with the same materials as the candidate node.
0 means interface nodes are smoothed based on all interface neighbors.extrnbr
(default inclusive) means do not restrict neighbors. exclusive means restrict neighbors to pset nodes.smooth/position/mega geometry/ [ifirst,ilast,istride ]/[control] smooth/position/network/[ifisrt,ilast,istride]/[niter]/[weight]/[check nocheck]
control
(default 0 ) from standard smoothing scheme to 1 which causes the scheme to be progressively more controlled, at 1 there is no mesh movement.
mega
Minimum Error Gradient Adaption. This option creates a smoothed grid which is adapted to the standard function with constant
Hessian f(x,y,z)=x2+y2+z2. Can be used on hybrid 3D meshes and guards against mesh folding.
Adaption to this function creates a uniform isotropic mesh.
Ref.: Randolph E. Bank and R. Kent Smith, “Mesh Smoothing Using A Posteriori Error Estimates”, SIAM J. Num. Anal. tol. 34, Issue 3, pp. 9-9 (19)
geometry
Geometry (“plump element”) adaption. Default for 3D.
Can be used on hybrid 3D meshes It uses the mega algorithm but retains only the leading geometry term;
the term containing the Hessian has been dropped. This algorithm guards against mesh folding.
network
This option smooths the surface network of a 3D tetrahedral grid. Volume nodes are not moved.
The material volumes are conserved. Combining this type of smooth with volume smoothing will help to avoid element inversions.
niter
(default 10 ) number of iterationsweight
(default 1. ) controls the amount of movement (from 0. to 1.).smooth
Smooth all nodes in the mesh using esug in 2D or geometry in 3D.
smooth / / / 1,0,0 / 0.5
Smooth all nodes in the mesh, using controlled smoothing with control=0.5.
pset/p2/attribute/itp1/1,0,0/0/eq
smooth /position /network/1,0,0/3/1./check
smooth/position/geometry/pset,get,p2
smooth /position /network/1,0,0/3/1./check
smooth/position/geometry/pset,get,p2
Smooth a 3D grid by combining network and volume smooths.
compute/distance_field/CMO_SINK mobj_sm dfield
pset/pin/attribute dfield/1,0,0/ le 120.
assign///maxiter_sm/6
smooth/position/esug/pset,get,pin
Smooth a 2D grid within 120 distance from mobj_sm and control the number of iterations by using the assign command.