63 const auto& cnstrTable = *dictionaryConstructorTablePtr_;
71 if (constraintType(iter.key()))
73 cTypes[i++] = iter.key();
85void Foam::faPatch::clearOut()
87 edgeFacesPtr_.reset(
nullptr);
88 pointLabelsPtr_.reset(
nullptr);
89 pointEdgesPtr_.reset(
nullptr);
101 const label nbrPolyPatchi,
102 const word& patchType
107 nbrPolyPatchId_(nbrPolyPatchi),
117Foam::faPatch::faPatch
122 const faBoundaryMesh& bm,
123 const word& patchType
128 nbrPolyPatchId_(
dict.get<label>(
"ngbPolyPatchIndex")),
138Foam::faPatch::faPatch
141 const faBoundaryMesh& bm,
144 const label nbrPolyPatchi
149 nbrPolyPatchId_(
p.nbrPolyPatchId_),
154Foam::faPatch::faPatch
183 return boundaryMesh_;
213 for (
const label patchEdgei : this->edgeLabels())
215 const label bndEdgei = (patchEdgei - nInternalEdges);
216 output[count] = connections[bndEdgei];
226 const auto& connections = boundaryMesh().mesh().boundaryConnections();
227 const label nInternalEdges = boundaryMesh().mesh().nInternalEdges();
231 for (
const label patchEdgei : this->edgeLabels())
233 const label bndEdgei = (patchEdgei - nInternalEdges);
234 const label proci = connections[bndEdgei].first();
235 procsUsed.insert(proci);
240 return procsUsed.sortedToc();
251 for (
const label patchEdgei : this->edgeLabels())
253 const label bndEdgei = (patchEdgei - nInternalEdges);
254 const label proci = connections[bndEdgei].first();
261 List<labelPair> output(procCount.
size());
263 for (
const label proci : procCount.
sortedToc())
265 output[count].first() = proci;
266 output[count].second() = procCount[proci];
276 if (!pointLabelsPtr_)
281 return *pointLabelsPtr_;
292 return *pointEdgesPtr_;
308 DynamicList<label> dynEdgePoints(2*edges.size());
310 for (
const edge&
e : edges)
313 if (markedPoints.insert(
e.first()))
315 dynEdgePoints.append(
e.first());
318 if (markedPoints.insert(
e.second()))
320 dynEdgePoints.append(
e.second());
325 pointLabelsPtr_ = std::make_unique<labelList>(std::move(dynEdgePoints));
368 const edge&
e = edges[edgei];
370 dynPointEdges[edgePoints.
find(
e.first())].
append(edgei);
371 dynPointEdges[edgePoints.
find(
e.second())].
append(edgei);
375 pointEdgesPtr_ = std::make_unique<labelListList>(edgePoints.
size());
376 auto& pEdges = *pointEdgesPtr_;
380 pEdges[pointi] = std::move(dynPointEdges[pointi]);
387 if (nbrPolyPatchId_ < 0)
398 if (nbrPolyPatchId_ < 0)
412 auto& pointNorm = tpointNorm.ref();
419 for (
const label bndEdgei : pntEdges[pointi])
421 n += faceNormals[bndEdgei];
435 edgeFacesPtr_ = std::make_unique<labelList::subList>
437 patchSlice(boundaryMesh().
mesh().edgeOwner())
441 return *edgeFacesPtr_;
467 tedgeNorm.ref().normalise();
489 const scalar minLenSqr(SMALL*SMALL);
493 if (
e.magSqr() < minLenSqr)
499 return nHat*(nHat & edgePN);
561 static_cast<labelList&
>(*this) = newEdges;
568 static_cast<labelList&
>(*this) = std::move(newEdges);
574 os.writeEntry(
"type",
type());
578 os.writeEntry(
"ngbPolyPatchIndex", nbrPolyPatchId_);
579 static_cast<const labelList&
>(*this).writeEntry(
"edgeLabels",
os);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Info<< " "<< writer.output().name()<< nl;}{ const Field< vector > edgeCentres(faMeshTools::flattenEdgeField(aMesh.edgeCentres(), true))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
label size() const noexcept
The number of elements in table.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &val)
Append an element at the end of the list.
void resize(const label len)
Adjust allocated size of list.
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label nInternalEdges() const
Number of internal edges.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
T & first()
Access first element of the list, position [0].
bool get(const label i) const
void size(const label n)
Older name for setAddressableSize.
label find(const T &val) const
Find index of the first occurrence of the value.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const bMesh & mesh() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
Finite area boundary mesh, which is a faPatch list with registered IO, a reference to the associated ...
Finite area patch class. Used for 2-D non-Euclidian finite area method.
static wordList constraintTypes()
Return a list of all the constraint patch types.
label offset() const
The offset where this patch starts in the boundary edge list.
const labelListList & pointEdges() const
Return patch point-edge addressing.
virtual void write(Ostream &) const
Write.
tmp< vectorField > ngbPolyPatchPointNormals() const
Return normals of neighbour polyPatch joined points.
const labelList & pointLabels() const
Return patch point labels.
virtual ~faPatch()
Destructor.
void resetEdges(const labelUList &newEdges)
Reset the list of edges (use with caution).
virtual void makeWeights(scalarField &) const
Make patch weighting factors.
virtual void makeLPN(scalarField &) const
Make patch geodesic distance between P and N.
const labelList & edgeLabels() const noexcept
Return the list of edges.
virtual void makeDeltaCoeffs(scalarField &) const
Make patch edge - neighbour face distances.
List< labelPair > boundaryConnections() const
List of proc/face for the boundary edge neighbours in locally reordered edge numbering.
const scalarField & magEdgeLengths() const
Return edge length magnitudes, like the faMesh::magLe() method.
const scalarField & lPN() const
Return patch geodesic distance between P and N.
tmp< vectorField > ngbPolyPatchFaceNormals() const
Return normals of neighbour polyPatch faces.
friend class faBoundaryMesh
The faPatch geometry initialisation is called by faBoundaryMesh.
const vectorField & skewCorrectionVectors() const
Return patch skew-correction vectors.
const vectorField & edgeLengths() const
Return edge length vectors, like the faMesh::Le() method.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
label nEdges() const noexcept
Number of edge labels (boundary edges) addressed by this patch.
tmp< vectorField > edgeFaceCentres() const
Return neighbour face centres.
void calcPointEdges() const
Calculate patch point-edge addressing.
const faBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
const scalarField & weights() const
Return patch weighting factors.
const labelUList & edgeFaces() const
Return edge-face addressing.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patch after moving points.
const vectorField & edgeCentres() const
Return edge centres.
labelList boundaryProcs() const
Boundary edge neighbour processors (does not include own proc).
const List< T >::subList patchSlice(const UList< T > &values) const
This patch slice from the complete list of values, which has size mesh::nEdges(), using the virtual p...
tmp< vectorField > edgeNormals() const
Return edge unit normals, like the faMesh::unitLe() method.
void calcPointLabels() const
Calculate patch point labels.
List< labelPair > boundaryProcSizes() const
List of proc/size for the boundary edge neighbour processors (does not include own proc).
void patchInternalField(const UList< Type > &internalData, const labelUList &addressing, UList< Type > &pfld) const
Extract internal field next to patch using specified addressing.
const scalarField & deltaCoeffs() const
Return patch edge - neighbour face distances.
virtual void makeCorrectionVectors(vectorField &) const
Make non-orthogonality correction vectors.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
label start() const
Patch start in edge list.
Identifies a patch by name and index, with optional physical type and group information.
void write(Ostream &os) const
Write (physicalType, inGroups) dictionary entries (without surrounding braces).
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
patchIdentifier(const patchIdentifier &)=default
Copy construct.
void addGroup(const word &name)
Add (unique) group for the patch.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
List of word.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
labelList pointLabels(nPoints, -1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.