64 const auto& cnstrTable = *dictionaryConstructorTablePtr_;
72 if (constraintType(iter.key()))
74 cTypes[i++] = iter.key();
86 void Foam::faPatch::clearOut()
96 Foam::faPatch::faPatch
102 const label nbrPolyPatchi,
103 const word& patchType
108 nbrPolyPatchId_(nbrPolyPatchi),
110 edgeFacesPtr_(nullptr),
111 pointLabelsPtr_(nullptr),
112 pointEdgesPtr_(nullptr)
121 Foam::faPatch::faPatch
124 const dictionary&
dict,
126 const faBoundaryMesh& bm,
127 const word& patchType
132 nbrPolyPatchId_(
dict.
get<label>(
"ngbPolyPatchIndex")),
134 edgeFacesPtr_(nullptr),
135 pointLabelsPtr_(nullptr),
136 pointEdgesPtr_(nullptr)
145 Foam::faPatch::faPatch
148 const faBoundaryMesh& bm,
151 const label nbrPolyPatchi
154 patchIdentifier(
p, index),
156 nbrPolyPatchId_(
p.nbrPolyPatchId_),
158 edgeFacesPtr_(nullptr),
159 pointLabelsPtr_(nullptr),
160 pointEdgesPtr_(nullptr)
164 Foam::faPatch::faPatch
193 return boundaryMesh_;
223 for (
const label patchEdgei : this->edgeLabels())
225 const label bndEdgei = (patchEdgei - nInternalEdges);
236 const auto& connections = boundaryMesh().mesh().boundaryConnections();
237 const label nInternalEdges = boundaryMesh().mesh().nInternalEdges();
241 for (
const label patchEdgei : this->edgeLabels())
243 const label bndEdgei = (patchEdgei - nInternalEdges);
244 const label proci = connections[bndEdgei].first();
245 procsUsed.insert(proci);
250 return procsUsed.sortedToc();
261 for (
const label patchEdgei : this->edgeLabels())
263 const label bndEdgei = (patchEdgei - nInternalEdges);
264 const label proci = connections[bndEdgei].first();
273 for (
const label proci : procCount.
sortedToc())
286 if (!pointLabelsPtr_)
291 return *pointLabelsPtr_;
302 return *pointEdgesPtr_;
318 DynamicList<label> dynEdgePoints(2*edges.size());
320 for (
const edge&
e : edges)
323 if (markedPoints.insert(
e.first()))
325 dynEdgePoints.append(
e.first());
328 if (markedPoints.insert(
e.second()))
330 dynEdgePoints.append(
e.second());
335 pointLabelsPtr_ =
new labelList(std::move(dynEdgePoints));
373 List<DynamicList<label,2>> dynPointEdges(edgePoints.size());
377 const edge&
e = edges[edgei];
379 dynPointEdges[edgePoints.find(
e.first())].
append(edgei);
380 dynPointEdges[edgePoints.find(
e.second())].
append(edgei);
385 auto& pEdges = *pointEdgesPtr_;
389 pEdges[pointi] = std::move(dynPointEdges[pointi]);
396 if (nbrPolyPatchId_ < 0)
407 if (nbrPolyPatchId_ < 0)
415 boundaryMesh().
mesh().haloFaceNormals(this->index())
421 auto& pointNorm = tpointNorm.ref();
428 for (
const label bndEdgei : pntEdges[pointi])
430 n += faceNormals[bndEdgei];
446 patchSlice(boundaryMesh().
mesh().edgeOwner())
450 return *edgeFacesPtr_;
476 tedgeNorm.ref().normalise();
497 const vector minVector(vector::uniform(0.57735*SMALL));
498 const scalar minLenSqr(SMALL*SMALL);
502 if (
e.magSqr() < minLenSqr)
508 return nHat*(nHat & edgePN);
514 dc = scalar(1)/(edgeNormals() &
delta());
524 k = edgeNormMag - (scalar(1)/(unitDelta & edgeNormMag))*unitDelta;
553 static_cast<labelList&
>(*this) = newEdges;
560 static_cast<labelList&
>(*this) = std::move(newEdges);
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.
const wordList & inGroups() const noexcept
The (optional) groups that the patch belongs to.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
label appendUniq(const T &val)
Append an element if not already in the list.
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 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.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
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)
Template functions to aid in the implementation of demand driven data.
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.
void deleteDemandDrivenData(DataPtr &dataPtr)
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)
static constexpr const zero Zero
Global zero (0)