首页 > 其他分享 >修改eclipse模型的深度

修改eclipse模型的深度

时间:2022-08-29 17:44:34浏览次数:71  
标签:keyword int 模型 eclipse argv atoi value fout 深度

#include <iostream>
#include <fstream>
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");
    string keyword;
    float value;
    fin>>keyword;   //keyword coord
    fout<<keyword<<"\n";
    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;
        }
    }
    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;
        }
    }
    fin>>keyword; fout<<keyword<<"\n";  //end symbol /
    fin.close();
    fout.close();
    return 0;
}

 

标签:keyword,int,模型,eclipse,argv,atoi,value,fout,深度
From: https://www.cnblogs.com/oliver2022/p/16636748.html

相关文章