SU2
element_structure.hpp
Go to the documentation of this file.
1 
36 #pragma once
37 
38 #include "mpi_structure.hpp"
39 
40 #include <cmath>
41 #include <iostream>
42 #include <cstdlib>
43 
44 #include "config_structure.hpp"
45 #include "geometry_structure.hpp"
46 #include "gauss_structure.hpp"
47 
48 using namespace std;
49 
57 class CElement {
58 protected:
59  unsigned short nGaussPoints;
60  unsigned short nGaussPointsP;
61  unsigned short nNodes;
62  static unsigned short nDim;
63  su2double **CurrentCoord,
64  **RefCoord;
65  su2double **GaussCoord,
66  *GaussWeight;
67  su2double **GaussCoordP,
68  *GaussWeightP;
69  su2double **NodalExtrap;
70  su2double **NodalStress;
73  su2double **Mab;
74  su2double ***Kab;
75  su2double **Ks_ab;
76  su2double ***Kk_ab;
77  su2double **Kt_a;
78  su2double **FDL_a;
79  su2double el_Pressure;
81 public:
85  CElement(void);
86 
92  CElement(unsigned short val_nDim, CConfig *config);
93 
97  virtual ~CElement(void);
98 
103  unsigned short GetnNodes(void);
104 
109  unsigned short GetnGaussPoints(void);
110 
115  unsigned short GetnGaussPointsP(void);
116 
123  void SetRef_Coord(su2double val_CoordRef, unsigned short iNode, unsigned short iDim);
124 
131  void SetCurr_Coord(su2double val_CoordCurr, unsigned short iNode, unsigned short iDim);
132 
137  void SetElement_Pressure(su2double val_ElPressure);
138 
146  su2double GetRef_Coord(unsigned short iNode, unsigned short iDim);
147 
155  su2double GetCurr_Coord(unsigned short iNode, unsigned short iDim);
156 
162  su2double GetWeight(unsigned short iGauss);
163 
169  su2double GetWeight_P(unsigned short iGaussP);
170 
176  su2double GetJ_X(unsigned short iGauss);
177 
183  su2double GetJ_x(unsigned short iGauss);
184 
190  su2double GetJ_X_P(unsigned short iGauss);
191 
197  su2double GetJ_x_P(unsigned short iGauss);
198 
203  su2double GetElement_Pressure(void);
204 
211  void Add_Mab(su2double val_Mab, unsigned short nodeA, unsigned short nodeB);
212 
219  void Add_Kab(su2double **val_Kab, unsigned short nodeA, unsigned short nodeB);
220 
227  void Add_Kab_T(su2double **val_Kab, unsigned short nodeA, unsigned short nodeB);
228 
229 
236  void Add_Ks_ab(su2double val_Ks_ab, unsigned short nodeA, unsigned short nodeB);
237 
243  void Add_Kt_a(su2double *val_Kt_a, unsigned short nodeA);
244 
250  void Add_FDL_a(su2double *val_FDL_a, unsigned short nodeA);
251 
258  void Set_Kk_ab(su2double **val_Kk_ab, unsigned short nodeA, unsigned short nodeB);
259 
263  void clearElement(void);
264 
268  void clearStress(void);
269 
276  su2double Get_Mab(unsigned short nodeA, unsigned short nodeB);
277 
284  su2double *Get_Kab(unsigned short nodeA, unsigned short nodeB);
285 
292  su2double Get_Ks_ab(unsigned short nodeA, unsigned short nodeB);
293 
300  su2double *Get_Kk_ab(unsigned short nodeA, unsigned short nodeB);
301 
307  su2double *Get_Kt_a(unsigned short nodeA);
308 
314  su2double *Get_FDL_a(unsigned short nodeA);
315 
322  su2double GetNi(unsigned short iNode, unsigned short iGauss);
323 
330  su2double GetGradNi_X(unsigned short iNode, unsigned short iGauss, unsigned short iDim);
331 
338  su2double GetGradNi_x(unsigned short iNode, unsigned short iGauss, unsigned short iDim);
339 
346  su2double GetGradNi_x_P(unsigned short iNode, unsigned short iGaussP, unsigned short iDim);
347 
354  su2double GetNi_Extrap(unsigned short iNode, unsigned short iGauss);
355 
362  void Add_NodalStress(su2double val_Stress, unsigned short iNode, unsigned short iVar);
363 
370  su2double Get_NodalStress(unsigned short iNode, unsigned short iVar);
371 
377  virtual void ComputeGrad_Linear(void);
378 
384  virtual void ComputeGrad_NonLinear(void);
385 
389  virtual void ComputeGrad_Pressure(void);
390 
391 
392 };
393 
401 class CTRIA1 : public CElement {
402 
403 protected:
404 
405 public:
406 
410  CTRIA1(void);
411 
418  CTRIA1(unsigned short val_nDim, CConfig *config);
419 
423  ~CTRIA1(void);
424 
430  void ComputeGrad_Linear(void);
431 
437  void ComputeGrad_NonLinear(void);
438 
439 };
440 
441 
449 class CQUAD4 : public CElement {
450 
451 protected:
452 
453 public:
454 
458  CQUAD4(void);
459 
466  CQUAD4(unsigned short val_nDim, CConfig *config);
467 
471  virtual ~CQUAD4(void);
472 
478  void ComputeGrad_Linear(void);
479 
485  void ComputeGrad_NonLinear(void);
486 
490  virtual void ComputeGrad_Pressure(void);
491 
492 
493 };
494 
502 class CQUAD4P1 : public CQUAD4 {
503 
504 protected:
505 
506 public:
507 
511  CQUAD4P1(void);
512 
519  CQUAD4P1(unsigned short val_nDim, CConfig *config);
520 
524  ~CQUAD4P1(void);
525 
531  void ComputeGrad_Pressure(void);
532 
533 
534 };
535 
543 class CTETRA1 : public CElement {
544 
545 protected:
546 
547 public:
548 
552  CTETRA1(void);
553 
560  CTETRA1(unsigned short val_nDim, CConfig *config);
561 
565  ~CTETRA1(void);
566 
572  void ComputeGrad_Linear(void);
573 
579  void ComputeGrad_NonLinear(void);
580 
581 };
582 
590 class CHEXA8 : public CElement {
591 
592 protected:
593 
594 public:
595 
599  CHEXA8(void);
600 
607  CHEXA8(unsigned short val_nDim, CConfig *config);
608 
612  virtual ~CHEXA8(void);
613 
619  void ComputeGrad_Linear(void);
620 
626  void ComputeGrad_NonLinear(void);
627 
631  virtual void ComputeGrad_Pressure(void);
632 
633 
634 };
635 
643 class CHEXA8P1 : public CHEXA8 {
644 
645 protected:
646 
647 public:
648 
652  CHEXA8P1(void);
653 
659  CHEXA8P1(unsigned short val_nDim, CConfig *config);
660 
664  ~CHEXA8P1(void);
665 
671  void ComputeGrad_Pressure(void);
672 
673 
674 };
675 
683 class CBOUND2D : public CElement {
684 
685 protected:
686 
687 public:
688 
692  CBOUND2D(void);
693 
700  CBOUND2D(unsigned short val_nDim, CConfig *config);
701 
705  ~CBOUND2D(void);
706 
712  void ComputeGrad_Linear(void);
713 
719  void ComputeGrad_NonLinear(void);
720 
721 };
722 
723 
724 #include "element_structure.inl"
su2double ** FDL_a
Structure for the dead loads for the residual computation.
Definition: element_structure.hpp:78
Headers of the main subroutines for creating the geometrical structure. The subroutines and functions...
unsigned short nGaussPoints
Number of gaussian points.
Definition: element_structure.hpp:59
All the information about the definition of the physical problem. The subroutines and functions are i...
su2double *** Kab
Structure for the constitutive component of the tangent matrix.
Definition: element_structure.hpp:74
CGaussVariable ** GaussPointP
Structure for the Gaussian Points for the pressure subintegration.
Definition: element_structure.hpp:72
Quadrilateral element with 4 Gauss Points.
Definition: element_structure.hpp:449
static unsigned short nDim
Number of dimension of the problem.
Definition: element_structure.hpp:62
su2double ** Kt_a
Structure for the nodal stress term for the residual computation.
Definition: element_structure.hpp:77
Hexahedral element with 8 Gauss Points.
Definition: element_structure.hpp:590
Headers of the mpi interface for generalized datatypes. The subroutines and functions are in the mpi_...
Headers of the Finite Element structure (gaussian points) The subroutines and functions are in the ga...
su2double *** Kk_ab
Structure for the pressure component of the tangent matrix.
Definition: element_structure.hpp:76
In-Line subroutines of the element_structure.hpp file.
su2double * GaussWeightP
Weight of the Gaussian Points for the pressure subintegration.
Definition: element_structure.hpp:67
Quadrilateral element with 4 Gauss Points and 1 Gauss Point for pressure subintegration.
Definition: element_structure.hpp:502
unsigned short nNodes
Number of gaussian points.
Definition: element_structure.hpp:61
Tria element with 1 Gauss Points.
Definition: element_structure.hpp:401
su2double ** RefCoord
Coordinates in the reference frame.
Definition: element_structure.hpp:63
su2double el_Pressure
Pressure in the element.
Definition: element_structure.hpp:79
Hexahedral element with 8 Gauss Points and 1 Gauss Point for pressure subintegration.
Definition: element_structure.hpp:643
su2double ** Ks_ab
Structure for the stress component of the tangent matrix.
Definition: element_structure.hpp:75
su2double ** NodalStress
Stress at the nodes.
Definition: element_structure.hpp:70
Tetrahedral element with 1 Gauss Point.
Definition: element_structure.hpp:543
Main class for defining the gaussian points.
Definition: gauss_structure.hpp:55
2D line boundary element with 2 Gauss Points
Definition: element_structure.hpp:683
su2double ** NodalExtrap
Coordinates of the nodal points for Gaussian extrapolation.
Definition: element_structure.hpp:69
CGaussVariable ** GaussPoint
Structure for the Gaussian Points.
Definition: element_structure.hpp:71
su2double ** Mab
Structure for the nodal components of the mass matrix.
Definition: element_structure.hpp:73
unsigned short nGaussPointsP
Number of gaussian points for the pressure term.
Definition: element_structure.hpp:60
Main class for defining the problem; basically this class reads the configuration file...
Definition: config_structure.hpp:68
su2double * GaussWeight
Weight of the Gaussian Points for the integration.
Definition: element_structure.hpp:65
Main class for defining the element structure.
Definition: element_structure.hpp:57