51 #ifndef PrimitivePatch_H 52 #define PrimitivePatch_H 68 template<
class T>
class Map;
81 template<
class FaceList,
class Po
intField>
84 public PrimitivePatchName,
94 typedef typename std::remove_reference<FaceList>::type::value_type
99 typedef typename std::remove_reference<PointField>::type::value_type
129 mutable label nInternalEdges_;
184 void calcIntBdryEdges()
const;
187 void calcBdryPoints()
const;
190 void calcAddressing()
const;
193 void calcPointEdges()
const;
196 void calcPointFaces()
const;
199 void calcMeshData()
const;
202 void calcMeshPointMap()
const;
205 void calcEdgeLoops()
const;
208 void calcLocalPoints()
const;
211 void calcLocalPointOrder()
const;
214 void calcFaceCentres()
const;
217 void calcFaceAreas()
const;
220 void calcFaceNormals()
const;
223 void calcPointNormals()
const;
226 void calcEdgeOwner()
const;
231 void visitPointRegion
235 const label startFacei,
236 const label startEdgeI,
248 const FaceList& faces,
411 template<
class ToPatch>
414 const ToPatch& targetPatch,
423 template<
class ToPatch>
426 const ToPatch& targetPatch,
454 const bool report =
false,
466 const bool report =
false,
const labelListList & pointEdges() const
Return point-edge addressing.
label nPoints() const
Return number of points supporting patch faces.
surfaceTopo
Enumeration defining the surface type. Used in check routines.
const Field< PointType > & faceCentres() const
Return face centres for patch.
PrimitivePatch(const FaceList &faces, const Field< PointType > &points)
Construct from components.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & boundaryPoints() const
Return list of boundary points,.
label nInternalEdges() const
Number of internal edges.
bool checkPointManifold(const bool report=false, labelHashSet *setPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
void clearPatchMeshAddr()
const labelListList & edgeLoops() const
Return list of closed loops of boundary vertices.
const Field< PointType > & faceAreas() const
Return face areas for patch.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const labelList & localPointOrder() const
Return orders the local points for most efficient search.
bool checkTopology(const bool report=false, labelHashSet *setPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
label whichEdge(const edge &) const
Given an edge in local point labels, return its.
A list of faces which address into the list of points.
const labelListList & faceFaces() const
Return face-face addressing.
const Map< label > & meshPointMap() const
Mesh point map. Given the global point index find its.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
bool isInternalEdge(const label edgeI) const
Is internal edge?
TemplateName(FvFaceCellWave)
const Field< PointType > & points() const
Return reference to global points.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
const Field< PointType > & faceNormals() const
Return face normals for patch.
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]
label whichPoint(const label gp) const
Given a global point index, return the local point index.
const labelListList & pointFaces() const
Return point-face addressing.
label nEdges() const
Return number of edges in patch.
~PrimitivePatch()
Destructor.
const Field< PointType > & pointNormals() const
Return point normals for patch.
autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
List< objectHit > projectFaceCentres(const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::vector) const
Project vertices of patch onto another patch.
std::remove_reference< FaceList >::type::value_type FaceType
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const labelListList & faceEdges() const
Return face-edge addressing.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
std::remove_reference< PointField >::type::value_type PointType
List< objectHit > projectPoints(const ToPatch &targetPatch, const Field< PointType > &projectionDirection, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction=intersection::direction::vector) const
Project vertices of patch onto another patch.
PointField PointFieldType