ESyS-Particle  2.3.4
pi_storage_single.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 #include "Foundation/console.h"
14 
15 template<typename P,typename I>
17 {
18  m_param=param;
19 }
20 
21 template<typename P,typename I>
23 {
24  console.XDebug() << "CDampingGroup<T>::Update()\n" ;
25  // empty particle list first
26  this->m_interactions.erase(
27  this->m_interactions.begin(),
28  this->m_interactions.end()
29  );
30  // build new particle list
32  ((ParallelParticleArray<P>*)this->m_ppa)->getAllParticles();
33  for(
35  iter!=plh->end();
36  iter++
37  ){
38  this->m_interactions.push_back(I(*iter,&m_param));
39  }
40  console.XDebug() << "end CDampingGroup<T>::Update()\n" ;
41 
42  return true;
43 }
44 
45 
46 template<typename P,typename InteractionType>
48 {
49  console.Debug()
50  << "calculating "
51  << this->m_interactions.size()
52  << " damping forces\n" ;
53 
54  for(
55  typename std::list<InteractionType>::iterator it = this->m_interactions.begin();
56  it != this->m_interactions.end();
57  it++
58  ){
59  it->calcForces();
60  }
61 }
62 
63 template<typename P,typename InteractionType>
64 void
66  double dt
67 )
68 {
69  console.Debug()
70  << "Setting time step size for "
71  << this->m_interactions.size()
72  << " damping forces\n";
73 
74  m_param.setTimeStepSize(dt);
75  for (
76  typename std::list<InteractionType>::iterator it = this->m_interactions.begin();
77  it != this->m_interactions.end();
78  it++
79  ){
80  it->setTimeStepSize(dt);
81  }
82 }
ParallelInteractionStorage_Single::setTimeStepSize
virtual void setTimeStepSize(double dt)
Definition: pi_storage_single.hpp:65
Console::Debug
Console & Debug()
set verbose level of next message to "dbg"
console.h
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"
AParallelParticleArray
abstract base class for parallel particle storage array
Definition: pp_array.h:42
T_Handle
Template class for a handle/ref. counted pointer.
Definition: handle.h:27
ParallelInteractionStorage_Single::update
virtual bool update()
Definition: pi_storage_single.hpp:22
TParallelInteractionStorage
templated abstract base class for parallel interaction storage array. Adds the vector of interactions...
Definition: pi_storage.h:91
esys::lsm::bpu::iter
boost::python::object iter(const boost::python::object &pyOb)
Definition: Util.h:25
ParallelInteractionStorage_Single::calcForces
virtual void calcForces()
Definition: pi_storage_single.hpp:47
ParallelInteractionStorage_Single::ParallelInteractionStorage_Single
ParallelInteractionStorage_Single(AParallelParticleArray *, const typename I::ParameterType &)
Definition: pi_storage_single.hpp:16
ParallelInteractionStorage_Single::m_param
I::ParameterType m_param
Definition: pi_storage_single.h:29
console
Console console
Definition: console.cpp:25