Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle sideset id & names overlap in StitchedMG #24513

Closed
GiudGiud opened this issue May 27, 2023 Discussed in #24429 · 0 comments · Fixed by #24526
Closed

Handle sideset id & names overlap in StitchedMG #24513

GiudGiud opened this issue May 27, 2023 Discussed in #24429 · 0 comments · Fixed by #24526
Labels
C: Framework C: Meshing MeshGenerator system, mesh loading P: minor A defect that does not affect the accuracy of results. T: defect An anomaly, which is anything that deviates from expectations.

Comments

@GiudGiud
Copy link
Contributor

Bug description

The output of the stitching is very odd in this case. Sidesets meant to be on the left are on the bottom and left, and so on
At this point I think there's considerable overlap in the inputs in ids, and we need to be able to handle that

How to reproduce

Use the inputs in the threads, there's a github repo. i also have a copy

Impact

Safer MOOSE mesh generation

Discussed in #24429

Originally posted by salaudeen-ya May 19, 2023
Hello,

I have two rectangular meshes below

image

I expected to have the dimensions add up as given in the StichedMeshGenerator, but it doesn't;
https://mooseframework.inl.gov/source/meshgenerators/StitchedMeshGenerator.html#!

In addition, the MOOSE could recognize the following IDs in one of the files:

Boundary names that do exist: 
    ID : Name
    0 : Line1
    1 : Line2
    2 : Line3
    3 : Line4
    5 : bottom_pmdl
    6 : left_pmdl
    7 : right_pmdl
    8 : top_pmdl

but still throws this error:
/home/salau/projects/ddm/2Dproblems/right_subdomain_pmdl_schwarz_stitch_1layer.i:83: (BCs/leftBC/boundary): the following node sets (ids) do not exist on the mesh: left_pmdl (12)

I wondered how that could be possible.

The error is generated from this input file:

[Mesh]
  [interior]
    type = FileMeshGenerator
    file = interior.inp
  []

  [pmdl]
    type = FileMeshGenerator
    file = pmdl.inp
  []

  [smg]
    type = StitchedMeshGenerator
    inputs = 'interior pmdl'
    clear_stitched_boundary_ids = false
    stitch_boundaries_pairs = 'right_int left_pmdl'
                              
    #parallel_type = 'replicated'
    #construct_side_list_from_node_list=true
  []
[]


[Variables]
  [u]
    order = FIRST
    family = LAGRANGE
  []
[]

[AuxVariables]
  [xflux]
    order = CONSTANT
    family = MONOMIAL
  []
  [yflux]
    order = CONSTANT
    family = MONOMIAL
  []
[]

[Kernels]
  [diffusion]
    type = MatDiffusion
    variable = u
    diffusivity = 1
  []
    [reaction]
    type =  Reaction
    variable = u
    rate = 0.25
  []
[]

[AuxKernels]
  [xfluxKernel]
    type = DiffusionFluxAux
    diffusivity = -1
    variable = xflux
    diffusion_variable = u
    component = x
  []
  [yfluxKernel]
    type = DiffusionFluxAux
    diffusivity = -1
    variable = yflux
    diffusion_variable = u
    component = y
  []

[]

[BCs]
  [topBC_int] 
    type = NeumannBC
    variable = u
    boundary = 'top_int'
    value = 1
  []

  [leftBC] 
    type = DirichletBC
    variable = u
    boundary = 'left_pmdl'
    value = 0
  []
[]

[Executioner]
  type = Steady
  solve_type = 'NEWTON'

  fixed_point_max_its = 1000
  nl_abs_tol = 1e-10
  fixed_point_rel_tol = 1e-16
  fixed_point_abs_tol = 1e-10

  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'

  [Quadrature]
    type = 'GAUSS'
    custom_blocks = '1 2'    
    custom_orderX = 'FIRST CONSTANT'
    custom_orderY = 'FIRST FIRST'
  []

[]


[Outputs]
  exodus = true
  csv = true
  console = true
[]

For this input file, bottom_int works fine, but left_pmdl does not.

However, consider when I change the order to the stitch with this input file,

[Mesh]
  [pmdl]
    type = FileMeshGenerator
    file = pmdl.inp
  []

  [interior]
    type = FileMeshGenerator
    file = interior.inp
  []

  [smg]
    type = StitchedMeshGenerator
    inputs = 'pmdl interior'
    clear_stitched_boundary_ids = false
    stitch_boundaries_pairs = 'right_pmdl left_int'
                              
    #parallel_type = 'replicated'
    #construct_side_list_from_node_list=true
  []
  
[]
[Variables]
  [v]
    order = FIRST
    family = LAGRANGE
  []
[]

[AuxVariables]
  [xflux_v]
    order = CONSTANT
    family = MONOMIAL
  []
  [yflux_v]
    order = CONSTANT
    family = MONOMIAL
  []
[]

[Kernels]
  [diffusion]
    type = MatDiffusion
    variable = v
    diffusivity = 1
  []
  [reaction]
    type =  Reaction
    variable = v
    rate = 0.25
  []
[]

[AuxKernels]
  [xfluxKernel]
    type = DiffusionFluxAux
    diffusivity = -1
    variable = xflux_v
    diffusion_variable = v
    component = x
  []
  [yfluxKernel]
    type = DiffusionFluxAux
    diffusivity = -1
    variable = yflux_v
    diffusion_variable = v
    component = y
  []
[]

[BCs]
   [topBC] 
    type = NeumannBC
    variable = v
    boundary = 'bottom_int'
    value = 1
  []

  [toppmdl] 
    type = NeumannBC
    variable = v
    boundary = 'left_pmdl'
    value = 1
  []


[]


[Executioner]
  type = Steady
  solve_type = 'NEWTON'

  fixed_point_max_its = 1000
  nl_abs_tol = 1e-10
  fixed_point_rel_tol = 1e-16
  fixed_point_abs_tol = 1e-10

  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
  
  [Quadrature]
    type = 'GAUSS'
    custom_blocks = '1 2'    
    custom_orderX = 'CONSTANT FIRST'
    custom_orderY = 'FIRST FIRST'
  []
[]

[Outputs]
  exodus = true
  csv = true
  console = true
[]

the left_pmdl boundary was recognized (but the bottom_int boundary was not).

Why is this??

Summarily:

  • Why are the dimensions not adding up in the horizontal axis?
  • Why are some boundaries recognized based on the order of stitch, and some are not.

Thank you.

@GiudGiud GiudGiud added C: Framework C: Meshing MeshGenerator system, mesh loading P: minor A defect that does not affect the accuracy of results. T: defect An anomaly, which is anything that deviates from expectations. labels May 27, 2023
@GiudGiud GiudGiud changed the title Odd output from stitched mesh generator Handle sideset id & names overlap in StitchedMG May 30, 2023
GiudGiud added a commit to GiudGiud/moose that referenced this issue May 30, 2023
GiudGiud added a commit to GiudGiud/moose that referenced this issue May 30, 2023
tanoret pushed a commit to tanoret/moose that referenced this issue Jul 10, 2023
GiudGiud pushed a commit to GiudGiud/moose that referenced this issue Aug 3, 2023
Actually prevent overlap between boundaries when stitching
refs idaholab#24513
GiudGiud pushed a commit to GiudGiud/moose that referenced this issue Aug 3, 2023
Actually prevent overlap between boundaries when stitching
refs idaholab#24513
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework C: Meshing MeshGenerator system, mesh loading P: minor A defect that does not affect the accuracy of results. T: defect An anomaly, which is anything that deviates from expectations.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant