36template<
class FaceList,
class Po
intField>
62 forAll(
p.meshPoints(), patchPointi)
64 const label meshPointi =
p.meshPoints()[patchPointi];
66 const auto fnd = coupledPatchMP.
cfind(meshPointi);
69 const label coupledPointi = fnd.val();
71 List<point>& pNormals = pointFaceNormals[coupledPointi];
76 const label facei =
pFaces[i];
77 const vector&
n =
p.faceNormals()[facei];
78 pNormals[i] = ((pFlip.
empty() || !pFlip[facei]) ?
n : -
n);
100 forAll(slaves, coupledPointi)
102 const labelList& slaveSlots = slaves[coupledPointi];
104 transformedSlaves[coupledPointi];
106 point&
n = coupledPointNormals[coupledPointi];
109 const List<point>& local = pointFaceNormals[coupledPointi];
114 + transformedSlaveSlots.
size();
121 n +=
sum(pointFaceNormals[slaveSlots[i]]);
123 forAll(transformedSlaveSlots, i)
125 n +=
sum(pointFaceNormals[transformedSlaveSlots[i]]);
136 coupledPointNormals[slaveSlots[i]] =
n;
138 forAll(transformedSlaveSlots, i)
140 coupledPointNormals[transformedSlaveSlots[i]] =
n;
149 coupledPointNormals.
size(),
160 auto& extrudeN = textrudeN.ref();
162 const faceList& localFaces =
p.localFaces();
167 const face&
f = localFaces[facei];
171 extrudeN[
f[fp]] += ((pFlip.
empty() || !pFlip[facei]) ?
n : -
n);
174 extrudeN /=
mag(extrudeN)+VSMALL;
179 forAll(
p.meshPoints(), patchPointi)
181 const label meshPointi =
p.meshPoints()[patchPointi];
183 const auto fnd = coupledPatchMP.
cfind(meshPointi);
186 const label coupledPointi = fnd.val();
187 extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
195template<
class FaceList,
class Po
intField>
209 auto& edgeNormals = tedgeNormals.ref();
217 const labelList& eFaces = edgeFaces[edgei];
218 for (
const label facei : eFaces)
221 edgeNormals[edgei] +=
223 (pFlip.
empty() || !pFlip[facei])
229 edgeNormals /=
mag(edgeNormals)+VSMALL;
246 label patchEdgeI = patchEdges[i];
247 label coupledEdgeI = coupledEdges[i];
248 cppEdgeData[coupledEdgeI] = edgeNormals[patchEdgeI];
265 cppEdgeData /=
mag(cppEdgeData)+VSMALL;
273 label patchEdgeI = patchEdges[i];
274 label coupledEdgeI = coupledEdges[i];
275 edgeNormals[patchEdgeI] = cppEdgeData[coupledEdgeI];
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
A HashTable to objects of type <T> with a label key.
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
A list of faces which address into the list of points.
const Map< label > & meshPointMap() const
Mesh point map.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
virtual const vectorField & pointNormals() const
Return point unit normals.
tmp< vectorField > edgeNormals() const
Return edge normals.
A face is a list of labels corresponding to mesh vertices.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
const labelListList & globalEdgeTransformedSlaves() const
const mapDistribute & globalPointSlavesMap() const
const mapDistribute & globalEdgeSlavesMap() const
static void syncData(List< Type > &elems, const labelListList &slaves, const labelListList &transformedSlaves, const mapDistribute &slavesMap, const globalIndexAndTransform &, const CombineOp &cop, const TransformOp &top)
Helper: synchronise data with transforms.
const labelListList & globalPointSlaves() const
const globalIndexAndTransform & globalTransforms() const
Global transforms numbering.
const labelListList & globalPointTransformedSlaves() const
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
const labelListList & globalEdgeSlaves() const
label constructSize() const noexcept
Constructed data size.
Class containing processor-to-processor mapping information.
void reverseDistribute(const label constructSize, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Mesh consisting of general polyhedral cells.
const globalMeshData & globalData() const
Return parallel info.
A class for managing temporary objects.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
#define forAll(list, i)
Loop across all elements in list.