Go to the documentation of this file.
54 #ifndef PrimitivePatch_H
55 #define PrimitivePatch_H
72 template<
class T>
class Map;
85 template<
class FaceList,
class Po
intField>
88 public PrimitivePatchName,
97 std::remove_reference<FaceList>::type::value_type
face_type;
101 std::remove_reference<PointField>::type::value_type
point_type;
137 mutable unique_ptr<edgeList> edgesPtr_;
140 mutable label nInternalEdges_;
143 mutable unique_ptr<labelList> boundaryPointsPtr_;
146 mutable unique_ptr<labelListList> faceFacesPtr_;
149 mutable unique_ptr<labelListList> edgeFacesPtr_;
152 mutable unique_ptr<labelListList> faceEdgesPtr_;
155 mutable unique_ptr<labelListList> pointEdgesPtr_;
158 mutable unique_ptr<labelListList> pointFacesPtr_;
161 mutable unique_ptr<List<face_type>> localFacesPtr_;
164 mutable unique_ptr<labelList> meshPointsPtr_;
168 mutable unique_ptr<Map<label>> meshPointMapPtr_;
171 mutable unique_ptr<labelListList> edgeLoopsPtr_;
174 mutable unique_ptr<Field<point_type>> localPointsPtr_;
177 mutable unique_ptr<labelList> localPointOrderPtr_;
180 mutable unique_ptr<Field<point_type>> faceCentresPtr_;
183 mutable unique_ptr<Field<point_type>> faceAreasPtr_;
186 mutable unique_ptr<Field<scalar>> magFaceAreasPtr_;
189 mutable unique_ptr<Field<point_type>> faceNormalsPtr_;
192 mutable unique_ptr<Field<point_type>> pointNormalsPtr_;
198 void calcIntBdryEdges()
const;
201 void calcBdryPoints()
const;
204 void calcAddressing()
const;
207 void calcPointEdges()
const;
210 void calcPointFaces()
const;
213 void calcMeshData()
const;
216 void calcMeshPointMap()
const;
219 void calcEdgeLoops()
const;
222 void calcLocalPoints()
const;
225 void calcLocalPointOrder()
const;
228 void calcFaceCentres()
const;
231 void calcFaceAreas()
const;
234 void calcMagFaceAreas()
const;
237 void calcFaceNormals()
const;
240 void calcPointNormals()
const;
245 void visitPointRegion
249 const label startFacei,
250 const label startEdgeI,
262 const FaceList& faces,
325 return edges().size();
431 template<
class ToPatch>
434 const ToPatch& targetPatch,
435 const Field<point_type>& projectionDirection,
441 template<
class ToPatch>
444 const ToPatch& targetPatch,
445 const Field<point_type>& projectionDirection,
470 const bool report =
false,
482 const bool report =
false,
490 virtual void movePoints(
const Field<point_type>&);
496 void operator=(
const PrimitivePatch<FaceList, PointField>& rhs);
499 void operator=(PrimitivePatch<FaceList, PointField>&& rhs);
const labelListList & pointFaces() const
Return point-face addressing.
label whichPoint(const label gp) const
Given a global point index, return the local point index.
const labelListList & edgeFaces() const
Return edge-face addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
FaceList FaceListType
The face list type.
const Field< point_type > & pointNormals() const
Return point normals for patch.
label nEdges() const
Return number of edges in patch.
bool hasFaceCentres() const
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual ~PrimitivePatch()
Destructor.
const labelListList & faceEdges() const
Return face-edge addressing.
bool hasPointNormals() const
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]=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, &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]
Generic templated field type.
const Field< point_type > & faceAreas() const
Return face area vectors for patch.
PointField PointFieldType
The point field type.
std::remove_reference< PointField >::type::value_type point_type
The point type.
const labelListList & pointEdges() const
Return point-edge addressing.
TemplateName(blendedSchemeBase)
label nPoints() const
Return number of points supporting patch faces.
List< objectHit > projectFaceCentres(const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
Project vertices of patch onto another patch.
const Field< point_type > & points() const
Return reference to global points.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
surfaceTopo
Enumeration defining the surface type. Used in check routines.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const labelList & boundaryPoints() const
Return list of boundary points, address into LOCAL point list.
label nInternalEdges() const
Number of internal edges.
List< objectHit > projectPoints(const ToPatch &targetPatch, const Field< point_type > &projectionDirection, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction=intersection::VECTOR) const
Project vertices of patch onto another patch.
List< labelList > labelListList
A List of labelList.
bool checkPointManifold(const bool report=false, labelHashSet *setPtr=nullptr) const
Checks primitivePatch for faces sharing point but not edge.
bool hasFaceAreas() const
bool isInternalEdge(const label edgei) const
Is internal edge?
const labelListList & edgeLoops() const
Return list of closed loops of boundary vertices.
const labelList & localPointOrder() const
Return orders the local points for most efficient search.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
label whichEdge(const edge &) const
const Field< scalar > & magFaceAreas() const
Return face area magnitudes for patch.
void clearPatchMeshAddr()
std::remove_reference< FaceList >::type::value_type face_type
The face type.
bool hasFaceNormals() const
virtual void movePoints(const Field< point_type > &)
Correct patch after moving points.
face_type FaceType
Deprecated(2020-03) prefer face_type typedef.
void operator=(const PrimitivePatch< FaceList, PointField > &rhs)
Copy assign faces. Leave points alone (could be a reference).
const Map< label > & meshPointMap() const
Mesh point map.
const labelListList & faceFaces() const
Return face-face addressing.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
bool checkTopology(const bool report=false, labelHashSet *setPtr=nullptr) const
Check surface formed by patch for manifoldness (see above).
void swap(PrimitivePatch &)=delete
Suppress direct swapping, since storage containers may be const.
Smooth ATC in cells next to a set of patches supplied by type.
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
const Field< point_type > & faceCentres() const
Return face centres for patch.
A list of faces which address into the list of points.
PrimitivePatch(const FaceList &faces, const PointField &points)
Construct from components.