   #include "stdlib.h"
   #include <stdio.h>     
   #include <stdlib.h>
   #include <string.h> 
   #include <fstream>
   #include <iostream> 
   #include <iostream>
   #include <string.h>
   #include <fstream> 
   const char *command = "blockMesh";

if (mash==1){
  
   std::fstream readFile;
   std::ofstream writeFile;
   
   string str_nx=std::to_string(nx); int length_nx=str_nx.length(); string one="1";  size_t pos_nx;
   string str; string simpGra="simpleGrading";size_t pos; 

    
   string right="right"; string updown="updown"; string slashes="//"; int flag=0;
   readFile.open("system/blockMeshDict");
   writeFile.open("system/sample");
   while(std::getline(readFile,str))
        {   
	        if((pos=str.find(simpGra))<4294967295){
            cout<<"Found at "<<pos<<endl;
            pos_nx=str.find(str_nx);
            cout<<"Found at "<<pos_nx<<endl;
            str.replace(pos_nx,length_nx,one);
           }

            if((pos=str.find(right))<4294967295){
            cout<<"Found at "<<pos<<endl;
            str.replace(pos,right.length(),"/*right");
           }

            if((pos=str.find(updown))<4294967295){
            cout<<"Found at "<<pos<<endl;
            str.replace(pos,updown.length(),"*/updown");
			flag=1;
           }

            if((pos=str.find(slashes))<4294967295 && flag==1){
            cout<<"Found at "<<pos<<endl;
            str.replace(pos,slashes.length(),"");
           }
    
		if((pos=str.find("}"))<4294967295 && flag==1){
				flag=2;
			}
      writeFile<<str<<"\n";

        }
        readFile.close();
        writeFile.close();
        remove("system/blockMeshDict");
        rename("system/sample","system/blockMeshDict");
        remove("system/sample");
		
	
	 system(command); 
	 cout << "New mesh created \n";
}	
   else {
	   cout<<"Ok, so you have to go to blockMeshDict and change it. Press one whenyou have done";
	   
	   int change; 
	  cin>>change; 
	   if (change==1)
	   {	 
	 system(command); 
	 cout << "New mesh created \n";
	   } else{
	   cout << "You don't change. I stop "; 
	   exit (EXIT_FAILURE); 
	   }
	   }
