Skip to content

Commit e6c52cd

Browse files
Merge pull request #538 from geodynamics/baagaard/fix-buried-edge-parallel
FIX: Use zero constraints when we don't have a cell to get the DS for constraining buried edges in parallel
2 parents 79445bd + 580553d commit e6c52cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libsrc/pylith/feassemble/ConstraintSimple.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,23 @@ pylith::feassemble::ConstraintSimple::initialize(const pylith::topology::Field&
105105
err = PetscDSGetDiscretization(cds, f, &disc);PYLITH_CHECK_ERROR(err);
106106
err = PetscObjectGetName(disc, &name);PYLITH_CHECK_ERROR(err);
107107
if (_subfieldName == std::string(name)) {ds = cds;i_field = f;break;}
108-
}
109-
}
108+
} // for
109+
} // for
110+
PetscInt numConstrainedDOF = _constrainedDOF.size();
111+
PetscInt* constrainedDOF = &_constrainedDOF[0];
110112
if (!ds) {
111113
// :KLUDGE: It is possible for a process to have a DOF that we need to constrain, but the process
112114
// may not have any cells with that DOF. The underlying code doesn't actually care if the point is
113115
// in the DS, so just get any DS and use it for the constraint.
114116
err = DMGetDS(dm, &ds);PYLITH_CHECK_ERROR(err);
115117
i_field = solution.getSubfieldInfo(_subfieldName.c_str()).index;
118+
numConstrainedDOF = 0;
119+
constrainedDOF = NULL;
116120
} // if
117121
err = DMPlexRestoreTransitiveClosure(solution.getDM(), point, PETSC_FALSE, &clSize, &closure);PYLITH_CHECK_ERROR(err);
118122
err = DMGetLabel(solution.getDM(), _labelName.c_str(), &label);PYLITH_CHECK_ERROR(err);
119123
err = PetscDSAddBoundary(ds, DM_BC_ESSENTIAL, _labelName.c_str(), label, 1, &_labelValue, i_field,
120-
_constrainedDOF.size(), &_constrainedDOF[0], (void (*)(void)) _fn, NULL, context, NULL);
124+
numConstrainedDOF, constrainedDOF, (void (*)(void)) _fn, NULL, context, NULL);
121125
PYLITH_CHECK_ERROR(err);
122126
err = DMViewFromOptions(dm, NULL, "-constraint_simple_dm_view");PYLITH_CHECK_ERROR(err);
123127
{

0 commit comments

Comments
 (0)