diff --git a/plugin/seq/DxWriter.cpp b/plugin/seq/DxWriter.cpp index ccd59fd1b..e30cea540 100644 --- a/plugin/seq/DxWriter.cpp +++ b/plugin/seq/DxWriter.cpp @@ -112,7 +112,7 @@ class DxWriter { _vecmesh.push_back(mesh); _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "object \"pos_" << _vecmesh.size( ) - 1 << "\" class array type float rank 1 shape 2 items " << Th.nv << " data follows" << std::endl; @@ -168,7 +168,7 @@ class DxWriter { _vecofts[jj].vecistant.push_back(t); _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "object \"" << nameofts << "_data_" << _vecofts[jj].vecistant.size( ) - 1 << "\" class array type float rank 0 items " << val.size( ) << " data follows" << std::endl; @@ -203,7 +203,7 @@ class DxWriter { } _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "object \"" << nameoffield << "_data\" class array type float rank 0 items " << val.size( ) << " data follows" << std::endl; diff --git a/plugin/seq/Element_QF.cpp b/plugin/seq/Element_QF.cpp index 67d69417e..66f5db92f 100644 --- a/plugin/seq/Element_QF.cpp +++ b/plugin/seq/Element_QF.cpp @@ -329,54 +329,6 @@ static void finit( ) { // equivalent2d 3d EFQF static AddNewFE3 AddNewFE_QF3d5("FEQF53d", &TypeOfFE_QF3d5); static AddNewFE3 AddNewFE_QF3ddef("FEQF3d", &TypeOfFE_QF3d5); - if (0) { // ne marche pas ?????? - TEF2dto3d[FindFE2("FEQF")] = &TypeOfFE_QF3d5; - TEF2dto3d[FindFE2("FEQF1")] = &TypeOfFE_QF3d1; - TEF2dto3d[FindFE2("FEQF2")] = &TypeOfFE_QF3d2; - TEF2dto3d[FindFE2("FEQF5")] = &TypeOfFE_QF3d5; - } - - if (0) { // Add tools cree new FiniteElement2d - static AddNewFE3 *pAddNewFE3[15]; - - for (int i = 1; i <= 14; ++i) { - if (verbosity > 9) { - cout << "\n"; - } - - pAddNewFE3[i] = 0; - char sqfv[100]; - sprintf(sqfv, "qfVp%d", i); - C_F0 cfq = Global.Find(sqfv); - if (cfq.NotNull( )) { - if (verbosity > 99) { - cout << " find " << i << " " << sqfv << " type " << cfq.left( ) << endl; - } - - const EConstant< const GQuadratureFormular< R3 > * > *efq = - dynamic_cast< const EConstant< const GQuadratureFormular< R3 > * > * >(cfq.LeftValue( )); - if (efq) { - char *EFsqfv = new char[16]; - sprintf(EFsqfv, "FEqfVp%d", i); - - const GQuadratureFormular< R3 > *qf = - GetAny< const GQuadratureFormular< R3 > * >((*efq)(0)); - if (verbosity > 9) { - cout << " \t " << sqfv << " " << qf->n << " " << qf->exact << ", EF : " << EFsqfv - << endl; - } - - // int m = 5; - TypeOfFE_QF3d *FEqf = new TypeOfFE_QF3d(*qf); - pAddNewFE3[i] = new AddNewFE3(EFsqfv, FEqf); - } - } else if (verbosity > 9) { - cout << " try " << i << " " << sqfv << " not found" << endl; - } - - ; - } - } Dcl_Type< pEF2d * >(::InitializePtr< pEF2d >, ::DeletePtr< pEF2d >); if (verbosity > 9) { diff --git a/plugin/seq/Makefile.am b/plugin/seq/Makefile.am index ebe3fca8c..326d1873c 100644 --- a/plugin/seq/Makefile.am +++ b/plugin/seq/Makefile.am @@ -91,7 +91,7 @@ allheaders=../../src/fflib/AddNewFE.h ../../src/fflib/AFunction_ext.hpp ../../sr ../../src/femlib/assertion.hpp ../../src/femlib/BamgFreeFem.hpp ../../src/Algo/BFGS.hpp ../../src/Algo/BrentLS.hpp \ ../../src/femlib/CGNL.hpp ../../src/fflib/CodeAlloc.hpp ../../config.h \ ../../src/Algo/CubicLS.hpp ../../src/Algo/defs.hpp ../../src/femlib/DOperator.hpp ../../src/libMesh/eigenv.h \ - ../../src/fflib/endian.hpp ../../src/fflib/environment.hpp ../../src/fflib/error.hpp ../../src/femlib/fem3.hpp \ + ../../src/fflib/endian.hpp ../../src/fflib/environment.hpp ../../src/fflib/error.hpp \ ../../src/femlib/fem.hpp ../../src/femlib/FESpace.hpp ../../src/femlib/FESpacen.hpp ../../src/fflib/ff++.hpp \ ../../src/fflib/ffstack.hpp ../../src/femlib/FQuadTree.hpp ../../src/femlib/GenericMesh.hpp \ ../../src/Graphics/getprog-unix.hpp ../../src/Graphics/glrgraph.hpp ../../src/femlib/gmres.hpp \ diff --git a/plugin/seq/SaveHB.cpp b/plugin/seq/SaveHB.cpp index 9398af049..89b585ec0 100644 --- a/plugin/seq/SaveHB.cpp +++ b/plugin/seq/SaveHB.cpp @@ -24,7 +24,7 @@ void output_matrix_entries(ofstream &fout, const int N, const double *const ccs_ const int nnzero, const double *const b) { for (int i = 0; i < nnzero; i++) { - fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i]; + fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i]; if ((i + 1) % 4 == 0) fout << std::endl; } @@ -32,7 +32,7 @@ void output_matrix_entries(ofstream &fout, const int N, const double *const ccs_ for (int i = 0; i < N; i++) { - fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i]; + fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << b[i]; if ((i + 1) % 4 == 0) fout << std::endl; } @@ -45,8 +45,8 @@ void output_matrix_entries(ofstream &fout, const int N, const complex< double > const int nnzero, const complex< double > *const b) { for (int i = 0; i < nnzero; i++) { - fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].real( ) - << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].imag( ); + fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i].real( ) + << setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i].imag( ); if ((i + 1) % 2 == 0) fout << std::endl; } @@ -54,8 +54,8 @@ void output_matrix_entries(ofstream &fout, const int N, const complex< double > for (int i = 0; i < N; i++) { - fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i].real( ) << setw(20) - << setprecision(12) << setiosflags(ios::scientific) << b[i].imag( ); + fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << b[i].real( ) << setw(20) + << setprecision(17) << setiosflags(ios::scientific) << b[i].imag( ); if ((i + 1) % 2 == 0) fout << std::endl; } diff --git a/plugin/seq/VTK_writer.cpp b/plugin/seq/VTK_writer.cpp index b0750a248..2fbe577d7 100644 --- a/plugin/seq/VTK_writer.cpp +++ b/plugin/seq/VTK_writer.cpp @@ -77,7 +77,7 @@ class VtkWriter { _vecmesh.push_back(mesh); _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "" << std::endl; _ofdata << ""; @@ -148,7 +148,7 @@ class VtkWriter { /*!Add a field*/ void addscalar(const string &nameoffield, const Fem2D::Mesh *mesh, const KN< double > &val) { _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << ""; @@ -167,7 +167,7 @@ class VtkWriter { void addvector(const string &nameoffield, const Fem2D::Mesh *mesh, const KN< double > &val, const KN< double > &val2) { _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << ""; diff --git a/plugin/seq/VTK_writer_3d.cpp b/plugin/seq/VTK_writer_3d.cpp index e0b8e2c67..c6cc96663 100644 --- a/plugin/seq/VTK_writer_3d.cpp +++ b/plugin/seq/VTK_writer_3d.cpp @@ -78,7 +78,7 @@ class VtkWriter { _vecmesh.push_back(mesh); _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "" << std::endl; _ofdata << "" @@ -136,7 +136,7 @@ class VtkWriter { /*!Add a field*/ void addscalar(const string &nameoffield, const Mesh3 *mesh, const KN< double > &val) { _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "" << std::endl; @@ -165,7 +165,7 @@ class VtkWriter { void addvector(const string &nameoffield, const Mesh3 *mesh, const KN< double > &val, const KN< double > &val2, const KN< double > &val3) { _ofdata.flags(std::ios_base::scientific); - _ofdata.precision(15); + _ofdata.precision(17); _ofdata << "" << std::endl; diff --git a/plugin/seq/bmo.cpp b/plugin/seq/bmo.cpp index c57990537..6a17d7c78 100644 --- a/plugin/seq/bmo.cpp +++ b/plugin/seq/bmo.cpp @@ -200,7 +200,7 @@ double BijanMO::main(Vect &xx, Vect &xxmin, Vect &xxmax) { } if (debug) { - cout.precision(15); + cout.precision(17); cout << " F = " << costsavemin << " FM = " << costsaveming << endl; } @@ -224,7 +224,7 @@ double BijanMO::main(Vect &xx, Vect &xxmin, Vect &xxmax) { result(xoptg, vinit); cout << "-------------------------------------------\n"; - cout.precision(15); + cout.precision(17); cout << " FM = " << costsaveming << " nb eval J : " << nbeval << " nbevalp : " << nbevalp << endl; if (ncstr > 0) { cout << "-------------------------------------------\n"; @@ -367,7 +367,7 @@ int BijanMO::gradopt(Vect &x1, Vect &fpx, Vect &temp, double &rho, double &f, do gnorm /= gnorm0; if (histpath) { ofstream fhist(histpath->c_str( ), ios::app); - fhist.precision(16); + fhist.precision(17); fhist << f << " " << gnorm * gnorm0 << " "; int n1 = min(ndim, 10); @@ -378,7 +378,7 @@ int BijanMO::gradopt(Vect &x1, Vect &fpx, Vect &temp, double &rho, double &f, do if (histcpath) { ofstream fhist(histcpath->c_str( ), ios::app); - fhist.precision(16); + fhist.precision(17); fhist << fseul << endl; for (int i = 0; i < ncstr; ++i) { diff --git a/plugin/seq/cmaes.cpp b/plugin/seq/cmaes.cpp index b8196b790..7b22ee365 100644 --- a/plugin/seq/cmaes.cpp +++ b/plugin/seq/cmaes.cpp @@ -1751,18 +1751,6 @@ const char *cmaes_TestForTermination(cmaes_t *t) { cp += sprintf(cp, "Manual: stop signal read\n"); } -#if 0 - else if (0) { - for (i = 0, cTemp = 0; i < N; ++i) { - cTemp += (sigma * sqrt(C[i][i]) < stopdx) ? 1 : 0; - cTemp += (sigma * rgpc[i] < stopdx) ? 1 : 0; - } - - if (cTemp == 2 * N) { - flgStop = 1; - } - } -#endif if (cp - sTestOutString > 320) { ERRORMESSAGE("Bug in cmaes_t:Test(): sTestOutString too short", 0, 0, 0); diff --git a/plugin/seq/gmsh.cpp b/plugin/seq/gmsh.cpp index b9f86c75a..919889e9d 100644 --- a/plugin/seq/gmsh.cpp +++ b/plugin/seq/gmsh.cpp @@ -1649,7 +1649,7 @@ bool SaveGMSH(pmesh3 pTh, string *filewoext) { return 1; } - f1.precision(15); + f1.precision(17); const Mesh3 &msh = *pTh; long nbvertices = msh.nv; f1 << "$MeshFormat" << endl; @@ -1701,7 +1701,7 @@ bool SaveGMSH(pmeshS pTh, string *filewoext) { return 1; } - f1.precision(15); + f1.precision(17); const MeshS &msh = *pTh; long nbvertices = msh.nv; f1 << "$MeshFormat" << endl; @@ -1750,7 +1750,7 @@ bool SaveGMSH(pmeshL pTh, string *filewoext) { return 1; } - f1.precision(15); + f1.precision(17); const MeshL &msh = *pTh; long nbvertices = msh.nv; f1 << "$MeshFormat" << endl; diff --git a/plugin/seq/iovtk.cpp b/plugin/seq/iovtk.cpp index af1d461f0..6a5f27dfe 100644 --- a/plugin/seq/iovtk.cpp +++ b/plugin/seq/iovtk.cpp @@ -6906,17 +6906,17 @@ void saveMatlab(const string &file, const Mesh &Th) { pf << "x = [ "; for (size_t n = 0; n < 3; n++) { - pf << std::setprecision(5) << setw(18) << K[n].x << " "; + pf << std::setprecision(17) << setw(18) << K[n].x << " "; } - pf << std::setprecision(5) << setw(18) << K[0].x << " ]; "; + pf << std::setprecision(17) << setw(18) << K[0].x << " ]; "; pf << "y = [ "; for (size_t n = 0; n < 3; n++) { - pf << std::setprecision(5) << setw(18) << K[n].y << " "; + pf << std::setprecision(17) << setw(18) << K[n].y << " "; } - pf << std::setprecision(5) << setw(18) << K[0].y << " ]; "; + pf << std::setprecision(17) << setw(18) << K[0].y << " ]; "; pf << "line(x,y);" << endl; } @@ -6953,7 +6953,7 @@ void saveTecplot(const string &file, const Mesh &Th) { pf << "ZONE N=" << Th.nv << ", E=" << Th.nt << ", F=FEPOINT, ET=" << shape << endl; for (int i = 0; i < Th.nv; i++) { - pf << std::setprecision(5) << setw(18) << (R2)Th(i) << " \n"; + pf << std::setprecision(17) << setw(18) << (R2)Th(i) << " \n"; } for (int k = 0; k < Th.nt; ++k) { diff --git a/src/Graphics/ffglut.cpp b/src/Graphics/ffglut.cpp index b215522ee..4c22ad4f5 100644 --- a/src/Graphics/ffglut.cpp +++ b/src/Graphics/ffglut.cpp @@ -3111,13 +3111,6 @@ case 20+index: {type dummy; fin >= dummy;} break; PmaxT=Pmax; fminT=fmin; fmaxT=fmax; - if(old && 0) - { - Pmin= Minc(Pmin,old->PminT); - Pmax= Maxc(Pmax,old->PmaxT); - fmax= Max(fmax,old->fmaxT); - fmin= Min(fmin,old->fminT); - } z0= fminT -(fmaxT-fminT)*0.01; if((debug > 2)) cout << " data bound: " << PminT << " " << PmaxT diff --git a/src/bamglib/MeshGeom.cpp b/src/bamglib/MeshGeom.cpp index 68c24c7b3..22cb942f7 100644 --- a/src/bamglib/MeshGeom.cpp +++ b/src/bamglib/MeshGeom.cpp @@ -783,16 +783,12 @@ namespace bamg { GeometricalEdge &e2 = *e1.link; cerr << i << " " << e1[0].The( ) << " " << e2[0].The( ) << " " << e1[1].The( ) << " " << e2[1].The( ) << endl; - if (e1[0].The( ) == e2[0].The( ) && e1[1].The( ) == e2[1].The( )) { - } else if (e1[0].The( ) == e2[1].The( ) && e1[1].The( ) == e2[0].The( )) { - } else { + if (!((e1[0].The( ) == e2[0].The( ) && e1[1].The( ) == e2[1].The( )) || + (e1[0].The( ) == e2[1].The( ) && e1[1].The( ) == e2[0].The( )))) { err++; cerr << " Cracked edges with no same vertex " << &e1 - edges << " " << &e2 - edges << endl; } - } else { - // if (!edges[i][0].IsThe()) err++; - // if (!edges[i][1].IsThe()) err++; } if (err) { cerr << " Some vertex was not distint and not on cracked edge " << err << endl; diff --git a/src/bamglib/Metric.cpp b/src/bamglib/Metric.cpp index 6563cb170..01f7b7257 100644 --- a/src/bamglib/Metric.cpp +++ b/src/bamglib/Metric.cpp @@ -901,27 +901,14 @@ namespace bamg { assert(j >= 0 && j < nbv); R2 Aij = (R2)vj - (R2)vi; Real8 ll = Norme2(Aij); - if (0) { - Real8 hi = ll / vi.m(Aij); - Real8 hj = ll / vj.m(Aij); - if (hi < hj) { - Real8 dh = (hj - hi) / ll; - // cout << " dh = " << dh << endl; - if (dh > logseuil) { - vj.m.IntersectWith(vi.m / (1 + logseuil * ll / hi)); - if (first_np_or_next_t1[j] < 0) kch++, first_np_or_next_t1[j] = Head1, Head1 = j; - } - } - } else { - Real8 li = vi.m(Aij); - // Real8 lj = vj.m(Aij); - // if ( i == 2 || j == 2) - // cout << " inter " << i << " " << j << " " << ((1 +logseuil*li)) << endl; - if (vj.m.IntersectWith(vi.m / (1 + logseuil * li))) - // if( vj.m.IntersectWith(vi.m*(lj/li/(1 +logseuil*lj))) ) - if (first_np_or_next_t1[j] < 0) // if the metrix change - kch++, first_np_or_next_t1[j] = Head1, Head1 = j; - } + Real8 li = vi.m(Aij); + // Real8 lj = vj.m(Aij); + // if ( i == 2 || j == 2) + // cout << " inter " << i << " " << j << " " << ((1 +logseuil*li)) << endl; + if (vj.m.IntersectWith(vi.m / (1 + logseuil * li))) + // if( vj.m.IntersectWith(vi.m*(lj/li/(1 +logseuil*lj))) ) + if (first_np_or_next_t1[j] < 0) // if the metrix change + kch++, first_np_or_next_t1[j] = Head1, Head1 = j; } if (&vj == pvj0) break; } @@ -1029,7 +1016,7 @@ namespace bamg { assert(i < 512); LastMetricInterpole.lab = l; LastMetricInterpole.opt = i; - if (i > 200 && kkk++ < 10) + if (i > 200 && kkk++ < 10 && verbosity) cout << "Warning LengthInterpole: ( i = " << i << " l = " << l << " sss " << sss << " ) " << sstop << endl; return l; diff --git a/src/femlib/BamgFreeFem.cpp b/src/femlib/BamgFreeFem.cpp index 96e8a9e62..f48119a44 100644 --- a/src/femlib/BamgFreeFem.cpp +++ b/src/femlib/BamgFreeFem.cpp @@ -797,25 +797,6 @@ const Fem2D::Mesh * BuildMesh(Stack stack,const Fem2D::MeshL **ppmshL , int nb } - if(0) - { - - - Th->SetVertexFieldOn(); - for( int i=0;inbv;++i) - { - VertexOnGeom *on=0; - if( (on =Th->vertices[i].on) ) // we are on geometrie - { - if(on->abscisse <0) { - bamg::GeometricalVertex * gv= on->gv; - } - else {// erreur car un point est sur un arete en non un sommet - bamg::GeometricalEdge * ge= on->ge; - } - } - } - } m=bamg2msh(Th,true); } @@ -1168,25 +1149,6 @@ const Fem2D::Mesh * BuildMesh(Stack stack, E_BorderN const * const & b,bool jus } - if(0) - { - - - Th->SetVertexFieldOn(); - for( int i=0;inbv;++i) - { - VertexOnGeom *on=0; - if( (on =Th->vertices[i].on) ) // we are on geometrie - { - if(on->abscisse <0) { - bamg::GeometricalVertex * gv= on->gv; - } - else {// erreur car un point est sur un arete en non un sommet - bamg::GeometricalEdge * ge= on->ge; - } - } - } - } m=bamg2msh(Th,true); } diff --git a/src/femlib/Element_RT.cpp b/src/femlib/Element_RT.cpp index fd7325d31..9f77112a4 100644 --- a/src/femlib/Element_RT.cpp +++ b/src/femlib/Element_RT.cpp @@ -122,8 +122,7 @@ class TypeOfFE_RT : public TypeOfFE { public: R2 A(K[0]), B(K[1]),C(K[2]); // R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==2 ); // throwassert(val.K()==3 ); val=0; @@ -227,8 +226,7 @@ class TypeOfFE_RTmodif : public TypeOfFE { public: R2 A(K[0]), B(K[1]),C(K[2]); R la=1-PHat.x-PHat.y,lb=PHat.x,lc=PHat.y; R2 Dla(K.H(0)), Dlb(K.H(1)), Dlc(K.H(2)); - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==2 ); R2 AB(A,B),AC(A,C),BA(B,A),BC(B,C),CA(C,A),CB(C,B); @@ -386,8 +384,7 @@ void TypeOfFE_ConsEdge::FB(const bool * whatd,const Mesh & ,const Triangle & K,c R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); val=0; @@ -465,8 +462,7 @@ void TypeOfFE_P1ncLagrange::FB(const bool * whatd,const Mesh & ,const Triangle & // l1( cshrink1*(cshrink*((1,0)-G)+G)-G)+G = 1 R l0=1-P.x-P.y,l1=P.x,l2=P.y; - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); @@ -525,8 +521,7 @@ class TypeOfFE_RTortho : public TypeOfFE { public: R2 A(K[0]), B(K[1]),C(K[2]); //R l0=1-P.x-P.y,l1=P.x,l2=P.y; // R2 Dl0(K.H(0)), Dl1(K.H(1)), Dl2(K.H(2)); - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==2 ); // throwassert(val.K()==3 ); val=0; @@ -680,8 +675,7 @@ void TypeOfFE_P1ttdc::FB(const bool *whatd,const Mesh & ,const Triangle & K,cons R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); diff --git a/src/femlib/FESpace-v0.cpp b/src/femlib/FESpace-v0.cpp index 3c82ebe6c..87c11f76d 100644 --- a/src/femlib/FESpace-v0.cpp +++ b/src/femlib/FESpace-v0.cpp @@ -1064,8 +1064,7 @@ void TypeOfFE_P1Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K, R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y,l1=P.x,l2=P.y; - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); @@ -1126,8 +1125,7 @@ void TypeOfFE_P1Bubble::FB(const bool *whatd,const Mesh & ,const Triangle & K,co R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-P.x-P.y, l1=P.x, l2=P.y, lb=l0*l1*l2*9.; - if (val.N() <4) - throwassert(val.N() >=4); + throwassert(val.N() >=4); throwassert(val.M()==1 ); // throwassert(val.K()==3 ); diff --git a/src/femlib/FESpace.cpp b/src/femlib/FESpace.cpp index 49d3dff80..e4e67321a 100644 --- a/src/femlib/FESpace.cpp +++ b/src/femlib/FESpace.cpp @@ -489,8 +489,7 @@ void TypeOfFE_P0VF::FB(const bool *whatd,const Mesh & ,const Triangle & K,const l2 = l2 * 3. < 1; l0 = 1 - l1 -l2;// FH & AS july 2020 - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); val=0; @@ -1102,8 +1101,7 @@ void TypeOfFE_P1Lagrange::FB(const bool *whatd,const Mesh & ,const Triangle & K, R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-PHat.x-PHat.y,l1=PHat.x,l2=PHat.y; - if (val.N() <3) - throwassert(val.N() >=3); + throwassert(val.N() >=3); throwassert(val.M()==1 ); val=0; @@ -1145,8 +1143,7 @@ void TypeOfFE_P1Bubble::FB(const bool *whatd,const Mesh & ,const Triangle & K,co R2 A(K[0]), B(K[1]),C(K[2]); R l0=1-PHat.x-PHat.y, l1=PHat.x, l2=PHat.y, lb=l0*l1*l2*9.; - if (val.N() <4) - throwassert(val.N() >=4); + throwassert(val.N() >=4); throwassert(val.M()==1 ); val=0; diff --git a/src/femlib/GenericMesh.hpp b/src/femlib/GenericMesh.hpp index 2567ca590..0089c8542 100644 --- a/src/femlib/GenericMesh.hpp +++ b/src/femlib/GenericMesh.hpp @@ -654,8 +654,7 @@ class GenericMesh : public RefCounter R lb[Rd::d+1];//{1.-PHat.sum(),PHat}; R lbb[Rd::d+1];//{1.-PHat.sum(),PHat}; PHat.toBary(lb); // R1 R2 R3 - if(Abs(lb[j])>1e-10) - assert(Abs(lb[j])<1e-10); + assert(Abs(lb[j])<1e-10); int sigma[T::nva]; const void * nvkj[T::nva], *nvkkjj[T::nva]; int jj=p%nea; diff --git a/src/femlib/Makefile.am b/src/femlib/Makefile.am index 99d3d0b6c..7f02cc96f 100755 --- a/src/femlib/Makefile.am +++ b/src/femlib/Makefile.am @@ -7,7 +7,7 @@ EXTRA_DIST=BamgFreeFem.cpp BamgFreeFem.hpp CGNL.hpp CheckPtr.cpp \ ConjuguedGradrientNL.cpp DOperator.hpp Drawing.cpp Element_P2h.cpp \ -Element_RT.cpp fem3.hpp fem.cpp fem.hpp FESpace.cpp \ +Element_RT.cpp fem.cpp fem.hpp FESpace.cpp \ FESpace.hpp FESpace-v0.cpp FQuadTree.cpp FQuadTree.hpp gibbs.cpp \ glutdraw.cpp gmres.hpp MatriceCreuse.hpp MatriceCreuse_tpl.hpp \ MeshPoint.hpp mortar.cpp mshptg.cpp QuadratureFormular.cpp \ diff --git a/src/femlib/Mesh3dn.cpp b/src/femlib/Mesh3dn.cpp index c3655fa2a..bf1761400 100644 --- a/src/femlib/Mesh3dn.cpp +++ b/src/femlib/Mesh3dn.cpp @@ -129,13 +129,6 @@ namespace Fem2D if(ff[nvedgeTet[i][0]]+ff[nvedgeTet[i][1]]==0) onWhatIsFace[j][i+4]=2; } - if(0) - for(int j=0;j<4;++j) - { - for(int i=0;i<15;++i) - cout << onWhatIsFace[j][i] << " "; - cout << endl; - } return onWhatIsFace; } diff --git a/src/femlib/fem.cpp b/src/femlib/fem.cpp index ca43327bf..00b8704aa 100644 --- a/src/femlib/fem.cpp +++ b/src/femlib/fem.cpp @@ -99,7 +99,7 @@ class SubMortar { // here a mortar is a connected componand of he whole edge of the coarse triangle // minus the extremite of mortar // ----------- - int NbCollision=0,NbOfEdges=0,NbOfBEdges=0,NbOfMEdges=0; + int NbCollision=0,NbOfEdges=0,NbOfBEdges=0; const char MaskEdge[]={1,2,4}; const char AddMortar[]={8,16,32}; // reffecran(); @@ -246,17 +246,7 @@ class SubMortar { } if (NbAdj) NbOfEdges++; - if(NbAdj==1) - { - if (! (TonBoundary[i]& MaskEdge[j]) && 0) - { NbOfMEdges++; - if(verbosity>99) - cout << " Edge (" << j0 << " "<< j1 << ") : " << j << " of Triangle " << &T-triangles << " on mortar \n" - <<" --- > " << number(T[0]) << " " << number(T[1]) << " " << number(T[2]) << " /" << int(TonBoundary[i])<< "\n" ; - TonBoundary[i]+= AddMortar[j]; - } - else { NbOfBEdges++; } - } + if(NbAdj==1) NbOfBEdges++; } } @@ -265,7 +255,6 @@ class SubMortar { << nt << endl ; cout << " Nb of edge on user boundary " << neb << " , Nb of edges on true boundary " << NbOfBEdges << endl; - if(NbOfMEdges) cout << " Nb of edges on Mortars = " << NbOfMEdges << endl; } delete [] Head; // cleanning memory @@ -481,10 +470,8 @@ class SubMortar { {pV = &V;break;} // ok good } } - if ( ! (p>=0 && pV)) - throwassert(p>=0 && pV); // PB reach the end without founding - if ( ! ( Abs((AM.perp(),A-*pV)) < 1e-5) ) - throwassert( Abs((AM.perp(),A-*pV)) < 1e-5); + throwassert(p>=0 && pV); // PB reach the end without founding + throwassert( Abs((AM.perp(),A-*pV)) < 1e-5); throwassert(sm != number(pV)); int kkgd= 3*k + j; @@ -499,8 +486,7 @@ class SubMortar { throwassert( s == number(triangles[kkgd/3][VerticesOfTriangularEdge[kkgd%3][dg]])); sgd[gd]=s;// save the last - if ( ! ( Abs((AM.perp(),A-vertices[s])) < 1e-5) ) - throwassert( Abs((AM.perp(),A-vertices[s])) < 1e-5); + throwassert( Abs((AM.perp(),A-vertices[s])) < 1e-5); throwassert(kkgd>=0 && kkgd < 3*nt); if (datamortars) { @@ -610,7 +596,6 @@ class SubMortar { { cout << " Number of Edges = " << NbOfEdges << endl; cout << " Number of Boundary Edges = " << NbOfBEdges << " neb = " << neb << endl; - cout << " Number of Mortars Edges = " << NbOfMEdges << endl; cout << " Nb Of Mortars with Paper Def = " << NbMortarsPaper << " Nb Of Mortars = " << NbMortars; cout << " Euler Number nt- NbOfEdges + nv = " << nt + NbMortars - NbOfEdges + nv << "= Nb of Connected Componant - Nb Of Hole " @@ -2200,11 +2185,6 @@ Mesh::Mesh(const Mesh & Th,int * split,bool WithMortar,int label) R2 G=(A+B+C)/3.,PHat; double d=Area2(A,B,C); dmin=min(d,dmin); - if(d<=1e-5 && 0) - { - cout<< " T = "<< i << " det= " << d << " :: " << A << " " << B << " " << C << endl; - - } bool outside; const Triangle * t=Th.Find(G,PHat,outside,0); if(!outside ) { diff --git a/src/femlib/fem3.hpp b/src/femlib/fem3.hpp deleted file mode 100644 index 38f6e4f82..000000000 --- a/src/femlib/fem3.hpp +++ /dev/null @@ -1 +0,0 @@ -to remove \ No newline at end of file diff --git a/src/fflib/AFunction.hpp b/src/fflib/AFunction.hpp index e57c8a992..c921b9683 100644 --- a/src/fflib/AFunction.hpp +++ b/src/fflib/AFunction.hpp @@ -1242,11 +1242,6 @@ class E_F0_Func1 :public E_F0 { public: const E_F0_Func1* tt=dynamic_cast(t); if (tt && f == tt->f) rr = a->compare(tt->a); else rr = E_F0::compare(t); - if(tt && 0) - { - cout << "\n\t\t\t -------- " << (void *) f << " " << (void *) tt->f << " rr=" << a->compare(tt->a) << endl; - cout << "\t\t\tcmp E_F0_Func1 " << rr <<" << " << *this << " cmp " << *t << " " << tt << ">>\n"; - } return rr; } // to give a order in instuction // int Optimize(deque > &l,MapOfE_F0 & m, size_t & n) const; // build optimisation diff --git a/src/fflib/array_tlp.hpp b/src/fflib/array_tlp.hpp index 3b81f32e4..c49214711 100644 --- a/src/fflib/array_tlp.hpp +++ b/src/fflib/array_tlp.hpp @@ -1624,21 +1624,6 @@ void ArrayOperator() ); TheOperators->Add("=", new SetArrayofKNfromKN ); - if(0) // a change il faut regle un PB ambiguite ... - TheOperators->Add("=", - new OneBinaryOperator ,K > > , - new OneBinaryOperator ,Add_KN_ > > , - new OneBinaryOperator ,DotStar_KN_ > > , - new OneBinaryOperator ,DotSlash_KN_ > > , - new OneBinaryOperator ,Sub_KN_ > > , - new OneBinaryOperator ,Mulc_KN_ > > , - new OneBinaryOperator ,Divc_KN_ > > , - new OneBinaryOperator ,Mul_KNM_KN_ > > , - new OneBinaryOperator ,KN_ > > , // Add FH juin 2005 - new OneBinaryOperator ,Add_Mulc_KN_* > > , // Add FH aug 2005 - new OneBinaryOperator ,if_arth_KN_* > > - // new OneBinaryOperator ,KN* > > // test aug 2009 - ); // add august 2007 TheOperators->Add("<-", diff --git a/src/fflib/lgfem.cpp b/src/fflib/lgfem.cpp index 35152aaf9..fb2512f7a 100644 --- a/src/fflib/lgfem.cpp +++ b/src/fflib/lgfem.cpp @@ -7315,102 +7315,20 @@ E_F0 *Op_CopyArray::code(const basicAC_F0 &args) const { int na = a.size( ); int nb = b.size( ); if (na != nb) CompileError("Copy of Array with incompatible size!"); - if (0) { // old code !!!!!!! before removing FH sept. 2009 - Expression rr = 0, rrr, iii; - // try real voctor value FE interpolation - rr = IsFEcomp< double, v_fes >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< double, v_fes >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible real vector value FE function () !"); - ; - return new E_set_fev< double >(&b, rr, 2); - } - // try complex vector value FE interpolation - - rr = IsFEcomp< Complex, v_fes >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< Complex, v_fes >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible complex vector value FE function () !"); - ; - return new E_set_fev< Complex >(&b, rr, 2); - } - - rr = IsFEcomp< double, v_fes3 >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< double, v_fes3 >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible real vector value FE function () !"); - ; - return new E_set_fev3< double, v_fes3 >(&b, rr); - } - // try complex vector value FE interpolation - - rr = IsFEcomp< Complex, v_fes3 >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< Complex, v_fes3 >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible complex vector value FE function () !"); - ; - return new E_set_fev3< Complex, v_fes3 >(&b, rr); - } - - rr = IsFEcomp< double, v_fesS >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< double, v_fesS >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible real vector value FE function () !"); - ; - return new E_set_fev3< double, v_fesS >(&b, rr); - } - // try complex vector value FE interpolation - - rr = IsFEcomp< Complex, v_fesS >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< Complex, v_fesS >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible complex vector value FE function () !"); - ; - return new E_set_fev3< Complex, v_fesS >(&b, rr); - } - - rr = IsFEcomp< double, v_fesL >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< double, v_fesL >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible real vector value FE function () !"); - ; - return new E_set_fev3< double, v_fesL >(&b, rr); - } - // try complex vector value FE interpolation - - rr = IsFEcomp< Complex, v_fesL >(a[0], 0, rrr, iii); - if (rr != 0) { - for (int i = 1; i < nb; i++) - if (!IsFEcomp< Complex, v_fesL >(a[i], i, rrr, iii)) - CompileError("Copy of Array with incompatible complex vector value FE function () !"); - ; - return new E_set_fev3< Complex, v_fesL >(&b, rr); - } - } - - - - else { - Expression r = 0; // new code FH sep 2009. - if (!r) r = Op_CopyArrayT< double, v_fes >(a, b); - if (!r) r = Op_CopyArrayT< Complex, v_fes >(a, b); - if (!r) r = Op_CopyArrayT< double, v_fes3 >(a, b); - if (!r) r = Op_CopyArrayT< Complex, v_fes3 >(a, b); - if (!r) r = Op_CopyArrayT< double, v_fesS >(a, b); - if (!r) r = Op_CopyArrayT< Complex, v_fesS >(a, b); - if (!r) r = Op_CopyArrayT< double, v_fesL >(a, b); - if (!r) r = Op_CopyArrayT< Complex, v_fesL >(a, b); - if (r) return r; + Expression r = 0; // new code FH sep 2009. + if (!r) r = Op_CopyArrayT< double, v_fes >(a, b); + if (!r) r = Op_CopyArrayT< Complex, v_fes >(a, b); + if (!r) r = Op_CopyArrayT< double, v_fes3 >(a, b); + if (!r) r = Op_CopyArrayT< Complex, v_fes3 >(a, b); + if (!r) r = Op_CopyArrayT< double, v_fesS >(a, b); + if (!r) r = Op_CopyArrayT< Complex, v_fesS >(a, b); + if (!r) r = Op_CopyArrayT< double, v_fesL >(a, b); + if (!r) r = Op_CopyArrayT< Complex, v_fesL >(a, b); + if (r) return r; + else { + CompileError("Internal Error: General Copy of Array : to do "); + return ret; } - CompileError("Internal Error: General Copy of Array : to do "); - return ret; } template< class v_fes, int DIM > diff --git a/src/fflib/lgmesh.cpp b/src/fflib/lgmesh.cpp index 9058ceccf..13583926e 100644 --- a/src/fflib/lgmesh.cpp +++ b/src/fflib/lgmesh.cpp @@ -925,30 +925,6 @@ AnyType Adaptation::operator()(Stack stack) const Th.SmoothMetric(raison); Th.MaxSubDivision(maxsubdiv); Th.BoundAnisotropy(anisomax); - if(nbcperiodic && false ) // in test - // to be sure that the metric is ok with periotic BC - { // bof Bof ... - if(verbosity>1) cout << " inforce de periodic BC on Metric" << endl; - KN m(3*ndfv.N()), c(ndfv.N()); - c=0.; - m=0.; - for ( iv=0;iv