From 90f0c25844b15548632401b92f6a1eca843df7ac Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 17 May 2021 10:25:37 +0200 Subject: [PATCH] Identified static functions --- CoreFlows/Models/inc/DiffusionEquation.hxx | 6 +-- .../Models/inc/LinearElasticityModel.hxx | 6 +-- .../inc/StationaryDiffusionEquation.hxx | 6 +-- CoreFlows/Models/inc/utilitaire_algebre.h | 42 +++++++++---------- CoreFlows/Models/src/FiveEqsTwoFluid.cxx | 23 +++++----- CoreFlows/Models/src/IsothermalTwoFluid.cxx | 25 +++++------ CoreFlows/Models/src/ProblemFluid.cxx | 37 ++++++++-------- CoreFlows/Models/src/SinglePhase.cxx | 18 ++++---- CoreFlows/Models/src/SinglePhaseStaggered.cxx | 13 +++--- .../src/StationaryDiffusionEquation.cxx | 4 +- 10 files changed, 82 insertions(+), 98 deletions(-) diff --git a/CoreFlows/Models/inc/DiffusionEquation.hxx b/CoreFlows/Models/inc/DiffusionEquation.hxx index 73dc61f..cb922c6 100755 --- a/CoreFlows/Models/inc/DiffusionEquation.hxx +++ b/CoreFlows/Models/inc/DiffusionEquation.hxx @@ -141,9 +141,9 @@ protected : /*********** Functions for finite element method ***********/ Vector gradientNodal(Matrix M, vector< double > v);//gradient of nodal shape functions double computeDiffusionMatrixFE(bool & stop); - int fact(int n); - int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes); - int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes); + static int fact(int n); + static int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes); + static int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes); TimeScheme _timeScheme; map _limitField; diff --git a/CoreFlows/Models/inc/LinearElasticityModel.hxx b/CoreFlows/Models/inc/LinearElasticityModel.hxx index 81aeed2..bdaee35 100755 --- a/CoreFlows/Models/inc/LinearElasticityModel.hxx +++ b/CoreFlows/Models/inc/LinearElasticityModel.hxx @@ -178,9 +178,9 @@ protected : /*********** Functions for finite element method ***********/ Vector gradientNodal(Matrix M, vector< double > v);//gradient of nodal shape functions double computeStiffnessMatrixFE(bool & stop); - int fact(int n); - int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes); - int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes); + static int fact(int n); + static int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes); + static int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes); /********* Possibility to set a boundary field as Dirichlet boundary condition *********/ bool _dirichletValuesSet; diff --git a/CoreFlows/Models/inc/StationaryDiffusionEquation.hxx b/CoreFlows/Models/inc/StationaryDiffusionEquation.hxx index 8c98095..7810a39 100755 --- a/CoreFlows/Models/inc/StationaryDiffusionEquation.hxx +++ b/CoreFlows/Models/inc/StationaryDiffusionEquation.hxx @@ -219,9 +219,9 @@ protected : /*********** Functions for finite element method ***********/ Vector gradientNodal(Matrix M, vector< double > v);//gradient of nodal shape functions double computeDiffusionMatrixFE(bool & stop); - int fact(int n); - int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes) const; - int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes) const; + static int fact(int n); + static int unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes); + static int globalNodeIndex(int unknownIndex, std::vector< int > dirichletNodes); /********* Possibility to set a boundary field as DirichletNeumann boundary condition *********/ bool _dirichletValuesSet; diff --git a/CoreFlows/Models/inc/utilitaire_algebre.h b/CoreFlows/Models/inc/utilitaire_algebre.h index 874a356..033b7bb 100755 --- a/CoreFlows/Models/inc/utilitaire_algebre.h +++ b/CoreFlows/Models/inc/utilitaire_algebre.h @@ -158,12 +158,12 @@ class Polynoms { public: - void abs_par_interp_directe(int n, vector< complex< double > > vp, double * A, int sizeA, double epsilon, double *result,vector< complex< double > > y); + static void abs_par_interp_directe(int n, vector< complex< double > > vp, double * A, int sizeA, double epsilon, double *result,vector< complex< double > > y); /** \fn polynome_caracteristique * \brief Calcule le polynome caracteristique * @return */ - vector< double > polynome_caracteristique(double alpha_v, double alpha_l, double Uv, double Ul, double rhov, double rhol, double cv_2, double cl_2, double dPiv, double dPil);//c= inverse vitesse du son! + static vector< double > polynome_caracteristique(double alpha_v, double alpha_l, double Uv, double Ul, double rhov, double rhol, double cv_2, double cl_2, double dPiv, double dPil);//c= inverse vitesse du son! /** \fn polynome_caracteristique * \brief * @param alpha1 @@ -181,24 +181,24 @@ public: * @param g2 * @param epsilon * @return */ - vector< double > polynome_caracteristique(double alpha1, double alpha2, double u1, double u2, double rho1, double rho2, double invc1sq, double invc2sq, double dpi1, double dpi2, double g2press, double g2alpha, double g2, double epsilon); + static vector< double > polynome_caracteristique(double alpha1, double alpha2, double u1, double u2, double rho1, double rho2, double invc1sq, double invc2sq, double dpi1, double dpi2, double g2press, double g2alpha, double g2, double epsilon); /** \fn module * \brief calcule le module d'un nombre complexe * @param z est un nombre complexe * @return calcule le module de z*/ - double module(complex< double > z); + static double module(complex< double > z); /** \fn modulec calcule le module² de z */ - double modulec(complex< double > z); + static double modulec(complex< double > z); /** \fn abs_generalise * \brief calcule la valeur absolue d'un nombre complexe * \Details calcule la valeur absolue d'un nombre complexe en prenant en compte * que la partie réelle c-a-d si z= a+ib abs_generalize() renvoie |a|+ib * @param z * @return si z = a+ib elle renvoie |a|+ib */ - complex< double > abs_generalise(complex< double > z); + static complex< double > abs_generalise(complex< double > z); - int new_tri_selectif(vector< complex< double > > &L, int n, double epsilon); + static int new_tri_selectif(vector< complex< double > > &L, int n, double epsilon); /** \fn tri_selectif * \brief @@ -207,7 +207,7 @@ public: * @param epsilon * @return */ template< typename T > - int tri_selectif(T& L, int n, double epsilon); + static int tri_selectif(T& L, int n, double epsilon); /** \fn matrixProduct * \brief calcule le produit de 2 matrices . @@ -217,7 +217,7 @@ public: * @param R2,C2 la taille de la matrice2 Nbr de ligne et le nbr de colonne * @param out le resultat de Matrix1*Matrix2 * @return */ - void matrixProduct + static void matrixProduct ( const double *Matrix1, const int &R1, @@ -235,7 +235,7 @@ public: * @param Vector correspond au vecteur du produit * @param out le resultat de Matrix*Vector * @return */ - void matrixProdVec + static void matrixProdVec ( const double *Matrix, const int &R1, const int &C1, @@ -243,7 +243,7 @@ public: double *out ); - bool belongTo(complex< double > a , vector< complex > v, double epsilon); + static bool belongTo(complex< double > a , vector< complex > v, double epsilon); private: @@ -252,7 +252,7 @@ private: * @param *U,*V les 2 vecteurs * @param N taille des 2 vecteurs * @return la somme de U et V dans U*/ -void add +static void add ( double *U, //vecteur auquel on ajoute int N, //taille du vecteur @@ -267,7 +267,7 @@ void add * @param *ab le resultat * @return */ -void tensor +static void tensor ( const double *a, //vecteur gauche int N, //taille du vecteur gauche const double *b, //vecteur droit @@ -281,31 +281,31 @@ void tensor * @param N taille de la matrice * @param shift résultat * @return renvoie la trace de la matrice Matrix dans shift */ -void shift_diagonal( double *Matrix, const int N, double shift); +static void shift_diagonal( double *Matrix, const int N, double shift); //qques outils d'algebre des polynomes /** \fn remplir_trinome * \brief remplie un trinome */ -void remplir_trinome(double coeff, double u, double alpha, vector< double >& trinome); +static void remplir_trinome(double coeff, double u, double alpha, vector< double >& trinome); /** \fn additionne * \brief Additionne 2 vecteurs de tailles differentes * @param P,Q les 2 vecteurs à additionner * @param n,m les 2 tailles respectives des vecteurs P et Q * @return un vecteur qui correspond a P+Q*/ -vector< double > additionne(const vector< double >& P, const vector< double >& Q, int n, int m); +static vector< double > additionne(const vector< double >& P, const vector< double >& Q, int n, int m); /** \fn multiplie * \brief Calcule le produit scalaire de 2 vecteurs de tailles differentes * @param P,Q les 2 vecteurs * @param n,m les 2 tailles respectives des 2 vecteurs * @return un vecteur correspond à (P,Q) */ -vector< double > multiplie(const vector< double >& P, const vector< double >& Q, int n, int m); +static vector< double > multiplie(const vector< double >& P, const vector< double >& Q, int n, int m); //Pour le tri des valeurs propres -void ordre_croissant_abs(vector< complex< double > > &L, int n); +static void ordre_croissant_abs(vector< complex< double > > &L, int n); //Calcul des coefficients du polynome d'interpolation x->y dans la base de Newton template @@ -317,12 +317,12 @@ template * @param y * @param epsilon * @return */ -vector< complex< double > > dif_div(int n, const vector< complex< double > >& x, const vector< T >& y, double epsilon);//n=nb valeurs à interpoler +static vector< complex< double > > dif_div(int n, const vector< complex< double > >& x, const vector< T >& y, double epsilon);//n=nb valeurs à interpoler //attention, Les vp complexes conjugu�es doivent se suivre dans la liste x -void appliquer_dif_div(int n, const vector< complex< double > >& dif_div, const vector< complex< double > >& x, const double* A, const int sizeA, double epsilon, double *p);//p=result +static void appliquer_dif_div(int n, const vector< complex< double > >& dif_div, const vector< complex< double > >& x, const double* A, const int sizeA, double epsilon, double *p);//p=result -double avr(double a, double b); +static double avr(double a, double b); }; #endif diff --git a/CoreFlows/Models/src/FiveEqsTwoFluid.cxx b/CoreFlows/Models/src/FiveEqsTwoFluid.cxx index 57a3722..8a165fa 100755 --- a/CoreFlows/Models/src/FiveEqsTwoFluid.cxx +++ b/CoreFlows/Models/src/FiveEqsTwoFluid.cxx @@ -901,7 +901,6 @@ void FiveEqsTwoFluid::convectionMatrices() } } /******** Compute the eigenvalues and eigenvectors of Roe Matrix (using lapack)*********/ - Polynoms Poly; dgeev_(jobvl, jobvr, &_nVar, Aroe,&LDA,egvaReal,egvaImag, egVectorL, &LDVL,egVectorR, @@ -952,7 +951,7 @@ void FiveEqsTwoFluid::convectionMatrices() valeurs_propres[j] = complex(egvaReal[j],egvaImag[j]); } - taille_vp =Poly.new_tri_selectif(valeurs_propres,valeurs_propres.size(),_precision); + taille_vp =Polynoms::new_tri_selectif(valeurs_propres,valeurs_propres.size(),_precision); valeurs_propres_dist=vector< complex< double > >(taille_vp); for( int i=0 ; i > y (taille_vp,0); for( int i=0 ; i(egvaReal[j],egvaImag[j]); eigValuesRight[j] = complex(egvaReal[j],egvaImag[j]); } - Polynoms Poly; - int sizeLeft = Poly.new_tri_selectif(eigValuesLeft, eigValuesLeft.size(), _precision); - int sizeRight = Poly.new_tri_selectif(eigValuesRight, eigValuesRight.size(), _precision); - if (_verbose && _nbTimeStep%_freqSave ==0) + int sizeLeft = Polynoms::new_tri_selectif(eigValuesLeft, eigValuesLeft.size(), _precision); + int sizeRight = Polynoms::new_tri_selectif(eigValuesRight, eigValuesRight.size(), _precision); + if (_verbose && (_nbTimeStep-1)%_freqSave ==0) { cout<<" Eigenvalue of JacoMat Left: " << endl; for(int i=0; i(egvaReal[j],egvaImag[j]); } - Polynoms Poly; - int sizeLeft = Poly.new_tri_selectif(eigValuesLeft, eigValuesLeft.size(), _precision); - int sizeRight = Poly.new_tri_selectif(eigValuesRight, eigValuesRight.size(), _precision); - if (_verbose && _nbTimeStep%_freqSave ==0) + int sizeLeft = Polynoms::new_tri_selectif(eigValuesLeft, eigValuesLeft.size(), _precision); + int sizeRight = Polynoms::new_tri_selectif(eigValuesRight, eigValuesRight.size(), _precision); + if (_verbose && (_nbTimeStep-1)%_freqSave ==0) { cout<<" Eigenvalue of JacoMat Left: " << endl; for(int i=0; i pol_car= Poly.polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2,invcsq1,invcsq2, dpi1, dpi2, g2press, g2alpha, g2,_precision); + vector< double > pol_car= Polynoms::polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2,invcsq1,invcsq2, dpi1, dpi2, g2press, g2alpha, g2,_precision); for(int ct=0;ct<4;ct++){ if (abs(pol_car[ct])<_precision*_precision) pol_car[ct]=0; @@ -289,9 +288,9 @@ void IsothermalTwoFluid::convectionMatrices() //On ajoute les valeurs propres triviales if(_Ndim>1) { - if( !Poly.belongTo(u1_n,valeurs_propres, _precision) ) + if( !Polynoms::belongTo(u1_n,valeurs_propres, _precision) ) valeurs_propres.push_back(u1_n);//vp vapor energy - if( !Poly.belongTo(u2_n,valeurs_propres, _precision) ) + if( !Polynoms::belongTo(u2_n,valeurs_propres, _precision) ) valeurs_propres.push_back(u2_n);//vp liquid energy } bool doubleeigenval = norm(valeurs_propres[0] - valeurs_propres[1])<_precision;//norm= suqare of the magnitude @@ -301,7 +300,7 @@ void IsothermalTwoFluid::convectionMatrices() valeurs_propres.pop_back(); } - int taille_vp = Poly.new_tri_selectif(valeurs_propres,valeurs_propres.size(),_precision);//valeurs_propres.size();// + int taille_vp = Polynoms::new_tri_selectif(valeurs_propres,valeurs_propres.size(),_precision);//valeurs_propres.size();// _maxvploc=0; for(int i =0; i > y (taille_vp,0); - Polynoms Poly; for( int i=0 ; ivitesseSonTemperature(_Temperature,rho2); invcsq2*=invcsq2; - Polynoms Poly; - pol_car= Poly.polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2, invcsq1, invcsq2, dpi1, dpi2); + pol_car= Polynoms::polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2, invcsq1, invcsq2, dpi1, dpi2); for(int ct=0;ct<4;ct++){ if (abs(pol_car[ct])<_precision*_precision) pol_car[ct]=0; } vector< complex > vp_left = getRacines(pol_car); - int taille_vp_left = Poly.new_tri_selectif(vp_left,vp_left.size(),_precision); + int taille_vp_left = Polynoms::new_tri_selectif(vp_left,vp_left.size(),_precision); if(_verbose && _nbTimeStep%_freqSave ==0) { @@ -1126,13 +1123,13 @@ void IsothermalTwoFluid::entropicShift(double* n) invcsq2 = 1/_fluides[1]->vitesseSonTemperature(_Temperature,rho2); invcsq2*=invcsq2; - pol_car= Poly.polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2, invcsq1, invcsq2, dpi1, dpi2); + pol_car= Polynoms::polynome_caracteristique(alpha, 1-alpha, u1_n, u2_n, rho1, rho2, invcsq1, invcsq2, dpi1, dpi2); for(int ct=0;ct<4;ct++){ if (abs(pol_car[ct])<_precision*_precision) pol_car[ct]=0; } vector< complex > vp_right = getRacines(pol_car); - int taille_vp_right = Poly.new_tri_selectif(vp_right,vp_right.size(),_precision); + int taille_vp_right = Polynoms::new_tri_selectif(vp_right,vp_right.size(),_precision); if(_verbose && _nbTimeStep%_freqSave ==0) { diff --git a/CoreFlows/Models/src/ProblemFluid.cxx b/CoreFlows/Models/src/ProblemFluid.cxx index 1eb8c76..2f60c47 100755 --- a/CoreFlows/Models/src/ProblemFluid.cxx +++ b/CoreFlows/Models/src/ProblemFluid.cxx @@ -423,9 +423,8 @@ double ProblemFluid::computeTimeStep(bool & stop){ cout << endl; } idm = idCells[k]; - Polynoms Poly; //calcul et insertion de A^-*Jcb - Poly.matrixProduct(_AroeMinusImplicit, _nVar, _nVar, _Jcb, _nVar, _nVar, _a); + Polynoms::matrixProduct(_AroeMinusImplicit, _nVar, _nVar, _Jcb, _nVar, _nVar, _a); MatSetValuesBlocked(_A, size, &idm, size, &idm, _a, ADD_VALUES); if(_verbose) @@ -440,7 +439,7 @@ double ProblemFluid::computeTimeStep(bool & stop){ displayMatrix(_AroeMinusImplicit, _nVar,"-_AroeMinusImplicit: "); //calcul et insertion de D*JcbDiff - Poly.matrixProduct(_Diffusion, _nVar, _nVar, _JcbDiff, _nVar, _nVar, _a); + Polynoms::matrixProduct(_Diffusion, _nVar, _nVar, _JcbDiff, _nVar, _nVar, _a); MatSetValuesBlocked(_A, size, &idm, size, &idm, _a, ADD_VALUES); for(int k=0; k<_nVar*_nVar;k++) _Diffusion[k] *= -1; @@ -1020,8 +1019,7 @@ void ProblemFluid::addConvectionToSecondMember { for(int k=0; k<_nVar; k++) _temp[k]=(_Ui[k] - _Uj[k])*_inv_dxi;//(Ui-Uj)*_inv_dxi - Polynoms Poly; - Poly.matrixProdVec(_AroeMinus, _nVar, _nVar, _temp, _phi);//phi=A^-(U_i-U_j)/dx + Polynoms::matrixProdVec(_AroeMinus, _nVar, _nVar, _temp, _phi);//phi=A^-(U_i-U_j)/dx VecSetValuesBlocked(_b, 1, _idm, _phi, ADD_VALUES); if(_verbose && _nbTimeStep%_freqSave ==0) @@ -1041,7 +1039,7 @@ void ProblemFluid::addConvectionToSecondMember { for(int k=0; k<_nVar; k++) _temp[k]*=_inv_dxj/_inv_dxi;//(Ui-Uj)*_inv_dxj - Poly.matrixProdVec(_AroePlus, _nVar, _nVar, _temp, _phi);//phi=A^+(U_i-U_j)/dx + Polynoms::matrixProdVec(_AroePlus, _nVar, _nVar, _temp, _phi);//phi=A^+(U_i-U_j)/dx VecSetValuesBlocked(_b, 1, _idn, _phi, ADD_VALUES); if(_verbose && _nbTimeStep%_freqSave ==0) @@ -1147,12 +1145,12 @@ void ProblemFluid::addSourceTermToSecondMember cout<< _porosityGradientSourceVector[k]<<", "; cout< > ProblemFluid::getRacines(vector< double > pol_car){ void ProblemFluid::AbsMatriceRoe(vector< complex > valeurs_propres_dist) { - Polynoms Poly; int nbVp_dist=valeurs_propres_dist.size(); vector< complex< double > > y (nbVp_dist,0); for( int i=0 ; i > valeurs_propres_dis else y[i] = 0; } - Polynoms Poly; - Poly.abs_par_interp_directe(nbVp_dist,valeurs_propres_dist, _Aroe, _nVar,_precision, _signAroe,y); - if(_verbose && _nbTimeStep%_freqSave ==0) + + Polynoms::abs_par_interp_directe(nbVp_dist,valeurs_propres_dist, _Aroe, _nVar,_precision, _signAroe,y); + if(_verbose && (_nbTimeStep-1)%_freqSave ==0) { cout<< endl<<"ProblemFluid::SigneMatriceRoe: Valeurs propres :" << nbVp_dist< > valeurs_propres_dist) { int nbVp_dist=valeurs_propres_dist.size(); vector< complex< double > > y (nbVp_dist,0); - Polynoms Poly; + for( int i=0 ; i_precision) + if(Polynoms::module(valeurs_propres_dist[i])>_precision) y[i] = 1./valeurs_propres_dist[i]; else y[i] = 1./_precision; } - Poly.abs_par_interp_directe(nbVp_dist,valeurs_propres_dist, _Aroe, _nVar,_precision, _invAroe,y); - if(_verbose && _nbTimeStep%_freqSave ==0) + Polynoms::abs_par_interp_directe(nbVp_dist,valeurs_propres_dist, _Aroe, _nVar,_precision, _invAroe,y); + if(_verbose && (_nbTimeStep-1)%_freqSave ==0) { cout<< endl<<"ProblemFluid::InvMatriceRoe : Valeurs propres :" << nbVp_dist<(3,0);//at most 3 distinct eigenvalues vector< complex< double > > y (3,0); - Polynoms Poly; for( int i=0 ; i<3 ; i++) - y[i] = Poly.abs_generalise(vp_dist[i])+_entropicShift[i]; - Poly.abs_par_interp_directe(3,vp_dist, _Aroe, _nVar,_precision, _absAroe,y); + y[i] = Polynoms::abs_generalise(vp_dist[i])+_entropicShift[i]; + Polynoms::abs_par_interp_directe(3,vp_dist, _Aroe, _nVar,_precision, _absAroe,y); if( _spaceScheme ==pressureCorrection) for( int i=0 ; i<_Ndim ; i++) @@ -951,9 +950,8 @@ void SinglePhase::convectionMatrices() for(int idim=0;idim<_Ndim; idim++) _Vij[1+idim]=_Uroe[1+idim]; primToConsJacobianMatrix(_Vij); - Polynoms Poly; - Poly.matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); - Poly.matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); + Polynoms::matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); + Polynoms::matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); } else for(int i=0; i<_nVar*_nVar;i++) @@ -981,8 +979,7 @@ void SinglePhase::convectionMatrices() if(_entropicCorrection) { InvMatriceRoe( vp_dist); - Polynoms Poly; - Poly.matrixProduct(_absAroe, _nVar, _nVar, _invAroe, _nVar, _nVar, _signAroe); + Polynoms::matrixProduct(_absAroe, _nVar, _nVar, _invAroe, _nVar, _nVar, _signAroe); } else if (_spaceScheme==upwind || (_spaceScheme ==pressureCorrection ) || (_spaceScheme ==lowMach ))//upwind sans entropic SigneMatriceRoe( vp_dist); @@ -2567,11 +2564,10 @@ void SinglePhase::staggeredVFFCMatricesPrimitiveVariables(double un)//vitesse no } else//case nil velocity on the interface, apply centered scheme { - Polynoms Poly; primToConsJacobianMatrix(_Vj); - Poly.matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); + Polynoms::matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); primToConsJacobianMatrix(_Vi); - Poly.matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); + Polynoms::matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); } } } diff --git a/CoreFlows/Models/src/SinglePhaseStaggered.cxx b/CoreFlows/Models/src/SinglePhaseStaggered.cxx index 1427321..3468ccd 100755 --- a/CoreFlows/Models/src/SinglePhaseStaggered.cxx +++ b/CoreFlows/Models/src/SinglePhaseStaggered.cxx @@ -650,10 +650,9 @@ void SinglePhaseStaggered::convectionMatrices() _entropicShift=vector(3,0);//at most 3 distinct eigenvalues vector< complex< double > > y (3,0); - Polynoms Poly; for( int i=0 ; i<3 ; i++) - y[i] = Poly.abs_generalise(vp_dist[i])+_entropicShift[i]; - Poly.abs_par_interp_directe(3,vp_dist, _Aroe, _nVar,_precision, _absAroe,y); + y[i] = Polynoms::abs_generalise(vp_dist[i])+_entropicShift[i]; + Polynoms::abs_par_interp_directe(3,vp_dist, _Aroe, _nVar,_precision, _absAroe,y); if( _spaceScheme ==pressureCorrection) for( int i=0 ; i<_Ndim ; i++) @@ -697,9 +696,8 @@ void SinglePhaseStaggered::convectionMatrices() for(int idim=0;idim<_Ndim; idim++) _Vij[1+idim]=_Uroe[1+idim]; primToConsJacobianMatrix(_Vij); - Polynoms Poly; - Poly.matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); - Poly.matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); + Polynoms::matrixProduct(_AroeMinus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroeMinusImplicit); + Polynoms::matrixProduct(_AroePlus, _nVar, _nVar, _primToConsJacoMat, _nVar, _nVar, _AroePlusImplicit); } else for(int i=0; i<_nVar*_nVar;i++) @@ -727,8 +725,7 @@ void SinglePhaseStaggered::convectionMatrices() if(_entropicCorrection) { InvMatriceRoe( vp_dist); - Polynoms Poly; - Poly.matrixProduct(_absAroe, _nVar, _nVar, _invAroe, _nVar, _nVar, _signAroe); + Polynoms::matrixProduct(_absAroe, _nVar, _nVar, _invAroe, _nVar, _nVar, _signAroe); } else if (_spaceScheme==upwind || (_spaceScheme ==pressureCorrection ) || (_spaceScheme ==lowMach ))//upwind sans entropic SigneMatriceRoe( vp_dist); diff --git a/CoreFlows/Models/src/StationaryDiffusionEquation.cxx b/CoreFlows/Models/src/StationaryDiffusionEquation.cxx index 0af2cd8..a4661a3 100755 --- a/CoreFlows/Models/src/StationaryDiffusionEquation.cxx +++ b/CoreFlows/Models/src/StationaryDiffusionEquation.cxx @@ -12,7 +12,7 @@ int StationaryDiffusionEquation::fact(int n) { return (n == 1 || n == 0) ? 1 : fact(n - 1) * n; } -int StationaryDiffusionEquation::unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes) const +int StationaryDiffusionEquation::unknownNodeIndex(int globalIndex, std::vector< int > dirichletNodes) {//assumes Dirichlet node numbering is strictly increasing int j=0;//indice de parcours des noeuds frontière avec CL Dirichlet int boundarySize=dirichletNodes.size(); @@ -26,7 +26,7 @@ int StationaryDiffusionEquation::unknownNodeIndex(int globalIndex, std::vector< throw CdmathException("StationaryDiffusionEquation::unknownNodeIndex : Error : node is a Dirichlet boundary node"); } -int StationaryDiffusionEquation::globalNodeIndex(int unknownNodeIndex, std::vector< int > dirichletNodes) const +int StationaryDiffusionEquation::globalNodeIndex(int unknownNodeIndex, std::vector< int > dirichletNodes) {//assumes Dirichlet boundary node numbering is strictly increasing int boundarySize=dirichletNodes.size(); /* trivial case where all boundary nodes are Neumann BC */ -- 2.39.2