# Presentation: 361427

## CUBIT Advanced Users Tutorial

- Conforming Meshing

## What is Conforming Mesh?

- _Coincident_: in the same location
- hexes have nodes at same location but different ids
- _Conforming_: topologically connected
- hexes share the same nodes
- Coincident meshes may not be conforming.
- In Cubit
- Conforming geometry <-> conforming mesh
- In Exodus file
- Blocks’ elements share nodes

## Examples - Cubit

- Demo “conforming1.g”
-  2 bricks, merged and not-merged
- surface labels
- picking coincident surfaces

## Conforming1.jou

- journal graphics on
- brick width 10
- brick width 10
- body 2 move 10 0 0
- color volume 2 blue
- color background white
- graphics triad off
- graphics linewidth 3
- graphics text size 4
- #
- label surface
- display
- comment 'note coincident surface labels'
- comment ' can do the same thing with curve or mesh labels'
- #
- # query-select and pick and cycle through surf 6, 10
- comment "picking cycles through coincident surfaces"
- volume all size 3
- mesh volume all
- #
- # pick and list hexes
- list hex 19
- list hex 28
- comment "node numbers are different"
- export mesh 'conforming1.non.g'
- #
- # make it conforming
- merge all
- #
- list hex 19
- list hex 28
- comment "note shared face 46"
- list volume in surface 6 ids
- export mesh 'conforming1.yes.g'

## Exercise

- Import acis ‘ra2.sat’
- Set a size of 0.25; scheme auto
- Mesh without imprinting or merging
- Notice the mesh between the surfaces...
- Reset volume 1 & 2
- Reset size and scheme
- Imprint and merge
- Re-mesh

## Examples - Verde

- Verde listing topology

- ----------------------------
- Mesh Topology Information
- ----------------------------
-    Mesh appears fully conformal
-    Probable Topology: **1 Volume(s))**
-    Possible Topologies: N Volumes with N-1 holes

- ----------------------------
- Mesh Topology Information
- ----------------------------
-    Mesh appears fully conformal
-    Probable Topology: **2 Volume(s))**
-    Possible Topologies: N Volumes with N-2 holes

## Tools - make conforming

- SEACAS Exodus : gjoin2, grepos
- Difficult to visualize and control
- Can handle huge meshes efficiently
- Non-conforming to conforming

- % gjoin2
- > File1.g
- > File2.g
- > Combine 1.0e-6
- > End
- > Finish
- > Output.g

- Requires coincident nodes
- Furthest matched nodes: 0.0
- Closest non-matched nodes: edge length
- Coincident surfaces but not coincident mesh?
- Then combine only explicit sidesets instead of by proximity

## Tools – make non-conforming

- SEACAS Exodus : gjoin2, grepos
- Non-conforming to conforming

- % grepos b1-2.g b1.g
- > delete block 2
- > end
- % grepos b1-2.g b2.g
- > delete block 1
- > end
- % gjoin2
- > b1.g
- > b2.g
- > combine end
- > finish
- > b1-2.g

- grepos to write files with specific non-conforming blocks
-  gjoin2 to put blocks in one file,  but don’t “combine” = conforming

## Cubit -make conforming

- Imprint and Merge geometry
- imprint to make coincident topology
- merge to make conforming topology
- new: can merge after meshing if mesh topology matches.
- new: use partition with nodes, edges to match topology
- write out all blocks at once

## Review & Motivation

- Imprinting creates coincident topology
- ACIS solid modeling call
- Merging combines coincident topology
- Merging surfaces requires that their curves and vertices have been merged
- process works upward from vertices to curves to surfaces
- reports only highest dimensional entities merged
- e.g. consolidated 1 surfaces, 0 curves, 0 vertices:
-    one surface pair and all their contained curves and vertices were merged.

## Review & Motivation

- Merging
- reports only highest dimensional entities merged
- For contiguous 3D solid models this should only be surfaces, for 2D models it should be curves.
- exception - W76 AF&F, volumes actually meet at a curve

## Imprinting Background

- Imprinting
- ACIS solid model call
- absolute geometric accuracy
- scaling dependent
- problems ship and w76 FS examples
- too big, too small, poorly aligned, flat
- saved in ACIS sat file

## Imprint & Merge Troubleshooting

- Design model has gaps & overlaps; want Analysis model has conforming geometry
- Strategies for
- Finding mismatches & gaps & overlaps
- Find surface overlap
- Visualization of merged & unmerged surfaces
- Pairwise body intersection
- Removing mismatches & gaps & overlaps
- Explicit imprinting to enable merge
- Geometry tweaking, moving, booleans
- Healing, changing model tolerances

## Imprinting

- geometry absolute accuracy
- default 1.0e-6, can be changed
**set geometry accuracy 1.0e-4** (Pro/E)
- features less than 1.0e-6 apart will be considered coincident, not imprinted

