ESyS-Particle  2.3
StressTensorCollection.h
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 #ifndef ESYS_LSMSTRESSTENSORCOLLECTION_H
15 #define ESYS_LSMSTRESSTENSORCOLLECTION_H
16 
17 #include "Foundation/vec3.h"
18 #include "Foundation/Matrix3.h"
19 #include "Foundation/StlIterator.h"
21 
22 #include <vector>
23 #include <map>
24 
25 namespace esys
26 {
27  namespace lsm
28  {
29  template <typename TmplStressTensorCalculator>
31  {
32  public:
33  typedef TmplStressTensorCalculator StressCalculator;
34  typedef std::vector<StressTensor> StressTensorVector;
36 
37  StressTensorCollection(StressCalculator &stressCalculator)
39  m_pStressCalculator(&stressCalculator)
40  {
41  }
42 
43  template <typename TmplContactIterator>
44  void addContactIterator(TmplContactIterator it)
45  {
46  m_stressTensorVector.push_back(m_pStressCalculator->calculate(it));
47  }
48 
49  template <typename TmplContactIteratorIterator>
50  void addContactIterators(TmplContactIteratorIterator it)
51  {
52  while (it.hasNext())
53  {
54  addContactIterator(it.next());
55  }
56  }
57 
58  StressTensorIterator getIterator()
59  {
61  }
62 
63  int size() const
64  {
65  return m_stressTensorVector.size();
66  }
67 
68  private:
69  StressTensorVector m_stressTensorVector;
70  StressCalculator *m_pStressCalculator;
71  };
72  }
73 }
74 
75 #endif
Definition: StressTensorCollection.h:30
StressCalculator * m_pStressCalculator
Definition: StressTensorCollection.h:70
std::vector< StressTensor > StressTensorVector
Definition: StressTensorCollection.h:34
StressTensorVector m_stressTensorVector
Definition: StressTensorCollection.h:69
int size() const
Definition: StressTensorCollection.h:63
Definition: CheckPointable.cpp:16
void addContactIterators(TmplContactIteratorIterator it)
Definition: StressTensorCollection.h:50
void addContactIterator(TmplContactIterator it)
Definition: StressTensorCollection.h:44
Definition: StlIterator.h:29
StressTensorIterator getIterator()
Definition: StressTensorCollection.h:58
StressTensorCollection(StressCalculator &stressCalculator)
Definition: StressTensorCollection.h:37
TmplStressTensorCalculator StressCalculator
Definition: StressTensorCollection.h:33
ForwardIterator< StressTensorVector > StressTensorIterator
Definition: StressTensorCollection.h:35