Go to the documentation of this file.
50 void Foam::faPatch::clearOut()
60 Foam::faPatch::faPatch
66 const label ngbPolyPatchIndex
71 ngbPolyPatchIndex_(ngbPolyPatchIndex),
73 edgeFacesPtr_(nullptr),
74 pointLabelsPtr_(nullptr),
75 pointEdgesPtr_(nullptr)
79 Foam::faPatch::faPatch
89 ngbPolyPatchIndex_(
dict.get<label>(
"ngbPolyPatchIndex")),
91 edgeFacesPtr_(nullptr),
92 pointLabelsPtr_(nullptr),
93 pointEdgesPtr_(nullptr)
101 ngbPolyPatchIndex_(
p.ngbPolyPatchIndex_),
103 edgeFacesPtr_(nullptr),
104 pointLabelsPtr_(nullptr),
105 pointEdgesPtr_(nullptr)
121 return ngbPolyPatchIndex_;
127 return boundaryMesh_;
139 if (!pointLabelsPtr_)
144 return *pointLabelsPtr_;
156 bool existStart =
false;
157 bool existEnd =
false;
161 if (*iter == edges[edgeI].start())
166 if (*iter == edges[edgeI].
end())
174 labels.
append(edges[edgeI].start());
198 const edge& curPoints =
e[edgeI];
202 const label localPointIndex =
points.find(curPoints[pointI]);
204 pointEdgs[localPointIndex].append(edgeI);
214 pEdges[pointI].setSize(pointEdgs[pointI].size());
220 curEdgesIter != pointEdgs[pointI].end();
224 pEdges[pointI][i] = curEdgesIter();
237 return *pointEdgesPtr_;
245 if (ngbPolyPatchIndex() == -1)
279 ngbFaces[edgeI] = -1;
281 label curEdge = (*this)[edgeI];
283 label curPMeshEdge = meshEdges[curEdge];
285 forAll(edgeFaces[curPMeshEdge], faceI)
287 label curFace = edgeFaces[curPMeshEdge][faceI];
291 if (curPatchID == ngbPolyPatchIndex())
293 ngbFaces[edgeI] = curFace;
297 if (ngbFaces[edgeI] == -1)
300 <<
"Problem with determination of edge ngb faces!"
312 auto& fN = tfN.ref();
314 if (ngbPolyPatchIndex() == -1)
321 labelList ngbFaces = ngbPolyPatchFaces();
330 fN[faceI] = faces[ngbFaces[faceI]].unitNormal(
points);
339 if (ngbPolyPatchIndex() == -1)
353 forAll(pntEdges[pointI], edgeI)
355 pN[pointI] +=
faceNormals[pntEdges[pointI][edgeI]];
375 return *edgeFacesPtr_;
401 eN.
ref() = edgeLengths()/magEdgeLengths();
420 fc[edgeI] = gfc[faceLabels[edgeI]];
429 return edgeNormals()*(edgeNormals() & (edgeCentres() - edgeFaceCentres()));
436 dc = 1.0/(edgeNormals() &
delta());
464 Info<<
"Resetting patch edges" <<
endl;
478 edgeLabels.writeEntry(
"edgeLabels", os);
479 os.
writeEntry(
"ngbPolyPatchIndex", ngbPolyPatchIndex_);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
void append(const T &item)
Add copy at tail of list.
List< label > labelList
A List of labels.
const bMesh & mesh() const
virtual const pointField & points() const
Return raw points.
label ngbPolyPatchIndex() const
Return neighbour polyPatch index.
tmp< vectorField > edgeFaceCentres() const
Return neighbour face centres.
const labelListList & pointEdges() const
Return patch point-edge addressing.
A class for handling words, derived from Foam::string.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
A class for managing temporary objects.
const indirectPrimitivePatch & patch() const
Return constant reference to primitive patch.
static constexpr const zero Zero
Global zero (0)
virtual void movePoints(const pointField &)
Correct patch after moving points.
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)
const labelListList & edgeFaces() const
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...
const labelList & faceLabels() const
Return faMesh face labels.
void calcPointLabels() const
Calculate patch point labels.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
An STL-conforming iterator.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
virtual tmp< vectorField > delta() const
Return cell-centre to face-centre vector.
const scalarField & weights() const
Return patch weighting factors.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
tmp< vectorField > ngbPolyPatchFaceNormals() const
Return normals of neighbour polyPatch faces.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const labelUList & edgeFaces() const
Return edge-face addressing.
Template class for non-intrusive linked lists.
void deleteDemandDrivenData(DataPtr &dataPtr)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Finite area boundary mesh.
const faBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Identifies a patch by name, patch index and physical type.
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
const labelListList & cellEdges() const
virtual void makeDeltaCoeffs(scalarField &) const
Make patch edge - neighbour face distances.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
const vectorField & edgeCentres() const
Return edge centres.
virtual const labelList & faceOwner() const
Return face owner.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
labelList ngbPolyPatchFaces() const
Return edge neighbour polyPatch faces.
void operator=(const UList< label > &a)
Assignment to UList operator. Takes linear time.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
SubList< label > 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,...
Macros for easy insertion into run-time selection tables.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
label start() const
Patch start in edge list.
virtual ~faPatch()
Destructor.
const labelList & pointLabels() const
Return patch point labels.
List< labelList > labelListList
A List of labelList.
virtual const faceList & faces() const
Return raw faces.
const scalarField & magEdgeLengths() const
Return edge length magnitudes.
const std::string patch
OpenFOAM patch number as a std::string.
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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dimensionedScalar e
Elementary charge.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
tmp< vectorField > edgeNormals() const
Return edge normals.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Finite area mesh. Used for 2-D non-Euclidian finite area method.
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,...
void setSize(const label newSize)
Alias for resize(const label)
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)
void resetEdges(const labelList &)
Reset edge list.
#define WarningInFunction
Report a warning using Foam::Warning.
Smooth ATC in cells next to a set of patches supplied by type.
labelList pointLabels(nPoints, -1)
const vectorField & edgeLengths() const
Return edge length vectors.
void calcPointEdges() const
Calculate patch point-edge addressing.
A list of faces which address into the list of points.
virtual label size() const
Patch size.