ESyS-Particle  2.3
TaggedEWallInteractionGroup.hpp
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
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 // CEWallInteractionGroup functions
15 //----------------------------------------------
16 
17 #include "Foundation/console.h"
18 #include <iostream>
19 
20 template<class T>
22 {}
23 
33 template<class T>
35  :CEWallInteractionGroup<T>(comm, wallp,I)
36 {
37  console.XDebug() << "making CTaggedEWallInteractionGroup \n";
38 
39  this->m_tag=tag;
40  this->m_mask=mask;
41 }
42 
49 template<class T>
51 {
52  console.XDebug() << "CTaggedEWallInteractionGroup::Update()\n" ;
53 
54  console.XDebug()
55  << "CTaggedEWallInteractionGroup::Update: wall origin = " << this->m_wall->getOrigin()
56  << ", wall normal = " << this->m_wall->getNormal() << "\n" ;
57 
58  this->k_local=0.0;
59  // empty particle list first
60  this->m_interactions.erase(this->m_interactions.begin(),this->m_interactions.end());
61  this->m_inner_count=0;
62  // build new particle list
64  PPA->getParticlesAtPlane(this->m_wall->getOrigin(),this->m_wall->getNormal());
65  for(typename ParallelParticleArray<T>::ParticleListIterator iter=plh->begin();
66  iter!=plh->end();
67  iter++){
68  int p_tag=(*iter)->getTag(); // get particle tag
69  if ((p_tag & this->m_mask) == (this->m_tag & this->m_mask)){ // check if particles have the right tag
70  bool iflag=PPA->isInInner((*iter)->getPos());
71  this->m_interactions.push_back(CElasticWallInteraction<T>(*iter,this->m_wall,this->m_k,iflag));
72  this->m_inner_count+=(iflag ? 1 : 0);
73  }
74  }
75  console.XDebug() << "found " << this->m_inner_count << " interactions\n";
76 
77  console.XDebug() << "end CTaggedEWallInteractionGroup::Update()\n";
78 }
79 
ParticleListHandle getParticlesAtPlane(Vec3 o, Vec3 n)
Get list of particles along a plane. Forwards to NTable::getParticlesAtPlane.
Definition: pp_array.h:191
virtual bool isInInner(const Vec3 &)
Definition: pp_array.hpp:208
int m_tag
Definition: TaggedEWallInteractionGroup.h:34
boost::python::object iter(const boost::python::object &pyOb)
Definition: Util.h:25
CTaggedEWallInteractionGroup(TML_Comm *)
Definition: TaggedEWallInteractionGroup.hpp:21
base class for all walls
Definition: Wall.h:39
parrallel particle storage array with neighborsearch and variable exchange
Definition: SubLattice.h:61
virtual void Update(ParallelParticleArray< T > *)
Definition: TaggedEWallInteractionGroup.hpp:50
Interaction group parameters for CEWallInteractionGroups.
Definition: brokenEWallInteractionGroup.h:32
int m_mask
Definition: TaggedEWallInteractionGroup.h:35
abstract base class for communicator
Definition: comm.h:46
BasicCon & XDebug(bool h=true)
set verbose level of next message to "xdg"
Definition: console.cpp:316
unbonded elastic interaction between a particle and a wall
Definition: EWallInteraction.h:30
Con console
Template class for a handle/ref. counted pointer.
Definition: handle.h:26
Class for a group of unbonded,elastic interactions between particles and a wall.
Definition: brokenEWallInteractionGroup.h:48
NeighborTable< T >::particlelist::iterator ParticleListIterator
Definition: pp_array.h:80