Skip to content

Commit

Permalink
Merge pull request #538 from geodynamics/baagaard/fix-buried-edge-par…
Browse files Browse the repository at this point in the history
…allel

FIX: Use zero constraints when we don't have a cell to get the DS for constraining buried edges in parallel
  • Loading branch information
baagaard-usgs authored Oct 14, 2022
2 parents 79445bd + 580553d commit e6c52cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libsrc/pylith/feassemble/ConstraintSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,23 @@ pylith::feassemble::ConstraintSimple::initialize(const pylith::topology::Field&
err = PetscDSGetDiscretization(cds, f, &disc);PYLITH_CHECK_ERROR(err);
err = PetscObjectGetName(disc, &name);PYLITH_CHECK_ERROR(err);
if (_subfieldName == std::string(name)) {ds = cds;i_field = f;break;}
}
}
} // for
} // for
PetscInt numConstrainedDOF = _constrainedDOF.size();
PetscInt* constrainedDOF = &_constrainedDOF[0];
if (!ds) {
// :KLUDGE: It is possible for a process to have a DOF that we need to constrain, but the process
// may not have any cells with that DOF. The underlying code doesn't actually care if the point is
// in the DS, so just get any DS and use it for the constraint.
err = DMGetDS(dm, &ds);PYLITH_CHECK_ERROR(err);
i_field = solution.getSubfieldInfo(_subfieldName.c_str()).index;
numConstrainedDOF = 0;
constrainedDOF = NULL;
} // if
err = DMPlexRestoreTransitiveClosure(solution.getDM(), point, PETSC_FALSE, &clSize, &closure);PYLITH_CHECK_ERROR(err);
err = DMGetLabel(solution.getDM(), _labelName.c_str(), &label);PYLITH_CHECK_ERROR(err);
err = PetscDSAddBoundary(ds, DM_BC_ESSENTIAL, _labelName.c_str(), label, 1, &_labelValue, i_field,
_constrainedDOF.size(), &_constrainedDOF[0], (void (*)(void)) _fn, NULL, context, NULL);
numConstrainedDOF, constrainedDOF, (void (*)(void)) _fn, NULL, context, NULL);
PYLITH_CHECK_ERROR(err);
err = DMViewFromOptions(dm, NULL, "-constraint_simple_dm_view");PYLITH_CHECK_ERROR(err);
{
Expand Down

0 comments on commit e6c52cd

Please sign in to comment.