Skip to content

Commit ad41cb8

Browse files
authored
Minor fixes
1 parent a5f4584 commit ad41cb8

26 files changed

+70
-358
lines changed

plugin/seq/DxWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class DxWriter {
112112

113113
_vecmesh.push_back(mesh);
114114
_ofdata.flags(std::ios_base::scientific);
115-
_ofdata.precision(15);
115+
_ofdata.precision(17);
116116
_ofdata << "object \"pos_" << _vecmesh.size( ) - 1
117117
<< "\" class array type float rank 1 shape 2 items " << Th.nv << " data follows"
118118
<< std::endl;
@@ -168,7 +168,7 @@ class DxWriter {
168168

169169
_vecofts[jj].vecistant.push_back(t);
170170
_ofdata.flags(std::ios_base::scientific);
171-
_ofdata.precision(15);
171+
_ofdata.precision(17);
172172
_ofdata << "object \"" << nameofts << "_data_" << _vecofts[jj].vecistant.size( ) - 1
173173
<< "\" class array type float rank 0 items " << val.size( ) << " data follows"
174174
<< std::endl;
@@ -203,7 +203,7 @@ class DxWriter {
203203
}
204204

205205
_ofdata.flags(std::ios_base::scientific);
206-
_ofdata.precision(15);
206+
_ofdata.precision(17);
207207
_ofdata << "object \"" << nameoffield << "_data\" class array type float rank 0 items "
208208
<< val.size( ) << " data follows" << std::endl;
209209

plugin/seq/Element_QF.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -329,54 +329,6 @@ static void finit( ) { // equivalent2d 3d EFQF
329329
static AddNewFE3 AddNewFE_QF3d5("FEQF53d", &TypeOfFE_QF3d5);
330330
static AddNewFE3 AddNewFE_QF3ddef("FEQF3d", &TypeOfFE_QF3d5);
331331

332-
if (0) { // ne marche pas ??????
333-
TEF2dto3d[FindFE2("FEQF")] = &TypeOfFE_QF3d5;
334-
TEF2dto3d[FindFE2("FEQF1")] = &TypeOfFE_QF3d1;
335-
TEF2dto3d[FindFE2("FEQF2")] = &TypeOfFE_QF3d2;
336-
TEF2dto3d[FindFE2("FEQF5")] = &TypeOfFE_QF3d5;
337-
}
338-
339-
if (0) { // Add tools cree new FiniteElement2d
340-
static AddNewFE3 *pAddNewFE3[15];
341-
342-
for (int i = 1; i <= 14; ++i) {
343-
if (verbosity > 9) {
344-
cout << "\n";
345-
}
346-
347-
pAddNewFE3[i] = 0;
348-
char sqfv[100];
349-
sprintf(sqfv, "qfVp%d", i);
350-
C_F0 cfq = Global.Find(sqfv);
351-
if (cfq.NotNull( )) {
352-
if (verbosity > 99) {
353-
cout << " find " << i << " " << sqfv << " type " << cfq.left( ) << endl;
354-
}
355-
356-
const EConstant< const GQuadratureFormular< R3 > * > *efq =
357-
dynamic_cast< const EConstant< const GQuadratureFormular< R3 > * > * >(cfq.LeftValue( ));
358-
if (efq) {
359-
char *EFsqfv = new char[16];
360-
sprintf(EFsqfv, "FEqfVp%d", i);
361-
362-
const GQuadratureFormular< R3 > *qf =
363-
GetAny< const GQuadratureFormular< R3 > * >((*efq)(0));
364-
if (verbosity > 9) {
365-
cout << " \t " << sqfv << " " << qf->n << " " << qf->exact << ", EF : " << EFsqfv
366-
<< endl;
367-
}
368-
369-
// int m = 5;
370-
TypeOfFE_QF3d *FEqf = new TypeOfFE_QF3d(*qf);
371-
pAddNewFE3[i] = new AddNewFE3(EFsqfv, FEqf);
372-
}
373-
} else if (verbosity > 9) {
374-
cout << " try " << i << " " << sqfv << " not found" << endl;
375-
}
376-
377-
;
378-
}
379-
}
380332

381333
Dcl_Type< pEF2d * >(::InitializePtr< pEF2d >, ::DeletePtr< pEF2d >);
382334
if (verbosity > 9) {

plugin/seq/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ allheaders=../../src/fflib/AddNewFE.h ../../src/fflib/AFunction_ext.hpp ../../sr
9191
../../src/femlib/assertion.hpp ../../src/femlib/BamgFreeFem.hpp ../../src/Algo/BFGS.hpp ../../src/Algo/BrentLS.hpp \
9292
../../src/femlib/CGNL.hpp ../../src/fflib/CodeAlloc.hpp ../../config.h \
9393
../../src/Algo/CubicLS.hpp ../../src/Algo/defs.hpp ../../src/femlib/DOperator.hpp ../../src/libMesh/eigenv.h \
94-
../../src/fflib/endian.hpp ../../src/fflib/environment.hpp ../../src/fflib/error.hpp ../../src/femlib/fem3.hpp \
94+
../../src/fflib/endian.hpp ../../src/fflib/environment.hpp ../../src/fflib/error.hpp \
9595
../../src/femlib/fem.hpp ../../src/femlib/FESpace.hpp ../../src/femlib/FESpacen.hpp ../../src/fflib/ff++.hpp \
9696
../../src/fflib/ffstack.hpp ../../src/femlib/FQuadTree.hpp ../../src/femlib/GenericMesh.hpp \
9797
../../src/Graphics/getprog-unix.hpp ../../src/Graphics/glrgraph.hpp ../../src/femlib/gmres.hpp \

plugin/seq/SaveHB.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ void output_matrix_entries(ofstream &fout, const int N, const double *const ccs_
2424
const int nnzero, const double *const b) {
2525
for (int i = 0; i < nnzero; i++) {
2626

27-
fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i];
27+
fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i];
2828

2929
if ((i + 1) % 4 == 0) fout << std::endl;
3030
}
3131
if (nnzero % 4 != 0) fout << std::endl;
3232

3333
for (int i = 0; i < N; i++) {
3434

35-
fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i];
35+
fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << b[i];
3636

3737
if ((i + 1) % 4 == 0) fout << std::endl;
3838
}
@@ -45,17 +45,17 @@ void output_matrix_entries(ofstream &fout, const int N, const complex< double >
4545
const int nnzero, const complex< double > *const b) {
4646
for (int i = 0; i < nnzero; i++) {
4747

48-
fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].real( )
49-
<< setw(20) << setprecision(12) << setiosflags(ios::scientific) << ccs_val[i].imag( );
48+
fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i].real( )
49+
<< setw(20) << setprecision(17) << setiosflags(ios::scientific) << ccs_val[i].imag( );
5050

5151
if ((i + 1) % 2 == 0) fout << std::endl;
5252
}
5353
if (nnzero % 2 != 0) fout << std::endl;
5454

5555
for (int i = 0; i < N; i++) {
5656

57-
fout << setw(20) << setprecision(12) << setiosflags(ios::scientific) << b[i].real( ) << setw(20)
58-
<< setprecision(12) << setiosflags(ios::scientific) << b[i].imag( );
57+
fout << setw(20) << setprecision(17) << setiosflags(ios::scientific) << b[i].real( ) << setw(20)
58+
<< setprecision(17) << setiosflags(ios::scientific) << b[i].imag( );
5959

6060
if ((i + 1) % 2 == 0) fout << std::endl;
6161
}

plugin/seq/VTK_writer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class VtkWriter {
7777

7878
_vecmesh.push_back(mesh);
7979
_ofdata.flags(std::ios_base::scientific);
80-
_ofdata.precision(15);
80+
_ofdata.precision(17);
8181

8282
_ofdata << "<?xml version=\"1.0\"?>" << std::endl;
8383
_ofdata << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">";
@@ -148,7 +148,7 @@ class VtkWriter {
148148
/*!Add a field*/
149149
void addscalar(const string &nameoffield, const Fem2D::Mesh *mesh, const KN< double > &val) {
150150
_ofdata.flags(std::ios_base::scientific);
151-
_ofdata.precision(15);
151+
_ofdata.precision(17);
152152

153153
_ofdata << "<DataArray type=\"Float32\" Name=\"";
154154
_ofdata << nameoffield << "\" NumberOfComponents=\"1\" format=\"ascii\">";
@@ -167,7 +167,7 @@ class VtkWriter {
167167
void addvector(const string &nameoffield, const Fem2D::Mesh *mesh, const KN< double > &val,
168168
const KN< double > &val2) {
169169
_ofdata.flags(std::ios_base::scientific);
170-
_ofdata.precision(15);
170+
_ofdata.precision(17);
171171

172172
_ofdata << "<DataArray type=\"Float32\" Name=\"";
173173
_ofdata << nameoffield << "\" NumberOfComponents=\"3\" format=\"ascii\">";

plugin/seq/VTK_writer_3d.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class VtkWriter {
7878

7979
_vecmesh.push_back(mesh);
8080
_ofdata.flags(std::ios_base::scientific);
81-
_ofdata.precision(15);
81+
_ofdata.precision(17);
8282

8383
_ofdata << "<?xml version=\"1.0\"?>" << std::endl;
8484
_ofdata << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">"
@@ -136,7 +136,7 @@ class VtkWriter {
136136
/*!Add a field*/
137137
void addscalar(const string &nameoffield, const Mesh3 *mesh, const KN< double > &val) {
138138
_ofdata.flags(std::ios_base::scientific);
139-
_ofdata.precision(15);
139+
_ofdata.precision(17);
140140

141141
_ofdata << "<DataArray type=\"Float32\" Name=\"" << nameoffield
142142
<< "\" NumberOfComponents=\"1\" format=\"ascii\">" << std::endl;
@@ -165,7 +165,7 @@ class VtkWriter {
165165
void addvector(const string &nameoffield, const Mesh3 *mesh, const KN< double > &val,
166166
const KN< double > &val2, const KN< double > &val3) {
167167
_ofdata.flags(std::ios_base::scientific);
168-
_ofdata.precision(15);
168+
_ofdata.precision(17);
169169

170170
_ofdata << "<DataArray type=\"Float32\" Name=\"" << nameoffield
171171
<< "\" NumberOfComponents=\"3\" format=\"ascii\">" << std::endl;

plugin/seq/bmo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ double BijanMO::main(Vect &xx, Vect &xxmin, Vect &xxmax) {
200200
}
201201

202202
if (debug) {
203-
cout.precision(15);
203+
cout.precision(17);
204204
cout << " F = " << costsavemin << " FM = " << costsaveming << endl;
205205
}
206206

@@ -224,7 +224,7 @@ double BijanMO::main(Vect &xx, Vect &xxmin, Vect &xxmax) {
224224

225225
result(xoptg, vinit);
226226
cout << "-------------------------------------------\n";
227-
cout.precision(15);
227+
cout.precision(17);
228228
cout << " FM = " << costsaveming << " nb eval J : " << nbeval << " nbevalp : " << nbevalp << endl;
229229
if (ncstr > 0) {
230230
cout << "-------------------------------------------\n";
@@ -367,7 +367,7 @@ int BijanMO::gradopt(Vect &x1, Vect &fpx, Vect &temp, double &rho, double &f, do
367367
gnorm /= gnorm0;
368368
if (histpath) {
369369
ofstream fhist(histpath->c_str( ), ios::app);
370-
fhist.precision(16);
370+
fhist.precision(17);
371371
fhist << f << " " << gnorm * gnorm0 << " ";
372372
int n1 = min(ndim, 10);
373373

@@ -378,7 +378,7 @@ int BijanMO::gradopt(Vect &x1, Vect &fpx, Vect &temp, double &rho, double &f, do
378378

379379
if (histcpath) {
380380
ofstream fhist(histcpath->c_str( ), ios::app);
381-
fhist.precision(16);
381+
fhist.precision(17);
382382
fhist << fseul << endl;
383383

384384
for (int i = 0; i < ncstr; ++i) {

plugin/seq/cmaes.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,18 +1751,6 @@ const char *cmaes_TestForTermination(cmaes_t *t) {
17511751
cp += sprintf(cp, "Manual: stop signal read\n");
17521752
}
17531753

1754-
#if 0
1755-
else if (0) {
1756-
for (i = 0, cTemp = 0; i < N; ++i) {
1757-
cTemp += (sigma * sqrt(C[i][i]) < stopdx) ? 1 : 0;
1758-
cTemp += (sigma * rgpc[i] < stopdx) ? 1 : 0;
1759-
}
1760-
1761-
if (cTemp == 2 * N) {
1762-
flgStop = 1;
1763-
}
1764-
}
1765-
#endif
17661754

17671755
if (cp - sTestOutString > 320) {
17681756
ERRORMESSAGE("Bug in cmaes_t:Test(): sTestOutString too short", 0, 0, 0);

plugin/seq/gmsh.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ bool SaveGMSH(pmesh3 pTh, string *filewoext) {
16491649
return 1;
16501650
}
16511651

1652-
f1.precision(15);
1652+
f1.precision(17);
16531653
const Mesh3 &msh = *pTh;
16541654
long nbvertices = msh.nv;
16551655
f1 << "$MeshFormat" << endl;
@@ -1701,7 +1701,7 @@ bool SaveGMSH(pmeshS pTh, string *filewoext) {
17011701
return 1;
17021702
}
17031703

1704-
f1.precision(15);
1704+
f1.precision(17);
17051705
const MeshS &msh = *pTh;
17061706
long nbvertices = msh.nv;
17071707
f1 << "$MeshFormat" << endl;
@@ -1750,7 +1750,7 @@ bool SaveGMSH(pmeshL pTh, string *filewoext) {
17501750
return 1;
17511751
}
17521752

1753-
f1.precision(15);
1753+
f1.precision(17);
17541754
const MeshL &msh = *pTh;
17551755
long nbvertices = msh.nv;
17561756
f1 << "$MeshFormat" << endl;

plugin/seq/iovtk.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6906,17 +6906,17 @@ void saveMatlab(const string &file, const Mesh &Th) {
69066906
pf << "x = [ ";
69076907

69086908
for (size_t n = 0; n < 3; n++) {
6909-
pf << std::setprecision(5) << setw(18) << K[n].x << " ";
6909+
pf << std::setprecision(17) << setw(18) << K[n].x << " ";
69106910
}
69116911

6912-
pf << std::setprecision(5) << setw(18) << K[0].x << " ]; ";
6912+
pf << std::setprecision(17) << setw(18) << K[0].x << " ]; ";
69136913
pf << "y = [ ";
69146914

69156915
for (size_t n = 0; n < 3; n++) {
6916-
pf << std::setprecision(5) << setw(18) << K[n].y << " ";
6916+
pf << std::setprecision(17) << setw(18) << K[n].y << " ";
69176917
}
69186918

6919-
pf << std::setprecision(5) << setw(18) << K[0].y << " ]; ";
6919+
pf << std::setprecision(17) << setw(18) << K[0].y << " ]; ";
69206920
pf << "line(x,y);" << endl;
69216921
}
69226922

@@ -6953,7 +6953,7 @@ void saveTecplot(const string &file, const Mesh &Th) {
69536953
pf << "ZONE N=" << Th.nv << ", E=" << Th.nt << ", F=FEPOINT, ET=" << shape << endl;
69546954

69556955
for (int i = 0; i < Th.nv; i++) {
6956-
pf << std::setprecision(5) << setw(18) << (R2)Th(i) << " \n";
6956+
pf << std::setprecision(17) << setw(18) << (R2)Th(i) << " \n";
69576957
}
69586958

69596959
for (int k = 0; k < Th.nt; ++k) {

0 commit comments

Comments
 (0)