Skip to content
Snippets Groups Projects
Commit f3a1137d authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: parallel construct finiteArea fails with arbitrary connections (#2152)

- the case of 'fan-like' processor was previously assumed to be
  rare (see merge-request !487 and issue #2084).

  However, Vaggelis Papoutsis noticed that even fairly normal geometries
  can trigger problems.

- replaced the old patch/patch matching style with a more general
  edge-based synchronisation and matching that appears to handle
  the corner cases inherently. The internal communication overhead
  is essentially unchanged, and the logic is simpler.
parent 8a3dc052
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,13 @@ class faMesh
static const int quadricsFit_;
// Data Types
//- Internal class for managing patch/patch bookkeeping
//- during construction
class patchTuple;
// Private Member Functions
//- No copy construct
......@@ -268,8 +275,9 @@ class faMesh
// Helpers
//- Get the polyPatch pairs for the boundary edges (natural order)
List<LabelledItem<edge>> getBoundaryEdgePatchPairs() const;
//- Get list of (proc/patchi/patchEdgei) tuple pairs in an
//- globally consistent ordering
List<Pair<patchTuple>> getBoundaryEdgeConnections() const;
//- Create a single patch
PtrList<faPatch> createOnePatch
......@@ -286,14 +294,6 @@ class faMesh
const dictionary* defaultPatchDefinition = nullptr
) const;
//- Reorder processor edges using order of the
//- neighbour processorPolyPatch
void reorderProcEdges
(
faPatchData& patchDef,
const List<LabelledItem<edge>>& bndEdgePatchPairs
) const;
public:
......
This diff is collapsed.
......@@ -28,6 +28,7 @@ License
#include "faPatchData.H"
#include "dictionary.H"
#include "processorFaPatch.H"
#include "processorPolyPatch.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -108,6 +109,24 @@ void Foam::faPatchData::assign(const faPatch& fap)
}
bool Foam::faPatchData::assign_coupled(int ownProci, int neiProci)
{
clear();
if (ownProci == neiProci)
{
return false;
}
name_ = processorPolyPatch::newName(ownProci, neiProci);
type_ = processorFaPatch::typeName;
ownerProcId_ = ownProci;
neighProcId_ = neiProci;
return true;
}
int Foam::faPatchData::matchPatchPair
(
const labelPair& patchPair
......
......@@ -98,6 +98,9 @@ public:
//- Clear and populate with values from finiteArea patch
void assign(const faPatch& fap);
//- Set values consistent with a processor coupling
bool assign_coupled(int ownProci, int neiProci);
//- True if owner/neighbour processor ids are non-equal
bool coupled() const noexcept
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment