52 auto iter = indices.
cbegin();
53 const auto last = indices.
cend();
57 const bool aLower = (pointValues[*iter] < isoval);
62 if (aLower != (pointValues[*iter] < isoval))
80 const scalarField& cellValues,
81 const scalarField& pointValues,
83 const isoSurfaceParams& params
87 isoSurfaceParams(params),
118 const uint8_t maskValue
123 for (
const cutType
cut : cuts)
125 if (maskValue ? (
cut & maskValue) != 0 : !
cut)
137 for (cutType&
cut : cuts)
139 if (
cut != cutType::BLOCKED)
155 for (
const label celli : ignoreCells)
157 if (celli >= cuts.size())
162 cuts[celli] = cutType::BLOCKED;
172 UList<cutType>& cuts,
194 cuts[celli] == cutType::UNVISITED
195 && (bb.contains(cc[celli]) ? keepInside : !keepInside)
198 cuts[celli] = cutType::BLOCKED;
211 constexpr uint8_t realCut(cutType::CUT | cutType::TETCUT);
213 cuts.resize(mesh_.nCells(), cutType::UNVISITED);
218 if (cuts[celli] == cutType::UNVISITED)
220 cuts[celli] = getCellCutType(celli);
222 if ((cuts[celli] & realCut) != 0)
239 mesh_.isInternalFace(facei)
240 || !ignoreBoundaryFaces_.test(facei-mesh_.nInternalFaces())
253 for (
const label facei : mesh_.cells()[celli])
257 !mesh_.isInternalFace(facei)
258 && ignoreBoundaryFaces_.test(facei-mesh_.nInternalFaces())
264 if (
isFaceCut(iso_, pVals_, mesh_.faces()[facei]))
266 return cutType::TETCUT;
270 return cutType::NOTCUT;
278 const bool cellLower = (cVals_[celli] < iso_);
280 for (
const label facei : mesh_.cells()[celli])
284 !mesh_.isInternalFace(facei)
285 && ignoreBoundaryFaces_.test(facei-mesh_.nInternalFaces())
291 const face&
f = mesh_.faces()[facei];
294 for (
const label pointi :
f)
298 if (cellLower != (pVals_[pointi] < iso_))
307 return cutType::NOTCUT;
313 return (nPyrCuts == nPyrEdges) ? cutType::SPHERE : cutType::CUT;
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A bounding box defined in terms of min/max extrema points.
bool contains(const point &pt) const
Contains point? (inside or on edge).
bool good() const
Bounding box is non-inverted.
A face is a list of labels corresponding to mesh vertices.
Low-level components common to various iso-surface algorithms.
static void resetCuts(UList< cutType > &cuts)
Restore non-BLOCKED state to an UNVISITED state.
bitSet ignoreBoundaryFaces_
Optional boundary faces to ignore.
isoSurfaceBase(const isoSurfaceBase &)=delete
No copy construct.
static label countCutType(const UList< cutType > &cuts, const uint8_t maskValue)
Count the number of cuts matching the mask type.
cutType
The type of cell/face cuts.
@ BLOCKED
Blocked (never cut).
@ SPHERE
All edges to cell centre cut.
@ TETCUT
Cell cut is a tet.
const scalarField & cellValues() const noexcept
The mesh cell values used for creating the iso-surface.
const scalarField & pVals_
Point values.
label calcCellCuts(List< cutType > &cuts) const
Populate a list of candidate cell cuts using getCellCutType().
labelList meshCells_
For every face, the original cell in mesh.
const scalar iso_
Iso value.
cutType getFaceCutType(const label facei) const
Determine face cut for an individual face.
void ignoreCyclics()
Set ignoreBoundaryFaces to ignore cyclics (cyclicACMI).
const polyMesh & mesh() const noexcept
The mesh for which the iso-surface is associated.
cutType getCellCutType(const label celli) const
Cell cut for an individual cell, with special handling for TETCUT and SPHERE cuts.
const scalarField & pointValues() const noexcept
The mesh point values used for creating the iso-surface.
const polyMesh & mesh_
Reference to mesh.
label blockCells(UList< cutType > &cuts, const bitSet &ignoreCells) const
Mark ignoreCells as BLOCKED.
const scalarField & cVals_
Cell values.
isoSurfaceParams(const algorithmType algo=algorithmType::ALGO_DEFAULT, const filterType filter=filterType::DIAGCELL) noexcept
Default construct, or with specified algorithm.
A range or interval of labels defined by a start and a size.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
static bool test(const UList< face > &faces)
Test if given list of faces satisfies criteria for TET. (4 tri).
type
Volume classification types.
@ OUTSIDE
A location outside the volume.
@ INSIDE
A location inside the volume.
Convenience macros for instantiating iso-surface interpolate methods.
#define defineIsoSurfaceInterpolateMethods(ThisClass)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
MeshedSurface< face > meshedSurface
static bool isFaceCut(const scalar isoval, const scalarField &pointValues, const labelUList &indices)
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.