cellCuts.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::cellCuts
26 
27 Description
28  Description of cuts across cells.
29 
30  Description of cut is given as list of vertices and
31  list of edges to be cut (and position on edge).
32 
33  Does some checking of correctness/non-overlapping of cuts. 2x2x2
34  refinement has to be done in three passes since cuts can not overlap
35  (would make addressing too complicated)
36 
37  Introduces concept of 'cut' which is either an existing vertex
38  or a edge.
39 
40  Input can either be
41  -# list of cut vertices and list of cut edges. Constructs cell
42  circumference walks ('cellLoops').
43 
44  -# list of cell circumference walks. Will filter them so they
45  don't overlap.
46 
47  -# cellWalker and list of cells to refine (refineCell). Constructs
48  cellLoops and does B. cellWalker is class which can cut a single
49  cell using a plane through the cell centre and in a certain normal
50  direction
51 
52  CellCuts constructed from cellLoops (B, C) can have multiple cut-edges
53  and/or cut-point as long as there is per face only one (or none) cut across
54  a face, i.e. a face can only be split into two faces.
55 
56  The information available after construction:
57  - pointIsCut, edgeIsCut.
58  - faceSplitCut : the cross-cut of a face.
59  - cellLoops : the loop which cuts across a cell
60  - cellAnchorPoints : per cell the vertices on one side which are
61  considered the anchor points.
62 
63  AnchorPoints: connected loops have to be oriented in the same way to
64  be able to grow new internal faces out of the same bottom faces.
65  (limitation of the mapping procedure). The loop is cellLoop is oriented
66  such that the normal of it points towards the anchorPoints.
67  This is the only routine which uses geometric information.
68 
69 
70  Limitations:
71  - cut description is very precise. Hard to get right.
72  - do anchor points need to be unique per cell? Very inefficient.
73  - is orientation guaranteed to be correct? Uses geometric info so can go
74  wrong on highly distorted meshes.
75  - is memory inefficient. Probably need to use Maps instead of
76  labelLists.
77 
78 SourceFiles
79  cellCuts.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef cellCuts_H
84 #define cellCuts_H
85 
86 #include "edgeVertex.H"
87 #include "labelList.H"
88 #include "boolList.H"
89 #include "scalarField.H"
90 #include "pointField.H"
91 #include "DynamicList.H"
92 #include "typeInfo.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 
99 // Forward declaration of classes
100 class polyMesh;
101 class cellLooper;
102 class refineCell;
103 class plane;
104 
105 /*---------------------------------------------------------------------------*\
106  Class cellCuts Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class cellCuts
110 :
111  public edgeVertex
112 {
113  // Private data
114 
115  // Per point/edge status
116 
117  //- Is mesh point cut
119 
120  //- Is edge cut
122 
123  //- If edge is cut gives weight (0->start() to 1->end())
125 
126 
127  // Cut addressing
128 
129  //- Cuts per existing face (includes those along edge of face)
130  // Cuts in no particular order.
131  mutable labelListList* faceCutsPtr_;
132 
133  //- Per face : cut across edge (so not along existing edge)
134  // (can only be one per face)
136 
137 
138  // Cell-cut addressing
139 
140  //- Loop across cell circumference
142 
143  //- Number of valid loops in cellLoops_
144  label nLoops_;
145 
146  //- For each cut cell the points on the 'anchor' side of the cell.
148 
149 
150  // Private Static Functions
151 
152  //- Find value in first n elements of list.
153  static label findPartIndex
154  (
155  const labelList&,
156  const label n,
157  const label val
158  );
159 
160  //- Create boolList with all labels specified set to true
161  // (and rest to false)
162  static boolList expand(const label size, const labelList& labels);
163 
164  //- Create scalarField with all specified labels set to corresponding
165  // value in scalarField.
166  static scalarField expand
167  (
168  const label,
169  const labelList&,
170  const scalarField&
171  );
172 
173  //- Returns -1 or index of first element of lst that cannot be found
174  // in map.
175  static label firstUnique
176  (
177  const labelList& lst,
178  const Map<label>&
179  );
180 
181  // Private Member Functions
182 
183  //- Debugging: write cell's edges and any cut vertices and edges
184  // (so no cell loop determined yet)
185  void writeUncutOBJ(const fileName&, const label cellI) const;
186 
187  //- Debugging: write cell's edges, loop and anchors to directory.
188  void writeOBJ
189  (
190  const fileName& dir,
191  const label cellI,
192  const pointField& loopPoints,
193  const labelList& anchors
194  ) const;
195 
196  //- Find face on cell using the two edges.
198  (
199  const label cellI,
200  const label edgeA,
201  const label edgeB
202  ) const;
203 
204 
205  //- Find face on cell using an edge and a vertex.
207  (
208  const label cellI,
209  const label edgeI,
210  const label vertI
211  ) const;
212 
213  //- Find face using two vertices (guaranteed not to be along edge)
215  (
216  const label cellI,
217  const label vertA,
218  const label vertB
219  ) const;
220 
221 
222  // Cut addressing
223 
224  //- Calculate faceCuts in face vertex order.
225  void calcFaceCuts() const;
226 
227 
228  // Loop (cuts on cell circumference) calculation
229 
230  //- Find edge (or -1) on faceI using vertices v0,v1
232  (
233  const label faceI,
234  const label v0,
235  const label v1
236  ) const;
237 
238  //- Find face on which all cuts are (very rare) or -1.
239  label loopFace(const label cellI, const labelList& loop) const;
240 
241  //- Cross otherCut into next faces (not exclude0, exclude1)
242  bool walkPoint
243  (
244  const label cellI,
245  const label startCut,
246 
247  const label exclude0,
248  const label exclude1,
249 
250  const label otherCut,
251 
252  label& nVisited,
253  labelList& visited
254  ) const;
255 
256  //- Cross cut (which is edge on faceI) onto next face
257  bool crossEdge
258  (
259  const label cellI,
260  const label startCut,
261  const label faceI,
262  const label otherCut,
263 
264  label& nVisited,
265  labelList& visited
266  ) const;
267 
268  // wrapper around visited[nVisited++] = cut. Checks for duplicate
269  // cuts.
270  bool addCut
271  (
272  const label cellI,
273  const label cut,
274  label& nVisited,
275  labelList& visited
276  ) const;
277 
278  //- Walk across faceI following cuts, starting at cut. Stores cuts
279  // visited
280  bool walkFace
281  (
282  const label cellI,
283  const label startCut,
284  const label faceI,
285  const label cut,
286 
287  label& lastCut,
288  label& beforeLastCut,
289  label& nVisited,
290  labelList& visited
291  ) const;
292 
293  //- Walk across cuts (cut edges or cut vertices) of cell. Stops when
294  // hit cut already visited. Returns true when loop of 3 or more
295  // vertices found.
296  bool walkCell
297  (
298  const label cellI,
299  const label startCut, // overall starting cut
300  const label faceI,
301  const label prevCut, // current cut
302  label& nVisited,
303  labelList& visited
304  ) const;
305 
306  //- Determine for every cut cell the face it is cut by.
307  void calcCellLoops(const labelList& cutCells);
308 
309 
310  // Cell anchoring
311 
312  //- Are there enough faces on anchor side of cellI?
313  bool checkFaces
314  (
315  const label cellI,
316  const labelList& anchorPoints
317  ) const;
318 
319  //- Walk unset edges of single cell from starting point and
320  // marks visited edges and vertices with status.
321  void walkEdges
322  (
323  const label cellI,
324  const label pointI,
325  const label status,
326 
327  Map<label>& edgeStatus,
328  Map<label>& pointStatus
329  ) const;
330 
331  //- Check anchor points on 'outside' of loop
333  (
334  const label cellI,
335  const pointField& loopPts,
336  const labelList& anchorPoints
337  ) const;
338 
339  //- Determines set of anchor points given a loop. The loop should
340  // split the cell into two. Returns true if a valid set of anchor
341  // points determined, false otherwise.
342  bool calcAnchors
343  (
344  const label cellI,
345  const labelList& loop,
346  const pointField& loopPts,
347 
348  labelList& anchorPoints
349  ) const;
350 
351  //- Returns coordinates of points on loop with explicitly provided
352  // weights.
354  (
355  const labelList& loop,
356  const scalarField& loopWeights
357  ) const;
358 
359  //- Returns weights of loop. Inverse of loopPoints.
360  scalarField loopWeights(const labelList& loop) const;
361 
362  //- Check if cut edges in loop are compatible with ones in
363  // edgeIsCut_
364  bool validEdgeLoop
365  (
366  const labelList& loop,
367  const scalarField& loopWeights
368  ) const;
369 
370  //- Counts number of cuts on face.
372  (
373  const label faceI,
374  const labelList& loop
375  ) const;
376 
377  //- Determines if loop through cellI consistent with existing
378  // pattern.
380  (
381  const label cellI,
382  const labelList& loop
383  ) const;
384 
385  //- Check if loop is compatible with existing cut pattern in
386  // pointIsCut, edgeIsCut, faceSplitCut.
387  // Calculates and returns for current cell the cut faces and the
388  // points on one side of the loop.
389  bool validLoop
390  (
391  const label cellI,
392  const labelList& loop,
393  const scalarField& loopWeights,
394  Map<edge>& newFaceSplitCut,
395  labelList& anchorPoints
396  ) const;
397 
398  //- Update basic cut information from cellLoops. Assumes cellLoops_
399  // already set and consistent.
400  void setFromCellLoops();
401 
402  //- Update basic cut information for single cell from cellLoop.
403  bool setFromCellLoop
404  (
405  const label cellI,
406  const labelList& loop,
407  const scalarField& loopWeights
408  );
409 
410  //- Update basic cut information from cellLoops. Checks for
411  // consistency with existing cut pattern.
412  void setFromCellLoops
413  (
414  const labelList& cellLabels,
415  const labelListList& cellLoops,
416  const List<scalarField>& cellLoopWeights
417  );
418 
419  //- Cut cells and update basic cut information from cellLoops.
420  // Checks each loop for consistency with existing cut pattern.
421  void setFromCellCutter
422  (
423  const cellLooper&,
424  const List<refineCell>& refCells
425  );
426 
427  //- Same as above but now cut with prescribed plane.
428  void setFromCellCutter
429  (
430  const cellLooper&,
431  const labelList& cellLabels,
432  const List<plane>&
433  );
434 
435  //- Set orientation of loops
436  void orientPlanesAndLoops();
437 
438  //- Top level driver: adressing calculation and loop detection
439  void calcLoopsAndAddressing(const labelList& cutCells);
440 
441  //- Check various consistencies.
442  void check() const;
443 
444 
445  //- Disallow default bitwise copy construct
446  cellCuts(const cellCuts&);
447 
448  //- Disallow default bitwise assignment
449  void operator=(const cellCuts&);
450 
451 
452 public:
453 
454  //- Runtime type information
455  ClassName("cellCuts");
456 
457 
458  // Constructors
459 
460  //- Construct from cells to cut and pattern of cuts
461  cellCuts
462  (
463  const polyMesh& mesh,
464  const labelList& cutCells,
465  const labelList& meshVerts,
466  const labelList& meshEdges,
467  const scalarField& meshEdgeWeights
468  );
469 
470  //- Construct from pattern of cuts. Detect cells to cut.
471  cellCuts
472  (
473  const polyMesh& mesh,
474  const labelList& meshVerts,
475  const labelList& meshEdges,
476  const scalarField& meshEdgeWeights
477  );
478 
479  //- Construct from complete cellLoops through specified cells.
480  // Checks for consistency.
481  // Constructs cut-cut addressing and cellAnchorPoints.
482  cellCuts
483  (
484  const polyMesh& mesh,
485  const labelList& cellLabels,
486  const labelListList& cellLoops,
487  const List<scalarField>& cellEdgeWeights
488  );
489 
490  //- Construct from list of cells to cut and direction to cut in
491  // (always through cell centre) and celllooper.
492  cellCuts
493  (
494  const polyMesh& mesh,
495  const cellLooper& cellCutter,
496  const List<refineCell>& refCells
497  );
498 
499  //- Construct from list of cells to cut and plane to cut with and
500  // celllooper. (constructor above always cuts through cell centre)
501  cellCuts
502  (
503  const polyMesh& mesh,
504  const cellLooper& cellCutter,
505  const labelList& cellLabels,
506  const List<plane>& cutPlanes
507  );
508 
509  //- Construct from components
510  cellCuts
511  (
512  const polyMesh& mesh,
513  const boolList& pointIsCut,
514  const boolList& edgeIsCut,
515  const scalarField& edgeWeight,
516  const Map<edge>& faceSplitCut,
517  const labelListList& cellLoops,
518  const label nLoops,
520  );
521 
522 
523  //- Destructor
524  ~cellCuts();
525 
526  //- Clear out demand driven storage
527  void clearOut();
528 
529 
530  // Member Functions
531 
532  // Access
533 
534  //- Is mesh point cut
535  const boolList& pointIsCut() const
536  {
537  return pointIsCut_;
538  }
539 
540  //- Is edge cut
541  const boolList& edgeIsCut() const
542  {
543  return edgeIsCut_;
544  }
545 
546  //- If edge is cut gives weight (ratio between start() and end())
547  const scalarField& edgeWeight() const
548  {
549  return edgeWeight_;
550  }
551 
552  //- Cuts per existing face (includes those along edge of face)
553  // Cuts in no particular order
554  const labelListList& faceCuts() const
555  {
556  if (!faceCutsPtr_)
557  {
558  calcFaceCuts();
559  }
560  return *faceCutsPtr_;
561  }
562 
563  //- Gives for split face the two cuts that split the face into two.
564  const Map<edge>& faceSplitCut() const
565  {
566  return faceSplitCut_;
567  }
568 
569  //- For each cut cell the cut along the circumference.
570  const labelListList& cellLoops() const
571  {
572  return cellLoops_;
573  }
574 
575  //- Number of valid cell loops
576  label nLoops() const
577  {
578  return nLoops_;
579  }
580 
581  //- For each cut cell the points on the 'anchor' side of the cell.
582  const labelListList& cellAnchorPoints() const
583  {
584  return cellAnchorPoints_;
585  }
586 
587 
588  // Other
589 
590  //- Returns coordinates of points on loop for given cell.
591  // Uses cellLoops_ and edgeWeight_
592  pointField loopPoints(const label cellI) const;
593 
594  //- Invert anchor point selection.
596  (
597  const labelList& cellPoints,
598  const labelList& anchorPoints,
599  const labelList& loop
600  ) const;
601 
602  //- Flip loop for cellI. Updates anchor points as well.
603  void flip(const label cellI);
604 
605  //- Flip loop for cellI. Does not update anchors. Use with care
606  // (only if you're sure loop orientation is wrong)
607  void flipLoopOnly(const label cellI);
608 
609 
610  // Write
611 
612  //- debugging:Write list of cuts to stream in OBJ format
613  void writeOBJ
614  (
615  Ostream& os,
616  const pointField& loopPoints,
617  label& vertI
618  ) const;
619 
620  //- debugging:Write all of cuts to stream in OBJ format
621  void writeOBJ(Ostream& os) const;
622 
623  //- debugging:Write edges of cell and loop
624  void writeCellOBJ(const fileName& dir, const label cellI) const;
625 
626 };
627 
628 
629 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
630 
631 } // End namespace Foam
632 
633 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
634 
635 #endif
636 
637 // ************************************************************************* //
Foam::cellCuts::flip
void flip(const label cellI)
Flip loop for cellI. Updates anchor points as well.
Definition: cellCuts.C:2984
Foam::cellCuts::edgeEdgeToFace
label edgeEdgeToFace(const label cellI, const label edgeA, const label edgeB) const
Find face on cell using the two edges.
Definition: cellCuts.C:228
Foam::cellCuts::loopWeights
scalarField loopWeights(const labelList &loop) const
Returns weights of loop. Inverse of loopPoints.
Definition: cellCuts.C:1616
Foam::cellCuts::faceCutsPtr_
labelListList * faceCutsPtr_
Cuts per existing face (includes those along edge of face)
Definition: cellCuts.H:130
Foam::cellCuts::nLoops
label nLoops() const
Number of valid cell loops.
Definition: cellCuts.H:575
Foam::cellCuts::calcLoopsAndAddressing
void calcLoopsAndAddressing(const labelList &cutCells)
Top level driver: adressing calculation and loop detection.
Definition: cellCuts.C:2497
Foam::cellCuts::pointIsCut
const boolList & pointIsCut() const
Is mesh point cut.
Definition: cellCuts.H:534
boolList.H
Foam::cellCuts::vertexVertexToFace
label vertexVertexToFace(const label cellI, const label vertA, const label vertB) const
Find face using two vertices (guaranteed not to be along edge)
Definition: cellCuts.C:309
Foam::cellCuts::faceSplitCut
const Map< edge > & faceSplitCut() const
Gives for split face the two cuts that split the face into two.
Definition: cellCuts.H:563
Foam::cellCuts::edgeIsCut_
boolList edgeIsCut_
Is edge cut.
Definition: cellCuts.H:120
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
typeInfo.H
Foam::cellCuts::calcFaceCuts
void calcFaceCuts() const
Calculate faceCuts in face vertex order.
Definition: cellCuts.C:344
scalarField.H
Foam::cellCuts::writeOBJ
void writeOBJ(const fileName &dir, const label cellI, const pointField &loopPoints, const labelList &anchors) const
Debugging: write cell's edges, loop and anchors to directory.
Definition: cellCuts.C:179
Foam::cellCuts::operator=
void operator=(const cellCuts &)
Disallow default bitwise assignment.
Foam::cellCuts::walkCell
bool walkCell(const label cellI, const label startCut, const label faceI, const label prevCut, label &nVisited, labelList &visited) const
Walk across cuts (cut edges or cut vertices) of cell. Stops when.
Definition: cellCuts.C:793
Foam::cellCuts::pointIsCut_
boolList pointIsCut_
Is mesh point cut.
Definition: cellCuts.H:117
Foam::cellCuts::cellCuts
cellCuts(const cellCuts &)
Disallow default bitwise copy construct.
Foam::edgeVertex
Combines edge or vertex in single label. Used to specify cuts across cell circumference.
Definition: edgeVertex.H:52
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: PrimitivePatchTemplate.H:68
Foam::cellCuts::cellAnchorPoints
const labelListList & cellAnchorPoints() const
For each cut cell the points on the 'anchor' side of the cell.
Definition: cellCuts.H:581
Foam::cellCuts::writeCellOBJ
void writeCellOBJ(const fileName &dir, const label cellI) const
debugging:Write edges of cell and loop
Definition: cellCuts.C:3048
Foam::cellCuts::~cellCuts
~cellCuts()
Destructor.
Definition: cellCuts.C:2944
Foam::cellCuts::nLoops_
label nLoops_
Number of valid loops in cellLoops_.
Definition: cellCuts.H:143
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::cellCuts::firstUnique
static label firstUnique(const labelList &lst, const Map< label > &)
Returns -1 or index of first element of lst that cannot be found.
Definition: cellCuts.C:101
Foam::cellCuts::edgeWeight
const scalarField & edgeWeight() const
If edge is cut gives weight (ratio between start() and end())
Definition: cellCuts.H:546
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
labelList.H
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::cellCuts::faceCuts
const labelListList & faceCuts() const
Cuts per existing face (includes those along edge of face)
Definition: cellCuts.H:553
Foam::cellCuts::cellLoops
const labelListList & cellLoops() const
For each cut cell the cut along the circumference.
Definition: cellCuts.H:569
Foam::cellLooper
Abstract base class. Concrete implementations know how to cut a cell (i.e. determine a loop around th...
Definition: cellLooper.H:69
Foam::cellCuts::calcCellLoops
void calcCellLoops(const labelList &cutCells)
Determine for every cut cell the face it is cut by.
Definition: cellCuts.C:990
Foam::cellCuts::loopFace
label loopFace(const label cellI, const labelList &loop) const
Find face on which all cuts are (very rare) or -1.
Definition: cellCuts.C:512
Foam::cellCuts::checkFaces
bool checkFaces(const label cellI, const labelList &anchorPoints) const
Are there enough faces on anchor side of cellI?
cut
Patchify triangles based on orientation w.r.t other (triangulated or triangulatable) surfaces.
Foam::cellCuts::conservativeValidLoop
bool conservativeValidLoop(const label cellI, const labelList &loop) const
Determines if loop through cellI consistent with existing.
Definition: cellCuts.C:1729
Foam::cellCuts::nonAnchorPoints
labelList nonAnchorPoints(const labelList &cellPoints, const labelList &anchorPoints, const labelList &loop) const
Invert anchor point selection.
Definition: cellCuts.C:1183
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cellCuts::validEdgeLoop
bool validEdgeLoop(const labelList &loop, const scalarField &loopWeights) const
Check if cut edges in loop are compatible with ones in.
Definition: cellCuts.C:1641
Foam::cellCuts::cellAnchorPoints_
labelListList cellAnchorPoints_
For each cut cell the points on the 'anchor' side of the cell.
Definition: cellCuts.H:146
pointField.H
Foam::cellCuts::validLoop
bool validLoop(const label cellI, const labelList &loop, const scalarField &loopWeights, Map< edge > &newFaceSplitCut, labelList &anchorPoints) const
Check if loop is compatible with existing cut pattern in.
Definition: cellCuts.C:1824
Foam::cellCuts::edgeWeight_
scalarField edgeWeight_
If edge is cut gives weight (0->start() to 1->end())
Definition: cellCuts.H:123
Foam::cellCuts::crossEdge
bool crossEdge(const label cellI, const label startCut, const label faceI, const label otherCut, label &nVisited, labelList &visited) const
Cross cut (which is edge on faceI) onto next face.
Definition: cellCuts.C:620
Foam::cellCuts::expand
static boolList expand(const label size, const labelList &labels)
Create boolList with all labels specified set to true.
Definition: cellCuts.C:67
Foam::cellCuts::setFromCellLoops
void setFromCellLoops()
Update basic cut information from cellLoops. Assumes cellLoops_.
Definition: cellCuts.C:1990
Foam::cellCuts::loopAnchorConsistent
bool loopAnchorConsistent(const label cellI, const pointField &loopPts, const labelList &anchorPoints) const
Check anchor points on 'outside' of loop.
Definition: cellCuts.C:1214
Foam::cellCuts::writeUncutOBJ
void writeUncutOBJ(const fileName &, const label cellI) const
Debugging: write cell's edges and any cut vertices and edges.
Definition: cellCuts.C:121
Foam::cellCuts::flipLoopOnly
void flipLoopOnly(const label cellI)
Flip loop for cellI. Does not update anchors. Use with care.
Definition: cellCuts.C:3002
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::cellCuts::edgeIsCut
const boolList & edgeIsCut() const
Is edge cut.
Definition: cellCuts.H:540
Foam::cellCuts::walkFace
bool walkFace(const label cellI, const label startCut, const label faceI, const label cut, label &lastCut, label &beforeLastCut, label &nVisited, labelList &visited) const
Walk across faceI following cuts, starting at cut. Stores cuts.
Definition: cellCuts.C:701
Foam::cellCuts::check
void check() const
Check various consistencies.
Definition: cellCuts.C:2547
Foam::cellCuts::countFaceCuts
label countFaceCuts(const label faceI, const labelList &loop) const
Counts number of cuts on face.
Definition: cellCuts.C:1679
Foam::cellCuts::ClassName
ClassName("cellCuts")
Runtime type information.
Foam::cellCuts::findPartIndex
static label findPartIndex(const labelList &, const label n, const label val)
Find value in first n elements of list.
Definition: cellCuts.C:49
DynamicList.H
Foam::cellCuts::findEdge
label findEdge(const label faceI, const label v0, const label v1) const
Find edge (or -1) on faceI using vertices v0,v1.
Definition: cellCuts.C:482
Foam::cellCuts::clearOut
void clearOut()
Clear out demand driven storage.
Definition: cellCuts.C:2950
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cellCuts::walkPoint
bool walkPoint(const label cellI, const label startCut, const label exclude0, const label exclude1, const label otherCut, label &nVisited, labelList &visited) const
Cross otherCut into next faces (not exclude0, exclude1)
Definition: cellCuts.C:564
Foam::cellCuts::orientPlanesAndLoops
void orientPlanesAndLoops()
Set orientation of loops.
Definition: cellCuts.C:2440
Foam::cellCuts::faceSplitCut_
Map< edge > faceSplitCut_
Per face : cut across edge (so not along existing edge)
Definition: cellCuts.H:134
Foam::cellCuts::loopPoints
pointField loopPoints(const labelList &loop, const scalarField &loopWeights) const
Returns coordinates of points on loop with explicitly provided.
Definition: cellCuts.C:1600
Foam::cellCuts::setFromCellCutter
void setFromCellCutter(const cellLooper &, const List< refineCell > &refCells)
Cut cells and update basic cut information from cellLoops.
Definition: cellCuts.C:2213
Foam::cellCuts::setFromCellLoop
bool setFromCellLoop(const label cellI, const labelList &loop, const scalarField &loopWeights)
Update basic cut information for single cell from cellLoop.
Definition: cellCuts.C:2077
edgeVertex.H
Foam::cellCuts::calcAnchors
bool calcAnchors(const label cellI, const labelList &loop, const pointField &loopPts, labelList &anchorPoints) const
Determines set of anchor points given a loop. The loop should.
Definition: cellCuts.C:1253
Foam::cellCuts::edgeVertexToFace
label edgeVertexToFace(const label cellI, const label edgeI, const label vertI) const
Find face on cell using an edge and a vertex.
Definition: cellCuts.C:269
Foam::cellCuts::addCut
bool addCut(const label cellI, const label cut, label &nVisited, labelList &visited) const
Definition: cellCuts.C:665
Foam::cellCuts::walkEdges
void walkEdges(const label cellI, const label pointI, const label status, Map< label > &edgeStatus, Map< label > &pointStatus) const
Walk unset edges of single cell from starting point and.
Definition: cellCuts.C:1145
Foam::cellCuts
Description of cuts across cells.
Definition: cellCuts.H:108
Foam::cellCuts::cellLoops_
labelListList cellLoops_
Loop across cell circumference.
Definition: cellCuts.H:140
Foam::edgeVertex::mesh
const polyMesh & mesh() const
Definition: edgeVertex.H:98