Go to the documentation of this file.
62 "isoAlgorithm",
dict, algo
67 "isoAlgorithm", {{
"cell", 1906}}, useCell
89 const word& defaultSurfaceName,
102 dict.getOrDefault(
"surfaceName", defaultSurfaceName),
103 mesh.time().constant(),
112 distance_(
dict.get<scalar>(
"distance")),
115 distance_ < 0 ||
equal(distance_,
Zero) ||
dict.get<
bool>(
"signed")
120 isoSurfaceBase::getFilterType
123 isoSurfaceBase::filterType::DIAGCELL
126 bounds_(
dict.getOrDefault(
"bounds", boundBox::invertedBox)),
127 isoSurfPtr_(
nullptr),
128 isoSurfCellPtr_(
nullptr),
129 isoSurfTopoPtr_(
nullptr)
137 const word& surfaceType,
138 const word& surfaceName,
140 const bool signedDistance,
155 mesh.time().constant(),
167 signedDistance || distance_ < 0 ||
equal(distance_,
Zero)
172 isoSurfPtr_(
nullptr),
173 isoSurfCellPtr_(
nullptr),
174 isoSurfTopoPtr_(
nullptr)
184 Pout<<
"distanceSurface::createGeometry updating geometry." <<
endl;
189 isoSurfCellPtr_.clear();
190 isoSurfTopoPtr_.clear();
197 cellDistancePtr_.reset
203 "distanceSurface.cellDistance",
219 const bool isZeroDist =
equal(distance_,
Zero);
220 const bool filterCells =
238 surfPtr_().findNearest
245 if (signed_ || isZeroDist)
248 surfPtr_().getNormal(nearest, norms);
254 const point diff(cc[i] - nearest[i].hitPoint());
271 if (!cellBb.
contains(nearest[i].hitPoint()))
291 volScalarField::Boundary& cellDistanceBf =
300 surfPtr_().findNearest
310 surfPtr_().getNormal(nearest, norms);
314 const point diff(cc[i] - nearest[i].hitPoint());
340 pointDistance_.setSize(fvm.
nPoints());
345 surfPtr_().findNearest
355 surfPtr_().getNormal(nearest, norms);
359 const point diff(pts[i] - nearest[i].hitPoint());
373 pointDistance_[i] =
Foam::mag(pts[i] - nearest[i].hitPoint());
381 Pout<<
"Writing cell distance:" << cellDistance.objectPath() <<
endl;
382 cellDistance.write();
387 "distanceSurface.pointDistance",
399 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
404 if (!ignoreCells.
any())
413 isoSurfCellPtr_.reset
430 isoSurfTopoPtr_.reset
470 os <<
" surface:" << surfaceName()
472 <<
" faces:" << surface().surfFaces().size()
473 <<
" points:" << surface().points().size();
int debug
Static debugging option.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const labelListList & cellPoints() const
static constexpr const zero Zero
Global zero (0)
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
bool any() const
True if any bits in this bitset are set.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
static word timeName(const scalar t, const int precision=precision_)
distanceSurface(const word &defaultSurfaceName, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
void set(const bitSet &bitset)
Set specified bits from another bitset.
static const Enum< algorithmType > algorithmNames
Names for the iso-surface algorithms.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
dimensionedScalar sign(const dimensionedScalar &ds)
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
Mesh consisting of general polyhedral cells.
A surface formed by the iso value. After "Polygonising A Scalar Field Using Tetrahedrons",...
#define forAll(list, i)
Loop across all elements in list.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
algorithmType
The algorithm types.
A surface formed by the iso value. After "Regularised Marching Tetrahedra: improved iso-surface extra...
label nCells() const
Number of mesh cells.
bool readIfPresentCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX) const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const volVectorField & C() const
Return cell centres as volVectorField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Mesh data needed to do the Finite Volume discretisation.
scalar distance(const vector &p1, const vector &p2)
void clear()
Clear bounding box and make it an inverted box.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
bool contains(const point &pt) const
Contains point? (inside or on edge)
void print(Ostream &os) const
Print information.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
label nPoints() const
Number of mesh points.
static isoSurfaceBase::algorithmType getIsoAlgorithm(const dictionary &dict)
A bounding box defined in terms of min/max extrema points.
const Time & time() const
Return the top-level database.
void createGeometry()
Create/recreate the distance surface.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Marching tet iso surface algorithm with optional filtering to keep only points originating from mesh ...
bool equal(const T &s1, const T &s2)
Compare two values for equality.
defineTypeNameAndDebug(combustionModel, 0)
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void clear()
Clear the list, i.e. set addressable size to zero.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
filterType
The filtering (regularization) to apply.
void add(const boundBox &bb)
Extend to include the second box.