- curves hard to see

## Imprinting & Merging

- If mis-alignment is 1.0e-2,
- smallest feature is 1.0e-2,
- then you have a problem.

## Imprinting Troubleshooting

- Common problems are gaps & overlaps
- Sometimes creates small sliver surfaces due to:
- model tolerance problems
- e.g. curves close but not coincident
- bodies overlap
- If slivers are created, then start over, raise geometry accuracy
- optionally try healing with “maketolerant” option
- reimprint

## Imprinting Troubleshooting

- Sometimes topology not added due to
- model tolerance problems
- e.g. curves close but not coincident
- gaps between bodies
- “flat” features

## Merging Background

- Merging
- cubit function
- issue command every time geometry file read
- merge only surfaces for speed
**merge surf all** (v.s. **merge all**)
- internal surface check, off for speed
**set mergetest internalsurf Off**
- absolute tolerance
- default 1.0e-4, can be changed
**set merge tolerance 1.0e-4**(e.g. 100x geometric accuracy)
- features less than 1.0e-4 apart will be considered coincident, and merged

## Merge Checking

- Did merging work? Better find out before investing in a perfect journal file.
- Always check merge output the first time.
- Check for separate curves being listed as merged.
- Always check surface overlap the first time.
**find surface overlap**

## Merge Checking

- Always visualize merged surfaces the first time - draw and inspect unmerged surfaces
**group ‘ms’ equals surface merged**
**group ‘ums’ equals surface unmerged**
**surface in ‘ms’ visibility off**
**display**
- pick shell surfaces, turn off their visibility, and look inside the model for interior surfaces (meaning they are unmerged)

- Group ms:

- Group ums:

- Inside of
- group ums:

## Merging Troubleshooting

- Merging fails due to
- Topology doesn’t match - most common
- add topology by
- explicitly imprint bodies with missing vertices, curves
-     **imprint body <id> with curve <id>**
- remove topology with
**tweak surface <id> replace with surface <same_id>**
**regularize body <id>**
**detail body <id>**
**  ****detail body <id> remove**
-     or
-   **composite create {surface | curve}**
-     (this is VG that is not saved in the ACIS sat file)

## Merging Troubleshooting

- Two curves farther apart than merge tolerance
- translation problems, sloppy model construction
- fix by changing merge tolerance
**merge tolerance <val. Def. = .0005>**
- fix by moving geometry - hard
- Bad geometry
- volumes on top of each other, curves or nurbed surfaces defined slightly different
- fix by force merge:
- Specified bottom up: force vertices then curves then surfaces
**Merge {surface|curve|vertex} <id>****	****with{surface|curve|vertex} <id> force**
**set mergetest bbox {ON|off}**
- Skip testing interior of surfaces
-   **set mergetest internalsurf {on|off|SPLINE}**
- Reconstruct (part of) geometry from scratch - tedious!!!

## Merge Checking -Overlaps

- CUBIT> merge all
- ...Merging all features in the model
- ...Merging all Surfaces in the model
- WARNING: Merging Surface 78 (surface 78) and Surface 52 (surface 52) which have the same sense.
- This may indicate bad geometry.
- Surface 52 and 78 consolidated
- Consolidated 1 surfaces
- ...Merging all Curves in the model
- Curve 128 and 179 consolidated
- Consolidated 1 curves
- ...Merging all Vertices in the model
- Consolidated 0 pairs of vertices
- All detected matches successfully merged
- Journaled Command: merge all
- CUBIT>

## Merge Troubleshooting - Overlaps

- Go back to pre-imprinted model
- Imprinted model has tiny features
- Pairwise intersect all bodies
**Intersect Body All Pairwise**
- Output should be NULL

## CUBIT> merge all

...Merging all features in the model

...Merging all Surfaces in the model
Consolidated 0 surfaces

...Merging all Curves in the model
Curve 25 and 93 consolidated
Consolidated 1 curves

...Merging all Vertices in the model
Consolidated 0 pairs of vertices
All detected matches successfully merged
Journaled Command: merge all 

CUBIT> 

- ...Merging all features in the model
- ...Merging all Surfaces in the model
- Consolidated 0 surfaces
- ...Merging all Curves in the model
- Curve 25 and 93 consolidated
- Consolidated 1 curves
- ...Merging all Vertices in the model
- Consolidated 0 pairs of vertices
- All detected matches successfully merged
- Journaled Command: merge all
- CUBIT>

- Troubleshooting Merging - Failed Imprint

- Curve not
- Imprinted!

## Merging

- Always check merge output.  Check for separate curves being merged.
- In contiguous model curves are merged during surface merging
- Single curves are merged when:
- Topology doesn’t match: need to do “**imprint all**”
- Two curves on coincident surfaces were outside merge tolerance
- Bad geometry (volumes on top of each other, curves defined slightly different, etc...)

