37template<
class ParticleType>
43template<
class ParticleType>
50 "uniform"/cloud::prefix/
name(),
52 IOobject::MUST_READ_IF_MODIFIED,
57 if (dictObj.typeHeaderOk<IOdictionary>(
true))
59 const IOdictionary uniformPropsDict(dictObj);
64 cloud::geometryTypeNames.getOrDefault
68 cloud::geometryType::POSITIONS
71 const word procName(
"processor" +
Foam::name(Pstream::myProcNo()));
73 const dictionary* dictptr = uniformPropsDict.findDict(procName);
87template<
class ParticleType>
90 IOdictionary uniformPropsDict
96 "uniform"/cloud::prefix/
name(),
107 Pstream::listCombineAllGather(np, maxEqOp<label>());
112 cloud::geometryTypeNames[geometryType_]
118 uniformPropsDict.add(procName, dictionary());
119 uniformPropsDict.subDict(procName).add(
"particleCount", np[i]);
122 uniformPropsDict.writeObject
124 IOstreamOption(IOstream::ASCII, time().writeCompression()),
130template<
class ParticleType>
133 readCloudUniformProperties();
135 IOPosition<Cloud<ParticleType>> ioP(*
this, geometryType_);
137 const bool valid = ioP.headerOk();
138 Istream& is = ioP.readStream(checkClass ? typeName :
"", valid);
141 ioP.readData(is, *
this);
147 Pout<<
"Cannot read particle positions file:" <<
nl
148 <<
" " << ioP.objectPath() <<
nl
149 <<
"Assuming the initial cloud contains 0 particles." <<
endl;
153 geometryType_ = cloud::geometryType::COORDINATES;
158 polyMesh_.tetBasePtIs();
164template<
class ParticleType>
169 const bool checkClass
183 initCloud(checkClass);
189template<
class ParticleType>
192 const word& fieldName,
208template<
class ParticleType>
209template<
class DataType>
216 if (
data.size() != c.size())
220 <<
" field " <<
data.size()
221 <<
" does not match the number of particles " << c.size()
227template<
class ParticleType>
228template<
class DataType>
235 if (
data.size() != c.size())
239 <<
" field " <<
data.size()
240 <<
" does not match the number of particles " << c.size()
246template<
class ParticleType>
258 return fldNewPtr->store();
265template<
class ParticleType>
306 readStoreFile<label>(
io, ioNew)
307 || readStoreFile<scalar>(
io, ioNew)
308 || readStoreFile<vector>(
io, ioNew)
309 || readStoreFile<sphericalTensor>(
io, ioNew)
310 || readStoreFile<symmTensor>(
io, ioNew)
311 || readStoreFile<tensor>(
io, ioNew)
317 <<
"Unhandled field:" << fldName
324template<
class ParticleType>
327 ParticleType::writeFields(*
this);
331template<
class ParticleType>
338 writeCloudUniformProperties();
347template<
class ParticleType>
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Base cloud calls templated on particle type.
bool readStoreFile(const IOobject &io, const IOobject &ioNew) const
Helper function to store a cloud field on its registry.
static word cloudPropertiesName
Name of cloud properties dictionary.
void readFromFiles(objectRegistry &obr, const wordRes &selectFields, const wordRes &excludeFields=wordRes::null()) const
Read from files into objectRegistry.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
virtual void writeFields() const
Write the field data for the cloud of particles Dummy at.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
void checkFieldFieldIOobject(const Cloud< ParticleType > &c, const CompactIOField< Field< DataType >, DataType > &data) const
Check lagrangian data fieldfield.
A Field of objects of type <T> with automated input and output using a compact storage....
Generic templated field type.
A primitive field of type <T> with automated input and output.
List of IOobjects with searching and retrieving facilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const word & headerClassName() const noexcept
Return name of the class name read from header.
readOption
Enumeration defining the read options.
The IOstreamOption is a simple container for options an IOstream can normally have.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const word & name() const
A cloud is a registry collection of lagrangian particles.
geometryType
Cloud geometry type (internal or IO representations)
Database for solution data, solver performance and other reduced data.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
Registry of regIOobjects.
static label particleCount_
Cumulative particle counter - used to provide unique ID.
Mesh consisting of general polyhedral cells.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
virtual const pointField & oldCellCentres() const
Return old cellCentres (mesh motion)
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInfo
Report an information message using Foam::Info.
List< label > labelList
A List of labels.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Functor wrapper of allow/deny lists of wordRe for filtering.
const word cloudName(propsDict.get< word >("cloud"))