Skip to content

Commit cac6350

Browse files
committed
Compare by first PID and then element ID
1 parent e3dac8a commit cac6350

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

include/base/dof_object.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,23 @@ struct CompareDofObjectsByID
13801380
}
13811381
};
13821382

1383+
struct CompareDofObjectsByPIDAndThenID
1384+
{
1385+
bool operator()(const DofObject * a,
1386+
const DofObject * b) const
1387+
{
1388+
libmesh_assert (a);
1389+
libmesh_assert (b);
1390+
1391+
if (a->processor_id() < b->processor_id())
1392+
return true;
1393+
if (b->processor_id() < a->processor_id())
1394+
return false;
1395+
1396+
return a->id() < b->id();
1397+
}
1398+
};
1399+
13831400
} // namespace libMesh
13841401

13851402

include/base/ghosting_functor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class GhostingFunctor : public ReferenceCountedObject<GhostingFunctor>
229229
* What elements do we care about and what variables do we care
230230
* about on each element?
231231
*/
232-
typedef std::map<const Elem*, const CouplingMatrix*, CompareDofObjectsByID> map_type;
232+
typedef std::map<const Elem*, const CouplingMatrix*, CompareDofObjectsByPIDAndThenID> map_type;
233233

234234
/**
235235
* For the specified range of active elements, what other elements

0 commit comments

Comments
 (0)