49 void Foam::sampledCuttingPlane::createGeometry()
53 Pout<<
"sampledCuttingPlane::createGeometry :updating geometry." 60 pointDistance_.clear();
61 cellDistancePtr_.clear();
67 if (zoneID_.index() != -1 && !subMeshPtr_.valid())
72 const label exposedPatchi = patches.findPatchID(exposedPatchName_);
75 <<
"Allocating subset of size " 77 <<
" with exposed faces into patch " 78 << patches[exposedPatchi].name() <<
endl;
82 new fvMeshSubset(static_cast<const fvMesh&>(
mesh()))
84 subMeshPtr_().setLargeCellSubset
96 ? subMeshPtr_().subMesh()
97 :
static_cast<const fvMesh&
>(this->
mesh())
104 cellDistancePtr_.
reset 111 mesh.time().timeName(),
126 scalarField& fld = cellDistance.primitiveFieldRef();
131 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
135 volScalarField::Boundary& cellDistanceBf =
136 cellDistance.boundaryFieldRef();
140 forAll(cellDistanceBf, patchi)
144 isA<emptyFvPatchScalarField>
146 cellDistanceBf[patchi]
153 new calculatedFvPatchScalarField
160 const polyPatch& pp = mesh.boundary()[
patchi].patch();
164 fld.setSize(pp.size());
167 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
177 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
189 pointDistance_.setSize(mesh.nPoints());
195 pointDistance_[i] = (pts[i] - plane_.refPoint()) & plane_.normal();
202 Pout<<
"Writing cell distance:" << cellDistance.objectPath() <<
endl;
203 cellDistance.
write();
209 mesh.time().timeName(),
220 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
272 subMeshPtr_(
nullptr),
273 cellDistancePtr_(
nullptr),
274 isoSurfPtr_(
nullptr),
277 if (zoneID_.index() != -1)
279 dict.
lookup(
"exposedPatchName") >> exposedPatchName_;
284 <<
"Cannot find patch " << exposedPatchName_
285 <<
" in which to put exposed faces." <<
endl 290 if (debug && zoneID_.index() != -1)
292 Info<<
"Restricting to cellZone " << zoneID_.name()
293 <<
" with exposed internal faces into patch " 294 << exposedPatchName_ <<
endl;
318 Pout<<
"sampledCuttingPlane::expire :" 319 <<
" have-facesPtr_:" << facesPtr_.valid()
320 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
344 Pout<<
"sampledCuttingPlane::update :" 345 <<
" have-facesPtr_:" << facesPtr_.valid()
346 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
356 needsUpdate_ =
false;
367 return sampleField(vField);
377 return sampleField(vField);
387 return sampleField(vField);
397 return sampleField(vField);
407 return sampleField(vField);
417 return interpolateField(interpolator);
427 return interpolateField(interpolator);
436 return interpolateField(interpolator);
446 return interpolateField(interpolator);
456 return interpolateField(interpolator);
462 os <<
"sampledCuttingPlane: " <<
name() <<
" :" 463 <<
" plane:" << plane_
464 <<
" faces:" << faces().size()
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
virtual ~sampledCuttingPlane()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool expire()
Mark the surface as needing an update.
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An abstract class for surfaces with sampling.
void size(const label)
Override size to be inconsistent with allocated storage.
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label findPatchID(const word &patchName) const
Find patch index given a name.
Macros for easy insertion into run-time selection tables.
static const pointMesh & New(const polyMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
vectorField pointField
pointField is a vectorField.
fvPatchField< scalar > fvPatchScalarField
virtual bool needsUpdate() const
Does the surface need an update?
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
wordList names() const
Return a list of patch names.
static const word null
An empty word.
#define DebugInfo
Report an information message using Foam::Info.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
virtual void print(Ostream &) const
Write.
addNamedToRunTimeSelectionTable(GAMGProcAgglomeration, noneGAMGProcAgglomeration, GAMGAgglomeration, none)
label size() const
Return the number of elements in the UPtrList.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
prefixOSstream Pout(cout, "Pout")
sampledCuttingPlane(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
SubField< vector > subField
Declare type of subField.
virtual Ostream & write(const token &)=0
Write next token to stream.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
virtual bool update()
Update the surface as required.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.