diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 0c510e1a4..0675e1aa7 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -28,7 +28,10 @@ list (APPEND MAIN_SOURCE_FILES opm/simulators/timestepping/SimulatorReport.cpp opm/simulators/flow/MissingFeatures.cpp opm/simulators/linalg/ExtractParallelGridInformationToISTL.cpp - opm/simulators/linalg/FlexibleSolver.cpp + opm/simulators/linalg/FlexibleSolver1.cpp + opm/simulators/linalg/FlexibleSolver2.cpp + opm/simulators/linalg/FlexibleSolver3.cpp + opm/simulators/linalg/FlexibleSolver4.cpp opm/simulators/timestepping/TimeStepControl.cpp opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp opm/simulators/timestepping/SimulatorTimer.cpp diff --git a/opm/simulators/linalg/FlexibleSolver.hpp b/opm/simulators/linalg/FlexibleSolver.hpp index d3fa0584e..d4fec9c15 100644 --- a/opm/simulators/linalg/FlexibleSolver.hpp +++ b/opm/simulators/linalg/FlexibleSolver.hpp @@ -21,7 +21,7 @@ #ifndef OPM_FLEXIBLE_SOLVER_HEADER_INCLUDED #define OPM_FLEXIBLE_SOLVER_HEADER_INCLUDED -#include +#include #include #include diff --git a/opm/simulators/linalg/FlexibleSolver1.cpp b/opm/simulators/linalg/FlexibleSolver1.cpp new file mode 100644 index 000000000..440d412ea --- /dev/null +++ b/opm/simulators/linalg/FlexibleSolver1.cpp @@ -0,0 +1,54 @@ +/* + Copyright 2019, 2020 SINTEF Digital, Mathematics and Cybernetics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include "config.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +// Explicit instantiations of FlexibleSolver + +template +using BV = Dune::BlockVector>; +template +using BM = Dune::BCRSMatrix>; +template +using OBM = Dune::BCRSMatrix>; + +// Variants using Dune::FieldMatrix blocks. +template class Dune::FlexibleSolver, BV<1>>; + +// Variants using Opm::MatrixBlock blocks. +template class Dune::FlexibleSolver, BV<1>>; + + +using Comm = Dune::OwnerOverlapCopyCommunication; + +template Dune::FlexibleSolver, BV<1>>::FlexibleSolver(const MatrixType& matrix, + const Comm& comm, + const boost::property_tree::ptree& prm, + const std::function()>& weightsCalculator); + diff --git a/opm/simulators/linalg/FlexibleSolver2.cpp b/opm/simulators/linalg/FlexibleSolver2.cpp new file mode 100644 index 000000000..837b1fab9 --- /dev/null +++ b/opm/simulators/linalg/FlexibleSolver2.cpp @@ -0,0 +1,54 @@ +/* + Copyright 2019, 2020 SINTEF Digital, Mathematics and Cybernetics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include "config.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +// Explicit instantiations of FlexibleSolver + +template +using BV = Dune::BlockVector>; +template +using BM = Dune::BCRSMatrix>; +template +using OBM = Dune::BCRSMatrix>; + +// Variants using Dune::FieldMatrix blocks. +template class Dune::FlexibleSolver, BV<2>>; + +// Variants using Opm::MatrixBlock blocks. +template class Dune::FlexibleSolver, BV<2>>; + + +using Comm = Dune::OwnerOverlapCopyCommunication; + +template Dune::FlexibleSolver, BV<2>>::FlexibleSolver(const MatrixType& matrix, + const Comm& comm, + const boost::property_tree::ptree& prm, + const std::function()>& weightsCalculator); + diff --git a/opm/simulators/linalg/FlexibleSolver3.cpp b/opm/simulators/linalg/FlexibleSolver3.cpp new file mode 100644 index 000000000..68890230d --- /dev/null +++ b/opm/simulators/linalg/FlexibleSolver3.cpp @@ -0,0 +1,54 @@ +/* + Copyright 2019, 2020 SINTEF Digital, Mathematics and Cybernetics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include "config.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +// Explicit instantiations of FlexibleSolver + +template +using BV = Dune::BlockVector>; +template +using BM = Dune::BCRSMatrix>; +template +using OBM = Dune::BCRSMatrix>; + +// Variants using Dune::FieldMatrix blocks. +template class Dune::FlexibleSolver, BV<3>>; + +// Variants using Opm::MatrixBlock blocks. +template class Dune::FlexibleSolver, BV<3>>; + + +using Comm = Dune::OwnerOverlapCopyCommunication; + +template Dune::FlexibleSolver, BV<3>>::FlexibleSolver(const MatrixType& matrix, + const Comm& comm, + const boost::property_tree::ptree& prm, + const std::function()>& weightsCalculator); + diff --git a/opm/simulators/linalg/FlexibleSolver4.cpp b/opm/simulators/linalg/FlexibleSolver4.cpp new file mode 100644 index 000000000..d2a4b2d03 --- /dev/null +++ b/opm/simulators/linalg/FlexibleSolver4.cpp @@ -0,0 +1,54 @@ +/* + Copyright 2019, 2020 SINTEF Digital, Mathematics and Cybernetics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include "config.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +// Explicit instantiations of FlexibleSolver + +template +using BV = Dune::BlockVector>; +template +using BM = Dune::BCRSMatrix>; +template +using OBM = Dune::BCRSMatrix>; + +// Variants using Dune::FieldMatrix blocks. +template class Dune::FlexibleSolver, BV<4>>; + +// Variants using Opm::MatrixBlock blocks. +template class Dune::FlexibleSolver, BV<4>>; + + +using Comm = Dune::OwnerOverlapCopyCommunication; + +template Dune::FlexibleSolver, BV<4>>::FlexibleSolver(const MatrixType& matrix, + const Comm& comm, + const boost::property_tree::ptree& prm, + const std::function()>& weightsCalculator); + diff --git a/opm/simulators/linalg/FlexibleSolver.cpp b/opm/simulators/linalg/FlexibleSolver_impl.hpp similarity index 77% rename from opm/simulators/linalg/FlexibleSolver.cpp rename to opm/simulators/linalg/FlexibleSolver_impl.hpp index 5a1d8e89d..8c19a15e7 100644 --- a/opm/simulators/linalg/FlexibleSolver.cpp +++ b/opm/simulators/linalg/FlexibleSolver_impl.hpp @@ -20,6 +20,7 @@ #include "config.h" #include +#include #include #include @@ -184,48 +185,3 @@ namespace Dune } } // namespace Dune - - -// Explicit instantiations of FlexibleSolver - -template -using BV = Dune::BlockVector>; -template -using BM = Dune::BCRSMatrix>; -template -using OBM = Dune::BCRSMatrix>; - -// Variants using Dune::FieldMatrix blocks. -template class Dune::FlexibleSolver, BV<1>>; -template class Dune::FlexibleSolver, BV<2>>; -template class Dune::FlexibleSolver, BV<3>>; -template class Dune::FlexibleSolver, BV<4>>; - -// Variants using Opm::MatrixBlock blocks. -template class Dune::FlexibleSolver, BV<1>>; -template class Dune::FlexibleSolver, BV<2>>; -template class Dune::FlexibleSolver, BV<3>>; -template class Dune::FlexibleSolver, BV<4>>; - - -using Comm = Dune::OwnerOverlapCopyCommunication; - -template Dune::FlexibleSolver, BV<1>>::FlexibleSolver(const MatrixType& matrix, - const Comm& comm, - const boost::property_tree::ptree& prm, - const std::function()>& weightsCalculator); - -template Dune::FlexibleSolver, BV<2>>::FlexibleSolver(const MatrixType& matrix, - const Comm& comm, - const boost::property_tree::ptree& prm, - const std::function()>& weightsCalculator); - -template Dune::FlexibleSolver, BV<3>>::FlexibleSolver(const MatrixType& matrix, - const Comm& comm, - const boost::property_tree::ptree& prm, - const std::function()>& weightsCalculator); - -template Dune::FlexibleSolver, BV<4>>::FlexibleSolver(const MatrixType& matrix, - const Comm& comm, - const boost::property_tree::ptree& prm, - const std::function()>& weightsCalculator); diff --git a/tests/test_flexiblesolver.cpp b/tests/test_flexiblesolver.cpp index a790ce9ea..615ffa9dd 100644 --- a/tests/test_flexiblesolver.cpp +++ b/tests/test_flexiblesolver.cpp @@ -29,6 +29,7 @@ BOOST_VERSION / 100 % 1000 > 48 #include +#include #include #include