KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
pfem_particle.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3 Kratos
4 A General Purpose Software for Multi-Physics Finite Element Analysis
5 Version 1.0 (Released on march 05, 2007).
6 
7 Copyright 2007
8 Pooyan Dadvand, Riccardo Rossi
9 pooyan@cimne.upc.edu
10 rrossi@cimne.upc.edu
11 CIMNE (International Center for Numerical Methods in Engineering),
12 Gran Capita' s/n, 08034 Barcelona, Spain
13 
14 Permission is hereby granted, free of charge, to any person obtaining
15 a copy of this software and associated documentation files (the
16 "Software"), to deal in the Software without restriction, including
17 without limitation the rights to use, copy, modify, merge, publish,
18 distribute, sublicense and/or sell copies of the Software, and to
19 permit persons to whom the Software is furnished to do so, subject to
20 the following condition:
21 
22 Distribution of this code for any commercial purpose is permissible
23 ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNER.
24 
25 The above copyright notice and this permission notice shall be
26 included in all copies or substantial portions of the Software.
27 
28 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
31 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
32 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
33 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
34 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 
36 ==============================================================================
37 */
38 
39 //
40 // Project Name: Kratos
41 // Last Modified by: $Author: pablo $
42 // Date: $Date: 2013-03-05 11:34:12 $
43 // Revision: $Revision: 1.5 $
44 //
45 //
46 
47 
48 #if !defined(KRATOS_PFEM_PARTICLE_H_INCLUDED )
49 #define KRATOS_PFEM_PARTICLE_H_INCLUDED
50 
51 
52 
53 // System includes
54 #include <string>
55 #include <iostream>
56 #include <sstream>
57 #include <cstddef>
58 
59 
60 
61 // External includes
62 
63 
64 // Project includes
65 #include "includes/define.h"
66 #include "containers/array_1d.h"
67 #include "includes/serializer.h"
68 #include "geometries/point.h"
69 #include "includes/model_part.h"
70 
71 
72 namespace Kratos
73 {
74 
77 
81 
85 
89 
93 
95 
96 /*
97 @see Geometry
98 @see Node
99 @see IntegrationPoint
100 */
101 //template<std::size_t TDimension, class TDataType = double> //always size 3!
102 class PFEM_Particle : public Point
103 {
104 public:
107 
110 
111  typedef double TDataType;
112 
114 
115  typedef Point Type;
116 
118 
119  typedef std::size_t SizeType;
120 
121  typedef std::size_t IndexType;
122 
126 
130 
132  PFEM_Particle(TDataType const& NewX, TDataType const& NewY, TDataType const& NewZ) : Point(NewX, NewY, NewZ)
133  {
134  this->ERASE_FLAG=true; //initializing as useless particle
135  this->VELOCITY=ZeroVector(3);
136  this->ACCELERATION=ZeroVector(3);
137  this->DISTANCE=0.0;
138  this->PRESSURE=0.0;
139  this->OLD_PRESSURE=0.0;
140  this->PLASTIC_PRESSURE=0.0;
141  this->TEMPERATURE=0.0;
142  this->SHEAR_MODULUS=0.0;
143  this->BULK_MODULUS=0.0;
144  this->COHESION=0.0;
145  this->THETA=0.0;
146  this->DENSITY=0.0;
147  this->TOTAL_PLASTIC_DEFORMATION=ZeroVector(6);
148  this->OLD_TOTAL_PLASTIC_DEFORMATION=ZeroVector(6);
149  this->OLD_SIGMA=ZeroVector(6);
150  this->SIGMA=ZeroVector(6);
151  this->HAS_UPDATED_STRESSES=false;
152  this->PLASTICIZED=false;
153  }
154 
155  PFEM_Particle() : Point(0.0, 0.0, 0.0)
156  {
157  this->ERASE_FLAG=true;
158  this->VELOCITY=ZeroVector(3);
159  this->ACCELERATION=ZeroVector(3);
160  this->DISTANCE=0.0;
161  this->PRESSURE=0.0;
162  this->OLD_PRESSURE=0.0;
163  this->PLASTIC_PRESSURE=0.0;
164  this->TEMPERATURE=0.0;
165  this->SHEAR_MODULUS=0.0;
166  this->BULK_MODULUS=0.0;
167  this->COHESION=0.0;
168  this->THETA=0.0;
169  this->DENSITY=0.0;
170  this->TOTAL_PLASTIC_DEFORMATION=ZeroVector(6);
171  this->OLD_SIGMA=ZeroVector(6);
172  this->SIGMA=ZeroVector(6);
173  this->HAS_UPDATED_STRESSES=false;
174  this->PLASTICIZED=false;
175  }
176 
178  {}
179  //returning references
181  {
182  return this->VELOCITY;
183  }
184 
185  double& GetVelocity(const unsigned int i)
186  {
187  return this->VELOCITY[i];
188  }
189 
190  //returning references
192  {
193  return this->ACCELERATION;
194  }
195 
196  double& GetAcceleration(const unsigned int i)
197  {
198  return this->ACCELERATION[i];
199  }
200 
201  double& GetDistance()
202  {
203  return this->DISTANCE;
204  }
205 
206  double& GetShearModulus()
207  {
208  return this->SHEAR_MODULUS;
209  }
210 
211  double& GetBulkModulus()
212  {
213  return this->BULK_MODULUS;
214  }
216  {
217  return this->SECANT_BULK_MODULUS;
218  }
219 
220  //returning references
221  array_1d<double,6>& GetSigma() //should be 6 in 3d
222  {
223  return this->SIGMA;
224  }
225 
226  double& GetSigma(const unsigned int i)
227  {
228  return this->SIGMA[i];
229  }
230 
232  {
233  return this->OLD_SIGMA;
234  }
235  double& GetOldSigma(const unsigned int i)
236  {
237  return this->OLD_SIGMA[i];
238  }
239 
241  {
242  return this->TOTAL_PLASTIC_DEFORMATION;
243  }
244  double& GetTotalPlasticDeformation(const unsigned int i)
245  {
246  return this->TOTAL_PLASTIC_DEFORMATION[i];
247  }
248 
250  {
251  return this->OLD_TOTAL_PLASTIC_DEFORMATION;
252  }
253  double& GetOldTotalPlasticDeformation(const unsigned int i)
254  {
255  return this->OLD_TOTAL_PLASTIC_DEFORMATION[i];
256  }
257  //double& GetTemperature()
258  //{
259  // return this->TEMPERATURE;
260  //}
261 
262  //double& GetOxygen()
263  //{
264  // return this->OXYGEN;
265  //}
266 
267  double& GetPressure()
268  {
269  return this->PRESSURE;
270  }
271 
272  double& GetOldPressure()
273  {
274  return this->OLD_PRESSURE;
275  }
276 
278  {
279  return this->PLASTIC_PRESSURE;
280  }
281 
282  double& GetTemperature()
283  {
284  return this->TEMPERATURE;
285  }
286 
287  double& GetDensity()
288  {
289  return this->DENSITY;
290  }
291  double& GetTheta()
292  {
293  return this->THETA;
294  }
295  double& GetCohesion()
296  {
297  return this->COHESION;
298  }
299 
300  /*
301  double& GetGradientDiscontinuity()
302  {
303  return this->GRADIENT_DISCONTINUITY;
304  }
305  */
306  //Element::Pointer& GetElement()
307  //{
308  // return this->ELEMENT_WEAKPOINTER;
309  //}
310  /*
311  unsigned int& GetElementId()
312  {
313  return this->ELEMENT_ID;
314  }
315  */
316  bool& GetEraseFlag()
317  {
318  return this->ERASE_FLAG;
319  }
320 
322  {
323  return this->HAS_UPDATED_STRESSES;
324  }
325 
327  {
328  return this->PLASTICIZED;
329  }
330 
331 
332  //Copy constructor. Initialize this point with the coordinates
333  //of given particle.
334 
335  //PFEM_Particle(PFEM_Particle const& rOtherParticle)
336  // : Point(rOtherParticle) {}
337 
338 
339 private:
340  array_1d<double,3> VELOCITY;
341  array_1d<double,3> ACCELERATION;
342  double DISTANCE;
343  double PRESSURE;
344  double TEMPERATURE;
345  double SHEAR_MODULUS;
346  double BULK_MODULUS;
347  double SECANT_BULK_MODULUS;
348  double COHESION;
349  double THETA;
350  double DENSITY;
351  double OLD_PRESSURE;
352  double PLASTIC_PRESSURE;
353  array_1d<double,6> OLD_TOTAL_PLASTIC_DEFORMATION;
354  array_1d<double,6> TOTAL_PLASTIC_DEFORMATION;
355  array_1d<double,6> OLD_SIGMA;
356  array_1d<double,6> SIGMA; //should be of size 6 in 3d!
357  //Element::Pointer ELEMENT_WEAKPOINTER;
358 
359  //unsigned int ELEMENT_ID;
360  //double GRADIENT_DISCONTINUITY;
361  bool ERASE_FLAG;
362  bool HAS_UPDATED_STRESSES;
363  bool PLASTICIZED;
364 
365 
366 
367 };
368 
369 } //namespace Kratos
370 
371 #endif //KRATOS_PFEM_PARTICLE_H_INCLUDED defined
PFEM Particle class.
Definition: pfem_particle.h:103
array_1d< double, 3 > BaseType
Definition: pfem_particle.h:113
double & GetTheta()
Definition: pfem_particle.h:291
array_1d< double, 6 > & GetTotalPlasticDeformation()
Definition: pfem_particle.h:240
double & GetShearModulus()
Definition: pfem_particle.h:206
bool & IsPlasticized()
Definition: pfem_particle.h:326
std::size_t IndexType
Definition: pfem_particle.h:121
Point Type
Definition: pfem_particle.h:115
double & GetOldTotalPlasticDeformation(const unsigned int i)
Definition: pfem_particle.h:253
double & GetAcceleration(const unsigned int i)
Definition: pfem_particle.h:196
~PFEM_Particle()
Definition: pfem_particle.h:177
double & GetOldPressure()
Definition: pfem_particle.h:272
array_1d< double, 3 > & GetAcceleration()
Definition: pfem_particle.h:191
array_1d< double, 6 > & GetOldSigma()
Definition: pfem_particle.h:231
BaseType CoordinatesArrayType
Definition: pfem_particle.h:117
array_1d< double, 6 > & GetSigma()
Definition: pfem_particle.h:221
PFEM_Particle(TDataType const &NewX, TDataType const &NewY, TDataType const &NewZ)
Default constructor.
Definition: pfem_particle.h:132
double & GetSigma(const unsigned int i)
Definition: pfem_particle.h:226
double & GetSecantBulkModulus()
Definition: pfem_particle.h:215
double & GetTemperature()
Definition: pfem_particle.h:282
double TDataType
Definition: pfem_particle.h:111
double & GetDensity()
Definition: pfem_particle.h:287
PFEM_Particle()
Definition: pfem_particle.h:155
double & GetOldSigma(const unsigned int i)
Definition: pfem_particle.h:235
double & GetTotalPlasticDeformation(const unsigned int i)
Definition: pfem_particle.h:244
double & GetPlasticPressure()
Definition: pfem_particle.h:277
double & GetCohesion()
Definition: pfem_particle.h:295
double & GetDistance()
Definition: pfem_particle.h:201
double & GetBulkModulus()
Definition: pfem_particle.h:211
bool & HasUpdatedStresses()
Definition: pfem_particle.h:321
double & GetPressure()
Definition: pfem_particle.h:267
array_1d< double, 3 > & GetVelocity()
Definition: pfem_particle.h:180
bool & GetEraseFlag()
Definition: pfem_particle.h:316
double & GetVelocity(const unsigned int i)
Definition: pfem_particle.h:185
array_1d< double, 6 > & GetOldTotalPlasticDeformation()
Definition: pfem_particle.h:249
KRATOS_CLASS_POINTER_DEFINITION(PFEM_Particle)
Pointer definition of Point.
std::size_t SizeType
Definition: pfem_particle.h:119
Point class.
Definition: point.h:59
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
integer i
Definition: TensorModule.f:17