Commit f1e7cae6 authored by mattijs's avatar mattijs
Browse files

ENH: Have edge addressing from coupledPatch to mesh

parent b1484b37
...@@ -1122,6 +1122,9 @@ void Foam::globalMeshData::clearOut() ...@@ -1122,6 +1122,9 @@ void Foam::globalMeshData::clearOut()
deleteDemandDrivenData(sharedEdgeAddrPtr_); deleteDemandDrivenData(sharedEdgeAddrPtr_);
coupledPatchPtr_.clear(); coupledPatchPtr_.clear();
coupledPatchMeshEdgesPtr_.clear();
coupledPatchMeshEdgeMapPtr_.clear();
// Point // Point
globalPointNumberingPtr_.clear(); globalPointNumberingPtr_.clear();
globalPointSlavesPtr_.clear(); globalPointSlavesPtr_.clear();
...@@ -1409,6 +1412,45 @@ const Foam::indirectPrimitivePatch& Foam::globalMeshData::coupledPatch() const ...@@ -1409,6 +1412,45 @@ const Foam::indirectPrimitivePatch& Foam::globalMeshData::coupledPatch() const
} }
const Foam::labelList& Foam::globalMeshData::coupledPatchMeshEdges() const
{
if (!coupledPatchMeshEdgesPtr_.valid())
{
coupledPatchMeshEdgesPtr_.reset
(
new labelList
(
coupledPatch().meshEdges
(
mesh_.edges(),
mesh_.pointEdges()
)
)
);
}
return coupledPatchMeshEdgesPtr_();
}
const Foam::Map<Foam::label>& Foam::globalMeshData::coupledPatchMeshEdgeMap()
const
{
if (!coupledPatchMeshEdgeMapPtr_.valid())
{
const labelList& me = coupledPatchMeshEdges();
coupledPatchMeshEdgeMapPtr_.reset(new Map<label>(2*me.size()));
Map<label>& em = coupledPatchMeshEdgeMapPtr_();
forAll(me, i)
{
em.insert(me[i], i);
}
}
return coupledPatchMeshEdgeMapPtr_();
}
const Foam::globalIndex& Foam::globalMeshData::globalPointNumbering() const const Foam::globalIndex& Foam::globalMeshData::globalPointNumbering() const
{ {
if (!globalPointNumberingPtr_.valid()) if (!globalPointNumberingPtr_.valid())
......
...@@ -208,6 +208,10 @@ class globalMeshData ...@@ -208,6 +208,10 @@ class globalMeshData
mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_; mutable autoPtr<indirectPrimitivePatch> coupledPatchPtr_;
mutable autoPtr<labelList> coupledPatchMeshEdgesPtr_;
mutable autoPtr<Map<label> > coupledPatchMeshEdgeMapPtr_;
// Collocated // Collocated
// Coupled point to collocated coupled points // Coupled point to collocated coupled points
...@@ -506,6 +510,13 @@ public: ...@@ -506,6 +510,13 @@ public:
//- Return patch of all coupled faces //- Return patch of all coupled faces
const indirectPrimitivePatch& coupledPatch() const; const indirectPrimitivePatch& coupledPatch() const;
//- Return map from coupledPatch edges to mesh edges
const labelList& coupledPatchMeshEdges() const;
//- Return map from mesh edges to coupledPatch edges
const Map<label>& coupledPatchMeshEdgeMap() const;
// Coupled point to collocated coupled points. Coupled points are // Coupled point to collocated coupled points. Coupled points are
// points on any coupled patch. // points on any coupled patch.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment