39 namespace functionObjects
52 Foam::scalar Foam::functionObjects::sampledSurfaces::mergeTol_ = 1
e-10;
57 bool Foam::functionObjects::sampledSurfaces::needsUpdate()
const
61 if (
operator[](si).needsUpdate())
71 bool Foam::functionObjects::sampledSurfaces::expire()
73 bool justExpired =
false;
77 if (
operator[](si).expire())
85 mergeList_[si].clear();
94 bool Foam::functionObjects::sampledSurfaces::update()
108 if (
operator[](si).update())
118 scalar mergeDim = mergeTol_*mesh_.bounds().mag();
122 Pout<<
nl <<
"Merging all points within "
123 << mergeDim <<
" metre" <<
endl;
128 sampledSurface&
s = operator[](si);
144 SubList<face>(
s.faces(),
s.faces().size()),
148 mergeList_[si].faces,
149 mergeList_[si].pointsMap
170 mesh_.
time().globalPath()
176 interpolationScheme_(
word::null),
195 bool surfacesFound =
dict.found(
"surfaces");
199 dict.lookup(
"fields") >> fields_;
201 dict.lookup(
"interpolationScheme") >> interpolationScheme_;
203 dict.readIfPresent(
"writeEmpty", writeEmpty_);
205 const word writeType(
dict.lookup(
"surfaceFormat"));
210 if (
dict.isDict(
"surfaces"))
231 dict.lookup(
"surfaces"),
239 mergeList_.setSize(size());
247 Info<<
"Reading surface description:" <<
nl;
250 Info<<
" " << operator[](si).name() <<
nl;
258 Pout<<
"sample fields:" << fields_ <<
nl
259 <<
"sample surfaces:" <<
nl <<
"(" <<
nl;
263 Pout<<
" " << operator[](si) <<
endl;
303 Pout<<
"Creating directory "
304 << outputPath_/mesh_.time().
name() <<
nl <<
endl;
308 mkDir(outputPath_/mesh_.time().name());
315 #define FoundFieldType(Type, nullArg) \
316 || foundObject<VolField<Type>>(fields_[fieldi]) \
317 || foundObject<SurfaceField<Type>>(fields_[fieldi])
324 cannotFindObject(fields_[fieldi]);
326 #undef FoundFieldType
331 #define DeclareInterpolations(Type, nullArg) \
332 HashPtrTable<interpolation<Type>> interpolation##Type##s;
334 #undef DeclareInterpolations
341 #define GenerateFieldTypeValues(Type, nullArg) \
342 PtrList<Field<Type>> field##Type##Values = \
343 sampleType<Type>(surfi, fieldNames, interpolation##Type##s);
345 #undef GenerateFieldTypeValues
352 && (mergeList_[surfi].faces.size() || writeEmpty_)
357 outputPath_/mesh_.time().name(),
359 mergeList_[surfi].points,
360 mergeList_[surfi].faces,
364 , field##Type##Values
372 if (
s.faces().size() || writeEmpty_)
376 outputPath_/mesh_.time().name(),
383 , field##Type##Values
410 if (&map.
mesh() == &mesh_)
422 if (&map.
mesh() == &mesh_)
434 if (&map.
mesh() == &mesh_)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
void append(const T &)
Append an element at the end of the list.
virtual const fileName & name() const
Return the name of the stream.
const Field< PointType > & points() const
Return reference to global points.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
static bool & parRun()
Is this a parallel run?
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Set of surfaces to sample.
virtual wordList fields() const
Return the list of fields required.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map - expires the surfaces.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void movePoints(const polyMesh &)
Update for mesh point-motion - expires the surfaces.
virtual ~sampledSurfaces()
Destructor.
sampledSurfaces(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Sample and write.
virtual bool read(const dictionary &)
Read the sampledSurfaces dictionary.
Writes run time, CPU time and clock time and optionally the CPU and clock times per time step.
functionObject base class for writing single files
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const polyMesh & mesh() const
Return polyMesh.
Class containing mesh-to-mesh mapping information.
const polyMesh & mesh() const
Return polyMesh.
Mesh consisting of general polyhedral cells.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const polyMesh & mesh() const
Return polyMesh.
Class used for the PtrLists read-construction.
An abstract class for surfaces with sampling.
static autoPtr< sampledSurface > New(const word &name, const polyMesh &, const dictionary &)
Return a reference to the selected surface.
static autoPtr< surfaceWriter > New(const word &writeType, const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression)
Select given write options.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
static List< word > fieldNames
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
const dimensionedScalar e
Elementary charge.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
Addressing for a faceList slice.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
points setSize(newPointi)
#define FoundFieldType(Type, nullArg)
#define FieldTypeValuesParameter(Type, nullArg)
#define DeclareInterpolations(Type, nullArg)
#define GenerateFieldTypeValues(Type, nullArg)