Skip to content

Commit 04aa90a

Browse files
authored
Merge pull request #2 from MikeHeiber/development
v3.2 Update - Updates morphology output so that the first line of the morphology file contains information about the version of Ising_OPV used to generate the morphology and whether the file is compressed or uncompressed.
2 parents 3380538 + 1966867 commit 04aa90a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Morphology.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,11 @@ bool Morphology::importMorphologyFile(ifstream * input,bool compressed_files){
20052005
string line;
20062006
Site site;
20072007
getline(*input,line);
2008+
if(line.substr(0,9).compare("Ising_OPV")==0){
2009+
// skip first line
2010+
// get next line
2011+
getline(*input,line);
2012+
}
20082013
Length = atoi(line.c_str());
20092014
getline(*input,line);
20102015
Width = atoi(line.c_str());

main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int main(int argc, char * argv[]){
6161
// Input parameters
6262
Input_Parameters parameters;
6363
// Internal parameters
64-
string version = "v3.1";
64+
string version = "v3.2";
6565
bool enable_import_morphology;
6666
double mix_ratio = 0;
6767
double domain_size1 = 0;
@@ -380,23 +380,27 @@ int main(int argc, char * argv[]){
380380
ss << path << "morphology_" << procid << "_uncompressed.txt";
381381
morphology_output_file.open(ss.str().c_str());
382382
ss.str("");
383+
morphology_output_file << "Ising_OPV " << version << " - uncompressed format" << endl;
383384
}
384385
else{
385386
ss << path << "morphology_" << procid << "_compressed.txt";
386387
morphology_output_file.open(ss.str().c_str());
387388
ss.str("");
389+
morphology_output_file << "Ising_OPV " << version << " - compressed format" << endl;
388390
}
389391
}
390392
else{
391393
if(!parameters.enable_export_compressed_files){
392394
ss << path << filename_prefix << "mod_" << procid << "_uncompressed.txt";
393395
morphology_output_file.open(ss.str().c_str());
394396
ss.str("");
397+
morphology_output_file << "Ising_OPV " << version << " - uncompressed format" << endl;
395398
}
396399
else{
397400
ss << path << filename_prefix << "mod_" << procid << "_compressed.txt";
398401
morphology_output_file.open(ss.str().c_str());
399402
ss.str("");
403+
morphology_output_file << "Ising_OPV " << version << " - compressed format" << endl;
400404
}
401405
}
402406
morph.outputMorphologyFile(&morphology_output_file,parameters.enable_export_compressed_files);

parameters_default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Parameters for Ising_OPV v3.0
1+
## Parameters for Ising_OPV v3.2
22
-------------------------------
33
## General Parameters
44
50 //length (integer values only) (specify the x-direction size of the lattice)

0 commit comments

Comments
 (0)