Merge pull request #3691 from akva2/bda_wellcontrib_refactor

Refactor BDA well contributions
This commit is contained in:
Markus Blatt
2021-11-15 10:26:44 +01:00
committed by GitHub
14 changed files with 399 additions and 291 deletions

View File

@@ -81,18 +81,22 @@ testCusparseSolver(const boost::property_tree::ptree& prm, const std::string& ma
Dune::InverseOperatorResult result;
Vector x(rhs.size());
Opm::WellContributions wellContribs("cusparse", false);
auto wellContribs = Opm::WellContributions::create("cusparse", false);
std::unique_ptr<Opm::BdaBridge<Matrix, Vector, bz> > bridge;
try {
bridge = std::make_unique<Opm::BdaBridge<Matrix, Vector, bz> >(gpu_mode, fpga_bitstream, linear_solver_verbosity, maxit, tolerance, platformID, deviceID, opencl_ilu_reorder);
bridge->solve_system(&matrix, rhs, *wellContribs, result);
bridge->get_result(x);
return x;
} catch (const std::logic_error& error) {
BOOST_WARN_MESSAGE(true, error.what());
throw DeviceInitException(error.what());
if (strstr(error.what(), "Could not get device") != nullptr)
throw DeviceInitException(error.what());
else
throw error;
}
bridge->solve_system(&matrix, rhs, wellContribs, result);
bridge->get_result(x);
return x;
}
namespace pt = boost::property_tree;

View File

@@ -80,7 +80,7 @@ testOpenclSolver(const boost::property_tree::ptree& prm, const std::string& matr
Dune::InverseOperatorResult result;
Vector x(rhs.size());
Opm::WellContributions wellContribs("opencl", false);
auto wellContribs = Opm::WellContributions::create("opencl", false);
std::unique_ptr<Opm::BdaBridge<Matrix, Vector, bz> > bridge;
try {
bridge = std::make_unique<Opm::BdaBridge<Matrix, Vector, bz> >(gpu_mode, fpga_bitstream, linear_solver_verbosity, maxit, tolerance, platformID, deviceID, opencl_ilu_reorder);
@@ -88,7 +88,7 @@ testOpenclSolver(const boost::property_tree::ptree& prm, const std::string& matr
BOOST_WARN_MESSAGE(true, error.what());
throw PlatformInitException(error.what());
}
bridge->solve_system(&matrix, rhs, wellContribs, result);
bridge->solve_system(&matrix, rhs, *wellContribs, result);
bridge->get_result(x);
return x;