63 const auto& cnstrTable = *dictionaryConstructorTablePtr_;
71 if (constraintType(iter.key()))
73 cTypes[i++] = iter.key();
85 void Foam::faPatch::clearOut()
87 edgeFacesPtr_.reset(
nullptr);
88 pointLabelsPtr_.reset(
nullptr);
89 pointEdgesPtr_.reset(
nullptr);
95 Foam::faPatch::faPatch
101 const label nbrPolyPatchi,
102 const word& patchType
107 nbrPolyPatchId_(nbrPolyPatchi),
117 Foam::faPatch::faPatch
120 const dictionary&
dict,
122 const faBoundaryMesh& bm,
123 const word& patchType
128 nbrPolyPatchId_(
dict.
get<label>(
"ngbPolyPatchIndex")),
138 Foam::faPatch::faPatch
141 const faBoundaryMesh& bm,
144 const label nbrPolyPatchi
147 patchIdentifier(
p, index),
149 nbrPolyPatchId_(
p.nbrPolyPatchId_),
154 Foam::faPatch::faPatch
183 return boundaryMesh_;
213 for (
const label patchEdgei : this->edgeLabels())
215 const label bndEdgei = (patchEdgei - nInternalEdges);
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();
263 for (
const label proci : procCount.
sortedToc())
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));
364 List<DynamicList<label,2>> dynPointEdges(edgePoints.size());
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)
406 boundaryMesh().
mesh().haloFaceNormals(this->index())
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();
488 const vector minVector(vector::uniform(0.57735*SMALL));
489 const scalar minLenSqr(SMALL*SMALL);
493 if (
e.magSqr() < minLenSqr)
499 return nHat*(nHat & edgePN);
505 dc = scalar(1)/(edgeNormals() &
delta());
513 k = edgeNormals() - (scalar(1)/(unitDelta & edgeNormals()))*unitDelta;
542 static_cast<labelList&
>(*this) = newEdges;
549 static_cast<labelList&
>(*this) = std::move(newEdges);
void addGroup(const word &name)
Add (unique) group for the patch.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const scalarField & weights() const
Return patch weighting factors.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
void write(Ostream &os) const
Write (physicalType, inGroups) dictionary entries (without surrounding braces)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList pointLabels(nPoints, -1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
const scalarField & deltaCoeffs() const
Return patch edge - neighbour face distances.
Identifies a patch by name and index, with optional physical type and group information.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
const labelList & pointLabels() const
Return patch point labels.
label nInternalEdges() const
Number of internal edges.
virtual void makeDeltaCoeffs(scalarField &) const
Make patch edge - neighbour face distances.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
const scalarField & magEdgeLengths() const
Return edge length magnitudes, like the faMesh::magLe() method.
SubList< edge > subList
Declare type of subList.
label k
Boltzmann constant.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
List< labelList > labelListList
List of labelList.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
List< labelPair > boundaryProcSizes() const
List of proc/size for the boundary edge neighbour processors (does not include own proc) ...
#define forAll(list, i)
Loop across all elements in list.
static wordList constraintTypes()
Return a list of all the constraint patch types.
void makeCorrectionVectors(vectorField &) const
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
label size() const noexcept
The number of elements in table.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
const dimensionedScalar e
Elementary charge.
const vectorField & edgeCentres() const
Return edge centres.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
tmp< vectorField > edgeFaceCentres() const
Return neighbour face centres.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ const Field< vector > edgeCentres(faMeshTools::flattenEdgeField(aMesh.edgeCentres(), true))
void calcPointLabels() const
Calculate patch point labels.
A class for handling words, derived from Foam::string.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual void write(Ostream &) const
Write.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
const labelUList & edgeFaces() const
Return edge-face addressing.
tmp< vectorField > edgeNormals() const
Return edge unit normals, like the faMesh::unitLe() method.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
OBJstream os(runTime.globalPath()/outputName)
labelList boundaryProcs() const
Boundary edge neighbour processors (does not include own proc)
defineTypeNameAndDebug(combustionModel, 0)
List< labelPair > boundaryConnections() const
List of proc/face for the boundary edge neighbours in locally reordered edge numbering.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
label start() const
Patch start in edge list.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual ~faPatch()
Destructor.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
tmp< vectorField > ngbPolyPatchPointNormals() const
Return normals of neighbour polyPatch joined points.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
virtual void makeWeights(scalarField &) const
Make patch weighting factors.
static bool constraintType(const word &patchType)
Return true if the given type is a constraint type.
const vectorField & edgeLengths() const
Return edge length vectors, like the faMesh::Le() method.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Finite area boundary mesh.
const labelListList & pointEdges() const
Return patch point-edge addressing.
static Ostream & output(Ostream &os, const IntRange< T > &range)
void writeEntry(Ostream &os) const
Write the UList with its compound type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const bMesh & mesh() const
label offset() const
The offset where this patch starts in the boundary edge list.
List< label > labelList
A List of labels.
A class for managing temporary objects.
tmp< vectorField > ngbPolyPatchFaceNormals() const
Return normals of neighbour polyPatch faces.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patch after moving points.
void calcPointEdges() const
Calculate patch point-edge addressing.
void resetEdges(const labelUList &newEdges)
Reset the list of edges (use with caution)
const faBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
forAllConstIters(mixture.phases(), phase)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)