ESyS-Particle  2.3
InteractionToStressConverter.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_LSMINTERACTIONTOSTRESSCONVERTOR_H
15 #define ESYS_LSMINTERACTIONTOSTRESSCONVERTOR_H
16 
22 
23 #include "Foundation/BoundingBox.h"
24 
25 #include <iostream>
26 #include <iomanip>
27 
28 namespace std
29 {
30  template <>
31  struct less<Vec3>
32  {
33  bool operator()(const Vec3 &v1, const Vec3 &v2) const
34  {
35  return esys::lsm::Vec3XyzComparer()(v1, v2);
36  }
37  };
38 }
39 
40 namespace esys
41 {
42  namespace lsm
43  {
47 
49  {
50  public:
53 
54  InteractionToStressConverter(const BoundingBox &box, double gridSpacing);
55 
60  void addRaw2Interactions(std::istream &iStream);
61 
66  void writeVtkUnstructuredXml(std::ostream &oStream);
67 
68  void writeVtkUnstructuredXmlGridInformation(std::ostream &oStream);
69 
81  void writeVtkStructuredXml(std::ostream &oStream);
82 
83  StressTensorPtrGrid &getTensorIrregularGrid();
85 
96  TensorGrid &getTensorRegularGrid();
97 
98  void calcTensorRegularGrid();
99 
112  DoubleGrid &getDevRegularGrid();
113 
114  void calcDevRegularGrid();
115 
124  void writeFlatStructured(std::ostream &oStream);
125 
135  (
136  std::ostream &oStream
137  );
138 
145  void writeUnstructuredDx(std::ostream &oStream);
146 
147  double getMaxRadius();
148 
149  protected:
150  double getRealDevStress(const Tensor &stressTensor) const;
151  double getNormDevStress(const Tensor &stressTensor) const;
152 
153  bool is3d() const;
154 
155  private:
158  StressTensorCalculator m_stressCalculator;
159  StressTensCollection m_stressTensorCollection;
160  TensorGrid m_regTensorGrid;
161  DoubleGrid m_regDevStressGrid;
162  StressTensorPtrGrid m_irrStressTensorGrid;
163  };
164  }
165 }
166 #endif
void calcDevRegularGrid()
Definition: InteractionToStressConverter.cpp:477
void calcTensorIrregularGrid()
Definition: InteractionToStressConverter.cpp:380
Definition: vec3.h:46
void writeVtkUnstructuredXmlGridInformation(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:267
void writeVtkStructuredXml(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:497
Definition: Contact.h:101
double getMaxRadius()
Definition: InteractionToStressConverter.cpp:364
Definition: CheckPointable.cpp:16
BoundingBox m_bBox
Definition: InteractionToStressConverter.h:157
bool operator()(const Vec3 &v1, const Vec3 &v2) const
Definition: InteractionToStressConverter.h:33
StressTensorPtrGrid m_irrStressTensorGrid
Definition: InteractionToStressConverter.h:162
CartesianGrid< Tensor > TensorGrid
Definition: InteractionToStressConverter.h:46
3D bounding box
Definition: BoundingBox.h:27
StressTensorPtrGrid & getTensorIrregularGrid()
Definition: InteractionToStressConverter.cpp:355
StressTensorCollection< ContactPtTensorCalculator > StressTensCollection
Definition: InteractionToStressConverter.h:51
TensorGrid m_regTensorGrid
Definition: InteractionToStressConverter.h:160
DoubleGrid m_regDevStressGrid
Definition: InteractionToStressConverter.h:161
double getRealDevStress(const Tensor &stressTensor) const
Definition: InteractionToStressConverter.cpp:186
TensorGrid & getTensorRegularGrid()
Definition: InteractionToStressConverter.cpp:391
void writeUnstructuredDx(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:299
Definition: Vec3Comparer.h:23
bool is3d() const
Definition: InteractionToStressConverter.cpp:226
Definition: InteractionToStressConverter.h:48
StressTensCollection m_stressTensorCollection
Definition: InteractionToStressConverter.h:159
void writeVtkUnstructuredXml(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:240
CartesianGrid< StressTensor * > StressTensorPtrGrid
Definition: InteractionToStressConverter.h:45
void writeFlatStructured(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:526
void addRaw2Interactions(std::istream &iStream)
Definition: InteractionToStressConverter.cpp:231
double getNormDevStress(const Tensor &stressTensor) const
Definition: InteractionToStressConverter.cpp:211
DoubleGrid & getDevRegularGrid()
Definition: InteractionToStressConverter.cpp:468
double m_gridSpacing
Definition: InteractionToStressConverter.h:156
InteractionToStressConverter(const BoundingBox &box, double gridSpacing)
Definition: InteractionToStressConverter.cpp:175
TmplStressTensorCalculator StressCalculator
Definition: StressTensorCollection.h:33
CartesianGrid< double > DoubleGrid
Definition: InteractionToStressConverter.h:44
StressTensorCalculator m_stressCalculator
Definition: InteractionToStressConverter.h:158
void writeFlatUnstructured(std::ostream &oStream)
Definition: InteractionToStressConverter.cpp:319
Definition: StressTensor.h:29
void calcTensorRegularGrid()
Definition: InteractionToStressConverter.cpp:425
StressTensCollection::StressCalculator StressTensorCalculator
Definition: InteractionToStressConverter.h:52