ESyS-Particle  2.3.4
mesh2d_pis_eb.h
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 #ifndef __MESH2D_PIS_EB_H
14 #define __MESH2D_PIS_EB_H
15 
16 #include "tml/comm/cart_comm.h"
17 #include "pis/mesh2d_pis.h"
18 #include <vector>
19 
25 template<class ParticleType,class IType>
26 class Mesh2D_PIS_EB : public Mesh2D_PIS<ParticleType>
27 {
28  private:
29  static const int m_edge_exchg_tag;
30  static const int m_corner_exchg_tag;
31  void exchange_boundary(int,int);
32 
33  protected:
34  typename IType::ParameterType m_param;
35 
37  std::set<pair<int,int> > m_edge_int_set; // for isIn, <edge ID,particle ID> pairs
38  std::set<pair<int,int> > m_corner_int_set; // for isIn, <corner ID,particle ID> pairs
39 
40  std::list<typename IType::TriIntType> m_edge_interactions;
41  std::list<typename IType::CornerIntType> m_corner_interactions;
42 
43  public:
44 
45  // --- iterator class ===
47  public:
48  typedef typename IType::TriIntType Interaction;
49  typedef typename list<Interaction>::iterator Iterator;
50 
52 
53  bool hasNext();
54 
55  Interaction &next();
56 
57  int getNumRemaining();
58 
59  protected:
60  bool isInner(const Iterator &it);
61 
62  private:
67  };
68 
69  // --- member functions ---
70  Mesh2D_PIS_EB(Mesh2D*,ParallelParticleArray<ParticleType>*,typename IType::ParameterType);
71 
72  virtual bool isIn(const vector<int>&);
73  virtual void setTimeStepSize(double dt);
74  virtual void calcForces();
75  virtual bool update();
76  virtual void exchange();
77  virtual void rebuild();
78  virtual void tryInsert(const typename IType::TriIntType&);
79  virtual void tryInsert(const typename IType::CornerIntType&);
80  virtual void tryInsert(const vector<int>&);
81 
83 
84  void buildFromPPATagged(int,int);
85  void buildFromPPAByGap(double);
86 
87  virtual void saveSnapShotData(std::ostream&);
88  virtual void saveCheckPointData(std::ostream&);
89  virtual void loadCheckPointData(std::istream&);
90 };
91 
92 #include "pis/mesh2d_pis_eb.hpp"
93 
94 #endif //__MESH2D_PIS_EB_H
Mesh2D_PIS_EB::InteractionIterator::Interaction
IType::TriIntType Interaction
Definition: mesh2d_pis_eb.h:48
Mesh2D_PIS_EB::calcForces
virtual void calcForces()
Definition: mesh2d_pis_eb.hpp:65
Mesh2D_PIS_EB::Mesh2D_PIS_EB
Mesh2D_PIS_EB(Mesh2D *, ParallelParticleArray< ParticleType > *, typename IType::ParameterType)
Definition: mesh2d_pis_eb.hpp:26
Mesh2D_PIS_EB::saveCheckPointData
virtual void saveCheckPointData(std::ostream &)
Definition: mesh2d_pis_eb.hpp:475
Mesh2D_PIS_EB::isIn
virtual bool isIn(const vector< int > &)
Definition: mesh2d_pis_eb.hpp:44
Mesh2D_PIS_EB::exchange
virtual void exchange()
Definition: mesh2d_pis_eb.hpp:130
Mesh2D_PIS_EB::InteractionIterator
Definition: mesh2d_pis_eb.h:46
Mesh2D_PIS_EB::m_edge_exchg_tag
static const int m_edge_exchg_tag
Definition: mesh2d_pis_eb.h:29
Mesh2D_PIS_EB::m_corner_exchg_tag
static const int m_corner_exchg_tag
Definition: mesh2d_pis_eb.h:30
Mesh2D_PIS_EB::m_corner_int_set
std::set< pair< int, int > > m_corner_int_set
Definition: mesh2d_pis_eb.h:38
Mesh2D_PIS_EB::InteractionIterator::InteractionIterator
InteractionIterator(Iterator begin, Iterator end, AParallelParticleArray *ppa)
Definition: mesh2d_pis_eb.hpp:498
Mesh2D
Definition: Mesh2D.h:47
Mesh2D_PIS_EB::m_param
IType::ParameterType m_param
Definition: mesh2d_pis_eb.h:34
Mesh2D_PIS_EB::saveSnapShotData
virtual void saveSnapShotData(std::ostream &)
Definition: mesh2d_pis_eb.hpp:460
Mesh2D_PIS_EB::InteractionIterator::m_it
Iterator m_it
Definition: mesh2d_pis_eb.h:64
Mesh2D_PIS_EB::InteractionIterator::Iterator
list< Interaction >::iterator Iterator
Definition: mesh2d_pis_eb.h:49
ParallelParticleArray
parrallel particle storage array with neighborsearch and variable exchange
Definition: pp_array.h:75
Mesh2D_PIS_EB::InteractionIterator::m_ppa
AParallelParticleArray * m_ppa
Definition: mesh2d_pis_eb.h:66
mesh2d_pis.h
Mesh2D_PIS_EB::InteractionIterator::m_end
Iterator m_end
Definition: mesh2d_pis_eb.h:65
Mesh2D_PIS_EB::m_edge_interactions
std::list< typename IType::TriIntType > m_edge_interactions
Definition: mesh2d_pis_eb.h:40
AParallelParticleArray
abstract base class for parallel particle storage array
Definition: pp_array.h:42
Mesh2D_PIS_EB::InteractionIterator::isInner
bool isInner(const Iterator &it)
Definition: mesh2d_pis_eb.hpp:540
cart_comm.h
TML_CartComm
class for a cartesian communicator
Definition: cart_comm.h:34
Mesh2D_PIS_EB::InteractionIterator::hasNext
bool hasNext()
Definition: mesh2d_pis_eb.hpp:516
Mesh2D_PIS_EB::m_corner_interactions
std::list< typename IType::CornerIntType > m_corner_interactions
Definition: mesh2d_pis_eb.h:41
Mesh2D_PIS_EB::loadCheckPointData
virtual void loadCheckPointData(std::istream &)
Definition: mesh2d_pis_eb.hpp:490
Mesh2D_PIS_EB::tryInsert
virtual void tryInsert(const typename IType::TriIntType &)
Definition: mesh2d_pis_eb.hpp:261
Mesh2D_PIS_EB::update
virtual bool update()
Definition: mesh2d_pis_eb.hpp:87
Mesh2D_PIS_EB
Class for parallel storage of interactions between a 2D mesh and particles which does require exchang...
Definition: mesh2d_pis_eb.h:27
Mesh2D_PIS_EB::InteractionIterator::getNumRemaining
int getNumRemaining()
Definition: mesh2d_pis_eb.hpp:534
Mesh2D_PIS_EB::setTimeStepSize
virtual void setTimeStepSize(double dt)
Definition: mesh2d_pis_eb.hpp:205
Mesh2D_PIS_EB::buildFromPPATagged
void buildFromPPATagged(int, int)
Definition: mesh2d_pis_eb.hpp:357
Mesh2D_PIS_EB::getInnerInteractionIterator
InteractionIterator getInnerInteractionIterator()
Definition: mesh2d_pis_eb.hpp:449
Mesh2D_PIS_EB::exchange_boundary
void exchange_boundary(int, int)
Definition: mesh2d_pis_eb.hpp:151
Mesh2D_PIS_EB::InteractionIterator::m_numRemaining
int m_numRemaining
Definition: mesh2d_pis_eb.h:63
Mesh2D_PIS_EB::m_edge_int_set
std::set< pair< int, int > > m_edge_int_set
Definition: mesh2d_pis_eb.h:37
Mesh2D_PIS_EB::InteractionIterator::next
Interaction & next()
Definition: mesh2d_pis_eb.hpp:522
mesh2d_pis_eb.hpp
Mesh2D_PIS_EB::rebuild
virtual void rebuild()
Definition: mesh2d_pis_eb.hpp:215
Mesh2D_PIS_EB::buildFromPPAByGap
void buildFromPPAByGap(double)
Definition: mesh2d_pis_eb.hpp:405
Mesh2D_PIS
Abstract base class for parallel storage of interactions between a 2D mesh and particles.
Definition: mesh2d_pis.h:37
Mesh2D_PIS_EB::m_comm
TML_CartComm m_comm
Definition: mesh2d_pis_eb.h:36