Go to the documentation of this file.
53 void Foam::sampledCuttingPlane::checkBoundsIntersection
68 <<
"Bounds " << bounds_
69 <<
" do not overlap the mesh bounding box " <<
meshBb
79 <<
"Plane "<< pln <<
" does not intersect the bounds "
86 if (!
meshBb.intersects(pln))
91 <<
"Plane "<< pln <<
" does not intersect the mesh bounds "
98 void Foam::sampledCuttingPlane::createGeometry()
102 Pout<<
"sampledCuttingPlane::createGeometry :updating geometry."
108 isoSurfCellPtr_.clear();
109 isoSurfTopoPtr_.clear();
110 pointDistance_.clear();
111 cellDistancePtr_.clear();
116 const fvMesh& fvm =
static_cast<const fvMesh&
>(this->
mesh());
122 && subMeshPtr_.empty()
133 <<
"Allocating subset of size "
134 << cellsToSelect.count()
135 <<
" with exposed faces into patch "
141 if (bounds_.valid() && cellsToSelect.any())
143 const auto& cellCentres = fvm.C();
145 for (
const label celli : cellsToSelect)
147 const point& cc = cellCentres[celli];
149 if (!bounds_.contains(cc))
151 cellsToSelect.unset(celli);
156 <<
"Bounded subset of size "
157 << cellsToSelect.count() <<
endl;
160 subMeshPtr_.reset(
new fvMeshSubset(fvm, cellsToSelect, exposedPatchi));
168 ? subMeshPtr_().subMesh()
172 checkBoundsIntersection(plane_,
mesh.
bounds());
178 cellDistancePtr_.
reset
204 fld[i] = plane_.signedDistance(cc[i]);
208 volScalarField::Boundary& cellDistanceBf =
209 cellDistance.boundaryFieldRef();
213 forAll(cellDistanceBf, patchi)
217 isA<emptyFvPatchScalarField>
219 cellDistanceBf[patchi]
226 new calculatedFvPatchScalarField
237 fld.setSize(pp.size());
240 fld[i] = plane_.signedDistance(cc[i]);
251 fld[i] = plane_.signedDistance(cc[i]);
269 pointDistance_[i] = plane_.signedDistance(pts[i]);
276 Pout<<
"Writing cell distance:" << cellDistance.objectPath() <<
endl;
277 cellDistance.
write();
294 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
302 isoSurfCellPtr_.reset
318 isoSurfTopoPtr_.reset
389 subMeshPtr_(
nullptr),
390 cellDistancePtr_(
nullptr),
391 isoSurfPtr_(
nullptr),
392 isoSurfCellPtr_(
nullptr),
393 isoSurfTopoPtr_(
nullptr)
397 zoneNames_.resize(1);
408 <<
"Cannot find patch " << exposedPatchName_
409 <<
" in which to put exposed faces." <<
endl
415 <<
"Restricting to cellZone(s) " <<
flatOutput(zoneNames_)
416 <<
" with exposed internal faces into patch "
417 << exposedPatchName_ <<
endl;
434 Pout<<
"sampledCuttingPlane::expire :"
435 <<
" needsUpdate:" << needsUpdate_ <<
endl;
456 Pout<<
"sampledCuttingPlane::update :"
457 <<
" needsUpdate:" << needsUpdate_ <<
endl;
467 needsUpdate_ =
false;
478 return sampleOnFaces(sampler);
488 return sampleOnFaces(sampler);
498 return sampleOnFaces(sampler);
508 return sampleOnFaces(sampler);
518 return sampleOnFaces(sampler);
528 return sampleOnPoints(interpolator);
538 return sampleOnPoints(interpolator);
548 return sampleOnPoints(interpolator);
558 return sampleOnPoints(interpolator);
568 return sampleOnPoints(interpolator);
574 os <<
"sampledCuttingPlane: " <<
name() <<
" :"
575 <<
" plane:" << plane_
576 <<
" faces:" << faces().size()
577 <<
" points:" <<
points().size();
int debug
Static debugging option.
fvPatchField< scalar > fvPatchScalarField
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word & name() const
Return name.
Remove points from pyramid edges and face-diagonals.
A class for handling words, derived from Foam::string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
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_)
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static const Enum< algorithmType > algorithmNames
Names for the iso-surface algorithms.
label findIndex(const keyType &key) const
Return zone index for the first match, return -1 if not found.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
Mesh consisting of general polyhedral cells.
wordList names() const
Return a list of patch names.
#define forAll(list, i)
Loop across all elements in list.
virtual void print(Ostream &os) const
Print information.
bool overlaps(const boundBox &bb) const
Overlaps/touches boundingBox?
virtual bool needsUpdate() const
Does the surface need an update?
word name(const complex &c)
Return string representation of complex.
label findIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Deprecated(2017-10) search for first occurrence of the given element.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual bool update()
Update the surface as required.
An abstract class for surfaces with sampling.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
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.
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
sampledCuttingPlane(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
const boundBox & bounds() const
Return mesh bounding box.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const vectorField & cellCentres() const
#define DebugInfo
Report an information message using Foam::Info.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
bool intersects(const plane &pln) const
Does plane intersect this bounding box.
const vectorField & faceCentres() const
const word & name() const
Name of surface.
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
Print 0/1 bits in the (unsigned) integral type.
const dimensionedScalar e
Elementary charge.
label nPoints() const
Number of mesh points.
static filterType getFilterType(const dictionary &dict, const isoSurfaceBase::filterType deflt)
Get 'regularise' as bool or enumeration.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
const polyBoundaryMesh & patches
const Time & time() const
Return the top-level database.
SubField< Type > subField
Declare type of subField.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
bitSet selection(const labelUList &zoneIds) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool valid() const
Bounding box is non-inverted.
virtual bool expire()
Mark the surface as needing an update.
bool interpolate() const
Interpolation to nodes requested for surface.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
const Boundary & boundaryField() const
Return const-reference to the boundary field.