Go to the documentation of this file.
51 void Foam::faPatch::clearOut()
61 Foam::faPatch::faPatch
67 const label ngbPolyPatchIndex
72 nbrPolyPatchId_(ngbPolyPatchIndex),
74 edgeFacesPtr_(
nullptr),
75 pointLabelsPtr_(
nullptr),
76 pointEdgesPtr_(
nullptr)
80 Foam::faPatch::faPatch
90 nbrPolyPatchId_(
dict.
get<label>(
"ngbPolyPatchIndex")),
92 edgeFacesPtr_(
nullptr),
93 pointLabelsPtr_(
nullptr),
94 pointEdgesPtr_(
nullptr)
102 nbrPolyPatchId_(
p.nbrPolyPatchId_),
104 edgeFacesPtr_(nullptr),
105 pointLabelsPtr_(nullptr),
106 pointEdgesPtr_(nullptr)
122 return boundaryMesh_;
141 for (
const label patchEdgei : this->edgeLabels())
143 const label bndEdgei = (patchEdgei - nInternalEdges);
159 for (
const label patchEdgei : this->edgeLabels())
161 const label bndEdgei = (patchEdgei - nInternalEdges);
162 const label proci = connections[bndEdgei].first();
168 return procsUsed.sortedToc();
179 for (
const label patchEdgei : this->edgeLabels())
181 const label bndEdgei = (patchEdgei - nInternalEdges);
182 const label proci = connections[bndEdgei].first();
191 for (
const label proci : procCount.sortedToc())
204 if (!pointLabelsPtr_)
209 return *pointLabelsPtr_;
220 return *pointEdgesPtr_;
238 for (
const edge&
e : edges)
241 if (markedPoints.insert(
e.first()))
243 dynEdgePoints.
append(
e.first());
246 if (markedPoints.insert(
e.second()))
248 dynEdgePoints.append(
e.second());
253 pointLabelsPtr_ =
new labelList(std::move(dynEdgePoints));
295 const edge&
e = edges[edgei];
297 dynPointEdges[edgePoints.find(
e.first())].
append(edgei);
298 dynPointEdges[edgePoints.find(
e.second())].
append(edgei);
303 auto& pEdges = *pointEdgesPtr_;
307 pEdges[pointi] = std::move(dynPointEdges[pointi]);
314 if (nbrPolyPatchId_ < 0)
325 if (nbrPolyPatchId_ < 0)
339 auto& pointNorm = tpointNorm.ref();
346 for (
const label bndEdgei : pntEdges[pointi])
368 return *edgeFacesPtr_;
394 for (
vector&
n : tedgeNorm.ref())
406 auto& fc = tfc.ref();
416 fc[edgeI] = gfc[faceLabels[edgeI]];
425 return edgeNormals()*(edgeNormals() & (edgeCentres() - edgeFaceCentres()));
431 dc = scalar(1)/(edgeNormals() &
delta());
441 k = edgeNormMag - (scalar(1)/(unitDelta & edgeNormMag))*unitDelta;
470 static_cast<labelList&
>(*this) = newEdges;
477 static_cast<labelList&
>(*this) = std::move(newEdges);
488 static_cast<const labelList&
>(*this).writeEntry(
"edgeLabels",
os);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
const bMesh & mesh() const
tmp< vectorField > edgeFaceCentres() const
Return neighbour face centres.
const labelListList & pointEdges() const
Return patch point-edge addressing.
static Ostream & output(Ostream &os, const IntRange< T > &range)
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
virtual void movePoints(const pointField &)
Correct patch after moving points.
void resetEdges(const UList< label > &newEdges)
Reset the list of edges (use with caution)
const scalarField & deltaCoeffs() const
Return patch edge - neighbour face distances.
virtual void makeWeights(scalarField &) const
Make patch weighting factors.
Template functions to aid in the implementation of demand driven data.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
A List obtained as a section of another List.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void calcPointLabels() const
Calculate patch point labels.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
const faBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
const scalarField & weights() const
Return patch weighting factors.
#define forAll(list, i)
Loop across all elements in list.
tmp< vectorField > ngbPolyPatchFaceNormals() const
Return normals of neighbour polyPatch faces.
const labelUList & edgeFaces() const
Return edge-face addressing.
void deleteDemandDrivenData(DataPtr &dataPtr)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Finite area boundary mesh.
Identifies a patch by name and index, with optional physical type and group information.
labelList boundaryProcs() const
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
virtual void makeDeltaCoeffs(scalarField &) const
Make patch edge - neighbour face distances.
const vectorField & edgeCentres() const
Return edge centres.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
SubList< T > subList
Declare type of subList.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
List< labelPair > boundaryProcSizes() const
void makeCorrectionVectors(vectorField &) const
label start() const
Patch start in edge list.
label nInternalEdges() const
Number of internal edges.
virtual ~faPatch()
Destructor.
List< labelPair > boundaryConnections() const
const labelList & pointLabels() const
Return patch point labels.
List< labelList > labelListList
A List of labelList.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
const scalarField & magEdgeLengths() const
Return edge length magnitudes.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
virtual void write(Ostream &) const
Write.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
label k
Boltzmann constant.
const dimensionedScalar e
Elementary charge.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
tmp< vectorField > edgeNormals() const
Return edge normals.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
void write(Ostream &os) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
tmp< vectorField > ngbPolyPatchPointNormals() const
Return normals of neighbour polyPatch joined points.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
defineTypeNameAndDebug(combustionModel, 0)
labelList pointLabels(nPoints, -1)
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
const vectorField & edgeLengths() const
Return edge length vectors.
void calcPointEdges() const
Calculate patch point-edge addressing.