Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugin/seq/DxWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
48 changes: 0 additions & 48 deletions plugin/seq/Element_QF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion plugin/seq/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
12 changes: 6 additions & 6 deletions plugin/seq/SaveHB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ 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;
}
if (nnzero % 4 != 0) fout << std::endl;

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;
}
Expand All @@ -45,17 +45,17 @@ 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;
}
if (nnzero % 2 != 0) fout << std::endl;

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;
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/seq/VTK_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class VtkWriter {

_vecmesh.push_back(mesh);
_ofdata.flags(std::ios_base::scientific);
_ofdata.precision(15);
_ofdata.precision(17);

_ofdata << "<?xml version=\"1.0\"?>" << std::endl;
_ofdata << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">";
Expand Down Expand Up @@ -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 << "<DataArray type=\"Float32\" Name=\"";
_ofdata << nameoffield << "\" NumberOfComponents=\"1\" format=\"ascii\">";
Expand All @@ -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 << "<DataArray type=\"Float32\" Name=\"";
_ofdata << nameoffield << "\" NumberOfComponents=\"3\" format=\"ascii\">";
Expand Down
6 changes: 3 additions & 3 deletions plugin/seq/VTK_writer_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class VtkWriter {

_vecmesh.push_back(mesh);
_ofdata.flags(std::ios_base::scientific);
_ofdata.precision(15);
_ofdata.precision(17);

_ofdata << "<?xml version=\"1.0\"?>" << std::endl;
_ofdata << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">"
Expand Down Expand Up @@ -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 << "<DataArray type=\"Float32\" Name=\"" << nameoffield
<< "\" NumberOfComponents=\"1\" format=\"ascii\">" << std::endl;
Expand Down Expand Up @@ -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 << "<DataArray type=\"Float32\" Name=\"" << nameoffield
<< "\" NumberOfComponents=\"3\" format=\"ascii\">" << std::endl;
Expand Down
8 changes: 4 additions & 4 deletions plugin/seq/bmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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";
Expand Down Expand Up @@ -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);

Expand All @@ -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) {
Expand Down
12 changes: 0 additions & 12 deletions plugin/seq/cmaes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions plugin/seq/gmsh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions plugin/seq/iovtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down
7 changes: 0 additions & 7 deletions src/Graphics/ffglut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions src/bamglib/MeshGeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
31 changes: 9 additions & 22 deletions src/bamglib/Metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
Loading
Loading