ASL  0.1.6
Advanced Simulation Library
aslFDElasticity.h
Go to the documentation of this file.
1 /*
2  * Advanced Simulation Library <http://asl.org.il>
3  *
4  * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5  *
6  *
7  * This file is part of Advanced Simulation Library (ASL).
8  *
9  * ASL is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU Affero General Public License as
11  * published by the Free Software Foundation, version 3 of the License.
12  *
13  * ASL is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #ifndef ASLFDELASTICITY_H
25 #define ASLFDELASTICITY_H
26 
27 #include "aslNumMethod.h"
28 #include "acl/aclMath/aclVectorOfElementsDef.h"
29 
30 namespace acl{
31  class Kernel;
32  class VectorOfElementsData;
33 }
34 
35 namespace asl
36 {
37  class VectorTemplate;
38  class TemplateVE;
39 
40  template <typename V> class DataWithGhostNodes;
41  typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
43  typedef DataWithGhostNodes<acl::VectorOfElements> DataWithGhostNodesACL;
45 
46  namespace elasticity
47  {
48  acl::VectorOfElements strain(vector<TemplateVE> & displacment);
50 // VectorOfElements linearEqLaplasTerm(TemplateVE displacment);
51  }
52 
54  class ElasticityCommonA: public NumMethod
55  {
56  public:
57  typedef SPDataWithGhostNodesACLData Data;
59  protected:
60  std::unique_ptr<acl::Kernel> kernel;
61 
62  Data displacementData;
63  Data displacementInternalData;
64 
65  Param bulkModulus;
66  Param shearModulus;
67  Param force;
68  public:
69  const VectorTemplate* vectorTemplate;
70 
78  ElasticityCommonA(Data d, Param bM, Param sM, const VectorTemplate* vT);
80  void setVectorTemplate(const VectorTemplate* vT);
81  VectorTemplate getVectorTemplate();
82 
83  virtual void init()=0;
84  virtual void execute()=0;
85 
86  void setForce(Param f);
87  inline Data getDisplacementData() const;
88  inline Data getDisplacementInternalData() const;
89  inline const Param getBulkModulus() const;
90  inline const Param getShearModulus() const;
91  };
92 
94 
99  {
100  private:
101  Data pressure;
102  Data pressureInternalData;
103  public:
113 
114  virtual void init();
115  virtual void execute();
116 
117  inline Data getPressureData() const;
118  };
119 
121 
123 
128  {
129  private:
130  Data pressure;
131  Data pressureInternalData;
132  Param deltat;
133  Param dumpingFactor;
134  public:
143  FDElasticityRelaxation(Data d, Param bM, Param sM, Param dt, const VectorTemplate* vT);
145 
146  virtual void init();
147  virtual void execute();
148 
149  inline Data getPressureData() const;
150  inline Param getDeltat() const;
151  void setDumpingFactor(Param dumpF);
152  };
153 
155 
156 
158 
166  class FDElasticity2: public ElasticityCommonA
167  {
168  private:
169 // VData velocityData;
170  Param deltat;
171  Param dumpingFactor;
172  public:
173  FDElasticity2();
181  FDElasticity2(Data d, Param bM, Param sM,
182  Param dt, const VectorTemplate* vT);
183  ~FDElasticity2();
184 
185  virtual void init();
186  virtual void execute();
187 // inline VData getVelocityData() const;
188 
189  inline Param getDeltat() const;
190  void setDumpingFactor(Param dumpF);
191  };
192 
194 
196 
199  unsigned int nD(const ElasticityCommonA & e);
200 
201  SPFDElasticity2 generateFDElasticity(SPDataWithGhostNodesACLData d,
202  double bM,
203  double sM,
204  double dt,
205  const VectorTemplate* vT);
206 
207  SPFDElasticityIncompressibleStatic generateFDElasticityStatic(SPDataWithGhostNodesACLData d,
208  double bM,
209  double sM,
210  const VectorTemplate* vT);
211 
212  SPFDElasticityRelaxation generateFDElasticityRelax(SPDataWithGhostNodesACLData d,
213  double bM,
214  double sM,
215  double dt,
216  const VectorTemplate* vT);
217 
218 //-------------------------IMPLEMENTATION------------------------
219 
221  ElasticityCommonA::getDisplacementData() const
222  {
223  return displacementData;
224  }
225 
226  inline ElasticityCommonA::Data ElasticityCommonA::getDisplacementInternalData() const
227  {
228  return displacementInternalData;
229  }
230 
231  inline const ElasticityCommonA::Param
232  ElasticityCommonA::getBulkModulus() const
233  {
234  return bulkModulus;
235  }
236 
237  inline const ElasticityCommonA::Param
238  ElasticityCommonA::getShearModulus() const
239  {
240  return shearModulus;
241  }
242 
244  FDElasticityIncompressibleStatic::getPressureData() const
245  {
246  return pressure;
247  }
248 
250  FDElasticityRelaxation::getPressureData() const
251  {
252  return pressure;
253  }
254 
255  inline FDElasticity2::Param FDElasticity2::getDeltat() const
256  {
257  return deltat;
258  }
259 
260 } // asl
261 #endif // ASLFDELASTICITY_H
SPDataWithGhostNodesACLData Data
Numerical method which computes homogenious isotropic elasticity equation.
SPFDElasticity2 generateFDElasticity(SPDataWithGhostNodesACLData d, double bM, double sM, double dt, const VectorTemplate *vT)
acl::VectorOfElements stressLinear(acl::VectorOfElements &strain)
Advanced Simulation Library.
Definition: aslDataInc.h:30
Advanced Computational Language.
Definition: acl.h:40
Numerical method which computes homogenious isotropic elasticity equation.
acl::VectorOfElements Param
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
std::shared_ptr< FDElasticityIncompressibleStatic > SPFDElasticityIncompressibleStatic
abstract class for elasticity solver
const unsigned int nD(const Block &b)
Definition: aslBlocks.h:220
Numerical method which computes homogenious isotropic elasticity equation.
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
std::shared_ptr< FDElasticityRelaxation > SPFDElasticityRelaxation
std::shared_ptr< FDElasticity2 > SPFDElasticity2
SPFDElasticityIncompressibleStatic generateFDElasticityStatic(SPDataWithGhostNodesACLData d, double bM, double sM, const VectorTemplate *vT)
acl::VectorOfElements strain(vector< TemplateVE > &displacment)
The class represents several Element.
SPFDElasticityRelaxation generateFDElasticityRelax(SPDataWithGhostNodesACLData d, double bM, double sM, double dt, const VectorTemplate *vT)
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
Definition: aslGenerators.h:48
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
Definition: aslGenerators.h:49
Defines set of vectros with several properties.
Definition: aslTemplates.h:87