@@ -43,39 +43,29 @@ class CFEANonlinearElasticity : public CFEAElasticity {
4343
4444protected:
4545
46- su2double **F_Mat; /* !< \brief Deformation gradient. */
47- su2double **b_Mat; /* !< \brief Left Cauchy-Green Tensor. */
48- su2double **currentCoord; /* !< \brief Current coordinates. */
49- su2double **Stress_Tensor; /* !< \brief Cauchy stress tensor */
50-
51- su2double **FmT_Mat; /* !< \brief Deformation gradient inverse and transpose. */
52-
53- su2double **KAux_P_ab; /* !< \brief Auxiliar matrix for the pressure term */
54- su2double *KAux_t_a; /* !< \brief Auxiliar matrix for the pressure term */
46+ su2double F_Mat[MAXNDIM ][MAXNDIM ]; /* !< \brief Deformation gradient. */
47+ su2double b_Mat[MAXNDIM ][MAXNDIM ]; /* !< \brief Left Cauchy-Green Tensor. */
48+ su2double Stress_Tensor[MAXNDIM ][MAXNDIM ];
5549
5650 su2double J_F ; /* !< \brief Jacobian of the transformation (determinant of F) */
5751
5852 su2double f33; /* !< \brief Plane stress term for non-linear 2D plane stress analysis */
5953
6054 bool nearly_incompressible; /* !< \brief Boolean to consider nearly_incompressible effects */
6155
62- su2double **F_Mat_Iso; /* !< \brief Isocoric component of the deformation gradient. */
63- su2double **b_Mat_Iso; /* !< \brief Isocoric component of the left Cauchy-Green tensor. */
64-
65- su2double C10 , D1 ; /* !< \brief C10 = Mu/2. D1 = Kappa/2. */
66- su2double J_F_Iso; /* !< \brief J_F_Iso: det(F)^-1/3. */
56+ su2double b_Mat_Iso[MAXNDIM ][MAXNDIM ]; /* !< \brief Isocoric component of the left Cauchy-Green tensor. */
6757
6858 su2double cijkl[3 ][3 ][3 ][3 ]; /* !< \brief Constitutive tensor i,j,k,l (defined only for incompressibility - near inc.). */
6959
7060 bool maxwell_stress; /* !< \brief Consider the effects of the dielectric loads */
7161
72- su2double * EField_Ref_Unit, /* !< \brief Electric Field, unitary, in the reference configuration. */
73- * EField_Ref_Mod; /* !< \brief Electric Field, modulus, in the reference configuration. */
74- su2double * EField_Curr_Unit; /* !< \brief Auxiliary vector for the unitary Electric Field in the current configuration. */
62+ std::unique_ptr< su2double[]> EField_Ref_Unit; /* !< \brief Electric Field, unitary, in the reference configuration. */
63+ std::unique_ptr<su2double[]> EField_Ref_Mod; /* !< \brief Electric Field, modulus, in the reference configuration. */
64+ std::unique_ptr< su2double[]> EField_Curr_Unit; /* !< \brief Auxiliary vector for the unitary Electric Field in the current configuration. */
7565 unsigned short nElectric_Field,
7666 nDim_Electric_Field;
7767
78- su2double * ke_DE_i; /* !< \brief Electric Constant for Dielectric Elastomers. */
68+ std::unique_ptr< su2double[]> ke_DE_i; /* !< \brief Electric Constant for Dielectric Elastomers. */
7969
8070 su2double ke_DE; /* !< \brief Electric Constant for Dielectric Elastomers. */
8171 su2double EFieldMod_Ref; /* !< \brief Modulus of the electric field in the reference configuration. */
@@ -94,11 +84,6 @@ class CFEANonlinearElasticity : public CFEAElasticity {
9484 */
9585 CFEANonlinearElasticity (unsigned short val_nDim, unsigned short val_nVar, const CConfig *config);
9686
97- /* !
98- * \brief Destructor of the class.
99- */
100- ~CFEANonlinearElasticity (void ) override ;
101-
10287 /* !
10388 * \brief Set element electric field.
10489 * \param[in] i_DV - Index of the variable.
@@ -161,9 +146,48 @@ class CFEANonlinearElasticity : public CFEAElasticity {
161146 void SetElectric_Properties (const CElement *element_container, const CConfig *config);
162147
163148 /* !
164- * \brief TODO: Describe what this does.
149+ * \brief Computes b_Mat.
150+ */
151+ void ComputeLeftCauchyGreenTensor () {
152+ for (unsigned short iVar = 0 ; iVar < MAXNDIM ; iVar++) {
153+ for (unsigned short jVar = 0 ; jVar < MAXNDIM ; jVar++) {
154+ b_Mat[iVar][jVar] = 0 ;
155+ for (unsigned short kVar = 0 ; kVar < MAXNDIM ; kVar ++) {
156+ b_Mat[iVar][jVar] += F_Mat[iVar][kVar ]*F_Mat[jVar][kVar ];
157+ }
158+ }
159+ }
160+ }
161+
162+ /* !
163+ * \brief Computes the determinant of the deformation gradient.
164+ */
165+ void ComputeJ_F () {
166+ J_F = F_Mat[0 ][0 ]*F_Mat[1 ][1 ]*F_Mat[2 ][2 ]+
167+ F_Mat[0 ][1 ]*F_Mat[1 ][2 ]*F_Mat[2 ][0 ]+
168+ F_Mat[0 ][2 ]*F_Mat[1 ][0 ]*F_Mat[2 ][1 ]-
169+ F_Mat[0 ][2 ]*F_Mat[1 ][1 ]*F_Mat[2 ][0 ]-
170+ F_Mat[1 ][2 ]*F_Mat[2 ][1 ]*F_Mat[0 ][0 ]-
171+ F_Mat[2 ][2 ]*F_Mat[0 ][1 ]*F_Mat[1 ][0 ];
172+ }
173+
174+ /* !
175+ * \brief Computes the deformation gradient transpose inverse.
165176 */
166- void Compute_FmT_Mat (void );
177+ template <typename Mat>
178+ void Compute_FmT_Mat (const Mat& F_Mat, const su2double& J_F , Mat& FmT_Mat) const {
179+ FmT_Mat[0 ][0 ] = (F_Mat[1 ][1 ]*F_Mat[2 ][2 ] - F_Mat[1 ][2 ]*F_Mat[2 ][1 ]) / J_F ;
180+ FmT_Mat[0 ][1 ] = (F_Mat[1 ][2 ]*F_Mat[2 ][0 ] - F_Mat[2 ][2 ]*F_Mat[1 ][0 ]) / J_F ;
181+ FmT_Mat[0 ][2 ] = (F_Mat[1 ][0 ]*F_Mat[2 ][1 ] - F_Mat[1 ][1 ]*F_Mat[2 ][0 ]) / J_F ;
182+
183+ FmT_Mat[1 ][0 ] = (F_Mat[0 ][2 ]*F_Mat[2 ][1 ] - F_Mat[0 ][1 ]*F_Mat[2 ][2 ]) / J_F ;
184+ FmT_Mat[1 ][1 ] = (F_Mat[0 ][0 ]*F_Mat[2 ][2 ] - F_Mat[2 ][0 ]*F_Mat[0 ][2 ]) / J_F ;
185+ FmT_Mat[1 ][2 ] = (F_Mat[0 ][1 ]*F_Mat[2 ][1 ] - F_Mat[0 ][0 ]*F_Mat[2 ][0 ]) / J_F ;
186+
187+ FmT_Mat[2 ][0 ] = (F_Mat[0 ][1 ]*F_Mat[1 ][2 ] - F_Mat[0 ][2 ]*F_Mat[1 ][1 ]) / J_F ;
188+ FmT_Mat[2 ][1 ] = (F_Mat[0 ][2 ]*F_Mat[1 ][0 ] - F_Mat[0 ][0 ]*F_Mat[1 ][2 ]) / J_F ;
189+ FmT_Mat[2 ][2 ] = (F_Mat[0 ][0 ]*F_Mat[1 ][1 ] - F_Mat[0 ][1 ]*F_Mat[1 ][0 ]) / J_F ;
190+ }
167191
168192 /* !
169193 * \brief TODO: Describe what this does.
0 commit comments