#### 6.2` `Basic CAD to U-spline workflow

This section presents general-purpose, basic workflows for building surface and volumetric U-spline models of CAD BREP geometry in Coreform Cubit™ . Users may also benefit from reviewing the more in-depth, application-specific guidance provided in Building U-spline meshes for ANSYS LS-DYNA analyses.

##### 6.2.1` `Building U-spline surfaces

U-splines can be constructed from CAD surface geometry that has been imported into Coreform Cubit or created using Cubit’s native geometry creation capabilities.

To create a U-spline surface, a quadrilateral finite element mesh must first be generated over the CAD source geometry.

As always, generating a quality mesh may require defeaturing, geometry cleanup, and/or compositing to address small features or extraneous topological entites. We do not address these issues in this section, but illustrative cases and solutions are discussed in more detail in Cleanup model geometry (Optional) and Modify BREP topology for quality meshing (Optional).

Once geometry is prepared to satisfaction, an all-quadrilateral surface mesh should be generated over the CAD surface(s). This is generally best accomplished using Cubit’s pave or map meshing schemes. (See also the discussion in Mesh model geometry for additional, potentially useful pave command sizing and cleanup options.)

After mesh generation and prior to U-spline construction, it may be desirable to create Cubit block and sideset entities. Depending on solver support, these may be utilized for boundary condition or material property assignment.

When the mesh layout is complete, U-spline construction can begin. A critical initial task is to identify all Bézier interfaces that should be assigned continuity, or creased. Creasing may be required when:

the underlying geometry is not smooth, or

we wish to apply a Dirichlet boundary condition, either on the interface in question, or on a surface enclosed by a loop of Bézier interfaces, as described in Create subdomains for *SET_ keywords and figure 580

U-spline construction is currently accomplished via commands in the Cubit command window; no GUI components have yet been implemented for this functionality.

To designate Bézier interfaces for creasing, we (1) select the curves that contain the Bézier element interfaces that need to be creased and (2) assign them to a crease group, which the U-spline algorithm in Coreform Cubit automatically consumes as input.

We create the group by executing build uspline crease group in the Cubit command line. This command creates a group called cf_crease_and_project_entities and searches for candidate curves (and vertices) to include in this group.

Alternatively, the user can do this manually, creating the group cf_crease_and_project_entities via the command create group and then manually adding (or removing) entities to the group by selecting them in the model-viewer, as we demonstrate in figure 581.

After creasing is specified to satisfaction, the set uspline command is used to specify the desired degree, continuity, and creasing parameters, with syntax as follows:

set uspline {([volume <ids>]) ([surface <ids>]) ([curve <ids>])|default} [degree <degree>] [continuity <default continuity>] [creasing {full|minimal}]

Finally, the U-spline is constructed using the command syntax:

[build] uspline ([volume <ids>]) ([surface <ids>]) ([curve <ids>]) [optimized for timestep] [as <id>]

fit uspline <uspline id> [tessellation tol <tessellation multiplier>]

For an example that includes both crease group creation and construction of a quadratic surface U-spline with maximal continuity, see Constructing the U-spline.

##### 6.2.2` `Building U-spline volumes

Map

SubMap

Sweep

Sphere

Polyhedron

TetPrimitive

Sculpt

HTet

The interfaces between adjacent volumes are creased to C0.

Continuity transitions are dissallowed across the interfaces between two volumes.

##### 6.2.2.1` ` Map

`Example Cubit journal commands to create a Map meshed U-spline volume.reset create Cylinder height 1 radius 5 bri x 6 y 8 z 1 webcut body 1 with plane from surface 9 webcut body 1 with plane from surface 7 delete Volume 3 4 unite body 1 2 vol 1 scheme map vol 1 interval 2 mesh vol 1 set uspline vol 1 degree 2 build uspline vol 1 fit uspline 1 draw uspline on`

Figure 463: Building a U-spline on a Map-meshed volume. From left to right: (a) The original Cubit volume. (b) The Map-meshed volume. (c) The resulting U-spline volume, which is equivalent to a NURBS volume.

##### 6.2.2.2` ` SubMap

`Example Cubit journal commands to create a SubMap meshed U-spline volume.reset bri x 4 y 2 z 2 bri x 2 y 2 z 4 move vol 2 x -1 y 2 z 1 unite body 1 2 vol 1 size 1 mesh vol 1 set uspline vol 1 degree 2 build uspline vol 1 fit uspline 1 draw uspline on`

Figure 464: Building a U-spline on a SubMap-meshed volume. From left to right: (a) The original Cubit volume. (b) The meshed volume. Each colored block corresponds to a different patch in the resulting U-spline. (c) The resulting U-spline volume, which is equivalent to a multi-patch NURBS volume.

##### 6.2.2.3` ` Sweep

