Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
d96ebb9
Adding leak features into the model
May 16, 2019
695ca64
preliminary code: version 1
May 30, 2019
4e64f1c
refactoried node, link, mesh
Jun 3, 2019
63f3ce5
refactorized node, pipe, mesh
Jun 3, 2019
d53fe12
add main
Jun 3, 2019
811ba84
clean cmake-list
Jun 3, 2019
0bba04e
Refactoring
Jun 3, 2019
3934eaf
Finished refactoring
Jun 13, 2019
90477fa
Finished refactoring
Jun 13, 2019
a5e6941
Finished refactoring
Jun 13, 2019
a396346
Bug fixed and CG solver added
Jul 2, 2019
abf0857
Bug fixed and CG solver added
Jul 2, 2019
27ec90a
Pardiso Added
Jul 18, 2019
75dfa2f
Pardiso Modified
Jul 18, 2019
02be98c
Curves class added
Jul 23, 2019
66e8e98
Refactored for curve class
Jul 23, 2019
4940727
Namespace for settings
Jul 23, 2019
7672931
Pump for input
Aug 4, 2019
7d18567
Pump part for matrix assembler
Aug 6, 2019
0c408e2
Valves for .inp input and mesh
Aug 12, 2019
b35f1de
Made link status as a link attribute
Aug 13, 2019
c470222
Valves added
Aug 14, 2019
1f22b40
Methods to get isolated links and nodes
Aug 16, 2019
de784f5
PDD fixed
Aug 20, 2019
2ac47ca
Synthetic net generator added, code cleaned
Aug 24, 2019
a35f68c
Bug fixed
Aug 27, 2019
84332e6
Line search and MKL solver added
Sep 6, 2019
6b1061e
Code cleaned
Sep 12, 2019
6b659a7
Code cleaned
Sep 18, 2019
23fcf49
Remove Pardiso 6 Requirement from Cmake file
Sep 26, 2019
8223253
:fire: Remove benchmarks :hammer: Fix CMake
kks32 Sep 26, 2019
59fde9c
:dart: Add source of Intel MKL
kks32 Sep 26, 2019
b8d6a31
:dart: :hammer: Add source of Intel MKL
kks32 Sep 26, 2019
4197697
:hammer: Initialize variables in curves
kks32 Sep 26, 2019
0944804
:hammer: Initialize variables in curves
kks32 Sep 26, 2019
c0d5d30
:hammer: Ignore benchmarks files
kks32 Sep 26, 2019
e435361
:art: Fix formatting
kks32 Sep 26, 2019
c2c567b
:art: Add files of benchmarks
kks32 Sep 26, 2019
4b4a999
:dart: Add Test to build
kks32 Sep 26, 2019
f3953ef
:bug: Auto set number of omp threads
Sep 26, 2019
5baadeb
:bug: Set omp threads to 2
Sep 26, 2019
b544b63
:art: Fix formatting issues
kks32 Sep 26, 2019
ae5bb16
:art: Clang-format
kks32 Sep 26, 2019
f64f15f
cuda added
rewu1993 Oct 8, 2019
c9a69a5
:rocket: cuda added
rewu1993 Oct 8, 2019
2ed23f2
:art: change cmake format
Oct 15, 2019
4f64c9f
:art: fix formatting
rewu1993 Oct 16, 2019
78365d5
:construction: interface added
rewu1993 Jan 8, 2020
bca6085
Merge pull request #24 from rewu1993/refactoring
kks32 Jan 8, 2020
0c2dc96
:art: better code structure
rewu1993 Jan 9, 2020
4cf6ab4
:dart: testing
rewu1993 Jan 9, 2020
7c12730
Update pardiso_unsym.cc
rewu1993 Jan 9, 2020
fcf8351
:bug: delete extra term
rewu1993 Jan 9, 2020
eec9bb7
:dart::art: clang format
rewu1993 Jan 9, 2020
1a6a866
:bug: codecov
rewu1993 Jan 9, 2020
0b7305d
Merge pull request #25 from rewu1993/clean
kks32 Jan 10, 2020
7f94c24
Merge pull request #1 from rewu1993/clean
rewu1993 Mar 14, 2020
ad591b8
:art::sparkles: tclap for main function input, minor format issue fixed
Apr 29, 2020
82aa3e8
:bug: pdd bug fixed
May 1, 2020
8dc7a79
:art::speaker: format change, error messages added
May 2, 2020
53c8698
:hammer: decouple topology (nodes/links) with functionality (junction…
Jun 5, 2020
3c5bf8d
:hammer: decouple topology (nodes/links) with functionality (junction…
Jun 5, 2020
1bc99f8
:hammer: use index manager for id management inside mesh, decouple no…
Jun 6, 2020
db8bde7
:hammer: move graph operations from matrix assembler to mesh
Jun 9, 2020
b9206c1
:hammer: decouple variables from the matrix assembler
Jun 10, 2020
b40b70c
:hammer: decouple residuals from the matrix assembler
Jun 11, 2020
b9b2fc6
:hammer: matrix assembler refactored
Jun 13, 2020
dd88095
:hammer: simplify solver design, add Eigen LU solver for small linear…
Jun 15, 2020
11afd84
:hammer: linear system solver simplification, hydraulic solver refact…
Jun 16, 2020
341e669
:hammer: input class with leak junctions
Jun 16, 2020
338aa37
:hammer: update mesh properties using simulation result, write mesh r…
Jun 17, 2020
e575d1a
:hammer: move save from the mesh class to IO class
Jun 17, 2020
e838a01
:hammer: refactoring finished
Jun 18, 2020
4448b44
:bug: fixed bug on creating .inp output
Jun 18, 2020
a8315d2
:bug: virtual destructor for the base solver
Jun 19, 2020
a17f801
:bug: virtual destructor for the base solver
Jun 19, 2020
76964da
:bug: const_cast for matrix pointers
Jun 19, 2020
0d498e5
:bug: const_cast for matrix pointers
Jun 19, 2020
80e3bc7
:construction::sparkles: adding isolation valves into io class, class…
Jun 25, 2020
de12244
:construction::sparkles: add isolated segment finding algorithm
Jun 26, 2020
f8c8cd6
:construction::sparkles: find all segments from the network
Jun 27, 2020
1513ebe
:construction::hammer: improve the isolated segments finding algorithm
Jul 1, 2020
d2dd379
:construction: merge isolations & find isolation components
Jul 2, 2020
f16545a
:construction: merge isolations & find isolation components
Jul 3, 2020
b52595d
:construction::bug: segment index consistency through segment merging
Jul 4, 2020
0dd18cd
:construction::bulb: write out leak discharges
Aug 10, 2020
b87b2f2
:green_heart: clang format
Aug 10, 2020
b221d34
:construction::bug: remove spectra
Aug 10, 2020
e40c0b8
:construction::bug: remove spectra
Aug 10, 2020
b779136
Merge pull request #27 from rewu1993/refactoring
rewu1993 Sep 4, 2020
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
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
- run:
name: GCC-8 build
command: |
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux
mkdir -p build
[ "$(ls -A build)" ] && rm -rf build/*
cd build
Expand All @@ -20,6 +21,7 @@ jobs:
- run:
name: Clang-6.0 build
command: |
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux
mkdir -p build
[ "$(ls -A build)" ] && rm -rf build/*
cd build
Expand All @@ -32,10 +34,16 @@ jobs:
command: |
cppcheck --version
cppcheck --enable=warning --inconclusive --force --language=c++ --std=c++11 src/*.cc include/*.h include/*.tcc --error-exitcode=1
# clang-format
- run:
name: clang-format
command: |
python3 ./clang-tools/run-clang-format.py -r include/* src/* tests/*
# codecoverage
- run:
name: codecov.io
command: |
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux
mkdir -p build
[ "$(ls -A build)" ] && rm -rf build/*
cd build
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ configure.scan
*install-sh
*missing
*stamp-h1
benchmarks/
158 changes: 98 additions & 60 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(pipe_network LANGUAGES CXX)

# Require C++14-compliant compiler; only available for CMake v. 3.1 and up
set(CMAKE_CXX_STANDARD 14)
# Require C++17-compliant compiler; only available for CMake v. 3.1 and up
set(CMAKE_CXX_STANDARD 17)

cmake_minimum_required(VERSION 3.1)

Expand All @@ -11,7 +11,7 @@ SET(CMAKE_VERBOSE_MAKEFILE OFF)
# General compile settings
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Debug")
#SET(CMAKE_BUILD_TYPE "Release")
# SET(CMAKE_BUILD_TYPE "Release")
ENDIF (NOT CMAKE_BUILD_TYPE)

# GNU Specific settings
Expand All @@ -24,72 +24,110 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -pthread")
endif()

# CMake seems to have no way to enable/disable testing per subproject,
# so we provide an option similar to BUILD_TESTING, but just for CITYSCAPE.
option(PIPE_NETWORK_TEST_BUILD_TESTING "enable testing for cityscape" ON)

# CMake Modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

# Boost Archive
#find_package(Boost REQUIRED COMPONENTS system serialization)
#include_directories(${BOOST_INCLUDE_DIRS})
#link_libraries(${Boost_SERIALIZATION_LIBRARY} ${Boost_SYSTEM_LIBRARY})

# pipe_network executable
SET(pipe_network_src
src/index_manager.cc
src/mesh_components.cc
src/mesh.cc
src/matrix_assembler_components.cc
src/matrix_assembler.cc
src/curves.cc
src/mkl_unsym.cc
src/LU_solver.cc
src/hydralic_sim.cc
src/io.cc
src/io_utils.cc
src/valve_graph.cc
src/valve_graph_components.cc
)

# Find dependencies for the library
# Eigen
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})


# Pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Include directories
include_directories(
${pipe_network_SOURCE_DIR}/include/
${pipe_network_SOURCE_DIR}/external/
)
find_package (Threads)

# OpenMP
find_package(OpenMP)
if (OPENMP_FOUND)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()

# pipe_network executable
SET(pipe_network_src
src/main.cc
src/eigen_gmres.cc
src/matrix_assembler.cc
src/mesh.cc
src/pipe.cc
src/node.cc
src/io.cc
)
add_executable(pipe_network
${pipe_network_src}
)

target_link_libraries(pipe_network Threads::Threads)

# Unit test
SET(test_src
src/eigen_gmres.cc
src/matrix_assembler.cc
src/mesh.cc
src/pipe.cc
src/io.cc
src/node.cc
tests/eigen_gmres_test.cc
# tests/matrix_assembler_test.cc
tests/matrix_assembler_test_full.cc
tests/mesh_test.cc
tests/node_test.cc
tests/pipe_test.cc
tests/io_test.cc
tests/todini_example_test.cc
tests/test.cc
)
add_executable(pipe_network_test
${test_src}
)

target_link_libraries(pipe_network_test Threads::Threads)

add_test(NAME pipe_network_test COMMAND $<TARGET_FILE:pipe_network_test>)
enable_testing()
# MKL
find_package(MKL REQUIRED)

# BLAS Math Libraries
find_package(BLAS REQUIRED)

# LAPACK
find_package(LAPACK REQUIRED)


add_library(lpipe_network SHARED ${pipe_network_src})
# include directories
target_include_directories(lpipe_network
PUBLIC
${pipe_network_SOURCE_DIR}/include/
${pipe_network_SOURCE_DIR}/external/
${EIGEN3_INCLUDE_DIR}
${MKL_INCLUDE_DIR}
${BOOST_INCLUDE_DIRS}

)

# link libs
target_link_libraries(lpipe_network
PUBLIC
${CMAKE_THREAD_LIBS_INIT}
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
${Boost_LIBRARIES}
${MKL_LIBRARIES}
)

add_executable(pipe_network ${pipe_network_SOURCE_DIR}/src/main.cc)
target_link_libraries(pipe_network
PUBLIC
lpipe_network)

# Testing
if(PIPE_NETWORK_TEST_BUILD_TESTING)
# Unit test
SET(pipe_network_test_src
tests/node_test.cc
tests/link_test.cc
tests/mesh_test.cc
tests/matrix_assembler_test.cc
tests/solver_test.cc
tests/hydraulic_sim_test.cc
tests/input_test.cc
tests/curve_test.cc
tests/valve_graph_test.cc
)

add_executable(pipe_network_test tests/main_test.cc ${pipe_network_test_src})
target_link_libraries(pipe_network_test lpipe_network)
add_test(NAME pipe_network_test COMMAND $<TARGET_FILE:pipe_network_test>)
enable_testing()
endif()

# Coverage
find_package(codecov)
add_coverage(pipe_network)
add_coverage(pipe_network_test)
if(ENABLE_COVERAGE)
add_executable(pipe_network_test_coverage tests/main_test.cc ${pipe_network_src} ${pipe_network_test_src})
target_link_libraries(pipe_network_test_coverage lpipe_network)
add_coverage(pipe_network_test_coverage)
endif()
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
### Prerequisite packages
> The following prerequisite packages can be found in the docker image:

* [Boost](http://www.boost.org/)
* [Eigen](http://eigen.tuxfamily.org/)
* [Intel MKL](https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library.html)

## Compile and Run
> See https://pipe-network-doc.cb-cities.com/ for more detailed instructions.
Expand All @@ -31,3 +31,21 @@
### Run tests

0. Run `./pipe-network-test -s` (for a verbose output) or `ctest -VV`.

### Run hydraulic simulation
Run ./pipe-network with the following flags

-f <filename>, --file <filename>
.inp file path for the WDN system

-t <save path>, --to <save path>
folder to save the simulation results

-d, --debug
debug mode: output intermediate results (residuals)

-n <meshname>, --name <meshname>
Name for the WDN

-h, --help
Displays usage information and exits.
33 changes: 0 additions & 33 deletions benchmarks/Honai_network_nodes.csv

This file was deleted.

35 changes: 0 additions & 35 deletions benchmarks/Honai_network_pipes.csv

This file was deleted.

Loading