Skip to content

Commit

Permalink
add safety in case reaction phases are not set up
Browse files Browse the repository at this point in the history
  • Loading branch information
tduretz committed Dec 21, 2023
1 parent 96847d5 commit 0354c32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MDLIB/InputOutput.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,7 @@ Input ReadInputFile( char *fileName ) {
// Reaction stuff
materials.reac_soft[k] = (int)ReadMatProps( fin, "reac_soft", k, 0.0 );
materials.reac_phase[k] = (int)ReadMatProps( fin, "reac_phase", k, 0.0 );
if (materials.reac_phase[k]>=model.Nb_phases) {printf("The target phase for reaction softening of phase %d is not set up. Edit the .txt file!\n", k ); exit(13);}
materials.Pr[k] = ReadMatProps( fin, "Pr", k, 0.0 ) / scaling.S;
materials.dPr[k] = ReadMatProps( fin, "dPr", k, 0.0 ) / scaling.S;
materials.tau_kin[k] = ReadMatProps( fin, "tau_kin", k, 0.0 ) / scaling.t;
Expand Down Expand Up @@ -1608,7 +1609,8 @@ Input ReadInputFile( char *fileName ) {
model.PDMTmax[pid] = (800+273)/scaling.T; // Maximum temperature (MANTLE) [K]
model.PDMPmin[pid] = (0.0090/10*1e9)/scaling.S; // Minimum pressure (MANTLE) [Pa]
model.PDMPmax[pid] = (49.9890/10*1e9)/scaling.S; // Maximum pressure (MANTLE) [Pa]
model.PDMrho[pid] = ReadBin(model.import_files_dir, "SiO2_nsm000.dat", model.PDMnT[pid], model.PDMnP[pid], scaling.rho);
model.PDMrho[pid] = ReadBin(model.import_files_dir, "SiO2_nsm010.dat", model.PDMnT[pid], model.PDMnP[pid], scaling.rho);
// model.PDMrho[pid] = ReadBin(model.import_files_dir, "SiO2_nsm000.dat", model.PDMnT[pid], model.PDMnP[pid], scaling.rho);
}

//------------------------------------------------------------------------------------------------------------------------------//
Expand Down

0 comments on commit 0354c32

Please sign in to comment.