13 template<
typename P,
typename I>
20 template<
typename P,
typename InteractionType>
23 console.
Debug() <<
"setExIG " << eg <<
"\n";
26 typename list<InteractionType>::iterator iter = this->m_interactions.begin();
27 while(iter != this->m_interactions.end()){
29 vector<int> rm_pids=iter->getAllID();
30 if(m_exIG->isIn(rm_pids)){
31 console.
XDebug() <<
"removing excluded: " << rm_pids[0] <<
" - " << rm_pids[1] <<
"\n";
32 typename list<InteractionType>::iterator er_iter=iter;
34 this->m_set.erase(make_pair(rm_pids[0],rm_pids[1]));
36 this->m_interactions.erase(er_iter);
43 template<
typename T,
typename InteractionType>
49 <<
"setting time step size for "
50 << this->m_interactions.size() <<
" interaction forces\n" ;
51 this->m_param.setTimeStepSize(dt);
53 typename std::list<InteractionType>::iterator it = this->m_interactions.begin();
54 it != this->m_interactions.end();
57 it->setTimeStepSize(dt);
64 template<
typename T,
typename InteractionType>
71 if (this->m_update_timestamp != this->m_ppa->getTimeStamp()){
72 console.
XDebug() <<
"node " << this->m_comm.rank() <<
" ppa has been rebuilt\n";
74 typename list<InteractionType>::iterator iter = this->m_interactions.begin();
75 while(iter != this->m_interactions.end()){
76 if(iter->isPersistent()){
80 typename list<InteractionType>::iterator er_iter=iter;
82 vector<int> rm_pids=iter->getAllID();
83 this->m_set.erase(make_pair(rm_pids[0],rm_pids[1]));
85 this->m_interactions.erase(er_iter);
89 typename ParallelParticleArray<T>::PairListHandle plh =
92 for(
typename ParallelParticleArray<T>::PairListIterator iter=plh->begin();
98 int id1=iter->first->getID();
99 int id2=iter->second->getID();
103 if((!m_exIG->isIn(tv))&&(!this->isIn(tv))){
104 this->m_interactions.push_back(
105 InteractionType(iter->first,iter->second,this->m_param)
107 this->m_set.insert(make_pair(id1,id2));
110 }
else if (!(this->isIn(tv))) {
111 this->m_interactions.push_back(
112 InteractionType(iter->first,iter->second,this->m_param)
114 this->m_set.insert(make_pair(id1,id2));
118 console.
XDebug() <<
"node " << this->m_comm.rank() <<
" ppa not rebuilt\n";
120 typename ParallelParticleArray<T>::PairListHandle plh =
123 typename ParallelParticleArray<T>::PairListIterator iter=plh->begin();
130 int id1=iter->first->getID();
131 int id2=iter->second->getID();
135 if((!m_exIG->isIn(tv))&&(!(this->isIn(tv)))) {
136 this->m_interactions.push_back(
137 InteractionType(iter->first,iter->second, this->m_param)
139 this->m_set.insert(make_pair(id1,id2));
142 }
else if (!(this->isIn(tv))) {
143 this->m_interactions.push_back(
144 InteractionType(iter->first,iter->second,this->m_param)
146 this->m_set.insert(make_pair(id1,id2));
150 m_update_timestamp = this->m_ppa->getTimeStamp();
152 console.
Debug() <<
"added " << count_l <<
" pairs to ParallelInteractionStorage_ED\n";
159 template<
typename T,
typename InteractionType>
164 << this->m_interactions.size()
165 <<
" frictional heatings\n" ;
168 typename list<InteractionType>::iterator it = this->m_interactions.begin();
169 it != this->m_interactions.end();
176 template<
typename P,
typename InteractionType>
181 << this->m_interactions.size()
182 <<
" heat transfers\n" ;
185 typename list<InteractionType>::iterator it = this->m_interactions.begin();
186 it != this->m_interactions.end();
196 template<
typename P,
typename InteractionType>
199 const std::string delim =
"\n";
202 this->getInnerInteractionIterator();
203 oStream << InteractionType::getType() << delim;
204 oStream << it.getNumRemaining();
207 it.next().saveRestartData(oStream);
211 it.next().saveRestartData(oStream);
223 template<
typename P,
typename InteractionType>
227 std::string cp_interaction_type;
228 iStream >> cp_interaction_type;
231 if(cp_interaction_type!=InteractionType::getType()){
232 std::cerr <<
"interaction types differ between checkpoint "
233 << cp_interaction_type <<
" and scipt "
234 << InteractionType::getType() << std::endl;
239 std::cerr <<
"reading " << nconn <<
" " << InteractionType::getType() <<
" interactions " << std::endl;
242 for(
int i=0;i<nconn;i++){
243 InteractionType new_bond;
245 new_bond.loadRestartData(iStream);
247 this->tryInsert(new_bond);