## Merging

- Remedies:
- Force Merge:
- Specified bottom up: force vertices, then curves, then surfaces
**Merge {surface|curve|vertex} <id>****	****with{surface|curve|vertex} <id> force**
- Change the merge tolerance:
**Merge Tolerance <value, Def. = .0005>**

## Merging Example

- Thin plate
- merge tolerance larger than height
- scale model, or change merge tolerance

- red surface is “far” from its bounding curves!

## Exercise

- Mesh thin_plate.sat conformally, size 40 times larger than the smallest curve
- with changing the merge tolerance

## Demo

- demo - mesh really_thin_plate.sat
- using scaling
- (sometimes can’t change the merge tolerance)

- import acis "really_thin_plate.2.sat"
- body all copy scale 1.0e6
- delete body 1 to 4
- merge all
- volume all size smallest curve factor 40
- mesh volume all
- transform mesh output scale 1.0e-6
- export mesh "really_thin_plate.g"

## Imprint & Merge Troubleshooting

- If you don’t want merging
**surface <id> merge off**
- turns off merging of contained curves, vertices as well
- can override by force merging
- or only merge the bodies you want
**merge body <id_range>**
- Exercise
- mesh mid_mid_small.sat, with non-conforming mesh along the plane of surface 22

## Demo - imprint with curve

- Demo
- GES- ges_imprint_demo.sat
- two cubit sessions
- 1: merge, curves merged, find surface overlap
- 2: imprint body with curve,
- send geometry to session 1
- iterate
- Option: Use VG through “remove detail” or composite curves and surfaces to remove stray vertices or curves
- after imprinting, before/after merging.

## Demo - imprint with curve

- import acis “ges_imprint_demo.sat"
- imprint all
- imprint body in surface 124 with curve 169 302 90 91 88 6
- export acis “ges_imprint_demo.1.sat"

- cubit_session_2.jou

- cubit_session_1.jou

- import acis “ges_imprint_demo.sat"
- imprint all
- merge all
- find surface overlap
- comment "pick in this session,to find out which curves to imprint but switch to second session for actual imprinting“

- reset
- import acis “ges_imprint_demo.1.sat"
- merge all
- find surface overlap

- Oops, we missed curve 168!

## Demo - imprint with curve

- reset
- import acis “ges_imprint_demo.2.sat
- merge all
- find surface overlap
- comment “it worked!”
- comment ‘if just missing a vertex, can remove detail before merging’
- detail volume all
- detail volume all remove

- reset
- import acis “ges_imprint_demo.1.sat"
- imprint body in surface 125 with curve 168
- export acis “ges_imprint_demo.2.sat"

- cubit_session_1.jou

- cubit_session_2.jou

## Exercise

- Exercise (same as demo):
- Import ges_imprint_demo.sat.
- Make it merge.
- Option: remove extra vertices to simplify meshing

## Exercise

- Import ACIS “w80_part.2.sat”
- Conformally mesh with coarse size 24
- Need to fix geometry of body 1
- Two ways to do it!
- Need to position bodies

## Cubit - make non-conforming

- Just don’t merge
- Mesh already merged in memory
- write out only certain blocks to different files
- or in a file
- import as MDG and only write out certain blocks

## Tools – check conforming

- Exodus file
- count combined nodes in gjoin - hard
- visualize in ensight, mustafa, blot?
- verde topology checks
- partially merged or disconnected volumes
- visualize in cubit, with labels,
-    or picking and listing
**import mesh ‘conform.g’ preview**

## Sub-assembly conforming meshing

- Motivation
- break assembly in parts for running time, memory size, or for two people
- Method
- mesh one part, writing out surface mesh
- mesh second part, reading in surface mesh
- what happens if topology change needed?
- Ok if part1 has enriched topology, but not part2
- Ok if part 2 removes topology (composite)
- Decide, export surface meshes on interface

## Import Mesh Troubleshooting

- Troubleshooting importing a mesh
- import mesh tolerance
- e.g. **set import mesh tolerance 0.01**
- mesh in same conforming state as model
- if not, try importing one block at a time:
**import mesh “file.g” block all** - same as one at a time
- entire block must “fit” on geometry

## Import Mesh Troubleshooting

- embed associativity data in exodus file
- very reliable, but geometric model must be exactly the same on import and export
**set nodeset associativity on**
**export mesh**
**set import mesh nodeset associativity on** - off if model changed
**import mesh**

## Sub-assembly conforming meshing

- Exercise/Demo
- mesh subassembly_first.sat
- hint, connect hole in linking surface with boundary
- reset
- mesh subassembly_second.sat
- make sure it conforms to first.