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.
stokes_3D.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 //
12 
13 
14 
15 #if !defined(KRATOS_STOKES_ELEMENT_SYMBOLIC_3D_INCLUDED )
16 #define KRATOS_STOKES_ELEMENT_SYMBOLIC_3D_INCLUDED
17 
18 
19 // System includes
20 
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
26 #include "includes/element.h"
27 #include "includes/variables.h"
28 #include "includes/serializer.h"
29 #include "utilities/geometry_utilities.h"
30 #include "includes/cfd_variables.h"
31 
32 namespace Kratos
33 {
34 
37 
41 
45 
49 
53 
60 class Stokes3D
61  : public Element
62 {
63 public:
66 
69 
70  template <unsigned int TNumNodes, unsigned int TDim>
71  struct element_data
72  {
75 
78 
81 
82  double bdf0;
83  double bdf1;
84  double bdf2;
85  double h;
86  double dyn_tau_coeff;
87  };
88 
92 
94 
95  Stokes3D(IndexType NewId, GeometryType::Pointer pGeometry)
96  : Element(NewId, pGeometry)
97  {}
98 
99  Stokes3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
100  : Element(NewId, pGeometry, pProperties)
101  {}
102 
104  ~Stokes3D() override {};
105 
106 
110 
111 
115 
116  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override
117  {
118  KRATOS_TRY
119  return Kratos::make_intrusive< Stokes3D >(NewId, GetGeometry().Create(ThisNodes), pProperties);
120  KRATOS_CATCH("");
121  }
122  Element::Pointer Create(IndexType NewId,
123  GeometryType::Pointer pGeom,
124  PropertiesType::Pointer pProperties) const override
125  {
126  return Kratos::make_intrusive< Stokes3D >(NewId, pGeom, pProperties);
127  }
128 
129 
130  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override
131  {
132  KRATOS_TRY
133 
134  const unsigned int NumNodes = 4;
135  const unsigned int Dim = 3;
136  const int ndofs = Dim + 1;
137  const unsigned int MatrixSize = NumNodes*ndofs;
138 
139  if (rLeftHandSideMatrix.size1() != MatrixSize)
140  rLeftHandSideMatrix.resize(MatrixSize, MatrixSize, false); //false says not to preserve existing storage!!
141 
142  if (rRightHandSideVector.size() != MatrixSize)
143  rRightHandSideVector.resize(MatrixSize, false); //false says not to preserve existing storage!!
144 
145  //struct to pass around the data
147 
148  //getting data for the given geometry
149 
150  double Volume;
152 
153  //compute element size
154 // data.h = ComputeH<4,3>(data.DN_DX, Volume);
155 
156  //gauss point position
158  GetShapeFunctionsOnGauss(Ncontainer);
159 
160  //database access to all of the variables needed
161  const Vector& BDFVector = rCurrentProcessInfo[BDF_COEFFICIENTS];
162  data.bdf0 = BDFVector[0];
163  data.bdf1 = BDFVector[1];
164  data.bdf2 = BDFVector[2];
165  data.dyn_tau_coeff = rCurrentProcessInfo[DYNAMIC_TAU] * data.bdf0;
166 
167 
168  for (unsigned int i = 0; i < NumNodes; i++)
169  {
170  const array_1d<double,3>& vel = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
171  const array_1d<double,3>& body_force = GetGeometry()[i].FastGetSolutionStepValue(BODY_FORCE);
172  const array_1d<double,3>& vel_n = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,1);
173  const array_1d<double,3>& vel_nn = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,2);
174 
175  for(unsigned int k=0; k<Dim; k++)
176  {
177  data.v(i,k) = vel[k];
178  data.vn(i,k) = vel_n[k];
179  data.vnn(i,k) = vel_nn[k];
180  data.f(i,k) = body_force[k];
181  }
182 
183  data.p[i] = GetGeometry()[i].FastGetSolutionStepValue(PRESSURE);
184  data.rho[i] = GetGeometry()[i].FastGetSolutionStepValue(DENSITY);
185  }
186 
187  //allocate memory needed
189  array_1d<double,MatrixSize> rhs_local;
190 
191  //loop on gauss points
192 // noalias(rLeftHandSideMatrix) = ZeroMatrix(MatrixSize,MatrixSize);
193 // noalias(rRightHandSideVector) = ZeroVector(MatrixSize);
194  for(unsigned int igauss = 0; igauss<1; igauss++) //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
195  {
196 // noalias(data.N) = row(Ncontainer, igauss); //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
197 
198  ComputeConstitutiveResponse(data, rCurrentProcessInfo);
199 
202 
203  //here we assume that all the weights of the gauss points are the same so we multiply at the end by Volume/NumNodes
204  noalias(rLeftHandSideMatrix) = lhs_local; //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
205  noalias(rRightHandSideVector) = rhs_local; //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
206  }
207 
208  rLeftHandSideMatrix *= Volume; //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
209  rRightHandSideVector *= Volume; //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
210 
211 // rLeftHandSideMatrix *= Volume/static_cast<double>(NumNodes);
212 // rRightHandSideVector *= Volume/static_cast<double>(NumNodes);
213 
214 
215 
216  KRATOS_CATCH("Error in Stokes Element Symbolic")
217  }
218 
219 
220 
221 
222 
223  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override
224  {
225  KRATOS_TRY
226 
227  const unsigned int NumNodes = 4;
228  const unsigned int Dim = 3;
229  const int ndofs = Dim + 1;
230  const unsigned int MatrixSize = NumNodes*ndofs;
231 
232  if (rRightHandSideVector.size() != MatrixSize)
233  rRightHandSideVector.resize(MatrixSize, false); //false says not to preserve existing storage!!
234 
235  //struct to pass around the data
237 
238  //getting data for the given geometry
239  double Volume;
241 
242  //gauss point position
244  GetShapeFunctionsOnGauss(Ncontainer);
245 
246  //database access to all of the variables needed
247  const Vector& BDFVector = rCurrentProcessInfo[BDF_COEFFICIENTS];
248  data.bdf0 = BDFVector[0];
249  data.bdf1 = BDFVector[1];
250  data.bdf2 = BDFVector[2];
251  data.dyn_tau_coeff = rCurrentProcessInfo[DYNAMIC_TAU] * data.bdf0;
252 
253 
254  for (unsigned int i = 0; i < NumNodes; i++)
255  {
256  const array_1d<double,3>& vel = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
257  const array_1d<double,3>& body_force = GetGeometry()[i].FastGetSolutionStepValue(BODY_FORCE);
258  const array_1d<double,3>& vel_n = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,1);
259  const array_1d<double,3>& vel_nn = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY,2);
260 
261  for(unsigned int k=0; k<Dim; k++)
262  {
263  data.v(i,k) = vel[k];
264  data.vn(i,k) = vel_n[k];
265  data.vnn(i,k) = vel_nn[k];
266  data.f(i,k) = body_force[k];
267  }
268 
269 
270  data.p[i] = GetGeometry()[i].FastGetSolutionStepValue(PRESSURE);
271  data.rho[i] = GetGeometry()[i].FastGetSolutionStepValue(DENSITY);
272  }
273 
274  //allocate memory needed
275  array_1d<double,MatrixSize> rhs_local;
276 
277  //loop on gauss points - ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
278  noalias(rRightHandSideVector) = ZeroVector(MatrixSize);
279  for(unsigned int igauss = 0; igauss<1; igauss++) //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
280  {
281 // noalias(data.N) = row(Ncontainer, igauss);
282 
283  ComputeConstitutiveResponse(data, rCurrentProcessInfo);
284 
286 
287  //here we assume that all the weights of the gauss points are the same so we multiply at the end by Volume/NumNodes
288  noalias(rRightHandSideVector) += rhs_local;
289  }
290 
291  rRightHandSideVector *= Volume; //ATTENTION DELIBERATELY USING ONE SINGLE GAUSS POINT!!
292 // rRightHandSideVector *= Volume/static_cast<double>(NumNodes);
293 
294  KRATOS_CATCH("")
295 
296  }
297 
298 
299 
300 
301 
302  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override
303  {
304  KRATOS_TRY
305 
306  const unsigned int NumNodes = 4;
307  const int Dim = 3;
308 
309  if (rResult.size() != NumNodes*(Dim+1))
310  rResult.resize(NumNodes*(Dim+1), false);
311 
312  for(unsigned int i=0; i<NumNodes; i++)
313  {
314  rResult[i*(Dim+1) ] = GetGeometry()[i].GetDof(VELOCITY_X).EquationId();
315  rResult[i*(Dim+1)+1] = GetGeometry()[i].GetDof(VELOCITY_Y).EquationId();
316  rResult[i*(Dim+1)+2] = GetGeometry()[i].GetDof(VELOCITY_Z).EquationId();
317  rResult[i*(Dim+1)+3] = GetGeometry()[i].GetDof(PRESSURE).EquationId();
318  }
319 
320 
321  KRATOS_CATCH("")
322 
323  }
324 
325 
326 
327 
328 
329  void GetDofList(DofsVectorType& ElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override
330  {
331  KRATOS_TRY
332 
333  const unsigned int NumNodes = 4;
334  const int Dim = 3;
335 
336  if (ElementalDofList.size() != NumNodes*(Dim+1))
337  ElementalDofList.resize(NumNodes*(Dim+1));
338 
339  for(unsigned int i=0; i<NumNodes; i++)
340  {
341  ElementalDofList[i*(Dim+1) ] = GetGeometry()[i].pGetDof(VELOCITY_X);
342  ElementalDofList[i*(Dim+1)+1] = GetGeometry()[i].pGetDof(VELOCITY_Y);
343  ElementalDofList[i*(Dim+1)+2] = GetGeometry()[i].pGetDof(VELOCITY_Z);
344  ElementalDofList[i*(Dim+1)+3] = GetGeometry()[i].pGetDof(PRESSURE);
345  }
346 
347  KRATOS_CATCH("");
348  }
349 
351 
359  int Check(const ProcessInfo& rCurrentProcessInfo) const override
360  {
361  KRATOS_TRY
362 
363  // Perform basic element checks
364  int ErrorCode = Kratos::Element::Check(rCurrentProcessInfo);
365  if(ErrorCode != 0) return ErrorCode;
366 
367  // Checks on nodes
368  // Check that the element's nodes contain all required SolutionStepData and Degrees of freedom
369  for(unsigned int i=0; i<this->GetGeometry().size(); ++i)
370  {
371  if(this->GetGeometry()[i].SolutionStepsDataHas(VELOCITY) == false)
372  KRATOS_THROW_ERROR(std::invalid_argument,"Missing VELOCITY variable on solution step data for node ",this->GetGeometry()[i].Id());
373  if(this->GetGeometry()[i].SolutionStepsDataHas(PRESSURE) == false)
374  KRATOS_THROW_ERROR(std::invalid_argument,"Missing PRESSURE variable on solution step data for node ",this->GetGeometry()[i].Id());
375  if(this->GetGeometry()[i].HasDofFor(VELOCITY_X) == false ||
376  this->GetGeometry()[i].HasDofFor(VELOCITY_Y) == false ||
377  this->GetGeometry()[i].HasDofFor(VELOCITY_Z) == false)
378  KRATOS_THROW_ERROR(std::invalid_argument,"Missing VELOCITY component degree of freedom on node ",this->GetGeometry()[i].Id());
379  if(this->GetGeometry()[i].HasDofFor(PRESSURE) == false)
380  KRATOS_THROW_ERROR(std::invalid_argument,"Missing PRESSURE component degree of freedom on node ",this->GetGeometry()[i].Id());
381  }
382 
383  // Check constitutive law
384  if(mp_constitutive_law == nullptr)
385  KRATOS_ERROR << "The constitutive law was not set. Cannot proceed.";
386 
387  mp_constitutive_law->Check(GetProperties(),GetGeometry(),rCurrentProcessInfo);
388 
389  return 0;
390 
391  KRATOS_CATCH("");
392  }
393 
394  void Calculate(const Variable<double>& rVariable,
395  double& Output,
396  const ProcessInfo& rCurrentProcessInfo) override
397  {
398  KRATOS_TRY
399 
400  if(rVariable == HEAT_FLUX) //compute the heat flux per unit volume induced by the shearing
401  {
402  const unsigned int NumNodes = 4;
403  const unsigned int Dim = 3;
404  const unsigned int strain_size = 6;
405 
406  //struct to pass around the data
408 
409  //getting data for the given geometry
410  double Volume;
412 
413 
414  for (unsigned int i = 0; i < NumNodes; i++)
415  {
416  const array_1d<double,3>& vel = GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
417 
418  for(unsigned int k=0; k<Dim; k++)
419  {
420  data.v(i,k) = vel[k];
421  }
422  }
423 
424  if (data.stress.size() != strain_size) data.stress.resize(strain_size,false);
425 
428 
429  //compute strain
431  strain[0] = DN(0,0)*v(0,0) + DN(1,0)*v(1,0) + DN(2,0)*v(2,0) + DN(3,0)*v(3,0);
432  strain[1] = DN(0,1)*v(0,1) + DN(1,1)*v(1,1) + DN(2,1)*v(2,1) + DN(3,1)*v(3,1);
433  strain[2] = DN(0,2)*v(0,2) + DN(1,2)*v(1,2) + DN(2,2)*v(2,2) + DN(3,2)*v(3,2);
434  strain[3] = DN(0,0)*v(0,1) + DN(0,1)*v(0,0) + DN(1,0)*v(1,1) + DN(1,1)*v(1,0) + DN(2,0)*v(2,1) + DN(2,1)*v(2,0) + DN(3,0)*v(3,1) + DN(3,1)*v(3,0);
435  strain[4] = DN(0,1)*v(0,2) + DN(0,2)*v(0,1) + DN(1,1)*v(1,2) + DN(1,2)*v(1,1) + DN(2,1)*v(2,2) + DN(2,2)*v(2,1) + DN(3,1)*v(3,2) + DN(3,2)*v(3,1);
436  strain[5] = DN(0,0)*v(0,2) + DN(0,2)*v(0,0) + DN(1,0)*v(1,2) + DN(1,2)*v(1,0) + DN(2,0)*v(2,2) + DN(2,2)*v(2,0) + DN(3,0)*v(3,2) + DN(3,2)*v(3,0);
437 
438  //create constitutive law parameters:
439  ConstitutiveLaw::Parameters Values(GetGeometry(),GetProperties(),rCurrentProcessInfo);
440 
441  //set constitutive law flags:
442  Flags& ConstitutiveLawOptions=Values.GetOptions();
443  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_STRESS);
444  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR, false);
445 
446  //this is to pass the shape functions. Unfortunately it is needed to make a copy to a flexible size vector
447  const Vector Nvec(data.N);
448  Values.SetShapeFunctionsValues(Nvec);
449 
450  Values.SetStrainVector(strain); //this is the input parameter
451  Values.SetStressVector(data.stress); //this is an ouput parameter
452 // Values.SetConstitutiveMatrix(data.C); //this is an ouput parameter
453 
454  //ATTENTION: here we assume that only one constitutive law is employed for all of the gauss points in the element.
455  //this is ok under the hypothesis that no history dependent behaviour is employed
456  mp_constitutive_law->CalculateMaterialResponseCauchy(Values);
457 
458  Output = inner_prod(data.stress, strain);
459  }
460 
461  KRATOS_CATCH("")
462  }
463 
464 
468 
469 
473 
474 
478 
480 
481  std::string Info() const override
482  {
483  return "Stokes3D #";
484  }
485 
487 
488  void PrintInfo(std::ostream& rOStream) const override
489  {
490  rOStream << Info() << Id();
491  }
492 
494  // virtual void PrintData(std::ostream& rOStream) const;
495 
496 
500 
501 
503 
504 protected:
507 
508 
512 
513  //this is the symbolic function implementing the element
514  void ComputeGaussPointLHSContribution(BoundedMatrix<double,16,16>& lhs, const element_data<4,3>& data);
515  void ComputeGaussPointRHSContribution(array_1d<double,16>& rhs, const element_data<4,3>& data);
516 
520 
522  {
523  }
524 
528  template< unsigned int TNumNodes, unsigned int TDim>
529  double ComputeH(BoundedMatrix<double,TNumNodes, TDim>& DN_DX, const double Volume)
530  {
531  double h=0.0;
532  for(unsigned int i=0; i<TNumNodes; i++)
533  {
534  double h_inv = 0.0;
535  for(unsigned int k=0; k<TDim; k++)
536  {
537  h_inv += DN_DX(i,k)*DN_DX(i,k);
538  }
539  h += 1.0/h_inv;
540  }
541  h = sqrt(h)/static_cast<double>(TNumNodes);
542  return h;
543  }
544 
545  //gauss points for the 3D case
547  {
548  Ncontainer(0,0) = 0.58541020; Ncontainer(0,1) = 0.13819660; Ncontainer(0,2) = 0.13819660; Ncontainer(0,3) = 0.13819660;
549  Ncontainer(1,0) = 0.13819660; Ncontainer(1,1) = 0.58541020; Ncontainer(1,2) = 0.13819660; Ncontainer(1,3) = 0.13819660;
550  Ncontainer(2,0) = 0.13819660; Ncontainer(2,1) = 0.13819660; Ncontainer(2,2) = 0.58541020; Ncontainer(2,3) = 0.13819660;
551  Ncontainer(3,0) = 0.13819660; Ncontainer(3,1) = 0.13819660; Ncontainer(3,2) = 0.13819660; Ncontainer(3,3) = 0.58541020;
552  }
553 
554  //gauss points for the 2D case
556  {
557  const double one_sixt = 1.0/6.0;
558  const double two_third = 2.0/3.0;
559  Ncontainer(0,0) = one_sixt; Ncontainer(0,1) = one_sixt; Ncontainer(0,2) = two_third;
560  Ncontainer(1,0) = one_sixt; Ncontainer(1,1) = two_third; Ncontainer(1,2) = one_sixt;
561  Ncontainer(2,0) = two_third; Ncontainer(2,1) = one_sixt; Ncontainer(2,2) = one_sixt;
562  }
563 
564  virtual void ComputeConstitutiveResponse(element_data<4,3>& data, const ProcessInfo& rCurrentProcessInfo)
565  {
566  const unsigned int nnodes = 4;
567  const unsigned int dim = 3;
568  const unsigned int strain_size = 6;
569 
570  if(data.C.size1() != strain_size)
571  data.C.resize(strain_size,strain_size,false);
572  if(data.stress.size() != strain_size)
573  data.stress.resize(strain_size,false);
574 
577 
578 
579 // noalias(data.C) = ZeroMatrix(strain_size,strain_size);
580 // const double nu = GetProperties()[VISCOSITY];
581 // const double rho = inner_prod(data.rho, data.N);
582 
583  //compute strain
585  strain[0] = DN(0,0)*v(0,0) + DN(1,0)*v(1,0) + DN(2,0)*v(2,0) + DN(3,0)*v(3,0);
586  strain[1] = DN(0,1)*v(0,1) + DN(1,1)*v(1,1) + DN(2,1)*v(2,1) + DN(3,1)*v(3,1);
587  strain[2] = DN(0,2)*v(0,2) + DN(1,2)*v(1,2) + DN(2,2)*v(2,2) + DN(3,2)*v(3,2);
588  strain[3] = DN(0,0)*v(0,1) + DN(0,1)*v(0,0) + DN(1,0)*v(1,1) + DN(1,1)*v(1,0) + DN(2,0)*v(2,1) + DN(2,1)*v(2,0) + DN(3,0)*v(3,1) + DN(3,1)*v(3,0);
589  strain[4] = DN(0,1)*v(0,2) + DN(0,2)*v(0,1) + DN(1,1)*v(1,2) + DN(1,2)*v(1,1) + DN(2,1)*v(2,2) + DN(2,2)*v(2,1) + DN(3,1)*v(3,2) + DN(3,2)*v(3,1);
590  strain[5] = DN(0,0)*v(0,2) + DN(0,2)*v(0,0) + DN(1,0)*v(1,2) + DN(1,2)*v(1,0) + DN(2,0)*v(2,2) + DN(2,2)*v(2,0) + DN(3,0)*v(3,2) + DN(3,2)*v(3,0);
591 
592  //here we shall call the constitutive law
593 // data.C(0,0) = 2.0*nu*rho;
594 // data.C(1,1) = 2.0*nu*rho;
595 // data.C(2,2) = 2.0*nu*rho;
596 // data.C(3,3) = nu*rho;
597 // data.C(4,4) = nu*rho;
598 // data.C(5,5) = nu*rho;
599 //
600 // noalias(data.stress) = prod(data.C,strain);
601 
602 
603  //create constitutive law parameters:
604  ConstitutiveLaw::Parameters Values(GetGeometry(),GetProperties(),rCurrentProcessInfo);
605 
606  const Vector Nvec(data.N);
607  Values.SetShapeFunctionsValues(Nvec);
608  //set constitutive law flags:
609  Flags& ConstitutiveLawOptions=Values.GetOptions();
610  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_STRESS);
611  ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR);
612 
613  Values.SetStrainVector(strain); //this is the input parameter
614  Values.SetStressVector(data.stress); //this is an ouput parameter
615  Values.SetConstitutiveMatrix(data.C); //this is an ouput parameter
616 
617  //ATTENTION: here we assume that only one constitutive law is employed for all of the gauss points in the element.
618  //this is ok under the hypothesis that no history dependent behaviour is employed
619  mp_constitutive_law->CalculateMaterialResponseCauchy(Values);
620 
621  }
622 
623 
624  void Initialize(const ProcessInfo &rCurrentProcessInfo) override
625  {
626  KRATOS_TRY
627 
628  mp_constitutive_law = GetProperties()[CONSTITUTIVE_LAW]->Clone();
629  mp_constitutive_law->InitializeMaterial( GetProperties(), GetGeometry(), row( GetGeometry().ShapeFunctionsValues(), 0 ) );
630 
631  KRATOS_CATCH( "" )
632  }
633 
637 
638 
642 
643 
647 
648 
650 
651 
652 protected:
653  ConstitutiveLaw::Pointer mp_constitutive_law = nullptr;
654 
655 private:
658 
662 
666  friend class Serializer;
667 
668  void save(Serializer& rSerializer) const override
669  {
671  }
672 
673  void load(Serializer& rSerializer) override
674  {
676  }
677 
679 
682 
683 
687 
688 
692 
693 
697 
698 
699 
700 
701 
703 
704 };
705 
707 
710 
711 
715 
716 
718 /* inline std::istream& operator >> (std::istream& rIStream,
719  Fluid2DASGS& rThis);
720  */
722 /* inline std::ostream& operator << (std::ostream& rOStream,
723  const Fluid2DASGS& rThis)
724  {
725  rThis.PrintInfo(rOStream);
726  rOStream << std::endl;
727  rThis.PrintData(rOStream);
728 
729  return rOStream;
730  }*/
732 
733 } // namespace Kratos.
734 
735 #endif // KRATOS_STOKES_ELEMENT_SYMBOLIC_3D_INCLUDED defined
736 
737 
Base class for all Elements.
Definition: element.h:60
PropertiesType & GetProperties()
Definition: element.h:1024
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:904
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
Definition: flags.h:58
std::size_t IndexType
Definition: flags.h:74
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
IndexType Id() const
Definition: indexed_object.h:107
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: stokes_3D.h:62
Stokes3D(IndexType NewId, GeometryType::Pointer pGeometry)
Default constructor.
Definition: stokes_3D.h:95
void ComputeGaussPointRHSContribution(array_1d< double, 16 > &rhs, const element_data< 4, 3 > &data)
Definition: stokes_3D.cpp:454
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: stokes_3D.h:130
virtual void ComputeConstitutiveResponse(element_data< 4, 3 > &data, const ProcessInfo &rCurrentProcessInfo)
Definition: stokes_3D.h:564
Stokes3D(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: stokes_3D.h:99
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Definition: stokes_3D.h:302
void Calculate(const Variable< double > &rVariable, double &Output, const ProcessInfo &rCurrentProcessInfo) override
Definition: stokes_3D.h:394
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: stokes_3D.h:359
~Stokes3D() override
Destructor.
Definition: stokes_3D.h:104
ConstitutiveLaw::Pointer mp_constitutive_law
Definition: stokes_3D.h:653
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: stokes_3D.h:116
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: stokes_3D.h:223
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: stokes_3D.h:488
void GetShapeFunctionsOnGauss(BoundedMatrix< double, 4, 4 > &Ncontainer)
Definition: stokes_3D.h:546
void GetShapeFunctionsOnGauss(BoundedMatrix< double, 3, 3 > &Ncontainer)
Definition: stokes_3D.h:555
Stokes3D()
Definition: stokes_3D.h:521
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: stokes_3D.h:122
double ComputeH(BoundedMatrix< double, TNumNodes, TDim > &DN_DX, const double Volume)
Definition: stokes_3D.h:529
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Definition: stokes_3D.h:329
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: stokes_3D.h:624
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(Stokes3D)
Counted pointer of.
void ComputeGaussPointLHSContribution(BoundedMatrix< double, 16, 16 > &lhs, const element_data< 4, 3 > &data)
Definition: stokes_3D.cpp:7
std::string Info() const override
Turn back information as a string.
Definition: stokes_3D.h:481
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
v
Definition: generate_convection_diffusion_explicit_element.py:114
DN
Definition: generate_convection_diffusion_explicit_element.py:98
h
Definition: generate_droplet_dynamics.py:91
rhs
Definition: generate_frictional_mortar_condition.py:297
lhs
Definition: generate_frictional_mortar_condition.py:297
int strain_size
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:16
strain
HERE WE MUST SUBSTITUTE EXPRESSIONS.
Definition: generate_stokes_twofluid_element.py:104
data
Definition: mesh_to_mdpa_converter.py:59
def load(f)
Definition: ode_solve.py:307
vel
Definition: pure_conduction.py:76
int k
Definition: quadrature.py:595
body_force
Definition: script_ELASTIC.py:102
int dim
Definition: sensitivityMatrix.py:25
int nnodes
Definition: sensitivityMatrix.py:24
integer i
Definition: TensorModule.f:17
Definition: constitutive_law.h:189
void SetConstitutiveMatrix(VoigtSizeMatrixType &rConstitutiveMatrix)
Definition: constitutive_law.h:403
void SetStrainVector(StrainVectorType &rStrainVector)
Definition: constitutive_law.h:401
Flags & GetOptions()
Definition: constitutive_law.h:412
void SetStressVector(StressVectorType &rStressVector)
Definition: constitutive_law.h:402
void SetShapeFunctionsValues(const Vector &rShapeFunctionsValues)
Definition: constitutive_law.h:396
Definition: stokes_3D.h:72
BoundedMatrix< double, TNumNodes, TDim > f
Definition: stokes_3D.h:73
double h
Definition: stokes_3D.h:85
array_1d< double, TNumNodes > p
Definition: stokes_3D.h:74
BoundedMatrix< double, TNumNodes, TDim > vnn
Definition: stokes_3D.h:73
double dyn_tau_coeff
Definition: stokes_3D.h:86
double bdf1
Definition: stokes_3D.h:83
BoundedMatrix< double, TNumNodes, TDim > DN_DX
Definition: stokes_3D.h:76
array_1d< double, TNumNodes > N
Definition: stokes_3D.h:77
double bdf2
Definition: stokes_3D.h:84
BoundedMatrix< double, TNumNodes, TDim > vn
Definition: stokes_3D.h:73
BoundedMatrix< double, TNumNodes, TDim > v
Definition: stokes_3D.h:73
Vector stress
Definition: stokes_3D.h:80
array_1d< double, TNumNodes > rho
Definition: stokes_3D.h:74
double bdf0
Definition: stokes_3D.h:82
Matrix C
Definition: stokes_3D.h:79