Skip to content

Commit 9d4a6cd

Browse files
roystgnrjwpeterson
authored andcommitted
Don't constrain hanging nodes at variable boundary
If we have a subdomain-restricted variable which is supported on a fine element but *not* supported on a neighboring coarse element, then we do *not* want to try to generate hanging node constraints for that interface. Doing so was giving us OOB reads and garbage DoF IDs. Backported with the other commits from #2099 with the command. git cherry-pick e9297f1 33466d0 ae5cbc1 de07ffc Refs #2029.
1 parent 7f8bb48 commit 9d4a6cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fe/fe_base.C

+5-1
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,8 @@ FEGenericBase<OutputType>::compute_proj_constraints (DofConstraints & constraint
13801380
if (!elem->active())
13811381
return;
13821382

1383-
const FEType & base_fe_type = dof_map.variable_type(variable_number);
1383+
const Variable & var = dof_map.variable(variable_number);
1384+
const FEType & base_fe_type = var.type();
13841385

13851386
// Construct FE objects for this element and its neighbors.
13861387
std::unique_ptr<FEGenericBase<OutputShape>> my_fe
@@ -1438,6 +1439,9 @@ FEGenericBase<OutputType>::compute_proj_constraints (DofConstraints & constraint
14381439
if (!neigh)
14391440
continue;
14401441

1442+
if (!var.active_on_subdomain(neigh->subdomain_id()))
1443+
continue;
1444+
14411445
// h refinement constraints:
14421446
// constrain dofs shared between
14431447
// this element and ones coarser

0 commit comments

Comments
 (0)