40 patchName_(patchName),
47 triCumulativeMagSf_(),
48 sumTriMagSf_(Pstream::nProcs() + 1, 0.0)
53 <<
"Requested patch " << patchName_ <<
" not found" <<
nl 64 patchName_(pib.patchName_),
65 patchId_(pib.patchId_),
66 patchArea_(pib.patchArea_),
67 patchNormal_(pib.patchNormal_),
68 cellOwners_(pib.cellOwners_),
69 triFace_(pib.triFace_),
70 triToFace_(pib.triToFace_),
71 triCumulativeMagSf_(pib.triCumulativeMagSf_),
72 sumTriMagSf_(pib.sumTriMagSf_)
103 const face&
f = patch[facei];
110 triToFace.append(facei);
112 triMagSf.append(tris[i].
mag(points));
126 for (
label i = 1; i < triMagSf.size(); i++)
128 triMagSf[i] += triMagSf[i-1];
196 const triPointRef tri(points[tf[0]], points[tf[1]], points[tf[2]]);
200 const scalar a = rnd.
position(scalar(0.1), scalar(0.5));
211 tetFacei = mesh.
cells()[cellOwner][0];
const vectorField::subField faceAreas() const
Return face normals.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face normals and swept volumes.
labelList triToFace_
Addressing from per triangle to patch face.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void setPositionAndCell(const polyMesh &mesh, cachedRandom &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPtI)
Set the injection position and owner cell, tetFace and tetPt.
errorManipArg< error, int > exit(error &err, const int errNo=1)
wordList names() const
Return a list of patch names.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Traits class for primitives.
const Field< PointType > & points() const
Return reference to global points.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Type globalPosition(const Type &start, const Type &end)
Return a sample between start and end.
patchInjectionBase(const polyMesh &mesh, const word &patchName)
Construct from mesh and patch name.
virtual void updateMesh(const polyMesh &mesh)
Update patch geometry and derived info for injection locations.
const cellList & cells() const
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
vectorList patchNormal_
Patch face normal directions.
Point randomPoint(Random &rndGen) const
Return a random point on the triangle from a uniform.
A class for handling words, derived from string.
A triangular face using a FixedList of labels corresponding to mesh vertices.
scalarList sumTriMagSf_
Cumulative area fractions per processor.
const vectorField & cellCentres() const
const label patchId_
Patch ID.
scalarList triCumulativeMagSf_
Cumulative triangle area per triangle face.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
scalar patchArea_
Patch area - total across all processors.
const labelUList & faceCells() const
Return face-cell addressing.
labelList cellOwners_
List of cell labels corresponding to injector positions.
label triangles(const pointField &points, label &triI, faceList &triFaces) const
Split into triangles using existing points.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
Type position(const Type &start, const Type &end)
Return a sample between start and end.
A patch is a list of labels that address the faces in the global face list.
void clear()
Clear the addressed list, i.e. set the size to zero.
label findPatchID(const word &patchName) const
Find patch index given a name.
virtual ~patchInjectionBase()
Destructor.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
faceList triFace_
Decomposed patch faces as a list of triangles.