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_);
76 Info<<
"Allocating subset of size " 78 <<
" with exposed faces into patch " 79 << patches[exposedPatchi].name() <<
endl;
84 new fvMeshSubset(static_cast<const fvMesh&>(
mesh()))
86 subMeshPtr_().setLargeCellSubset
98 ? subMeshPtr_().subMesh()
99 :
static_cast<const fvMesh&
>(
mesh())
106 cellDistancePtr_.reset
113 fvm.time().timeName(),
128 scalarField& fld = cellDistance.primitiveFieldRef();
133 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
137 volScalarField::Boundary& cellDistanceBf =
138 cellDistance.boundaryFieldRef();
142 forAll(cellDistanceBf, patchi)
146 isA<emptyFvPatchScalarField>
148 cellDistanceBf[patchi]
155 new calculatedFvPatchScalarField
162 const polyPatch& pp = fvm.boundary()[
patchi].patch();
166 fld.setSize(pp.size());
169 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
179 fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
191 pointDistance_.setSize(fvm.nPoints());
197 pointDistance_[i] = (pts[i] - plane_.refPoint()) & plane_.normal();
204 Pout<<
"Writing cell distance:" << cellDistance.objectPath() <<
endl;
205 cellDistance.
write();
211 fvm.time().timeName(),
222 Pout<<
"Writing point distance:" << pDist.objectPath() <<
endl;
275 cellDistancePtr_(NULL),
279 if (zoneID_.index() != -1)
281 dict.
lookup(
"exposedPatchName") >> exposedPatchName_;
286 <<
"Cannot find patch " << exposedPatchName_
287 <<
" in which to put exposed faces." <<
endl 292 if (debug && zoneID_.index() != -1)
294 Info<<
"Restricting to cellZone " << zoneID_.name()
295 <<
" with exposed internal faces into patch " 296 << exposedPatchName_ <<
endl;
320 Pout<<
"sampledCuttingPlane::expire :" 321 <<
" have-facesPtr_:" << facesPtr_.valid()
322 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
346 Pout<<
"sampledCuttingPlane::update :" 347 <<
" have-facesPtr_:" << facesPtr_.valid()
348 <<
" needsUpdate_:" << needsUpdate_ <<
endl;
358 needsUpdate_ =
false;
369 return sampleField(vField);
379 return sampleField(vField);
389 return sampleField(vField);
399 return sampleField(vField);
409 return sampleField(vField);
419 return interpolateField(interpolator);
429 return interpolateField(interpolator);
438 return interpolateField(interpolator);
448 return interpolateField(interpolator);
458 return interpolateField(interpolator);
464 os <<
"sampledCuttingPlane: " <<
name() <<
" :" 465 <<
" plane:" << plane_
466 <<
" faces:" << faces().size()
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
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)
wordList names() const
Return a list of patch names.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual bool needsUpdate() const
Does the surface need an update?
static const word null
An empty word.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
addNamedToRunTimeSelectionTable(GAMGProcAgglomeration, noneGAMGProcAgglomeration, GAMGAgglomeration, none)
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
bool interpolate() const
Interpolation requested for surface.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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.
label findPatchID(const word &patchName) const
Find patch index given a name.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual bool update()
Update the surface as required.
virtual void print(Ostream &) const
Write.
label size() const
Return the number of elements in the UPtrList.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.