45 namespace functionObjects
61 void Foam::functionObjects::sampledSets::combineSampledSets()
63 masterSets_.setSize(
size());
70 Tuple2<coordSet, labelList> g =
s.gather();
72 masterSets_.set(seti,
new coordSet(g.first()));
73 masterSetOrders_[seti] = g.second();
78 <<
"Sample set " <<
s.name()
79 <<
" has zero points." <<
endl;
98 mesh_.
time().globalPath()
103 searchEngine_(mesh_),
104 interpolationScheme_(
word::null),
121 bool setsFound =
dict.found(
"sets");
124 dict.lookup(
"fields") >> fields_;
126 dict.lookup(
"interpolationScheme") >> interpolationScheme_;
128 const word writeType(
dict.lookup(
"setFormat"));
133 if (
dict.isDict(
"sets"))
166 combineSampledSets();
170 Info<<
"Reading set description:" <<
nl;
173 Info<<
" " << operator[](seti).name() <<
nl;
203 Pout<<
"Creating directory "
204 << outputPath_/mesh_.time().
name() <<
nl <<
endl;
207 mkDir(outputPath_/mesh_.time().name());
214 #define FoundFieldType(Type, nullArg) \
215 || foundObject<VolField<Type>>(fields_[fieldi])
222 cannotFindObject(fields_[fieldi]);
224 #undef FoundFieldType
229 #define DeclareInterpolations(Type, nullArg) \
230 HashPtrTable<interpolation<Type>> interpolation##Type##s;
232 #undef DeclareInterpolations
237 #define GenerateFieldTypeValues(Type, nullArg) \
238 PtrList<Field<Type>> field##Type##Values = \
239 sampleType<Type>(seti, fieldNames, interpolation##Type##s);
241 #undef GenerateFieldTypeValues
249 outputPath_/mesh_.time().name(),
250 operator[](seti).name(),
254 , field##Type##Values
263 if (
operator[](seti).size())
267 outputPath_/mesh_.time().name(),
268 operator[](seti).name(),
272 , field##Type##Values
291 searchEngine_.correct();
296 operator[](seti).movePoints();
301 combineSampledSets();
312 if (&map.
mesh() == &mesh_)
316 searchEngine_.correct();
321 operator[](seti).topoChange(map);
326 combineSampledSets();
334 if (&map.
mesh() == &mesh_)
338 searchEngine_.correct();
343 operator[](seti).mapMesh(map);
348 combineSampledSets();
359 if (&map.
mesh() == &mesh_)
363 searchEngine_.correct();
368 operator[](seti).distribute(map);
373 combineSampledSets();
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.
void setSize(const label)
Reset size of List.
virtual const fileName & name() const
Return the name of the stream.
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?
label size() const
Return the number of elements in the UPtrList.
const T & operator[](const label) const
Return element const reference.
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...
sampledSets(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
virtual wordList fields() const
Return the list of fields required.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
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.
virtual ~sampledSets()
Destructor.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Sample and write.
virtual bool read(const dictionary &)
Read the sampledSets.
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 read-construction of.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
static autoPtr< sampledSet > New(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Return a reference to the selected sampledSet.
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
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))
#define WarningInFunction
Report a warning using Foam::Warning.
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.
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)