mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-29 10:40:59 -06:00
dfdfbbd7d7
If no cell has a valid corner-point geometry, typically caused by using GDFILE to read non-finite data such as all ZCORN = -1.0E+20, then we must not attempt to generate a grid structure. If we do, we will typically just fail somewhere deep down in the corner-point processing code and generate a diagnostic message that's hard to decipher. With this commit we instead output a diagnostic message of the form Failed to create valid EclipseState object. Exception caught: No active cell in input grid has valid/finite cell geometry Please check geometry keywords, especially if grid is imported through GDFILE This may not be a lot better than the original diagnostic Processing grid flow: ${ROOT}/opm-grid/opm/grid/cpgpreprocess/preprocess.c:768: is_lefthanded: Assertion `! searching' failed. Aborted (core dumped) but does at least suggest that the grid data may be faulty.
95 lines
3.1 KiB
C++
95 lines
3.1 KiB
C++
/*
|
|
Copyright 2013, 2014, 2015 SINTEF ICT, Applied Mathematics.
|
|
Copyright 2014 Dr. Blatt - HPC-Simulation-Software & Services
|
|
Copyright 2015 IRIS AS
|
|
Copyright 2014 STATOIL 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 OPM_READDECK_HEADER_INCLUDED
|
|
#define OPM_READDECK_HEADER_INCLUDED
|
|
|
|
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
|
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace Opm {
|
|
class Deck;
|
|
class EclipseState;
|
|
class ErrorGuard;
|
|
class ParseContext;
|
|
class Python;
|
|
class Schedule;
|
|
class SummaryConfig;
|
|
class UDQState;
|
|
class WellTestState;
|
|
} // end namespace Opm
|
|
|
|
namespace Opm {
|
|
|
|
namespace Action {
|
|
class State;
|
|
}
|
|
|
|
enum class FileOutputMode {
|
|
//! \brief No file output.
|
|
OUTPUT_NONE = 0,
|
|
|
|
//! \brief Output only to log files, no ECLIPSE output.
|
|
OUTPUT_LOG_ONLY = 1,
|
|
|
|
//! \brief Output to all files.
|
|
OUTPUT_ALL = 3,
|
|
};
|
|
|
|
// Setup the OpmLog backends
|
|
FileOutputMode
|
|
setupLogging(int mpi_rank_,
|
|
const std::string& deck_filename,
|
|
const std::string& cmdline_output_dir,
|
|
const std::string& cmdline_output,
|
|
bool output_cout_,
|
|
const std::string& stdout_log_id,
|
|
const bool allRanksDbgLog);
|
|
|
|
/// \brief Reads the deck and creates all necessary objects if needed
|
|
///
|
|
/// If pointers already contains objects then they are used otherwise they
|
|
/// are created and can be used outside later.
|
|
void readDeck(Parallel::Communication comm,
|
|
const std::string& deckFilename,
|
|
std::shared_ptr<Deck>& deck,
|
|
std::shared_ptr<EclipseState>& eclipseState,
|
|
std::shared_ptr<Schedule>& schedule,
|
|
std::unique_ptr<UDQState>& udqState,
|
|
std::unique_ptr<Action::State>& actionState,
|
|
std::unique_ptr<WellTestState>& wtestState,
|
|
std::shared_ptr<SummaryConfig>& summaryConfig,
|
|
std::unique_ptr<ErrorGuard> errorGuard,
|
|
std::shared_ptr<Python> python,
|
|
std::unique_ptr<ParseContext> parseContext,
|
|
bool initFromRestart,
|
|
bool checkDeck,
|
|
const std::optional<int>& outputInterval);
|
|
|
|
void verifyValidCellGeometry(Parallel::Communication comm,
|
|
const EclipseState& eclipseState);
|
|
} // end namespace Opm
|
|
|
|
#endif // OPM_READDECK_HEADER_INCLUDED
|