Go to the documentation of this file.
21 template<
typename ShapeType>
27 if(!insertion::readInsertionDict(dict))
return false;
31 if( !this->isActive() )
38 for(
auto& name:regionDicNames)
41 regions_.push_backSafe(dict.
subDict(name), shapes_);
47 template<
typename ShapeType>
53 if( !insertion::writeInsertionDict(dict) )
return false;
55 if( !this->isActive() )
return true;
61 if( !regions_[i].write(rgnDict) )
70 template<
typename ShapeType>
73 const ShapeType& shapes)
82 template<
typename ShapeType>
86 const ShapeType& shapes)
101 template<
typename ShapeType>
108 if(!isActive())
return true;
113 bool insertionOccured =
false;
114 auto& rgn = regions_[i];
115 if( rgn.insertionTime(currentTime, dt) )
120 if( rgn.insertParticles(currentTime, dt, shapes, pos, insertionOccured) )
129 if(!particles_.insertParticles(pos, shapes, rgn.setFields()))
132 " Cannot add "<< pos.
size() <<
" particles from region "<< rgn.name() <<
136 REPORT(1)<<
"Total number of particles inserted from this region is "<<
149 yWARNING<<
"\n fewer number of particles are inserted from region "<< rgn.name() <<
150 " than expected. You may stop the simulation to change settings."<<
endyWARNING;
156 " error in inserting particles from region "<< rgn.name()<<
endl;
169 template<
typename ShapeType>
186 if(!readInsertionDict(dict))
196 template<
typename ShapeType>
205 if(! writeInsertionDict(dict) )
212 if( !dict.
write(os) )
215 " erro in writing to "<< os.
name()<<
endl;
bool insertParticles(real currentTime, real dt)
const char * insertionFile__
virtual bool read(iIstream &is) override
virtual bool write(iOstream &os) const
Insertion(particles &prtcl, const ShapeType &shapes)
virtual bool read(iIstream &is)
virtual word globalName() const
dictionary & subDictOrCreate(const word &keyword)
iOstream & endl(iOstream &os)
wordList dictionaryKeywords() const
virtual bool write(iOstream &os) const override
#define fatalErrorInFunction
#define ForAll(i, container)
bool writeInsertionDict(dictionary &dict) const
virtual const word & name() const
dictionary & subDict(const word &keyword)
bool readInsertionDict(const dictionary &dict)
#define ioErrorInFile(fileName, lineNumber)