Coreform Cubit constructs U-spline basis functions on sweep-meshed volumes as the tensor product of bivariate and univariate U-spline basis functions. The U-spline algorithm only that geometry under the the following constraints:

The mesh must by an all-hex mesh, composed of high-quality hexahedra.

For many-to-one swept meshes, source surfaces must be contiguous.

Entities cannot be creased using the build crease group command

##### 6.2.2.3.1` `Source surfaces must be contiguous in many-to-one swept meshes

As an example, consider the two cylinders created using the following commands:

create cylinder height 2 radius 2 |

create cylinder height 2 radius 1 |

move vol 1 z 1 |

move vol 2 z 3 |

imprint vol all |

merge vol all |

vol all size 1 |

surf 2 5 6 scheme circle |

surf 7 scheme hole |

vol all scheme sweep |

mesh vol all |

uspline vol all |

fit uspline 1 |

draw uspline on |

This sequence of commands results in the U-spline volume shown in the third image of figure 465 (top right, in grayscale).

By contrast, U-spline construction fails if the two cylinders are joined into a single volume before meshing, as shown in the fourth image (bottom left) of figure 465. Cubit can generate a swept mesh in this case also, as seen in the fifth image, but only via a many-to-one sweep involving non-contiguous source surfaces. Attempting to build a U-spline on the resulting mesh will fail with the error

ERROR: Cannot build volumetric splines over Volume 1 which is a many to one sweep with non-contiguous source surfaces.

Figure 465: This figure shows the restrictions on building U-spline volumes over many-to-one swept meshes. (a) A CAD geometry decomposed into two volumes. (b) The mesh of the two volume CAD geometry. Each volume is meshed as a one-to-one sweep. (c) The resulting U-spline volume. (d) The same CAD geometry represented as a single volume. (e) The mesh of the single volume CAD geometry. The volume is meshed using a many-to-one sweep. Because the two source surfaces are not contiguous, a U-spline volume cannot be built on this mesh.

##### 6.2.2.3.2` `Entities cannot be creased using build crease group

Instead the geometry must be decomposed into separate swept meshes. The faces on interfaces between swept meshes are automatically creased to continuity.

create Cylinder height 2 radius 2 |

move vol 1 z 1 |

create frustum height 2 radius 2 top 0 |

webcut volume 2 with plane zplane offset 0 |

delete Volume 2 |

compress all |

move vol 2 z 3 |

unite body 1 2 |

webcut volume 1 with cylinder radius 1 axis z |

compress all |

imprint vol all |

merge vol all |

surf 2 size .5 |

vol 1 size 1.5 |

surf 2 scheme circle |

volume 2 scheme Sweep source surface 2 target surface 7 sweep transform translate propagate bias |

volume 1 scheme Sweep source surface 3 target surface 5 sweep transform least squares |

mesh vol 2 |

mesh vol 1 |

uspline vol all |

The geometry, mesh, and resulting U-spline volume generate by the commands are shown in the first three images of figure 466. If we instead build a U-spline over the single volume shown in fourth image (lower left), the algorithm succeeds, but issues the warning

WARNING: Some edges which are at surface kinks in the CAD are not creased in the spline.

As the last image of figure 466 shows, the resulting U-spline volume fails to accurately capture a key feature of the original geometry.

Figure 466: This figure shows the workflow for ensuring sharp features are preserved in a U-spline volume fitted to a CAD geometry. (a) A CAD geometry decomposed into two volumes, separated by a sharp feature in the geometry. (b) The mesh of the two-volume CAD geometry. (c) The resulting U-spline volume, which accurately captures the sharp edge between the two volumes. (d) The same CAD geometry represented as a single volume. (e) The mesh of the single volume CAD geometry. (f) The resulting U-spline volume. Note that the sharp corner is not preserved in this U-spline volume.

Finally, automatic creasing of the U-spline mesh is performed to ensure a valid U-spline basis is constructed. This automatic creasing algorithm serves to ensure the following criteria are met:

The bivariate U-spline mesh on the source surface(s) of each swept mesh. must satisfy the admissiblity criteria for bivariate U-splines.

All faces on interfaces between swept meshes must be creased to continuity.

The continuity cannot change across interfaces between swept meshes.

While the user does not have control over this automatic creasing, they should be aware that it may have an effect on the resulting U-spline basis and corresponding geometry.

##### 6.2.2.4` ` Sphere

`Example Cubit journal commands to create a Sphere meshed U-spline volume.reset create sphere radius 1 volume 1 scheme sphere graded_interval 2 az_interval 2 bias 0.849129 fraction 0.5 max_smooth_iterations 0 mesh vol 1 set uspline vol 1 degree 2 build uspline vol 1 fit uspline 1 draw uspline on`

