mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Replace THROW by OPM_THROW
This commit is contained in:
@@ -219,7 +219,7 @@ namespace Opm
|
||||
output_binary_ = param.getDefault("output_binary", false);
|
||||
#ifndef HAVE_ERT
|
||||
if (output_binary_) {
|
||||
THROW("Cannot make binary output without ert library support. Reconfigure opm-core and opm-polymer with --with-ert and recompile.");
|
||||
OPM_THROW(std::runtime_error, "Cannot make binary output without ert library support. Reconfigure opm-core and opm-polymer with --with-ert and recompile.");
|
||||
}
|
||||
#endif
|
||||
output_dir_ = param.getDefault("output_dir", std::string("output"));
|
||||
@@ -229,7 +229,7 @@ namespace Opm
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
THROW("Creating directories failed: " << fpath);
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
}
|
||||
output_interval_ = param.getDefault("output_interval", 1);
|
||||
}
|
||||
@@ -246,7 +246,7 @@ namespace Opm
|
||||
} else if (method_string == "Newton") {
|
||||
method = Opm::TransportSolverTwophasePolymer::Newton;
|
||||
} else {
|
||||
THROW("Unknown method: " << method_string);
|
||||
OPM_THROW(std::runtime_error, "Unknown method: " << method_string);
|
||||
}
|
||||
tsolver_.setPreferredMethod(method);
|
||||
num_transport_substeps_ = param.getDefault("num_transport_substeps", 1);
|
||||
@@ -388,7 +388,7 @@ namespace Opm
|
||||
well_control_passed = wells_manager_.conditionsMet(well_state.bhp(), well_resflows_phase, well_resflows_phase);
|
||||
++well_control_iteration;
|
||||
if (!well_control_passed && well_control_iteration > max_well_control_iterations_) {
|
||||
THROW("Could not satisfy well conditions in " << max_well_control_iterations_ << " tries.");
|
||||
OPM_THROW(std::runtime_error, "Could not satisfy well conditions in " << max_well_control_iterations_ << " tries.");
|
||||
}
|
||||
if (!well_control_passed) {
|
||||
std::cout << "Well controls not passed, solving again." << std::endl;
|
||||
@@ -551,12 +551,12 @@ namespace Opm
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
THROW("Creating directories failed: " << fpath);
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
}
|
||||
vtkfilename << "/output-" << std::setw(5) << std::setfill('0') << step << ".vtu";
|
||||
std::ofstream vtkfile(vtkfilename.str().c_str());
|
||||
if (!vtkfile) {
|
||||
THROW("Failed to open " << vtkfilename.str());
|
||||
OPM_THROW(std::runtime_error, "Failed to open " << vtkfilename.str());
|
||||
}
|
||||
Opm::DataMap dm;
|
||||
dm["saturation"] = &state.saturation();
|
||||
@@ -592,12 +592,12 @@ namespace Opm
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
THROW("Creating directories failed: " << fpath);
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
}
|
||||
fname << "/" << std::setw(5) << std::setfill('0') << step << ".txt";
|
||||
std::ofstream file(fname.str().c_str());
|
||||
if (!file) {
|
||||
THROW("Failed to open " << fname.str());
|
||||
OPM_THROW(std::runtime_error, "Failed to open " << fname.str());
|
||||
}
|
||||
const std::vector<double>& d = *(it->second);
|
||||
std::copy(d.begin(), d.end(), std::ostream_iterator<double>(file, "\n"));
|
||||
@@ -622,7 +622,7 @@ namespace Opm
|
||||
writeECLData(grid, dm, simtimer.currentStepNum(), simtimer.currentTime(), simtimer.currentDateTime(),
|
||||
output_dir, "polymer_ecl");
|
||||
#else
|
||||
THROW("Cannot call outputStateBinary() without ert library support. Reconfigure with --with-ert and recompile.");
|
||||
OPM_THROW(std::runtime_error, "Cannot call outputStateBinary() without ert library support. Reconfigure with --with-ert and recompile.");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ namespace Opm
|
||||
std::string fname = output_dir + "/watercut.txt";
|
||||
std::ofstream os(fname.c_str());
|
||||
if (!os) {
|
||||
THROW("Failed to open " << fname);
|
||||
OPM_THROW(std::runtime_error, "Failed to open " << fname);
|
||||
}
|
||||
watercut.write(os);
|
||||
}
|
||||
@@ -646,7 +646,7 @@ namespace Opm
|
||||
std::string fname = output_dir + "/wellreport.txt";
|
||||
std::ofstream os(fname.c_str());
|
||||
if (!os) {
|
||||
THROW("Failed to open " << fname);
|
||||
OPM_THROW(std::runtime_error, "Failed to open " << fname);
|
||||
}
|
||||
wellreport.write(os);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user