186#ifndef Foam_functionObjects_surfaceFieldValue_H
187#define Foam_functionObjects_surfaceFieldValue_H
215class surfaceFieldValue
233 static const Enum<regionTypes> regionTypeNames_;
248 opSumDirectionBalance,
259 opAreaNormalAverage = (1 | typeScalar),
262 opAreaNormalIntegrate,
269 typeWeighted = 0x200,
272 opWeightedSum = (opSum | typeWeighted),
275 opWeightedAverage = (opAverage | typeWeighted),
278 opWeightedAreaAverage = (opAreaAverage | typeWeighted),
281 opWeightedAreaIntegrate = (opAreaIntegrate | typeWeighted),
284 opWeightedUniformity = (opUniformity | typeWeighted),
288 typeAbsolute = 0x400,
291 opAbsWeightedSum = (opWeightedSum | typeAbsolute),
294 opAbsWeightedAverage = (opWeightedAverage | typeAbsolute),
297 opAbsWeightedAreaAverage = (opWeightedAreaAverage | typeAbsolute),
300 opAbsWeightedAreaIntegrate =
301 (opWeightedAreaIntegrate | typeAbsolute),
304 opAbsWeightedUniformity =
305 (opWeightedUniformity | typeAbsolute),
309 static const Enum<operationType> operationTypeNames_;
313 enum postOperationType
321 static const Enum<postOperationType> postOperationTypeNames_;
329 void setFaceZoneFaces();
332 void setPatchFaces();
335 void combineMeshGeometry
342 void combineSurfaceGeometry
349 scalar totalArea()
const;
357 regionTypes regionType_;
360 operationType operation_;
363 postOperationType postOperation_;
372 error::handlerTypes emptySurfaceError_;
375 wordRes selectionNames_;
406 autoPtr<sampledSurface> sampledPtr_;
409 autoPtr<surfaceWriter> surfaceWriterPtr_;
416 template<
class WeightType>
417 static tmp<scalarField> weightingFactor
419 const Field<WeightType>& weightField,
426 template<
class WeightType>
427 static tmp<scalarField> weightingFactor
429 const Field<WeightType>& weightField,
430 const vectorField& Sf,
437 template<
class WeightType>
438 static tmp<scalarField> areaWeightingFactor
440 const Field<WeightType>& weightField,
441 const vectorField& Sf,
449 const objectRegistry& obr()
const;
452 inline bool withSurfaceFields()
const;
455 inline bool withTopologicalMerge() const noexcept;
458 inline const labelList&
faceId() const noexcept;
461 inline const labelList& facePatch() const noexcept;
464 inline const boolList& faceFlip() const noexcept;
467 bool usesSf() const noexcept;
470 inline
bool is_magOp() const noexcept;
473 inline
bool is_weightedOp() const noexcept;
476 template<class WeightType>
477 inline
bool canWeight(const Field<WeightType>&
fld) const;
485 bool validField(const word& fieldName) const;
489 tmp<Field<Type>> getFieldValues
491 const word& fieldName,
492 const
bool mandatory = false
496 template<class Type, class WeightType>
497 Type processSameTypeValues
499 const Field<Type>& values,
500 const vectorField& Sf,
501 const Field<WeightType>& weightField
506 template<class Type, class WeightType>
509 const Field<Type>& values,
510 const vectorField& Sf,
511 const Field<WeightType>& weightField
517 tmp<Field<Type>> filterField
519 const GeometricField<Type, fvsPatchField, surfaceMesh>&
field
524 tmp<Field<Type>> filterField
526 const GeometricField<Type, fvPatchField, volMesh>&
field
530 template<class WeightType>
533 const vectorField& Sf,
534 const Field<WeightType>& weightField,
536 const faceList& faces
540 template<class Type, class WeightType>
543 const word& fieldName,
544 const vectorField& Sf,
545 const Field<WeightType>& weightField,
547 const faceList& faces
552 virtual
void writeFileHeader(Ostream&
os);
575 const objectRegistry& obr,
580 surfaceFieldValue(const surfaceFieldValue&) = delete;
583 void operator=(const surfaceFieldValue&) = delete;
587 virtual ~surfaceFieldValue();
593 inline regionTypes regionType() const noexcept;
596 inline fileName outputDir() const;
602 virtual
bool write();
605 virtual
void updateMesh(const mapPolyMesh& mpm);
608 virtual
void movePoints(const polyMesh&
mesh);
614scalar surfaceFieldValue::processValues
616 const Field<scalar>& values,
617 const vectorField& Sf,
618 const scalarField& weightField
624vector surfaceFieldValue::processValues
626 const Field<vector>& values,
627 const vectorField& Sf,
628 const scalarField& weightField
634tmp<scalarField> surfaceFieldValue::weightingFactor
636 const Field<scalar>& weightField,
642tmp<scalarField> surfaceFieldValue::weightingFactor
644 const Field<scalar>& weightField,
645 const vectorField& Sf ,
651tmp<scalarField> surfaceFieldValue::areaWeightingFactor
653 const Field<scalar>& weightField,
654 const vectorField& Sf,
661tmp<scalarField> surfaceFieldValue::weightingFactor
663 const Field<vector>& weightField,
664 const vectorField& Sf,
670tmp<scalarField> surfaceFieldValue::areaWeightingFactor
672 const Field<vector>& weightField,
673 const vectorField& Sf,
686#include "surfaceFieldValueI.H"
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
An abstract class for surfaces with sampling.
Base class for surface writers.
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
List< label > labelList
A List of labels.
List< bool > boolList
A List of bools.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.