ESyS-Particle  4.0.1
SoftBWallInteractionGroup.hpp
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 //----------------------------------------------
14 // CSoftBWallInteractionGroup functions
15 //----------------------------------------------
16 
17 #include "Foundation/console.h"
18 
19 template<class T>
21 {}
22 
30 template<class T>
32  : AWallInteractionGroup<T>(comm)
33 {
34  console.XDebug() << "making CSoftBWallInteractionGroup \n";
35 
36  m_normalK=I->getNormalK();
37  m_shearK=I->getShearK();
38  this->m_wall=wallp;
39  m_tag=I->getTag();
40  m_scaling=I->getScaling();
41 // console.XDebug() << "kx, ky, kz: " << m_kx << ","<< m_ky << ","<< m_kz << "\n";
42 }
43 
44 template<class T>
46 {
47 
48  console.XDebug() << "calculating " << m_interactions.size() << " soft bonded wall forces\n" ;
49 
50  for(
51  typename vector<CSoftBondedWallInteraction<T> >::iterator it=m_interactions.begin();
52  it != m_interactions.end();
53  it++
54  ){
55  it->calcForces();
56  }
57 }
58 
59 template<class T>
61 {
62 
63  console.XDebug() << "CSoftBWallInteractionGroup::Update()\n" ;
64 
65  // empty particle list first
66  m_interactions.erase(m_interactions.begin(),m_interactions.end());
67  // build new particle list
68  typename ParallelParticleArray<T>::ParticleListHandle plh=
69  PPA->getParticlesAtPlane(this->m_wall->getOrigin(),this->m_wall->getNormal());
70  for(typename ParallelParticleArray<T>::ParticleListIterator iter=plh->begin();
71  iter!=plh->end();
72  iter++){
73  if((*iter)->getTag()==m_tag){
74  bool iflag=PPA->isInInner((*iter)->getPos());
75  m_interactions.push_back(CSoftBondedWallInteraction<T>(*iter,this->m_wall,m_normalK,m_shearK,m_scaling,iflag));
76  }
77  }
78  console.XDebug() << "end CSoftBWallInteractionGroup::Update()\n";
79 }
80 
81 template<class T>
82 ostream& operator<<(ostream& ost,const CSoftBWallInteractionGroup<T>& IG)
83 {
84  ost << "CBWallInteractionGroup" << endl << flush;
85  ost << *(IG.m_wall) << endl << flush;
86 
87  return ost;
88 }