40 result =
min(result, l[i]);
51 result =
max(result, l[i]);
70 if (
min(fAlphas) > isoAlpha || isoAlpha >
max(fAlphas))
87 const label fpi1 =
f.fcIndex(fpi0);
89 if ((fAlphas[fpi0] < isoAlpha) != (fAlphas[fpi1] < isoAlpha))
97 cuts.
last()[1] = fpi0;
100 cuti = cuts.
last().fcIndex(cuti);
110 <<
"Cutting values " << fAlphas <<
" with iso-value " << isoAlpha
111 <<
" resulted in an odd number of cuts"
127 const scalar isoAlpha
131 label nCellFaceCuts = 0;
134 nCellFaceCuts += fCuts[
c[cfi]].size();
136 if (nCellFaceCuts == 0)
154 cellFaceAndFaceEdgeCutToFaceEdge[cfi] =
159 const label fei0 = fCuts[
c[cfi]][fci].first();
160 const label fei1 = fCuts[
c[cfi]][fci].second();
164 cellFaceAndFaceEdgeCutToFaceEdge[cfi][fei0] = fei1;
168 cellFaceAndFaceEdgeCutToFaceEdge[cfi][fei1] = fei0;
176 label nCellFaceCutsVisited = 0;
177 label cfi0 = 0, fei0 = 0;
178 while (nCellFaceCutsVisited < nCellFaceCuts)
182 for (
label cfj0 = cfi0; cfj0 <
c.size(); ++ cfj0)
184 for (
label fej0 = fei0; fej0 < fs[
c[cfj0]].
size(); ++ fej0)
187 cellFaceAndFaceEdgeCutToFaceEdge[cfj0][fej0];
206 <<
"Could not find next unvisited connection for cell cut"
211 label cfi = cfi0, fei = fei0;
213 while (cellFaceAndFaceEdgeCutToFaceEdge[cfi][fei] != -1)
215 ++ nCellFaceCutsVisited;
217 const label otherFei =
218 cellFaceAndFaceEdgeCutToFaceEdge[cfi][fei];
220 cellFaceAndFaceEdgeCutToFaceEdge[cfi][fei] = -1;
222 const label cei = cfiAndFeiToCei[cfi][otherFei];
227 ceiToCfiAndFei[cei].other({cfi, otherFei});
235 cuts.
last().transfer(cut);
250 const scalar isoAlpha,
260 const edge e =
f.faceEdge(fCuts[cuti][i]);
278 const scalar isoAlpha,
283 if (cCuts.size() == 0)
294 if (cCuts[cuti].size() < 3)
continue;
300 const label cei = cCuts[cuti][i];
301 const label cfi = ceiToCfiAndFei[cei][0][0];
302 const label fei = ceiToCfiAndFei[cei][0][1];
304 const edge e = fs[
c[cfi]].faceEdge(fei);
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
OFstream which keeps track of vertices.
virtual Ostream & write(const char)
Write character.
const Type & second() const
Return second.
const Type & first() const
Return first.
A List with indirect addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
T & last()
Return the last element of the list.
const List< Pair< labelPair > > & ceiToCfiAndFei() const
Map from cell-edge-index to cell-face-index and face-edge-index.
const boolList & cOwns() const
For each cell-face, whether or not the cell owns it.
const CompactListList< label > & cfiAndFeiToCei() const
Map from cell-face-index and face-edge-index to cell-edge-index.
A cell is defined as a list of faces with extra functionality.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
Traits class for primitives.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar e
Elementary charge.
const dimensionedScalar c
Speed of light in a vacuum.
Type edgeCutValue(const edge &e, const scalar lambda, const Field< Type > &pPsis)
Linearly interpolate a value from the end points to the cut point of an.
static const bool separatedBelow
This flag determines which side of the iso-surface is separated into.
void writeCellCuts(const cell &c, const cellEdgeAddressing &cAddr, const List< List< label >> &cCuts, const faceList &fs, const pointField &ps, const scalarField &pAlphas, const scalar isoAlpha, OBJstream &obj)
Write the cuts for a given cell to an OBJ file.
void writeFaceCuts(const face &f, const List< labelPair > &fCuts, const pointField &ps, const scalarField &pAlphas, const scalar isoAlpha, OBJstream &obj)
Write the cuts for a given face to an OBJ file.
List< labelPair > faceCuts(const face &f, const scalarField &pAlphas, const scalar isoAlpha)
Return the cuts for a given face. This returns a list of pairs of.
labelListList cellCuts(const cell &c, const cellEdgeAddressing &cAddr, const faceUList &fs, const List< List< labelPair >> &fCuts, const scalarField &pAlphas, const scalar isoAlpha)
Return the cuts for a given cell. This returns a list of lists of cell-edge.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Type max(const UIndirectList< Type > &l)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
List< labelList > labelListList
A List of labelList.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Type min(const UIndirectList< Type > &l)