Loading...
Searching...
No Matches
ConvergenceOutputConfiguration.hpp
/*
Copyright 2022 Equinor ASA.
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 <http://www.gnu.org/licenses/>.
*/
#ifndef CONVERGENCE_OUTPUT_CONFIGURATION_HPP
#define CONVERGENCE_OUTPUT_CONFIGURATION_HPP
#include <cstddef>
#include <string_view>
namespace Opm {
class ConvergenceOutputConfiguration
{
public:
enum class Option : unsigned char {
None = 0,
Steps = 1 << 1,
Iterations = 1 << 2,
};
explicit ConvergenceOutputConfiguration(std::string_view options,
std::string_view optionName = "");
bool any() const
{
return this->flag_ != std::byte{0};
}
bool want(const Option opt) const
{
return std::to_integer<int>(this->flag_ & static_cast<std::byte>(opt)) != 0;
}
private:
std::byte flag_{0};
};
} // namespace Opm
#endif // CONVERGENCE_OUTPUT_CONFIGURATION_HPP
Opm::ConvergenceOutputConfiguration::Option
Option
Option values.
Definition ConvergenceOutputConfiguration.hpp:53
Opm::ConvergenceOutputConfiguration::any
bool any() const
Whether or not user wants any additional convergence output at all.
Definition ConvergenceOutputConfiguration.hpp:73
Opm::ConvergenceOutputConfiguration::want
bool want(const Option opt) const
Whether or not user wants specific convergence output.
Definition ConvergenceOutputConfiguration.hpp:81
Opm::ConvergenceOutputConfiguration::ConvergenceOutputConfiguration
ConvergenceOutputConfiguration(std::string_view options, std::string_view optionName="")
Constructor.
Definition ConvergenceOutputConfiguration.cpp:112
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43