diff --git a/Common/include/geometry/elements/CElement.hpp b/Common/include/geometry/elements/CElement.hpp index 2d04c90ed71..e2e436f8169 100644 --- a/Common/include/geometry/elements/CElement.hpp +++ b/Common/include/geometry/elements/CElement.hpp @@ -249,7 +249,8 @@ class CElement { * \param[in] nodeB - index of Node b. * \param[in] val_Kab - value of the matrix K. */ - inline void Add_Kab(unsigned short nodeA, unsigned short nodeB, su2double** val_Kab) { + template + inline void Add_Kab(unsigned short nodeA, unsigned short nodeB, Matrix& val_Kab) { for (unsigned short iDim = 0; iDim < nDim; iDim++) for (unsigned short jDim = 0; jDim < nDim; jDim++) Kab[nodeA](nodeB, iDim * nDim + jDim) += val_Kab[iDim][jDim]; } @@ -259,7 +260,8 @@ class CElement { * transpose) \param[in] nodeA - index of Node a. \param[in] nodeB - index of Node b. \param[in] val_Kab - value of * the matrix K. */ - inline void Add_Kab_T(unsigned short nodeA, unsigned short nodeB, su2double** val_Kab) { + template + inline void Add_Kab_T(unsigned short nodeA, unsigned short nodeB, Matrix& val_Kab) { for (unsigned short iDim = 0; iDim < nDim; iDim++) for (unsigned short jDim = 0; jDim < nDim; jDim++) Kab[nodeA](nodeB, iDim * nDim + jDim) += val_Kab[jDim][iDim]; } diff --git a/Common/include/linear_algebra/CPastixWrapper.hpp b/Common/include/linear_algebra/CPastixWrapper.hpp index 38d3e394f9c..b3dfc4714ca 100644 --- a/Common/include/linear_algebra/CPastixWrapper.hpp +++ b/Common/include/linear_algebra/CPastixWrapper.hpp @@ -57,10 +57,10 @@ class CPastixWrapper { pastix_int_t nCols; /*!< \brief Local number of columns. */ vector colptr; /*!< \brief Equiv. to our "row_ptr". */ vector rowidx; /*!< \brief Equiv. to our "col_ind". */ - vector values; /*!< \brief Equiv. to our "matrix". */ + vector values; /*!< \brief Equiv. to our "matrix". */ vector loc2glb; /*!< \brief Global index of the columns held by this rank. */ vector perm; /*!< \brief Ordering computed by PaStiX. */ - vector workvec; /*!< \brief RHS vector which then becomes the solution. */ + vector workvec; /*!< \brief RHS vector which then becomes the solution. */ pastix_int_t iparm[IPARM_SIZE]; /*!< \brief Integer parameters for PaStiX. */ passivedouble dparm[DPARM_SIZE]; /*!< \brief Floating point parameters for PaStiX. */ diff --git a/Common/src/linear_algebra/CPastixWrapper.cpp b/Common/src/linear_algebra/CPastixWrapper.cpp index c603a492805..51325275b5f 100644 --- a/Common/src/linear_algebra/CPastixWrapper.cpp +++ b/Common/src/linear_algebra/CPastixWrapper.cpp @@ -181,7 +181,7 @@ void CPastixWrapper::Initialize(CGeometry* geometry, const CConfig* spmInitDist(&spm, SU2_MPI::GetComm()); spm.mtxtype = SpmGeneral; // Despite being symmetric, we store the entire matrix. - spm.flttype = SpmDouble; + spm.flttype = std::is_same_v ? SpmDouble : SpmFloat; spm.fmttype = SpmCSC; spm.layout = SpmColMajor; spm.baseval = 1; diff --git a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp index c3a13b058e4..7e98680a40b 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp @@ -27,6 +27,7 @@ #pragma once +#include #include "../CNumerics.hpp" #include "../../../../Common/include/geometry/elements/CElement.hpp" @@ -61,23 +62,17 @@ class CFEAElasticity : public CNumerics { su2double Kappa = 0.0; /*!< \brief Aux. variable, Compressibility constant. */ su2double ThermalStressTerm = 0.0; /*!< \brief Aux. variable, Relationship between stress and delta T. */ - su2double *E_i = nullptr; /*!< \brief Young's modulus of elasticity. */ - su2double *Nu_i = nullptr; /*!< \brief Poisson's ratio. */ - su2double *Rho_s_i = nullptr; /*!< \brief Structural density. */ - su2double *Rho_s_DL_i = nullptr; /*!< \brief Structural density (for dead loads). */ - su2double *Alpha_i = nullptr; /*!< \brief Thermal expansion coefficient. */ + std::unique_ptr E_i; /*!< \brief Young's modulus of elasticity. */ + std::unique_ptr Nu_i; /*!< \brief Poisson's ratio. */ + std::unique_ptr Rho_s_i; /*!< \brief Structural density. */ + std::unique_ptr Rho_s_DL_i; /*!< \brief Structural density (for dead loads). */ + std::unique_ptr Alpha_i; /*!< \brief Thermal expansion coefficient. */ su2double ReferenceTemperature = 0.0; /*!< \brief Reference temperature for thermal expansion. */ - su2double **Ba_Mat = nullptr; /*!< \brief Matrix B for node a - Auxiliary. */ - su2double **Bb_Mat = nullptr; /*!< \brief Matrix B for node b - Auxiliary. */ - su2double *Ni_Vec = nullptr; /*!< \brief Vector of shape functions - Auxiliary. */ - su2double **D_Mat = nullptr; /*!< \brief Constitutive matrix - Auxiliary. */ - su2double **KAux_ab = nullptr; /*!< \brief Node ab stiffness matrix - Auxiliary. */ - su2double **GradNi_Ref_Mat = nullptr; /*!< \brief Gradients of Ni - Auxiliary. */ - su2double **GradNi_Curr_Mat = nullptr; /*!< \brief Gradients of Ni - Auxiliary. */ + su2double D_Mat[DIM_STRAIN_3D][DIM_STRAIN_3D]; /*!< \brief Constitutive matrix - Auxiliary. */ - su2double *DV_Val = nullptr; /*!< \brief For optimization cases, value of the design variables. */ + std::unique_ptr DV_Val; /*!< \brief For optimization cases, value of the design variables. */ unsigned short n_DV = 0; /*!< \brief For optimization cases, number of design variables. */ bool plane_stress = false; /*!< \brief Checks if we are solving a plane stress case. */ @@ -97,11 +92,6 @@ class CFEAElasticity : public CNumerics { */ CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEAElasticity(void) override; - /*! * \brief Set elasticity modulus and Poisson ratio. * \param[in] iVal - Index of the property. @@ -245,4 +235,25 @@ class CFEAElasticity : public CNumerics { return static_cast(iVar == jVar); } + template + void FillBMat(unsigned short iNode, const Mat1& GradNi_Mat, Mat2& B_Mat) const { + if (nDim == 2) { + B_Mat[0][0] = GradNi_Mat[iNode][0]; + B_Mat[1][1] = GradNi_Mat[iNode][1]; + B_Mat[2][0] = GradNi_Mat[iNode][1]; + B_Mat[2][1] = GradNi_Mat[iNode][0]; + } + else { + B_Mat[0][0] = GradNi_Mat[iNode][0]; + B_Mat[1][1] = GradNi_Mat[iNode][1]; + B_Mat[2][2] = GradNi_Mat[iNode][2]; + B_Mat[3][0] = GradNi_Mat[iNode][1]; + B_Mat[3][1] = GradNi_Mat[iNode][0]; + B_Mat[4][0] = GradNi_Mat[iNode][2]; + B_Mat[4][2] = GradNi_Mat[iNode][0]; + B_Mat[5][1] = GradNi_Mat[iNode][2]; + B_Mat[5][2] = GradNi_Mat[iNode][1]; + } + } + }; diff --git a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp index 8eae5ee49e6..62d27a17a87 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp @@ -55,11 +55,6 @@ class CFEALinearElasticity : public CFEAElasticity { */ CFEALinearElasticity(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEALinearElasticity(void) override = default; - /*! * \brief Build the tangent stiffness matrix of an element. * \param[in,out] element_container - Element whose tangent matrix is being built. @@ -110,11 +105,6 @@ class CFEAMeshElasticity final : public CFEALinearElasticity { */ CFEAMeshElasticity(unsigned short val_nDim, unsigned short val_nVar, unsigned long val_nElem, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEAMeshElasticity(void) override = default; - /*! * \brief Set the element-based local Young's modulus in mesh problems * \param[in] iElem - Element index. diff --git a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp index ed97b3e2825..bad33c51b34 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp @@ -43,15 +43,9 @@ class CFEANonlinearElasticity : public CFEAElasticity { protected: - su2double **F_Mat; /*!< \brief Deformation gradient. */ - su2double **b_Mat; /*!< \brief Left Cauchy-Green Tensor. */ - su2double **currentCoord; /*!< \brief Current coordinates. */ - su2double **Stress_Tensor; /*!< \brief Cauchy stress tensor */ - - su2double **FmT_Mat; /*!< \brief Deformation gradient inverse and transpose. */ - - su2double **KAux_P_ab; /*!< \brief Auxiliar matrix for the pressure term */ - su2double *KAux_t_a; /*!< \brief Auxiliar matrix for the pressure term */ + su2double F_Mat[MAXNDIM][MAXNDIM]; /*!< \brief Deformation gradient. */ + su2double b_Mat[MAXNDIM][MAXNDIM]; /*!< \brief Left Cauchy-Green Tensor. */ + su2double Stress_Tensor[MAXNDIM][MAXNDIM]; su2double J_F; /*!< \brief Jacobian of the transformation (determinant of F) */ @@ -59,23 +53,19 @@ class CFEANonlinearElasticity : public CFEAElasticity { bool nearly_incompressible; /*!< \brief Boolean to consider nearly_incompressible effects */ - su2double **F_Mat_Iso; /*!< \brief Isocoric component of the deformation gradient. */ - su2double **b_Mat_Iso; /*!< \brief Isocoric component of the left Cauchy-Green tensor. */ - - su2double C10, D1; /*!< \brief C10 = Mu/2. D1 = Kappa/2. */ - su2double J_F_Iso; /*!< \brief J_F_Iso: det(F)^-1/3. */ + su2double b_Mat_Iso[MAXNDIM][MAXNDIM]; /*!< \brief Isocoric component of the left Cauchy-Green tensor. */ su2double cijkl[3][3][3][3]; /*!< \brief Constitutive tensor i,j,k,l (defined only for incompressibility - near inc.). */ bool maxwell_stress; /*!< \brief Consider the effects of the dielectric loads */ - su2double *EField_Ref_Unit, /*!< \brief Electric Field, unitary, in the reference configuration. */ - *EField_Ref_Mod; /*!< \brief Electric Field, modulus, in the reference configuration. */ - su2double *EField_Curr_Unit; /*!< \brief Auxiliary vector for the unitary Electric Field in the current configuration. */ + std::unique_ptr EField_Ref_Unit; /*!< \brief Electric Field, unitary, in the reference configuration. */ + std::unique_ptr EField_Ref_Mod; /*!< \brief Electric Field, modulus, in the reference configuration. */ + std::unique_ptr EField_Curr_Unit; /*!< \brief Auxiliary vector for the unitary Electric Field in the current configuration. */ unsigned short nElectric_Field, nDim_Electric_Field; - su2double *ke_DE_i; /*!< \brief Electric Constant for Dielectric Elastomers. */ + std::unique_ptr ke_DE_i; /*!< \brief Electric Constant for Dielectric Elastomers. */ su2double ke_DE; /*!< \brief Electric Constant for Dielectric Elastomers. */ su2double EFieldMod_Ref; /*!< \brief Modulus of the electric field in the reference configuration. */ @@ -94,11 +84,6 @@ class CFEANonlinearElasticity : public CFEAElasticity { */ CFEANonlinearElasticity(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEANonlinearElasticity(void) override; - /*! * \brief Set element electric field. * \param[in] i_DV - Index of the variable. @@ -161,9 +146,48 @@ class CFEANonlinearElasticity : public CFEAElasticity { void SetElectric_Properties(const CElement *element_container, const CConfig *config); /*! - * \brief TODO: Describe what this does. + * \brief Computes b_Mat. + */ + void ComputeLeftCauchyGreenTensor() { + for (unsigned short iVar = 0; iVar < MAXNDIM; iVar++) { + for (unsigned short jVar = 0; jVar < MAXNDIM; jVar++) { + b_Mat[iVar][jVar] = 0; + for (unsigned short kVar = 0; kVar < MAXNDIM; kVar++) { + b_Mat[iVar][jVar] += F_Mat[iVar][kVar]*F_Mat[jVar][kVar]; + } + } + } + } + + /*! + * \brief Computes the determinant of the deformation gradient. + */ + void ComputeJ_F() { + J_F = F_Mat[0][0]*F_Mat[1][1]*F_Mat[2][2]+ + F_Mat[0][1]*F_Mat[1][2]*F_Mat[2][0]+ + F_Mat[0][2]*F_Mat[1][0]*F_Mat[2][1]- + F_Mat[0][2]*F_Mat[1][1]*F_Mat[2][0]- + F_Mat[1][2]*F_Mat[2][1]*F_Mat[0][0]- + F_Mat[2][2]*F_Mat[0][1]*F_Mat[1][0]; + } + + /*! + * \brief Computes the deformation gradient transpose inverse. */ - void Compute_FmT_Mat(void); + template + void Compute_FmT_Mat(const Mat& F_Mat, const su2double& J_F, Mat& FmT_Mat) const { + FmT_Mat[0][0] = (F_Mat[1][1]*F_Mat[2][2] - F_Mat[1][2]*F_Mat[2][1]) / J_F; + FmT_Mat[0][1] = (F_Mat[1][2]*F_Mat[2][0] - F_Mat[2][2]*F_Mat[1][0]) / J_F; + FmT_Mat[0][2] = (F_Mat[1][0]*F_Mat[2][1] - F_Mat[1][1]*F_Mat[2][0]) / J_F; + + FmT_Mat[1][0] = (F_Mat[0][2]*F_Mat[2][1] - F_Mat[0][1]*F_Mat[2][2]) / J_F; + FmT_Mat[1][1] = (F_Mat[0][0]*F_Mat[2][2] - F_Mat[2][0]*F_Mat[0][2]) / J_F; + FmT_Mat[1][2] = (F_Mat[0][1]*F_Mat[2][1] - F_Mat[0][0]*F_Mat[2][0]) / J_F; + + FmT_Mat[2][0] = (F_Mat[0][1]*F_Mat[1][2] - F_Mat[0][2]*F_Mat[1][1]) / J_F; + FmT_Mat[2][1] = (F_Mat[0][2]*F_Mat[1][0] - F_Mat[0][0]*F_Mat[1][2]) / J_F; + FmT_Mat[2][2] = (F_Mat[0][0]*F_Mat[1][1] - F_Mat[0][1]*F_Mat[1][0]) / J_F; + } /*! * \brief TODO: Describe what this does. diff --git a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp index e57521cea0f..3cea87dcac5 100644 --- a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp +++ b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp @@ -48,11 +48,6 @@ class CFEM_NeoHookean_Comp final : public CFEANonlinearElasticity { */ CFEM_NeoHookean_Comp(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEM_NeoHookean_Comp(void) override = default; - private: /*! * \brief Compute the plane stress term. @@ -100,11 +95,6 @@ class CFEM_Knowles_NearInc final : public CFEANonlinearElasticity { */ CFEM_Knowles_NearInc(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEM_Knowles_NearInc(void) override = default; - private: /*! * \brief Compute the plane stress term. @@ -150,11 +140,6 @@ class CFEM_DielectricElastomer final : public CFEANonlinearElasticity { */ CFEM_DielectricElastomer(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEM_DielectricElastomer(void) override = default; - private: /*! * \brief Compute the plane stress term. @@ -202,11 +187,6 @@ class CFEM_IdealDE final : public CFEANonlinearElasticity { */ CFEM_IdealDE(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config); - /*! - * \brief Destructor of the class. - */ - ~CFEM_IdealDE(void) override = default; - private: /*! * \brief Compute the plane stress term. diff --git a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp index da9d09979c6..29be9e12d2f 100644 --- a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp @@ -27,9 +27,11 @@ #pragma once +#include +#include + #include "CFileWriter.hpp" -#include class CTecplotBinaryFileWriter final: public CFileWriter{ diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 0b373388bd4..42e8e485f71 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -123,11 +123,13 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom config[val_iZone]->SetInnerIter(CurIter); break; } - /*--- Linear elasticity without thermal effects only needs one iteration. ---*/ + /*--- Linear elasticity without thermal effects and double precision only needs one iteration. ---*/ +#ifndef USE_MIXED_PRECISION if (linear && !heat) { output->SetConvergence(true); break; } +#endif /*--- Normal stopping criteria. ---*/ if (StopCalc && IntIter > 0) break; } diff --git a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp index 9b9c6af005f..51f21633ff4 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp @@ -43,11 +43,11 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, /*--- Initialize vector structures for multiple material definition ---*/ const auto nProp = config->GetnElasticityMat(); - E_i = new su2double[nProp]; - Nu_i = new su2double[nProp]; - Rho_s_i = new su2double[nProp]; // For inertial effects - Rho_s_DL_i = new su2double[nProp]; // For dead loads - Alpha_i = new su2double[nProp]; + E_i.reset(new su2double[nProp]); + Nu_i.reset(new su2double[nProp]); + Rho_s_i.reset(new su2double[nProp]); // For inertial effects + Rho_s_DL_i.reset(new su2double[nProp]); // For dead loads + Alpha_i.reset(new su2double[nProp]); for (iVar = 0; iVar < nProp; iVar++) { E_i[iVar] = config->GetElasticyMod(iVar); Nu_i[iVar] = config->GetPoissonRatio(iVar); @@ -69,32 +69,7 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, Compute_Lame_Parameters(); - KAux_ab = new su2double* [nDim]; - for (iVar = 0; iVar < nDim; iVar++) { - KAux_ab[iVar] = new su2double[nDim]; - } - - unsigned short nStrain = (nDim==2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - unsigned short nNodes = (nDim==2) ? NNODES_2D : NNODES_3D; - - Ba_Mat = new su2double* [nStrain]; - Bb_Mat = new su2double* [nStrain]; - D_Mat = new su2double* [nStrain]; - Ni_Vec = new su2double [nNodes]; - GradNi_Ref_Mat = new su2double* [nNodes]; - GradNi_Curr_Mat = new su2double* [nNodes]; - for (iVar = 0; iVar < nStrain; iVar++) { - Ba_Mat[iVar] = new su2double[nDim]; - Bb_Mat[iVar] = new su2double[nDim]; - D_Mat[iVar] = new su2double[nStrain]; - } - for (iVar = 0; iVar < nNodes; iVar++) { - GradNi_Ref_Mat[iVar] = new su2double[nDim]; - GradNi_Curr_Mat[iVar] = new su2double[nDim]; - } - - DV_Val = nullptr; - n_DV = 0; + n_DV = 0; switch (config->GetDV_FEA()) { case YOUNG_MODULUS: case POISSON_RATIO: @@ -131,44 +106,6 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, } } -CFEAElasticity::~CFEAElasticity() { - - unsigned short iVar; - unsigned short nStrain = (nDim==2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - unsigned short nNodes = (nDim==2) ? NNODES_2D : NNODES_3D; - - for (iVar = 0; iVar < nDim; iVar++) { - delete [] KAux_ab[iVar]; - } - - for (iVar = 0; iVar < nStrain; iVar++) { - delete [] Ba_Mat[iVar]; - delete [] Bb_Mat[iVar]; - delete [] D_Mat[iVar]; - } - for (iVar = 0; iVar < nNodes; iVar++) { - delete [] GradNi_Ref_Mat[iVar]; - delete [] GradNi_Curr_Mat[iVar]; - } - - delete [] KAux_ab; - delete [] Ba_Mat; - delete [] Bb_Mat; - delete [] D_Mat; - delete [] GradNi_Ref_Mat; - delete [] GradNi_Curr_Mat; - - delete[] DV_Val; - - delete [] E_i; - delete [] Nu_i; - delete [] Rho_s_i; - delete [] Rho_s_DL_i; - delete [] Alpha_i; - delete [] Ni_Vec; -} - - void CFEAElasticity::Compute_Mass_Matrix(CElement *element, const CConfig *config) { /*--- Initialize values for the material model considered ---*/ @@ -198,6 +135,7 @@ void CFEAElasticity::Compute_Mass_Matrix(CElement *element, const CConfig *confi /*--- Retrieve the values of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double Ni_Vec[NNODES_3D] = {}; for (iNode = 0; iNode < nNode; iNode++) { Ni_Vec[iNode] = element->GetNi(iNode,iGauss); } @@ -383,8 +321,8 @@ void CFEAElasticity::ReadDV(const CConfig *config) { if (master_node) cout << "There is no design variable file." << endl; - n_DV = 1; - DV_Val = new su2double[n_DV]; + n_DV = 1; + DV_Val.reset(new su2double[n_DV]); for (unsigned short iDV = 0; iDV < n_DV; iDV++) DV_Val[iDV] = 1.0; @@ -408,7 +346,7 @@ void CFEAElasticity::ReadDV(const CConfig *config) { properties_file.close(); n_DV = iDV; - DV_Val = new su2double[n_DV]; + DV_Val.reset(new su2double[n_DV]); /*--- Reopen the file (TODO: improve this) ---*/ diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index f9273ba0e43..1e0bf29e034 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -39,14 +39,12 @@ CFEALinearElasticity::CFEALinearElasticity(unsigned short val_nDim, unsigned sho void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConfig *config) { unsigned short iVar, jVar, kVar; - unsigned short iGauss, nGauss; - unsigned short iNode, jNode, nNode; + unsigned short iGauss; + unsigned short iNode, jNode; unsigned short iDim; - unsigned short bDim; - su2double Weight, Jac_X; - - su2double AuxMatrix[3][6], *res_aux = new su2double[nVar]; + su2double AuxMatrix[MAXNDIM][DIM_STRAIN_3D] = {}; + su2double Ba_Mat[DIM_STRAIN_3D][MAXNDIM] = {}, Bb_Mat[DIM_STRAIN_3D][MAXNDIM] = {}; /*--- Set element properties and recompute the constitutive matrix, this is needed for multiple material cases and for correct differentiation ---*/ @@ -62,35 +60,21 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf Compute_Constitutive_Matrix(element, config); - /*--- Initialize auxiliary matrices ---*/ - - bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - - for (iVar = 0; iVar < bDim; iVar++) { - for (jVar = 0; jVar < nDim; jVar++) { - Ba_Mat[iVar][jVar] = 0.0; - Bb_Mat[iVar][jVar] = 0.0; - } - } - - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 6; jVar++) { - AuxMatrix[iVar][jVar] = 0.0; - } - } - - element->ClearElement(); /*--- Restarts the element: avoids adding over previous results in other elements --*/ + /*--- Restart the element: avoids adding over previous results in other elements --*/ + element->ClearElement(); element->ComputeGrad_Linear(); - nNode = element->GetnNodes(); - nGauss = element->GetnGaussPoints(); + const auto nNode = element->GetnNodes(); + const auto nGauss = element->GetnGaussPoints(); + const auto bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; for (iGauss = 0; iGauss < nGauss; iGauss++) { - Weight = element->GetWeight(iGauss); - Jac_X = element->GetJ_X(iGauss); + const su2double Weight = element->GetWeight(iGauss); + const su2double Jac_X = element->GetJ_X(iGauss); /*--- Retrieve the values of the gradients of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double GradNi_Ref_Mat[NNODES_3D][MAXNDIM] = {}; for (iNode = 0; iNode < nNode; iNode++) { for (iDim = 0; iDim < nDim; iDim++) { GradNi_Ref_Mat[iNode][iDim] = element->GetGradNi_X(iNode,iGauss,iDim); @@ -101,29 +85,13 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf for (iNode = 0; iNode < nNode; iNode++) { - su2double KAux_t_a[3] = {0.0}; + su2double KAux_t_a[MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { KAux_t_a[iVar] += Weight * thermalStress * GradNi_Ref_Mat[iNode][iVar] * Jac_X; } element->Add_Kt_a(iNode, KAux_t_a); - if (nDim == 2) { - Ba_Mat[0][0] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][0] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][1] = GradNi_Ref_Mat[iNode][0]; - } - else { - Ba_Mat[0][0] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][2] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[3][0] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[3][1] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[4][0] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[4][2] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[5][1] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[5][2] = GradNi_Ref_Mat[iNode][1]; - } + FillBMat(iNode, GradNi_Ref_Mat, Ba_Mat); /*--- Compute the BT.D Matrix ---*/ @@ -138,27 +106,11 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf /*--- Assumming symmetry ---*/ for (jNode = iNode; jNode < nNode; jNode++) { - if (nDim == 2) { - Bb_Mat[0][0] = GradNi_Ref_Mat[jNode][0]; - Bb_Mat[1][1] = GradNi_Ref_Mat[jNode][1]; - Bb_Mat[2][0] = GradNi_Ref_Mat[jNode][1]; - Bb_Mat[2][1] = GradNi_Ref_Mat[jNode][0]; - } - else { - Bb_Mat[0][0] = GradNi_Ref_Mat[jNode][0]; - Bb_Mat[1][1] = GradNi_Ref_Mat[jNode][1]; - Bb_Mat[2][2] = GradNi_Ref_Mat[jNode][2]; - Bb_Mat[3][0] = GradNi_Ref_Mat[jNode][1]; - Bb_Mat[3][1] = GradNi_Ref_Mat[jNode][0]; - Bb_Mat[4][0] = GradNi_Ref_Mat[jNode][2]; - Bb_Mat[4][2] = GradNi_Ref_Mat[jNode][0]; - Bb_Mat[5][1] = GradNi_Ref_Mat[jNode][2]; - Bb_Mat[5][2] = GradNi_Ref_Mat[jNode][1]; - } + FillBMat(jNode, GradNi_Ref_Mat, Bb_Mat); + su2double KAux_ab[MAXNDIM][MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { for (jVar = 0; jVar < nDim; jVar++) { - KAux_ab[iVar][jVar] = 0.0; for (kVar = 0; kVar < bDim; kVar++) { KAux_ab[iVar][jVar] += Weight * AuxMatrix[iVar][kVar] * Bb_Mat[kVar][jVar] * Jac_X; } @@ -178,17 +130,16 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf } /*--- Compute residual ---*/ - for(iNode = 0; iNodeGet_Kab(iNode,jNode); + su2double res_aux[MAXNDIM] = {}; for (iVar = 0; iVar < nVar; iVar++) { - res_aux[iVar] = 0.0; - for (jVar = 0; jVar < nVar; jVar++) - res_aux[iVar] += Kab[iVar*nVar+jVar]* - (element->GetCurr_Coord(jNode,jVar)-element->GetRef_Coord(jNode,jVar)); + for (jVar = 0; jVar < nVar; jVar++) { + res_aux[iVar] += Kab[iVar*nVar+jVar] * + (element->GetCurr_Coord(jNode,jVar) - element->GetRef_Coord(jNode,jVar)); + } } element->Add_Kt_a(iNode, res_aux); } @@ -197,8 +148,6 @@ void CFEALinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConf /*--- Register the stress residual as preaccumulation output ---*/ element->SetPreaccOut_Kt_a(); AD::EndPreacc(); - - delete[] res_aux; } @@ -234,11 +183,12 @@ void CFEALinearElasticity::Compute_Constitutive_Matrix(CElement *element_contain su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { unsigned short iVar, jVar; - unsigned short iGauss, nGauss; - unsigned short iNode, nNode; - unsigned short iDim, bDim; + unsigned short iGauss; + unsigned short iNode; + unsigned short iDim; - su2double avgStress[DIM_STRAIN_3D] = {0.0}; + su2double avgStress[DIM_STRAIN_3D] = {}; + su2double Ba_Mat[DIM_STRAIN_3D][MAXNDIM] = {}; /*--- Set element properties and recompute the constitutive matrix, this is needed for multiple material cases and for correct differentiation ---*/ @@ -254,25 +204,19 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, Compute_Constitutive_Matrix(element, config); - /*--- Initialize auxiliary matrices ---*/ - - bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - - for (iVar = 0; iVar < bDim; iVar++) { - for (jVar = 0; jVar < nDim; jVar++) { - Ba_Mat[iVar][jVar] = 0.0; - } - } - - element->ClearStress(); /*--- Clears the stress in the element to avoid adding over previous results. --*/ + /*--- Clears the stress in the element to avoid adding over previous results. --*/ + element->ClearStress(); element->ComputeGrad_Linear(); - nNode = element->GetnNodes(); - nGauss = element->GetnGaussPoints(); + + const auto nNode = element->GetnNodes(); + const auto nGauss = element->GetnGaussPoints(); + const auto bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; for (iGauss = 0; iGauss < nGauss; iGauss++) { /*--- Retrieve the values of the gradients of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double GradNi_Ref_Mat[NNODES_3D][MAXNDIM] = {}; for (iNode = 0; iNode < nNode; iNode++) { for (iDim = 0; iDim < nDim; iDim++) { GradNi_Ref_Mat[iNode][iDim] = element->GetGradNi_X(iNode,iGauss,iDim); @@ -280,37 +224,17 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, } } - su2double Strain[DIM_STRAIN_3D] = {0.0}; + /*--- Compute the Strain Vector as B*u ---*/ + su2double Strain[DIM_STRAIN_3D] = {}; for (iNode = 0; iNode < nNode; iNode++) { - - /*--- Set matrix B ---*/ - if (nDim == 2) { - Ba_Mat[0][0] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][0] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][1] = GradNi_Ref_Mat[iNode][0]; - } - else { - Ba_Mat[0][0] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[2][2] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[3][0] = GradNi_Ref_Mat[iNode][1]; - Ba_Mat[3][1] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[4][0] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[4][2] = GradNi_Ref_Mat[iNode][0]; - Ba_Mat[5][1] = GradNi_Ref_Mat[iNode][2]; - Ba_Mat[5][2] = GradNi_Ref_Mat[iNode][1]; - } - - /*--- Compute the Strain Vector as B*u ---*/ + FillBMat(iNode, GradNi_Ref_Mat, Ba_Mat); for (iVar = 0; iVar < bDim; iVar++) { for (jVar = 0; jVar < nDim; jVar++) { Strain[iVar] += Ba_Mat[iVar][jVar]*nodalDisplacement[iNode][jVar]; } } - } /*--- Compute the Stress Vector as D*epsilon + thermal stress ---*/ @@ -361,17 +285,9 @@ su2double CFEALinearElasticity::Compute_Averaged_NodalStress(CElement *element, CFEAMeshElasticity::CFEAMeshElasticity(unsigned short val_nDim, unsigned short val_nVar, unsigned long val_nElem, const CConfig *config) : CFEALinearElasticity() { - DV_Val = nullptr; - Rho_s_i = nullptr; - Rho_s_DL_i = nullptr; - Nu_i = nullptr; - Alpha_i = nullptr; - nDim = val_nDim; nVar = val_nVar; - unsigned long iVar; - E = 1.0; Nu = config->GetDeform_PoissonRatio(); Compute_Lame_Parameters(); @@ -386,36 +302,11 @@ CFEAMeshElasticity::CFEAMeshElasticity(unsigned short val_nDim, unsigned short v break; } - E_i = nullptr; if (element_based){ - E_i = new su2double[val_nElem]; - for (iVar = 0; iVar < val_nElem; iVar++){ + E_i.reset(new su2double[val_nElem]); + for (unsigned long iVar = 0; iVar < val_nElem; iVar++){ E_i[iVar] = E; } } - KAux_ab = new su2double* [nDim]; - for (iVar = 0; iVar < nDim; iVar++) { - KAux_ab[iVar] = new su2double[nDim]; - } - - unsigned short nStrain = (nDim==2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - unsigned short nNodes = (nDim==2) ? NNODES_2D : NNODES_3D; - - Ba_Mat = new su2double* [nStrain]; - Bb_Mat = new su2double* [nStrain]; - D_Mat = new su2double* [nStrain]; - Ni_Vec = new su2double [nNodes]; - GradNi_Ref_Mat = new su2double* [nNodes]; - GradNi_Curr_Mat = new su2double* [nNodes]; - for (iVar = 0; iVar < nStrain; iVar++) { - Ba_Mat[iVar] = new su2double[nDim]; - Bb_Mat[iVar] = new su2double[nDim]; - D_Mat[iVar] = new su2double[nStrain]; - } - for (iVar = 0; iVar < nNodes; iVar++) { - GradNi_Ref_Mat[iVar] = new su2double[nDim]; - GradNi_Curr_Mat[iVar] = new su2double[nDim]; - } - } diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index ecda59f65d7..783a4522a10 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -34,58 +34,15 @@ CFEANonlinearElasticity::CFEANonlinearElasticity(unsigned short val_nDim, unsign nearly_incompressible = (config->GetMaterialCompressibility() == STRUCT_COMPRESS::NEARLY_INCOMP); - unsigned short iVar; - - F_Mat = new su2double *[3]; - b_Mat = new su2double *[3]; - FmT_Mat = new su2double *[3]; - Stress_Tensor = new su2double *[3]; - for (iVar = 0; iVar < 3; iVar++) { - F_Mat[iVar] = new su2double [3]; - b_Mat[iVar] = new su2double [3]; - FmT_Mat[iVar] = new su2double [3]; - Stress_Tensor[iVar] = new su2double [3]; - } - - KAux_t_a = new su2double [nDim]; - - KAux_P_ab = new su2double* [nDim]; - for (iVar = 0; iVar < nDim; iVar++) { - KAux_P_ab[iVar] = new su2double[nDim]; - } - - unsigned short nNodes = (nDim==2) ? NNODES_2D : NNODES_3D; - - currentCoord = new su2double* [nNodes]; - for (iVar = 0; iVar < nNodes; iVar++) - currentCoord[iVar] = new su2double[nDim]; - - J_F = 1.0; J_F_Iso = 1.0; + J_F = 1.0; f33 = 1.0; - C10 = Mu/2.0; - D1 = 2.0/Kappa; - - F_Mat_Iso = nullptr; - b_Mat_Iso = nullptr; - - F_Mat_Iso = new su2double *[3]; - b_Mat_Iso = new su2double *[3]; - for (iVar = 0; iVar < 3; iVar++){ - F_Mat_Iso[iVar] = new su2double [3]; - b_Mat_Iso[iVar] = new su2double [3]; - } - maxwell_stress = config->GetDE_Effects(); - ke_DE = 0.0; - nElectric_Field = 0; + ke_DE = 0.0; + nElectric_Field = 0; nDim_Electric_Field = 0; - EField_Ref_Unit = nullptr; - EField_Ref_Mod = nullptr; - EField_Curr_Unit = nullptr; - if (maxwell_stress) { const su2double *Electric_Field_Dir = config->Get_Electric_Field_Dir(); @@ -120,26 +77,26 @@ CFEANonlinearElasticity::CFEANonlinearElasticity(unsigned short val_nDim, unsign } /*--- Initialize pointer for the electric field ---*/ - EField_Ref_Unit = new su2double[nDim_Electric_Field]; + EField_Ref_Unit.reset(new su2double[nDim_Electric_Field]); /*--- Assign values to the auxiliary Electric_Field structure ---*/ for (iDim = 0; iDim < nDim_Electric_Field; iDim++) { EField_Ref_Unit[iDim] = Electric_Field_Dir[iDim]/ref_Efield_mod; } /*--- Auxiliary vector for hosting the electric field modulus in the reference configuration ---*/ - EField_Ref_Mod = new su2double[nElectric_Field]; + EField_Ref_Mod.reset(new su2double[nElectric_Field]); for (iVar = 0; iVar < nElectric_Field; iVar++) EField_Ref_Mod[iVar] = config->Get_Electric_Field_Mod(iVar); /*--- Auxiliary vector for computing the electric field in the current configuration ---*/ - EField_Curr_Unit = new su2double[nDim_Electric_Field]; + EField_Curr_Unit.reset(new su2double[nDim_Electric_Field]); for (iDim = 0; iDim < nDim_Electric_Field; iDim++) { EField_Curr_Unit[iDim] = 0.0; } /*--- Auxiliary vector for storing the electric field constant ---*/ unsigned short nElectric_Constant = config->GetnElectric_Constant(); - ke_DE_i = new su2double[nElectric_Field]; + ke_DE_i.reset(new su2double[nElectric_Field]); if (nElectric_Constant == nElectric_Field) for (iVar = 0; iVar < nElectric_Field; iVar++) ke_DE_i[iVar] = config->GetElectric_Constant(iVar); @@ -163,76 +120,19 @@ CFEANonlinearElasticity::CFEANonlinearElasticity(unsigned short val_nDim, unsign } break; } - } - } -CFEANonlinearElasticity::~CFEANonlinearElasticity() { - - unsigned short iVar; - - for (iVar = 0; iVar < 3; iVar++) { - delete [] F_Mat[iVar]; - delete [] b_Mat[iVar]; - delete [] FmT_Mat[iVar]; - delete [] Stress_Tensor[iVar]; - } - - for (iVar = 0; iVar < nDim; iVar++) { - delete [] KAux_P_ab[iVar]; - } - - unsigned short nNodes = (nDim==2) ? NNODES_2D : NNODES_3D; - - for (iVar = 0; iVar < nNodes; iVar++) { - delete [] currentCoord[iVar]; - } - - delete [] F_Mat; - delete [] b_Mat; - delete [] FmT_Mat; - delete [] Stress_Tensor; - delete [] KAux_t_a; - delete [] KAux_P_ab; - delete [] currentCoord; - - if (F_Mat_Iso != nullptr) { - for (iVar = 0; iVar < 3; iVar++){ - if (F_Mat_Iso[iVar] != nullptr) delete [] F_Mat_Iso[iVar]; - } - delete [] F_Mat_Iso; - } - if (b_Mat_Iso != nullptr){ - for (iVar = 0; iVar < 3; iVar++){ - if (b_Mat_Iso[iVar] != nullptr) delete [] b_Mat_Iso[iVar]; - } - delete [] b_Mat_Iso; - } - - delete [] EField_Ref_Unit; - delete [] EField_Ref_Mod; - delete [] EField_Curr_Unit; - - if (maxwell_stress) { - delete [] ke_DE_i; - } -} - - void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CConfig *config) { unsigned short iVar, jVar, kVar; - unsigned short iGauss, nGauss; - unsigned short iNode, jNode, nNode; - unsigned short iDim, bDim; - - su2double Ks_Aux_ab; - - su2double Weight, Jac_x; + unsigned short iGauss; + unsigned short iNode, jNode; + unsigned short iDim; - su2double AuxMatrixKc[3][6]; - su2double AuxMatrixKs[3]; + su2double AuxMatrixKc[MAXNDIM][DIM_STRAIN_3D] = {}; + su2double AuxMatrixKs[MAXNDIM] = {}; + su2double Ba_Mat[DIM_STRAIN_3D][MAXNDIM] = {}, Bb_Mat[DIM_STRAIN_3D][MAXNDIM] = {}; /*--- TODO: Initialize values for the material model considered ---*/ // cout << "PROPERTY: " << element->Get_iProp() << " and DV " << element->Get_iDV() << endl; @@ -251,55 +151,37 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC /*--- Recompute Lame parameters as they depend on the material properties ---*/ Compute_Lame_Parameters(); - /*-----------------------------------------------------------*/ - - /*--- Initialize auxiliary matrices ---*/ - - bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; - - for (iVar = 0; iVar < bDim; iVar++) { - for (jVar = 0; jVar < nDim; jVar++) { - Ba_Mat[iVar][jVar] = 0.0; - Bb_Mat[iVar][jVar] = 0.0; - } - } - - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 6; jVar++) { - AuxMatrixKc[iVar][jVar] = 0.0; - } - } - - for (iVar = 0; iVar < 3; iVar++) { - AuxMatrixKs[iVar] = 0.0; - } - - element->ClearElement(); /*--- Restarts the element to avoid adding over previous results. --*/ + /*--- Restarts the element to avoid adding over previous results. --*/ + element->ClearElement(); element->ComputeGrad_Linear(); element->ComputeGrad_NonLinear(); - nNode = element->GetnNodes(); - nGauss = element->GetnGaussPoints(); + const auto nNode = element->GetnNodes(); + const auto nGauss = element->GetnGaussPoints(); + const auto bDim = (nDim == 2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; /*--- Full integration of the constitutive and stress term ---*/ for (iGauss = 0; iGauss < nGauss; iGauss++) { - Weight = element->GetWeight(iGauss); - Jac_x = element->GetJ_x(iGauss); + const su2double Weight = element->GetWeight(iGauss); + const su2double Jac_x = element->GetJ_x(iGauss); /*--- Initialize the deformation gradient for each Gauss Point ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - F_Mat[iVar][jVar] = 0.0; - b_Mat[iVar][jVar] = 0.0; + for (iVar = 0; iVar < MAXNDIM; iVar++) { + for (jVar = 0; jVar < MAXNDIM; jVar++) { + F_Mat[iVar][jVar] = 0; } } /*--- Retrieve the values of the gradients of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double GradNi_Ref_Mat[NNODES_3D][MAXNDIM] = {}; + su2double GradNi_Curr_Mat[NNODES_3D][MAXNDIM] = {}; + su2double currentCoord[NNODES_3D][MAXNDIM] = {}; + for (iNode = 0; iNode < nNode; iNode++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -330,22 +212,11 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC /*--- Determinant of F --> Jacobian of the transformation ---*/ - J_F = F_Mat[0][0]*F_Mat[1][1]*F_Mat[2][2]+ - F_Mat[0][1]*F_Mat[1][2]*F_Mat[2][0]+ - F_Mat[0][2]*F_Mat[1][0]*F_Mat[2][1]- - F_Mat[0][2]*F_Mat[1][1]*F_Mat[2][0]- - F_Mat[1][2]*F_Mat[2][1]*F_Mat[0][0]- - F_Mat[2][2]*F_Mat[0][1]*F_Mat[1][0]; + ComputeJ_F(); /*--- Compute the left Cauchy deformation tensor ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - for (kVar = 0; kVar < 3; kVar++) { - b_Mat[iVar][jVar] += F_Mat[iVar][kVar]*F_Mat[jVar][kVar]; - } - } - } + ComputeLeftCauchyGreenTensor(); /*--- Compute the constitutive matrix ---*/ @@ -362,8 +233,8 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC /*--- Compute the nodal stress term for each gaussian point and for each node, ---*/ /*--- and add it to the element structure to be retrieved from the solver ---*/ + su2double KAux_t_a[MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { - KAux_t_a[iVar] = 0.0; for (jVar = 0; jVar < nDim; jVar++) { KAux_t_a[iVar] += Weight * Stress_Tensor[iVar][jVar] * GradNi_Curr_Mat[iNode][jVar] * Jac_x; } @@ -375,25 +246,9 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC /*----------------------- CONSTITUTIVE AND STRESS TERM ---------------------------*/ /*--------------------------------------------------------------------------------*/ - if (nDim == 2) { - Ba_Mat[0][0] = GradNi_Curr_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Curr_Mat[iNode][1]; - Ba_Mat[2][0] = GradNi_Curr_Mat[iNode][1]; - Ba_Mat[2][1] = GradNi_Curr_Mat[iNode][0]; - } - else if (nDim ==3) { - Ba_Mat[0][0] = GradNi_Curr_Mat[iNode][0]; - Ba_Mat[1][1] = GradNi_Curr_Mat[iNode][1]; - Ba_Mat[2][2] = GradNi_Curr_Mat[iNode][2]; - Ba_Mat[3][0] = GradNi_Curr_Mat[iNode][1]; - Ba_Mat[3][1] = GradNi_Curr_Mat[iNode][0]; - Ba_Mat[4][0] = GradNi_Curr_Mat[iNode][2]; - Ba_Mat[4][2] = GradNi_Curr_Mat[iNode][0]; - Ba_Mat[5][1] = GradNi_Curr_Mat[iNode][2]; - Ba_Mat[5][2] = GradNi_Curr_Mat[iNode][1]; - } + FillBMat(iNode, GradNi_Curr_Mat, Ba_Mat); - /*--- Compute the BT.D Matrix ---*/ + /*--- Compute the BT.D Matrix ---*/ for (iVar = 0; iVar < nDim; iVar++) { for (jVar = 0; jVar < bDim; jVar++) { @@ -415,28 +270,12 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC /*--- Assumming symmetry ---*/ for (jNode = iNode; jNode < nNode; jNode++) { - if (nDim == 2) { - Bb_Mat[0][0] = GradNi_Curr_Mat[jNode][0]; - Bb_Mat[1][1] = GradNi_Curr_Mat[jNode][1]; - Bb_Mat[2][0] = GradNi_Curr_Mat[jNode][1]; - Bb_Mat[2][1] = GradNi_Curr_Mat[jNode][0]; - } - else if (nDim ==3) { - Bb_Mat[0][0] = GradNi_Curr_Mat[jNode][0]; - Bb_Mat[1][1] = GradNi_Curr_Mat[jNode][1]; - Bb_Mat[2][2] = GradNi_Curr_Mat[jNode][2]; - Bb_Mat[3][0] = GradNi_Curr_Mat[jNode][1]; - Bb_Mat[3][1] = GradNi_Curr_Mat[jNode][0]; - Bb_Mat[4][0] = GradNi_Curr_Mat[jNode][2]; - Bb_Mat[4][2] = GradNi_Curr_Mat[jNode][0]; - Bb_Mat[5][1] = GradNi_Curr_Mat[jNode][2]; - Bb_Mat[5][2] = GradNi_Curr_Mat[jNode][1]; - } + FillBMat(jNode, GradNi_Curr_Mat, Bb_Mat); /*--- KAux_ab is the term for the constitutive part of the tangent matrix ---*/ + su2double KAux_ab[MAXNDIM][MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { for (jVar = 0; jVar < nDim; jVar++) { - KAux_ab[iVar][jVar] = 0.0; for (kVar = 0; kVar < bDim; kVar++) { KAux_ab[iVar][jVar] += Weight * AuxMatrixKc[iVar][kVar] * Bb_Mat[kVar][jVar] * Jac_x; } @@ -444,7 +283,7 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC } /*--- Ks_Aux_ab is the term for the constitutive part of the tangent matrix ---*/ - Ks_Aux_ab = 0.0; + su2double Ks_Aux_ab = 0.0; for (iVar = 0; iVar < nDim; iVar++) { Ks_Aux_ab += Weight * AuxMatrixKs[iVar] * GradNi_Curr_Mat[jNode][iVar] * Jac_x; } @@ -471,9 +310,9 @@ void CFEANonlinearElasticity::Compute_Tangent_Matrix(CElement *element, const CC void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const CConfig *config) { - unsigned short iVar, jVar, kVar; - unsigned short iGauss, nGauss; - unsigned short iNode, nNode; + unsigned short iVar, jVar; + unsigned short iGauss; + unsigned short iNode; unsigned short iDim; /*--- TODO: Initialize values for the material model considered ---*/ @@ -494,34 +333,35 @@ void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const /*-----------------------------------------------------------*/ - su2double Weight, Jac_x; - element->ClearElement(); /*--- Restarts the element to avoid adding over previous results. --*/ element->ComputeGrad_Linear(); /*--- TODO: Check if we can take this out so we don't have to do it twice. ---*/ element->ComputeGrad_NonLinear(); - nNode = element->GetnNodes(); - nGauss = element->GetnGaussPoints(); + const auto nNode = element->GetnNodes(); + const auto nGauss = element->GetnGaussPoints(); /*--- Full integration of the nodal stress ---*/ for (iGauss = 0; iGauss < nGauss; iGauss++) { - Weight = element->GetWeight(iGauss); - Jac_x = element->GetJ_x(iGauss); + const su2double Weight = element->GetWeight(iGauss); + const su2double Jac_x = element->GetJ_x(iGauss); /*--- Initialize the deformation gradient for each Gauss Point ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - F_Mat[iVar][jVar] = 0.0; - b_Mat[iVar][jVar] = 0.0; + for (iVar = 0; iVar < MAXNDIM; iVar++) { + for (jVar = 0; jVar < MAXNDIM; jVar++) { + F_Mat[iVar][jVar] = 0; } } /*--- Retrieve the values of the gradients of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double GradNi_Ref_Mat[NNODES_3D][MAXNDIM] = {}; + su2double GradNi_Curr_Mat[NNODES_3D][MAXNDIM] = {}; + su2double currentCoord[NNODES_3D][MAXNDIM] = {}; + for (iNode = 0; iNode < nNode; iNode++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -552,22 +392,11 @@ void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const /*--- Determinant of F --> Jacobian of the transformation ---*/ - J_F = F_Mat[0][0]*F_Mat[1][1]*F_Mat[2][2]+ - F_Mat[0][1]*F_Mat[1][2]*F_Mat[2][0]+ - F_Mat[0][2]*F_Mat[1][0]*F_Mat[2][1]- - F_Mat[0][2]*F_Mat[1][1]*F_Mat[2][0]- - F_Mat[1][2]*F_Mat[2][1]*F_Mat[0][0]- - F_Mat[2][2]*F_Mat[0][1]*F_Mat[1][0]; + ComputeJ_F(); /*--- Compute the left Cauchy deformation tensor ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - for (kVar = 0; kVar < 3; kVar++) { - b_Mat[iVar][jVar] += F_Mat[iVar][kVar]*F_Mat[jVar][kVar]; - } - } - } + ComputeLeftCauchyGreenTensor(); /*--- Compute the stress tensor ---*/ @@ -576,11 +405,11 @@ void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const for (iNode = 0; iNode < nNode; iNode++) { - /*--- Compute the nodal stress term for each gaussian point and for each node, ---*/ - /*--- and add it to the element structure to be retrieved from the solver ---*/ + /*--- Compute the nodal stress term for each gaussian point and for each node, ---*/ + /*--- and add it to the element structure to be retrieved from the solver ---*/ + su2double KAux_t_a[MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { - KAux_t_a[iVar] = 0.0; for (jVar = 0; jVar < nDim; jVar++) { KAux_t_a[iVar] += Weight * Stress_Tensor[iVar][jVar] * GradNi_Curr_Mat[iNode][jVar] * Jac_x; } @@ -600,19 +429,18 @@ void CFEANonlinearElasticity::Compute_NodalStress_Term(CElement *element, const void CFEANonlinearElasticity::Add_MaxwellStress(CElement *element, const CConfig *config) { -// Adds the Maxwell stress to the output of the stress Sxx, Syy, Szz, SVM... - - unsigned short iDim, jDim; + // Adds the Maxwell stress to the output of the stress Sxx, Syy, Szz, SVM... su2double E0 = 0.0, E1 = 0.0, E2 = 0.0; su2double E0_2 = 0.0, E1_2 = 0.0, E2_2 = 0.0; su2double E_2 = 0.0; - Compute_FmT_Mat(); + su2double FmT_Mat[MAXNDIM][MAXNDIM] = {}; + Compute_FmT_Mat(F_Mat, J_F, FmT_Mat); - for (iDim = 0; iDim < nDim; iDim++){ + for (unsigned short iDim = 0; iDim < nDim; iDim++){ EField_Curr_Unit[iDim] = 0.0; - for (jDim = 0; jDim < nDim; jDim++){ + for (unsigned short jDim = 0; jDim < nDim; jDim++){ EField_Curr_Unit[iDim] += FmT_Mat[iDim][jDim] * EField_Ref_Unit[jDim]; } } @@ -645,41 +473,23 @@ void CFEANonlinearElasticity::SetElectric_Properties(const CElement *element, co } -void CFEANonlinearElasticity::Compute_FmT_Mat() { - - FmT_Mat[0][0] = (F_Mat[1][1]*F_Mat[2][2] - F_Mat[1][2]*F_Mat[2][1]) / J_F; - FmT_Mat[0][1] = (F_Mat[1][2]*F_Mat[2][0] - F_Mat[2][2]*F_Mat[1][0]) / J_F; - FmT_Mat[0][2] = (F_Mat[1][0]*F_Mat[2][1] - F_Mat[1][1]*F_Mat[2][0]) / J_F; - - FmT_Mat[1][0] = (F_Mat[0][2]*F_Mat[2][1] - F_Mat[0][1]*F_Mat[2][2]) / J_F; - FmT_Mat[1][1] = (F_Mat[0][0]*F_Mat[2][2] - F_Mat[2][0]*F_Mat[0][2]) / J_F; - FmT_Mat[1][2] = (F_Mat[0][1]*F_Mat[2][1] - F_Mat[0][0]*F_Mat[2][0]) / J_F; - - FmT_Mat[2][0] = (F_Mat[0][1]*F_Mat[1][2] - F_Mat[0][2]*F_Mat[1][1]) / J_F; - FmT_Mat[2][1] = (F_Mat[0][2]*F_Mat[1][0] - F_Mat[0][0]*F_Mat[1][2]) / J_F; - FmT_Mat[2][2] = (F_Mat[0][0]*F_Mat[1][1] - F_Mat[0][1]*F_Mat[1][0]) / J_F; - -} - void CFEANonlinearElasticity::Compute_Isochoric_F_b() { - unsigned short iVar, jVar, kVar; - - J_F_Iso = pow(J_F,-0.333333333333333); + const su2double J_F_Iso = pow(J_F,-0.333333333333333); // Isochoric deformation tensor - for (iVar = 0; iVar < 3; iVar++){ - for (jVar = 0; jVar < 3; jVar++){ + su2double F_Mat_Iso[MAXNDIM][MAXNDIM]; + for (unsigned short iVar = 0; iVar < MAXNDIM; iVar++) { + for (unsigned short jVar = 0; jVar < MAXNDIM; jVar++) { F_Mat_Iso[iVar][jVar] = F_Mat[iVar][jVar] * J_F_Iso; } } // Isochoric left Cauchy-Green tensor - - for (iVar = 0; iVar < 3; iVar++){ - for (jVar = 0; jVar < 3; jVar++){ + for (unsigned short iVar = 0; iVar < MAXNDIM; iVar++) { + for (unsigned short jVar = 0; jVar < MAXNDIM; jVar++) { b_Mat_Iso[iVar][jVar] = 0.0; - for (kVar = 0; kVar < 3; kVar++){ + for (unsigned short kVar = 0; kVar < MAXNDIM; kVar++) { b_Mat_Iso[iVar][jVar] += F_Mat_Iso[iVar][kVar]*F_Mat_Iso[jVar][kVar]; } } @@ -689,9 +499,7 @@ void CFEANonlinearElasticity::Compute_Isochoric_F_b() { void CFEANonlinearElasticity::Assign_cijkl_D_Mat() { - unsigned short iVar, jVar; - - if (nDim == 2){ + if (nDim == 2) { D_Mat[0][0] = cijkl[0][0][0][0]; D_Mat[1][1] = cijkl[1][1][1][1]; @@ -705,8 +513,7 @@ void CFEANonlinearElasticity::Assign_cijkl_D_Mat() { D_Mat[2][1] = cijkl[1][0][1][1]; D_Mat[2][2] = cijkl[0][1][0][1]; - } - else{ + } else { D_Mat[0][0] = cijkl[0][0][0][0]; D_Mat[1][1] = cijkl[1][1][1][1]; D_Mat[2][2] = cijkl[2][2][2][2]; @@ -734,8 +541,8 @@ void CFEANonlinearElasticity::Assign_cijkl_D_Mat() { D_Mat[4][5] = cijkl[0][2][1][2]; - for (jVar = 0; jVar < 6; jVar++){ - for (iVar = 0; iVar < jVar; iVar++){ + for (unsigned short jVar = 0; jVar < 6; jVar++){ + for (unsigned short iVar = 0; iVar < jVar; iVar++){ D_Mat[jVar][iVar] = D_Mat[iVar][jVar]; } } @@ -746,11 +553,11 @@ void CFEANonlinearElasticity::Assign_cijkl_D_Mat() { su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *element, const CConfig *config) { - unsigned short iVar, jVar, kVar; - unsigned short iGauss, nGauss; - unsigned short iDim, iNode, nNode; + unsigned short iVar, jVar; + unsigned short iGauss; + unsigned short iDim, iNode; - su2double avgStress[DIM_STRAIN_3D] = {0.0}; + su2double avgStress[DIM_STRAIN_3D] = {}; /*--- TODO: Initialize values for the material model considered ---*/ SetElement_Properties(element, config); @@ -772,35 +579,36 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen /*--- Recompute Lame parameters as they depend on the material properties ---*/ Compute_Lame_Parameters(); - su2double Weight, Jac_x; - element->ClearStress(); element->ClearElement(); /*--- Restarts the element to avoid adding over previous results. ---*/ element->ComputeGrad_Linear(); element->ComputeGrad_NonLinear(); - nNode = element->GetnNodes(); - nGauss = element->GetnGaussPoints(); + const auto nNode = element->GetnNodes(); + const auto nGauss = element->GetnGaussPoints(); /*--- Computation of the deformation gradient ---*/ for (iGauss = 0; iGauss < nGauss; iGauss++) { - Weight = element->GetWeight(iGauss); - Jac_x = element->GetJ_x(iGauss); + const su2double Weight = element->GetWeight(iGauss); + const su2double Jac_x = element->GetJ_x(iGauss); /*--- Initialize the deformation gradient for each Gauss Point ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - F_Mat[iVar][jVar] = 0.0; - b_Mat[iVar][jVar] = 0.0; + for (iVar = 0; iVar < MAXNDIM; iVar++) { + for (jVar = 0; jVar < MAXNDIM; jVar++) { + F_Mat[iVar][jVar] = 0; } } /*--- Retrieve the values of the gradients of the shape functions for each node ---*/ /*--- This avoids repeated operations ---*/ + su2double GradNi_Ref_Mat[NNODES_3D][MAXNDIM] = {}; + su2double GradNi_Curr_Mat[NNODES_3D][MAXNDIM] = {}; + su2double currentCoord[NNODES_3D][MAXNDIM] = {}; + for (iNode = 0; iNode < nNode; iNode++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -831,22 +639,11 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen /*--- Determinant of F --> Jacobian of the transformation ---*/ - J_F = F_Mat[0][0]*F_Mat[1][1]*F_Mat[2][2]+ - F_Mat[0][1]*F_Mat[1][2]*F_Mat[2][0]+ - F_Mat[0][2]*F_Mat[1][0]*F_Mat[2][1]- - F_Mat[0][2]*F_Mat[1][1]*F_Mat[2][0]- - F_Mat[1][2]*F_Mat[2][1]*F_Mat[0][0]- - F_Mat[2][2]*F_Mat[0][1]*F_Mat[1][0]; + ComputeJ_F(); /*--- Compute the left Cauchy deformation tensor ---*/ - for (iVar = 0; iVar < 3; iVar++) { - for (jVar = 0; jVar < 3; jVar++) { - for (kVar = 0; kVar < 3; kVar++) { - b_Mat[iVar][jVar] += F_Mat[iVar][kVar]*F_Mat[jVar][kVar]; - } - } - } + ComputeLeftCauchyGreenTensor(); /*--- Compute the stress tensor ---*/ @@ -867,8 +664,8 @@ su2double CFEANonlinearElasticity::Compute_Averaged_NodalStress(CElement *elemen /*--- Compute the nodal stress term for each gaussian point and for each node, ---*/ /*--- and add it to the element structure to be retrieved from the solver ---*/ + su2double KAux_t_a[MAXNDIM] = {}; for (iVar = 0; iVar < nDim; iVar++) { - KAux_t_a[iVar] = 0.0; for (jVar = 0; jVar < nDim; jVar++) { KAux_t_a[iVar] += Weight * Stress_Tensor[iVar][jVar] * GradNi_Curr_Mat[iNode][jVar] * Jac_x; } diff --git a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp index 65bb6341809..90e23c38536 100644 --- a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp +++ b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp @@ -181,7 +181,7 @@ void CFEM_Knowles_NearInc::Compute_Constitutive_Matrix(CElement *element, const void CFEM_Knowles_NearInc::Compute_Stress_Tensor(CElement *element, const CConfig *config, unsigned short iGauss) { - /* -- Suchocki (2011) (full reference in class constructor). ---*/ + /*--- Suchocki (2011) (full reference in class constructor). ---*/ unsigned short iVar, jVar; @@ -208,9 +208,7 @@ void CFEM_Knowles_NearInc::Compute_Stress_Tensor(CElement *element, const CConfi } CFEM_DielectricElastomer::CFEM_DielectricElastomer(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : - CFEANonlinearElasticity(val_nDim, val_nVar, config) { - -} + CFEANonlinearElasticity(val_nDim, val_nVar, config) {} void CFEM_DielectricElastomer::Compute_Constitutive_Matrix(CElement *element, const CConfig *config) { @@ -230,36 +228,16 @@ void CFEM_DielectricElastomer::Compute_Constitutive_Matrix(CElement *element, co D_Mat[5][0] = 0.0; D_Mat[5][1] = 0.0; D_Mat[5][2] = 0.0; D_Mat[5][3] = 0.0; D_Mat[5][4] = 0.0; D_Mat[5][5] = 0.0; } - } void CFEM_DielectricElastomer::Compute_Stress_Tensor(CElement *element, const CConfig *config, unsigned short iGauss) { - unsigned short iDim, jDim; - - su2double E0 = 0.0, E1 = 0.0, E2 = 0.0; - su2double E0_2 = 0.0, E1_2 = 0.0, E2_2 = 0.0; - su2double E_2 = 0.0; - - Compute_FmT_Mat(); - - for (iDim = 0; iDim < nDim; iDim++){ - EField_Curr_Unit[iDim] = 0.0; - for (jDim = 0; jDim < nDim; jDim++){ - EField_Curr_Unit[iDim] += FmT_Mat[iDim][jDim] * EField_Ref_Unit[jDim]; + for (unsigned short iDim = 0; iDim < MAXNDIM; ++iDim) { + for (unsigned short jDim = 0; jDim < MAXNDIM; ++jDim) { + Stress_Tensor[iDim][jDim] = 0; } } - - E0 = EFieldMod_Ref*EField_Curr_Unit[0]; E0_2 = pow(E0,2); - E1 = EFieldMod_Ref*EField_Curr_Unit[1]; E1_2 = pow(E1,2); - if (nDim == 3) {E2 = EFieldMod_Ref*EField_Curr_Unit[2]; E2_2 = pow(E2,2);} - - E_2 = E0_2+E1_2+E2_2; - - Stress_Tensor[0][0] = ke_DE*(E0_2-0.5*E_2); Stress_Tensor[0][1] = ke_DE*E0*E1; Stress_Tensor[0][2] = ke_DE*E0*E2; - Stress_Tensor[1][0] = ke_DE*E1*E0; Stress_Tensor[1][1] = ke_DE*(E1_2-0.5*E_2); Stress_Tensor[1][2] = ke_DE*E1*E2; - Stress_Tensor[2][0] = ke_DE*E2*E0; Stress_Tensor[2][1] = ke_DE*E2*E1; Stress_Tensor[2][2] = ke_DE*(E2_2-0.5*E_2); - + Add_MaxwellStress(element, config); } CFEM_IdealDE::CFEM_IdealDE(unsigned short val_nDim, unsigned short val_nVar, diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 006271bea71..65119324452 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -232,9 +232,14 @@ def run_test(self, with_tsan=False, with_asan=False, with_tapetests=False): for j in range(len(data)): sim_vals.append( float(data[j]) ) delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) - if delta_vals[j] > self.tol: - exceed_tol = True - passed = False + if isinstance(self.tol, list): + if delta_vals[j] > self.tol[j]: + exceed_tol = True + passed = False + else: + if delta_vals[j] > self.tol: + exceed_tol = True + passed = False break else: iter_missing = True diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index cadbede988e..cbbf7dad1f7 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -298,7 +298,8 @@ def main(): ramp_msw.cfg_dir = "euler/ramp" ramp_msw.cfg_file = "inv_ramp_msw.cfg" ramp_msw.test_iter = 100 - ramp_msw.test_vals = [-7.522451, -1.791193, -0.077520, 0.054427] + ramp_msw.test_vals = [-7.5, -1.765, -0.077520, 0.054427] + ramp_msw.tol = [0.03, 0.03, 0.00001, 0.00001] test_list.append(ramp_msw) # MFR_coupling