libmesh icon indicating copy to clipboard operation
libmesh copied to clipboard

XYDG Meshing Around a Single Disjointed Mesh

Open olinwc opened this issue 1 year ago • 5 comments

FEATURE REQUEST

Issue

Currently, XYDelaunayGenerator (XYDG) cannot mesh the area around a single mesh with disjointed pieces. The use case for this is designing an assembly using HexIDPatternedMeshGenerator and then deleting the background of the created assembly, preserving only the pins, and then drawing a hexagon and maybe some circles inside the assembly for wires or control drums. XYDG works if each pin is defined as it own mesh, but if all the pins come from an assembly mesh with its background deleted, this does not work.

Feature

Ability to pass a single mesh consisting of disconnected parts and XYDG will mesh around those disconnected parts.

Work Around

Currently I can workaround this for single control rods by creating my hexagonal pin cell mesh, and then ONLY deleting pin cells where I want to put my control drum, thereby creating a hole in the hexagonal assembly, and then putting the control drum in this hole and meshing around that.

The problem with this approach is that the control drum CANNOT intersect with the pin cells (pin + background in cell). This could be a problem as physically there is no reason a control drum or control rod channel could not intersect with the pin background of a cell. This cannot be meshed currently unless doing the aforementioned explicitly meshing individual pins.

Tag @roystgnr @eshemon

olinwc avatar Jun 12 '23 16:06 olinwc

Tagging @miaoyinb for his comments here on what could potentially be addressed by the upcoming FlexiblePatternGenerator

eshemon avatar Jun 12 '23 17:06 eshemon

I ran across #1902 again today, and I'm wondering if I can kill two birds with one stone here. A flood algorithm that fills an unordered_set (or maybe an id-indexed set; don't want to get burned in parallel again...) of elements would be useful for both identifying disconnected meshes and making copies of connected components for use in MeshedHole.

But now here's something that scares me a bit: are we likely to come up with cases where a mesh itself is connected but its interior is not? E.g. two quads like:

o---o
|   |
|   |
o---o---o
    |   |
    |   |
    o---o

No flood-fill based on neighbor (and for adapted meshes, parent) links will find a connection that only goes through one vertex. We've got other code in libMesh (at least in distributed-memory-mesh repartitioning code paths, possibly elsewhere) that already does not handle this case well, IIRC.

roystgnr avatar Jun 12 '23 17:06 roystgnr

I am working on this new FlexiblePatternGenerator that will be able to do what you mentioned here. The new MG allows users to pattern unit meshes based on hexagona/rectuangular/circular and free-style patterns and adopted any closed-loop mesh as the boundary. It then uses XYD to generate the matrix. It should be ready for a PR soon.

miaoyinb avatar Jun 12 '23 17:06 miaoyinb

mixed_pattern

Sample example syntax

[Mesh]
  [accg]
    type = AdvancedConcentricCircleGenerator
    num_sectors = 9
    ring_radii = '1 2'
    ring_intervals = '2 2'
    ring_block_ids = '10 15 20'
    ring_block_names = 'inner_tri inner outer'
    external_boundary_id = 100
    external_boundary_name = 'ext'
    create_outward_interface_boundaries = false
  []
  [reduced_accg]
    type = TransformGenerator
    input = 'accg'
    transform = SCALE
    vector_value = '0.4 0.4 0.4'
  []
  [fpg]
    type = FlexiblePatternGenerator
    inputs = 'accg reduced_accg'
    boundary_type = HEXAGON
    boundary_pitch = ${fparse 12.0*sqrt(3.0)}
    boundary_sectors = 10
    hex_patterns = '0 0;
                   0 2 0;
                    0 0'
    hex_pitches = 7
    rect_pitches_x = 3
    rect_pitches_y = 5
    rect_patterns = '1 1;
                     1 1'
    extra_positions = '0.0 10.0 0.0 
                       0.0 -10.0 0.0'
    extra_positions_mg_indices = '1 1'
    desired_area = 1.0
    verify_holes = false
  []
[]  

miaoyinb avatar Jun 12 '23 17:06 miaoyinb

AdvancedConcentricCircleGenerator is another new MG being developed for pin generation.

miaoyinb avatar Jun 12 '23 17:06 miaoyinb