Skip to content

Commit

Permalink
Allow coincident nodes on mortar boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad authored and hugary1995 committed Jul 25, 2022
1 parent be12962 commit 29f8aa0
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 5 deletions.
11 changes: 6 additions & 5 deletions framework/src/constraints/AutomaticMortarGeneration.C
Expand Up @@ -1850,10 +1850,13 @@ AutomaticMortarGeneration::projectSecondaryNodesSinglePair(
secondary_val);
}

// Sanity check
if (!found_match)
mooseError("Could not associate primary/secondary neighbors on either side of "
"secondary_node.");
{
// There could be coincident nodes and this might be a bad primary candidate (see
// issue #21680). Instead of giving up, let's try continuing
rejected_primary_elem_candidates.insert(primary_elem_candidate);
continue;
}

// We need to handle the case where we've exactly projected a secondary node onto a
// primary node, but our secondary node is at one of the secondary face endpoints and
Expand Down Expand Up @@ -1894,10 +1897,8 @@ AutomaticMortarGeneration::projectSecondaryNodesSinglePair(
break; // out of e-loop
}
else
{
// The current secondary_node is not in this Elem, so keep track of the rejects.
rejected_primary_elem_candidates.insert(primary_elem_candidate);
}
}

if (projection_succeeded)
Expand Down
63 changes: 63 additions & 0 deletions test/tests/mortar/coincident-nodes/test.i
@@ -0,0 +1,63 @@
[Mesh]
[top]
type = GeneratedMeshGenerator
dim = 2
ymin = 0.5
ymax = 1
nx = 2
ny = 1
subdomain_ids = '0 0'
[]
[bottom]
type = GeneratedMeshGenerator
dim = 2
ymin = 0
ymax = 0.5
nx = 2
ny = 1
subdomain_ids = '1 1'
[]
[combine]
type = CombinerGenerator
inputs = 'top bottom'
[]
[secondary]
type = LowerDBlockFromSidesetGenerator
input = combine
sidesets = left
new_block_id = 11
new_block_name = secondary
[]
[primary]
type = LowerDBlockFromSidesetGenerator
input = secondary
sidesets = right
new_block_id = 12
new_block_name = primary
[]
[]

[Problem]
solve = false
[]

[Variables]
[u][]
[]

[Constraints]
[mortar]
type = PenaltyEqualValueConstraint
secondary_variable = u
primary_boundary = right
secondary_boundary = left
primary_subdomain = 12
secondary_subdomain = 11
penalty_value = 10
[]
[]

[Executioner]
type = Transient
num_steps = 1
[]
9 changes: 9 additions & 0 deletions test/tests/mortar/coincident-nodes/tests
@@ -0,0 +1,9 @@
[Tests]
[coincident]
type = RunApp
input = test.i
requirement = 'The system shall be able to construct a mortar mesh when coincident nodes exist on one or more mortar boundaries.'
design = 'Constraints/index.md'
issues = '#21680'
[]
[]

0 comments on commit 29f8aa0

Please sign in to comment.