33 template<
class FaceList,
class Po
intField>
59 forAll(
p.meshPoints(), patchPointi)
61 label meshPointi =
p.meshPoints()[patchPointi];
63 if (fnd != coupledPatchMP.
end())
65 label coupledPointi = fnd();
67 List<point>& pNormals = pointFaceNormals[coupledPointi];
72 pNormals[i] =
p.faceNormals()[
pFaces[i]];
94 forAll(slaves, coupledPointi)
96 const labelList& slaveSlots = slaves[coupledPointi];
98 transformedSlaves[coupledPointi];
100 point&
n = coupledPointNormals[coupledPointi];
103 const List<point>& local = pointFaceNormals[coupledPointi];
108 + transformedSlaveSlots.
size();
115 n +=
sum(pointFaceNormals[slaveSlots[i]]);
117 forAll(transformedSlaveSlots, i)
119 n +=
sum(pointFaceNormals[transformedSlaveSlots[i]]);
130 coupledPointNormals[slaveSlots[i]] =
n;
132 forAll(transformedSlaveSlots, i)
134 coupledPointNormals[transformedSlaveSlots[i]] =
n;
143 coupledPointNormals.
size(),
156 const faceList& localFaces =
p.localFaces();
161 const face&
f = localFaces[facei];
162 const vector&
n = faceNormals[facei];
165 extrudeN[
f[fp]] +=
n;
168 extrudeN /=
mag(extrudeN)+vSmall;
173 forAll(
p.meshPoints(), patchPointi)
175 label meshPointi =
p.meshPoints()[patchPointi];
177 if (fnd != coupledPatchMP.
end())
179 label coupledPointi = fnd();
180 extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
188 template<
class FaceList,
class Po
intField>
207 const labelList& eFaces = edgeFaces[edgeI];
210 edgeNormals[edgeI] += faceNormals[eFaces[i]];
213 edgeNormals /=
mag(edgeNormals)+vSmall;
230 label patchEdgeI = patchEdges[i];
231 label coupledEdgeI = coupledEdges[i];
232 cppEdgeData[coupledEdgeI] = edgeNormals[patchEdgeI];
249 cppEdgeData /=
mag(cppEdgeData)+vSmall;
257 label patchEdgeI = patchEdges[i];
258 label coupledEdgeI = coupledEdges[i];
259 edgeNormals[patchEdgeI] = cppEdgeData[coupledEdgeI];
#define forAll(list, i)
Loop across all elements in list.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A list of faces which address into the list of points.
const Map< label > & meshPointMap() const
Mesh point map. Given the global point index find its.
label constructSize() const
Constructed data size.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
void reverseDistribute(const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
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...
static void syncData(List< Type > &pointData, const labelListList &slaves, const labelListList &transformedSlaves, const distributionMap &slavesMap, const globalIndexAndTransform &, const CombineOp &cop, const TransformOp &top)
Helper: synchronise data with transforms.
const labelListList & globalEdgeTransformedSlaves() const
const distributionMap & globalEdgeSlavesMap() const
const distributionMap & globalPointSlavesMap() const
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
Mesh consisting of general polyhedral cells.
const globalMeshData & globalData() const
Return parallel info.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
vectorField pointField
pointField is a vectorField.
dimensioned< scalar > mag(const dimensioned< Type > &)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("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]=cellShape(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, &mergedCyclicPolyPatch::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]
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable