Go to the documentation of this file.
34 for(
const auto& nm:names)
36 if(!names_.insertIf(nm, i))
39 " repeated name in the list of sphere names: " << names;
46 numShapes_ = names_.size();
61 if(diameters_.size() != materials_.
size() )
64 " number of elements in diameters and properties are not the same in "<< dict.
globalName()<<
endl;
67 else if(diameters_.size() != names.
size() )
70 " number of elements in diameters and names are not the same in "<< dict.
globalName()<<
endl;
74 if( !insertNames(names) )
77 " error in reading dictionary "<< dict.
globalName();
90 if( !dict.
add(
"diamters", diameters_) )
93 " Error in writing diameters to dictionary "<< dict.
globalName()<<
endl;
97 if( !dict.
add(
"properties", materials_) )
100 " Error in writing properties to dictionary "<< dict.
globalName()<<
endl;
104 size_t n = names_.size();
115 if( !dict.
add(
"names", names) )
118 " Error in writing names to dictionary "<< dict.
globalName()<<
endl;
134 diameters_(diameter),
137 if( !insertNames( name) )
151 for(
const auto& nm:names)
153 if(!nameToIndex(nm, idx))
156 " invalid shape name requested "<< nm <<
endl;
159 diams.push_back(diameters_[idx]);
171 if( !sphereDict.
read(is) )
191 if( !writeDictionary(sphereDict))
196 if( !sphereDict.
write(os) )
199 " error in writing dictionray to file. \n";
const char * sphereShapeFile__
virtual bool write(iOstream &os) const
virtual bool read(iIstream &is)
bool write(iOstream &os) const
virtual word globalName() const
bool add(const word &keyword, const float &v)
iOstream & endl(iOstream &os)
#define fatalErrorInFunction
bool writeDictionary(dictionary &dict) const
virtual const word & name() const
T getVal(const word &keyword) const
property holds the pure properties of materials.
#define ioErrorInFile(fileName, lineNumber)
bool insertNames(const wordVector &names)
bool readDictionary(const dictionary &dict)
bool shapeToDiameter(wordVector &names, realVector &diams) const