mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 16:54:47 -06:00
Merge pull request #2 from bska/master-refactor-for-cpgrid-support
Fix build in !HAVE_DUNE_CORNERPOINT case
This commit is contained in:
commit
91a4d59fcc
@ -46,7 +46,7 @@ include (${project}-prereqs)
|
||||
include (CMakeLists_files.cmake)
|
||||
|
||||
macro (config_hook)
|
||||
# opm_need_version_of ("dune-common")
|
||||
opm_need_version_of ("dune-common")
|
||||
endmacro (config_hook)
|
||||
|
||||
macro (prereqs_hook)
|
||||
@ -55,9 +55,8 @@ endmacro (prereqs_hook)
|
||||
macro (sources_hook)
|
||||
if(DUNE_CORNERPOINT_FOUND OR dune-cornerpoint_FOUND)
|
||||
list (APPEND examples_SOURCES
|
||||
examples/sim_fibo_ad_cp.cpp)
|
||||
list (APPEND PROGRAM_SOURCE_FILES
|
||||
examples/sim_fibo_ad_cp.cpp)
|
||||
${PROJECT_SOURCE_DIR}/examples/sim_fibo_ad_cp.cpp
|
||||
)
|
||||
endif()
|
||||
endmacro (sources_hook)
|
||||
|
||||
|
@ -211,6 +211,7 @@ try
|
||||
rock_comp->isActive() ? rock_comp.get() : 0,
|
||||
wells,
|
||||
linsolver,
|
||||
grav);
|
||||
SimulatorReport episodeReport = simulator.run(simtimer, state, well_state);
|
||||
|
||||
++simtimer;
|
||||
|
@ -23,14 +23,24 @@
|
||||
#include "config.h"
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
#else
|
||||
#include <dune/common/mpihelper.hh>
|
||||
#endif
|
||||
|
||||
#include <opm/core/pressure/FlowBCManager.hpp>
|
||||
|
||||
#include <opm/core/grid.h>
|
||||
//#include <opm/core/grid/GridManager.hpp>
|
||||
#include <opm/core/grid/cornerpoint_grid.h>
|
||||
|
||||
#include <opm/core/grid/GridManager.hpp>
|
||||
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
#include <dune/grid/common/GridAdapter.hpp>
|
||||
|
||||
#include <opm/core/wells.h>
|
||||
#include <opm/core/wells/WellsManager.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
@ -63,6 +73,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
@ -112,13 +123,17 @@ try
|
||||
|
||||
Opm::ParserPtr newParser(new Opm::Parser() );
|
||||
Opm::DeckConstPtr newParserDeck = newParser->parseFile( deck_filename );
|
||||
std::shared_ptr<EclipseGridParser> deck;
|
||||
deck.reset(new EclipseGridParser(deck_filename));
|
||||
std::shared_ptr<const EclipseGridParser> cdeck(deck);
|
||||
|
||||
// Grid init
|
||||
grid.reset(new Dune::CpGrid());
|
||||
grid->processEclipseFormat(*deck, 2e-12, false);
|
||||
{
|
||||
grdecl g = {};
|
||||
GridManager::createGrdecl(newParserDeck, g);
|
||||
|
||||
grid->processEclipseFormat(g, 2e-12, false);
|
||||
|
||||
std::free(const_cast<double*>(g.mapaxes));
|
||||
}
|
||||
|
||||
|
||||
Opm::EclipseWriter outputWriter(param, newParserDeck,
|
||||
|
@ -114,7 +114,7 @@ void extractInternalFaces(const UnstructuredGrid& grid,
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end namespace AutoDiffHelpers
|
||||
} // end namespace AutoDiffGrid
|
||||
|
||||
#ifdef HAVE_DUNE_CORNERPOINT
|
||||
// Interface functions using CpGrid
|
||||
@ -273,6 +273,6 @@ CellVolumeIterator endCellVolumes(const Dune::CpGrid& grid)
|
||||
{
|
||||
return CellVolumeIterator(grid, numCells(grid));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} // end namespace AutoDiffGrid
|
||||
#endif // HAVE_DUNE_CORNERPOINT
|
||||
} // end namespace Opm
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <opm/core/simulator/BlackoilState.hpp>
|
||||
#include <opm/core/simulator/WellState.hpp>
|
||||
#include <opm/core/utility/DataMap.hpp>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/core/utility/miscUtilities.hpp>
|
||||
|
||||
#include <opm/autodiff/GridHelpers.hpp>
|
||||
|
Loading…
Reference in New Issue
Block a user