131#ifndef Foam_sampledSurfaces_H
132#define Foam_sampledSurfaces_H
161 static scalar mergeTol_;
164 enum sampleActionType :
unsigned
176 const bool loadFromFiles_;
185 fileName outputPath_;
191 wordRes fieldSelection_;
194 word sampleFaceScheme_;
197 word sampleNodeScheme_;
206 List<unsigned> actions_;
209 List<bool> hasFaces_;
227 static autoPtr<surfaceWriter> newWriter
236 bool performAction(
unsigned request);
240 IOobjectList preCheckFields();
247 const Field<Type>& values,
248 const word& fieldName
261 template<
class GeoField>
264 const IOobjectList& objects,
270 void storeRegistrySurface(
const sampledSurface&
s);
273 template<
class Type,
class GeoMeshType>
274 void storeRegistryField
276 const sampledSurface&
s,
277 const word& fieldName,
278 const dimensionSet& dims,
284 template<
class Container,
class Predicate>
285 static bool testAny(
const Container& items,
const Predicate& pred);
288 virtual bool needsUpdate()
const;
294 virtual bool expire(
const bool force=
false);
301 sampledSurfaces(
const sampledSurfaces&) =
delete;
304 void operator=(
const sampledSurfaces&) =
delete;
328 const objectRegistry&
obr,
330 const bool loadFromFiles =
false
342 bool verbose(
bool on)
noexcept;
354 virtual bool write();
357 virtual void updateMesh(
const mapPolyMesh& mpm);
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))
vtk::lineWriter writer(edgeCentres, edgeList::null(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edgesCentres")))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
constexpr PtrList() noexcept
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
A class for handling file names.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
readUpdateState
Enumeration defining the state of the mesh after a read update.
A surface mesh consisting of general polygon faces and capable of holding fields.
An abstract class for surfaces with sampling.
Set of surfaces to sample.
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion - expires the surfaces.
virtual bool read(const dictionary &dict)
Read the sampledSurfaces dictionary.
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh - expires the surfaces.
const wordRes & fieldNames() const noexcept
Return names of fields to sample.
static scalar mergeTol() noexcept
Get merge tolerance.
bool verbose(bool on) noexcept
Enable/disable verbose output.
virtual ~sampledSurfaces()=default
Destructor.
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
virtual bool execute()
Sample and store if the sampleOnExecute is enabled.
TypeName("surfaces")
Runtime type information.
virtual bool write()
Sample and write.
Base class for surface writers.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
GeometricField< Type, fvsPatchField, surfaceMesh > SurfaceField
A (volume) surface field for a given type.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.