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.getOrDefault
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
124 IOstreamOption(IOstream::ASCII, time().writeCompression()),
130 template<
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();
164 template<
class ParticleType>
169 const bool checkClass
176 geometryType_(cloud::geometryType::COORDINATES)
180 polyMesh_.tetBasePtIs();
181 polyMesh_.oldCellCentres();
183 initCloud(checkClass);
189 template<
class ParticleType>
192 const word& fieldName,
208 template<
class ParticleType>
209 template<
class DataType>
216 if (
data.size() !=
c.size())
220 <<
" field " <<
data.size()
221 <<
" does not match the number of particles " <<
c.size()
227 template<
class ParticleType>
228 template<
class DataType>
235 if (
data.size() !=
c.size())
239 <<
" field " <<
data.size()
240 <<
" does not match the number of particles " <<
c.size()
246 template<
class ParticleType>
253 template<
class ParticleType>
260 writeCloudUniformProperties();
263 return cloud::writeObject(streamOpt, this->size());
269 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 (0)
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
OSstream wrapped stdout (std::cout) with parallel prefix.
const word & name() const
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.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Generic templated field type.
word name(const complex &c)
Return string representation of complex.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields)
The IOstreamOption is a simple container for options an IOstream can normally have.
static word cloudPropertiesName
Name of cloud properties dictionary.
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.
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.
void checkFieldFieldIOobject(const Cloud< ParticleType > &c, const CompactIOField< Field< DataType >, DataType > &data) const
Check lagrangian data fieldfield.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.