13 template<
typename P,
typename I>
19 template<
typename P,
typename InteractionType>
25 typename list<InteractionType>::iterator
iter = this->m_interactions.begin();
26 while(
iter != this->m_interactions.end()){
28 vector<int> rm_pids=
iter->getAllID();
29 if(eg->
isIn(rm_pids)){
30 console.
XDebug() <<
"removing excluded: " << rm_pids[0] <<
" - " << rm_pids[1] <<
"\n";
31 typename list<InteractionType>::iterator er_iter=
iter;
33 this->m_set.erase(make_pair(rm_pids[0],rm_pids[1]));
35 this->m_interactions.erase(er_iter);
48 template<
typename T,
typename InteractionType>
53 vector<AParallelInteractionStorage*>::iterator exiter=m_exIG.begin();
54 while(exiter!=m_exIG.end() && (!in_exig)){
55 in_exig=(*exiter)->isIn(tv);
62 template<
typename T,
typename InteractionType>
68 <<
"setting time step size for "
69 << this->m_interactions.size() <<
" interaction forces\n" ;
70 this->m_param.setTimeStepSize(dt);
72 typename std::list<InteractionType>::iterator it = this->m_interactions.begin();
73 it != this->m_interactions.end();
76 it->setTimeStepSize(dt);
83 template<
typename T,
typename InteractionType>
90 if (this->m_update_timestamp != this->m_ppa->getTimeStamp()){
91 console.
XDebug() <<
"node " << this->m_comm.rank() <<
" ppa has been rebuilt\n";
93 typename list<InteractionType>::iterator
iter = this->m_interactions.begin();
94 while(
iter != this->m_interactions.end()){
95 if(
iter->isPersistent()){
99 typename list<InteractionType>::iterator er_iter=
iter;
101 vector<int> rm_pids=
iter->getAllID();
102 this->m_set.erase(make_pair(rm_pids[0],rm_pids[1]));
104 this->m_interactions.erase(er_iter);
117 int id1=
iter->first->getID();
118 int id2=
iter->second->getID();
121 if((!isExcluded(tv))&&(!this->isIn(tv))){
122 this->m_interactions.push_back(
123 InteractionType(
iter->first,
iter->second,this->m_param)
125 this->m_set.insert(make_pair(id1,id2));
130 console.
XDebug() <<
"node " << this->m_comm.rank() <<
" ppa not rebuilt\n";
142 int id1=
iter->first->getID();
143 int id2=
iter->second->getID();
146 if((!isExcluded(tv))&&(!this->isIn(tv))){
147 this->m_interactions.push_back(
148 InteractionType(
iter->first,
iter->second, this->m_param)
150 this->m_set.insert(make_pair(id1,id2));
155 m_update_timestamp = this->m_ppa->getTimeStamp();
157 console.
Debug() <<
"added " << count_l <<
" pairs to ParallelInteractionStorage_ED\n";
164 template<
typename T,
typename InteractionType>
169 << this->m_interactions.size()
170 <<
" frictional heatings\n" ;
173 typename list<InteractionType>::iterator it = this->m_interactions.begin();
174 it != this->m_interactions.end();
181 template<
typename P,
typename InteractionType>
186 << this->m_interactions.size()
187 <<
" heat transfers\n" ;
190 typename list<InteractionType>::iterator it = this->m_interactions.begin();
191 it != this->m_interactions.end();
201 template<
typename P,
typename InteractionType>
204 const std::string delim =
"\n";
207 this->getInnerInteractionIterator();
208 oStream << InteractionType::getType() << delim;
212 it.
next().saveRestartData(oStream);
216 it.
next().saveRestartData(oStream);
228 template<
typename P,
typename InteractionType>
232 std::string cp_interaction_type;
233 iStream >> cp_interaction_type;
236 if(cp_interaction_type!=InteractionType::getType()){
237 std::cerr <<
"interaction types differ between checkpoint "
238 << cp_interaction_type <<
" and scipt "
239 << InteractionType::getType() << std::endl;
244 std::cerr <<
"reading " << nconn <<
" " << InteractionType::getType() <<
" interactions " << std::endl;
247 for(
int i=0;i<nconn;i++){
248 InteractionType new_bond;
250 new_bond.loadRestartData(iStream);
252 this->tryInsert(new_bond);