Skip to content

Commit

Permalink
Add test case for maybeChopSubStep()
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonhagland committed Jan 21, 2025
1 parent 990c3f0 commit 6e50ec9
Show file tree
Hide file tree
Showing 12 changed files with 7,894 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_chopstep PRIVATE $<TARGET_OBJECTS:moduleVersion>)

include (${CMAKE_CURRENT_SOURCE_DIR}/modelTests.cmake)

Expand Down
13 changes: 12 additions & 1 deletion CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ list (APPEND TEST_DATA_FILES
tests/options_flexiblesolver.json
tests/options_flexiblesolver_simple.json
tests/GLIFT1.DATA
tests/RC-01_MAST_PRED.DATA
tests/include/flowl_b_vfp.ecl
tests/include/flowl_c_vfp.ecl
tests/include/permx_model5.grdecl
Expand All @@ -550,6 +551,13 @@ list (APPEND TEST_DATA_FILES
tests/include/summary.inc
tests/include/test1_20x30x10.grdecl
tests/include/well_vfp.ecl
tests/include/b1_vfp_flowline.inc
tests/include/d1_vfp_flowline.inc
tests/include/edit_nnc.inc
tests/include/flowline_e1_vfp.inc
tests/include/PVT-WET-GAS.INC
tests/include/scal_mod2.inc
tests/include/summary_rc.inc
tests/test10.partition
tests/parametersystem.ini
tests/data/co2injection.dgf
Expand Down Expand Up @@ -1172,7 +1180,7 @@ if(dune-alugrid_FOUND)
examples/fracture_discretefracture.cpp
)
endif()
if(USE_MPI)
if(MPI_FOUND)
list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow/ReservoirCoupling.cpp
opm/simulators/flow/ReservoirCouplingMaster.cpp
Expand All @@ -1185,6 +1193,9 @@ if(USE_MPI)
opm/simulators/flow/ReservoirCouplingSlave.hpp
opm/simulators/flow/ReservoirCouplingSpawnSlaves.hpp
)
list (APPEND TEST_SOURCE_FILES
tests/rescoup/test_chopstep.cpp
)
endif()
if(HYPRE_FOUND)
list(APPEND PUBLIC_HEADER_FILES
Expand Down
8 changes: 8 additions & 0 deletions opm/simulators/flow/ReservoirCouplingMaster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class ReservoirCouplingMaster {
this->master_slave_comm_.push_back(comm);
}
void addSlaveName(const std::string &name) { this->slave_names_.push_back(name); }
void addSlaveNextReportTimeOffset(double offset) {
this->slave_next_report_time_offsets_.push_back(offset);
}
void addSlaveStartDate(std::time_t date) { this->slave_start_dates_.push_back(date); }
double getActivationDate() const { return this->activation_date_; }
int getArgc() const { return this->argc_; }
Expand All @@ -64,6 +67,11 @@ class ReservoirCouplingMaster {
void resizeSlaveStartDates(int size) { this->slave_start_dates_.resize(size); }
void resizeNextReportDates(int size) { this->slave_next_report_time_offsets_.resize(size); }
void sendNextTimeStepToSlaves(double next_time_step);
// These are currently only used for unit testing
void setSlaveStartDate(int index, std::time_t date) { this->slave_start_dates_[index] = date; }
void setSlaveNextReportTimeOffset(int index, double offset) {
this->slave_next_report_time_offsets_[index] = offset;
}

private:
double getMasterActivationDate_() const;
Expand Down
Loading

0 comments on commit 6e50ec9

Please sign in to comment.