Commit 88d82c43 authored by Olivier Bonnefon's avatar Olivier Bonnefon
Browse files

remove w files from save

parent 52cd53bf
load "BinaryIO"
// test of BinaryIO tools ...
real[int] buffer1(5);
real[int] buffer2(5);
for (int ii=0;ii<5;ii++)
buffer1[ii]=ii;
SaveVec(buffer1,"saveBuff");
int size=0;
GetSizeVec(size,"saveBuff");
cout<<"size ="<<size<<endl;
LoadVec(buffer2,"saveBuff");
for (int ii=0;ii<size;ii++)
cout<<buffer2[ii]<<" ";
cout<<endl;
for (int jj=0;jj<4;jj++){
for (int ii=0;ii<5;ii++)
buffer1[ii]=buffer1[ii]+5;
SaveVecAppend(buffer1,"saveBuff");
}
int newSize=25;
SetSizeVec(newSize,"saveBuff");
GetSizeVec(size,"saveBuff");
real[int] buffer3(size);
cout<<"now size ="<<size<<endl;
LoadVec(buffer3,"saveBuff");
for (int ii=0;ii<size;ii++)
cout<<buffer3[ii]<<" ";
cout<<endl;
load "BinaryIO"
int size;
GetSizeVec(size,"u2d0__rep_0");
cout<<"now size ="<<size<<endl;
includepath += "../Tools1D/"
includepath += "../Recorder/"
includepath += "../examples1D/"
loadpath += "/opt/freefem++-3.58/examples++-load/"
#include <fstream>
#include <iostream>
using namespace std;
long GetSizeVec(char* name){
std::ifstream infile (name,ios_base::binary);
long dim;
infile.read((char *) &dim, sizeof(long int));
return dim;
}
void LoadVec(char* name,double *pD)
{
std::ifstream infile (name,ios_base::binary);
long int dim;
infile.read((char *) &dim, sizeof(long int));
double dtemp;
for(long int i=0; i<dim; i++)
{
infile.read((char *) &dtemp, sizeof(double));
*(pD++)=dtemp ;
}
}
int main(){
char filename[256];
int N=100;
double * pMaxTraj[14];
double * pMinTraj[14];
long size[14];
for (int j=0;j<15;j++){
sprtinf(filename,"../SAVE/u2d%i__rep_0",j);
size[j]=GetSizeVec(filename);
pMaxTraj[j]=(double *)malloc(size[j]*sizeof(double));
pMinTraj[j]=(double *)malloc(size[j]*sizeof(double));
}
size[j]=GetSizeVec("../SAVE/u2d0__rep_0");
for(int ii=0;ii<100;ii++){
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment