Go to the documentation of this file.
32 template<
class ParticleType>
38 template<
class ParticleType>
45 "uniform"/cloud::prefix/
name(),
47 IOobject::MUST_READ_IF_MODIFIED,
56 const word procName(
"processor" +
Foam::name(Pstream::myProcNo()));
57 if (uniformPropsDict.
found(procName))
60 >> ParticleType::particleCount_;
65 ParticleType::particleCount_ = 0;
70 template<
class ParticleType>
79 "uniform"/cloud::prefix/
name(),
88 np[Pstream::myProcNo()] = ParticleType::particleCount_;
91 Pstream::listCombineScatter(np);
97 uniformPropsDict.
subDict(procName).
add(
"particleCount", np[i]);
103 IOstream::currentVersion,
104 time().writeCompression()
109 template<
class ParticleType>
112 readCloudUniformProperties();
130 Pout<<
"Cannot read particle positions file:" <<
nl
131 <<
" " << ioP.objectPath() <<
nl
132 <<
"Assuming the initial cloud contains 0 particles." <<
endl;
139 polyMesh_.tetBasePtIs();
143 ParticleType&
p = pIter();
152 template<
class ParticleType>
156 const bool checkClass
167 initCloud(checkClass);
171 template<
class ParticleType>
174 const polyMesh& pMesh,
176 const bool checkClass
187 initCloud(checkClass);
193 template<
class ParticleType>
196 const word& fieldName,
212 template<
class ParticleType>
213 template<
class DataType>
220 if (
data.size() !=
c.size())
224 <<
" field " <<
data.size()
225 <<
" does not match the number of particles " <<
c.size()
231 template<
class ParticleType>
232 template<
class DataType>
239 if (
data.size() !=
c.size())
243 <<
" field " <<
data.size()
244 <<
" does not match the number of particles " <<
c.size()
250 template<
class ParticleType>
255 template<
class ParticleType>
260 ParticleType::writeFields(*
this);
265 template<
class ParticleType>
273 writeCloudUniformProperties();
278 return cloud::writeObject(fmt, ver, cmp);
289 template<
class ParticleType>
295 os.
check(
"Ostream& operator<<(Ostream&, const Cloud<ParticleType>&)");
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void initCloud(const bool checkClass)
Initialise cloud on IO constructor.
virtual void writeFields() const
Write the field data for the cloud of particles Dummy at.
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType) const
Write using given format, version and compression.
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A primitive field of type <T> with automated input and output.
#define forAll(list, i)
Loop across all elements in list.
compressionType
Enumeration for the format of data in the stream.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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....
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.
bool headerOk()
Read and check header info.
virtual void readData(CloudType &c, bool checkClass)
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Pre-declare SubField and related Field type.
void writeCloudUniformProperties() const
Write cloud properties dictionary.
static word cloudPropertiesName
Name of cloud properties dictionary.
virtual void readFields()
Read the field data for the cloud of particles. Dummy at.
Helper IO class to read and write particle positions.
Ostream & operator<<(Ostream &, const edgeMesh &)
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by any number of values (e....
errorManip< error > abort(error &err)
A cloud is a collection of lagrangian particles.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const
Name function is needed to disambiguate those inherited.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void readFields(const boolList &haveMesh, const fvMesh &mesh, const autoPtr< fvMeshSubset > &subsetterPtr, IOobjectList &allObjects, PtrList< GeoField > &fields)
Cloud(const polyMesh &mesh, const IDLList< ParticleType > &particles)
Construct from mesh and a list of particles.
const word cloudName(propsDict.lookup("cloudName"))
const dimensionedScalar c
Speed of light in a vacuum.
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write using given format, version and compression.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
void readCloudUniformProperties()
Read cloud properties dictionary.
Database for solution data, solver performance and other reduced data.
word name(const complex &)
Return a string representation of a complex.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void checkFieldFieldIOobject(const Cloud< ParticleType > &c, const CompactIOField< Field< DataType >, DataType > &data) const
Check lagrangian data fieldfield.
streamFormat
Enumeration for the format of data in the stream.