Go to the documentation of this file.
36 template<
class ParticleType>
42 template<
class ParticleType>
49 "uniform"/cloud::prefix/
name(),
51 IOobject::MUST_READ_IF_MODIFIED,
56 if (dictObj.typeHeaderOk<IOdictionary>(
true))
58 const IOdictionary uniformPropsDict(dictObj);
63 cloud::geometryTypeNames.lookupOrDefault
67 cloud::geometryType::POSITIONS
70 const word procName(
"processor" +
Foam::name(Pstream::myProcNo()));
72 const dictionary* dictptr = uniformPropsDict.findDict(procName);
76 dictptr->readEntry(
"particleCount", ParticleType::particleCount_);
81 ParticleType::particleCount_ = 0;
86 template<
class ParticleType>
89 IOdictionary uniformPropsDict
95 "uniform"/cloud::prefix/
name(),
104 np[Pstream::myProcNo()] = ParticleType::particleCount_;
106 Pstream::listCombineGather(np, maxEqOp<label>());
107 Pstream::listCombineScatter(np);
112 cloud::geometryTypeNames[geometryType_]
118 uniformPropsDict.add(procName, dictionary());
119 uniformPropsDict.subDict(procName).add(
"particleCount", np[i]);
122 uniformPropsDict.writeObject
125 IOstream::currentVersion,
126 time().writeCompression(),
132 template<
class ParticleType>
135 readCloudUniformProperties();
137 IOPosition<Cloud<ParticleType>> ioP(*
this, geometryType_);
139 const bool valid = ioP.headerOk();
140 Istream& is = ioP.readStream(checkClass ? typeName :
"", valid);
143 ioP.readData(is, *
this);
149 Pout<<
"Cannot read particle positions file:" <<
nl
150 <<
" " << ioP.objectPath() <<
nl
151 <<
"Assuming the initial cloud contains 0 particles." <<
endl;
155 geometryType_ = cloud::geometryType::COORDINATES;
160 polyMesh_.tetBasePtIs();
166 template<
class ParticleType>
171 const bool checkClass
178 geometryType_(cloud::geometryType::COORDINATES)
182 initCloud(checkClass);
188 template<
class ParticleType>
191 const word& fieldName,
207 template<
class ParticleType>
208 template<
class DataType>
215 if (
data.size() !=
c.size())
219 <<
" field " <<
data.size()
220 <<
" does not match the number of particles " <<
c.size()
226 template<
class ParticleType>
227 template<
class DataType>
234 if (
data.size() !=
c.size())
238 <<
" field " <<
data.size()
239 <<
" does not match the number of particles " <<
c.size()
245 template<
class ParticleType>
252 template<
class ParticleType>
261 writeCloudUniformProperties();
264 return cloud::writeObject(fmt, ver, cmp, this->size());
270 template<
class ParticleType>
int debug
Static debugging option.
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual void writeFields() const
Write the field data for the cloud of particles Dummy at.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
A primitive field of type <T> with automated input and output.
static constexpr const zero Zero
Global zero.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A Field of objects of type <T> with automated input and output using a compact storage....
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
const word & name() const
Name function is needed to disambiguate those inherited.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid) const
Write using given format, version and compression.
Representation of a major/minor version number.
Generic templated field type.
word name(const complex &c)
Return string representation of complex.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields)
static word cloudPropertiesName
Name of cloud properties dictionary.
streamFormat
Data format (ascii | binary)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
errorManip< error > abort(error &err)
A cloud is a registry collection of lagrangian particles.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Base cloud calls templated on particle type.
Cloud(const polyMesh &mesh, const word &cloudName, const IDLList< ParticleType > &particles)
Construct from mesh and a list of particles.
const dimensionedScalar c
Speed of light in a vacuum.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Database for solution data, solver performance and other reduced data.
Ostream & operator<<(Ostream &, const boundaryPatch &)
void checkFieldFieldIOobject(const Cloud< ParticleType > &c, const CompactIOField< Field< DataType >, DataType > &data) const
Check lagrangian data fieldfield.