64 const auto& cnstrTable = *dictionaryConstructorTablePtr_;
72 if (constraintType(iter.key()))
74 cTypes[i++] = iter.key();
86void Foam::faPatch::clearOut()
102 const label nbrPolyPatchi,
103 const word& patchType
108 nbrPolyPatchId_(nbrPolyPatchi),
110 edgeFacesPtr_(nullptr),
111 pointLabelsPtr_(nullptr),
112 pointEdgesPtr_(nullptr)
127 const word& patchType
132 nbrPolyPatchId_(
dict.get<label>(
"ngbPolyPatchIndex")),
134 edgeFacesPtr_(nullptr),
135 pointLabelsPtr_(nullptr),
136 pointEdgesPtr_(nullptr)
151 const label nbrPolyPatchi
156 nbrPolyPatchId_(
p.nbrPolyPatchId_),
158 edgeFacesPtr_(nullptr),
159 pointLabelsPtr_(nullptr),
160 pointEdgesPtr_(nullptr)
193 return boundaryMesh_;
212 for (
const label patchEdgei : this->edgeLabels())
214 const label bndEdgei = (patchEdgei - nInternalEdges);
215 output[count] = connections[bndEdgei];
230 for (
const label patchEdgei : this->edgeLabels())
232 const label bndEdgei = (patchEdgei - nInternalEdges);
233 const label proci = connections[bndEdgei].first();
250 for (
const label patchEdgei : this->edgeLabels())
252 const label bndEdgei = (patchEdgei - nInternalEdges);
253 const label proci = connections[bndEdgei].first();
262 for (
const label proci : procCount.
sortedToc())
264 output[count].first() = proci;
265 output[count].second() = procCount[proci];
275 if (!pointLabelsPtr_)
280 return *pointLabelsPtr_;
291 return *pointEdgesPtr_;
309 for (
const edge&
e : edges)
317 if (markedPoints.
insert(
e.second()))
319 dynEdgePoints.
append(
e.second());
324 pointLabelsPtr_ =
new labelList(std::move(dynEdgePoints));
366 const edge&
e = edges[edgei];
369 dynPointEdges[edgePoints.
find(
e.second())].
append(edgei);
374 auto& pEdges = *pointEdgesPtr_;
378 pEdges[pointi] = std::move(dynPointEdges[pointi]);
385 if (nbrPolyPatchId_ < 0)
396 if (nbrPolyPatchId_ < 0)
410 auto& pointNorm = tpointNorm.ref();
417 for (
const label bndEdgei : pntEdges[pointi])
439 return *edgeFacesPtr_;
465 for (
vector&
n : tedgeNorm.ref())
477 auto& fc = tfc.ref();
487 fc[edgeI] = gfc[faceLabels[edgeI]];
496 return edgeNormals()*(edgeNormals() & (edgeCentres() - edgeFaceCentres()));
502 dc = scalar(1)/(edgeNormals() &
delta());
512 k = edgeNormMag - (scalar(1)/(unitDelta & edgeNormMag))*unitDelta;
541 static_cast<labelList&
>(*this) = newEdges;
548 static_cast<labelList&
>(*this) = std::move(newEdges);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
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.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
SubList< label > subList
Declare type of subList.
void append(const T &val)
Append an element at the end of the list.
label appendUniq(const T &val)
Append an element if not already in 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,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
label nInternalEdges() const
Number of internal edges.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
A List obtained as a section of another List.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
T & first()
Return the first element of the list.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void writeEntry(Ostream &os) const
Write the UList with its compound type.
void size(const label n)
Older name for setAddressableSize.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const bMesh & mesh() const
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Finite area boundary mesh.
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.
const labelListList & pointEdges() const
Return patch point-edge addressing.
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 makeDeltaCoeffs(scalarField &) const
Make patch edge - neighbour face distances.
List< labelPair > boundaryConnections() const
const scalarField & magEdgeLengths() const
Return edge length magnitudes.
tmp< vectorField > ngbPolyPatchFaceNormals() const
Return normals of neighbour polyPatch faces.
const vectorField & edgeLengths() const
Return edge length vectors.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
tmp< vectorField > edgeFaceCentres() const
Return neighbour face centres.
void calcPointEdges() const
Calculate patch point-edge addressing.
const faBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
const scalarField & weights() const
Return patch weighting factors.
const labelUList & edgeFaces() const
Return edge-face addressing.
const vectorField & edgeCentres() const
Return edge centres.
labelList boundaryProcs() const
tmp< vectorField > edgeNormals() const
Return edge normals.
void calcPointLabels() const
Calculate patch point labels.
List< labelPair > boundaryProcSizes() const
const scalarField & deltaCoeffs() const
Return patch edge - neighbour face distances.
void makeCorrectionVectors(vectorField &) const
label start() const
Patch start in edge list.
virtual bool write()
Write the output fields.
void movePoints()
Update for new mesh geometry.
Identifies a patch by name and index, with optional physical type and group information.
const wordList & inGroups() const noexcept
The (optional) groups that the patch belongs to.
int myProcNo() const noexcept
Return processor number.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Template functions to aid in the implementation of demand driven data.
OBJstream os(runTime.globalPath()/outputName)
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
List< label > labelList
A List of labels.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
static Ostream & output(Ostream &os, const IntRange< T > &range)
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void deleteDemandDrivenData(DataPtr &dataPtr)
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.