Skip to content

Commit

Permalink
Fix Build in Reduced Environment
Browse files Browse the repository at this point in the history
In particular, include <config.h> to make the Dune Version macros do
the right thing.  Add some missing parameters, and relax requirement
that dune-pdelab is available.
  • Loading branch information
bska committed Dec 17, 2024
1 parent 69de69a commit c38827a
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 33 deletions.
38 changes: 20 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,17 @@ if(USE_TRACY_PROFILER AND Tracy_FOUND)
target_link_libraries(test_vem_assembly Tracy::TracyClient)
endif()

opm_add_test(testpdelab
ONLY_COMPILE
ALWAYS_ENABLE
DEPENDS opmsimulators opmupscaling
LIBRARIES opmsimulators opmupscaling
SOURCES
examples/testpdelab.cpp
$<TARGET_OBJECTS:moduleVersionGeoMech>
)

#opm_add_test(testpdelab
# ONLY_COMPILE
# ALWAYS_ENABLE
# DEPENDS opmsimulators opmupscaling
# LIBRARIES opmsimulators opmupscaling
# SOURCES
# examples/testpdelab.cpp
# $<TARGET_OBJECTS:moduleVersionGeoMech>
#)


opm_add_test(test_foamgrid
ONLY_COMPILE
Expand All @@ -304,15 +306,15 @@ opm_add_test(test_foamgrid
)


opm_add_test(test_fracture
ONLY_COMPILE
ALWAYS_ENABLE
DEPENDS opmsimulators opmupscaling
LIBRARIES opmsimulators opmupscaling
SOURCES
examples/test_fracture.cpp
$<TARGET_OBJECTS:moduleVersionGeoMech>
)
#opm_add_test(test_fracture
# ONLY_COMPILE
# ALWAYS_ENABLE
# DEPENDS opmsimulators opmupscaling
# LIBRARIES opmsimulators opmupscaling
# SOURCES
# examples/test_fracture.cpp
# $<TARGET_OBJECTS:moduleVersionGeoMech>
#)

opm_add_test(plot_reservoir_vtk
ONLY_COMPILE
Expand Down
2 changes: 2 additions & 0 deletions examples/coupled_standalone_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <config.h>

#include <iostream>
#include <fstream>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion examples/flow_energy_geomech_polygrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#include <opm/simulators/flow/GenericTracerModel_impl.hpp>
#include <opm/simulators/flow/Transmissibility_impl.hpp>
#include <opm/simulators/utils/GridDataOutput_impl.hpp>

#include "MechTypeTag.hpp"

Expand Down
2 changes: 2 additions & 0 deletions examples/paramtest.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <config.h>

#include "opm/geomech/param_interior.hpp"
#include "opm/geomech/GridStretcher.hpp"

Expand Down
2 changes: 2 additions & 0 deletions examples/single_fracture_sim.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <config.h>

#include <iostream>
#include <fstream>

Expand Down
2 changes: 2 additions & 0 deletions examples/standalone_sim_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <config.h>

#include <cstddef>
#include <dune/common/exceptions.hh>
#include <dune/istl/solvercategory.hh>
Expand Down
3 changes: 2 additions & 1 deletion examples/test_elasticity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,12 @@ int run(Params& p, const std::string& name)
}else{
esolver.setBodyForce(0.0);
}
const auto reduce_boundary = true;
bool do_matrix = true;//assemble matrix
bool do_vector = true;//assemble matrix
esolver.fixNodes(bc_nodes);
esolver.initForAssembly();
esolver.assemble(pressforce, do_matrix, do_vector);
esolver.assemble(pressforce, do_matrix, do_vector, reduce_boundary);
esolver.updateRhsWithGrad(pressforce);
Opm::PropertyTree prm("mechsolver.json");
esolver.setupSolver(prm);
Expand Down
12 changes: 6 additions & 6 deletions examples/test_gridstretch.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#include <config.h>

#include "opm/geomech/GridStretcher.hpp"

#include <dune/grid/io/file/gmshreader.hh>
#include <dune/foamgrid/foamgrid.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh>

#include <vector>
#include <string>
#include <iostream>
#include <iterator>

#include "opm/geomech/param_interior.hpp"
#include "opm/geomech/GridStretcher.hpp"

Expand All @@ -21,7 +18,10 @@

#include <dune/grid/io/file/vtk/vtkwriter.hh>


#include <iostream>
#include <iterator>
#include <string>
#include <vector>

using namespace std;
using namespace Opm;
Expand Down
14 changes: 11 additions & 3 deletions examples/test_parallelgrid_grdecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

# define DISABLE_ALUGRID_SFC_ORDERING 1

#include <opm/common/utility/platform_dependent/disable_warnings.h>

#include <dune/common/exceptions.hh> // We use exceptions
#include <dune/common/version.hh>

#include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh>
//#include <dune/grid/io/file/vtk/subsampleingvtkwriter.hh>
Expand All @@ -30,19 +33,25 @@

#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>

#include <opm/grid/polyhedralgrid.hh>

#include <opm/input/eclipse/Deck/Deck.hpp>
#include <opm/input/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/EclipseState/SimulationConfig/BCConfig.hpp>

#include <opm/common/utility/platform_dependent/reenable_warnings.h>

#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>

#if HAVE_ALUGRID
#include <dune/alugrid/grid.hh>
#include <dune/alugrid/common/fromtogridfactory.hh>
#endif

#include <opm/grid/utility/StopWatch.hpp>
#include <opm/common/utility/parameters/ParameterGroup.hpp>

Expand All @@ -52,13 +61,12 @@
#include <opm/elasticity/matrixops.hpp>
#include <dune/grid/utility/globalindexset.hh>

#include "vectorfunctions.hh"
#include <cstring>
#include <iostream>
#include "vectorfunctions.hh"
#include <unistd.h>
#include <opm/geomech/boundaryutils.hh>
#include <unistd.h>

#include <opm/geomech/boundaryutils.hh>
#include <opm/geomech/dune_utilities.hpp>
#include <opm/geomech/DuneCommunicationHelpers.hpp>

Expand Down
4 changes: 3 additions & 1 deletion examples/test_vem_assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,16 @@ int main(int argc, char** argv)
const int num_neumann_faces = 0;

// assemble the mechanical system
const auto reduce_boundary = true;

vector<tuple<int, int, double>> A_entries;
vector<double> b;
const int numdof =
vem::assemble_mech_system_3D(&coords[0], num_cells, &num_cell_faces[0], &num_face_corners[0],
&face_corners[0], &young[0], &poisson[0], &body_force[0],
num_fixed_dofs, &fixed_dof_ixs[0], &fixed_dof_values[0],
num_neumann_faces, nullptr, nullptr,
A_entries, b);
A_entries, b, reduce_boundary);

// view matrix

Expand Down
2 changes: 1 addition & 1 deletion opm-flowgeomechanics-prereqs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set (opm-flowgeomechanics_DEPS
# DUNE prerequisites
"dune-common REQUIRED"
"dune-istl REQUIRED"
"dune-pdelab REQUIRED"
"dune-pdelab"
"dune-foamgrid REQUIRED"
# matrix library
"BLAS REQUIRED"
Expand Down
4 changes: 2 additions & 2 deletions opm/geomech/eclproblemgeomech.hh
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ namespace Opm{
// alwas rebuild wells
sim_update.well_structure_changed = true;
this->actionHandler_.applySimulatorUpdate(reportStep,
sim_update,
sim_update,
updateTrans,
commit_wellstate);
commit_wellstate);
if (commit_wellstate) {
this->wellModel().commitWGState();
}
Expand Down

0 comments on commit c38827a

Please sign in to comment.