40 Foam::faGlobalMeshData::faGlobalMeshData(
const faMesh&
mesh)
76 label polyMeshNGlobalPoints = mesh_().globalData().nGlobalPoints();
78 const labelList& polyMeshSharedPointLabels =
79 mesh_().globalData().sharedPointLabels();
81 const labelList& polyMeshSharedPointAddr =
82 mesh_().globalData().sharedPointAddr();
88 forAll(mesh_.boundary(), patchI)
90 const faPatch& fap = mesh_.boundary()[patchI];
92 if (isA<processorFaPatch>(fap))
96 forAll(localPointLabels, pointI)
99 mesh_.patch().meshPoints()[localPointLabels[pointI]];
101 const label sharedPolyMeshPoint =
102 polyMeshSharedPointLabels.
find(polyMeshPoint);
106 sharedPolyMeshPoint != -1
107 && !sharedPointLabels.
found(localPointLabels[pointI])
110 globalList[polyMeshSharedPointAddr[sharedPolyMeshPoint]]
113 sharedPointLabels.
insert(localPointLabels[pointI]);
119 sharedPointLabels_ = sharedPointLabels.
toc();
124 for (label i=0; i<globalList.size(); ++i)
126 if (globalList[i] > 0)
128 globalList[i] = ++nGlobalPoints_;
132 sharedPointAddr_.setSize(sharedPointLabels_.size());
133 forAll(sharedPointAddr_, pointI)
135 const label polyMeshSharedPointIndex =
136 polyMeshSharedPointLabels.
find 138 mesh_.patch().meshPoints()[sharedPointLabels_[pointI]]
141 sharedPointAddr_[pointI] =
142 globalList[polyMeshSharedPointAddr[polyMeshSharedPointIndex]]
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
bool found(const Key &key) const
Same as contains()
const labelList & pointLabels() const
Return patch point labels.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const faMesh & mesh() const noexcept
Return mesh reference.
#define forAll(list, i)
Loop across all elements in list.
~faGlobalMeshData()
Destructor.
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
Determines/represents processor-processor connection. After instantiation contains the processor-proc...
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Define the processor-processor connection table by walking a list of patches and detecting the proces...
void updateMesh()
Change global mesh data given a topological change.
List< Key > toc() const
The table of contents (the keys) in unsorted order.
Inter-processor communications stream.
static constexpr const zero Zero
Global zero (0)