Figure 467: Building a U-spline on a Sphere-meshed volume. From left to right: (a) The original Cubit volume. (b) The meshed volume. Each colored block corresponds to a different patch in the resulting U-spline. (c) The resulting U-spline volume, which is equivalent to a multi-patch NURBS volume.

##### 6.2.2.5` ` Polyhedron

`Example Cubit journal commands to create a Polyhedron meshed U-spline volume.reset bri x 1 create vertex on curve 12 2 1 midpoint webcut volume 1 with plane vertex 9 vertex 11 vertex 10 delete vol 2 delete vert all curve in vol 1 interval 4 volume 1 scheme polyhedron mesh volume 1 set uspline vol 1 degree 2 build uspline vol 1 fit uspline 1 draw uspline on`

Figure 468: Building a U-spline on a Polyhedron-meshed volume. From left to right: (a) The original Cubit volume. (b) The meshed volume. Each colored block corresponds to a different patch in the resulting U-spline. (c) The resulting U-spline volume, which is equivalent to a multi-patch NURBS volume.

##### 6.2.2.6` ` TetPrimitive

Constructing a U-spline volume on a TetPrimitive meshed volume results in a multi-patch NURBS volume consisting four NURBS patches.

`Example Cubit journal commands to create a TetPrimitive meshed U-spline volume.reset create sphere radius 1 webcut volume 1 with plane zplane rotate 180 about y webcut volume 1 with plane yplane rotate 180 about x webcut volume 1 with plane xplane rotate 180 about y delete vol 2 to 4 vol 1 interval 4 vol 1 scheme tetprimitive mesh vol 1 set uspline vol 1 degree 2 build uspline vol 1 fit uspline 1 draw uspline on`

Figure 469: Building a U-spline on a TetPrimitive-meshed volume. From left to right: (a) The original Cubit volume. (b) The meshed volume. Each colored block corresponds to a different patch in the resulting U-spline. (c) The resulting U-spline volume, which is equivalent to a multi-patch NURBS volume.

##### 6.2.3` `Commands

##### 6.2.3.1` `set uspline

Summary: The set uspline command sets the basis degree and continuity on Cubit geometric entities for building a U-spline.

set uspline <enum>entity [degree <integer>deg] [continuity <integer>cont] [creasing <enum>creasing_type]

The entity enum allows for setting degree and continuity on volumes, surfaces, and curves simultaneously.

If the degree and continuity keywords are not supplied, default values of and ϑ = 1 will be used.

- The creasing_type enum can take one of the following values:
minimal: Crease the minimal number of edges necessary in order to crease a valid U-spline.

full: Crease edges to remove all continuity transitions in the resulting U-spline.

If no creasing_type is specified, the default creasing strategy minimal will be used. When a U-spline is built using the build uspline command, all of the geometric entities corresponding to a single U-spline must have identical degree and continuity settings, or an error will be thrown.

##### 6.2.3.2` `build uspline

[build] uspline {volume <ids>|surface <ids>|curve <ids>} [optimized for timestep] [as <id>]

Each call to the build uspline command builds a single uspline curve, surface, or volume on the Cubit entities secified by ids.

If optimized for timestep is specified, the command builds a U-spline with locally altered degree and continuity to allow a larger timestep for explicit dynamics simulations. This option is only supported when building U-splines with degree = 2 and creasing_type = full.

If as <id> is specified, the command assigns the newly created U-spline the specified ID. If not, the U-spline is assigned the next free ID.

##### 6.2.3.3` `fit uspline

fit uspline {<integer>us_id} [tessellation tol <real>tol]

The set of us_id specifies the U-spline IDs to be fitted to the source CAD geometry. The keyword all may be substituted for the list of integers to fit all U-splines that have been constructed.

The tessellation tol keyword specifies how far to refine the visualization tessellation. The value provided, times the largest axis-aligned bounding box dimension of the U-spline, equals the desired maximum difference between the actual spline and the tessellated approximation.

##### 6.2.3.4` `quality uspline

quality uspline {<integer>us_id} scaled jacobian [threshold <real>thresh]

The set of us_id specifies the IDs of the U-splines for which to calculate the scaled Jacobian. Only U-splines that have been fit to CAD may be passed to this command. The keyword all may be substituted for the list of integers to check all U-splines that have been fit to CAD.

The threshold keyword specifies the value above which a scaled Jacobian value is considered good. The default threshold is 0.1.

##### 6.2.3.5` `draw uspline

draw uspline <enum>toggle

The toggle takes a value of either off or on.

##### 6.2.3.6` `draw uspline projection_error

draw uspline id {<integer>us_id} <enum>field

The field enum takes a value of either projection_error or none.

##### 6.2.3.7` `remove uspline

remove uspline {<integer>us_id}

The set of us_id specifies the IDs of the U-splines to be removed. The keyword all may be substituted for the list of integers to remove all U-splines in the session.