23 template<
typename ShapeType>
30 if(!insertion::writeInsertionDict(dict))
return false;
32 if( !this->isActive() )
return true;
38 if( !regions_[i].write(rgnDict) )
41 "Error in writing to dictionary "<<rgnDict.globalName()<<
endl;
49 template<
typename ShapeType>
55 if( !this->isActive() )
60 wordList regionDicNames = this->dictionaryKeywords();
62 for(
const auto& name:regionDicNames)
76 template<
typename ShapeType>
79 const ShapeType& shapes)
110 template<
typename ShapeType>
118 if(!isActive())
return true;
123 bool insertionOccured =
false;
124 auto& rgn = regions_[i];
125 if( rgn.insertionTime(iter, t, dt) )
130 if( rgn.insertParticles(iter, t, dt, shapes, pos, insertionOccured) )
139 if(!Particles().insertParticles(pos, shapes, rgn.setFieldList()))
142 " Cannot add "<< pos.
size() <<
" particles from region "<< rgn.name() <<
146 REPORT(1)<<
"Total number of particles inserted from this region is "<<
159 WARNING<<
"\n fewer number of particles are inserted from region "<< rgn.name() <<
160 " than expected. You may stop the simulation to change settings."<<
END_WARNING;
161 if(!Particles().insertParticles(pos, shapes, rgn.setFieldList()))
164 " Cannot add "<< pos.
size() <<
" particles from region "<< rgn.name() <<
172 " error in inserting particles from region "<< rgn.name()<<
endl;