修改eclipse模型的深度

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

/* ecl grid file format
coord
....../
zcorn
..../
*/
int main(int argc, char*argv[]){
ifstream fin(argv[1]);
int ni= atoi(argv[2]);
int nj= atoi(argv[3]);
int nk= atoi(argv[4]);
float changeV = atof(argv[5]);

ofstream fout("output_grid.grdecl");
fout<<fixed<<setprecision(6);

string keyword;
float value;
fin>>keyword; //keyword coord
fout<<keyword<<"\n";

fout<<fixed<<setprecision(6);
int n=(ni+1)*(nj+1)*2;
for(int i=0;i<n;i++){
fin>>value; fout<<value<<" "; //x
fin>>value; fout<<value<<" "; //y
fin>>value; fout<<value+changeV<<" "; //z
if(i%1000==0){
cout<<i<<"/"<<n<<endl;
}
fout<<"\n";
}
fin>>keyword; fout<<keyword<<"\n"; //end symbol /
fin>>keyword; fout<<keyword<<"\n"; // zcorn
n = ni*nj*nk*8;
for(int i=0;i<n;i++){
fin>>value; fout<<value+changeV<<" ";
if(i%1000==0){
cout<<i<<"/"<<n<<endl;
}
if((i+1)%8==0)
fout<<"\n";
}
fin>>keyword; fout<<keyword<<"\n"; //end symbol /
fin.close();
fout.close();
return 0;
}

posted @ 2022-08-29 17:40  Oliver2022  阅读(84)  评论(0编辑  收藏  举报