ESyS-Particle  4.0.1
SoftBWallInteractionGroup.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __SOFTBWALLINTERACTIONGROUP_H
00014 #define __SOFTBWALLINTERACTIONGROUP_H
00015 
00016 //--- project includes ---
00017 #include "Model/SoftBWallInteraction.h"
00018 #include "Model/WallIG.h"
00019 #include "Model/BWallInteractionGroup.h"
00020 
00021 //--- STL includes ---
00022 #include <map>
00023 
00024 using std::map;
00025 
00026 template <class T> class ParallelParticleArray;
00027 
00031 class CSoftBWallIGP : public CBWallIGP
00032 {
00033  protected:
00034   double m_shearK;
00035   bool m_scaling;
00036  public:
00037   CSoftBWallIGP(const std::string&,const std::string&,double,double,int,int,bool);
00038   virtual void  packInto(CVarMPIBuffer*) const;
00039   double getNormalK()const{return m_k;};
00040   double getShearK()const{return m_shearK;};
00041   bool getScaling()const{return m_scaling;};
00042 
00043   friend ostream& operator<<(ostream&,const CSoftBWallIGP&);
00044 };
00045 
00046 CSoftBWallIGP* extractSoftBWallIGP(AMPIBuffer*);
00047 
00048 // --- Forward decl ---
00049 template <class T> class CSoftBWallInteractionGroup;
00050 template <class T> ostream& operator<<(ostream &, const CSoftBWallInteractionGroup<T> &);
00051 
00052 
00057 template<class T>
00058 class CSoftBWallInteractionGroup : public AWallInteractionGroup<T>
00059 {
00060  protected:
00061   vector<CSoftBondedWallInteraction<T> > m_interactions;
00062   double m_normalK,m_shearK; 
00063   int m_tag;
00064   bool m_scaling;
00065 
00066  public:
00067   CSoftBWallInteractionGroup(TML_Comm*);
00068   CSoftBWallInteractionGroup(TML_Comm*,CWall*,const CSoftBWallIGP*);
00069   virtual ~CSoftBWallInteractionGroup(){}
00070 
00074   virtual void setTimeStepSize(double dt)
00075   {
00076   }
00077 
00078   virtual void calcForces();
00079   virtual void Update(ParallelParticleArray<T>*);
00080 
00081   friend ostream& operator<< <>(ostream &, const CSoftBWallInteractionGroup &);
00082 };
00083 
00084 #include  "SoftBWallInteractionGroup.hpp"
00085 
00086 #endif //__BSOFTWALLINTERACTIONGROUP_H