ESyS-Particle  2.3.4
TaggedEWallInteractionGroup.hpp
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 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.apache.org/licenses/LICENSE-2.0 //
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 
CWall
base class for all walls
Definition: Wall.h:40
CTaggedEWallInteractionGroup::m_mask
int m_mask
Definition: TaggedEWallInteractionGroup.h:35
CElasticWallInteraction
unbonded elastic interaction between a particle and a wall
Definition: EWallInteraction.h:31
CEWallInteractionGroup
Class for a group of unbonded,elastic interactions between particles and a wall.
Definition: EWallInteractionGroup.h:56
console.h
CEWallIGP
Interaction group parameters for CEWallInteractionGroups.
Definition: brokenEWallInteractionGroup.h:33
ParallelParticleArray::ParticleListIterator
NeighborTable< T >::particlelist::iterator ParticleListIterator
Definition: pp_array.h:80
ParallelParticleArray
parrallel particle storage array with neighborsearch and variable exchange
Definition: pp_array.h:75
Console::XDebug
Console & XDebug()
set verbose level of next message to "xdg"
ParallelParticleArray::getParticlesAtPlane
ParticleListHandle getParticlesAtPlane(Vec3 o, Vec3 n)
Get list of particles along a plane. Forwards to NTable::getParticlesAtPlane.
Definition: pp_array.h:191
T_Handle
Template class for a handle/ref. counted pointer.
Definition: handle.h:27
ParallelParticleArray::isInInner
virtual bool isInInner(const Vec3 &)
Definition: pp_array.hpp:208
esys::lsm::bpu::iter
boost::python::object iter(const boost::python::object &pyOb)
Definition: Util.h:25
CTaggedEWallInteractionGroup::m_tag
int m_tag
Definition: TaggedEWallInteractionGroup.h:34
TML_Comm
abstract base class for communicator
Definition: comm.h:47
CTaggedEWallInteractionGroup::CTaggedEWallInteractionGroup
CTaggedEWallInteractionGroup(TML_Comm *)
Definition: TaggedEWallInteractionGroup.hpp:21
console
Console console
Definition: console.cpp:25
CTaggedEWallInteractionGroup::Update
virtual void Update(ParallelParticleArray< T > *)
Definition: TaggedEWallInteractionGroup.hpp:50