Go to the documentation of this file.
36 template<
class FaceList,
class Po
intField>
61 forAll(
p.meshPoints(), patchPointi)
63 const label meshPointi =
p.meshPoints()[patchPointi];
65 const auto fnd = coupledPatchMP.cfind(meshPointi);
68 const label coupledPointi = fnd.val();
70 List<point>& pNormals = pointFaceNormals[coupledPointi];
75 pNormals[i] =
p.faceNormals()[
pFaces[i]];
97 forAll(slaves, coupledPointi)
99 const labelList& slaveSlots = slaves[coupledPointi];
101 transformedSlaves[coupledPointi];
103 point&
n = coupledPointNormals[coupledPointi];
106 const List<point>& local = pointFaceNormals[coupledPointi];
111 + transformedSlaveSlots.size();
118 n +=
sum(pointFaceNormals[slaveSlots[i]]);
120 forAll(transformedSlaveSlots, i)
122 n +=
sum(pointFaceNormals[transformedSlaveSlots[i]]);
133 coupledPointNormals[slaveSlots[i]] =
n;
135 forAll(transformedSlaveSlots, i)
137 coupledPointNormals[transformedSlaveSlots[i]] =
n;
146 coupledPointNormals.size(),
159 const faceList& localFaces =
p.localFaces();
164 const face&
f = localFaces[facei];
168 extrudeN[
f[fp]] +=
n;
171 extrudeN /=
mag(extrudeN)+VSMALL;
176 forAll(
p.meshPoints(), patchPointi)
178 const label meshPointi =
p.meshPoints()[patchPointi];
180 const auto fnd = coupledPatchMP.cfind(meshPointi);
183 const label coupledPointi = fnd.val();
184 extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
192 template<
class FaceList,
class Po
intField>
205 auto& edgeNormals = tedgeNormals.ref();
213 const labelList& eFaces = edgeFaces[edgei];
214 for (
const label facei : eFaces)
219 edgeNormals /=
mag(edgeNormals)+VSMALL;
236 label patchEdgeI = patchEdges[i];
237 label coupledEdgeI = coupledEdges[i];
238 cppEdgeData[coupledEdgeI] = edgeNormals[patchEdgeI];
255 cppEdgeData /=
mag(cppEdgeData)+VSMALL;
263 label patchEdgeI = patchEdges[i];
264 label coupledEdgeI = coupledEdges[i];
265 edgeNormals[patchEdgeI] = cppEdgeData[coupledEdgeI];
vectorField pointField
pointField is a vectorField.
const labelListList & globalPointTransformedSlaves() const
const labelListList & globalPointSlaves() const
const mapDistribute & globalEdgeSlavesMap() const
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
const mapDistribute & globalPointSlavesMap() const
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
const globalIndexAndTransform & globalTransforms() const
Global transforms numbering.
void setSize(const label n)
Alias for resize()
Class containing processor-to-processor mapping information.
const labelListList & globalEdgeSlaves() 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.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
label constructSize() const
Constructed data size.
const labelListList & globalEdgeTransformedSlaves() const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
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.
const Map< label > & meshPointMap() const
Mesh point map.
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]
A list of faces which address into the list of points.