Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/spsa #117

Merged
merged 5 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FieldOpt/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.nvimrc
*.clang_complete
/compile_commands.json
11 changes: 4 additions & 7 deletions FieldOpt/ConstraintMath/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 2.8)
project(constraintmath)

include(Sources.cmake)

include_directories(${CMAKE_BINARY_DIR}/libraries/include/)

add_library(constraintmath STATIC
well_constraint_projections/well_constraint_projections.cpp
)
add_library(constraintmath STATIC ${CONSTRAINTMATH_HEADERS} ${CONSTRAINTMATH_SOURCES})
add_library(fieldopt::constraintmath ALIAS ${PROJECT_NAME})

include_directories(${EIGEN3_INCLUDE_DIR})
Expand All @@ -23,10 +23,7 @@ add_compile_options(-std=c++11)
if (BUILD_TESTING)
# Unit tests
include_directories(${EIGEN3_INCLUDE_DIR})
add_executable(test_constraintmath
tests/well_constraint_projections_tests.cpp
tests/test_domain_boundary.cpp
)
add_executable(test_constraintmath ${CONSTRAINTMATH_TESTS})
target_link_libraries(test_constraintmath
fieldopt::constraintmath
${gtest}
Expand Down
13 changes: 13 additions & 0 deletions FieldOpt/ConstraintMath/Sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SET(CONSTRAINTMATH_HEADERS
well_constraint_projections/well_constraint_projections.h
)

SET(CONSTRAINTMATH_SOURCES
well_constraint_projections/well_constraint_projections.cpp
)

SET(CONSTRAINTMATH_TESTS
tests/test_domain_boundary.cpp
tests/well_constraint_projections_tests.cpp
)

12 changes: 4 additions & 8 deletions FieldOpt/ERTWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
cmake_minimum_required(VERSION 2.8)
project(ertwrapper)

include(Sources.cmake)

add_library(ertwrapper STATIC
ertwrapper_exceptions.h
eclgridreader.cpp
eclsummaryreader.cpp)

add_library(ertwrapper STATIC ${ERTWRAPPER_HEADERS} ${ERTWRAPPER_SOURCES})
add_library(fieldopt::ertwrapper ALIAS ${PROJECT_NAME})

include_directories(
Expand All @@ -31,10 +30,7 @@ endif()

# Unit tests
if (BUILD_TESTING)
add_executable(test_ertwrapper
tests/test_eclgridreader.cpp
tests/test_eclsummaryreader.cpp
)
add_executable(test_ertwrapper ${ERTWRAPPER_TESTS})
target_link_libraries(test_ertwrapper
fieldopt::ertwrapper
${gtest}
Expand Down
16 changes: 16 additions & 0 deletions FieldOpt/ERTWrapper/Sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SET(ERTWRAPPER_HEADERS
eclgridreader.h
eclsummaryreader.h
ertwrapper_exceptions.h
)

SET(ERTWRAPPER_SOURCES
eclgridreader.cpp
eclsummaryreader.cpp
)

SET(ERTWRAPPER_TESTS
tests/test_eclgridreader.cpp
tests/test_eclsummaryreader.cpp
)

9 changes: 4 additions & 5 deletions FieldOpt/Hdf5SummaryReader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required( VERSION 2.8 )
project(hdf5summaryreader)

include(Sources.cmake)

find_package(HDF5 REQUIRED COMPONENTS CXX)
add_definitions(${HDF5_DEFINITIONS})
include_directories(${HDF5_INCLUDE_DIRS})

add_library(hdf5summaryreader STATIC
hdf5_summary_reader.cpp)

add_library(hdf5summaryreader STATIC ${HDF5SUMMARYREADER_HEADERS} ${HDF5SUMMARYREADER_SOURCES})
add_library(fieldopt::hdf5summaryreader ALIAS ${PROJECT_NAME})

target_link_libraries(hdf5summaryreader
Expand All @@ -18,8 +18,7 @@ add_compile_options(-std=c++11)
if (BUILD_TESTING)
# Unit tests
include_directories(${HDF5_INCLUDE_DIRS})
add_executable(test_hdf5summaryreader
tests/test_hdf5_summary_reader.cpp)
add_executable(test_hdf5summaryreader ${HDF5SUMMARYREADER_TESTS})

target_link_libraries(test_hdf5summaryreader
fieldopt::hdf5summaryreader
Expand Down
12 changes: 12 additions & 0 deletions FieldOpt/Hdf5SummaryReader/Sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SET(HDF5SUMMARYREADER_HEADERS
hdf5_summary_reader.h
)

SET(HDF5SUMMARYREADER_SOURCES
hdf5_summary_reader.cpp
)

SET(HDF5SUMMARYREADER_TESTS
tests/test_hdf5_summary_reader.cpp
)

48 changes: 4 additions & 44 deletions FieldOpt/Model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(model)

add_library(model STATIC
cpp-spline/src/Vector.cpp
cpp-spline/src/Curve.cpp
cpp-spline/src/Bezier.cpp
cpp-spline/src/CatmullRom.cpp
cpp-spline/src/BSpline.cpp
model.cpp
wells/well.cpp
wells/well_exceptions.h
wells/wellbore/completions/completion.cpp
wells/wellbore/completions/perforation.cpp
wells/wellbore/trajectory.cpp
wells/wellbore/wellspline.cpp
wells/control.cpp
wells/wellbore/wellblock.cpp
properties/property.h
properties/property_exceptions.h
properties/binary_property.cpp
properties/variable_property_container.cpp
properties/continous_property.cpp
properties/discrete_property.cpp
properties/property.cpp
model_synchronization_object.cpp
wells/wellbore/pseudo_cont_vert.cpp
wells/wellbore/completions/segmented_completion.cpp
wells/wellbore/completions/packer.cpp
wells/wellbore/completions/icd.cpp
wells/compartment.cpp
wells/segment.cpp
)
include(Sources.cmake)

add_library(model STATIC ${MODEL_HEADERS} ${MODEL_SOURCES})
add_library(fieldopt::model ALIAS ${PROJECT_NAME})

target_link_libraries (model
Expand All @@ -52,20 +25,7 @@ add_compile_options(-std=c++11)

if (BUILD_TESTING)
# Unit tests
add_executable(test_model
tests/test_model.cpp
tests/variables/test_properties.cpp
tests/variables/test_variable_property_container.cpp
tests/wells/test_control.cpp
tests/wells/test_perforation.cpp
tests/wells/test_trajectory.cpp
tests/wells/test_well.cpp
tests/wells/test_wellblock.cpp
tests/test_resource_variable_property_container.h
tests/test_resource_model.h
tests/wells/test_pseudo_cont_vert.cpp
tests/wells/test_block_to_spline_conversion.cpp
tests/wells/test_segmented_well.cpp tests/wells/test_trajectory_curve.cpp)
add_executable(test_model ${MODEL_TESTS})
target_link_libraries(test_model
fieldopt::model
fieldopt::reservoir
Expand Down
77 changes: 77 additions & 0 deletions FieldOpt/Model/Sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
SET(MODEL_HEADERS
cpp-spline/src/BSpline.h
cpp-spline/src/Bezier.h
cpp-spline/src/CatmullRom.h
cpp-spline/src/Curve.h
cpp-spline/src/Vector.h
model.h
model_synchronization_object.h
properties/binary_property.h
properties/continous_property.h
properties/discrete_property.h
properties/property.h
properties/property_exceptions.h
properties/variable_property_container.h
wells/compartment.h
wells/control.h
wells/segment.h
wells/well.h
wells/well_exceptions.h
wells/wellbore/completions/completion.h
wells/wellbore/completions/icd.h
wells/wellbore/completions/packer.h
wells/wellbore/completions/perforation.h
wells/wellbore/completions/segmented_completion.h
wells/wellbore/pseudo_cont_vert.h
wells/wellbore/trajectory.h
wells/wellbore/wellblock.h
wells/wellbore/wellspline.h
)

SET(MODEL_SOURCES
cpp-spline/src/BSpline.cpp
cpp-spline/src/Bezier.cpp
cpp-spline/src/CatmullRom.cpp
cpp-spline/src/Curve.cpp
cpp-spline/src/Vector.cpp
model.cpp
model_synchronization_object.cpp
properties/binary_property.cpp
properties/continous_property.cpp
properties/discrete_property.cpp
properties/property.cpp
properties/variable_property_container.cpp
wells/compartment.cpp
wells/control.cpp
wells/segment.cpp
wells/well.cpp
wells/wellbore/completions/completion.cpp
wells/wellbore/completions/icd.cpp
wells/wellbore/completions/packer.cpp
wells/wellbore/completions/perforation.cpp
wells/wellbore/completions/segmented_completion.cpp
wells/wellbore/pseudo_cont_vert.cpp
wells/wellbore/trajectory.cpp
wells/wellbore/wellblock.cpp
wells/wellbore/wellspline.cpp
)

SET(MODEL_TESTS
tests/test_resource_model.h
tests/test_resource_model_setting_snippets.hpp
tests/test_resource_variable_property_container.h
tests/test_model.cpp
tests/variables/test_properties.cpp
tests/variables/test_variable_property_container.cpp
tests/wells/test_block_to_spline_conversion.cpp
tests/wells/test_control.cpp
tests/wells/test_perforation.cpp
tests/wells/test_pseudo_cont_vert.cpp
tests/wells/test_segmented_well.cpp
tests/wells/test_trajectory.cpp
tests/wells/test_trajectory_curve.cpp
tests/wells/test_well.cpp
tests/wells/test_wellblock.cpp
)


61 changes: 4 additions & 57 deletions FieldOpt/Optimization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(optimization)

add_library(optimization STATIC
optimization_exceptions.h
objective/objective.cpp
objective/weightedsum.cpp
case.cpp
case_handler.cpp
constraints/constraint.cpp
constraints/bhp_constraint.cpp
constraints/constraint_handler.cpp
constraints/reservoir_boundary.cpp
optimizer.cpp
constraints/well_spline_length.cpp
constraints/interwell_distance.cpp
constraints/well_spline_constraint.cpp
constraints/combined_spline_length_interwell_distance.cpp
constraints/rate_constraint.cpp
constraints/combined_spline_length_interwell_distance_reservoir_boundary.cpp
case_transfer_object.cpp
optimizers/ExhaustiveSearch2DVert.cpp
optimizers/GSS.cpp
optimizers/compass_search.cpp
optimizers/APPS.cpp
optimizers/GeneticAlgorithm.cpp
optimizers/RGARDD.cpp
normalizer.cpp
optimizers/bayesian_optimization/AcquisitionFunction.cpp
optimizers/bayesian_optimization/af_optimizers/AFPSO.cpp
optimizers/bayesian_optimization/af_optimizers/AFOptimizer.cpp
optimizers/bayesian_optimization/EGO.cpp
optimizers/bayesian_optimization/af_optimizers/AFCompassSearch.cpp
constraints/pseudo_cont_boundary_2d.cpp
constraints/icv_constraint.cpp
constraints/packer_constraint.cpp
hybrid_optimizer.cpp
objective/NPV.cpp
optimizers/PSO.cpp optimizers/VFSA.cpp optimizers/VFSA.h)
include(Sources.cmake)

add_library(optimization STATIC ${OPTIMIZATION_HEADERS} ${OPTIMIZATION_SOURCES})
add_library(fieldopt::optimization ALIAS ${PROJECT_NAME})

target_link_libraries(optimization
Expand All @@ -58,27 +25,7 @@ add_compile_options(-std=c++11)

if (BUILD_TESTING)
# Unit tests
add_executable(test_optimization
tests/test_case.cpp
tests/test_case_handler.cpp
tests/constraints/test_bhp_constraint.cpp
tests/constraints/test_constraint_handler.cpp
tests/constraints/test_reservoir_boundary.cpp
tests/objective/test_weightedsum.cpp
tests/optimizers/test_compass_search.cpp
tests/test_resource_cases.h
tests/test_resource_optimizer.h
tests/constraints/test_rate_constraint.cpp
tests/test_case_transfer_object.cpp
tests/optimizers/test_apps.cpp
tests/optimizers/test_ga.cpp
tests/test_normalizer.cpp
tests/constraints/test_interwell_distance.cpp
tests/constraints/test_spline_well_length.cpp
tests/optimizers/test_ego.cpp
tests/constraints/test_pseudo_cont_boundary_2d.cpp
tests/optimizers/test_pso.cpp tests/optimizers/test_vfsa.cpp)

add_executable(test_optimization ${OPTIMIZATION_TESTS})

target_link_libraries(test_optimization
fieldopt::optimization
Expand Down
Loading