diff --git a/.cmake-format.yaml b/.cmake-format.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d11c25002bb06b3db16ca63853faa096aac70c91 --- /dev/null +++ b/.cmake-format.yaml @@ -0,0 +1,76 @@ +parse: + additional_commands: + foo: + flags: + - BAR + - BAZ + kwargs: + HEADERS: '*' + SOURCES: '*' + DEPENDS: '*' + override_spec: {} + _help_vartags: + vartags: [] + proptags: [] + +format: + disable: false + line_width: 120 + tab_size: 4 + use_tabchars: false + fractional_tab_policy: use-space + max_subgroups_hwrap: 2 + max_pargs_hwrap: 6 + max_rows_cmdline: 2 + separate_ctrl_name_with_space: false + separate_fn_name_with_space: false + dangle_parens: false + dangle_align: prefix + min_prefix_chars: 4 + max_prefix_chars: 10 + max_lines_hwrap: 2 + line_ending: unix + command_case: canonical + keyword_case: unchanged + always_wrap: [] + enable_sort: true + autosort: false + require_valid_layout: false + layout_passes: {} + +markup: + bullet_char: '*' + enum_char: . + first_comment_is_literal: false + literal_comment_pattern: null + fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$ + ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$ + explicit_trailing_pattern: '#<' + hashruler_min_length: 10 + canonicalize_hashrulers: true + enable_markup: true + +lint: + disabled_codes: [] + function_pattern: '[0-9a-z_]+' + macro_pattern: '[0-9A-Z_]+' + global_var_pattern: '[A-Z][0-9A-Z_]+' + internal_var_pattern: _[A-Z][0-9A-Z_]+ + local_var_pattern: '[a-z][a-z0-9_]+' + private_var_pattern: _[0-9a-z_]+ + public_var_pattern: '[A-Z][0-9A-Z_]+' + argument_var_pattern: '[a-z][a-z0-9_]+' + keyword_pattern: '[A-Z][0-9A-Z_]+' + max_conditionals_custom_parser: 2 + min_statement_spacing: 1 + max_statement_spacing: 2 + max_returns: 6 + max_branches: 12 + max_arguments: 5 + max_localvars: 15 + max_statements: 50 + +encode: + emit_byteorder_mark: false + input_encoding: utf-8 + output_encoding: utf-8 \ No newline at end of file diff --git a/.gitignore b/.gitignore index df134f3d8f4289b954a8b3f7bfbc138b6be6f80e..82c6dcbe5cfa0e301cfcbb934b3e5c4783e3b545 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ # build directories -buildDev/ build/ -buildDev/ bin/ cmake-build-debug/ -MSVC2017/ -VS2017/ run/ # Python @@ -25,6 +21,3 @@ output/ # MacOS .DS_Store - -#Cluster -run/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07ff3f6e3f200a4a2cde0d6fc6499b0cd8abb23d..8ad5c98d9458e66f66a0e905dc045713d3d7521d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,7 @@ -image: irmb/virtualfluids-python-deps:latest +############################################################################### +## VirtualFluids CI Pipeline ## +############################################################################### +image: irmb/virtualfluids-python-deps-ubuntu20.04:latest stages: - build @@ -118,6 +121,8 @@ msvc_16: gcc_9_python: stage: build_python + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + needs: ["gcc_9"] cache: @@ -144,6 +149,8 @@ gcc_9_python: build_singularity_image: stage: container_upload + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + needs: - gcc_9_python @@ -164,6 +171,8 @@ build_singularity_image: gcc_9_unit_tests: stage: test + image: irmb/virtualfluids-deps-ubuntu20.04:latest + needs: ["gcc_9"] before_script: @@ -194,6 +203,8 @@ msvc_16_unit_tests: gcc_9_python_bindings_test: stage: test + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + needs: ["gcc_9_python"] before_script: @@ -209,6 +220,8 @@ gcc_9_python_bindings_test: gcc_9_python_slurm_test: stage: test + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + needs: ["gcc_9_python"] rules: @@ -252,14 +265,14 @@ gcc_9_python_slurm_test: nvidia_test: stage: benchmark + image: nvidia/cuda:11.1.1-devel-ubuntu20.04 + needs: [] tags: - gpu - linux - image: nvidia/cuda:11.1.1-devel-ubuntu20.04 - script: - echo NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES} - nvidia-smi @@ -381,11 +394,11 @@ include_what_you_use_clang_10: cppcheck: stage: analyze + image: irmb/virtualfluids-deps-ubuntu20.04 + only: - develop@irmb/VirtualFluids_dev - image: irmb/virtualfluids-deps-ubuntu20.04 - needs: [] before_script: @@ -409,11 +422,11 @@ cppcheck: lizard: stage: analyze + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + only: - develop@irmb/VirtualFluids_dev - image: irmb/virtualfluids-python-deps-ubuntu20.04 - needs: [] before_script: @@ -437,11 +450,11 @@ lizard: gcov_gcc_9: stage: analyze + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + only: - develop@irmb/VirtualFluids_dev - image: irmb/virtualfluids-python-deps-ubuntu20.04 - needs: [] before_script: @@ -481,11 +494,11 @@ gcov_gcc_9: clang-tidy: stage: analyze + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + only: - develop@irmb/VirtualFluids_dev - image: irmb/virtualfluids-python-deps-ubuntu20.04 - needs: [] allow_failure: true @@ -513,24 +526,25 @@ clang-tidy: ############################################################################### # doxgen -doxygen: +pages: stage: analyze + image: alpine + only: - develop@irmb/VirtualFluids_dev needs: [] - image: alpine - script: - apk update && apk add doxygen - doxygen docs/Doxyfile + - mv docs/build/html/ public/ artifacts: - expire_in: 1 week + expire_in: 1 hrs paths: - - docs/build/ + - public ############################################################################### @@ -539,6 +553,8 @@ doxygen: .deploy_template: stage: deploy + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + before_script: - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - apt-get install -y rsync @@ -599,6 +615,9 @@ vf_wheel_to_jupyterhub: # This job only run on the development branch of the parent repository, not on forks! sonar-scanner: stage: deploy + + image: irmb/virtualfluids-python-deps-ubuntu20.04:latest + tags: - linux @@ -631,9 +650,12 @@ sonar-scanner: ## Release ## ############################################################################### create_release: - image: registry.gitlab.com/gitlab-org/release-cli:latest stage: release + + image: registry.gitlab.com/gitlab-org/release-cli:latest + needs: ["build_singularity_image"] + rules: - if: $CI_COMMIT_TAG diff --git a/CMake/cmake_config_files/MOLLOK.config.cmake b/CMake/cmake_config_files/MOLLOK.config.cmake index 2407cda6287cd0e171453d1559ab6585b0a09a33..03f83455175719ff5b0e786994213bbaa0fbd29e 100644 --- a/CMake/cmake_config_files/MOLLOK.config.cmake +++ b/CMake/cmake_config_files/MOLLOK.config.cmake @@ -5,7 +5,7 @@ ################################################################################# #SET TO CORRECT PATH: -SET(CMAKE_CUDA_ARCHITECTURES 52) +SET(CMAKE_CUDA_ARCHITECTURES 86) SET(PATH_NUMERICAL_TESTS "D:/out/numericalTests/") LIST(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") diff --git a/CMake/cmake_config_files/TESLA03.config.cmake b/CMake/cmake_config_files/TESLA03.config.cmake index bf08ef36405df6090393f368e50e4e48795635af..91672511794eeb452f97a1aca952416c7e1179d5 100644 --- a/CMake/cmake_config_files/TESLA03.config.cmake +++ b/CMake/cmake_config_files/TESLA03.config.cmake @@ -19,3 +19,4 @@ SET(VTK_DIR "F:/Libraries/vtk/VTK-8.2.0/build" CACHE PATH "VTK directory overrid SET(PATH_NUMERICAL_TESTS "E:/temp/numericalTests/") LIST(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") +SET(CMAKE_CUDA_ARCHITECTURES 52) \ No newline at end of file diff --git a/CMake/compilerflags/GNU.cmake b/CMake/compilerflags/GNU.cmake index 3e67b79e9c84d29b51b2881b17e2b74f5510bbd2..8d54b52a434719a1e99aa705b121593973f3375a 100644 --- a/CMake/compilerflags/GNU.cmake +++ b/CMake/compilerflags/GNU.cmake @@ -38,6 +38,7 @@ list(APPEND CS_COMPILER_FLAGS_CXX "-Wno-unused-parameter") list(APPEND CS_COMPILER_FLAGS_CXX "-Wno-reorder") list(APPEND CS_COMPILER_FLAGS_CXX "-Wno-unknown-pragmas") list(APPEND CS_COMPILER_FLAGS_CXX "-Wno-cast-function-type") +list(APPEND CS_COMPILER_FLAGS_CXX "-Wno-strict-aliasing") ############################################################################################################# # linker options diff --git a/CMakeLists.txt b/CMakeLists.txt index d74febdac96544fa6f50b65602392d3c44a5ca10..140f2b0b9da1fb15bacab931ca01da5dd7e2e21d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,18 @@ ################################################################################# cmake_minimum_required(VERSION 3.15..3.20 FATAL_ERROR) -project(VirtualFluids CXX) +project(VirtualFluids + VERSION 1.0.0 + DESCRIPTION "CFD code based on the Lattice Boltzmann Method" + HOMEPAGE_URL "https://www.tu-braunschweig.de/irmb/forschung/virtualfluids" + LANGUAGES CXX) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() +message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -86,19 +95,11 @@ if(BUILD_VF_GPU) message(FATAL_ERROR "CUDA Compiler was requested but is not found on the system.") endif() - if(MSVC) - # With the MSVC compiler we got this warning: nvcc : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. - # But we build the c++ code with C++14. Until we have not a solution here, we set the standard to 11 here. - set(CMAKE_CUDA_STANDARD 11) - else() - set(CMAKE_CUDA_STANDARD 14) - endif() - + set(CMAKE_CUDA_STANDARD 17) set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) enable_language(CUDA) - if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) message(WARNING "CMAKE_CUDA_ARCHITECTURES was not defined and is set to 30 (CUDA support until 10.1 only).") set(CMAKE_CUDA_ARCHITECTURES 30) @@ -106,7 +107,6 @@ if(BUILD_VF_GPU) if(BUILD_CUDA_LTO) - if(CMAKE_CUDA_ARCHITECTURES LESS 50) message(FATAL_ERROR "CUDA Link time optimization requires CUDA 11.2 and CC 5.0.") else() @@ -121,8 +121,8 @@ if(BUILD_VF_GPU) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda") - message("CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}") - message("CUDA Architecture: ${CMAKE_CUDA_ARCHITECTURES}") + message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}") + message(STATUS "CUDA Architecture: ${CMAKE_CUDA_ARCHITECTURES}") endif() diff --git a/CMakePresets.json b/CMakePresets.json index 6527d5c1f4feba60064b1473fa12dbb2331279aa..663142f01b4076bc66295549a11fb4e3b6701ce0 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "cmakeMinimumRequired": { "major": 3, "minor": 19, diff --git a/README.md b/README.md index dcd9c19d6ed9a2254cb021904c3cfd982ad237e8..b9d60ed3d1955f2fe0728ca92d8ec7f6b8846a06 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,11 @@ A GPU computation generates a the time series of output files directly in the ou ## Documentation -The doxygen generated documentation can be found [here](https://git.irmb.bau.tu-bs.de/doku/CPU). +The doxygen generated documentation can be found [here](https://irmb.gitlab-pages.rz.tu-bs.de/VirtualFluids_dev). ## Known Issues -If you notice any problems on your platform, please report an issue. +If you notice any problems on your platform, please report an [issue](https://git.rz.tu-bs.de/irmb/virtualfluids/-/issues/new). ## Authors diff --git a/apps/cpu/BoxBenchmark/bb.cpp b/apps/cpu/BoxBenchmark/bb.cpp index 547e654b35096e66e9400b16ad5a01be024ed2c5..719df7738df87e2b310aa03332fb2a3ef8f2ffe6 100644 --- a/apps/cpu/BoxBenchmark/bb.cpp +++ b/apps/cpu/BoxBenchmark/bb.cpp @@ -14,7 +14,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/CheckpointConverter/cpc.cpp b/apps/cpu/CheckpointConverter/cpc.cpp index 1ef1ad8f4ead0330620713fea61fb1ae51f5bbd5..c26e7df4c682e1c5214d15644c57d52ac7d8413a 100644 --- a/apps/cpu/CheckpointConverter/cpc.cpp +++ b/apps/cpu/CheckpointConverter/cpc.cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string path = config.getString("path"); diff --git a/apps/cpu/CouetteFlow/cflow.cpp b/apps/cpu/CouetteFlow/cflow.cpp index 2ac32915a9348021acb2ff6e5ee70b24a8dedeb6..e37bafade742c42601fdeb66cfa45ca516097ff3 100644 --- a/apps/cpu/CouetteFlow/cflow.cpp +++ b/apps/cpu/CouetteFlow/cflow.cpp @@ -10,7 +10,7 @@ void bflow(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/DHIT/dhit.cpp b/apps/cpu/DHIT/dhit.cpp index 7eb78c37ee35d99af6ac9ca665beba023896290f..957c823ef664e4dd19df45fa322e93a8c8164bb7 100644 --- a/apps/cpu/DHIT/dhit.cpp +++ b/apps/cpu/DHIT/dhit.cpp @@ -12,7 +12,7 @@ void run(string configname) { //Sleep(30000); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/DLR-F16-Porous/f16.cpp b/apps/cpu/DLR-F16-Porous/f16.cpp index 422c2dead86796d935fb73b8a16ebf94db53df71..9197aca45bbfed9be817fbcb83db4973e4a58f87 100644 --- a/apps/cpu/DLR-F16-Porous/f16.cpp +++ b/apps/cpu/DLR-F16-Porous/f16.cpp @@ -53,7 +53,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); @@ -207,7 +207,8 @@ void run(string configname) bcProc = SPtr<BCProcessor>(new ThinWallBCProcessor()); SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); - //t = 21.8, P = 1.0145 atm, Relative Humidity = 45.8, Second Coefficient of Viscosity = 3120 //Ash, R. L., Zuckerwar, A. J., & Zheng, Z. (1991). Second coefficient of viscosity in air. + //t = 21.8, P = 1.0145 atm, Relative Humidity = 45.8, Second Coefficient of Viscosity = 3120 + //Ash, R. L., Zuckerwar, A. J., & Zheng, Z. (1991). Second coefficient of viscosity in air. double bulckViscosity = 3120 * nuLB; dynamicPointerCast<CompressibleCumulant4thOrderViscosityLBMKernel>(kernel)->setBulkViscosity(bulckViscosity); kernel->setBCProcessor(bcProc); diff --git a/apps/cpu/DLR-F16-Solid/f16.cpp b/apps/cpu/DLR-F16-Solid/f16.cpp index 99983c3c3fd4171e1feb0ea5635805e019a25d44..d88b650b143793b67388f920bd2e23c380af0e5a 100644 --- a/apps/cpu/DLR-F16-Solid/f16.cpp +++ b/apps/cpu/DLR-F16-Solid/f16.cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); @@ -169,7 +169,8 @@ void run(string configname) bcProc = SPtr<BCProcessor>(new BCProcessor()); SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel()); - //t = 21.8, P = 1.0145 atm, Relative Humidity = 45.8, Second Coefficient of Viscosity = 3120 //Ash, R. L., Zuckerwar, A. J., & Zheng, Z. (1991). Second coefficient of viscosity in air. + //t = 21.8, P = 1.0145 atm, Relative Humidity = 45.8, Second Coefficient of Viscosity = 3120 + //Ash, R. L., Zuckerwar, A. J., & Zheng, Z. (1991). Second coefficient of viscosity in air. double bulckViscosity = 3120 * nuLB; dynamicPointerCast<CompressibleCumulant4thOrderViscosityLBMKernel>(kernel)->setBulkViscosity(bulckViscosity); diff --git a/apps/cpu/DLR-F16/f16.cpp b/apps/cpu/DLR-F16/f16.cpp index ca204d3807d8304dc15ca68b227a29d6ffed6f35..523a9c7c09795627d43de8b119597e52caf4d5b0 100644 --- a/apps/cpu/DLR-F16/f16.cpp +++ b/apps/cpu/DLR-F16/f16.cpp @@ -160,7 +160,7 @@ void run(string configname) try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp b/apps/cpu/FlowAroundCylinder/cylinder.cpp index 3ae5f2ab511cdc1767d8497eb6a895055d5ddd48..81bfd5ff3658d41e29ab6f56590119de7db3fe82 100644 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp +++ b/apps/cpu/FlowAroundCylinder/cylinder.cpp @@ -14,7 +14,7 @@ void run(string configname) //DEBUG/////////////////////////////////////// //Sleep(30000); ///////////////////////////////////////////// - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); diff --git a/apps/cpu/Hagen_Poiseuille_flow/pflow.cpp b/apps/cpu/Hagen_Poiseuille_flow/pflow.cpp index c448a5de53c96309be9e24ff4f507fee20a462c6..05f6c625be6ffe4cd56a673eb44a62e6c59d5ce0 100644 --- a/apps/cpu/Hagen_Poiseuille_flow/pflow.cpp +++ b/apps/cpu/Hagen_Poiseuille_flow/pflow.cpp @@ -10,7 +10,7 @@ using namespace std; //{ // try // { -// ConfigurationFile config; +// vf::basics::ConfigurationFile config; // config.load(configname); // // string pathname = config.getString("pathname"); @@ -301,7 +301,7 @@ void pflowdp(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); @@ -544,7 +544,7 @@ void pflowdp(string configname) intHelper.addInteractor(outflowInt); - //die Geschwindigkeit Randbedingung soll Ausflüß überdecken !!!!! + //die Geschwindigkeit Randbedingung soll Ausfl�� �berdecken !!!!! diff --git a/apps/cpu/Hagen_Poiseuille_flow2/pflow2.cpp b/apps/cpu/Hagen_Poiseuille_flow2/pflow2.cpp index 76124d72ecedbed258aa163dc72e7a1cadff2bcc..5bcf21ed9596ce6d8d6bce9974b98627c007168d 100644 --- a/apps/cpu/Hagen_Poiseuille_flow2/pflow2.cpp +++ b/apps/cpu/Hagen_Poiseuille_flow2/pflow2.cpp @@ -10,7 +10,7 @@ void pflowdp(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/HerschelBulkleyModel/hbflow.cpp b/apps/cpu/HerschelBulkleyModel/hbflow.cpp index 6de995e2af0510fcc19f985a1eb43214b1748090..976635bdea0823f6e4cdef208f06d98499e0eabf 100644 --- a/apps/cpu/HerschelBulkleyModel/hbflow.cpp +++ b/apps/cpu/HerschelBulkleyModel/hbflow.cpp @@ -10,7 +10,7 @@ void bflow(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp index f4b50325da703381b9c09b36c18741f7f1c04cc5..eff2c2c628995b34f00650d310275d186d38f2fc 100644 --- a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp +++ b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp @@ -10,7 +10,7 @@ void bflow(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string outputPath = config.getValue<string>("outputPath"); diff --git a/apps/cpu/JetBreakup/JetBreakup.cpp b/apps/cpu/JetBreakup/JetBreakup.cpp index e2dc0f0e31483310bc119b26ce246aa8dfb7133c..d6cff6366a00a65983ee67075f99d8ca2c9e1ff9 100644 --- a/apps/cpu/JetBreakup/JetBreakup.cpp +++ b/apps/cpu/JetBreakup/JetBreakup.cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/LaminarTubeFlow/ltf.cpp b/apps/cpu/LaminarTubeFlow/ltf.cpp index e523dd2de7416ea5189dbceab200725d89f15424..c2c3866fc11b404acb3c571450f86d8ce07a4b2f 100644 --- a/apps/cpu/LaminarTubeFlow/ltf.cpp +++ b/apps/cpu/LaminarTubeFlow/ltf.cpp @@ -11,7 +11,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/Multiphase/Multiphase (Droplet Test).cpp.backup b/apps/cpu/Multiphase/Multiphase (Droplet Test).cpp.backup index 46297d526c76362e2d45e00ad5496c20dac2af99..389b754f848e8886140113310572686a9efd908b 100644 --- a/apps/cpu/Multiphase/Multiphase (Droplet Test).cpp.backup +++ b/apps/cpu/Multiphase/Multiphase (Droplet Test).cpp.backup @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/Multiphase (Jet breakup on Phoenix).cpp.backup b/apps/cpu/Multiphase/Multiphase (Jet breakup on Phoenix).cpp.backup index 9f28008987968254edb46a1b7750155aad4f5ced..1adc07f8b293327e9bf814d82ebcca8b8aa91d44 100644 --- a/apps/cpu/Multiphase/Multiphase (Jet breakup on Phoenix).cpp.backup +++ b/apps/cpu/Multiphase/Multiphase (Jet breakup on Phoenix).cpp.backup @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/Multiphase.cpp b/apps/cpu/Multiphase/Multiphase.cpp index deb2845f4278661bb970ea68b043e3cb435bffcc..77bcfd0c00a4f2d6050de7dfb58a2c923b5d2ce4 100644 --- a/apps/cpu/Multiphase/Multiphase.cpp +++ b/apps/cpu/Multiphase/Multiphase.cpp @@ -12,7 +12,7 @@ void run(string configname) //Sleep(20000); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Droplet Test).cpp b/apps/cpu/Multiphase/backup/Multiphase (Droplet Test).cpp index b5a8a9eac55d2150f08e00a8ba6f215228bf135a..18989d3601729dcc663f707bc21e3a7f91a57dfd 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Droplet Test).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Droplet Test).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Final before automation).cpp b/apps/cpu/Multiphase/backup/Multiphase (Final before automation).cpp index b4a6b34782a4bc8df00168d9d0a9130d19630755..b6160314eb87c785443602a4c5eb35ca16ebc02b 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Final before automation).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Final before automation).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Flow Focusing).cpp b/apps/cpu/Multiphase/backup/Multiphase (Flow Focusing).cpp index 33333fc0dba8d082574e766e39c9573adbdde450..11e064e30a210485aabd40c40ee925e3acf56922 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Flow Focusing).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Flow Focusing).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Jet breakup on Phoenix).cpp b/apps/cpu/Multiphase/backup/Multiphase (Jet breakup on Phoenix).cpp index 9f28008987968254edb46a1b7750155aad4f5ced..1adc07f8b293327e9bf814d82ebcca8b8aa91d44 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Jet breakup on Phoenix).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Jet breakup on Phoenix).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (T-Junction).cpp b/apps/cpu/Multiphase/backup/Multiphase (T-Junction).cpp index 18651e4a5584a7eda7bd3aea4dc8789eb03e1d15..2f3e94e7acf42de01826e0aac1daff2689d04acb 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (T-Junction).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (T-Junction).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Thermal).cpp b/apps/cpu/Multiphase/backup/Multiphase (Thermal).cpp index a5d20b94a4a74331f55954088545df8f735faf71..a61d7b7541f05e66eab79f0e5bf1f4e91325632f 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Thermal).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Thermal).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase (Tube).cpp b/apps/cpu/Multiphase/backup/Multiphase (Tube).cpp index 5795ec61054dfa359fd4038ce7f8f1f263b6ee71..7febd0cf18d80039af1fc284612789321b21e6b6 100644 --- a/apps/cpu/Multiphase/backup/Multiphase (Tube).cpp +++ b/apps/cpu/Multiphase/backup/Multiphase (Tube).cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/Multiphase/backup/Multiphase.cpp b/apps/cpu/Multiphase/backup/Multiphase.cpp index eae4ab93de060157422f29ae9984078e298194d4..df4c311d8de62ce79aa337af19561b510b859d79 100644 --- a/apps/cpu/Multiphase/backup/Multiphase.cpp +++ b/apps/cpu/Multiphase/backup/Multiphase.cpp @@ -10,7 +10,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/MultiphaseDropletTest/droplet.cpp b/apps/cpu/MultiphaseDropletTest/droplet.cpp index 092d5a16a36b47c726f0f85463484f0c97fdecd0..829ad38628665cbe006e7f9b88cb63b8ea362472 100644 --- a/apps/cpu/MultiphaseDropletTest/droplet.cpp +++ b/apps/cpu/MultiphaseDropletTest/droplet.cpp @@ -9,7 +9,7 @@ using namespace std; void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/OrganPipe/OrganPipe.cpp b/apps/cpu/OrganPipe/OrganPipe.cpp index 2435b3567d5179da7375fceacdf641b05302d18b..8ad094bc9cc8db392eac1f7926365a9dca2586c6 100644 --- a/apps/cpu/OrganPipe/OrganPipe.cpp +++ b/apps/cpu/OrganPipe/OrganPipe.cpp @@ -15,7 +15,7 @@ void run(string configname) SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); bool newStart = config.getValue<bool>("newStart"); diff --git a/apps/cpu/Thermoplast/thermoplast.cpp b/apps/cpu/Thermoplast/thermoplast.cpp index 60057f28ea51fe10da93d07cfad9cf3f35d1411d..dc77db67a844004fe2ecc63a15df125c03ad1903 100644 --- a/apps/cpu/Thermoplast/thermoplast.cpp +++ b/apps/cpu/Thermoplast/thermoplast.cpp @@ -197,7 +197,7 @@ void thermoplast(string configname) SPtr<Communicator> comm = MPICommunicator::getInstance(); int myid = comm->getProcessID(); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); vector<int> blocknx = config.getVector<int>("blocknx"); diff --git a/apps/cpu/ViskomatXL/viskomat.cpp b/apps/cpu/ViskomatXL/viskomat.cpp index 91dfb050901571b5cf37e02cfca5ab8c7a8eb8cb..12eea28c32990f38393bc3d3478cd0833c30c5ef 100644 --- a/apps/cpu/ViskomatXL/viskomat.cpp +++ b/apps/cpu/ViskomatXL/viskomat.cpp @@ -10,7 +10,7 @@ void bflow(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string outputPath = config.getValue<string>("outputPath"); @@ -35,7 +35,7 @@ void bflow(string configname) double scaleFactor = config.getValue<double>("scaleFactor"); double resolution = config.getValue<double>("resolution"); - ConfigurationFile viscosity; + vf::basics::ConfigurationFile viscosity; //viscosity.load(viscosityPath + "/viscosity.cfg"); //double nuLB = viscosity.getValue<double>("nuLB"); diff --git a/apps/cpu/aperm/aperm.cpp b/apps/cpu/aperm/aperm.cpp index 8745b732b04cd449c52ef23d9e8176a780a1ebbb..0172975c677e0072d3ead6ab13127cca98ca7161 100644 --- a/apps/cpu/aperm/aperm.cpp +++ b/apps/cpu/aperm/aperm.cpp @@ -12,7 +12,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/aperm/aperm.cpp.old b/apps/cpu/aperm/aperm.cpp.old index ce21e06c2d7713665596886c152c6e384f5003d2..87f05527469d44c5ea565108e515bea2a6b50a29 100644 --- a/apps/cpu/aperm/aperm.cpp.old +++ b/apps/cpu/aperm/aperm.cpp.old @@ -12,7 +12,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/aperm/aperm.cpp.old2 b/apps/cpu/aperm/aperm.cpp.old2 index 0a4d41cfa3c136948cf88dc7f71dee2bb75bf3be..fd2b40d89a9479ba50843028a3d61e9422e759b7 100644 --- a/apps/cpu/aperm/aperm.cpp.old2 +++ b/apps/cpu/aperm/aperm.cpp.old2 @@ -12,7 +12,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/bChannelA/bChannelA.cpp b/apps/cpu/bChannelA/bChannelA.cpp index 388ca594cda49bd48e4f6eaf3ad8342b5f469ef9..75e263bbe125871598fdd1cbd38749e41132a224 100644 --- a/apps/cpu/bChannelA/bChannelA.cpp +++ b/apps/cpu/bChannelA/bChannelA.cpp @@ -87,7 +87,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); diff --git a/apps/cpu/f16Test/f16test.cpp b/apps/cpu/f16Test/f16test.cpp index 8e3bb726e638fb1946e23d841e5c35aaa085d0cc..58921f91e5fa294fb117a2842626e28d12ade8d4 100644 --- a/apps/cpu/f16Test/f16test.cpp +++ b/apps/cpu/f16Test/f16test.cpp @@ -16,7 +16,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getString("pathOut"); diff --git a/apps/cpu/levels/levels.cpp b/apps/cpu/levels/levels.cpp index 2f9297f3aa7749db7001ddf6f0ad8f1af8525ac5..7173a4ba562a95fc93e267c5498957fc4a539da6 100644 --- a/apps/cpu/levels/levels.cpp +++ b/apps/cpu/levels/levels.cpp @@ -20,7 +20,7 @@ void run(string configname) int mybundle = comm->getBundleID(); int root = comm->getRoot(); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("path"); diff --git a/apps/cpu/mirror/mirror.cpp b/apps/cpu/mirror/mirror.cpp index a5c877bf68df10f3445849de6deac346772b058a..e4a2f33027bb3b0be3eafb6b0746a14f642107ee 100644 --- a/apps/cpu/mirror/mirror.cpp +++ b/apps/cpu/mirror/mirror.cpp @@ -9,7 +9,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); diff --git a/apps/cpu/mpi_benchmark/mpib.cpp b/apps/cpu/mpi_benchmark/mpib.cpp index 7874e2ea51a86663c29f9bc4d8847e832f6b139b..05a251bb2f0632a8cff7b1d0cb42603c5be0438e 100644 --- a/apps/cpu/mpi_benchmark/mpib.cpp +++ b/apps/cpu/mpi_benchmark/mpib.cpp @@ -20,7 +20,7 @@ void run(string configname) { //UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG5"); - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getString("pathOut"); diff --git a/apps/cpu/pChannel/pChannel.cpp b/apps/cpu/pChannel/pChannel.cpp index 85a34a51cd3712a679e380bbd014cfeeefb6e74d..f036c22b6a7f3016a25d20640026db10eb5cb6bf 100644 --- a/apps/cpu/pChannel/pChannel.cpp +++ b/apps/cpu/pChannel/pChannel.cpp @@ -169,7 +169,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathOut = config.getValue<string>("pathOut"); diff --git a/apps/cpu/pChannel/pChannel.cpp.hlrn b/apps/cpu/pChannel/pChannel.cpp.hlrn index 808b8cf49ec3c2f4c9c9fcaa725844ce08d9ca1f..a0592ec5b0871b37e3d7f21e0f85cc91ebf561d2 100644 --- a/apps/cpu/pChannel/pChannel.cpp.hlrn +++ b/apps/cpu/pChannel/pChannel.cpp.hlrn @@ -13,7 +13,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/cpu/perm/perm.cpp b/apps/cpu/perm/perm.cpp index 4cb2b6eb111e814479cef87ae4799e4467939c19..21b4bc47abfd650e52c9b235d28fdcdf52b229f2 100644 --- a/apps/cpu/perm/perm.cpp +++ b/apps/cpu/perm/perm.cpp @@ -9,7 +9,7 @@ void perm(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getValue<string>("pathname"); diff --git a/apps/cpu/rheometer/rheometer.cpp b/apps/cpu/rheometer/rheometer.cpp index f6f98c122c3197f1a080fd335f8edfc9ee1f4e33..3c7907d3b1bc13547d64abd2180657d20b250704 100644 --- a/apps/cpu/rheometer/rheometer.cpp +++ b/apps/cpu/rheometer/rheometer.cpp @@ -10,7 +10,7 @@ void bflow(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string outputPath = config.getValue<string>("outputPath"); @@ -34,7 +34,7 @@ void bflow(string configname) double scaleFactor = config.getValue<double>("scaleFactor"); double resolution = config.getValue<double>("resolution"); - ConfigurationFile viscosity; + vf::basics::ConfigurationFile viscosity; viscosity.load(viscosityPath + "/viscosity.cfg"); double nuLB = viscosity.getValue<double>("nuLB"); diff --git a/apps/cpu/screw/screw.cpp b/apps/cpu/screw/screw.cpp index 3f48efaf9beb105d0c1e06237165153ef3c6898c..099ae784987b4c829a00018e712df690b0660c38 100644 --- a/apps/cpu/screw/screw.cpp +++ b/apps/cpu/screw/screw.cpp @@ -14,7 +14,7 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(argv[1]); string pathname = config.getString("pathname"); diff --git a/apps/cpu/sphere/sphere.cpp b/apps/cpu/sphere/sphere.cpp index 310766ad05f6a3a1d8c08d8ead69c9f48bb6ce11..3b725f98cf62b5c987cbbde9f0698b5d9bc337c1 100644 --- a/apps/cpu/sphere/sphere.cpp +++ b/apps/cpu/sphere/sphere.cpp @@ -13,7 +13,7 @@ void run(string configname) int myid = comm->getProcessID(); - //ConfigurationFile config; + //vf::basics::ConfigurationFile config; //config.load(configname); //string pathname = config.getValue<string>("path"); diff --git a/apps/cpu/teperm/teperm.cpp b/apps/cpu/teperm/teperm.cpp index b881495912710982a9944f6274ed037595b1442a..51638fa26e5675e69bf9e6ce23950f6cf9a47ec6 100644 --- a/apps/cpu/teperm/teperm.cpp +++ b/apps/cpu/teperm/teperm.cpp @@ -14,7 +14,7 @@ void run(string configname) { try { - ConfigurationFile config; + vf::basics::ConfigurationFile config; config.load(configname); string pathname = config.getString("pathname"); diff --git a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp index 448c0561a8de04b4ba1afe93490938bba7376850..da92fa6a3809877118f58b8367d6d06d1e158982 100644 --- a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp +++ b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp @@ -8,6 +8,7 @@ #include <fstream> #include <exception> #include <memory> +#include <filesystem> #include "mpi.h" @@ -17,13 +18,13 @@ #include "PointerDefinitions.h" #include "Core/LbmOrGks.h" -#include "Core/Input/Input.h" #include "Core/StringUtilities/StringUtil.h" -#include "Core/Input/ConfigFileReader/ConfigFileReader.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" +#include <basics/config/ConfigurationFile.h> + ////////////////////////////////////////////////////////////////////////// #include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" @@ -121,12 +122,6 @@ void multipleLevel(const std::string& configPath) gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - vf::gpu::Communicator* comm = vf::gpu::Communicator::getInstanz(); - SPtr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(); - - std::cout << configPath << std::endl; - SPtr<ConfigData> configData = configReader->readConfigFile(configPath.c_str()); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -154,8 +149,12 @@ void multipleLevel(const std::string& configPath) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + vf::gpu::Communicator* comm = vf::gpu::Communicator::getInstanz(); + + vf::basics::ConfigurationFile config; + config.load(configPath); - SPtr<Parameter> para = Parameter::make(configData, comm); + SPtr<Parameter> para = std::make_shared<Parameter>(config, comm->getNummberOfProcess(), comm->getPID()); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -173,7 +172,6 @@ void multipleLevel(const std::string& configPath) para->setDevices(std::vector<uint>{(uint)0}); - para->setOutputPath( path ); para->setOutputPrefix( simulationName ); para->setFName(para->getOutputPath() + "/" + para->getOutputPrefix()); @@ -343,41 +341,26 @@ void multipleLevel(const std::string& configPath) int main( int argc, char* argv[]) { MPI_Init(&argc, &argv); - std::string str, str2; - if ( argv != NULL ) - { - //str = static_cast<std::string>(argv[0]); - - try - { - ////////////////////////////////////////////////////////////////////////// - - std::string targetPath; - - targetPath = __FILE__; - - targetPath = targetPath.substr(0, targetPath.find_last_of('/') + 1); - - - std::cout << targetPath << std::endl; - - multipleLevel(targetPath + "configDrivenCavity.txt"); - - ////////////////////////////////////////////////////////////////////////// - } - catch (const std::bad_alloc& e) - { - *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; - } - catch (const std::exception& e) - { - *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; - } - catch (...) - { - *logging::out << logging::Logger::LOGGER_ERROR << "Unknown exception!\n"; - } + try + { + // assuming that the config files is stored parallel to this file. + std::filesystem::path filePath = __FILE__; + filePath.replace_filename("configDrivenCavity.txt"); + + multipleLevel(filePath.string()); + } + catch (const std::bad_alloc& e) + { + *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; + } + catch (const std::exception& e) + { + *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; + } + catch (...) + { + *logging::out << logging::Logger::LOGGER_ERROR << "Unknown exception!\n"; } MPI_Finalize(); diff --git a/apps/gpu/LBM/DrivenCavity/configDrivenCavity.txt b/apps/gpu/LBM/DrivenCavity/configDrivenCavity.txt index a3d6622d50700e554dcf3429f0c51e07f5c83ead..246e6f72841c23957e85bb5d69a449af8d178822 100644 --- a/apps/gpu/LBM/DrivenCavity/configDrivenCavity.txt +++ b/apps/gpu/LBM/DrivenCavity/configDrivenCavity.txt @@ -9,6 +9,7 @@ ################################################## #Path="E:/DrivenCavity/results" #Path="F:/Work/Computations/out/DrivenCavity/" +Path = C:/out/ #Prefix="DrivenCavity" #WriteGrid=true ################################################## diff --git a/apps/gpu/LBM/WTG_RUB/CMakeLists.txt b/apps/gpu/LBM/WTG_RUB/CMakeLists.txt index 8bac54bf335a26aaecbf8cbb5a1474e67bd99b89..606987dfb093c9c93bbd25bf5ff68fdc81311e1b 100644 --- a/apps/gpu/LBM/WTG_RUB/CMakeLists.txt +++ b/apps/gpu/LBM/WTG_RUB/CMakeLists.txt @@ -3,3 +3,5 @@ PROJECT(WTG_RUB LANGUAGES CUDA CXX) vf_add_library(BUILDTYPE binary PRIVATE_LINK basics VirtualFluids_GPU GridGenerator MPI::MPI_CXX FILES WTG_RUB.cpp) set_source_files_properties(WTG_RUB.cpp PROPERTIES LANGUAGE CUDA) + +set_target_properties(WTG_RUB PROPERTIES CUDA_SEPARABLE_COMPILATION ON) diff --git a/apps/gpu/LBM/WTG_RUB/WTG_RUB.cpp b/apps/gpu/LBM/WTG_RUB/WTG_RUB.cpp index 12bc850bc718952278b5f0e9e10470eea3ff18b3..86d2227d200622ab3a2d87505ba5c7afcede36fe 100644 --- a/apps/gpu/LBM/WTG_RUB/WTG_RUB.cpp +++ b/apps/gpu/LBM/WTG_RUB/WTG_RUB.cpp @@ -7,6 +7,7 @@ #include <fstream> #include <exception> #include <memory> +#include <filesystem> #include "mpi.h" @@ -16,18 +17,19 @@ #include "PointerDefinitions.h" #include "Core/LbmOrGks.h" -#include "Core/Input/Input.h" #include "Core/StringUtilities/StringUtil.h" -#include "Core/Input/ConfigFileReader/ConfigFileReader.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" +#include <basics/config/ConfigurationFile.h> + ////////////////////////////////////////////////////////////////////////// #include "GridGenerator/grid/GridBuilder/LevelGridBuilder.h" #include "GridGenerator/grid/GridBuilder/MultipleGridBuilder.h" #include "GridGenerator/grid/BoundaryConditions/Side.h" +#include "GridGenerator/grid/BoundaryConditions/BoundaryCondition.h" #include "GridGenerator/grid/GridFactory.h" #include "GridGenerator/geometries/TriangularMesh/TriangularMesh.h" #include "GridGenerator/geometries/Conglomerate/Conglomerate.h" @@ -67,26 +69,24 @@ LbmOrGks lbmOrGks = LBM; const real L = 1.0; -const real Re = 500.0;// 1000.0; - const real velocity = 1.0; int variant = 1; real rotationOfCity; real z_offset = 0.0; // only if baseplate is in use (currently not!! not important) +int dataN; +std::vector<real> dataZ; +std::vector<real> dataVelocity; +std::string simulationName(""); // 1: original setup of Lennard Lux (6 level, 4.0 cm -> 1.25 mm) // 2: setup 1 of MSch (4 level, 1.0 cm -> 1.25 mm) // 3: setup 2 of MSch (5 level, 1.6 cm -> 1.0 mm) int setupDomain = 3; - - std::string path("D:/out/WTG_RUB"); //Mollok std::string inputPath("D:/out/WTG_RUB/input/"); -std::string simulationName("RUB"); - const uint timeStepStartOut = 0; const uint timeStepOut = 10000; const uint timeStepEnd = 100000; @@ -94,8 +94,12 @@ const uint timeStepEnd = 100000; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +void convertMPFile(SPtr <MultipleGridBuilder> gridBuilder, real& phi, std::vector<real>& origin, bool& measureVeloProfilesOnly, uint& maxLevel); + void addFineGrids(SPtr<MultipleGridBuilder> gridBuilder, uint &maxLevel, real &rotationOfCity); +void readVelocityProfile(); + std::string chooseVariation(); void multipleLevel(const std::string& configPath) @@ -110,12 +114,6 @@ void multipleLevel(const std::string& configPath) gridFactory->setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod::POINT_IN_OBJECT); auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - - vf::gpu::Communicator* comm = vf::gpu::Communicator::getInstanz(); - SPtr<ConfigFileReader> configReader = ConfigFileReader::getNewInstance(); - - std::cout << configPath << std::endl; - SPtr<ConfigData> configData = configReader->readConfigFile(configPath.c_str()); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -147,8 +145,28 @@ void multipleLevel(const std::string& configPath) //TriangularMesh *RubSTL = TriangularMesh::make(inputPath + "stl/Var02_0deg_FD_b.stl"); TriangularMesh *RubSTL = TriangularMesh::make(inputPath + "stl/" + chooseVariation() + ".stl"); - // vector<real> originOfCityXY = { 600.0, y_max / 2, z_offset }; + std::vector<real> originOfCityXY = { 600.0, y_max / 2, z_offset }; + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // OPTIONS + + int maxLevelAtInflow = maxLevel; + // there are max. 3 levels (0,1,2) at inflow-/x_min-Side if maxLevel >= 3; OTHERWISE: maxLevel + if (maxLevel >= 3) + maxLevelAtInflow = 2; + + // MeasurePoints [MP01-15: lvl maxLevel],[MP16-41: lvl 1]; disable when reducing numberOfLevels --> dx might be too + // large if MP01-15 are used with low resolution dx, MPs might be placed in solid City-geometry + bool useMP = true; + bool measureVeloProfilesOnly = false; + + // Two Components: true->DiffOn, false->DiffOff + bool diffOnOff = false; + + // Resetting diff or flow field, e.g. after restart, do not reset diff/flow at start of measureRun ;-) + bool reset_diff = true; + bool reset_flow = true; + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// gridBuilder->addCoarseGrid(x_min, y_min, z_min, x_max, y_max, z_max, dx); @@ -173,7 +191,12 @@ void multipleLevel(const std::string& configPath) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - SPtr<Parameter> para = Parameter::make(configData, comm); + vf::gpu::Communicator* comm = vf::gpu::Communicator::getInstanz(); + + vf::basics::ConfigurationFile config; + config.load(configPath); + + SPtr<Parameter> para = std::make_shared<Parameter>(config, comm->getNummberOfProcess(), comm->getPID()); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// const real velocityLB = (real)0.0844; // LB units @@ -189,7 +212,7 @@ void multipleLevel(const std::string& configPath) para->setDevices(std::vector<uint>{(uint)0}); para->setOutputPath( path ); - para->setOutputPrefix( simulationName ); + para->setOutputPrefix( "Unified_" + simulationName ); para->setFName(para->getOutputPath() + "/" + para->getOutputPrefix()); @@ -202,7 +225,7 @@ void multipleLevel(const std::string& configPath) para->setVelocityRatio(velocity/ velocityLB); - para->setMainKernel("CumulantK17CompChim"); + para->setMainKernel("CumulantK17CompChim"); // CumulantK17Unified, CumulantK17CompChim para->setInitialCondition([&](real coordX, real coordY, real coordZ, real &rho, real &vx, real &vy, real &vz) { rho = (real)0.0; @@ -225,6 +248,79 @@ void multipleLevel(const std::string& configPath) gridBuilder->setPressureBoundaryCondition(SideType::PX, 0.0); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + readVelocityProfile(); + for (int level = 0; level <= maxLevelAtInflow; level++) { + auto inflowBC = std::dynamic_pointer_cast<VelocityBoundaryCondition>( + gridBuilder->getBoundaryCondition(SideType::MX, level)); + + // lambda function [capture list](parameter list){function body} + // for every z, loop is being run; + if (inflowBC) { + inflowBC->setVelocityProfile( + gridBuilder->getGrid(level), [&](real x, real y, real z, real &vx, real &vy, real &vz) { + int i; + for (i = 0; i < dataN; i++) { + if ((z < dataZ[i]) || (z == dataZ[i])) + break; + } // remembers i + + // if z is below current data point --> interpolation between previous and current datapoint + if (z < dataZ[i]) { + vx = velocityLB * (dataVelocity[i] + (dataVelocity[i + 1] - dataVelocity[i]) / + (dataZ[i + 1] - dataZ[i]) * (z - dataZ[i])); + } else if (z == dataZ[i]) { + vx = velocityLB * dataVelocity[i]; + } + + // vx << std::endl; vx = velocityLB; + vy = 0.0; + vz = 0.0; + }); + } + } + + // Resetting Velocity Profile (returning to intial state; do not combine with restart) + if (reset_flow) { + para->setInitialCondition([&](real x, real y, real z, real &rho, real &vx, real &vy, real &vz) { + int i; + for (i = 0; i < dataN; i++) { + if ((z < dataZ[i]) || (z == dataZ[i])) + break; + } + if (z < dataZ[i]) { + vx = velocityLB * 0.588 * + (dataVelocity[i] + + (dataVelocity[i + 1] - dataVelocity[i]) / (dataZ[i + 1] - dataZ[i]) * (z - dataZ[i])); + } else if (z == dataZ[i]) { + vx = velocityLB * 0.588 * dataVelocity[i]; + } + + // std::cout << "LINE : " << __LINE__ << "\tdataZ = " << dataZ[i] << "\tz = " << z << "\tvx = " << vx << + // std::endl; + + // vx = velocityLB; + vy = 0.0; + vz = 0.0; + rho = 0.0; + }); + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Intializing MeasurePoints + para->setUseMeasurePoints(useMP); + if (para->getUseMeasurePoints()) { + convertMPFile(gridBuilder, rotationOfCity, originOfCityXY, measureVeloProfilesOnly, maxLevel); + // Number log-Files for each MeasurePoint: numberOfMPFiles = timeStepEnd/ClockCycle + para->setclockCycleForMP(timeStepEnd); + // Number of logged Timesteps for each file + para->settimestepForMP(timeStepOut / 100); + // para->settimestepForMP(timeStepOut); + para->setmeasurePoints(inputPath + "measurePoints.dat"); + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SPtr<CudaMemoryManager> cudaMemoryManager = CudaMemoryManager::make(para); @@ -242,6 +338,35 @@ void multipleLevel(const std::string& configPath) } +void readVelocityProfile() +{ + // reads velocityProfile.txt, containing values for relative velocity (u_h) in relation to height (z). also fills + // dataZ,dataVelocity vectors + + std::ifstream inFile; + inFile.open(inputPath + "VeloProfile.txt"); + //inFile.open(inputPath + "velocityProfile.txt"); + + if (inFile.fail()) { + std::cerr << "Error opening File" << std::endl; + exit(1); + } + + int z; + real velocity; + + // read + inFile >> dataN; + for (int k = 0; k < dataN; k++) { + inFile >> z; + dataZ.push_back(z + z_offset); + + inFile >> velocity; + dataVelocity.push_back(velocity); + } + inFile.close(); +} + void addFineGrids(SPtr<MultipleGridBuilder> gridBuilder, uint &maxLevel, real &rotationOfCity) { if (setupDomain == 1) { @@ -411,6 +536,131 @@ void addFineGrids(SPtr<MultipleGridBuilder> gridBuilder, uint &maxLevel, real &r } +void convertMPFile(SPtr<MultipleGridBuilder> gridBuilder, real &phi, std::vector<real> &originXY, bool &measureVeloProfilesOnly, uint &maxLevel) +{ + // File Reader&Writer for converting MP-Coordinates to Index: MeasurePoint placement requires "measurePoints.dat" + // with name, node-ID and level. This function can read a txt-File containing the name, X-Y-Z-Coordinates and level + // of measurePoints. After reading the txt-File and converting X-Y-Z to the node-ID, it writes "measurePoints.dat". + // Justification for this function: Human Readability and no changes in measurepoint core functions + + // File Opening Procedure + std::ifstream inFile; + if (measureVeloProfilesOnly) + inFile.open(inputPath + "measurePoints_veloProfiles.txt"); + else + inFile.open(inputPath + "measurePoints.txt"); + + // Check for error + if (inFile.fail()) { + std::cerr << "Error opening File" << std::endl; + exit(1); + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Reading Procedure + std::cout << "phi in degrees:" << phi << std::endl; + phi = phi * M_PI / 180; + std::cout << "phi in radians:" << phi << std::endl; + + std::vector<std::string> MP_name; + std::vector<real> MP_X, MP_Y, MP_Z; + std::vector<int> MP_level, MP_k; + + std::string name; + real X, Y, Z; + uint level, numberOfMeasurePoints; + + inFile >> numberOfMeasurePoints; + std::cout << "numberOfMeasurePoints: " << numberOfMeasurePoints << " "; + std::cout << "Coordinates from File\n"; + for (uint k = 0; k < numberOfMeasurePoints; k++) { + inFile >> name; + MP_name.push_back(name); + std::cout << "Name: " << MP_name[k] << " "; + + inFile >> X; + MP_X.push_back(X); + std::cout << "\t\tX: " << MP_X[k] << " "; + + inFile >> Y; + MP_Y.push_back(Y); + std::cout << "\t\tY: " << MP_Y[k] << " "; + + inFile >> Z; + if (((variant > 3 && variant < 7) || (variant > 9 && variant <= 12)) && k == 14) + Z += 2.25; // account for angled roof + MP_Z.push_back(Z); + std::cout << "\t\tZ: " << MP_Z[k] + z_offset << " "; + + inFile >> level; + if (level > maxLevel) + level = maxLevel; + MP_level.push_back(level); + std::cout << "\t\tLevel: " << MP_level[k] << std::endl; + } + inFile.close(); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + real X_temp, Y_temp; + // Transformation for phi radians around centre of city for MP[1..15] + if (!phi == 0) { + std::cout << "Calculating new Coordinates for MP01 to MP15 after Rotation of " << phi * 180 / M_PI + << "degrees (+: counter-clockwise / -: clockwise)\n"; + for (uint k = 0; k < 15; k++) { + X_temp = originXY[0] + (MP_X[k] - originXY[0]) * cos(phi) - (MP_Y[k] - originXY[1]) * sin(phi); + Y_temp = originXY[1] + (MP_X[k] - originXY[0]) * sin(phi) + (MP_Y[k] - originXY[1]) * cos(phi); + std::cout << "Name: " << MP_name[k] << " "; + std::cout << "\t\tX: " << X_temp << " "; + std::cout << "\t\tY: " << Y_temp << " "; + std::cout << "\t\tZ: " << MP_Z[k] << " " << std::endl; + + MP_X[k] = X_temp; + MP_Y[k] = Y_temp; + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Coordinates to Index Procedure + // std::cout << "Converting Coordinates to Index..." << std::endl; + for (uint k = 0; k < numberOfMeasurePoints; k++) { + MP_k.push_back( + gridBuilder->getGrid(MP_level[k]) + ->getSparseIndex(gridBuilder->getGrid(MP_level[k])->transCoordToIndex(MP_X[k], MP_Y[k], MP_Z[k]))); + if (MP_k[k] == -1) { + std::cerr << "Error: Could not convert Coordinate to Sparse Index for MP " << k + 1 << std::endl; + } + std::cout << MP_name[k] << "\tID = " + << gridBuilder->getGrid(MP_level[k]) + ->getSparseIndex( + gridBuilder->getGrid(MP_level[k])->transCoordToIndex(MP_X[k], MP_Y[k], MP_Z[k])) + << std::endl; + // std::cout << "ID = " << + // gridBuilder->getGrid(0)->getSparseIndex(gridBuilder->getGrid(0)->transCoordToIndex(-0.500000, + // -0.500000, 9.500000)) << std::endl; + } + // std::cout << "Done Converting Coordinates to Index..." << std::endl; + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Writing Procedure + // std::cout << "Writing new file..." << std::endl; + std::ofstream outFile(inputPath + "measurePoints.dat"); + + outFile << numberOfMeasurePoints << std::endl; + for (uint j = 0; j < numberOfMeasurePoints; j++) { + outFile << MP_name[j] << " " << MP_k[j] << " " << MP_level[j] << std::endl; + // std::cout << MP_name[j] << "\t" << MP_k[j] << "\t" << MP_level[j] << std::endl; + } + // std::cout << "Done writing new file..." << std::endl; + outFile.close(); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +} + std::string chooseVariation() { switch (variant) { @@ -472,29 +722,16 @@ std::string chooseVariation() int main( int argc, char* argv[]) { MPI_Init(&argc, &argv); - std::string str, str2; if ( argv != NULL ) { - //str = static_cast<std::string>(argv[0]); - try { - ////////////////////////////////////////////////////////////////////////// + // assuming that the config files is stored parallel to this file. + std::filesystem::path filePath = __FILE__; + filePath.replace_filename("configDrivenCavity.txt"); - std::string targetPath; - - targetPath = __FILE__; - - targetPath = targetPath.substr(0, targetPath.find_last_of('/') + 1); - - - - std::cout << targetPath << std::endl; - - multipleLevel(targetPath + "configDrivenCavity.txt"); - - ////////////////////////////////////////////////////////////////////////// - } + multipleLevel(filePath.string()); + } catch (const std::bad_alloc& e) { *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; diff --git a/apps/gpu/LBM/WTG_RUB/configDrivenCavity.txt b/apps/gpu/LBM/WTG_RUB/configDrivenCavity.txt index a3d6622d50700e554dcf3429f0c51e07f5c83ead..f6ff6c107d239c11d8c88566795f94ada7226085 100644 --- a/apps/gpu/LBM/WTG_RUB/configDrivenCavity.txt +++ b/apps/gpu/LBM/WTG_RUB/configDrivenCavity.txt @@ -9,6 +9,7 @@ ################################################## #Path="E:/DrivenCavity/results" #Path="F:/Work/Computations/out/DrivenCavity/" +Path="/" #Prefix="DrivenCavity" #WriteGrid=true ################################################## diff --git a/docs/Doxyfile b/docs/Doxyfile index b5057d7697d0616f748d8e6652248966d41b2eb2..e8b9a328ae81177aaf587d6203ea4882e9de169e 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -996,7 +996,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = docs/img/ # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -1052,7 +1052,9 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = main.md +INPUT += docs/img/VF_logo.png +INPUT += README.md +USE_MDFILE_AS_MAINPAGE = README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing diff --git a/docs/cpu/Documentation/doc.h b/docs/cpu/Documentation/doc.h deleted file mode 100644 index 0c6c4c6c30e7bc1a8691b52fa1555f2ea3d4d16b..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doc.h +++ /dev/null @@ -1,31 +0,0 @@ -//index page for doxygen - -/*! \mainpage - * - * \section intro_sec Introduction - * <i>VirtualFluids</i> is an adaptive, parallel Lattice-Boltzmann flow solver - * which is comprised of various cores - * and use second order accurate compact interpolation at the interfaces, - * coupling grids of different resolutions. - * The software framework is based on object-oriented technology and uses tree-like data structures. - * These data structures are also suitable for hierarchical parallelization using a combination of PThreads and MPI and dynamic load balancing. - * - * \section install_sec Installation - * - * \subsection step1 Step 1: CMake - * Download and install <a href="http://www.cmake.org/">CMake</a>. - * If you have Windows OS oder X-Windows for Linux/Unix start <i>cmake-gui</i>. - * If you work in terminal start <i>ccmake</i>. - * \subsection step2 Step 2: project configuration - * You need set a path for <i>VirtualFluids</i> source code. It is allays <i>source</i> directory at the end of path. - * E.g. c:/vf/source. You need also set a path to build binaries. If you click <b>Configure</b> button start a project wizard and you can choose a compiler. - * Set <b>Grouped</b> and <b>Advanced</b> check boxes in CMake. In the group <i>USE</i> you have follow important options: - * \li USE_BOND - using an agent based communication framework for fault tolerance BOND - * \li USE_METIS - using a domain decomposition tool METIS - * \li USE_MPI - using MPI for distributed memory parallelization - * \li USE_YAML - using YAML - * \li USE_ZOLTAN - using domain decomposition tool ZOLTAN - * There are externals library and you need additionally compile them. - * \subsection step3 Step 4: project compilation - * Compile you project with suitable compiler. - */ \ No newline at end of file diff --git a/docs/cpu/Documentation/doc/install.html b/docs/cpu/Documentation/doc/install.html deleted file mode 100644 index 0c4cfd3b3a94a47d2bd7c0de756def3f6501ff1a..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doc/install.html +++ /dev/null @@ -1,18 +0,0 @@ -\section install_sec Installation - -\subsection step1 Step 1: CMake -Download and install <a href="http://www.cmake.org/">CMake</a>. -If you have Windows OS oder X-Windows for Linux/Unix start <i>cmake-gui</i>. -If you work in terminal start <i>ccmake</i>. -\subsection step2 Step 2: project configuration -You need set a path for <i>VirtualFluids</i> source code. It is allays <i>source</i> directory at the end of path. -E.g. c:/vf/source. You need also set a path to build binaries. If you click <b>Configure</b> button start a project wizard and you can choose a compiler. -Set <b>Grouped</b> and <b>Advanced</b> check boxes in CMake. In the group <i>USE</i> you have follow important options: -\li USE_BOND - using an agent based communication framework for fault tolerance BOND -\li USE_METIS - using a domain decomposition tool METIS -\li USE_MPI - using MPI for distributed memory parallelization -\li USE_YAML - using YAML -\li USE_ZOLTAN - using domain decomposition tool ZOLTAN -There are externals library and you need additionally compile them. -\subsection step3 Step 4: project compilation -Compile you project with suitable compiler. diff --git a/docs/cpu/Documentation/doc/intstall.md b/docs/cpu/Documentation/doc/intstall.md deleted file mode 100644 index 912aea1bb142486445049dd3a1ae08b151ca344f..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doc/intstall.md +++ /dev/null @@ -1,18 +0,0 @@ -# Installation {#installation} -## Step 1: CMake -Download and install [CMake](http://www.cmake.org). -If you have Windows OS oder X-Windows for Linux/Unix start *cmake-gui*. -If you work in terminal start *ccmake*. -## Step 2: project configuration -You need set a path for *VirtualFluids* source code. It is allays *source* directory at the end of path. -E.g. *c:/vf/source*. You need also set a path to build binaries. E.g. *c:/vf/bin*. If you click **Configure** button start a project wizard and you can choose a compiler. -Set **Grouped** and **Advanced** check boxes in CMake. In the group *USE* you have follow important options: -* USE_BOND - using an agent based communication framework for fault tolerance BOND -* USE_METIS - using a domain decomposition tool METIS -* USE_MPI - using MPI for distributed memory parallelization -* USE_YAML - using YAML -* USE_ZOLTAN - using domain decomposition tool ZOLTAN - -There are externals library and you need additionally compile them. -## Step 4: project compilation -Compile you project with suitable compiler \ No newline at end of file diff --git a/docs/cpu/Documentation/doc/main.md b/docs/cpu/Documentation/doc/main.md deleted file mode 100644 index 1b04aeb7f44f4c80bbe71e6f839b90850dfca222..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doc/main.md +++ /dev/null @@ -1,11 +0,0 @@ -# Introduction {#mainpage} - -## Introduction -*VirtualFluids* is an adaptive, parallel Lattice-Boltzmann flow solver -which is comprised of various cores -and use second order accurate compact interpolation at the interfaces, -coupling grids of different resolutions. -The software framework is based on object-oriented technology and uses tree-like data structures. -These data structures are also suitable for hierarchical parallelization using a combination of PThreads and MPI and dynamic load balancing. - -[Installation](md__d_1__projects__virtual_fluids_source__documentation_doc_intstall.html) diff --git a/docs/cpu/Documentation/doxygen/VF_Doxyfile.dox b/docs/cpu/Documentation/doxygen/VF_Doxyfile.dox deleted file mode 100644 index 7ac4685967b93ce3b8bcdc3969d11e27d5927799..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doxygen/VF_Doxyfile.dox +++ /dev/null @@ -1,2366 +0,0 @@ -# Doxyfile 1.8.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = VirtualFluids - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = D:/Projects/bFluid/source/doc/doxygen/logo.png - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = z:\VirtualFluids\Documentation - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if <section_label> ... \endif and \cond <section_label> -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = ../doc \ - ../../VirtualFluidsCore \ - ../../ThirdParty - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# <filter> <input-file> -# -# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = main.md - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more acurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use <access key> + S -# (what the <access key> is depends on the OS and browser, but it is typically -# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down -# key> to jump into the search results window, the results can be navigated -# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel -# the search. The filter options can be selected when the cursor is inside the -# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> -# to select a filter and <Enter> or <escape> to activate or cancel the filter -# option. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There -# are two flavours of web server based searching depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. See -# the section "External Indexing and Searching" for details. -# The default value is: NO. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SERVER_BASED_SEARCH = NO - -# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP -# script for searching. Instead the search results are written to an XML file -# which needs to be processed by an external indexer. Doxygen will invoke an -# external search engine pointed to by the SEARCHENGINE_URL option to obtain the -# search results. -# -# Doxygen ships with an example indexer ( doxyindexer) and search engine -# (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). -# -# See the section "External Indexing and Searching" for details. -# The default value is: NO. -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTERNAL_SEARCH = NO - -# The SEARCHENGINE_URL should point to a search engine hosted by a web server -# which will return the search results when EXTERNAL_SEARCH is enabled. -# -# Doxygen ships with an example indexer ( doxyindexer) and search engine -# (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SEARCHENGINE_URL = - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed -# search data is written to a file for indexing by an external tool. With the -# SEARCHDATA_FILE tag the name of this file can be specified. -# The default file is: searchdata.xml. -# This tag requires that the tag SEARCHENGINE is set to YES. - -SEARCHDATA_FILE = searchdata.xml - -# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the -# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is -# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple -# projects and redirect the results back to the right project. -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTERNAL_SEARCH_ID = - -# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen -# projects other than the one defined by this configuration file, but that are -# all added to the same external search index. Each project needs to have a -# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of -# to a relative location where the documentation can be found. The format is: -# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... -# This tag requires that the tag SEARCHENGINE is set to YES. - -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. -# The default value is: YES. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: latex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. -# -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate -# index for LaTeX. -# The default file is: makeindex. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX -# documents. This may be useful for small projects and may help to save some -# trees in general. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used by the -# printer. -# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x -# 14 inches) and executive (7.25 x 10.5 inches). -# The default value is: a4. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times -# If left blank no extra packages will be included. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. -# -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will -# replace them by respectively the title of the page, the current date and time, -# only the current date, the version number of doxygen, the project name (see -# PROJECT_NAME), or the project number (see PROJECT_NUMBER). -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. -# -# Note: Only use a user-defined footer if you know what you are doing! -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_FOOTER = - -# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the LATEX_OUTPUT output -# directory. Note that the files will be copied as-is; there are no commands or -# markers available. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_EXTRA_FILES = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is -# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will -# contain links (just like the HTML output) instead of page references. This -# makes the output suitable for online browsing using a PDF viewer. -# The default value is: YES. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -PDF_HYPERLINKS = YES - -# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a -# higher quality PDF documentation. -# The default value is: YES. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode -# command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_BATCHMODE = NO - -# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the -# index chapters (such as File Index, Compound Index, etc.) in the output. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_HIDE_INDICES = NO - -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. -# The default value is: plain. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The -# RTF output is optimized for Word 97 and may not look too pretty with other RTF -# readers/editors. -# The default value is: NO. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: rtf. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF -# documents. This may be useful for small projects and may help to save some -# trees in general. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will -# contain hyperlink fields. The RTF file will contain links (just like the HTML -# output) instead of page references. This makes the output suitable for online -# browsing using Word or some other Word compatible readers that support those -# fields. -# -# Note: WordPad (write) and others do not support links. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. -# -# See also section "Doxygen usage" for information on how to generate the -# default style sheet that doxygen normally uses. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for -# classes and files. -# The default value is: NO. - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. A directory man3 will be created inside the directory specified by -# MAN_OUTPUT. -# The default directory is: man. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to the generated -# man pages. In case the manual section does not start with a number, the number -# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is -# optional. -# The default value is: .3. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it -# will generate one additional man file for each entity documented in the real -# man page(s). These additional files only source the real man page, but without -# them the man command would be unable to find the correct page. -# The default value is: NO. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that -# captures the structure of the code including all documentation. -# The default value is: NO. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: xml. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify a XML DTD, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program -# listings (including syntax highlighting and cross-referencing information) to -# the XML output. Note that enabling this will significantly increase the size -# of the XML output. -# The default value is: YES. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files -# that can be used to generate PDF. -# The default value is: NO. - -GENERATE_DOCBOOK = NO - -# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in -# front of it. -# The default directory is: docbook. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. -# The default value is: NO. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module -# file that captures the structure of the code including all documentation. -# -# Note that this feature is still experimental and incomplete at the moment. -# The default value is: NO. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary -# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI -# output from the Perl module output. -# The default value is: NO. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely -# formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the -# size of the Perl module output will be much smaller and Perl will parse it -# just the same. -# The default value is: YES. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file are -# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful -# so different doxyrules.make files included by the same Makefile don't -# overwrite each other's variables. -# This tag requires that the tag GENERATE_PERLMOD is set to YES. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all -# C-preprocessor directives found in the sources and include files. -# The default value is: YES. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be -# performed. Macro expansion can be done in a controlled way by setting -# EXPAND_ONLY_PREDEF to YES. -# The default value is: NO. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then -# the macro expansion is limited to the macros specified with the PREDEFINED and -# EXPAND_AS_DEFINED tags. -# The default value is: NO. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES the includes files in the -# INCLUDE_PATH will be searched if a #include is found. -# The default value is: YES. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by the -# preprocessor. -# This tag requires that the tag SEARCH_INCLUDES is set to YES. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will be -# used. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that are -# defined before the preprocessor is started (similar to the -D option of e.g. -# gcc). The argument of the tag is a list of macros of the form: name or -# name=definition (no spaces). If the definition and the "=" are omitted, "=1" -# is assumed. To prevent a macro definition from being undefined via #undef or -# recursively expanded use the := operator instead of the = operator. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -PREDEFINED = VF_FETOL \ - VF_MPI \ - VF_METIS \ - VF_ZOLTAN - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this -# tag can be used to specify a list of macro names that should be expanded. The -# macro definition that is found in the sources will be used. Use the PREDEFINED -# tag if you want to use a different macro definition that overrules the -# definition found in the source code. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all refrences to function-like macros that are alone on a line, have an -# all uppercase name, and do not end with a semicolon. Such function macros are -# typically used for boiler-plate code, and will confuse the parser if not -# removed. -# The default value is: YES. -# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES tag can be used to specify one or more tag files. For each tag -# file the location of the external documentation should be added. The format of -# a tag file without this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where loc1 and loc2 can be relative or absolute paths or URLs. See the -# section "Linking to external documentation" for more information about the use -# of tag files. -# Note: Each tag file must have an unique name (where the name does NOT include -# the path). If a tag file is not located in the directory in which doxygen is -# run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create a -# tag file that is based on the input files it reads. See section "Linking to -# external documentation" for more information about the usage of tag files. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. -# The default value is: NO. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be -# listed. -# The default value is: YES. - -EXTERNAL_GROUPS = YES - -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in -# the related pages index. If set to NO, only the current project's pages will -# be listed. -# The default value is: YES. - -EXTERNAL_PAGES = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide inheritance -# and usage relations if the target is undocumented or is not a class. -# The default value is: YES. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz (see: -# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent -# Bell Labs. The other options in this section have no effect if this option is -# set to NO -# The default value is: NO. - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed -# to run in parallel. When set to 0 doxygen will base this on the number of -# processors available in the system. You can set it explicitly to a value -# larger than 0 to get control over the balance between CPU load and processing -# speed. -# Minimum value: 0, maximum value: 32, default value: 0. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_NUM_THREADS = 0 - -# When you want a differently looking font n the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTPATH = - -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a -# graph for each documented class showing the direct and indirect implementation -# dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside the -# class node. If there are many fields or methods and many nodes the graph may -# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the -# number of items for each type to make the size more manageable. Set this to 0 -# for no limit. Note that the threshold may be exceeded by 50% before the limit -# is enforced. So when you set the threshold to 10, up to 15 fields may appear, -# but if the number exceeds 15, the total amount of fields shown is limited to -# 10. -# Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -UML_LIMIT_NUM_FIELDS = 10 - -# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and -# collaboration graphs will show the relations between templates and their -# instances. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -TEMPLATE_RELATIONS = NO - -# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to -# YES then doxygen will generate a graph for each documented file showing the -# direct and indirect include dependencies of the file with other documented -# files. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -INCLUDE_GRAPH = YES - -# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are -# set to YES then doxygen will generate a graph for each documented file showing -# the direct and indirect include dependencies of the file with other documented -# files. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH tag is set to YES then doxygen will generate a call -# dependency graph for every global function or class method. -# -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller -# dependency graph for every global function or class method. -# -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical -# hierarchy of all classes instead of a textual one. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the -# dependencies a directory has on other directories in a graphical way. The -# dependency relations are determined by the #include relations between the -# files in the directories. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. -# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order -# to make the SVG files visible in IE 9+ (other browsers do not have this -# requirement). -# Possible values are: png, jpg, gif and svg. -# The default value is: png. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# -# Note that this requires a modern browser other than Internet Explorer. Tested -# and working are Firefox, Chrome, Safari, and Opera. -# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make -# the SVG files visible. Older versions of IE do not have SVG support. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -INTERACTIVE_SVG = NO - -# The DOT_PATH tag can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the \dotfile -# command). -# This tag requires that the tag HAVE_DOT is set to YES. - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the \mscfile -# command). - -MSCFILE_DIRS = - -# The DIAFILE_DIRS tag can be used to specify one or more directories that -# contain dia files that are included in the documentation (see the \diafile -# command). - -DIAFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes -# that will be shown in the graph. If the number of nodes in a graph becomes -# larger than this value, doxygen will truncate the graph, which is visualized -# by representing a node as a red box. Note that doxygen if the number of direct -# children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that -# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. -# Minimum value: 0, maximum value: 10000, default value: 50. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs -# generated by dot. A depth value of 3 means that only nodes reachable from the -# root by following a path via at most 3 edges will be shown. Nodes that lay -# further from the root node will be omitted. Note that setting this option to 1 -# or 2 may greatly reduce the computation time needed for large code bases. Also -# note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. -# Minimum value: 0, maximum value: 1000, default value: 0. -# This tag requires that the tag HAVE_DOT is set to YES. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) support -# this, this feature is disabled by default. -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page -# explaining the meaning of the various boxes and arrows in the dot generated -# graphs. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot -# files that are used to generate the various graphs. -# The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_CLEANUP = YES diff --git a/docs/cpu/Documentation/doxygen/logo.png b/docs/cpu/Documentation/doxygen/logo.png deleted file mode 100644 index 61253fbec8bf6a1617f19f8629de5ebc4f0f02e6..0000000000000000000000000000000000000000 Binary files a/docs/cpu/Documentation/doxygen/logo.png and /dev/null differ diff --git a/docs/cpu/Documentation/doxygen/start.html b/docs/cpu/Documentation/doxygen/start.html deleted file mode 100644 index 215fb59dc23071c4001359ff551109c8232b33d4..0000000000000000000000000000000000000000 --- a/docs/cpu/Documentation/doxygen/start.html +++ /dev/null @@ -1 +0,0 @@ -<meta http-equiv="refresh" content="0; URL=html/index.html"> \ No newline at end of file diff --git a/gpu.cmake b/gpu.cmake index c58bc61fef46762b6044a7d179be5b523840d388..06b8672e82e4810d375e2af294d1da758850923b 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -40,7 +40,7 @@ IF (BUILD_VF_GPU) #add_subdirectory(targets/apps/LBM/BaselMultiGPU) add_subdirectory(apps/gpu/LBM/DrivenCavity) - #add_subdirectory(apps/gpu/LBM/WTG_RUB) + add_subdirectory(apps/gpu/LBM/WTG_RUB) #add_subdirectory(apps/gpu/LBM/gridGeneratorTest) #add_subdirectory(apps/gpu/LBM/TGV_3D) #add_subdirectory(apps/gpu/LBM/TGV_3D_MultiGPU) diff --git a/src/basics/Core/Input/ConfigData/ConfigData.h b/src/basics/Core/Input/ConfigData/ConfigData.h deleted file mode 100644 index 44d50557608817bff889ba9aa4316861d8ce2bca..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigData/ConfigData.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef CONFIGDATA_H -#define CONFIGDATA_H - -#include "../../DataTypes.h" - -#include <memory> -#include <vector> - -class ConfigData -{ -public: - virtual ~ConfigData() = default; - - virtual real getViscosity() = 0; - virtual uint getNumberOfDevices() = 0; - virtual std::vector<uint> getDevices() = 0; - virtual std::string getOutputPath() = 0; - virtual std::string getPrefix() = 0; - virtual std::string getGridPath() = 0; - virtual bool getPrintOutputFiles() = 0; - virtual bool getGeometryValues() = 0; - virtual bool getCalc2ndOrderMoments() = 0; - virtual bool getCalc3rdOrderMoments() = 0; - virtual bool getCalcHighOrderMoments() = 0; - virtual bool getReadGeo() = 0; - virtual bool getCalcMedian() = 0; - virtual bool getCalcDragLift() = 0; - virtual bool getCalcCp() = 0; - virtual bool getWriteVeloASCIIfiles() = 0; - virtual bool getCalcPlaneConc() = 0; - virtual bool getConcFile() = 0; - virtual bool getStreetVelocityFile() = 0; - virtual bool getUseMeasurePoints() = 0; - virtual bool getUseWale() = 0; - virtual bool getUseInitNeq() = 0; - virtual bool getSimulatePorousMedia() = 0; - virtual uint getD3Qxx() = 0; - virtual uint getTEnd() = 0; - virtual uint getTOut() = 0; - virtual uint getTStartOut() = 0; - virtual uint getTimeCalcMedStart() = 0; - virtual uint getTimeCalcMedEnd() = 0; - virtual uint getPressInID() = 0; - virtual uint getPressOutID() = 0; - virtual uint getPressInZ() = 0; - virtual uint getPressOutZ() = 0; - virtual bool getDiffOn() = 0; - virtual uint getDiffMod() = 0; - virtual real getDiffusivity() = 0; - virtual real getTemperatureInit() = 0; - virtual real getTemperatureBC() = 0; - virtual real getVelocity() = 0; - virtual real getViscosityRatio() = 0; - virtual real getVelocityRatio() = 0; - virtual real getDensityRatio() = 0; - virtual real getPressRatio() = 0; - virtual real getRealX() = 0; - virtual real getRealY() = 0; - virtual real getFactorPressBC() = 0; - virtual std::string getGeometryFileC() = 0; - virtual std::string getGeometryFileM() = 0; - virtual std::string getGeometryFileF() = 0; - virtual uint getClockCycleForMP() = 0; - virtual uint getTimestepForMP() = 0; - virtual real getForcingX() = 0; - virtual real getForcingY() = 0; - virtual real getForcingZ() = 0; - virtual real getQuadricLimiterP() = 0; - virtual real getQuadricLimiterM() = 0; - virtual real getQuadricLimiterD() = 0; - virtual bool getCalcParticles() = 0; - virtual int getParticleBasicLevel() = 0; - virtual int getParticleInitLevel() = 0; - virtual int getNumberOfParticles() = 0; - virtual real getStartXHotWall() = 0; - virtual real getEndXHotWall() = 0; - virtual std::vector<std::string> getPossNeighborFilesX() = 0; - virtual std::vector<std::string> getPossNeighborFilesY() = 0; - virtual std::vector<std::string> getPossNeighborFilesZ() = 0; - // virtual std::vector<std::string> getPossNeighborFilesX() = 0; - // virtual std::vector<std::string> getPossNeighborFilesY() = 0; - // virtual std::vector<std::string> getPossNeighborFilesZ() = 0; - virtual int getTimeDoCheckPoint() = 0; - virtual int getTimeDoRestart() = 0; - virtual bool getDoCheckPoint() = 0; - virtual bool getDoRestart() = 0; - virtual uint getMaxLevel() = 0; - virtual std::vector<int> getGridX() = 0; - virtual std::vector<int> getGridY() = 0; - virtual std::vector<int> getGridZ() = 0; - virtual std::vector<int> getDistX() = 0; - virtual std::vector<int> getDistY() = 0; - virtual std::vector<int> getDistZ() = 0; - virtual std::vector<bool> getNeedInterface() = 0; - virtual std::string getMainKernel() = 0; - virtual bool getMultiKernelOn() = 0; - virtual std::vector<int> getMultiKernelLevel() = 0; - virtual std::vector<std::string> getMultiKernelName() = 0; - - virtual bool isViscosityInConfigFile() = 0; - virtual bool isNumberOfDevicesInConfigFile() = 0; - virtual bool isDevicesInConfigFile() = 0; - virtual bool isOutputPathInConfigFile() = 0; - virtual bool isPrefixInConfigFile() = 0; - virtual bool isGridPathInConfigFile() = 0; - virtual bool isPrintOutputFilesInConfigFile() = 0; - virtual bool isGeometryValuesInConfigFile() = 0; - virtual bool isCalc2ndOrderMomentsInConfigFile() = 0; - virtual bool isCalc3rdOrderMomentsInConfigFile() = 0; - virtual bool isCalcHighOrderMomentsInConfigFile() = 0; - virtual bool isReadGeoInConfigFile() = 0; - virtual bool isCalcMedianInConfigFile() = 0; - virtual bool isCalcDragLiftInConfigFile() = 0; - virtual bool isCalcCpInConfigFile() = 0; - virtual bool isWriteVeloASCIIfilesInConfigFile() = 0; - virtual bool isCalcPlaneConcInConfigFile() = 0; - virtual bool isConcFileInConfigFile() = 0; - virtual bool isStreetVelocityFileInConfigFile() = 0; - virtual bool isUseMeasurePointsInConfigFile() = 0; - virtual bool isUseWaleInConfigFile() = 0; - virtual bool isUseInitNeqInConfigFile() = 0; - virtual bool isSimulatePorousMediaInConfigFile() = 0; - virtual bool isD3QxxInConfigFile() = 0; - virtual bool isTEndInConfigFile() = 0; - virtual bool isTOutInConfigFile() = 0; - virtual bool isTStartOutInConfigFile() = 0; - virtual bool isTimeCalcMedStartInConfigFile() = 0; - virtual bool isTimeCalcMedEndInConfigFile() = 0; - virtual bool isPressInIDInConfigFile() = 0; - virtual bool isPressOutIDInConfigFile() = 0; - virtual bool isPressInZInConfigFile() = 0; - virtual bool isPressOutZInConfigFile() = 0; - virtual bool isDiffOnInConfigFile() = 0; - virtual bool isDiffModInConfigFile() = 0; - virtual bool isDiffusivityInConfigFile() = 0; - virtual bool isTemperatureInitInConfigFile() = 0; - virtual bool isTemperatureBCInConfigFile() = 0; - // virtual bool isViscosityInConfigFile() = 0; - virtual bool isVelocityInConfigFile() = 0; - virtual bool isViscosityRatioInConfigFile() = 0; - virtual bool isVelocityRatioInConfigFile() = 0; - virtual bool isDensityRatioInConfigFile() = 0; - virtual bool isPressRatioInConfigFile() = 0; - virtual bool isRealXInConfigFile() = 0; - virtual bool isRealYInConfigFile() = 0; - virtual bool isFactorPressBCInConfigFile() = 0; - virtual bool isGeometryFileCInConfigFile() = 0; - virtual bool isGeometryFileMInConfigFile() = 0; - virtual bool isGeometryFileFInConfigFile() = 0; - virtual bool isClockCycleForMPInConfigFile() = 0; - virtual bool isTimestepForMPInConfigFile() = 0; - virtual bool isForcingXInConfigFile() = 0; - virtual bool isForcingYInConfigFile() = 0; - virtual bool isForcingZInConfigFile() = 0; - virtual bool isQuadricLimiterPInConfigFile() = 0; - virtual bool isQuadricLimiterMInConfigFile() = 0; - virtual bool isQuadricLimiterDInConfigFile() = 0; - virtual bool isCalcParticlesInConfigFile() = 0; - virtual bool isParticleBasicLevelInConfigFile() = 0; - virtual bool isParticleInitLevelInConfigFile() = 0; - virtual bool isNumberOfParticlesInConfigFile() = 0; - virtual bool isNeighborWSBInConfigFile() = 0; - virtual bool isStartXHotWallInConfigFile() = 0; - virtual bool isEndXHotWallInConfigFile() = 0; - virtual bool isPossNeighborFilesXInConfigFile() = 0; - virtual bool isPossNeighborFilesYInConfigFile() = 0; - virtual bool isPossNeighborFilesZInConfigFile() = 0; - virtual bool isTimeDoCheckPointInConfigFile() = 0; - virtual bool isTimeDoRestartInConfigFile() = 0; - virtual bool isDoCheckPointInConfigFile() = 0; - virtual bool isDoRestartInConfigFile() = 0; - virtual bool isMaxLevelInConfigFile() = 0; - virtual bool isGridXInConfigFile() = 0; - virtual bool isGridYInConfigFile() = 0; - virtual bool isGridZInConfigFile() = 0; - virtual bool isDistXInConfigFile() = 0; - virtual bool isDistYInConfigFile() = 0; - virtual bool isDistZInConfigFile() = 0; - virtual bool isNeedInterfaceInConfigFile() = 0; - virtual bool isMainKernelInConfigFile() = 0; - virtual bool isMultiKernelOnInConfigFile() = 0; - virtual bool isMultiKernelLevelInConfigFile() = 0; - virtual bool isMultiKernelNameInConfigFile() = 0; -}; -#endif diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp b/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp deleted file mode 100644 index 0c53b32829eb989667b93fc7df156525267e930b..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigData/ConfigDataImp.cpp +++ /dev/null @@ -1,834 +0,0 @@ -#include "ConfigDataImp.h" - -std::shared_ptr<ConfigDataImp> ConfigDataImp::getNewInstance() -{ - return std::shared_ptr<ConfigDataImp>(new ConfigDataImp()); -} - -real ConfigDataImp::getViscosity() { return this->viscosity; } - -uint ConfigDataImp::getNumberOfDevices() { return this->numberOfDevices; } - -std::vector<uint> ConfigDataImp::getDevices() { return this->devices; } - -std::string ConfigDataImp::getOutputPath() { return this->outputPath; } - -std::string ConfigDataImp::getPrefix() { return this->prefix; } - -std::string ConfigDataImp::getGridPath() { return this->gridPath; } - -bool ConfigDataImp::getPrintOutputFiles() { return this->printOutputFiles; } - -bool ConfigDataImp::getGeometryValues() { return this->geometryValues; } - -bool ConfigDataImp::getCalc2ndOrderMoments() { return this->calc2ndOrderMoments; } - -bool ConfigDataImp::getCalc3rdOrderMoments() { return this->calc3rdOrderMoments; } - -bool ConfigDataImp::getCalcHighOrderMoments() { return this->calcHighOrderMoments; } - -bool ConfigDataImp::getReadGeo() { return this->readGeo; } - -bool ConfigDataImp::getCalcMedian() { return this->calcMedian; } - -bool ConfigDataImp::getCalcDragLift() { return this->calcDragLift; } - -bool ConfigDataImp::getCalcCp() { return this->calcCp; } - -bool ConfigDataImp::getWriteVeloASCIIfiles() { return this->writeVeloASCIIfiles; } - -bool ConfigDataImp::getCalcPlaneConc() { return this->calcPlaneConc; } - -bool ConfigDataImp::getConcFile() { return this->concFile; } - -bool ConfigDataImp::getStreetVelocityFile() { return this->streetVelocityFile; } - -bool ConfigDataImp::getUseMeasurePoints() { return this->useMeasurePoints; } - -bool ConfigDataImp::getUseWale() { return this->useWale; } - -bool ConfigDataImp::getUseInitNeq() { return this->useInitNeq; } - -bool ConfigDataImp::getSimulatePorousMedia() { return this->simulatePorousMedia; } - -uint ConfigDataImp::getD3Qxx() { return this->d3Qxx; } - -uint ConfigDataImp::getTEnd() { return this->tEnd; } - -uint ConfigDataImp::getTOut() { return this->tOut; } - -uint ConfigDataImp::getTStartOut() { return this->tStartOut; } - -uint ConfigDataImp::getTimeCalcMedStart() { return this->timeCalcMedStart; } - -uint ConfigDataImp::getTimeCalcMedEnd() { return this->timeCalcMedEnd; } - -uint ConfigDataImp::getPressInID() { return this->pressInID; } - -uint ConfigDataImp::getPressOutID() { return this->pressOutID; } - -uint ConfigDataImp::getPressInZ() { return this->pressInZ; } - -uint ConfigDataImp::getPressOutZ() { return this->pressOutZ; } - -bool ConfigDataImp::getDiffOn() { return this->diffOn; } - -uint ConfigDataImp::getDiffMod() { return this->diffMod; } - -real ConfigDataImp::getDiffusivity() { return this->diffusivity; } - -real ConfigDataImp::getTemperatureInit() { return this->temperatureInit; } - -real ConfigDataImp::getTemperatureBC() { return this->temperatureBC; } - -real ConfigDataImp::getVelocity() { return this->velocity; } - -real ConfigDataImp::getViscosityRatio() { return this->viscosityRatio; } - -real ConfigDataImp::getVelocityRatio() { return this->velocityRatio; } - -real ConfigDataImp::getDensityRatio() { return this->densityRatio; } - -real ConfigDataImp::getPressRatio() { return this->pressRatio; } - -real ConfigDataImp::getRealX() { return this->realX; } - -real ConfigDataImp::getRealY() { return this->realY; } - -real ConfigDataImp::getFactorPressBC() { return this->factorPressBC; } - -std::string ConfigDataImp::getGeometryFileC() { return this->geometryFileC; } - -std::string ConfigDataImp::getGeometryFileM() { return this->geometryFileM; } - -std::string ConfigDataImp::getGeometryFileF() { return this->geometryFileF; } - -uint ConfigDataImp::getClockCycleForMP() { return this->clockCycleForMP; } - -uint ConfigDataImp::getTimestepForMP() { return this->timestepForMP; } - -real ConfigDataImp::getForcingX() { return this->forcingX; } - -real ConfigDataImp::getForcingY() { return this->forcingY; } - -real ConfigDataImp::getForcingZ() { return this->forcingZ; } - -real ConfigDataImp::getQuadricLimiterP() { return this->quadricLimiterP; } - -real ConfigDataImp::getQuadricLimiterM() { return this->quadricLimiterM; } - -real ConfigDataImp::getQuadricLimiterD() { return this->quadricLimiterD; } - -bool ConfigDataImp::getCalcParticles() { return this->calcParticles; } - -int ConfigDataImp::getParticleBasicLevel() { return this->particleBasicLevel; } - -int ConfigDataImp::getParticleInitLevel() { return this->particleInitLevel; } - -int ConfigDataImp::getNumberOfParticles() { return this->numberOfParticles; } - -real ConfigDataImp::getStartXHotWall() { return this->startXHotWall; } - -real ConfigDataImp::getEndXHotWall() { return this->endXHotWall; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesX() { return this->possNeighborFilesX; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesY() { return this->possNeighborFilesY; } - -std::vector<std::string> ConfigDataImp::getPossNeighborFilesZ() { return this->possNeighborFilesZ; } - -int ConfigDataImp::getTimeDoCheckPoint() { return this->timeDoCheckPoint; } - -int ConfigDataImp::getTimeDoRestart() { return this->timeDoRestart; } - -bool ConfigDataImp::getDoCheckPoint() { return this->doCheckPoint; } - -bool ConfigDataImp::getDoRestart() { return this->doRestart; } - -uint ConfigDataImp::getMaxLevel() { return this->maxLevel; } - -std::vector<int> ConfigDataImp::getGridX() { return this->gridX; } - -std::vector<int> ConfigDataImp::getGridY() { return this->gridY; } - -std::vector<int> ConfigDataImp::getGridZ() { return this->gridZ; } - -std::vector<int> ConfigDataImp::getDistX() { return this->distX; } - -std::vector<int> ConfigDataImp::getDistY() { return this->distY; } - -std::vector<int> ConfigDataImp::getDistZ() { return this->distZ; } - -std::vector<bool> ConfigDataImp::getNeedInterface() { return this->needInterface; } - -std::string ConfigDataImp::getMainKernel() { return this->mainKernel; } - -bool ConfigDataImp::getMultiKernelOn() { return this->multiKernelOn; } - -std::vector<int> ConfigDataImp::getMultiKernelLevel() { return this->multiKernelLevel; } - -std::vector<std::string> ConfigDataImp::getMultiKernelName() { return this->multiKernelName; } - -void ConfigDataImp::setViscosity(real viscosity) -{ - this->viscosity = viscosity; - this->isViscosity = true; -} - -void ConfigDataImp::setNumberOfDevices(uint numberOfDevices) -{ - this->numberOfDevices = numberOfDevices; - this->isNumberOfDevices = true; -} - -void ConfigDataImp::setDevices(std::vector<uint> devices) -{ - this->devices = devices; - this->isDevices = true; -} - -void ConfigDataImp::setOutputPath(std::string outputPath) -{ - this->outputPath = outputPath; - this->isOutputPath = true; -} - -void ConfigDataImp::setPrefix(std::string prefix) -{ - this->prefix = prefix; - this->isPrefix = true; -} - -void ConfigDataImp::setGridPath(std::string gridPath) -{ - this->gridPath = gridPath; - this->isGridPath = true; -} - -void ConfigDataImp::setPrintOutputFiles(bool printOutputFiles) -{ - this->printOutputFiles = printOutputFiles; - this->isPrintOutputFiles = true; -} - -void ConfigDataImp::setGeometryValues(bool geometryValues) -{ - this->geometryValues = geometryValues; - this->isGeometryValues = true; -} - -void ConfigDataImp::setCalc2ndOrderMoments(bool calc2ndOrderMoments) -{ - this->calc2ndOrderMoments = calc2ndOrderMoments; - this->isCalc2ndOrderMoments = true; -} - -void ConfigDataImp::setCalc3rdOrderMoments(bool calc3rdOrderMoments) -{ - this->calc3rdOrderMoments = calc3rdOrderMoments; - this->isCalc3rdOrderMoments = true; -} - -void ConfigDataImp::setCalcHighOrderMoments(bool calcHighOrderMoments) -{ - this->calcHighOrderMoments = calcHighOrderMoments; - this->isCalcHighOrderMoments = true; -} - -void ConfigDataImp::setReadGeo(bool readGeo) -{ - this->readGeo = readGeo; - this->isReadGeo = true; -} - -void ConfigDataImp::setCalcMedian(bool calcMedian) -{ - this->calcMedian = calcMedian; - this->isCalcMedian = true; -} - -void ConfigDataImp::setCalcDragLift(bool calcDragLift) -{ - this->calcDragLift = calcDragLift; - this->isCalcDragLift = true; -} - -void ConfigDataImp::setCalcCp(bool calcCp) -{ - this->calcCp = calcCp; - this->isCalcCp = true; -} - -void ConfigDataImp::setWriteVeloASCIIfiles(bool writeVeloASCIIfiles) -{ - this->writeVeloASCIIfiles = writeVeloASCIIfiles; - this->isWriteVeloASCII = true; -} - -void ConfigDataImp::setCalcPlaneConc(bool calcPlaneConc) -{ - this->calcPlaneConc = calcPlaneConc; - this->isCalcPlaneConc = true; -} - -void ConfigDataImp::setConcFile(bool concFile) -{ - this->concFile = concFile; - this->isConcFile = true; -} - -void ConfigDataImp::setStreetVelocityFile(bool streetVelocityFile) -{ - this->streetVelocityFile = streetVelocityFile; - this->isStreetVelocityFile = true; -} - -void ConfigDataImp::setUseMeasurePoints(bool useMeasurePoints) -{ - this->useMeasurePoints = useMeasurePoints; - this->isUseMeasurePoints = true; -} - -void ConfigDataImp::setUseWale(bool useWale) -{ - this->useWale = useWale; - this->isUseWale = true; -} - -void ConfigDataImp::setUseInitNeq(bool useInitNeq) -{ - this->useInitNeq = useInitNeq; - this->isUseInitNeq = true; -} - -void ConfigDataImp::setSimulatePorousMedia(bool simulatePorousMedia) -{ - this->simulatePorousMedia = simulatePorousMedia; - this->isSimulatePorousMedia = true; -} - -void ConfigDataImp::setD3Qxx(uint d3Qxx) -{ - this->d3Qxx = d3Qxx; - this->isD3Qxx = true; -} - -void ConfigDataImp::setTEnd(uint tEnd) -{ - this->tEnd = tEnd; - this->isTEnd = true; -} - -void ConfigDataImp::setTOut(uint tOut) -{ - this->tOut = tOut; - this->isTOut = true; -} - -void ConfigDataImp::setTStartOut(uint tStartOut) -{ - this->tStartOut = tStartOut; - this->isTStartOut = true; -} - -void ConfigDataImp::setTimeCalcMedStart(uint timeCalcMedStart) -{ - this->timeCalcMedStart = timeCalcMedStart; - this->isTimeCalcMedStart = true; -} - -void ConfigDataImp::setTimeCalcMedEnd(uint timeCalcMedEnd) -{ - this->timeCalcMedEnd = timeCalcMedEnd; - this->isTimeCalcMedEnd = true; -} - -void ConfigDataImp::setPressInID(uint pressInID) -{ - this->pressInID = pressInID; - this->isPressInID = true; -} - -void ConfigDataImp::setPressOutID(uint pressOutID) -{ - this->pressOutID = pressOutID; - this->isPressOutID = true; -} - -void ConfigDataImp::setPressInZ(uint pressInZ) -{ - this->pressInZ = pressInZ; - this->isPressInZ = true; -} - -void ConfigDataImp::setPressOutZ(uint pressOutZ) -{ - this->pressOutZ = pressOutZ; - this->isPressOutZ = true; -} - -void ConfigDataImp::setDiffOn(bool diffOn) -{ - this->diffOn = diffOn; - this->isDiffOn = true; -} - -void ConfigDataImp::setDiffMod(uint diffMod) -{ - this->diffMod = diffMod; - this->isDiffMod = true; -} - -void ConfigDataImp::setDiffusivity(real diffusivity) -{ - this->diffusivity = diffusivity; - this->isDiffusivity = true; -} - -void ConfigDataImp::setTemperatureInit(real temperatureInit) -{ - this->temperatureInit = temperatureInit; - this->isTemperatureInit = true; -} - -void ConfigDataImp::setTemperatureBC(real temperatureBC) -{ - this->temperatureBC = temperatureBC; - this->isTemperatureBC = true; -} - -// void ConfigDataImp::setViscosity(real viscosity) -//{ -// this->viscosity = viscosity; -// this->isViscosity = true; -//} - -void ConfigDataImp::setVelocity(real velocity) -{ - this->velocity = velocity; - this->isVelocity = true; -} - -void ConfigDataImp::setViscosityRatio(real viscosityRatio) -{ - this->viscosityRatio = viscosityRatio; - this->isViscosityRatio = true; -} - -void ConfigDataImp::setVelocityRatio(real velocityRatio) -{ - this->velocityRatio = velocityRatio; - this->isVelocityRatio = true; -} - -void ConfigDataImp::setDensityRatio(real densityRatio) -{ - this->densityRatio = densityRatio; - this->isDensityRatio = true; -} - -void ConfigDataImp::setPressRatio(real pressRatio) -{ - this->pressRatio = pressRatio; - this->isPressRatio = true; -} - -void ConfigDataImp::setRealX(real realX) -{ - this->realX = realX; - this->isRealX = true; -} - -void ConfigDataImp::setRealY(real realY) -{ - this->realY = realY; - this->isRealY = true; -} - -void ConfigDataImp::setFactorPressBC(real factorPressBC) -{ - this->factorPressBC = factorPressBC; - this->isFactorPressBC = true; -} - -void ConfigDataImp::setGeometryFileC(std::string geometryFileC) -{ - this->geometryFileC = geometryFileC; - this->isGeometryFileC = true; -} - -void ConfigDataImp::setGeometryFileM(std::string geometryFileM) -{ - this->geometryFileM = geometryFileM; - this->isGeometryFileM = true; -} - -void ConfigDataImp::setGeometryFileF(std::string geometryFileF) -{ - this->geometryFileF = geometryFileF; - this->isGeometryFileF = true; -} - -void ConfigDataImp::setClockCycleForMP(uint clockCycleForMP) -{ - this->clockCycleForMP = clockCycleForMP; - this->isClockCycleForMP = true; -} - -void ConfigDataImp::setTimestepForMP(uint timestepForMP) -{ - this->timestepForMP = timestepForMP; - this->isTimestepForMP = true; -} - -void ConfigDataImp::setForcingX(real forcingX) -{ - this->forcingX = forcingX; - this->isForcingX = true; -} - -void ConfigDataImp::setForcingY(real forcingY) -{ - this->forcingY = forcingY; - this->isForcingY = true; -} - -void ConfigDataImp::setForcingZ(real forcingZ) -{ - this->forcingZ = forcingZ; - this->isForcingZ = true; -} - -void ConfigDataImp::setQuadricLimiterP(real quadricLimiterP) -{ - this->quadricLimiterP = quadricLimiterP; - this->isQuadricLimiterP = true; -} - -void ConfigDataImp::setQuadricLimiterM(real quadricLimiterM) -{ - this->quadricLimiterM = quadricLimiterM; - this->isQuadricLimiterM = true; -} - -void ConfigDataImp::setQuadricLimiterD(real quadricLimiterD) -{ - this->quadricLimiterD = quadricLimiterD; - this->isQuadricLimiterD = true; -} - -void ConfigDataImp::setCalcParticles(bool calcParticles) -{ - this->calcParticles = calcParticles; - this->isCalcParticles = true; -} - -void ConfigDataImp::setParticleBasicLevel(int particleBasicLevel) -{ - this->particleBasicLevel = particleBasicLevel; - this->isParticleBasicLevel = true; -} - -void ConfigDataImp::setParticleInitLevel(int particleInitLevel) -{ - this->particleInitLevel = particleInitLevel; - this->isParticleInitLevel = true; -} - -void ConfigDataImp::setNumberOfParticles(int numberOfParticles) -{ - this->numberOfParticles = numberOfParticles; - this->isNumberOfParticles = true; -} - -void ConfigDataImp::setStartXHotWall(real startXHotWall) -{ - this->startXHotWall = startXHotWall; - this->isStartXHotWall = true; -} - -void ConfigDataImp::setEndXHotWall(real endXHotWall) -{ - this->endXHotWall = endXHotWall; - this->isEndXHotWall = true; -} - -void ConfigDataImp::setPossNeighborFilesX(const std::vector<std::string> &possNeighborFilesX) -{ - this->possNeighborFilesX = possNeighborFilesX; - this->isPossNeighborFilesX = true; -} - -void ConfigDataImp::setPossNeighborFilesY(const std::vector<std::string> &possNeighborFilesY) -{ - this->possNeighborFilesY = possNeighborFilesY; - this->isPossNeighborFilesY = true; -} - -void ConfigDataImp::setPossNeighborFilesZ(const std::vector<std::string> &possNeighborFilesZ) -{ - this->possNeighborFilesZ = possNeighborFilesZ; - this->isPossNeighborFilesZ = true; -} - -void ConfigDataImp::setTimeDoCheckPoint(int timeDoCheckPoint) -{ - this->timeDoCheckPoint = timeDoCheckPoint; - this->isTimeDoCheckPoint = true; -} - -void ConfigDataImp::setTimeDoRestart(int timeDoRestart) -{ - this->timeDoRestart = timeDoRestart; - this->isTimeDoRestart = true; -} - -void ConfigDataImp::setDoCheckPoint(bool doCheckPoint) -{ - this->doCheckPoint = doCheckPoint; - this->isDoCheckPoint = true; -} - -void ConfigDataImp::setDoRestart(bool doRestart) -{ - this->doRestart = doRestart; - this->isDoRestart = true; -} - -void ConfigDataImp::setMaxLevel(uint maxLevel) -{ - this->maxLevel = maxLevel; - this->isMaxLevel = true; -} - -void ConfigDataImp::setGridX(const std::vector<int> &gridX) -{ - this->gridX = gridX; - this->isGridX = true; -} - -void ConfigDataImp::setGridY(const std::vector<int> &gridY) -{ - this->gridY = gridY; - this->isGridY = true; -} - -void ConfigDataImp::setGridZ(const std::vector<int> &gridZ) -{ - this->gridZ = gridZ; - this->isGridZ = true; -} - -void ConfigDataImp::setDistX(const std::vector<int> &distX) -{ - this->distX = distX; - this->isDistX = true; -} - -void ConfigDataImp::setDistY(const std::vector<int> &distY) -{ - this->distY = distY; - this->isDistY = true; -} - -void ConfigDataImp::setDistZ(const std::vector<int> &distZ) -{ - this->distZ = distZ; - this->isDistZ = true; -} - -void ConfigDataImp::setNeedInterface(const std::vector<bool> &needInterface) -{ - this->needInterface = needInterface; - this->isNeedInterface = true; -} - -void ConfigDataImp::setMainKernel(const std::string &mainKernel) -{ - this->mainKernel = mainKernel; - this->isMainKernel = true; -} - -void ConfigDataImp::setMultiKernelOn(bool multiKernelOn) -{ - this->multiKernelOn = multiKernelOn; - this->isMultiKernelOn = true; -} - -void ConfigDataImp::setMultiKernelLevel(const std::vector<int> &multiKernelLevel) -{ - this->multiKernelLevel = multiKernelLevel; - this->isMultiKernelLevel = true; -} - -void ConfigDataImp::setMultiKernelName(const std::vector<std::string> &multiKernelName) -{ - this->multiKernelName = multiKernelName; - this->isMultiKernelName = true; -} - -bool ConfigDataImp::isCalc2ndOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; } - -bool ConfigDataImp::isCalc3rdOrderMomentsInConfigFile() { return this->isCalc2ndOrderMoments; } - -bool ConfigDataImp::isCalcHighOrderMomentsInConfigFile() { return this->isCalcHighOrderMoments; } - -bool ConfigDataImp::isReadGeoInConfigFile() { return this->isReadGeo; } - -bool ConfigDataImp::isCalcMedianInConfigFile() { return this->isCalcMedian; } - -bool ConfigDataImp::isCalcDragLiftInConfigFile() { return this->isCalcDragLift; } - -bool ConfigDataImp::isCalcCpInConfigFile() { return this->isCalcCp; } - -bool ConfigDataImp::isWriteVeloASCIIfilesInConfigFile() { return this->isWriteVeloASCII; } - -bool ConfigDataImp::isCalcPlaneConcInConfigFile() { return this->isCalcPlaneConc; } - -bool ConfigDataImp::isConcFileInConfigFile() { return this->isConcFile; } - -bool ConfigDataImp::isStreetVelocityFileInConfigFile() { return this->isStreetVelocityFile; } - -bool ConfigDataImp::isUseMeasurePointsInConfigFile() { return this->isUseMeasurePoints; } - -bool ConfigDataImp::isUseWaleInConfigFile() { return this->isUseWale; } - -bool ConfigDataImp::isUseInitNeqInConfigFile() { return this->isUseInitNeq; } - -bool ConfigDataImp::isSimulatePorousMediaInConfigFile() { return this->isSimulatePorousMedia; } - -bool ConfigDataImp::isD3QxxInConfigFile() { return this->isD3Qxx; } - -bool ConfigDataImp::isTEndInConfigFile() { return this->isTEnd; } - -bool ConfigDataImp::isTOutInConfigFile() { return this->isTOut; } - -bool ConfigDataImp::isTStartOutInConfigFile() { return this->isTStartOut; } - -bool ConfigDataImp::isTimeCalcMedStartInConfigFile() { return this->isTimeCalcMedStart; } - -bool ConfigDataImp::isTimeCalcMedEndInConfigFile() { return this->isTimeCalcMedEnd; } - -bool ConfigDataImp::isPressInIDInConfigFile() { return this->isPressInID; } - -bool ConfigDataImp::isPressOutIDInConfigFile() { return this->isPressOutID; } - -bool ConfigDataImp::isPressInZInConfigFile() { return this->isPressInZ; } - -bool ConfigDataImp::isPressOutZInConfigFile() { return this->isPressOutZ; } - -bool ConfigDataImp::isDiffOnInConfigFile() { return this->isDiffOn; } - -bool ConfigDataImp::isDiffModInConfigFile() { return this->isDiffMod; } - -bool ConfigDataImp::isDiffusivityInConfigFile() { return this->isDiffusivity; } - -bool ConfigDataImp::isTemperatureInitInConfigFile() { return this->isTemperatureInit; } - -bool ConfigDataImp::isTemperatureBCInConfigFile() { return this->isTemperatureBC; } - -bool ConfigDataImp::isViscosityInConfigFile() { return this->isViscosity; } - -bool ConfigDataImp::isNumberOfDevicesInConfigFile() { return this->isNumberOfDevices; } - -bool ConfigDataImp::isDevicesInConfigFile() { return this->isDevices; } - -bool ConfigDataImp::isOutputPathInConfigFile() { return this->isOutputPath; } - -bool ConfigDataImp::isPrefixInConfigFile() { return this->isPrefix; } - -bool ConfigDataImp::isGridPathInConfigFile() { return this->isGridPath; } - -bool ConfigDataImp::isPrintOutputFilesInConfigFile() { return this->isPrintOutputFiles; } - -bool ConfigDataImp::isGeometryValuesInConfigFile() { return this->isGeometryValues; } - -bool ConfigDataImp::isVelocityInConfigFile() { return this->isVelocity; } - -bool ConfigDataImp::isViscosityRatioInConfigFile() { return this->isViscosityRatio; } - -bool ConfigDataImp::isVelocityRatioInConfigFile() { return this->isVelocityRatio; } - -bool ConfigDataImp::isDensityRatioInConfigFile() { return this->isDensityRatio; } - -bool ConfigDataImp::isPressRatioInConfigFile() { return this->isPressRatio; } - -bool ConfigDataImp::isRealXInConfigFile() { return this->isRealX; } - -bool ConfigDataImp::isRealYInConfigFile() { return this->isRealY; } - -bool ConfigDataImp::isFactorPressBCInConfigFile() { return this->isFactorPressBC; } - -bool ConfigDataImp::isGeometryFileCInConfigFile() { return this->isGeometryFileC; } - -bool ConfigDataImp::isGeometryFileMInConfigFile() { return this->isGeometryFileM; } - -bool ConfigDataImp::isGeometryFileFInConfigFile() { return this->isGeometryFileF; } - -bool ConfigDataImp::isClockCycleForMPInConfigFile() { return this->isClockCycleForMP; } - -bool ConfigDataImp::isTimestepForMPInConfigFile() { return this->isTimestepForMP; } - -bool ConfigDataImp::isForcingXInConfigFile() { return this->isForcingX; } - -bool ConfigDataImp::isForcingYInConfigFile() { return this->isForcingY; } - -bool ConfigDataImp::isForcingZInConfigFile() { return this->isForcingZ; } - -bool ConfigDataImp::isQuadricLimiterPInConfigFile() { return this->isQuadricLimiterP; } - -bool ConfigDataImp::isQuadricLimiterMInConfigFile() { return this->isQuadricLimiterM; } - -bool ConfigDataImp::isQuadricLimiterDInConfigFile() { return this->isQuadricLimiterD; } - -bool ConfigDataImp::isCalcParticlesInConfigFile() { return this->isCalcParticles; } - -bool ConfigDataImp::isParticleBasicLevelInConfigFile() { return this->isParticleBasicLevel; } - -bool ConfigDataImp::isParticleInitLevelInConfigFile() { return this->isParticleInitLevel; } - -bool ConfigDataImp::isNumberOfParticlesInConfigFile() { return this->isNumberOfParticles; } - -bool ConfigDataImp::isNeighborWSBInConfigFile() { return this->isNeighborWSB; } - -bool ConfigDataImp::isStartXHotWallInConfigFile() { return this->isStartXHotWall; } - -bool ConfigDataImp::isEndXHotWallInConfigFile() { return this->isEndXHotWall; } - -bool ConfigDataImp::isPossNeighborFilesXInConfigFile() { return this->isPossNeighborFilesX; } - -bool ConfigDataImp::isPossNeighborFilesYInConfigFile() { return this->isPossNeighborFilesY; } - -bool ConfigDataImp::isPossNeighborFilesZInConfigFile() { return this->isPossNeighborFilesZ; } - -bool ConfigDataImp::isTimeDoCheckPointInConfigFile() { return this->isTimeDoCheckPoint; } - -bool ConfigDataImp::isTimeDoRestartInConfigFile() { return this->isTimeDoCheckPoint; } - -bool ConfigDataImp::isDoCheckPointInConfigFile() { return this->isDoCheckPoint; } - -bool ConfigDataImp::isDoRestartInConfigFile() { return this->isDoRestart; } - -bool ConfigDataImp::isMaxLevelInConfigFile() { return this->isMaxLevel; } - -bool ConfigDataImp::isGridXInConfigFile() { return this->isGridX; } - -bool ConfigDataImp::isGridYInConfigFile() { return this->isGridY; } - -bool ConfigDataImp::isGridZInConfigFile() { return this->isGridZ; } - -bool ConfigDataImp::isDistXInConfigFile() { return this->isDistX; } - -bool ConfigDataImp::isDistYInConfigFile() { return this->isDistY; } - -bool ConfigDataImp::isDistZInConfigFile() { return this->isDistZ; } - -bool ConfigDataImp::isNeedInterfaceInConfigFile() { return this->isNeedInterface; } - -bool ConfigDataImp::isMainKernelInConfigFile() { return this->isMainKernel; } - -bool ConfigDataImp::isMultiKernelOnInConfigFile() { return this->isMultiKernelOn; } - -bool ConfigDataImp::isMultiKernelLevelInConfigFile() { return this->isMultiKernelLevel; } - -bool ConfigDataImp::isMultiKernelNameInConfigFile() { return this->isMultiKernelName; } diff --git a/src/basics/Core/Input/ConfigData/ConfigDataImp.h b/src/basics/Core/Input/ConfigData/ConfigDataImp.h deleted file mode 100644 index 511ac4be166c7e43885209f144f0cdac6821c6f1..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigData/ConfigDataImp.h +++ /dev/null @@ -1,447 +0,0 @@ -#ifndef CONFIGDATAIMP_H -#define CONFIGDATAIMP_H - -#include "ConfigData.h" - -#include <memory> -#include <string> - -class ConfigDataImp : public ConfigData -{ -public: - static std::shared_ptr<ConfigDataImp> getNewInstance(); - - real getViscosity() override; - uint getNumberOfDevices() override; - std::vector<uint> getDevices() override; - std::string getOutputPath() override; - std::string getPrefix() override; - std::string getGridPath() override; - bool getPrintOutputFiles() override; - bool getGeometryValues() override; - bool getCalc2ndOrderMoments() override; - bool getCalc3rdOrderMoments() override; - bool getCalcHighOrderMoments() override; - bool getReadGeo() override; - bool getCalcMedian() override; - bool getCalcDragLift() override; - bool getCalcCp() override; - bool getWriteVeloASCIIfiles() override; - bool getCalcPlaneConc() override; - bool getConcFile() override; - bool getStreetVelocityFile() override; - bool getUseMeasurePoints() override; - bool getUseWale() override; - bool getUseInitNeq() override; - bool getSimulatePorousMedia() override; - uint getD3Qxx() override; - uint getTEnd() override; - uint getTOut() override; - uint getTStartOut() override; - uint getTimeCalcMedStart() override; - uint getTimeCalcMedEnd() override; - uint getPressInID() override; - uint getPressOutID() override; - uint getPressInZ() override; - uint getPressOutZ() override; - bool getDiffOn() override; - uint getDiffMod() override; - real getDiffusivity() override; - real getTemperatureInit() override; - real getTemperatureBC() override; - real getVelocity() override; - real getViscosityRatio() override; - real getVelocityRatio() override; - real getDensityRatio() override; - real getPressRatio() override; - real getRealX() override; - real getRealY() override; - real getFactorPressBC() override; - std::string getGeometryFileC() override; - std::string getGeometryFileM() override; - std::string getGeometryFileF() override; - uint getClockCycleForMP() override; - uint getTimestepForMP() override; - real getForcingX() override; - real getForcingY() override; - real getForcingZ() override; - real getQuadricLimiterP() override; - real getQuadricLimiterM() override; - real getQuadricLimiterD() override; - bool getCalcParticles() override; - int getParticleBasicLevel() override; - int getParticleInitLevel() override; - int getNumberOfParticles() override; - real getStartXHotWall() override; - real getEndXHotWall() override; - std::vector<std::string> getPossNeighborFilesX() override; - std::vector<std::string> getPossNeighborFilesY() override; - std::vector<std::string> getPossNeighborFilesZ() override; - // std::vector<std::string> getPossNeighborFilesX(); - // std::vector<std::string> getPossNeighborFilesY(); - // std::vector<std::string> getPossNeighborFilesZ(); - int getTimeDoCheckPoint() override; - int getTimeDoRestart() override; - bool getDoCheckPoint() override; - bool getDoRestart() override; - uint getMaxLevel() override; - std::vector<int> getGridX() override; - std::vector<int> getGridY() override; - std::vector<int> getGridZ() override; - std::vector<int> getDistX() override; - std::vector<int> getDistY() override; - std::vector<int> getDistZ() override; - std::vector<bool> getNeedInterface() override; - std::string getMainKernel() override; - bool getMultiKernelOn() override; - std::vector<int> getMultiKernelLevel() override; - std::vector<std::string> getMultiKernelName() override; - - void setViscosity(real viscosity); - void setNumberOfDevices(uint numberOfDevices); - void setDevices(std::vector<uint> devices); - void setOutputPath(std::string outputPath); - void setPrefix(std::string prefix); - void setGridPath(std::string gridPath); - void setPrintOutputFiles(bool printOutputFiles); - void setGeometryValues(bool geometryValues); - void setCalc2ndOrderMoments(bool calc2ndOrderMoments); - void setCalc3rdOrderMoments(bool calc3rdOrderMoments); - void setCalcHighOrderMoments(bool calcHighOrderMoment); - void setReadGeo(bool readGeo); - void setCalcMedian(bool calcMedian); - void setCalcDragLift(bool calcDragLift); - void setCalcCp(bool calcCp); - void setWriteVeloASCIIfiles(bool writeVeloASCIIfiles); - void setCalcPlaneConc(bool calcPlaneConc); - void setConcFile(bool concFile); - void setStreetVelocityFile(bool streetVelocityFile); - void setUseMeasurePoints(bool useMeasurePoints); - void setUseWale(bool useWale); - void setUseInitNeq(bool useInitNeq); - void setSimulatePorousMedia(bool simulatePorousMedia); - void setD3Qxx(uint d3Qxx); - void setTEnd(uint tEnd); - void setTOut(uint tOut); - void setTStartOut(uint tStartOut); - void setTimeCalcMedStart(uint timeCalcMedStart); - void setTimeCalcMedEnd(uint timeCalcMedEnd); - void setPressInID(uint pressInID); - void setPressOutID(uint pressOutID); - void setPressInZ(uint pressInZ); - void setPressOutZ(uint pressOutZ); - void setDiffOn(bool diffOn); - void setDiffMod(uint diffMod); - void setDiffusivity(real diffusivity); - void setTemperatureInit(real temperatureInit); - void setTemperatureBC(real temperatureBC); - // void setViscosity(real viscosity); - void setVelocity(real velocity); - void setViscosityRatio(real viscosityRatio); - void setVelocityRatio(real velocityRatio); - void setDensityRatio(real fensityRatio); - void setPressRatio(real pressRatio); - void setRealX(real realX); - void setRealY(real realY); - void setFactorPressBC(real factorPressBC); - void setGeometryFileC(std::string geometryFileC); - void setGeometryFileM(std::string geometryFileM); - void setGeometryFileF(std::string geometryFileF); - void setClockCycleForMP(uint clockCycleForMP); - void setTimestepForMP(uint timestepForMP); - void setForcingX(real forcingX); - void setForcingY(real forcingY); - void setForcingZ(real forcingZ); - void setQuadricLimiterP(real quadricLimiterP); - void setQuadricLimiterM(real quadricLimiterM); - void setQuadricLimiterD(real quadricLimiterD); - void setCalcParticles(bool calcParticles); - void setParticleBasicLevel(int particleBasicLevel); - void setParticleInitLevel(int particleInitLevel); - void setNumberOfParticles(int numberOfParticles); - void setStartXHotWall(real startXHotWall); - void setEndXHotWall(real endXHotWall); - void setPossNeighborFilesX(const std::vector<std::string> &possNeighborFilesX); - void setPossNeighborFilesY(const std::vector<std::string> &possNeighborFilesY); - void setPossNeighborFilesZ(const std::vector<std::string> &possNeighborFilesZ); - // void setPossNeighborFilesX(std::vector<std::string> possNeighborFilesX); - // void setPossNeighborFilesY(std::vector<std::string> possNeighborFilesY); - // void setPossNeighborFilesZ(std::vector<std::string> possNeighborFilesZ); - void setTimeDoCheckPoint(int timeDoCheckPoint); - void setTimeDoRestart(int timeDoRestart); - void setDoCheckPoint(bool doCheckPoint); - void setDoRestart(bool doRestart); - void setMaxLevel(uint maxLevel); - void setGridX(const std::vector<int> &gridX); - void setGridY(const std::vector<int> &gridY); - void setGridZ(const std::vector<int> &gridZ); - void setDistX(const std::vector<int> &distX); - void setDistY(const std::vector<int> &distY); - void setDistZ(const std::vector<int> &distZ); - void setNeedInterface(const std::vector<bool> &needInterface); - void setMainKernel(const std::string &mainKernel); - void setMultiKernelOn(bool multiKernelOn); - void setMultiKernelLevel(const std::vector<int> &multiKernelLevel); - void setMultiKernelName(const std::vector<std::string> &multiKernelName); - - bool isViscosityInConfigFile() override; - bool isNumberOfDevicesInConfigFile() override; - bool isDevicesInConfigFile() override; - bool isOutputPathInConfigFile() override; - bool isPrefixInConfigFile() override; - bool isGridPathInConfigFile() override; - bool isPrintOutputFilesInConfigFile() override; - bool isGeometryValuesInConfigFile() override; - bool isCalc2ndOrderMomentsInConfigFile() override; - bool isCalc3rdOrderMomentsInConfigFile() override; - bool isCalcHighOrderMomentsInConfigFile() override; - bool isReadGeoInConfigFile() override; - bool isCalcMedianInConfigFile() override; - bool isCalcDragLiftInConfigFile() override; - bool isCalcCpInConfigFile() override; - bool isWriteVeloASCIIfilesInConfigFile() override; - bool isCalcPlaneConcInConfigFile() override; - bool isConcFileInConfigFile() override; - bool isStreetVelocityFileInConfigFile() override; - bool isUseMeasurePointsInConfigFile() override; - bool isUseWaleInConfigFile() override; - bool isUseInitNeqInConfigFile() override; - bool isSimulatePorousMediaInConfigFile() override; - bool isD3QxxInConfigFile() override; - bool isTEndInConfigFile() override; - bool isTOutInConfigFile() override; - bool isTStartOutInConfigFile() override; - bool isTimeCalcMedStartInConfigFile() override; - bool isTimeCalcMedEndInConfigFile() override; - bool isPressInIDInConfigFile() override; - bool isPressOutIDInConfigFile() override; - bool isPressInZInConfigFile() override; - bool isPressOutZInConfigFile() override; - bool isDiffOnInConfigFile() override; - bool isDiffModInConfigFile() override; - bool isDiffusivityInConfigFile() override; - bool isTemperatureInitInConfigFile() override; - bool isTemperatureBCInConfigFile() override; - // bool isViscosityInConfigFile(); - bool isVelocityInConfigFile() override; - bool isViscosityRatioInConfigFile() override; - bool isVelocityRatioInConfigFile() override; - bool isDensityRatioInConfigFile() override; - bool isPressRatioInConfigFile() override; - bool isRealXInConfigFile() override; - bool isRealYInConfigFile() override; - bool isFactorPressBCInConfigFile() override; - bool isGeometryFileCInConfigFile() override; - bool isGeometryFileMInConfigFile() override; - bool isGeometryFileFInConfigFile() override; - bool isClockCycleForMPInConfigFile() override; - bool isTimestepForMPInConfigFile() override; - bool isForcingXInConfigFile() override; - bool isForcingYInConfigFile() override; - bool isForcingZInConfigFile() override; - bool isQuadricLimiterPInConfigFile() override; - bool isQuadricLimiterMInConfigFile() override; - bool isQuadricLimiterDInConfigFile() override; - bool isCalcParticlesInConfigFile() override; - bool isParticleBasicLevelInConfigFile() override; - bool isParticleInitLevelInConfigFile() override; - bool isNumberOfParticlesInConfigFile() override; - bool isNeighborWSBInConfigFile() override; - bool isStartXHotWallInConfigFile() override; - bool isEndXHotWallInConfigFile() override; - bool isPossNeighborFilesXInConfigFile() override; - bool isPossNeighborFilesYInConfigFile() override; - bool isPossNeighborFilesZInConfigFile() override; - bool isTimeDoCheckPointInConfigFile() override; - bool isTimeDoRestartInConfigFile() override; - bool isDoCheckPointInConfigFile() override; - bool isDoRestartInConfigFile() override; - bool isMaxLevelInConfigFile() override; - bool isGridXInConfigFile() override; - bool isGridYInConfigFile() override; - bool isGridZInConfigFile() override; - bool isDistXInConfigFile() override; - bool isDistYInConfigFile() override; - bool isDistZInConfigFile() override; - bool isNeedInterfaceInConfigFile() override; - bool isMainKernelInConfigFile() override; - bool isMultiKernelOnInConfigFile() override; - bool isMultiKernelLevelInConfigFile() override; - bool isMultiKernelNameInConfigFile() override; - -private: - ConfigDataImp() = default; - - real viscosity { 0. }; - uint numberOfDevices { 0 }; - std::vector<uint> devices; - std::string outputPath; - std::string prefix; - std::string gridPath; - bool printOutputFiles { false }; - bool geometryValues { false }; - bool calc2ndOrderMoments { false }; - bool calc3rdOrderMoments { false }; - bool calcHighOrderMoments { false }; - bool readGeo { false }; - bool calcMedian { false }; - bool calcDragLift { false }; - bool calcCp { false }; - bool writeVeloASCIIfiles { false }; - bool calcPlaneConc { false }; - bool concFile { false }; - bool streetVelocityFile { false }; - bool useMeasurePoints { false }; - bool useWale { false }; - bool useInitNeq { false }; - bool simulatePorousMedia { false }; - uint d3Qxx { 0 }; - uint tEnd { 0 }; - uint tOut { 0 }; - uint tStartOut { 0 }; - uint timeCalcMedStart { 0 }; - uint timeCalcMedEnd { 0 }; - uint pressInID { 0 }; - uint pressOutID { 0 }; - uint pressInZ { 0 }; - uint pressOutZ { 0 }; - bool diffOn { false }; - uint diffMod { 0 }; - real diffusivity { 0. }; - real temperatureInit { 0. }; - real temperatureBC { 0. }; - // real viscosity { 0 }; - real velocity { 0. }; - real viscosityRatio { 0. }; - real velocityRatio { 0. }; - real densityRatio { 0. }; - real pressRatio { 0. }; - real realX { 0. }; - real realY { 0. }; - real factorPressBC { 0. }; - std::string geometryFileC; - std::string geometryFileM; - std::string geometryFileF; - uint clockCycleForMP { 0 }; - uint timestepForMP { 0 }; - real forcingX { 0. }; - real forcingY { 0. }; - real forcingZ { 0. }; - real quadricLimiterP { 0. }; - real quadricLimiterM { 0. }; - real quadricLimiterD { 0. }; - bool calcParticles { false }; - int particleBasicLevel { 0 }; - int particleInitLevel { 0 }; - int numberOfParticles { 0 }; - real startXHotWall { 0. }; - real endXHotWall { 0. }; - std::vector<std::string> possNeighborFilesX; - std::vector<std::string> possNeighborFilesY; - std::vector<std::string> possNeighborFilesZ; - // std::vector<std::string> possNeighborFilesX; - // std::vector<std::string> possNeighborFilesY; - // std::vector<std::string> possNeighborFilesZ; - int timeDoCheckPoint { 0 }; - int timeDoRestart { 0 }; - bool doCheckPoint{ false }; - bool doRestart{ false }; - int maxLevel { 0 }; - std::vector<int> gridX; - std::vector<int> gridY; - std::vector<int> gridZ; - std::vector<int> distX; - std::vector<int> distY; - std::vector<int> distZ; - std::vector<bool> needInterface; - std::string mainKernel; - bool multiKernelOn{ false }; - std::vector<int> multiKernelLevel; - std::vector<std::string> multiKernelName; - - bool isViscosity { false }; - bool isNumberOfDevices {false}; - bool isDevices { false }; - bool isOutputPath { false }; - bool isPrefix { false }; - bool isGridPath { false }; - bool isPrintOutputFiles { false }; - bool isGeometryValues { false }; - bool isCalc2ndOrderMoments { false }; - bool isCalc3rdOrderMoments { false }; - bool isCalcHighOrderMoments { false }; - bool isReadGeo { false }; - bool isCalcMedian { false }; - bool isCalcDragLift { false }; - bool isCalcCp { false }; - bool isWriteVeloASCII { false }; - bool isCalcPlaneConc { false }; - bool isConcFile { false }; - bool isStreetVelocityFile { false }; - bool isUseMeasurePoints { false }; - bool isUseWale { false }; - bool isUseInitNeq { false }; - bool isSimulatePorousMedia { false }; - bool isD3Qxx { false }; - bool isTEnd { false }; - bool isTOut { false }; - bool isTStartOut { false }; - bool isTimeCalcMedStart { false }; - bool isTimeCalcMedEnd { false }; - bool isPressInID { false }; - bool isPressOutID { false }; - bool isPressInZ { false }; - bool isPressOutZ { false }; - bool isDiffOn { false }; - bool isDiffMod { false }; - bool isDiffusivity { false }; - bool isTemperatureInit { false }; - bool isTemperatureBC { false }; - // bool isViscosity { false }; - bool isVelocity { false }; - bool isViscosityRatio { false }; - bool isVelocityRatio { false }; - bool isDensityRatio { false }; - bool isPressRatio { false }; - bool isRealX { false }; - bool isRealY { false }; - bool isFactorPressBC { false }; - bool isGeometryFileC { false }; - bool isGeometryFileM { false }; - bool isGeometryFileF { false }; - bool isClockCycleForMP { false }; - bool isTimestepForMP { false }; - bool isForcingX { false }; - bool isForcingY { false }; - bool isForcingZ { false }; - bool isQuadricLimiterP { false }; - bool isQuadricLimiterM { false }; - bool isQuadricLimiterD { false }; - bool isCalcParticles { false }; - bool isParticleBasicLevel { false }; - bool isParticleInitLevel { false }; - bool isNumberOfParticles { false }; - bool isNeighborWSB { false }; - bool isStartXHotWall { false }; - bool isEndXHotWall { false }; - bool isPossNeighborFilesX { false }; - bool isPossNeighborFilesY { false }; - bool isPossNeighborFilesZ { false }; - bool isTimeDoCheckPoint { false }; - bool isTimeDoRestart { false }; - bool isDoCheckPoint { false }; - bool isDoRestart { false }; - bool isMaxLevel { false }; - bool isGridX { false }; - bool isGridY { false }; - bool isGridZ { false }; - bool isDistX { false }; - bool isDistY { false }; - bool isDistZ { false }; - bool isNeedInterface { false }; - bool isMainKernel { false }; - bool isMultiKernelOn { false }; - bool isMultiKernelLevel { false }; - bool isMultiKernelName { false }; -}; -#endif diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp deleted file mode 100644 index 8fdb9fe1bc7f5dfe10dbfb522a87a4a3187dd60b..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.cpp +++ /dev/null @@ -1,262 +0,0 @@ -#include "ConfigFileReader.h" -#include "../../StringUtilities/StringUtil.h" -#include "../ConfigData/ConfigDataImp.h" -#include "../Input.h" - -#include <fstream> -#include <iostream> - -std::shared_ptr<ConfigFileReader> ConfigFileReader::getNewInstance() -{ - return std::shared_ptr<ConfigFileReader>(new ConfigFileReader()); -} - -std::shared_ptr<ConfigData> ConfigFileReader::readConfigFile(const char* filePath) const -{ - std::cout << filePath << std::endl; - std::shared_ptr<ConfigDataImp> data = ConfigDataImp::getNewInstance(); - std::ifstream stream; - stream.open(filePath, std::ios::in); - if (stream.fail()) - throw std::runtime_error("can not open config file!"); - std::unique_ptr<input::Input> input = input::Input::makeInput(stream, "config"); - - if (input->getValue("NumberOfDevices") != "") - data->setNumberOfDevices(StringUtil::toInt(input->getValue("NumberOfDevices"))); - - if (input->getValue("Devices") != "") - data->setDevices(StringUtil::toUintVector(input->getValue("Devices"))); - - if (input->getValue("Path") != "") - data->setOutputPath(input->getValue("Path")); - - if (input->getValue("Prefix") != "") - data->setPrefix(input->getValue("Prefix")); - - if (input->getValue("GridPath") != "") - data->setGridPath(input->getValue("GridPath")); - else { - std::cout << "GridPath has to be defined!" << std::endl; - exit(1); - } - - if (input->getValue("WriteGrid") != "") - data->setPrintOutputFiles(StringUtil::toBool(input->getValue("WriteGrid"))); - - if (input->getValue("GeometryValues") != "") - data->setGeometryValues(StringUtil::toBool(input->getValue("GeometryValues"))); - - if (input->getValue("calc2ndOrderMoments") != "") - data->setCalc2ndOrderMoments(StringUtil::toBool(input->getValue("calc2ndOrderMoments"))); - - if (input->getValue("calc3rdOrderMoments") != "") - data->setCalc3rdOrderMoments(StringUtil::toBool(input->getValue("calc3rdOrderMoments"))); - - if (input->getValue("calcHigherOrderMoments") != "") - data->setCalcHighOrderMoments(StringUtil::toBool(input->getValue("calcHigherOrderMoments"))); - - if (input->getValue("ReadGeometry") != "") - data->setReadGeo(StringUtil::toBool(input->getValue("ReadGeometry"))); - - if (input->getValue("calcMedian") != "") - data->setCalcMedian(StringUtil::toBool(input->getValue("calcMedian"))); - - if (input->getValue("UseConcFile") != "") - data->setConcFile(StringUtil::toBool(input->getValue("UseConcFile"))); - - if (input->getValue("UseStreetVelocityFile") != "") - data->setStreetVelocityFile(StringUtil::toBool(input->getValue("UseStreetVelocityFile"))); - - if (input->getValue("UseMeasurePoints") != "") - data->setUseMeasurePoints(StringUtil::toBool(input->getValue("UseMeasurePoints"))); - - if (input->getValue("UseWale") != "") - data->setUseWale(StringUtil::toBool(input->getValue("UseWale"))); - - if (input->getValue("UseInitNeq") != "") - data->setUseInitNeq(StringUtil::toBool(input->getValue("UseInitNeq"))); - - if (input->getValue("SimulatePorousMedia") != "") - data->setSimulatePorousMedia(StringUtil::toBool(input->getValue("SimulatePorousMedia"))); - - if (input->getValue("D3Qxx") != "") - data->setD3Qxx(StringUtil::toInt(input->getValue("D3Qxx"))); - - if (input->getValue("TimeEnd") != "") - data->setTEnd(StringUtil::toInt(input->getValue("TimeEnd"))); - - if (input->getValue("TimeOut") != "") - data->setTOut(StringUtil::toInt(input->getValue("TimeOut"))); - - if (input->getValue("TimeStartOut") != "") - data->setTStartOut(StringUtil::toInt(input->getValue("TimeStartOut"))); - - if (input->getValue("TimeStartCalcMedian") != "") - data->setTimeCalcMedStart(StringUtil::toInt(input->getValue("TimeStartCalcMedian"))); - - if (input->getValue("TimeEndCalcMedian") != "") - data->setTimeCalcMedEnd(StringUtil::toInt(input->getValue("TimeEndCalcMedian"))); - - if (input->getValue("PressInID") != "") - data->setPressInID(StringUtil::toInt(input->getValue("PressInID"))); - - if (input->getValue("PressOutID") != "") - data->setPressOutID(StringUtil::toInt(input->getValue("PressOutID"))); - - if (input->getValue("PressInZ") != "") - data->setPressInZ(StringUtil::toInt(input->getValue("PressInZ"))); - - if (input->getValue("PressOutZ") != "") - data->setPressOutZ(StringUtil::toInt(input->getValue("PressOutZ"))); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("DiffOn") != "") - data->setDiffOn(StringUtil::toBool(input->getValue("DiffOn"))); - - if (input->getValue("DiffMod") != "") - data->setDiffMod(StringUtil::toInt(input->getValue("DiffMod"))); - - if (input->getValue("Diffusivity") != "") - data->setDiffusivity(StringUtil::toFloat(input->getValue("Diffusivity"))); - - if (input->getValue("Temp") != "") - data->setTemperatureInit(StringUtil::toFloat(input->getValue("Temp"))); - - if (input->getValue("TempBC") != "") - data->setTemperatureBC(StringUtil::toFloat(input->getValue("TempBC"))); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("Viscosity_LB") != "") - data->setViscosity(StringUtil::toFloat(input->getValue("Viscosity_LB"))); - - if (input->getValue("Velocity_LB") != "") - data->setVelocity(StringUtil::toFloat(input->getValue("Velocity_LB"))); - - if (input->getValue("Viscosity_Ratio_World_to_LB") != "") - data->setViscosityRatio(StringUtil::toFloat(input->getValue("Viscosity_Ratio_World_to_LB"))); - - if (input->getValue("Velocity_Ratio_World_to_LB") != "") - data->setVelocityRatio(StringUtil::toFloat(input->getValue("Velocity_Ratio_World_to_LB"))); - - if (input->getValue("Density_Ratio_World_to_LB") != "") - data->setDensityRatio(StringUtil::toFloat(input->getValue("Density_Ratio_World_to_LB"))); - - if (input->getValue("Delta_Press") != "") - data->setPressRatio(StringUtil::toFloat(input->getValue("Delta_Press"))); - - if (input->getValue("SliceRealX") != "") - data->setRealX(StringUtil::toFloat(input->getValue("SliceRealX"))); - - if (input->getValue("SliceRealY") != "") - data->setRealY(StringUtil::toFloat(input->getValue("SliceRealY"))); - - if (input->getValue("FactorPressBC") != "") - data->setFactorPressBC(StringUtil::toFloat(input->getValue("FactorPressBC"))); - - if (input->getValue("GeometryC") != "") - data->setGeometryFileC(input->getValue("GeometryC")); - - if (input->getValue("GeometryM") != "") - data->setGeometryFileM(input->getValue("GeometryM")); - - if (input->getValue("GeometryF") != "") - data->setGeometryFileF(input->getValue("GeometryF")); - ////////////////////////////////////////////////////////////////////////// - if (input->getValue("measureClockCycle") != "") - data->setClockCycleForMP(StringUtil::toInt(input->getValue("measureClockCycle"))); - - if (input->getValue("measureTimestep") != "") - data->setTimestepForMP(StringUtil::toInt(input->getValue("measureTimestep"))); - ////////////////////////////////////////////////////////////////////////// - // Forcing - if (input->getValue("ForcingX") != "") - data->setForcingX(StringUtil::toFloat(input->getValue("ForcingX"))); - if (input->getValue("ForcingY") != "") - data->setForcingY(StringUtil::toFloat(input->getValue("ForcingY"))); - if (input->getValue("ForcingZ") != "") - data->setForcingZ(StringUtil::toFloat(input->getValue("ForcingZ"))); - ////////////////////////////////////////////////////////////////////////// - // Quadric Limiters - if (input->getValue("QuadricLimiterP") != "") - data->setQuadricLimiterP(StringUtil::toFloat(input->getValue("QuadricLimiterP"))); - if (input->getValue("QuadricLimiterM") != "") - data->setQuadricLimiterM(StringUtil::toFloat(input->getValue("QuadricLimiterM"))); - if (input->getValue("QuadricLimiterD") != "") - data->setQuadricLimiterD(StringUtil::toFloat(input->getValue("QuadricLimiterD"))); - ////////////////////////////////////////////////////////////////////////// - // Particles - if (input->getValue("calcParticles") != "") - data->setCalcParticles(StringUtil::toBool(input->getValue("calcParticles"))); - - if (input->getValue("baseLevel") != "") - data->setParticleBasicLevel(StringUtil::toInt(input->getValue("baseLevel"))); - - if (input->getValue("initLevel") != "") - data->setParticleInitLevel(StringUtil::toInt(input->getValue("initLevel"))); - - if (input->getValue("numberOfParticles") != "") - data->setNumberOfParticles(StringUtil::toInt(input->getValue("numberOfParticles"))); - - if (input->getValue("startXHotWall") != "") - data->setStartXHotWall(real(StringUtil::toDouble(input->getValue("startXHotWall")))); - - if (input->getValue("endXHotWall") != "") - data->setEndXHotWall(real(StringUtil::toDouble(input->getValue("endXHotWall")))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Restart - if (input->getValue("TimeDoCheckPoint") != "") - data->setTimeDoCheckPoint(StringUtil::toInt(input->getValue("TimeDoCheckPoint"))); - - if (input->getValue("TimeDoRestart") != "") - data->setTimeDoRestart(StringUtil::toInt(input->getValue("TimeDoRestart"))); - - if (input->getValue("DoCheckPoint") != "") - data->setDoCheckPoint(StringUtil::toBool(input->getValue("DoCheckPoint"))); - - if (input->getValue("DoRestart") != "") - data->setDoRestart(StringUtil::toBool(input->getValue("DoRestart"))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (input->getValue("NOGL") != "") - data->setMaxLevel(StringUtil::toInt(input->getValue("NOGL"))); - - if (input->getValue("GridX") != "") - data->setGridX(StringUtil::toIntVector(input->getValue("GridX"))); - - if (input->getValue("GridY") != "") - data->setGridY(StringUtil::toIntVector(input->getValue("GridY"))); - - if (input->getValue("GridZ") != "") - data->setGridZ(StringUtil::toIntVector(input->getValue("GridZ"))); - - if (input->getValue("DistX") != "") - data->setDistX(StringUtil::toIntVector(input->getValue("DistX"))); - - if (input->getValue("DistY") != "") - data->setDistY(StringUtil::toIntVector(input->getValue("DistY"))); - - if (input->getValue("DistZ") != "") - data->setDistZ(StringUtil::toIntVector(input->getValue("DistZ"))); - - if (input->getValue("NeedInterface") != "") - data->setNeedInterface(StringUtil::toBoolVector(input->getValue("NeedInterface"))); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Kernel - if (input->getValue("MainKernelName") != "") - data->setMainKernel(input->getValue("MainKernelName")); - - if (input->getValue("MultiKernelOn") != "") - data->setMultiKernelOn(StringUtil::toBool(input->getValue("MultiKernelOn"))); - - if (input->getValue("MultiKernelLevel") != "") - data->setMultiKernelLevel(StringUtil::toIntVector(input->getValue("MultiKernelLevel"))); - - if (input->getValue("MultiKernelName") != "") - data->setMultiKernelName(StringUtil::toStringVector(input->getValue("MultiKernelName"))); - - if (StringUtil::toStringVector(input->getValue("MultiKernelName")).size() != - StringUtil::toIntVector(input->getValue("MultiKernelLevel")).size()) { - std::cout << "MultiKernelName and MultiKernelLevel has to be of same size!" << std::endl; - exit(1); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - return data; -} diff --git a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h b/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h deleted file mode 100644 index 77c93ebfa4ba8564188d8e4a5442963382cf91e3..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigFileReader/ConfigFileReader.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CONFIGFILEREADER_H -#define CONFIGFILEREADER_H - - -#include <memory> -#include <string> - -#include "basics_export.h" - -class ConfigData; - -class ConfigFileReader -{ -public: - BASICS_EXPORT static std::shared_ptr<ConfigFileReader> getNewInstance(); - - BASICS_EXPORT std::shared_ptr<ConfigData> readConfigFile(const char* filePath) const; - -private: - ConfigFileReader() = default; -}; -#endif diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp b/src/basics/Core/Input/ConfigInput/ConfigInput.cpp deleted file mode 100644 index 1fdff1e8794b5cb58f6b1a8a2e97a536531df829..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.cpp +++ /dev/null @@ -1,222 +0,0 @@ -#include "ConfigInput.h" -#include <algorithm> -#include <cerrno> -#include <iostream> -#include <sstream> -#include <string> - -#define COMMENT '#' - -namespace input -{ -// Trim the given characters from the beginning and end of a string. -// the default is to trim whitespace. If the string is empty or contains -// only the trim characters, an empty string is returned. -std::string trim(const std::string &instring, const std::string &trimstring = std::string(" \t\n")) -{ - if (trimstring.size() == 0) - return instring; - std::string temp = ""; - std::string::size_type begpos = instring.find_first_not_of(trimstring); - if (begpos == std::string::npos) { - return temp; - } else { - std::string::size_type endpos = instring.find_last_not_of(trimstring); - temp = instring.substr(begpos, endpos - begpos + 1); - } - return temp; -} - -ConfigInput::ConfigInput(std::istream &stream) : stream(stream) -{ - while (!stream.eof()) - this->setTokenValuePair(); -} - -ConfigInput::~ConfigInput() = default; - -bool ConfigInput::hasValue(const std::string &key) const -{ - bool valueFound = false; - std::string keyCopy = key; - this->makeLower(keyCopy); - if (configEntries.find(keyCopy.c_str()) != configEntries.end()) - valueFound = true; - - return valueFound; -} - -std::string ConfigInput::getValue(const std::string &key) -{ - std::string keyCopy = key; - this->makeLower(keyCopy); - if (configEntries.find(keyCopy.c_str()) != configEntries.end()) - return (*configEntries.find(keyCopy.c_str())).second; - return ""; -} - -////////////////////////////////////////////////////////////////////////// -// private methods // -////////////////////////////////////////////////////////////////////////// - -void ConfigInput::makeLower(std::string &value) const -{ - for (size_t i = 0; i < value.size(); i++) - value[i] = tolower(value[i]); -} - -void ConfigInput::setTokenValuePair() -{ - this->eatWhiteAndComments(true); - - std::string token; - if (!this->setToken(token)) - return; - - std::string value; - this->setValue(value); - - configEntries.insert(String_Pair(token, value)); -} - -bool ConfigInput::setToken(std::string &token) -{ - char tokenChar[1024]; - bool foundEqualSign = false; - int charIndex = 0; - - this->findToken(foundEqualSign, tokenChar, charIndex); - - if (!isToken(charIndex, foundEqualSign)) - return false; - - this->nullTerminate(tokenChar, charIndex); - token = tokenChar; - makeLower(token); - return true; -} - -void ConfigInput::findToken(bool &foundEqualSign, char *token, int &i) -{ - char ch; - while (!(stream.get(ch)).fail()) { - if ((ch != '\t')) { - if ((ch == '=') || (ch == ' ') || (ch == '\n') || (ch == '\r') || (ch == '\t')) { - foundEqualSign = true; - break; - } - token[i++] = ch; - } - } -} - -bool ConfigInput::isToken(int charIndex, bool foundEqualSign) -{ - if (charIndex == 0) { - configEntries.insert(String_Pair("", "")); - return false; - } - - if (!foundEqualSign && !advanceToEqualSignOnLine()) { - configEntries.insert(String_Pair("", "")); - return false; - } - return true; -} - -void ConfigInput::setValue(std::string &value) -{ - int charIndex = 0; - char valueChar[1024]; - this->findValue(charIndex, valueChar); - - if (charIndex == 0) - value = ""; - else { - this->nullTerminate(valueChar, charIndex); - value = valueChar; - value = trim(value); - this->stripLeadingAndTrailingQuotes(value); - } -} - -int ConfigInput::findValue(int &charIndex, char *value) -{ - char ch; - char c = eatWhiteAndComments(false); - if (c != '\n') { - charIndex = 0; - while (!(stream.get(ch)).fail()) { - if ((ch == '\t') || (ch == '\r') || (ch == '\n') || (ch == '#')) { - while (ch != '\n') { - if (stream.get(ch).fail()) - break; - } - break; - } else { - value[charIndex++] = ch; - } - } - } - return charIndex; -} - -void ConfigInput::stripLeadingAndTrailingQuotes(std::string &m_value) -{ - if (m_value[0] == '"') - m_value = m_value.substr(1); - if (m_value[m_value.length() - 1] == '"') - m_value = m_value.substr(0, m_value.length() - 1); -} - -void ConfigInput::nullTerminate(char *value, int &i) { value[i++] = '\0'; } - -bool ConfigInput::advanceToEqualSignOnLine() -{ - char ch; - bool foundEqual = false; - while (!(stream.get(ch)).fail()) { - if (isNewLine(ch) || isCarriageReturn(ch)) - break; - if (isEqualSign(ch)) { - foundEqual = true; - break; - } - } - return foundEqual; -} - -char ConfigInput::eatWhiteAndComments(bool traverseNewlines) -{ - char ch; - bool isComment = false; - - while (!(stream.get(ch)).fail()) { - if (isCommentSign(ch)) - isComment = true; - else if (isNewLine(ch)) { - isComment = false; - if (!traverseNewlines) - return (ch); - } else if (isRegularChar(isComment, ch)) { - stream.putback(ch); - return 0; - } - } - return 0; -} - -bool ConfigInput::isRegularChar(bool isComment, char ch) -{ - return (!isComment) && (ch != ' ') && (ch != '\t') && (ch != '\r'); -} - -bool ConfigInput::isCommentSign(char ch) { return ch == COMMENT; } - -bool ConfigInput::isEqualSign(char ch) { return ch == '='; } - -bool ConfigInput::isNewLine(char ch) { return ch == '\n'; } - -bool ConfigInput::isCarriageReturn(char ch) { return ch == '\r'; } - -} // namespace input diff --git a/src/basics/Core/Input/ConfigInput/ConfigInput.h b/src/basics/Core/Input/ConfigInput/ConfigInput.h deleted file mode 100644 index aee9242ca7cb63ac259fe27869c0d4f9d5036b05..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/ConfigInput/ConfigInput.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef ConfigInput_H -#define ConfigInput_H -#include <istream> -#include <list> -#include <map> -#include <memory> -#include <string> -#include <vector> - -#include "../Input.h" -#include "basics_export.h" - -namespace input -{ -class ConfigInput : public Input -{ -public: - BASICS_EXPORT ConfigInput(std::istream &stream); - BASICS_EXPORT ~ConfigInput() override; - - BASICS_EXPORT bool hasValue(const std::string &key) const override; - BASICS_EXPORT std::string getValue(const std::string &key) override; - -protected: - virtual void setTokenValuePair(); - void setValue(std::string &value); - bool setToken(std::string &token); - bool isToken(int charIndex, bool foundEqualSign); - int findValue(int &charIndex, char *value); - void stripLeadingAndTrailingQuotes(std::string &m_value); - void nullTerminate(char *token, int &i); - void findToken(bool &foundEqualSign, char *token, int &i); - char eatWhiteAndComments(bool traverse_newlines = true); - bool isRegularChar(bool isComment, char ch); - bool isNewLine(char ch); - bool isCommentSign(char ch); - bool advanceToEqualSignOnLine(); - bool isCarriageReturn(char ch); - bool isEqualSign(char ch); - void makeLower(std::string &instring) const; - -protected: - std::istream &stream; - using String_Pair = std::pair<std::string, std::string>; - std::map<std::string, std::string> configEntries; -}; -} // namespace input -#endif diff --git a/src/basics/Core/Input/Input.cpp b/src/basics/Core/Input/Input.cpp deleted file mode 100644 index f971dd2260d97c28c6e84f60d9b0415eb971ea16..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/Input.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Input.h" - -#include <memory> - -#ifdef BUILD_JSONCPP -#include "JsonInput/JsonInput.h" -#endif - -#include "ConfigInput/ConfigInput.h" - -namespace input -{ - -std::unique_ptr<input::Input> Input::makeInput(std::istream &stream, const std::string & /*inputType*/) -{ -#ifdef BUILD_JSONCPP - if (inputType == "json") - return std::unique_ptr<Input>(new JsonInput(stream)); -#endif - - return std::make_unique<ConfigInput>(stream); -} - -} // namespace input diff --git a/src/basics/Core/Input/Input.h b/src/basics/Core/Input/Input.h deleted file mode 100644 index 3b07b8b32d99293c3216e1a14dc9df9fc9688bea..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/Input.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef Input_H -#define Input_H - -#include "basics_export.h" - -#include <istream> -#include <memory> -#include <string> - -namespace input -{ -class Input -{ -public: - static BASICS_EXPORT std::unique_ptr<Input> makeInput(std::istream &stream, const std::string &inputType); - - virtual ~Input() = default; - - virtual bool hasValue(const std::string &key) const = 0; - virtual std::string getValue(const std::string &key) = 0; -}; -} // namespace input - -#endif diff --git a/src/basics/Core/Input/JsonInput/JsonInput.cpp b/src/basics/Core/Input/JsonInput/JsonInput.cpp deleted file mode 100644 index 34a1d154a386d267c4d086e28b5f7e5f64c302cc..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/JsonInput/JsonInput.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifdef BUILD_JSONCPP - -#include "JsonInput.h" - -#include <fstream> -#include <iterator> -#include <sstream> -#include <string> -#include <vector> - -namespace input -{ -template <typename Out> -void split(const std::string &s, char delim, Out result) -{ - std::stringstream ss; - ss.str(s); - std::string item; - while (std::getline(ss, item, delim)) { - *(result++) = item; - } -} - -std::vector<std::string> split(const std::string &s, char delim) -{ - std::vector<std::string> elems; - split(s, delim, std::back_inserter(elems)); - return elems; -} - -JsonInput::JsonInput(std::istream &stream) -{ - Json::Reader reader; - reader.parse(stream, jsonValue); -} - -bool JsonInput::hasValue(const std::string &key) const -{ - auto keys = split(key, ' '); - - if (keys.size() == 1 && !jsonValue[keys[0]].isNull()) - return true; - else if (keys.size() == 2 && !jsonValue[keys[0]][keys[1]].isNull()) - return true; - else if (keys.size() == 3 && !jsonValue[keys[0]][keys[1]][keys[2]].isNull()) - return true; - else - return false; -} - -std::string JsonInput::getValue(const std::string &key) -{ - auto keys = split(key, ' '); - - if (keys.size() == 1) - return jsonValue[keys[0]].asString(); - else if (keys.size() == 2) - return jsonValue[keys[0]][keys[1]].asString(); - else if (keys.size() == 3) - return jsonValue[keys[0]][keys[1]][keys[2]].asString(); - else - return ""; -} - -} // namespace input - -#endif diff --git a/src/basics/Core/Input/JsonInput/JsonInput.h b/src/basics/Core/Input/JsonInput/JsonInput.h deleted file mode 100644 index 8a33e99bfe2904caff82349caaf2579049892b15..0000000000000000000000000000000000000000 --- a/src/basics/Core/Input/JsonInput/JsonInput.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifdef BUILD_JSONCPP - -#ifndef JsonInput_H -#define JsonInput_H - -#include <json/json.h> -#include <string> - -#include "basics_export.h" - -#include "../Input.h" - -namespace input -{ -class JsonInput : public Input -{ -public: - BASICS_EXPORT JsonInput(std::istream &stream); - - BASICS_EXPORT virtual bool hasValue(const std::string &key) const override; - BASICS_EXPORT virtual std::string getValue(const std::string &key) override; - -private: - Json::Value jsonValue; -}; -} // namespace input - -#endif - -#endif diff --git a/src/basics/basics/utilities/UbFileInputASCII.cpp b/src/basics/basics/utilities/UbFileInputASCII.cpp index 12ce32ab032579976d3b3f97d53e5ae4a2584f78..cefa577d2ad37058a56696af37decf6a461af593 100644 --- a/src/basics/basics/utilities/UbFileInputASCII.cpp +++ b/src/basics/basics/utilities/UbFileInputASCII.cpp @@ -1,5 +1,6 @@ #include <basics/utilities/UbFileInputASCII.h> #include <cstring> +#include <algorithm> using namespace std; @@ -138,7 +139,7 @@ bool UbFileInputASCII::containsString(const string &var) } /*==========================================================*/ int UbFileInputASCII::readIntegerAfterString(const string &var) -// last change [10.3.2004] at [9:46] +// last change [29.6.2021] at [13:52] // suchts in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck // z.B. timesteps 9 { @@ -155,14 +156,16 @@ int UbFileInputASCII::readIntegerAfterString(const string &var) " wasn't found in " + this->filename)); } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) - strcpy(line, (line + 1)); // Whitespaces entfernen + std::string temp {line}; + temp = temp.substr(var.size()); // zeile um "varname" kuerzen + + temp.erase(std::remove(temp.begin(), temp.end(), ' '), temp.end()); // remove whitespace + temp.erase(std::remove(temp.begin(), temp.end(), '\t'), temp.end()); // remove tabs - return (atoi(line)); // Umwandlung in int + return std::stoi(temp); } /*==========================================================*/ -// last change [10.3.2004] at [9:46] +// last change [29.6.2021] at [13:52] // sucht in einer Datei nach varname und gibt den dahinter stehenden int-Wert zurueck // z.B. nue 9.5 double UbFileInputASCII::readDoubleAfterString(const string &var) @@ -181,14 +184,16 @@ double UbFileInputASCII::readDoubleAfterString(const string &var) } while (/*!strncmp(varname,line,sizeof(varname))==0*/ strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) - strcpy(line, (line + 1)); // Whitespaces entfernen + std::string temp {line}; + temp = temp.substr(var.size()); // zeile um "varname" kuerzen + + temp.erase(std::remove(temp.begin(), temp.end(), ' '), temp.end()); // remove whitespace + temp.erase(std::remove(temp.begin(), temp.end(), '\t'), temp.end()); // remove tabs - return (atof(line)); // Umwandlung in double + return std::stod(temp); } /*==========================================================*/ -// [9.9.2002] +// last change [29.6.2021] at [13:52] // liefert string-Wert der hinter dem uebergebenen char feld in der datei infile steht // zudem wird der wert in die uebergebene variable value uebertragen (falls man das ergebniss als char benoetig) string UbFileInputASCII::readStringAfterString(const string &var) //,char *value) @@ -207,15 +212,13 @@ string UbFileInputASCII::readStringAfterString(const string &var) //,char *value " wasn't found in " + this->filename)); } while (strstr(line, var.c_str()) != line); // Ende Schleife, wenn varname ganz in zeile vorkommt - strcpy(line, (line + strlen(var.c_str()))); // zeile um "varname" kuerzen - while ((line[0] == ' ') || (line[0] == '\t')) - strcpy(line, (line + 1)); // Whitespaces entfernen + std::string temp {line}; + temp = temp.substr(var.size()); // zeile um "varname" kuerzen - char *p; - p = strtok(line, " "); // schneidet alles "ab und inklusive space " nach namen ab - p = strtok(line, "\t"); // schneidet alles "ab und inklusive tab " nach namen ab + temp.erase(std::remove(temp.begin(), temp.end(), ' '), temp.end()); // remove whitespace + temp.erase(std::remove(temp.begin(), temp.end(), '\t'), temp.end()); // remove tabs - return static_cast<string>(p); // Umwandlung in string + return temp; } /*==========================================================*/ // last change [10.3.2004] at [9:46] diff --git a/src/basics/basics/utilities/UbFileInputASCIITest.cfg b/src/basics/basics/utilities/UbFileInputASCIITest.cfg new file mode 100644 index 0000000000000000000000000000000000000000..294d58cd2eae2819366e4f9cb2e49195e4fd518a --- /dev/null +++ b/src/basics/basics/utilities/UbFileInputASCIITest.cfg @@ -0,0 +1 @@ +test = 1 diff --git a/src/basics/basics/utilities/UbFileInputASCIITest.cpp b/src/basics/basics/utilities/UbFileInputASCIITest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..87cb5ce58eb359239d3c3e29babf04e600edc64c --- /dev/null +++ b/src/basics/basics/utilities/UbFileInputASCIITest.cpp @@ -0,0 +1,18 @@ +#include <gmock/gmock.h> +#include <filesystem> + +#include <basics/utilities/UbFileInputASCII.h> + + +TEST(UbFileInputASCIITest, readIntegerAfterString) +{ + // assuming that the config files is stored parallel to this file. + std::filesystem::path filePath = __FILE__; + filePath.replace_filename("UbFileInputASCIITest.cfg"); + + UbFileInputASCII sut {filePath.string()}; + + const int actual = sut.readIntegerAfterString("test ="); + + EXPECT_THAT(actual, testing::Eq(1)); +} diff --git a/src/basics/config/ConfigurationFile.cpp b/src/basics/config/ConfigurationFile.cpp new file mode 100644 index 0000000000000000000000000000000000000000..026d13e15486c46a7056e061ea075a03c9c06f9f --- /dev/null +++ b/src/basics/config/ConfigurationFile.cpp @@ -0,0 +1,133 @@ +#include "ConfigurationFile.h" + + +#include <map> +#include <vector> +#include <sstream> +#include <string> +#include <fstream> +#include <iostream> +#include <stdlib.h> + +#include <basics/basics/utilities/UbException.h> + + +namespace vf::basics +{ + +void ConfigurationFile::clear() +{ + data.clear(); +} +////////////////////////////////////////////////////////////////////////// +bool ConfigurationFile::load(const std::string& file) +{ + std::ifstream inFile(file.c_str()); + + if (!inFile.good()) + { + UB_THROW(UbException(UB_EXARGS, "Cannot read configuration file "+file+"!")); + } + + while (inFile.good() && ! inFile.eof()) + { + std::string line; + getline(inFile, line); + + // filter out comments + if (!line.empty()) + { + size_t pos = line.find('#'); + + if (pos != std::string::npos) + { + line = line.substr(0, pos); + } + } + + // split line into key and value + if (!line.empty()) + { + size_t pos = line.find('='); + + if (pos != std::string::npos) + { + std::string key = trim(line.substr(0, pos)); + std::string value = trim(line.substr(pos + 1)); + + if (!key.empty() && !value.empty()) + { + data[key] = value; + } + } + } + } + + return true; +} + +////////////////////////////////////////////////////////////////////////// +template<> +bool ConfigurationFile::fromString<bool>(const std::string& str) const +{ + return str == "true"; +} + +////////////////////////////////////////////////////////////////////////// +bool ConfigurationFile::contains(const std::string& key) const +{ + return data.find(key) != data.end(); +} +////////////////////////////////////////////////////////////////////////// +std::string ConfigurationFile::getString(const std::string& key) const +{ + std::map<std::string, std::string>::const_iterator iter = data.find(key); + + if (iter != data.end()) + { + std::string value = iter->second; + return value; + } + else + { + UB_THROW(UbException(UB_EXARGS, "The parameter \"" + key + "\" is missing!")); + } +} +////////////////////////////////////////////////////////////////////////// +std::string ConfigurationFile::trim(const std::string& str) +{ + size_t first = str.find_first_not_of(" \t\n\r"); + + if (first != std::string::npos) + { + size_t last = str.find_last_not_of(" \t\n\r"); + + return str.substr(first, last - first + 1); + } + else + { + return ""; + } +} +////////////////////////////////////////////////////////////////////////// +void ConfigurationFile::split(std::vector<std::string>& lst, const std::string& input, const std::string& separators, bool remove_empty) const +{ + std::ostringstream word; + for (size_t n = 0; n < input.size(); ++n) + { + if (std::string::npos == separators.find(input[n])) + word << input[n]; + else + { + if (!word.str().empty() || !remove_empty) + lst.push_back(word.str()); + word.str(""); + } + } + if (!word.str().empty() || !remove_empty) + lst.push_back(word.str()); +} +////////////////////////////////////////////////////////////////////////// + + +} diff --git a/src/cpu/VirtualFluidsCore/Utilities/ConfigurationFile.hpp b/src/basics/config/ConfigurationFile.h similarity index 54% rename from src/cpu/VirtualFluidsCore/Utilities/ConfigurationFile.hpp rename to src/basics/config/ConfigurationFile.h index 5c8050826f0ac580f83fc29e51da883469d8d6e2..ef7e7c9f06f94cabb3ba9cbefe95c8ee75736958 100644 --- a/src/cpu/VirtualFluidsCore/Utilities/ConfigurationFile.hpp +++ b/src/basics/config/ConfigurationFile.h @@ -1,5 +1,5 @@ -#ifndef Configuration_h__ -#define Configuration_h__ +#ifndef BASICS_CONFIGURATIONFILE_H +#define BASICS_CONFIGURATIONFILE_H #include <map> #include <vector> @@ -9,6 +9,8 @@ #include <iostream> #include <stdlib.h> +#include <basics/basics/utilities/UbException.h> + //! \brief Simple configuration file //! \details The Configuration class presented here can read and keep values of any configuration file written in a format like this: //!# @@ -37,6 +39,11 @@ //! //! \author Konstantin Kutscher + +namespace vf::basics +{ + + class ConfigurationFile { public: @@ -75,96 +82,6 @@ private: }; -// ---------------------------------- -// method implementations -// ---------------------------------- - -void ConfigurationFile::clear() -{ - data.clear(); -} -////////////////////////////////////////////////////////////////////////// -bool ConfigurationFile::load(const std::string& file) -{ - std::ifstream inFile(file.c_str()); - - if (!inFile.good()) - { - UB_THROW(UbException(UB_EXARGS, "Cannot read configuration file "+file+"!")); - } - - while (inFile.good() && ! inFile.eof()) - { - std::string line; - getline(inFile, line); - - // filter out comments - if (!line.empty()) - { - size_t pos = line.find('#'); - - if (pos != std::string::npos) - { - line = line.substr(0, pos); - } - } - - // split line into key and value - if (!line.empty()) - { - size_t pos = line.find('='); - - if (pos != std::string::npos) - { - std::string key = trim(line.substr(0, pos)); - std::string value = trim(line.substr(pos + 1)); - - if (!key.empty() && !value.empty()) - { - data[key] = value; - } - } - } - } - - return true; -} -////////////////////////////////////////////////////////////////////////// -bool ConfigurationFile::contains(const std::string& key) const -{ - return data.find(key) != data.end(); -} -////////////////////////////////////////////////////////////////////////// -std::string ConfigurationFile::getString(const std::string& key) const -{ - std::map<std::string, std::string>::const_iterator iter = data.find(key); - - if (iter != data.end()) - { - std::string value = iter->second; - return value; - } - else - { - UB_THROW(UbException(UB_EXARGS, "The parameter \"" + key + "\" is missing!")); - } -} -////////////////////////////////////////////////////////////////////////// -std::string ConfigurationFile::trim(const std::string& str) -{ - size_t first = str.find_first_not_of(" \t\n\r"); - - if (first != std::string::npos) - { - size_t last = str.find_last_not_of(" \t\n\r"); - - return str.substr(first, last - first + 1); - } - else - { - return ""; - } -} ////////////////////////////////////////////////////////////////////////// template<class T> std::vector<T> ConfigurationFile::getVector(const std::string& key) const @@ -183,38 +100,18 @@ std::vector<T> ConfigurationFile::getVector(const std::string& key) const return v; } ////////////////////////////////////////////////////////////////////////// -void ConfigurationFile::split(std::vector<std::string>& lst, const std::string& input, const std::string& separators, bool remove_empty) const -{ - std::ostringstream word; - for (size_t n = 0; n < input.size(); ++n) - { - if (std::string::npos == separators.find(input[n])) - word << input[n]; - else - { - if (!word.str().empty() || !remove_empty) - lst.push_back(word.str()); - word.str(""); - } - } - if (!word.str().empty() || !remove_empty) - lst.push_back(word.str()); -} -////////////////////////////////////////////////////////////////////////// template<class T> T ConfigurationFile::fromString(const std::string& str) const { - //boolean hack - if (str == "true") - return true; - else if (str == "false") - return false; - ////////////// std::istringstream stream(str); T t; stream >> t; return t; } + +template<> +bool ConfigurationFile::fromString<bool>(const std::string& str) const; + ////////////////////////////////////////////////////////////////////////// template<class T> T ConfigurationFile::getValue(const std::string& key) const @@ -225,7 +122,7 @@ T ConfigurationFile::getValue(const std::string& key) const { bFlag = true; } - + std::istringstream iss(str); T x; iss >> x; @@ -240,4 +137,7 @@ T ConfigurationFile::getValue(const std::string& key) const return x; } -#endif // Configuration_h__ + +} + +#endif diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp index 92442dd542840595d1ddf07f86e9add0a083c965..f4622a5f35e3f45d7a9b7c32919e84b8a9fb268c 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -1111,17 +1111,18 @@ void GbTriFaceMesh3D::readMeshFromSTLFileBinary(string filename, bool removeRedu UB_THROW(UbException(UB_EXARGS, "Can not open STL file: " + filename)); } char title[80]; - int nFaces; - fread(title, 80, 1, f); - fread((void *)&nFaces, 4, 1, f); + int nFaces; + size_t read_values = fread(title, 80, 1, f); + read_values = fread((void *)&nFaces, 4, 1, f); float v[12]; // normal=3, vertices=3*3 = 12 unsigned short uint16; // Every Face is 50 Bytes: Normal(3*float), Vertices(9*float), 2 Bytes Spacer for (int i = 0; i < nFaces; ++i) { for (size_t j = 0; j < 12; ++j) { - fread((void *)&v[j], sizeof(float), 1, f); + read_values = fread((void *)&v[j], sizeof(float), 1, f); } - fread((void *)&uint16, sizeof(unsigned short), 1, f); // spacer between successive faces + read_values = fread((void *)&uint16, sizeof(unsigned short), 1, f); // spacer between successive faces + (void)read_values; nodes->push_back(GbTriFaceMesh3D::Vertex(v[3], v[4], v[5])); nodes->push_back(GbTriFaceMesh3D::Vertex(v[6], v[7], v[8])); nodes->push_back(GbTriFaceMesh3D::Vertex(v[9], v[10], v[11])); diff --git a/src/basics/geometry3d/GbVoxelMatrix3D.h b/src/basics/geometry3d/GbVoxelMatrix3D.h index ba4b3b420e7ac25c79b870d6472716e392409437..3f166863c8116d2b5900c575ee0baaae6acb2bdc 100644 --- a/src/basics/geometry3d/GbVoxelMatrix3D.h +++ b/src/basics/geometry3d/GbVoxelMatrix3D.h @@ -290,7 +290,8 @@ void GbVoxelMatrix3D::readBufferedMatrixFromRawFile(std::string filename, GbVoxe CbArray3D<T> readMatrix(nodesX1, nodesX2, nodesX3); UBLOG(logINFO, " - read file to matrix"); - fread(readMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(T), readMatrix.getDataVector().size(), file); + auto read_values = fread(readMatrix.getStartAdressOfSortedArray(0, 0, 0), sizeof(T), readMatrix.getDataVector().size(), file); + (void) read_values; fclose(file); UBLOG(logINFO, " - init values"); diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index 363c9c046b37a45d800ea142e79617f71a8499d3..f5064398a6a2953c20f844be3db5865a16620e93 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -42,6 +42,8 @@ #include <basics/PointerDefinitions.h> +#include <basics/config/ConfigurationFile.h> + #include <basics/container/CbArray2D.h> #include <basics/container/CbArray3D.h> #include <basics/container/CbArray4D.h> @@ -291,7 +293,6 @@ #include <Utilities/ChangeRandomQs.hpp> #include <Utilities/CheckpointConverter.h> -#include <Utilities/ConfigurationFile.hpp> #include <Utilities/MathUtil.hpp> #include <Utilities/MemoryUtil.h> #include <Utilities/VoxelMatrixUtil.hpp> diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp index a3572c8c40ed63144080c1803d728393eaf30547..481311f909457f80655b5c888a8226635472a3ce 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOCoProcessor.cpp @@ -203,7 +203,8 @@ void MPIIOCoProcessor::writeBlocks(int step) if (rc != MPI_SUCCESS) throw UbException(UB_EXARGS, "couldn't open file " + filename); - double start, finish; + double start {0.}; + double finish {0.}; MPI_Offset write_offset = (MPI_Offset)(size * sizeof(int)); if (comm->isRoot()) { @@ -240,7 +241,9 @@ void MPIIOCoProcessor::readBlocks(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp index f82111472cb8bedf88e9a8e5c556f2eca9f0a9a0..0d713212c0f19e62bc521482ecc5a937a359e7a6 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationBECoProcessor.cpp @@ -113,7 +113,7 @@ void MPIIOMigrationBECoProcessor::writeDataSet(int step) } dataSetParam dataSetParamStr1, dataSetParamStr2, dataSetParamStr3; - int firstGlobalID; + int firstGlobalID {0}; std::vector<double> doubleValuesArrayF; // double-values (arrays of f's) in all blocks Fdistribution std::vector<double> doubleValuesArrayH1; // double-values (arrays of f's) in all blocks H1distribution // std::vector<double> doubleValuesArrayH2; // double-values (arrays of f's) in all blocks H2distribution @@ -286,7 +286,9 @@ void MPIIOMigrationBECoProcessor::writeDataSet(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -412,7 +414,7 @@ void MPIIOMigrationBECoProcessor::write4DArray(int step, Arrays arrayType, std:: blocksCount += static_cast<int>(blocksVector[level].size()); } - int firstGlobalID; + int firstGlobalID {0}; std::vector<double> doubleValuesArray; // double-values of the data array in all blocks dataSetParam dataSetParamStr; bool firstBlock = true; @@ -483,7 +485,9 @@ void MPIIOMigrationBECoProcessor::write4DArray(int step, Arrays arrayType, std:: MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType); MPI_Type_commit(&dataSetDoubleType); - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -529,7 +533,7 @@ void MPIIOMigrationBECoProcessor::write3DArray(int step, Arrays arrayType, std:: blocksCount += static_cast<int>(blocksVector[level].size()); } - int firstGlobalID; + int firstGlobalID {0}; std::vector<double> doubleValuesArray; // double-values of the data array in all blocks dataSetParam dataSetParamStr; bool firstBlock = true; @@ -595,7 +599,9 @@ void MPIIOMigrationBECoProcessor::write3DArray(int step, Arrays arrayType, std:: MPI_Type_contiguous(doubleCountInBlock, MPI_DOUBLE, &dataSetDoubleType); MPI_Type_commit(&dataSetDoubleType); - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -739,7 +745,9 @@ void MPIIOMigrationBECoProcessor::writeBoundaryConds(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1018,7 +1026,9 @@ void MPIIOMigrationBECoProcessor::readDataSet(int step) int indexB = rank * blocksPerProcess; // the first "my" block int indexE = indexB + int(myBlocksCount); // the latest "my" block - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1261,7 +1271,9 @@ void MPIIOMigrationBECoProcessor::readArray(int step, Arrays arrType, std::strin UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1415,7 +1427,9 @@ void MPIIOMigrationBECoProcessor::readBoundaryConds(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp index fae3b48463a45499ea7c8d5b78d4bcfd01d1bb81..87ded25803be8c71d3b201aa7907aadc54cdfc1b 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIOMigrationCoProcessor.cpp @@ -318,7 +318,9 @@ void MPIIOMigrationCoProcessor::writeDataSet(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -533,7 +535,9 @@ void MPIIOMigrationCoProcessor::write4DArray(int step, Arrays arrayType, std::st UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -655,7 +659,9 @@ void MPIIOMigrationCoProcessor::write3DArray(int step, Arrays arrayType, std::st UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -779,7 +785,9 @@ averageDensityArray->getDataVector().begin(), averageDensityArray->getDataVector 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -894,7 +902,9 @@ AverageVelocityArray3DPtr->getDataVector().begin(), AverageVelocityArray3DPtr->g 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -1009,7 +1019,9 @@ AverageFluctArray3DPtr->getDataVector().begin(), AverageFluctArray3DPtr->getData 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -1129,7 +1141,9 @@ AverageTripleArray3DPtr->getDataVector().begin(), AverageTripleArray3DPtr->getDa 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -1250,7 +1264,9 @@ ShearStressValArray3DPtr->getDataVector().begin(), ShearStressValArray3DPtr->get 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -1371,7 +1387,9 @@ relaxationFactor3DPtr->getDataVector().begin(), relaxationFactor3DPtr->getDataVe 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_Info info = MPI_INFO_NULL; @@ -1530,7 +1548,9 @@ void MPIIOMigrationCoProcessor::writeBoundaryConds(int step) UBLOG(logINFO, "Physical Memory currently used by current process: "<< Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1642,7 +1662,9 @@ void MPIIOMigrationCoProcessor::readDataSet(int step) UBLOG(logINFO, "MPIIOMigrationCoProcessor::readDataSet start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1910,7 +1932,9 @@ void MPIIOMigrationCoProcessor::readArray(int step, Arrays arrType, std::string UBLOG(logINFO, "MPIIOMigrationCoProcessor::readArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2055,7 +2079,9 @@ void MPIIOMigrationCoProcessor::readArray(int step, Arrays arrType, std::string UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2161,7 +2187,9 @@ void MPIIOMigrationCoProcessor::readAverageVelocityArray(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2266,7 +2294,9 @@ void MPIIOMigrationCoProcessor::readAverageFluktuationsArray(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2371,7 +2401,9 @@ void MPIIOMigrationCoProcessor::readAverageTripleArray(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2476,7 +2508,9 @@ void MPIIOMigrationCoProcessor::readShearStressValArray(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2581,7 +2615,9 @@ void MPIIOMigrationCoProcessor::readRelaxationFactor(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); MPI_File file_handler; @@ -2685,7 +2721,9 @@ void MPIIOMigrationCoProcessor::readBoundaryConds(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp index 02e471c4d652a88335c29f481b6c08b15dcc49e8..f69514478a2a53372c1807324581ad125bc55432 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp @@ -344,7 +344,9 @@ void MPIIORestartCoProcessor::writeDataSet(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -547,7 +549,9 @@ void MPIIORestartCoProcessor::writeAverageDensityArray(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -682,7 +686,9 @@ void MPIIORestartCoProcessor::writeAverageVelocityArray(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -818,7 +824,9 @@ void MPIIORestartCoProcessor::writeAverageFluktuationsArray(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -955,7 +963,9 @@ void MPIIORestartCoProcessor::writeAverageTripleArray(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1092,7 +1102,9 @@ void MPIIORestartCoProcessor::writeShearStressValArray(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1230,7 +1242,9 @@ void MPIIORestartCoProcessor::writeRelaxationFactor(int step) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1369,7 +1383,9 @@ void MPIIORestartCoProcessor::writePhaseField(int step, int fieldN) } } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1563,7 +1579,9 @@ void MPIIORestartCoProcessor::writeBoundaryConds(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1652,7 +1670,9 @@ void MPIIORestartCoProcessor::readDataSet(int step) UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1887,7 +1907,9 @@ void MPIIORestartCoProcessor::readAverageDensityArray(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readAverageDensityArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -1986,7 +2008,9 @@ void MPIIORestartCoProcessor::readAverageVelocityArray(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readAverageVelocityArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2083,7 +2107,9 @@ void MPIIORestartCoProcessor::readAverageFluktuationsArray(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readAverageFluktuationsArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2181,7 +2207,9 @@ void MPIIORestartCoProcessor::readAverageTripleArray(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readAverageTripleArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2278,7 +2306,9 @@ void MPIIORestartCoProcessor::readShearStressValArray(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readShearStressValArray start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2375,7 +2405,9 @@ void MPIIORestartCoProcessor::readRelaxationFactor(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readRelaxationFactor start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2472,7 +2504,9 @@ void MPIIORestartCoProcessor::readPhaseField(int step, int fieldN) UBLOG(logINFO, "MPIIORestartCoProcessor::readPhaseField start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -2577,7 +2611,9 @@ void MPIIORestartCoProcessor::readBoundaryConds(int step) UBLOG(logINFO, "MPIIORestartCoProcessor::readBoundaryConds start MPI IO rank = " << rank); UBLOG(logINFO, "Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe() / 1073741824.0 << " GB"); } - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp index 27f25fbfe54f9a48f5ce1b8403c4ce640d4d18ae..24230ca99c605e8bbd2594236253c8ef63de1afc 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TimeAveragedValuesCoProcessor.cpp @@ -384,7 +384,7 @@ void TimeAveragedValuesCoProcessor::calculateAverageValues(double timeSteps) maxX2 -= 2; maxX3 -= 2; - LBMReal rho, ux, uy, uz, uxx, uzz, uyy, uxy, uxz, uyz, rhof; + LBMReal rho {0.}, ux {0.}, uy {0.}, uz {0.}, uxx {0.}, uzz {0.}, uyy {0.}, uxy {0.}, uxz {0.}, uyz {0.}, rhof {0.}; for (int ix3 = minX3; ix3 <= maxX3; ix3++) { for (int ix2 = minX2; ix2 <= maxX2; ix2++) { diff --git a/src/cpu/VirtualFluidsCore/Parallel/MetisPartitioner.cpp b/src/cpu/VirtualFluidsCore/Parallel/MetisPartitioner.cpp index 93776668460650d5b7015f57cb00fe303277a3a7..51d74e3bf1b5d5109904e1fa581bcff366fad505 100644 --- a/src/cpu/VirtualFluidsCore/Parallel/MetisPartitioner.cpp +++ b/src/cpu/VirtualFluidsCore/Parallel/MetisPartitioner.cpp @@ -24,7 +24,7 @@ void MetisPartitioner::setMetisOptions(int option, idx_t value) { options[option ////////////////////////////////////////////////////////////////////////// int MetisPartitioner::partition(int nofParts, MetisPartitioner::PartType ptype) { - int rc; + int rc {0}; idx_t nvtxs = (idx_t)xadj.size() - 1; // number of nodes idx_t ncon = (idx_t)vwgt.size() / nvtxs; // number Of node constraints; part.resize(nvtxs); diff --git a/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp b/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp index b66eff480e99102edf332cfd750e0d2b6965ba83..146f5eccc6823cd3d057eb8ea08e08dd2a95ef29 100644 --- a/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp +++ b/src/cpu/VirtualFluidsCore/Utilities/CheckpointConverter.cpp @@ -133,7 +133,9 @@ void CheckpointConverter::convert(int step, int procCount) void CheckpointConverter::convertBlocks(int step, int procCount) { - double start, finish; + + double start {0.}; + double finish {0.}; start = MPI_Wtime(); // file to read from @@ -295,7 +297,9 @@ void CheckpointConverter::convertDataSet(int step, int procCount) if (rcW != MPI_SUCCESS) throw UbException(UB_EXARGS, "couldn't open file " + filenameW); - double start, finish; + + double start {0.}; + double finish {0.}; start = MPI_Wtime(); int blocksCount = 0; @@ -429,7 +433,9 @@ void CheckpointConverter::convertDataSet(int step, int procCount) void CheckpointConverter::convert___Array(int /*step*/, int procCount, std::string filenameR, std::string filenameW) { - double start, finish; + + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); @@ -523,7 +529,8 @@ void CheckpointConverter::convertBC(int step, int procCount) if (rcW != MPI_SUCCESS) throw UbException(UB_EXARGS, "couldn't open file " + filenameW); - double start, finish; + double start {0.}; + double finish {0.}; if (comm->isRoot()) start = MPI_Wtime(); diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp index 8a83a0c6df6c0b81dfdd98025aca7c8a92959562..8c0d4b93066eb69f8036cc80fab9254c7678b741 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp @@ -343,7 +343,7 @@ void SetInterpolationConnectorsBlockVisitor::setInterpolationConnectors(SPtr<Blo if(fBlockNE) fBlockNERank = fBlockNE->getRank(); int cBlockRank = cBlock->getRank(); - LBMReal omegaF; + LBMReal omegaF {0.0}; if(fBlockSW) omegaF =LBMSystem::calcCollisionFactor(nue, fBlockSW->getLevel()); if(fBlockNW) omegaF =LBMSystem::calcCollisionFactor(nue, fBlockNW->getLevel()); if(fBlockSE) omegaF =LBMSystem::calcCollisionFactor(nue, fBlockSE->getLevel()); diff --git a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp index 3f41f66ae70ae669d406deb3bc110f0f2047ab82..a1d0fbbd484d705f6f4f1d28a95e9c0e5ff42442 100644 --- a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp +++ b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp @@ -181,17 +181,18 @@ std::vector<Triangle> STLReader::readBinarySTL(const std::string& name) FILE *file = fopen(name.c_str(), mode.c_str()); char header_info[80] = ""; - fread(header_info, sizeof(char), 80, file); + auto read_values = fread(header_info, sizeof(char), 80, file); char nTri[4]; - fread(nTri, sizeof(char), 4, file); + read_values = fread(nTri, sizeof(char), 4, file); unsigned long nTriLong = *((unsigned long*)nTri); *logging::out << logging::Logger::INFO_INTERMEDIATE << "Number of Triangles: " << nTriLong << "\n"; std::vector<Triangle> triangles; char facet[50]; for (unsigned int i = 0; i < nTriLong; i++){ - fread(facet, sizeof(char), 50, file); + read_values = fread(facet, sizeof(char), 50, file); + (void) read_values; Vertex normal = getVertexFromChar(facet); @@ -272,10 +273,10 @@ std::vector<Triangle> STLReader::readBinarySTL(const BoundingBox &box, const std char nTri[4]; unsigned long nTriLong; - fread(header_info, sizeof(char), 80, file); + auto read_values = fread(header_info, sizeof(char), 80, file); - fread(nTri, sizeof(char), 4, file); + read_values = fread(nTri, sizeof(char), 4, file); nTriLong = *((unsigned long*)nTri); *logging::out << logging::Logger::INFO_INTERMEDIATE << "Number of Triangles complete geometry: " << nTriLong << "\n"; @@ -283,7 +284,8 @@ std::vector<Triangle> STLReader::readBinarySTL(const BoundingBox &box, const std char facet[50]; for (unsigned int i = 0; i < nTriLong; i++){ - fread(facet, sizeof(char), 50, file); + read_values = fread(facet, sizeof(char), 50, file); + (void) read_values; Vertex normal = getVertexFromChar(facet); diff --git a/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp b/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp index 7beae77cf8e8d6e8757df4b4e39160965c9052a6..32fd45109538101a35e253caff102c4f4df1a4a5 100644 --- a/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp +++ b/src/gpu/VirtualFluids_GPU/Communication/Communicator.cpp @@ -155,8 +155,8 @@ void Communicator::exchngDataGeo(int *sbuf_t, int *rbuf_t, int *sbuf_b, int *rbu MPI_Isend(sbuf_b, count, MPI_INT, nbrbottom, 0, comm1d, &request[3]); MPI_Waitall(4, request, status); } -int Communicator::getPID() { return PID; } -int Communicator::getNummberOfProcess() { return numprocs; } +int Communicator::getPID() const { return PID; } +int Communicator::getNummberOfProcess() const { return numprocs; } int Communicator::getNeighbourTop() { return nbrtop; } int Communicator::getNeighbourBottom() { return nbrbottom; } MPI_Comm Communicator::getCommunicator() { return comm1d; } diff --git a/src/gpu/VirtualFluids_GPU/Communication/Communicator.h b/src/gpu/VirtualFluids_GPU/Communication/Communicator.h index b67cdf264dd6fc9a1af9b9cbad708f47ea5feaf3..72c4a136ece03098c10ea65493ba02a0109ed95d 100644 --- a/src/gpu/VirtualFluids_GPU/Communication/Communicator.h +++ b/src/gpu/VirtualFluids_GPU/Communication/Communicator.h @@ -36,8 +36,8 @@ public: void exchngTopToBottom(float* sbuf, float* rbuf, int count); void waitAll(); void distributeGeometry(unsigned int* dataRoot, unsigned int* dataNode, int dataSizePerNode); - int getPID(); - int getNummberOfProcess(); + int getPID() const; + int getNummberOfProcess() const; int getNeighbourTop(); int getNeighbourBottom(); void exchngData(float* sbuf_t, float* rbuf_t, float* sbuf_b, float* rbuf_b, int count); diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp index a0539073347f999e680a9d96ac3d02fee65d7bec..ab266e499fbe9aae16eef29c8bd35b67019323f3 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp @@ -166,13 +166,26 @@ unsigned int BoundaryQs::getLevel() } -void BoundaryQs::setValues(real** q27, unsigned int level) const +void BoundaryQs::setValuesInVector(std::vector<std::vector<std::vector<real>>> &q27, unsigned int level) const +{ + for (std::size_t column = 0; column < values[level].size(); column++) + for (std::size_t index = 0; index < values[level][column].size(); index++) + q27[level][column].push_back(values[level][column][index]); +} + +void BoundaryQs::setValues(real **q27, unsigned int level) const { for (std::size_t column = 0; column < values[level].size(); column++) for (std::size_t index = 0; index < values[level][column].size(); index++) q27[column][index] = values[level][column][index]; } +void BoundaryQs::setIndexInVector(std::vector<std::vector<int>> &data, unsigned int level) const +{ + for (std::size_t index = 0; index < indices[level].size(); index++) + data[level].push_back(indices[level][index]); +} + void BoundaryQs::setIndex(int *data, unsigned int level) const { for (std::size_t index = 0; index < indices[level].size(); index++) diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.h index daefd2cac6bce4b35e52d915b265be5fd6bd4f99..804051824b5c8ca01809c78e58034eb06d45874e 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.h @@ -32,7 +32,9 @@ private: void init_Binary(); public: - void setIndex(int *indices, unsigned int level) const; + void setIndexInVector(std::vector<std::vector<int>> &data, unsigned int level) const; + void setValuesInVector(std::vector<std::vector<std::vector<real>>> &q27, unsigned int level) const; + void setIndex(int *indices, unsigned int level) const; void setValues(real** q27, unsigned int level) const; void getQs(std::vector<std::vector<std::vector<real> > > &qs); void getIndices(std::vector<std::vector<uint> > &indices); diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp index 49de1d53a3bc0e64907906e2c87409c34cb8ba85..940dbfa617ccd06f5d7b77527cc78b618062240a 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp @@ -61,10 +61,11 @@ void GridReader::allocArrays_CoordNeighborGeo() CoordNeighborGeoV coordX(para->getcoordX(), binaer, true); CoordNeighborGeoV coordY(para->getcoordY(), binaer, true); CoordNeighborGeoV coordZ(para->getcoordZ(), binaer, true); - neighX = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborX(), binaer, false)); - neighY = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborY(), binaer, false)); - neighZ = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborZ(), binaer, false)); - CoordNeighborGeoV geoV(para->getgeoVec(), binaer, false); + neighX = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborX(), binaer, false)); + neighY = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborY(), binaer, false)); + neighZ = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborZ(), binaer, false)); + neighWSB = std::shared_ptr<CoordNeighborGeoV>(new CoordNeighborGeoV(para->getneighborWSB(), binaer, false)); + CoordNeighborGeoV geoV(para->getgeoVec(), binaer, false); uint maxLevel = coordX.getLevel(); std::cout << "Number of Level: " << maxLevel + 1 << std::endl; @@ -81,19 +82,20 @@ void GridReader::allocArrays_CoordNeighborGeo() cudaMemoryManager->cudaAllocCoord(level); cudaMemoryManager->cudaAllocSP(level); - cudaMemoryManager->cudaAllocF3SP(level); + //cudaMemoryManager->cudaAllocF3SP(level); cudaMemoryManager->cudaAllocNeighborWSB(level); if (para->getUseWale()) cudaMemoryManager->cudaAllocTurbulentViscosity(level); - coordX.initalCoords(para->getParH(level)->coordX_SP, level); - coordY.initalCoords(para->getParH(level)->coordY_SP, level); - coordZ.initalCoords(para->getParH(level)->coordZ_SP, level); - neighX->initalNeighbors(para->getParH(level)->neighborX_SP, level); - neighY->initalNeighbors(para->getParH(level)->neighborY_SP, level); - neighZ->initalNeighbors(para->getParH(level)->neighborZ_SP, level); - geoV.initalNeighbors(para->getParH(level)->geoSP, level); + coordX.initalCoords( para->getParH(level)->coordX_SP, level); + coordY.initalCoords( para->getParH(level)->coordY_SP, level); + coordZ.initalCoords( para->getParH(level)->coordZ_SP, level); + neighX->initalNeighbors( para->getParH(level)->neighborX_SP, level); + neighY->initalNeighbors( para->getParH(level)->neighborY_SP, level); + neighZ->initalNeighbors( para->getParH(level)->neighborZ_SP, level); + neighWSB->initalNeighbors(para->getParH(level)->neighborWSB_SP, level); + geoV.initalNeighbors( para->getParH(level)->geoSP, level); rearrangeGeometry(para.get(), level); setInitalNodeValues(numberOfNodesPerLevel, level); @@ -113,13 +115,26 @@ void GridReader::allocArrays_BoundaryValues() this->setChannelBoundaryCondition(); int level = BC_Values[0]->getLevel(); + for (int i = 0; i <= level; i++) { + velocityX_BCvalues.push_back(std::vector<real>()); + velocityY_BCvalues.push_back(std::vector<real>()); + velocityZ_BCvalues.push_back(std::vector<real>()); + velocityQs.push_back(std::vector<std::vector<real>>()); + velocityIndex.push_back(std::vector<int>()); + for (int j = 0; j < para->getD3Qxx(); j++) { + velocityQs[i].push_back(std::vector<real>()); + } + } + for (uint i = 0; i < channelBoundaryConditions.size(); i++) { - setVelocityValues(i); - setPressureValues(i); - setOutflowValues(i); + if ( this->channelBoundaryConditions[i] == "velocity") { fillVelocityVectors(i); } + else if (this->channelBoundaryConditions[i] == "pressure") { setPressureValues(i); } + else if (this->channelBoundaryConditions[i] == "outflow") { setOutflowValues(i); } } + setVelocityValues(); + initalValuesDomainDecompostion(level); } @@ -229,37 +244,59 @@ void GridReader::setPressRhoBC(int sizePerLevel, int level, int channelSide) con } -void GridReader::setVelocityValues(int channelSide) const +void GridReader::fillVelocityVectors(int channelSide) { - for (unsigned int level = 0; level <= BC_Values[channelSide]->getLevel(); level++) + for (unsigned int level = 0; level <= BC_Values[channelSide]->getLevel(); level++) { - int sizePerLevel = BC_Values[channelSide]->getSize(level); - setVelocitySizePerLevel(level, sizePerLevel); + const int sizePerLevel = BC_Values[channelSide]->getSize(level); if (sizePerLevel > 1) { - std::cout << "size velocity level " << level << " : " << sizePerLevel << std::endl; + // set local vectors per side and level + real *veloX_ValuesPerSide = new real[sizePerLevel]; + real *veloY_ValuesPerSide = new real[sizePerLevel]; + real *veloZ_ValuesPerSide = new real[sizePerLevel]; + + std::cout << "size velocity level " << level << " : " << sizePerLevel << std::endl; + BC_Values[channelSide]->setVelocityValues(veloX_ValuesPerSide, veloY_ValuesPerSide, veloZ_ValuesPerSide, level); + + for (int i = 0; i < sizePerLevel; i++) { + this->velocityX_BCvalues[level].push_back(veloX_ValuesPerSide[i]); + this->velocityY_BCvalues[level].push_back(veloY_ValuesPerSide[i]); + this->velocityZ_BCvalues[level].push_back(veloZ_ValuesPerSide[i]); + } + + delete[] veloX_ValuesPerSide; + delete[] veloY_ValuesPerSide; + delete[] veloZ_ValuesPerSide; + } + } - cudaMemoryManager->cudaAllocVeloBC(level); - setVelocity(level, sizePerLevel, channelSide); - cudaMemoryManager->cudaCopyVeloBC(level); - } - } } -void GridReader::setVelocity(int level, int sizePerLevel, int channelSide) const -{ - BC_Values[channelSide]->setVelocityValues(para->getParH(level)->Qinflow.Vx, para->getParH(level)->Qinflow.Vy, para->getParH(level)->Qinflow.Vz, level); +void GridReader::setVelocityValues() { + for (int level = 0; level < (int)(velocityX_BCvalues.size()); level++) { + + int sizePerLevel = (int) velocityX_BCvalues[level].size(); + std::cout << "complete size velocity level " << level << " : " << sizePerLevel << std::endl; + setVelocitySizePerLevel(level, sizePerLevel); + + if (sizePerLevel > 1) { + cudaMemoryManager->cudaAllocVeloBC(level); + setVelocity(level, sizePerLevel); + cudaMemoryManager->cudaCopyVeloBC(level); + } + } +} +void GridReader::setVelocity(int level, int sizePerLevel) const +{ for (int index = 0; index < sizePerLevel; index++) { - para->getParH(level)->Qinflow.Vx[index] = para->getParH(level)->Qinflow.Vx[index] / para->getVelocityRatio(); - para->getParH(level)->Qinflow.Vy[index] = para->getParH(level)->Qinflow.Vy[index] / para->getVelocityRatio(); - para->getParH(level)->Qinflow.Vz[index] = para->getParH(level)->Qinflow.Vz[index] / para->getVelocityRatio(); - //para->getParH(level)->Qinflow.Vx[index] = para->getVelocity();//0.035; - //para->getParH(level)->Qinflow.Vy[index] = 0.0;//para->getVelocity();//0.0; - //para->getParH(level)->Qinflow.Vz[index] = 0.0; + para->getParH(level)->Qinflow.Vx[index] = this->velocityX_BCvalues[level][index] / para->getVelocityRatio(); + para->getParH(level)->Qinflow.Vy[index] = this->velocityY_BCvalues[level][index] / para->getVelocityRatio(); + para->getParH(level)->Qinflow.Vz[index] = this->velocityZ_BCvalues[level][index] / para->getVelocityRatio(); } } @@ -514,12 +551,19 @@ void GridReader::allocArrays_BoundaryQs() for (std::size_t i = 0; i < channelBoundaryConditions.size(); i++) { - if (this->channelBoundaryConditions[i] == "noSlip") { setNoSlipQs(BC_Qs[i]); } + if ( this->channelBoundaryConditions[i] == "noSlip" ) { setNoSlipQs(BC_Qs[i]); } else if (this->channelBoundaryConditions[i] == "velocity") { setVelocityQs(BC_Qs[i]); } - else if (this->channelBoundaryConditions[i] == "pressure") { setPressQs(BC_Qs[i]); } - else if (this->channelBoundaryConditions[i] == "outflow") { setOutflowQs(BC_Qs[i]); } + else if (this->channelBoundaryConditions[i] == "pressure") { setPressQs(BC_Qs[i]); } + else if (this->channelBoundaryConditions[i] == "outflow" ) { setOutflowQs(BC_Qs[i]); } } + for (int lev = 0; lev < (int)(velocityIndex.size()); lev++) { + if (velocityIndex[lev].size() > 1) { + copyVectorsToQStruct(velocityQs[lev], velocityIndex[lev], para->getParH(lev)->Qinflow); + cudaMemoryManager->cudaCopyVeloBC(lev); + } + } + std::shared_ptr<BoundaryQs> obj_geomQ = std::shared_ptr<BoundaryQs>(new BoundaryQs(para->getgeomBoundaryBcQs(), para, "geo", false)); if (para->getIsGeo()) setGeoQs(obj_geomQ); @@ -544,15 +588,14 @@ void GridReader::setPressQs(std::shared_ptr<BoundaryQs> boundaryQ) const } } -void GridReader::setVelocityQs(std::shared_ptr<BoundaryQs> boundaryQ) const +void GridReader::setVelocityQs(std::shared_ptr<BoundaryQs> boundaryQ) { for (unsigned int level = 0; level <= boundaryQ->getLevel(); level++) { if (hasQs(boundaryQ, level)) { this->printQSize("velocity", boundaryQ, level); - this->initalQStruct(para->getParH(level)->Qinflow, boundaryQ, level); - cudaMemoryManager->cudaCopyVeloBC(level); + this->initalVectorForQStruct(velocityQs, velocityIndex, boundaryQ, level); } } } @@ -613,7 +656,34 @@ void GridReader::modifyQElement(std::shared_ptr<BoundaryQs> boundaryQ, unsigned /*------------------------------------------------------------------------------------------------*/ /*---------------------------------------private q methods----------------------------------------*/ /*------------------------------------------------------------------------------------------------*/ -void GridReader::initalQStruct(QforBoundaryConditions& Q, std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const +void GridReader::initalVectorForQStruct(std::vector<std::vector<std::vector<real>>> &Qs, std::vector<std::vector<int>> &index, + std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const +{ + boundaryQ->setValuesInVector(Qs, level); + boundaryQ->setIndexInVector(index, level); +} + +void GridReader::copyVectorsToQStruct(std::vector<std::vector<real>> &Qs, + std::vector<int> &index, QforBoundaryConditions &Q) const +{ + QforBoundaryConditions qTemp; + this->setQ27Size(qTemp, Q.q27[0], Q.kQ); + + uint sizeOfValues = (uint)index.size(); + + for (int direction = 0; direction < para->getD3Qxx(); direction++) { + for (size_t indexQ = 0; indexQ < sizeOfValues; indexQ++) { + qTemp.q27[direction][indexQ] = Qs[direction][indexQ]; + } + } + + for (size_t indexQ = 0; indexQ < sizeOfValues; indexQ++) { + Q.k[indexQ] = index[indexQ]; + } +} + +void GridReader::initalQStruct(QforBoundaryConditions &Q, std::shared_ptr<BoundaryQs> boundaryQ, + unsigned int level) const { QforBoundaryConditions qTemp; this->setQ27Size(qTemp, Q.q27[0], Q.kQ); @@ -628,7 +698,25 @@ bool GridReader::hasQs(std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level void GridReader::initalGridInformations() { + int maxLevel = para->getMaxLevel(); + std::vector<int> gridX, gridY, gridZ; + std::vector<int> distX, distY, distZ; + + for (int i = 0; i <= maxLevel; i++) { + gridX.push_back(0); + gridY.push_back(0); + gridZ.push_back(0); + distX.push_back(0); + distY.push_back(0); + distZ.push_back(0); + } + para->setGridX(gridX); + para->setGridY(gridY); + para->setGridZ(gridZ); + para->setDistX(distX); + para->setDistY(distY); + para->setDistZ(distZ); } void GridReader::setQ27Size(QforBoundaryConditions &Q, real* QQ, unsigned int sizeQ) const diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h index aafe0d1cb732af656fe861e7cab93af4e0ae078b..f7a4c43062da79d39c43e6822688c51ad55e7442 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h @@ -26,6 +26,13 @@ private: std::shared_ptr<CoordNeighborGeoV> neighX, neighY, neighZ, neighWSB; std::vector<std::shared_ptr<BoundaryValues> > BC_Values; + std::vector<std::vector<real>> velocityX_BCvalues, velocityY_BCvalues, velocityZ_BCvalues; + std::vector<std::vector<std::vector<real>>> velocityQs; + std::vector<std::vector<int>> velocityIndex; + + std::vector<std::vector<real>> pressureBCvalues; + std::vector<std::vector<real>> outflowBCvalues; + public: GridReader(FILEFORMAT format, std::shared_ptr<Parameter> para, std::shared_ptr<CudaMemoryManager> cudaManager); ~GridReader(); @@ -50,21 +57,27 @@ private: void setPressureValues(int channelSide) const; void setPressRhoBC(int sizePerLevel, int level, int channelSide) const; - void setVelocityValues(int channelSide) const; - void setVelocity(int level, int sizePerLevel, int channelSide) const; + void fillVelocityVectors(int channelSide); + void setVelocityValues(); + void setVelocity(int level, int sizePerLevel) const; void setOutflowValues(int channelSide) const; void setOutflow(int level, int sizePerLevel, int channelSide) const; - void setPressQs(std::shared_ptr<BoundaryQs> boundaryQ) const; - void setVelocityQs(std::shared_ptr<BoundaryQs> boundaryQ) const; + //void fillVelocityQVectors(int channelSide); + void setPressQs(std::shared_ptr<BoundaryQs> boundaryQ) const; + void setVelocityQs(std::shared_ptr<BoundaryQs> boundaryQ); void setOutflowQs(std::shared_ptr<BoundaryQs> boundaryQ) const; void setNoSlipQs(std::shared_ptr<BoundaryQs> boundaryQ) const; void setGeoQs(std::shared_ptr<BoundaryQs> boundaryQ) const; void modifyQElement(std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; - void initalQStruct(QforBoundaryConditions& Q, std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; + void initalVectorForQStruct(std::vector<std::vector<std::vector<real>>> &Qs, std::vector<std::vector<int>> &index, + std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; + void copyVectorsToQStruct(std::vector<std::vector<real>> &Qs, std::vector<int> &index, + QforBoundaryConditions &Q) const; + void initalQStruct(QforBoundaryConditions &Q, std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; void printQSize(std::string bc, std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; void setSizeNoSlip(std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; void setSizeGeoQs(std::shared_ptr<BoundaryQs> boundaryQ, unsigned int level) const; diff --git a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu index 562140eb24bad470604b5782a816a4e60d5000f3..ce6e034d1c1eee57e062b736cfcea97e07306f3c 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu @@ -42,14 +42,18 @@ extern "C" __global__ void LBCalcMac27( real* vxD, const unsigned int k = nx*(ny*z + y) + x; // Zugriff auf arrays im device + + if(k >= size_Mat) + return; + + if(!vf::gpu::isValidFluidNode(geoD[k])) + return; + rhoD[k] = c0o1; vxD[k] = c0o1; vyD[k] = c0o1; vzD[k] = c0o1; - if(!vf::gpu::isValidFluidNode(k, size_Mat, geoD[k])) - return; - vf::gpu::DistributionWrapper distr_wrapper(distributions, size_Mat, isEvenTimestep, k, neighborX, neighborY, neighborZ); const auto& distribution = distr_wrapper.distribution; @@ -266,15 +270,18 @@ extern "C" __global__ void LBCalcMacCompSP27(real *vxD, real *vyD, real *vzD, re { const unsigned k = vf::gpu::getNodeIndex(); + if(k >= size_Mat) + return; + + if (!vf::gpu::isValidFluidNode(geoD[k])) + return; + pressD[k] = c0o1; rhoD[k] = c0o1; vxD[k] = c0o1; vyD[k] = c0o1; vzD[k] = c0o1; - if (!vf::gpu::isValidFluidNode(k, size_Mat, geoD[k])) - return; - vf::gpu::DistributionWrapper distr_wrapper(distributions, size_Mat, isEvenTimestep, k, neighborX, neighborY, neighborZ); const auto &distribution = distr_wrapper.distribution; diff --git a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp index 7bc73d43544d10897c8f0f02cafe0b98d0e63d8d..75e45328246c7758f37d2dd26742f131cdabe571 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp +++ b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.cpp @@ -8,6 +8,8 @@ #include <Visitor/ActuatorLine.h> #include <Visitor/Probe.h> +#include "Calculation/PorousMedia.h" + #include <lbm/constants/NumericConstants.h> void CudaMemoryManager::cudaAllocFull(int lev) diff --git a/src/gpu/VirtualFluids_GPU/Init/DefineGrid.cpp b/src/gpu/VirtualFluids_GPU/Init/DefineGrid.cpp deleted file mode 100644 index 98119ce6f2d5a5bcd630cb33d210a9d52080fb66..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/DefineGrid.cpp +++ /dev/null @@ -1,444 +0,0 @@ -#include "Init/DefineGrid.h" -#include "Init/ReadGeometry.h" -#include "Temperature/FindTemperature.h" -#include "FindInterface/FindInterface.h" -#include <cuda_runtime.h> -#include <helper_cuda.h> - -//////////////////////////////////////////////////////////////////////////////// -void defineGrid(Parameter* para, vf::gpu::Communicator* comm, CudaMemoryManager* cudaManager) -{ - for (int lev=para->getFine(); lev >= para->getCoarse(); lev--) - { - /////////////////////////////////////////////////////////////////////////////////////////////////// - // Allocate Host Memory - /////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaAllocFull(lev); - /////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getDiffOn()==true) - { - checkCudaErrors( cudaMallocHost((void**) &(para->getParH(lev)->Conc_Full ), para->getParH(lev)->mem_size_real)); - } - /////////////////////////////////////////////////////////////////////////////////////////////////// - if (lev==para->getCoarse()) - { - /////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getReadGeo()==true) - { - std::cout << "read geometry...\n" ; - readGeometry(para, comm, lev, para->getGeometryFileC()); - std::cout << "done.\n"; - } - /////////////////////////////////////////////////////////////////////////////////////////////////// - for (unsigned int k=0; k<para->getParH(lev)->nz; k++) - { - for (unsigned int j=0; j<para->getParH(lev)->ny; j++) - { - for (unsigned int i=0; i<para->getParH(lev)->nx; i++) - { - int m = para->getParH(lev)->nx*(para->getParH(lev)->ny*k + j) + i; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getReadGeo()==true) - { - if ( i <= STARTOFFX || i >= para->getParH(lev)->gridNX + STARTOFFX - 1 - || j <= STARTOFFY || j >= para->getParH(lev)->gridNY + STARTOFFY - 1 - || k <= STARTOFFZ || k >= para->getParH(lev)->gridNZ + STARTOFFZ - 1 ) - { - para->getParH(lev)->geo[m] = GEO_VOID; - } - //else if ( (k >= STARTOFFZ +1) && (k <= STARTOFFZ + 20) ) - //{ - // para->getParH(lev)->geo[m] = GEO_FLUID; - //} - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - else - { - //////////////////////////////////////////////////////////////////////////////////////////////// - //Test - ////unsigned int centerX = para->getParH(lev)->gridNX / 2 + STARTOFFX; - ////unsigned int centerY = para->getParH(lev)->gridNY / 2 + STARTOFFY; - ////unsigned int centerZ = para->getParH(lev)->gridNZ / 4 + STARTOFFZ; - //real centerX = para->getParH(lev)->gridNX / 2. + STARTOFFX - 0.5; - //real centerY = para->getParH(lev)->gridNY / 2. + STARTOFFY - 0.5; - //real centerZ = para->getParH(lev)->gridNZ / 4. + STARTOFFZ - 0.5; - //real radius = para->getParH(lev)->gridNY / 10.;//2.56f; - //////unsigned int distSq = (centerX-i)*(centerX-i)+(centerY-j)*(centerY-j); - ////unsigned int distSq = (centerX-i)*(centerX-i)+(centerY-j)*(centerY-j)+(centerZ-k)*(centerZ-k); - //real distSq = (centerX-i)*(centerX-i)+(centerY-j)*(centerY-j)+(centerZ-k)*(centerZ-k); - //real radiSq = radius*radius; - //////////////////////////////////////////////////////////////////////////////////////////////// - - if ( i < STARTOFFX || i > para->getParH(lev)->gridNX + STARTOFFX - 1 - || j < STARTOFFY || j > para->getParH(lev)->gridNY + STARTOFFY - 1 - || k < STARTOFFZ || k > para->getParH(lev)->gridNZ + STARTOFFZ - 1 ) - { - para->getParH(lev)->geo[m] = GEO_VOID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - //else if ( j == STARTOFFY || j == para->getParH(lev)->gridNY + STARTOFFY - 1 ) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ( k == STARTOFFZ || k == para->getParH(lev)->gridNZ + STARTOFFZ - 1) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ( i == STARTOFFX+1 || i == para->getParH(lev)->gridNX + STARTOFFX - 2 ) - //{ - // para->getParH(lev)->geo[m] = GEO_VELO; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ((i >= para->getParH(lev+1)->XdistKn + STARTOFFX + 3) && (i <= (para->getParH(lev+1)->XdistKn + para->getParH(lev+1)->gridNX / 2) + STARTOFFX - 3) && - // (j >= para->getParH(lev+1)->YdistKn + STARTOFFY + 3) && (j <= (para->getParH(lev+1)->YdistKn + para->getParH(lev+1)->gridNY / 2) + STARTOFFY - 3) && - // (k >= para->getParH(lev+1)->ZdistKn + STARTOFFZ /*+ 3*/) && (k <= (para->getParH(lev+1)->ZdistKn + para->getParH(lev+1)->gridNZ / 2) + STARTOFFZ - 3) ) - //{ - // para->getParH(lev)->geo[m] = GEO_VOID; - // if (para->getDiffOn()==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ((i >= para->getParH(lev)->gridNX / 4 + STARTOFFX + 4) && (i <= (para->getParH(lev)->gridNX * 3 / 4) + STARTOFFX - 4) && - // (j >= para->getParH(lev)->gridNY / 4 + STARTOFFY + 4) && (j <= (para->getParH(lev)->gridNY * 3 / 4) + STARTOFFY - 4) && - // (k >= para->getParH(lev)->gridNZ / 8 + STARTOFFZ + 4) && (k <= (para->getParH(lev)->gridNZ * 5 / 8) + STARTOFFZ - 4) && maxlevel>1) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if (distSq < /*>*/ radiSq) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ( i <= STARTOFFX + 30 && i >=STARTOFFX + 20 - // && j <= STARTOFFY + 30 && j >=STARTOFFY + 20 - // && k <= STARTOFFZ + 30 && k >=STARTOFFZ + 20 ) - //{ - // para->getParH(lev)->geo[m] = GEO_FLUID; - // para->getParH(lev)->Conc_Full[m] = 1.0; - //} - //else if ( i <= STARTOFFX + 30 && i >=STARTOFFX + 20 - // && j <= STARTOFFY + 30 && j >=STARTOFFY + 20 - // && k <= STARTOFFZ + 30 && k >=STARTOFFZ + 20 ) - //{ - // para->getParH(lev)->geo[m] = GEO_FLUID; - // para->getParH(lev)->Conc_Full[m] = 1.0; - //} - else - { - para->getParH(lev)->geo[m] = GEO_FLUID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = (real)para->getTemperatureInit(); - } - } - //if (i == STARTOFFZ) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (para->getDiffOn()==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - - } - para->getParH(lev)->k[m] = 0; - } - } - } - } - else if (lev==para->getFine() && para->getMaxLevel()>=1) - { - for (unsigned int k=0; k<para->getParH(lev)->nz; k++) - { - for (unsigned int j=0; j<para->getParH(lev)->ny; j++) - { - for (unsigned int i=0; i<para->getParH(lev)->nx; i++) - { - //unsigned int centerX = para->getParH(lev)->gridNX / 2 + STARTOFFX; - //unsigned int centerY = para->getParH(lev)->gridNY / 2 + STARTOFFY; - //unsigned int centerZ = para->getParH(lev)->gridNZ / 2 + STARTOFFZ; - //real radius = para->getParH(lev)->gridNY / 5.f;//2.56f; - //real centerX = para->getParH(lev)->gridNX / 2.f + STARTOFFX - 0.5f; - //real centerY = para->getParH(lev)->gridNY / 2.f + STARTOFFY - 0.5f; - //real centerZ = para->getParH(lev)->gridNZ / 2.f + STARTOFFZ - 0.5f; - //real radius = para->getParH(lev)->gridNY / 5.f;//2.56f; - - int m = para->getParH(lev)->nx*(para->getParH(lev)->ny*k + j) + i; - - ////unsigned int distSq = (centerX-i)*(centerX-i)+(centerY-j)*(centerY-j)+(centerZ-k)*(centerZ-k); - //real distSq = (centerX-i)*(centerX-i)+(centerY-j)*(centerY-j)+(centerZ-k)*(centerZ-k); - //real radiSq = radius*radius; - - //diff stuff - //real mradsq = (real)((real)i-(STARTOFFX + 30)) * (real)((real)i-(STARTOFFX + 30)) + (real)((real)j-(STARTOFFY + 30)) * (real)((real)j-(STARTOFFY + 30)) +(real) ((real)k-(STARTOFFZ + 30)) * (real) ((real)k-(STARTOFFZ + 30)); - - if ( i < STARTOFFX || i > para->getParH(lev)->gridNX + STARTOFFX - 1 - || j < STARTOFFY || j > para->getParH(lev)->gridNY + STARTOFFY - 1 - || k < STARTOFFZ || k > para->getParH(lev)->gridNZ + STARTOFFZ - 1 ) - { - para->getParH(lev)->geo[m] = GEO_VOID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - //else if (i = STARTOFFX) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ((i > STARTOFFX ) && (i <= para->getParH(lev)->gridNX + STARTOFFX - 38) && - // (j >= 19 + STARTOFFY) && (j <= para->getParH(lev)->gridNY + STARTOFFY - 19) && - // (k >= 30 + STARTOFFZ) && (k <= para->getParH(lev)->gridNZ + STARTOFFZ - 30) ) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ((i >= STARTOFFX ) && (i <= (para->getParH(lev)->gridNX * 4 / 8) + STARTOFFX) && - // (j >= para->getParH(lev)->gridNY / 4 + STARTOFFY) && (j <= (para->getParH(lev)->gridNY * 3 / 4) + STARTOFFY) && - // (k >= para->getParH(lev)->gridNZ * 8 / 20 + STARTOFFZ) && (k <= (para->getParH(lev)->gridNZ * 12 / 20) + STARTOFFZ) ) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - ////diff stuff - //else if ( mradsq < 100.f ) - //{ - // para->getParH(lev)->geo[m] = GEO_FLUID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 1.0f - mradsq * 0.01f; - // } - //} - //else if ( i <= STARTOFFX + 30 && i >=STARTOFFX + 20 - // && j <= STARTOFFY + 30 && j >=STARTOFFY + 20 - // && k <= STARTOFFZ + 30 && k >=STARTOFFZ + 20 ) - //{ - // para->getParH(lev)->geo[m] = GEO_FLUID; - // para->getParH(lev)->Conc_Full[m] = 1.0; - //} - //else if (distSq < radiSq) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - else - { - para->getParH(lev)->geo[m] = GEO_FLUID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - //if (i == STARTOFFX) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - if (k == STARTOFFZ) - { - para->getParH(lev)->geo[m] = GEO_SOLID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - - - para->getParH(lev)->k[m] = 0; - } - } - } - } - else if( lev > para->getCoarse() && lev < para->getFine() ) - { - for (unsigned int k=0; k<para->getParH(lev)->nz; k++) - { - for (unsigned int j=0; j<para->getParH(lev)->ny; j++) - { - for (unsigned int i=0; i<para->getParH(lev)->nx; i++) - { - int m = para->getParH(lev)->nx*(para->getParH(lev)->ny*k + j) + i; - - if ( i < STARTOFFX || i > para->getParH(lev)->gridNX + STARTOFFX - 1 - || j < STARTOFFY || j > para->getParH(lev)->gridNY + STARTOFFY - 1 - || k < STARTOFFZ || k > para->getParH(lev)->gridNZ + STARTOFFZ - 1 ) - { - para->getParH(lev)->geo[m] = GEO_VOID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - else if ((i >= para->getParH(lev+1)->XdistKn + STARTOFFX + 3) && (i <= (para->getParH(lev+1)->XdistKn + para->getParH(lev+1)->gridNX / 2) + STARTOFFX - 3) && - (j >= para->getParH(lev+1)->YdistKn + STARTOFFY + 3) && (j <= (para->getParH(lev+1)->YdistKn + para->getParH(lev+1)->gridNY / 2) + STARTOFFY - 3) && - (k >= para->getParH(lev+1)->ZdistKn + STARTOFFZ + 3) && (k <= (para->getParH(lev+1)->ZdistKn + para->getParH(lev+1)->gridNZ / 2) + STARTOFFZ - 3) ) - { - para->getParH(lev)->geo[m] = GEO_VOID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - //else if (i = STARTOFFX) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - // if (ic.diffOn==true) - // { - // para->getParH(lev)->Conc_Full[m] = 0.0; - // } - //} - //else if ((i >= para->getParH(lev)->gridNX / 4 + STARTOFFX + 3) && (i <= (para->getParH(lev)->gridNX * 3 / 4) + STARTOFFX - 3) && - // (j >= para->getParH(lev)->gridNY / 4 + STARTOFFY + 3) && (j <= (para->getParH(lev)->gridNY * 3 / 4) + STARTOFFY - 3) && - // (k >= para->getParH(lev)->gridNZ / 8 + STARTOFFZ + 3) && (k <= (para->getParH(lev)->gridNZ * 5 / 8) + STARTOFFZ - 3) ) - //{ - // para->getParH(lev)->geo[m] = GEO_SOLID; - //} - else - { - para->getParH(lev)->geo[m] = GEO_FLUID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - if (i == STARTOFFX) - { - para->getParH(lev)->geo[m] = GEO_SOLID; - if (para->getDiffOn()==true) - { - para->getParH(lev)->Conc_Full[m] = 0.0; - } - } - para->getParH(lev)->k[m] = 0; - } - } - } - } - - //std::cout << "read geoFull..." ; - //readVFgeoFull(para, "D:/temp/gpuBenchmarkCylinder/GPU/geoFull.dat"); - //std::cout << "done.\n"; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Buffer GEO - //geo_sbuf_t.setSize(1,para->getParH(0)->sizePlaneXY); - //geo_rbuf_t.setSize(1,para->getParH(0)->sizePlaneXY); - //geo_sbuf_b.setSize(1,para->getParH(0)->sizePlaneXY); - //geo_rbuf_b.setSize(1,para->getParH(0)->sizePlaneXY); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Exchange GEO - //if (numprocs>1) - //{ - // exchangeDataGeo(lev); - //} - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - para->setSizeMatSparse(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaAllocSP(lev); - //F3 - cudaManager->cudaAllocF3SP(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Buffer - //sbuf_t.setSize(27,para->getParH(0)->sizePlaneST); - //rbuf_t.setSize(27,para->getParH(0)->sizePlaneRT); - //sbuf_b.setSize(27,para->getParH(0)->sizePlaneSB); - //rbuf_b.setSize(27,para->getParH(0)->sizePlaneRB); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getDiffOn()==true) - { - cudaManager->cudaAllocConc(lev); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - para->fillSparse(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaCopySP(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getDiffOn()==true) - { - std::cout << "Maikes Thermo-Stuff...\n" ; - initTemperatur(para, cudaManager, lev);//thermostuff(lev); - std::cout << "done.\n"; - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if ( lev < para->getFine() && para->getMaxLevel()>=1) - { - ////////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaAllocInterfaceCF(lev); - cudaManager->cudaAllocInterfaceFC(lev); - cudaManager->cudaAllocInterfaceOffCF(lev); - cudaManager->cudaAllocInterfaceOffFC(lev); - ////////////////////////////////////////////////////////////////////////////////////////////////////// - //Find Interpolation Interface - ////////////////////////////////////////////////////////////////////////////////////////////////////// - std::cout << "Anzahl der CF-Interpolationzellen vorher:" << para->getParH(lev)->K_CF << "\n"; - std::cout << "Anzahl der FC-Interpolationzellen vorher:" << para->getParH(lev)->K_FC << "\n"; - ////////////////////////////////////////////////////////////////////////////////////////////////////// - interpolation(para->getParH(lev)->intCF, para->getParH(lev)->intFC, - para->getParH(lev)->gridNX, para->getParH(lev)->gridNY, para->getParH(lev)->gridNZ, - para->getParH(lev+1)->gridNX, para->getParH(lev+1)->gridNY, para->getParH(lev+1)->gridNZ, - para->getParH(lev+1)->XdistKn, para->getParH(lev+1)->YdistKn, para->getParH(lev+1)->ZdistKn, - para->getParH(lev)->k, para->getParH(lev+1)->k, para->getParH(lev)->need_interface, - para->getParH(lev)->offCF, para->getParH(lev)->offFC); - ////////////////////////////////////////////////////////////////////////////////////////////////////// - std::cout << "Anzahl der CF-Interpolationzellen nachher:" << para->getParH(lev)->intCF.kCF << "\n"; - std::cout << "Anzahl der FC-Interpolationzellen nachher:" << para->getParH(lev)->intFC.kFC << "\n"; - ////////////////////////////////////////////////////////////////////////////////////////////////////// - //Test - //for (int test = 0; test < para->getParH(lev)->intCF.kCF; test++) - //{ - // para->getParH(lev)->offCF.xOffCF[test] = -para->getParH(lev)->offCF.xOffCF[test]; - // para->getParH(lev)->offCF.yOffCF[test] = -para->getParH(lev)->offCF.yOffCF[test]; - // para->getParH(lev)->offCF.zOffCF[test] = -para->getParH(lev)->offCF.zOffCF[test]; - //} - ////////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaCopyInterfaceCF(lev); - cudaManager->cudaCopyInterfaceFC(lev); - cudaManager->cudaCopyInterfaceOffCF(lev); - cudaManager->cudaCopyInterfaceOffFC(lev); - ////////////////////////////////////////////////////////////////////////////////////////////////////// - } - } - //////////////////////////////////////////////////////////////////////////////////////////////////////// - //if (para->getMyID() == para->getPressInID()) setSizeOfPlane(para, 0, para->getPressInZ()); - //else if(para->getMyID() == para->getPressOutID()) setSizeOfPlane(para, 0, para->getPressOutZ()); - //////////////////////////////////////////////////////////////////////////////////////////////////////// - -} diff --git a/src/gpu/VirtualFluids_GPU/Init/DefineGrid.h b/src/gpu/VirtualFluids_GPU/Init/DefineGrid.h deleted file mode 100644 index 474ab9080993f20c807ec2ec13e1c770415ad732..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/DefineGrid.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef DEFINE_GRID_H -#define DEFINE_GRID_H - -#include "LBM/LB.h" -#include "Parameter/Parameter.h" -#include "Communication/Communicator.h" -#include "GPU/CudaMemoryManager.h" - -extern "C" void defineGrid(Parameter* para, vf::gpu::Communicator* comm, CudaMemoryManager* cudaManager); - -#endif diff --git a/src/gpu/VirtualFluids_GPU/Init/InitLattice.cpp b/src/gpu/VirtualFluids_GPU/Init/InitLattice.cpp index c5969ba6e2588012ab80cb041be89d72e9fab9f0..e2b7b34d75e901a468ae7f222ca9e0490cdbf4f8 100644 --- a/src/gpu/VirtualFluids_GPU/Init/InitLattice.cpp +++ b/src/gpu/VirtualFluids_GPU/Init/InitLattice.cpp @@ -1,86 +1,72 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitLattice.h +//! \ingroup Init +//! \author Martin Schoenherr +//======================================================================================= #include "Init/InitLattice.h" -#include <cuda_runtime.h> -#include <helper_cuda.h> -#include "Parameter/Parameter.h" +#include "GPU/CudaMemoryManager.h" #include "GPU/GPU_Interface.h" -#include "Temperature/FindTemperature.h" +#include "Parameter/Parameter.h" #include "PreProcessor/PreProcessor.h" -#include "GPU/CudaMemoryManager.h" +#include "Temperature/FindTemperature.h" + -//////////////////////////////////////////////////////////////////////////////// void initLattice(SPtr<Parameter> para, SPtr<PreProcessor> preProcessor, SPtr<CudaMemoryManager> cudaManager) { - for (int lev=para->getFine(); lev >= para->getCoarse(); lev--) - { - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - preProcessor->init(para, lev); + for (int lev = para->getFine(); lev >= para->getCoarse(); lev--) { + preProcessor->init(para, lev); + + CalcMacCompSP27( + para->getParD(lev)->vx_SP, para->getParD(lev)->vy_SP, para->getParD(lev)->vz_SP, para->getParD(lev)->rho_SP, + para->getParD(lev)->press_SP, para->getParD(lev)->geoSP, para->getParD(lev)->neighborX_SP, + para->getParD(lev)->neighborY_SP, para->getParD(lev)->neighborZ_SP, para->getParD(lev)->size_Mat_SP, + para->getParD(lev)->numberofthreads, para->getParD(lev)->d0SP.f[0], para->getParD(lev)->evenOrOdd); + + if (para->getCalcMedian()) { + constexpr uint tdiff = 1; + CalcMacMedSP27(para->getParD(lev)->vx_SP_Med, para->getParD(lev)->vy_SP_Med, para->getParD(lev)->vz_SP_Med, + para->getParD(lev)->rho_SP_Med, para->getParD(lev)->press_SP_Med, para->getParD(lev)->geoSP, + para->getParD(lev)->neighborX_SP, para->getParD(lev)->neighborY_SP, + para->getParD(lev)->neighborZ_SP, tdiff, para->getParD(lev)->size_Mat_SP, + para->getParD(lev)->numberofthreads, para->getParD(lev)->evenOrOdd); + } + // advection - diffusion + if (para->getDiffOn()) { + + cudaManager->cudaAllocConc(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //CalcMacSP27(para->getParD(lev)->vx_SP, - // para->getParD(lev)->vy_SP, - // para->getParD(lev)->vz_SP, - // para->getParD(lev)->rho_SP, - // para->getParD(lev)->press_SP, - // para->getParD(lev)->geoSP, - // para->getParD(lev)->neighborX_SP, - // para->getParD(lev)->neighborY_SP, - // para->getParD(lev)->neighborZ_SP, - // para->getParD(lev)->size_Mat_SP, - // para->getParD(lev)->numberofthreads, - // para->getParD(lev)->d0SP.f[0], - // para->getParD(lev)->evenOrOdd); - //getLastCudaError("Kernel CalcMacSP27 execution failed"); - CalcMacCompSP27(para->getParD(lev)->vx_SP, - para->getParD(lev)->vy_SP, - para->getParD(lev)->vz_SP, - para->getParD(lev)->rho_SP, - para->getParD(lev)->press_SP, - para->getParD(lev)->geoSP, - para->getParD(lev)->neighborX_SP, - para->getParD(lev)->neighborY_SP, - para->getParD(lev)->neighborZ_SP, - para->getParD(lev)->size_Mat_SP, - para->getParD(lev)->numberofthreads, - para->getParD(lev)->d0SP.f[0], - para->getParD(lev)->evenOrOdd); - getLastCudaError("Kernel execution failed"); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (para->getCalcMedian()) - { - unsigned int tdiff = 1; - CalcMacMedSP27( para->getParD(lev)->vx_SP_Med, - para->getParD(lev)->vy_SP_Med, - para->getParD(lev)->vz_SP_Med, - para->getParD(lev)->rho_SP_Med, - para->getParD(lev)->press_SP_Med, - para->getParD(lev)->geoSP, - para->getParD(lev)->neighborX_SP, - para->getParD(lev)->neighborY_SP, - para->getParD(lev)->neighborZ_SP, - tdiff, - para->getParD(lev)->size_Mat_SP, - para->getParD(lev)->numberofthreads, - para->getParD(lev)->evenOrOdd); - getLastCudaError("CalcMacMedSP27 execution failed"); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // advection - diffusion stuff - if (para->getDiffOn()==true){ - //malloc - //printf("vor cudaAllocConc\n"); - cudaManager->cudaAllocConc(lev); - //define init conc/temp - //printf("vor Schleife\n"); - for (unsigned int i = 0; i < para->getParH(lev)->size_Mat_SP; i++) - { - para->getParH(lev)->Conc[i] = para->getTemperatureInit(); - } - //malloc and init fs - //printf("vor initTemperatur\n"); - initTemperatur(para.get(), cudaManager.get(), lev); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + for (unsigned int i = 0; i < para->getParH(lev)->size_Mat_SP; i++) { + para->getParH(lev)->Conc[i] = para->getTemperatureInit(); + } + initTemperatur(para.get(), cudaManager.get(), lev); + } } } diff --git a/src/gpu/VirtualFluids_GPU/Init/InitLattice.h b/src/gpu/VirtualFluids_GPU/Init/InitLattice.h index 4e781f96eead293631a8e1dcf3b5acf556cadb25..e69386b78f607a861d56f5dbca657ea482971e12 100644 --- a/src/gpu/VirtualFluids_GPU/Init/InitLattice.h +++ b/src/gpu/VirtualFluids_GPU/Init/InitLattice.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitLattice.h +//! \ingroup Init +//! \author Martin Schoenherr +//======================================================================================= #ifndef INIT_LATTICE_H #define INIT_LATTICE_H diff --git a/src/gpu/VirtualFluids_GPU/Init/PositionReader.cpp b/src/gpu/VirtualFluids_GPU/Init/PositionReader.cpp new file mode 100644 index 0000000000000000000000000000000000000000..034016b8177394f698ba71252a148bb71655d210 --- /dev/null +++ b/src/gpu/VirtualFluids_GPU/Init/PositionReader.cpp @@ -0,0 +1,213 @@ +#include "PositionReader.h" + +#include "Parameter/Parameter.h" + +#include <basics/utilities/UbFileInputASCII.h> + + +////////////////////////////////////////////////////////////////////////// +void PositionReader::readFilePropellerCylinderForAlloc(Parameter* para) +{ + UbFileInputASCII in(para->getpropellerCylinder()); + int test = 0, count = 0; + int maxlevel = in.readInteger(); + in.readLine(); + + for (int level = 0; level < maxlevel; level++) + { + para->getParH(level)->QPropeller.kQ = in.readInteger(); + para->getParD(level)->QPropeller.kQ = para->getParH(level)->QPropeller.kQ; + in.readLine(); + if (level == para->getFine()) + { + for(int u=0; u<para->getParH(level)->QPropeller.kQ; u++) + { + test = in.readInteger(); + if (para->getParH(level)->geoSP[test] == GEO_FLUID) + { + count++; + } + //////////////////////////////////////////////////////////////////////// + //for(unsigned int ix3=0; ix3<para->getParH(level)->nz; ix3++) + //{ + // for(unsigned int ix2=0; ix2<para->getParH(level)->ny; ix2++) + // { + // for(unsigned int ix1=0; ix1<para->getParH(level)->nx; ix1++) + // { + // unsigned int m = para->getParH(level)->nx*(para->getParH(level)->ny*ix3 + ix2) + ix1; + // if (para->getParH(level)->k[m] == test) + // { + // if(para->getParH(level)->geo[m] == 1) + // { + // count++; + // } + // } + // } + // } + //} + //count++; + //////////////////////////////////////////////////////////////////////// + in.readDouble(); + in.readDouble(); + in.readDouble(); + in.readLine(); + } + } + else + { + for(int u=0; u<para->getParH(level)->QPropeller.kQ; u++) + { + in.readInteger(); + in.readDouble(); + in.readDouble(); + in.readDouble(); + in.readLine(); + } + } + para->getParH(level)->QPropeller.kQ = count; + para->getParD(level)->QPropeller.kQ = para->getParH(level)->QPropeller.kQ; + } +} +////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////// +void PositionReader::readFilePropellerCylinder(Parameter* para) +{ + UbFileInputASCII in(para->getpropellerCylinder()); + int test = 0, count = 0; + int maxlevel = in.readInteger(); + in.readLine(); + + for (int level = 0; level < maxlevel; level++) + { + int allnodes = in.readInteger(); + in.readLine(); + if (level == para->getFine()) + { + for(int u=0; u<allnodes; u++) + { + test = in.readInteger(); + //////////////////////////////////////////////////////////////////////// + if (para->getParH(level)->geoSP[test] == GEO_FLUID) + { + para->getParH(level)->QPropeller.k[count] = test; + para->getParH(level)->QPropeller.Vx[count] = (real)in.readDouble(); + para->getParH(level)->QPropeller.Vy[count] = (real)in.readDouble(); + para->getParH(level)->QPropeller.Vz[count] = (real)in.readDouble(); + para->getParH(level)->QPropeller.RhoBC[count] = 0.0f; + count++; + } + else + { + in.readDouble(); + in.readDouble(); + in.readDouble(); + } + //para->getParH(level)->QPropeller.k[count] = test; + //para->getParH(level)->QPropeller.Vx[count] = (real)in.readDouble(); + //para->getParH(level)->QPropeller.Vy[count] = (real)in.readDouble(); + //para->getParH(level)->QPropeller.Vz[count] = (real)in.readDouble(); + //para->getParH(level)->QPropeller.Vx[count] = 0.07f; + //para->getParH(level)->QPropeller.Vy[count] = 0.0f; + //para->getParH(level)->QPropeller.Vz[count] = 0.0f; + in.readLine(); + } + } + else + { + for(int u=0; u<allnodes; u++) + { + in.readInteger(); + in.readDouble(); + in.readDouble(); + in.readDouble(); + in.readLine(); + } + } + printf("allnodes = %d, count = %d\n", allnodes, count); + } +} +////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////// +void PositionReader::definePropellerQs(Parameter* para) +{ + ////////////////////////////////////////////////////////////////// + //preprocessing + real* QQ = para->getParH(para->getFine())->QPropeller.q27[0]; + unsigned int sizeQ = para->getParH(para->getFine())->QPropeller.kQ; + QforBoundaryConditions Q; + Q.q27[dirE ] = &QQ[dirE *sizeQ]; + Q.q27[dirW ] = &QQ[dirW *sizeQ]; + Q.q27[dirN ] = &QQ[dirN *sizeQ]; + Q.q27[dirS ] = &QQ[dirS *sizeQ]; + Q.q27[dirT ] = &QQ[dirT *sizeQ]; + Q.q27[dirB ] = &QQ[dirB *sizeQ]; + Q.q27[dirNE ] = &QQ[dirNE *sizeQ]; + Q.q27[dirSW ] = &QQ[dirSW *sizeQ]; + Q.q27[dirSE ] = &QQ[dirSE *sizeQ]; + Q.q27[dirNW ] = &QQ[dirNW *sizeQ]; + Q.q27[dirTE ] = &QQ[dirTE *sizeQ]; + Q.q27[dirBW ] = &QQ[dirBW *sizeQ]; + Q.q27[dirBE ] = &QQ[dirBE *sizeQ]; + Q.q27[dirTW ] = &QQ[dirTW *sizeQ]; + Q.q27[dirTN ] = &QQ[dirTN *sizeQ]; + Q.q27[dirBS ] = &QQ[dirBS *sizeQ]; + Q.q27[dirBN ] = &QQ[dirBN *sizeQ]; + Q.q27[dirTS ] = &QQ[dirTS *sizeQ]; + Q.q27[dirZERO] = &QQ[dirZERO*sizeQ]; + Q.q27[dirTNE ] = &QQ[dirTNE *sizeQ]; + Q.q27[dirTSW ] = &QQ[dirTSW *sizeQ]; + Q.q27[dirTSE ] = &QQ[dirTSE *sizeQ]; + Q.q27[dirTNW ] = &QQ[dirTNW *sizeQ]; + Q.q27[dirBNE ] = &QQ[dirBNE *sizeQ]; + Q.q27[dirBSW ] = &QQ[dirBSW *sizeQ]; + Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; + Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; + ////////////////////////////////////////////////////////////////// + for(int u=0; u<para->getParH(para->getFine())->QPropeller.kQ; u++) + { + for (int dir = dirE; dir<=dirBSW; dir++) + { + if ((dir==dirE) || + (dir==dirNE) || (dir==dirSE) || (dir==dirTE) || (dir==dirBE) || + (dir==dirTNE)|| (dir==dirBNE)|| (dir==dirTSE)|| (dir==dirBSE)) + { + Q.q27[dir][u] = 1.0f; + } + else + { + Q.q27[dir][u] = -1.0f; + } + } + } + ////////////////////////////////////////////////////////////////// +} +////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////// +void PositionReader::readMeasurePoints( Parameter* para ) +{ + UbFileInputASCII in(para->getmeasurePoints()); + int numberOfAllNodes = in.readInteger(); + in.readLine(); + int tempLevel; + MeasurePoints tempMP; + //printf("done, init the values...\n"); + for (int u = 0; u < numberOfAllNodes; u++) + { + tempMP.name = in.readString(); + //printf("done, read the name...\n"); + tempMP.k = in.readInteger(); + //printf("done, read k...\n"); + tempLevel = in.readInteger(); + //printf("done, read level...\n"); + in.readLine(); + //printf("done, read the values...\n"); + para->getParH(tempLevel)->MP.push_back(tempMP); + //printf("done, put it into a vector...\n"); + } +} diff --git a/src/gpu/VirtualFluids_GPU/Init/PositionReader.h b/src/gpu/VirtualFluids_GPU/Init/PositionReader.h new file mode 100644 index 0000000000000000000000000000000000000000..b12a17c8148f4b5b1d5b656e0c9ea04d88eee89f --- /dev/null +++ b/src/gpu/VirtualFluids_GPU/Init/PositionReader.h @@ -0,0 +1,15 @@ +#ifndef POSITION_READER_H +#define POSITION_READER_H + +class Parameter; + +class PositionReader +{ +public: + static void readFilePropellerCylinderForAlloc(Parameter* para); + static void readFilePropellerCylinder(Parameter* para); + static void definePropellerQs(Parameter* para); + static void readMeasurePoints(Parameter* para); +}; + +#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp b/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp deleted file mode 100644 index 4c1bca688e27ef8696d993bbacbef8547245263e..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "Init/ReadGeometry.h" - -//////////////////////////////////////////////////////////////////////////////// -void readGeometry(Parameter* para, vf::gpu::Communicator* comm, int lev, std::string geometryFile) -{ - int dataSizePerGPU = para->getParH(lev)->gridNX * para->getParH(lev)->gridNY * para->getParH(lev)->gridNZ; - unsigned int dataSizeTotal = para->getParH(lev)->gridNX * para->getParH(lev)->gridNY * para->getParH(lev)->gridNZ * para->getNumprocs(); - unsigned int * dataRoot = NULL; - - unsigned int m, l; - if(para->getMyID() == 0) // Are we the root node? - { - dataRoot = new unsigned int[dataSizeTotal]; - VtkGeometryReader::readFile(geometryFile, dataRoot); - } - - std::cout << "dataSizePerGPU size: " << dataSizePerGPU << "\n"; - - unsigned int *dataGPU = new unsigned int[dataSizePerGPU]; - - std::cout << "distributeGeometry: start \n"; - comm->distributeGeometry(dataRoot, dataGPU, dataSizePerGPU); - std::cout << "distributeGeometry: end \n"; - - l=0; - for(unsigned int k=STARTOFFZ ; k < para->getParH(lev)->gridNZ + STARTOFFZ ; k++) - { - for(unsigned int j=STARTOFFY ; j < para->getParH(lev)->gridNY + STARTOFFY ; j++) - { - for(unsigned int i=STARTOFFX ; i < para->getParH(lev)->gridNX + STARTOFFX ; i++) - { - m = para->getParH(lev)->nx* (para->getParH(lev)->ny * k + j) + i; - para->getParH(lev)->geo[m] = dataGPU[l]; - l++; - } - } - } - - if(para->getMyID() == 0) - delete [] dataRoot; - - delete [] dataGPU; -} diff --git a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.h b/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.h deleted file mode 100644 index 5bc42081e065188bbe6711b61d160643149ee961..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef READ_GEOMETRY_H -#define READ_GEOMETRY_H - -#include "Parameter/Parameter.h" -#include "Communication/Communicator.h" -#include "Input/VtkGeometryReader.h" - -#include <iostream> - -extern "C" void readGeometry(Parameter* para, vf::gpu::Communicator* comm, int lev, std::string geometryFile); - -#endif diff --git a/src/gpu/VirtualFluids_GPU/Init/SetParameter.cpp b/src/gpu/VirtualFluids_GPU/Init/SetParameter.cpp deleted file mode 100644 index a4279516b84f6d49eab385d09cdd456e83dff467..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/SetParameter.cpp +++ /dev/null @@ -1,260 +0,0 @@ -//#include "Init/SetParameter.h" -//#include "Interface_OpenFOAM/Interface.h" -// -////////////////////////////////////////////////////////////////////////////////// -//void setParameters(Parameter* para, vf::gpu::Communicator* comm, std::string &cstr) -//{ -// ConfigFile cf(cstr.c_str()); -// if ( !cf.read() ) -// { -// std::string exceptionText = "Unable to read configuration file\n"; -// throw exceptionText; -// } -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// para->setMaxDev( StringUtil::toInt(cf.getValue( "NumberOfDevices" ))); -// para->setMyID( comm->getPID()); -// para->setNumprocs( comm->getNummberOfProcess()); -// para->setDevices( StringUtil::toVector<int>(cf.getValue( "Devices" ))); -// devCheck( comm->mapCudaDevice(para->getMyID(), para->getNumprocs(), para->getDevices(), para->getMaxDev())); -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// std::string _path = cf.getValue( "Path" ); -// std::string _prefix = cf.getValue( "Prefix" ); -// std::string _gridpath = cf.getValue( "GridPath" ); -// std::string gridPath = getGridPath(para, _gridpath); -// para->setOutputPath( _path); -// para->setOutputPrefix( _prefix); -// para->setFName( _path + "/" + _prefix); -// para->setPrintFiles( false); -// para->setPrintFiles( StringUtil::toBool( cf.getValue( "WriteGrid" ))); -// para->setGeometryValues( StringUtil::toBool( cf.getValue( "GeometryValues" ))); -// para->setCalc2ndOrderMoments( StringUtil::toBool( cf.getValue( "calc2ndOrderMoments" ))); -// para->setCalc3rdOrderMoments( StringUtil::toBool( cf.getValue( "calc3rdOrderMoments" ))); -// para->setCalcHighOrderMoments(StringUtil::toBool( cf.getValue( "calcHigherOrderMoments" ))); -// para->setReadGeo( StringUtil::toBool( cf.getValue( "ReadGeometry" ))); -// para->setCalcMedian( StringUtil::toBool( cf.getValue( "calcMedian" ))); -// para->setConcFile( StringUtil::toBool( cf.getValue( "UseConcFile" ))); -// para->setUseMeasurePoints( StringUtil::toBool( cf.getValue( "UseMeasurePoints"))); -// para->setUseWale( StringUtil::toBool( cf.getValue( "UseWale" ))); -// para->setSimulatePorousMedia( StringUtil::toBool( cf.getValue( "SimulatePorousMedia" ))); -// para->setD3Qxx( StringUtil::toInt( cf.getValue( "D3Qxx" ))); -// para->setMaxLevel( StringUtil::toInt( cf.getValue( "NOGL" ))); -// para->setTEnd( StringUtil::toInt( cf.getValue( "TimeEnd" ))); -// para->setTOut( StringUtil::toInt( cf.getValue( "TimeOut" ))); -// para->setTStartOut( StringUtil::toInt( cf.getValue( "TimeStartOut"))); -// para->setTimeCalcMedStart( StringUtil::toInt( cf.getValue( "TimeStartCalcMedian" ))); -// para->setTimeCalcMedEnd( StringUtil::toInt( cf.getValue( "TimeEndCalcMedian" ))); -// para->setPressInID( StringUtil::toInt( cf.getValue( "PressInID" ))); -// para->setPressOutID( StringUtil::toInt( cf.getValue( "PressOutID" ))); -// para->setPressInZ( StringUtil::toInt( cf.getValue( "PressInZ" ))); -// para->setPressOutZ( StringUtil::toInt( cf.getValue( "PressOutZ" ))); -// ////////////////////////////////////////////////////////////////////////// -// para->setDiffOn( StringUtil::toBool( cf.getValue( "DiffOn" ))); -// para->setDiffMod( StringUtil::toInt( cf.getValue( "DiffMod" ))); -// para->setDiffusivity( StringUtil::toFloat(cf.getValue( "Diffusivity" ))); -// para->setTemperatureInit( StringUtil::toFloat(cf.getValue( "Temp" ))); -// para->setTemperatureBC( StringUtil::toFloat(cf.getValue( "TempBC" ))); -// ////////////////////////////////////////////////////////////////////////// -// para->setViscosity( StringUtil::toFloat(cf.getValue( "Viscosity_LB" ))); -// para->setVelocity( StringUtil::toFloat(cf.getValue( "Velocity_LB" ))); -// para->setViscosityRatio( StringUtil::toFloat(cf.getValue( "Viscosity_Ratio_World_to_LB" ))); -// para->setVelocityRatio( StringUtil::toFloat(cf.getValue( "Velocity_Ratio_World_to_LB" ))); -// para->setDensityRatio( StringUtil::toFloat(cf.getValue( "Density_Ratio_World_to_LB" ))); -// para->setPressRatio( StringUtil::toFloat(cf.getValue( "Delta_Press" ))); -// para->setRealX( StringUtil::toFloat(cf.getValue( "SliceRealX" ))); -// para->setRealY( StringUtil::toFloat(cf.getValue( "SliceRealY" ))); -// para->setFactorPressBC( StringUtil::toFloat(cf.getValue( "dfpbc" ))); -// para->setGeometryFileC( cf.getValue( "GeometryC" )); -// para->setGeometryFileM( cf.getValue( "GeometryM" )); -// para->setGeometryFileF( cf.getValue( "GeometryF" )); -// ////////////////////////////////////////////////////////////////////////// -// para->setgeoVec( gridPath + cf.getValue( "geoVec" )); -// para->setcoordX( gridPath + cf.getValue( "coordX" )); -// para->setcoordY( gridPath + cf.getValue( "coordY" )); -// para->setcoordZ( gridPath + cf.getValue( "coordZ" )); -// para->setneighborX( gridPath + cf.getValue( "neighborX" )); -// para->setneighborY( gridPath + cf.getValue( "neighborY" )); -// para->setneighborZ( gridPath + cf.getValue( "neighborZ" )); -// para->setscaleCFC( gridPath + cf.getValue( "scaleCFC" )); -// para->setscaleCFF( gridPath + cf.getValue( "scaleCFF" )); -// para->setscaleFCC( gridPath + cf.getValue( "scaleFCC" )); -// para->setscaleFCF( gridPath + cf.getValue( "scaleFCF" )); -// para->setscaleOffsetCF( gridPath + cf.getValue( "scaleOffsetCF" )); -// para->setscaleOffsetFC( gridPath + cf.getValue( "scaleOffsetFC" )); -// para->setgeomBoundaryBcQs( gridPath + cf.getValue( "geomBoundaryBcQs" )); -// para->setgeomBoundaryBcValues(gridPath + cf.getValue( "geomBoundaryBcValues" )); -// para->setinletBcQs( gridPath + cf.getValue( "inletBcQs" )); -// para->setinletBcValues( gridPath + cf.getValue( "inletBcValues" )); -// para->setoutletBcQs( gridPath + cf.getValue( "outletBcQs" )); -// para->setoutletBcValues( gridPath + cf.getValue( "outletBcValues" )); -// para->settopBcQs( gridPath + cf.getValue( "topBcQs" )); -// para->settopBcValues( gridPath + cf.getValue( "topBcValues" )); -// para->setbottomBcQs( gridPath + cf.getValue( "bottomBcQs" )); -// para->setbottomBcValues( gridPath + cf.getValue( "bottomBcValues" )); -// para->setfrontBcQs( gridPath + cf.getValue( "frontBcQs" )); -// para->setfrontBcValues( gridPath + cf.getValue( "frontBcValues" )); -// para->setbackBcQs( gridPath + cf.getValue( "backBcQs" )); -// para->setbackBcValues( gridPath + cf.getValue( "backBcValues" )); -// para->setnumberNodes( gridPath + cf.getValue( "numberNodes" )); -// para->setLBMvsSI( gridPath + cf.getValue( "LBMvsSI" )); -// //////////////////////////////gridPath + //////////////////////////////////////////// -// para->setmeasurePoints( gridPath + cf.getValue( "measurePoints" )); -// para->setpropellerValues( gridPath + cf.getValue( "propellerValues" )); -// para->setclockCycleForMP( StringUtil::toFloat(cf.getValue( "measureClockCycle" ))); -// para->settimestepForMP( StringUtil::toInt(cf.getValue( "measureTimestep" ))); -// para->setcpTop( gridPath + cf.getValue( "cpTop" )); -// para->setcpBottom( gridPath + cf.getValue( "cpBottom" )); -// para->setcpBottom2( gridPath + cf.getValue( "cpBottom2" )); -// para->setConcentration( gridPath + cf.getValue( "Concentration" )); -// ////////////////////////////////////////////////////////////////////////// -// //Normals - Geometry -// para->setgeomBoundaryNormalX( gridPath + cf.getValue( "geomBoundaryNormalX" )); -// para->setgeomBoundaryNormalY( gridPath + cf.getValue( "geomBoundaryNormalY" )); -// para->setgeomBoundaryNormalZ( gridPath + cf.getValue( "geomBoundaryNormalZ" )); -// //Normals - Inlet -// para->setInflowBoundaryNormalX( gridPath + cf.getValue( "inletBoundaryNormalX" )); -// para->setInflowBoundaryNormalY( gridPath + cf.getValue( "inletBoundaryNormalY" )); -// para->setInflowBoundaryNormalZ( gridPath + cf.getValue( "inletBoundaryNormalZ" )); -// //Normals - Outlet -// para->setOutflowBoundaryNormalX( gridPath + cf.getValue( "outletBoundaryNormalX" )); -// para->setOutflowBoundaryNormalY( gridPath + cf.getValue( "outletBoundaryNormalY" )); -// para->setOutflowBoundaryNormalZ( gridPath + cf.getValue( "outletBoundaryNormalZ" )); -// ////////////////////////////////////////////////////////////////////////// -// //Forcing -// para->setForcing(StringUtil::toFloat(cf.getValue( "ForcingX")), StringUtil::toFloat(cf.getValue( "ForcingY")), StringUtil::toFloat(cf.getValue( "ForcingZ"))); -// ////////////////////////////////////////////////////////////////////////// -// //Particles -// para->setCalcParticles( StringUtil::toBool( cf.getValue( "calcParticles" ))); -// para->setParticleBasicLevel(StringUtil::toInt( cf.getValue( "baseLevel" ))); -// para->setParticleInitLevel( StringUtil::toInt( cf.getValue( "initLevel" ))); -// para->setNumberOfParticles( StringUtil::toInt( cf.getValue( "numberOfParticles" ))); -// para->setneighborWSB( gridPath + cf.getValue( "neighborWSB" )); -// para->setStartXHotWall( StringUtil::toDouble(cf.getValue("startXHotWall" ))); -// para->setEndXHotWall( StringUtil::toDouble(cf.getValue("endXHotWall" ))); -// ////////////////////////////////////////////////////////////////////////// -// //for Multi GPU -// if (para->getNumprocs()>1) -// { -// //////////////////////////////////////////////////////////////////////////// -// ////1D domain decomposition -// //std::vector<std::string> sendProcNeighbors; -// //std::vector<std::string> recvProcNeighbors; -// //for (int i = 0; i<para->getNumprocs();i++) -// //{ -// // sendProcNeighbors.push_back(gridPath + StringUtil::toString(i) + "s.dat"); -// // recvProcNeighbors.push_back(gridPath + StringUtil::toString(i) + "r.dat"); -// //} -// //para->setPossNeighborFiles(sendProcNeighbors, "send"); -// //para->setPossNeighborFiles(recvProcNeighbors, "recv"); -// ////////////////////////////////////////////////////////////////////////// -// //3D domain decomposition -// std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; -// std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; -// for (int i = 0; i<para->getNumprocs();i++) -// { -// sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); -// sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); -// sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); -// recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); -// recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); -// recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); -// } -// para->setPossNeighborFilesX(sendProcNeighborsX, "send"); -// para->setPossNeighborFilesY(sendProcNeighborsY, "send"); -// para->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); -// para->setPossNeighborFilesX(recvProcNeighborsX, "recv"); -// para->setPossNeighborFilesY(recvProcNeighborsY, "recv"); -// para->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); -// } -// ////////////////////////////////////////////////////////////////////////// -// //para->setkFull( cf.getValue( "kFull" )); -// //para->setgeoFull( cf.getValue( "geoFull" )); -// //para->setnoSlipBcPos( cf.getValue( "noSlipBcPos" )); -// //para->setnoSlipBcQs( cf.getValue( "noSlipBcQs" )); -// //para->setnoSlipBcValues( cf.getValue( "noSlipBcValues" )); -// //para->setnoSlipBcValue( cf.getValue( "noSlipBcValue" )); -// //para->setslipBcPos( cf.getValue( "slipBcPos" )); -// //para->setslipBcQs( cf.getValue( "slipBcQs" )); -// //para->setslipBcValue( cf.getValue( "slipBcValue" )); -// //para->setpressBcPos( cf.getValue( "pressBcPos" )); -// //para->setpressBcQs( cf.getValue( "pressBcQs" )); -// //para->setpressBcValues( cf.getValue( "pressBcValues" )); -// //para->setpressBcValue( cf.getValue( "pressBcValue" )); -// //para->setvelBcQs( cf.getValue( "velBcQs" )); -// //para->setvelBcValues( cf.getValue( "velBcValues" )); -// //para->setpropellerCylinder( cf.getValue( "propellerCylinder" )); -// //para->setpropellerQs( cf.getValue( "propellerQs" )); -// //para->setwallBcQs( cf.getValue( "wallBcQs" )); -// //para->setwallBcValues( cf.getValue( "wallBcValues" )); -// //para->setperiodicBcQs( cf.getValue( "periodicBcQs" )); -// //para->setperiodicBcValues( cf.getValue( "periodicBcValues" )); -// //cout << "Try this: " << para->getgeomBoundaryBcValues() << endl; -// -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// //Restart -// para->setTimeDoCheckPoint( StringUtil::toInt( cf.getValue( "TimeDoCheckPoint" ))); -// para->setTimeDoRestart( StringUtil::toInt( cf.getValue( "TimeDoRestart" ))); -// para->setDoCheckPoint( StringUtil::toBool( cf.getValue( "DoCheckPoint" ))); -// para->setDoRestart( StringUtil::toBool( cf.getValue( "DoRestart" ))); -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// para->setGridX( StringUtil::toVector<int>(cf.getValue( "GridX" ))); //GridX = StringUtil::toVector<int>(cf.getValue( "GridX" )); -// para->setGridY( StringUtil::toVector<int>(cf.getValue( "GridY" ))); //GridY = StringUtil::toVector<int>(cf.getValue( "GridY" )); -// para->setGridZ( StringUtil::toVector<int>(cf.getValue( "GridZ" ))); //GridZ = StringUtil::toVector<int>(cf.getValue( "GridZ" )); -// para->setDistX( StringUtil::toVector<int>(cf.getValue( "DistX" ))); //DistX = StringUtil::toVector<int>(cf.getValue( "DistX" )); -// para->setDistY( StringUtil::toVector<int>(cf.getValue( "DistY" ))); //DistY = StringUtil::toVector<int>(cf.getValue( "DistY" )); -// para->setDistZ( StringUtil::toVector<int>(cf.getValue( "DistZ" ))); //DistZ = StringUtil::toVector<int>(cf.getValue( "DistZ" )); -// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// para->setNeedInterface( StringUtil::toVector<bool>(cf.getValue( "NeedInterface" ))); -// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Interface *config = new Interface(false); -// config->setDimensions(para); -// config->setBoundingBox(para); -// delete config; -// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// para->initParameter(); -// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// para->setRe(para->getVelocity() * (real)1.0 / para->getViscosity()); -// para->setPhi((real) 0.0); -// para->setlimitOfNodesForVTK(30000000); //max 30 Million nodes per VTK file -// if (para->getDoRestart()) -// { -// para->setStartTurn(para->getTimeDoRestart()); -// } -// else -// { -// para->setStartTurn((unsigned int)0); //100000 -// } -// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//} -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -////////////////////////////////////////////////////////////////////////////////// -//std::string getGridPath(Parameter* para, std::string Gridpath) -//{ -// if(para->getNumprocs()==1) -// { -// return Gridpath + "/"; -// } -// else -// { -// return Gridpath + "/" + StringUtil::toString(para->getMyID()) + "/"; -// } -// -//} -////////////////////////////////////////////////////////////////////////////////// -// diff --git a/src/gpu/VirtualFluids_GPU/Init/SetParameter.h b/src/gpu/VirtualFluids_GPU/Init/SetParameter.h deleted file mode 100644 index 7298c40f2c3efd5fa3c82748f856c7c0ba981b83..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Init/SetParameter.h +++ /dev/null @@ -1,15 +0,0 @@ -//#ifndef SET_PARAMETER_H -//#define SET_PARAMETER_H -// -//#include "Parameter/Parameter.h" -//#include "Input/ConfigFile.h" -//#include "Utilities/StringUtil.hpp" -//#include "GPU/devCheck.h" -//#include "Communication/Communicator.h" -// -//#include <iostream> -// -//void setParameters(Parameter* para, vf::gpu::Communicator* comm, std::string &cstr); -//std::string getGridPath(Parameter* para, std::string Gridpath); -// -//#endif diff --git a/src/gpu/VirtualFluids_GPU/Init/VfReader.cpp b/src/gpu/VirtualFluids_GPU/Init/VfReader.cpp index 89d214186f9bf7140e2689bc522d21f19c7603a0..aa94cb658764c4648e30811255312afd26c92cc4 100644 --- a/src/gpu/VirtualFluids_GPU/Init/VfReader.cpp +++ b/src/gpu/VirtualFluids_GPU/Init/VfReader.cpp @@ -1,284 +1,10 @@ #include "Init/VfReader.h" +#include "Parameter/Parameter.h" +#include "Communication/Communicator.h" +#include "Init/PositionReader.h" #include "GPU/CudaMemoryManager.h" -//////////////////////////////////////////////////////////////////////////////// -void readVFkFull(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile) -{ - kFullReader::readFileForAlloc(geometryFile, para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocFull(lev); - ////////////////////////////////////////////////////////////////////////// - for(unsigned int ix3=0; ix3<para->getParH(lev)->nz; ix3++) - { - for(unsigned int ix2=0; ix2<para->getParH(lev)->ny; ix2++) - { - for(unsigned int ix1=0; ix1<para->getParH(lev)->nx; ix1++) - { - unsigned int m = para->getParH(lev)->nx*(para->getParH(lev)->ny*ix3 + ix2) + ix1; - para->getParH(lev)->k[m] = 0; - para->getParH(lev)->geo[m] = 16; - } - } - } - } - - kFullReader::readFile(geometryFile, para); -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readVFgeoFull(Parameter* para, const std::string geometryFile) -{ - kFullReader::readGeoFull(geometryFile, para); - - ////////////////////////////////////////////////////////////////////////// - //for (int lev = 0; lev <= para->getMaxLevel(); lev++) - //{ - // for(unsigned int ix3=0; ix3<para->getParH(lev)->nz; ix3++) - // { - // for(unsigned int ix2=0; ix2<para->getParH(lev)->ny; ix2++) - // { - // for(unsigned int ix1=0; ix1<para->getParH(lev)->nx; ix1++) - // { - // unsigned int m = para->getParH(lev)->nx*(para->getParH(lev)->ny*ix3 + ix2) + ix1; - // if (para->getParH(lev)->geo[m] == 0 || para->getParH(lev)->geo[m] == 15) - // { - // para->getParH(lev)->geo[m] = 16; - // } - // } - // } - // } - //} -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readVecSP(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFileForAlloc(para->getgeoVec(), para); - - //alloc - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocSP(lev); - } - - //geoSP - PositionReader::readFile(para->getgeoVec(), "geoVec", para); - //neighborX - PositionReader::readFile(para->getneighborX(), "neighborX", para); - //neighborY - PositionReader::readFile(para->getneighborY(), "neighborY", para); - //neighborZ - PositionReader::readFile(para->getneighborZ(), "neighborZ", para); - - //Copy Host -> Device - for(int lev = 0; lev <= para->getMaxLevel(); lev++) - { - for(unsigned int u=0; u<para->getParH(lev)->size_Mat_SP; u++) - { - para->getParH(lev)->rho_SP[u] = 0.01f;//+ lev/100.f; - para->getParH(lev)->vx_SP[u] = 0.0f;//+ lev/100.f; - para->getParH(lev)->vy_SP[u] = 0.0f;//+ lev/100.f; - para->getParH(lev)->vz_SP[u] = 0.0f;//+ lev/100.f; - para->getParH(lev)->press_SP[u] = 0.0f;//+ lev/100.f; - //Median - para->getParH(lev)->rho_SP_Med[u] = 0.0f; - para->getParH(lev)->vx_SP_Med[u] = 0.0f; - para->getParH(lev)->vy_SP_Med[u] = 0.0f; - para->getParH(lev)->vz_SP_Med[u] = 0.0f; - para->getParH(lev)->press_SP_Med[u] = 0.0f; - } - cudaManager->cudaCopySP(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readInterfaceCF(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFileInterfaceForAlloc(para->getscaleCFC(), "CF", para); - - //alloc - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocInterfaceCF(lev); - } - - //Scale Coarse to Fine - Coarse - PositionReader::readFileInterface(para->getscaleCFC(), "CFC", para); - //Scale Coarse to Fine - Fine - PositionReader::readFileInterface(para->getscaleCFF(), "CFF", para); - - //Copy Host -> Device - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyInterfaceCF(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readInterfaceFC(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFileInterfaceForAlloc(para->getscaleFCC(), "FC", para); - - //alloc - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocInterfaceFC(lev); - } - - //Scale Fine to Coarse - Coarse - PositionReader::readFileInterface(para->getscaleFCC(), "FCC", para); - //Scale Fine to Coarse - Fine - PositionReader::readFileInterface(para->getscaleFCF(), "FCF", para); - - //Copy Host -> Device - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyInterfaceFC(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readInterfaceOffCF(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile) -{ - PositionReader::readFileInterfaceOffsetForAlloc(geometryFile, "CF", para); - - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocInterfaceOffCF(lev); - } - - PositionReader::readFileInterfaceOffset(geometryFile, "CF", para); - - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyInterfaceOffCF(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readInterfaceOffFC(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile) -{ - PositionReader::readFileInterfaceOffsetForAlloc(geometryFile, "FC", para); - - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocInterfaceOffFC(lev); - } - - PositionReader::readFileInterfaceOffset(geometryFile, "FC", para); - - for (int lev = 0; lev < para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyInterfaceOffFC(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readNoSlipBc(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFileNoSlipBcForAlloc(para->getnoSlipBcPos(), para); - PositionReader::readFileNoSlipBcQreadForAlloc(para->getnoSlipBcQs(), para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocWallBC(lev); - } - - PositionReader::readFileNoSlipBcPos(para->getnoSlipBcPos(), para); - PositionReader::readFileNoSlipBcValue(para->getnoSlipBcValue(), para); - PositionReader::readFileNoSlipBcQs(para->getnoSlipBcQs(), para); - - PositionReader::findQs(para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyWallBC(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readSlipBc(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFileSlipBcForAlloc(para->getslipBcPos(), para); - PositionReader::readFileSlipBcQreadForAlloc(para->getslipBcQs(), para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocSlipBC(lev); - } - - PositionReader::readFileSlipBcPos(para->getslipBcPos(), para); - PositionReader::readFileSlipBcValue(para->getslipBcValue(), para); - PositionReader::readFileSlipBcQs(para->getslipBcQs(), para); - - PositionReader::findSlipQs(para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaCopySlipBC(lev); - } -} -//////////////////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////////////////// -void readPressBc(Parameter* para, CudaMemoryManager* cudaManager) -{ - PositionReader::readFilePressBcForAlloc(para->getpressBcPos(), para); - PositionReader::readFilePressBcQreadForAlloc(para->getpressBcQs(), para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaAllocPress(lev); - } - //only Coarse - //para->cudaAllocPress(para->getCoarse()); - - PositionReader::readFilePressBcPos(para->getpressBcPos(), para); - PositionReader::readFilePressBcValue(para->getpressBcValue(), para); - PositionReader::readFilePressBcQs(para->getpressBcQs(), para); - - PositionReader::findPressQs(para); - - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - cudaManager->cudaCopyPress(lev); - } - //only Coarse - //para->cudaCopyPress(para->getCoarse()); -} -//////////////////////////////////////////////////////////////////////////////// - - - //////////////////////////////////////////////////////////////////////////////// void readPropellerCylinder(Parameter* para, CudaMemoryManager* cudaManager) { @@ -291,9 +17,6 @@ void readPropellerCylinder(Parameter* para, CudaMemoryManager* cudaManager) cudaManager->cudaCopyVeloPropeller(para->getFine()); } -//////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////// void readMeasurePoints(Parameter* para, CudaMemoryManager* cudaManager) diff --git a/src/gpu/VirtualFluids_GPU/Init/VfReader.h b/src/gpu/VirtualFluids_GPU/Init/VfReader.h index 614c269d36c9a50f329ddbd8a2bef8d473a0769f..c7d95e8e769b5b7536c471af90073c314f5b3e94 100644 --- a/src/gpu/VirtualFluids_GPU/Init/VfReader.h +++ b/src/gpu/VirtualFluids_GPU/Init/VfReader.h @@ -1,38 +1,13 @@ #ifndef VF_READER_H #define VF_READER_H -#include "Parameter/Parameter.h" -#include "Communication/Communicator.h" -#include "Input/kFullReader.h" -#include "Input/PositionReader.h" -//#include "GPU/GPU_Interface.h" - -#include <iostream> class CudaMemoryManager; +class Parameter; -extern "C" void readVFkFull(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile); - -extern "C" void readVFgeoFull(Parameter* para, const std::string geometryFile); - -extern "C" void readVecSP(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void readInterfaceCF(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void readInterfaceFC(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void readInterfaceOffCF(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile); - -extern "C" void readInterfaceOffFC(Parameter* para, CudaMemoryManager* cudaManager, const std::string geometryFile); - -extern "C" void readNoSlipBc(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void readSlipBc(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void readPressBc(Parameter* para, CudaMemoryManager* cudaManager); -extern "C" void readPropellerCylinder(Parameter* para, CudaMemoryManager* cudaManager); +void readPropellerCylinder(Parameter* para, CudaMemoryManager* cudaManager); -extern "C" void readMeasurePoints(Parameter* para, CudaMemoryManager* cudaManager); +void readMeasurePoints(Parameter* para, CudaMemoryManager* cudaManager); #endif diff --git a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp b/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp deleted file mode 100644 index cfe4da2c7381fbcd5998a91eee2c662601dff554..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp +++ /dev/null @@ -1,198 +0,0 @@ -#include "ConfigFile.h" -#include <errno.h> -#include <algorithm> -#include <sstream> -#include <iostream> -#include <string> - -#include "Core/StringUtilities/StringUtil.h" - - -ConfigFile::ConfigFile( const char *strConfigFile ) -{ - if ( strConfigFile ) - m_sConfigFile = strConfigFile; -} -ConfigFile::~ConfigFile() -{ -} -bool ConfigFile::read() -{ - m_in.open(m_sConfigFile.c_str(),std::ios::in); - if (m_in.fail()) - { - return false; - } - while (!m_in.eof()) - { - //-------------------------------------------------------- - // Get a token and value. - // This gives values to member vars: m_token and m_value. - //---------------------------------------------------------- - get_token_and_value(); - if ( m_token.length() ) - m_ConfigEntries.insert( String_Pair(m_token, m_value) ); - } - m_in.close(); - return true; -} -void ConfigFile::get_token_and_value(void) -{ - char token[1024]; - char ch; - bool found_equal=false; - int i=0; - eat_white_and_comments(); - while(!(m_in.get(ch)).fail()) - { - if ((ch != '\t')) - { - if ( (ch == '=') || (ch == ' ') || (ch == '\n') || (ch == '\r') || - (ch == '\t')) - { - if (ch == '=')found_equal=true; - break; - } - token[i++]=ch; - } - } - if (i==0) - { - // It didn�t find a token, in this case. - m_token=""; - m_value=""; - return; - } - // Null-terminate the token that was found. - token[i++]='\0'; - m_token = token; - makeLower(m_token); - // Advance to the equal sign, if need be. - if (!found_equal) - { - if (!advance_to_equal_sign_on_line()) - { - // The token had no value. - m_token=""; - m_value=""; - return; - } - } - // Get the token�s value. - i=0; - char c = eat_white_and_comments(false); - if ( c != '\n' ) - { - i=0; - while(!(m_in.get(ch)).fail()) - { - if ((ch == '\t') || (ch == '\r') || (ch == '\n') || (ch == '#') ) - { - while (ch!='\n') - { - if (m_in.get(ch).fail()) break; - } - break; - } - else - { - token[i++]=ch; - } - } - } - if (i==0) - { - // This token had no value. - m_value=""; - } - else - { - token[i++]='\0'; - m_value=token; - // Remove leading/trailing spaces. - m_value = StringUtil::trim(m_value); - // Strip leading and trailing quotes, if there are any. - if ( m_value[0] == '"' ) - m_value = m_value.substr( 1 ); - if ( m_value[ m_value.length() -1 ] == '"' ) - m_value = m_value.substr( 0, m_value.length()-1 ); - } -} -bool ConfigFile::advance_to_equal_sign_on_line() -{ - char ch; - bool found_equal=false; - while ( !(m_in.get(ch)).fail() ) - { - if ((ch=='\r')||(ch=='\n')) break; - if (ch == '=') - { - found_equal=true; - break; - } - } - return found_equal; -} -char ConfigFile::eat_white_and_comments(bool traverse_newlines) -{ - char ch; - bool in_comment; - in_comment = false; - while (!(m_in.get(ch)).fail()) - { - if (ch == '#') - in_comment = true; - else if (ch == '\n') - { - in_comment = false; - if (!traverse_newlines) - { - return(ch); // Stop eating. - } - } - else if ((!in_comment) && (ch != ' ') && - (ch != '\t') && (ch != '\r')) - { - m_in.putback(ch); - return 0; - } - } - return 0; -} -void ConfigFile::makeLower(std::string &instring) -{ - for(unsigned i=0; i < instring.size(); - i++) - { - instring[i] = tolower(instring[i]); - } -} -bool ConfigFile::hasValue( const char *key ) -{ - bool bRet = false; - std::string sKey = key; - makeLower( sKey ); - if ( m_ConfigEntries.find( sKey.c_str() ) != m_ConfigEntries.end() ) - { - bRet = true; - } - return bRet; -} -std::string ConfigFile::getValue( const char *key ) -{ - std::string sKey = key; - makeLower( sKey ); - if ( m_ConfigEntries.find( sKey.c_str() ) != m_ConfigEntries.end() ) - { - std::map<std::string, std::string>::iterator iter; - iter = m_ConfigEntries.find(sKey.c_str()); - return (*iter).second; - } - return ""; -} -void ConfigFile::setValue( const char *key, const char *value ) -{ - std::string sKey = key; - makeLower( sKey ); - m_ConfigEntries[sKey] = value; -} \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.h b/src/gpu/VirtualFluids_GPU/Input/ConfigFile.h deleted file mode 100644 index 6df713326b72c23827b2c0eb426d7e7deb5a9e85..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CONFIGFILE_H -#define CONFIGFILE_H -#include <string> -#include <vector> -#include <fstream> -#include <map> -#include <list> - -class ConfigFile -{ -public: - ConfigFile(const char *strFileName); - virtual ~ConfigFile(void); - bool read(void); - bool hasValue( const char *key ); - std::string getValue( const char *key ); - void setValue( const char *key, const char *value ); -protected: - virtual void get_token_and_value(); - virtual char eat_white_and_comments(bool traverse_newlines=true); - virtual bool advance_to_equal_sign_on_line(); - virtual void makeLower(std::string &instring); -protected: - std::fstream m_in; - std::string m_token; - std::string m_value; - std::string m_sConfigFile; - typedef std::pair <std::string, std::string> String_Pair; - std::map<std::string, std::string> m_ConfigEntries; -}; -#endif diff --git a/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp b/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp deleted file mode 100644 index b2a942c9a36590b589cab7eacd0b299f76fd7f2c..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp +++ /dev/null @@ -1,1183 +0,0 @@ -#include "PositionReader.h" - -#include "basics/utilities/UbFileInputASCII.h" - -// static const int E = dirE; //static const int E = 0; -// static const int W = dirW; //static const int W = 1; -// static const int N = dirN; //static const int N = 2; -// static const int S = dirS; //static const int S = 3; -// static const int T = dirT; //static const int T = 4; -// static const int B = dirB; //static const int B = 5; -// static const int NE = dirNE; //static const int NE = 6; -// static const int SW = dirSW; //static const int SW = 7; -// static const int SE = dirSE; //static const int SE = 8; -// static const int NW = dirNW; //static const int NW = 9; -// static const int TE = dirTE; //static const int TE = 10; -// static const int BW = dirBW; //static const int BW = 11; -// static const int BE = dirBE; //static const int BE = 12; -// static const int TW = dirTW; //static const int TW = 13; -// static const int TN = dirTN; //static const int TN = 14; -// static const int BS = dirBS; //static const int BS = 15; -// static const int BN = dirBN; //static const int BN = 16; -// static const int TS = dirTS; //static const int TS = 17; -// static const int TNE = dirTNE; //static const int TNE = 18; -// static const int TNW = dirTNW; //static const int TNW = 19; -// static const int TSE = dirTSE; //static const int TSE = 20; -// static const int TSW = dirTSW; //static const int TSW = 21; -// static const int BNE = dirBNE; //static const int BNE = 22; -// static const int BNW = dirBNW; //static const int BNW = 23; -// static const int BSE = dirBSE; //static const int BSE = 24; -// static const int BSW = dirBSW; //static const int BSW = 25; -// static const int ZERO = dirZERO; //static const int ZERO = 26; - - -static const int INV_E = dirE; //= W; -static const int INV_W = dirW; //= E; -static const int INV_N = dirN; //= S; -static const int INV_S = dirS; //= N; -static const int INV_T = dirT; //= B; -static const int INV_B = dirB; //= T; -static const int INV_NE = dirNE; //= SW; -static const int INV_SW = dirSW; //= NE; -static const int INV_SE = dirSE; //= NW; -static const int INV_NW = dirNW; //= SE; -static const int INV_TE = dirTE; //= BW; -static const int INV_BW = dirBW; //= TE; -static const int INV_BE = dirBE; //= TW; -static const int INV_TW = dirTW; //= BE; -static const int INV_TN = dirTN; //= BS; -static const int INV_BS = dirBS; //= TN; -static const int INV_BN = dirBN; //= TS; -static const int INV_TS = dirTS; //= BN; -static const int INV_TNE = dirTNE; //= BSW; -static const int INV_TNW = dirTNW; //= BSE; -static const int INV_TSE = dirTSE; //= BNW; -static const int INV_TSW = dirTSW; //= BNE; -static const int INV_BNE = dirBNE; //= TSW; -static const int INV_BNW = dirBNW; //= TSE; -static const int INV_BSE = dirBSE; //= TNW; -static const int INV_BSW = dirBSW; //= TNE; -static const int INV_ZERO= dirZERO; //= ZERO; - -//static const int INVDIR[ENDDIR+1]; - -const int INVDIR[] = { INV_E, - INV_W, - INV_N, - INV_S, - INV_T, - INV_B, - INV_NE, - INV_SW, - INV_SE, - INV_NW, - INV_TE, - INV_BW, - INV_BE, - INV_TW, - INV_TN, - INV_BS, - INV_BN, - INV_TS, //alt Bezug neu - INV_BNE, //INV_TNE = BSW = 25 = dirTSW = TSW = INV_BNE - INV_TSE, //INV_TNW = BSE = 24 = dirBNW = BNW = INV_TSE - INV_BSE, //INV_TSE = BNW = 23 = dirTNW = TNW = INV_BSE - INV_TNW, //INV_TSW = BNE = 22 = dirBSE = BSE = INV_TNW - INV_BNW, //INV_BNE = TSW = 21 = dirTSE = TSE = INV_BNW - INV_TSW, //INV_BNW = TSE = 20 = dirBNE = BNE = INV_TSW - INV_BSW, //INV_BSE = TNW = 19 = dirTNE = TNE = INV_BSW - INV_ZERO, //INV_BSW = TNE = 18 = dirZERO = ZERO= INV_ZERO - INV_TNE}; //INV_ZERO= ZERO = 26 = dirBSW = BSW = INV_TNE - -static const int optionDigits = 2; //--> 2 bits f�r secondary Option -static const long long maxOptionVal = ( 1<<optionDigits ) - 1; //2^3-1 -> 7 -//float q[27]; -long long noslipBoundaryFlags; - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level <= maxlevel; level++) - { - //Host - para->getParH(level)->size_Mat_SP = in.readInteger(); - para->getParH(level)->mem_size_real_SP = sizeof(real ) * para->getParH(level)->size_Mat_SP; - para->getParH(level)->mem_size_int_SP = sizeof(unsigned int) * para->getParH(level)->size_Mat_SP; - //Device - para->getParD(level)->size_Mat_SP = para->getParH(level)->size_Mat_SP; - para->getParD(level)->mem_size_int_SP = sizeof(unsigned int) * para->getParD(level)->size_Mat_SP; - para->getParD(level)->mem_size_real_SP = sizeof(real ) * para->getParD(level)->size_Mat_SP; - - in.readLine(); - for(unsigned int u = /*1*/0; u<para->getParH(level)->size_Mat_SP; u++) - { - in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFile(const std::string fileName, std::string Type, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - if (Type == "geoVec") - { - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u = 0; u<para->getParH(level)->size_Mat_SP; u++) - { - para->getParH(level)->geoSP[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "neighborX") - { - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u = 0; u<para->getParH(level)->size_Mat_SP; u++) - { - //para->getParH(level)->neighborZ_SP[u] = in.readInteger(); - para->getParH(level)->neighborX_SP[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "neighborY") - { - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u = 0; u<para->getParH(level)->size_Mat_SP; u++) - { - para->getParH(level)->neighborY_SP[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "neighborZ") - { - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u = /*1*/0; u<para->getParH(level)->size_Mat_SP; u++) - { - //para->getParH(level)->neighborX_SP[u] = in.readInteger(); - para->getParH(level)->neighborZ_SP[u] = in.readInteger(); - } - in.readLine(); - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileInterfaceForAlloc(const std::string fileName, std::string Type, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - unsigned int test = 0; - - for (int level = 0; level < maxlevel; level++) - { - if (Type == "CF") - { - para->getParH(level)->K_CF = in.readInteger(); - para->getParD(level)->K_CF = para->getParH(level)->K_CF; - para->getParH(level)->intCF.kCF = para->getParH(level)->K_CF; - para->getParD(level)->intCF.kCF = para->getParH(level)->K_CF; - para->getParH(level)->mem_size_kCF = sizeof(unsigned int) * para->getParH(level)->K_CF; - para->getParD(level)->mem_size_kCF = sizeof(unsigned int) * para->getParD(level)->K_CF; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_CF; u++) - { - test = in.readInteger(); - if (test>=para->getParH(level)->size_Mat_SP) - { - printf("CF: das geht doch nicht!!!"); - } - } - } - else if (Type == "FC") - { - para->getParH(level)->K_FC = in.readInteger(); - para->getParD(level)->K_FC = para->getParH(level)->K_FC; - para->getParH(level)->intFC.kFC = para->getParH(level)->K_FC; - para->getParD(level)->intFC.kFC = para->getParH(level)->K_FC; - para->getParH(level)->mem_size_kFC = sizeof(unsigned int) * para->getParH(level)->K_FC; - para->getParD(level)->mem_size_kFC = sizeof(unsigned int) * para->getParD(level)->K_FC; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_FC; u++) - { - test = in.readInteger(); - if (test>=para->getParH(level)->size_Mat_SP) - { - printf("FC: das geht doch nicht!!!"); - } - } - } - - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileInterface(const std::string fileName, std::string Type, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - if (Type == "CFC") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_CF; u++) - { - para->getParH(level)->intCF.ICellCFC[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "CFF") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_CF; u++) - { - para->getParH(level)->intCF.ICellCFF[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "FCC") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_FC; u++) - { - para->getParH(level)->intFC.ICellFCC[u] = in.readInteger(); - } - in.readLine(); - } - } - else if (Type == "FCF") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_FC; u++) - { - para->getParH(level)->intFC.ICellFCF[u] = in.readInteger(); - } - in.readLine(); - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileInterfaceOffsetForAlloc(const std::string fileName, std::string Type, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - if (Type == "CF") - { - para->getParH(level)->K_CF = in.readInteger(); - para->getParD(level)->K_CF = para->getParH(level)->K_CF; - para->getParH(level)->intCF.kCF = para->getParH(level)->K_CF; - para->getParD(level)->intCF.kCF = para->getParH(level)->K_CF; - para->getParH(level)->mem_size_kCF_off = sizeof(real) * para->getParH(level)->K_CF; - para->getParD(level)->mem_size_kCF_off = sizeof(real) * para->getParD(level)->K_CF; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_CF; u++) - { - in.readDouble(); - in.readDouble(); - in.readDouble(); - } - } - else if (Type == "FC") - { - para->getParH(level)->K_FC = in.readInteger(); - para->getParD(level)->K_FC = para->getParH(level)->K_FC; - para->getParH(level)->intFC.kFC = para->getParH(level)->K_FC; - para->getParD(level)->intFC.kFC = para->getParH(level)->K_FC; - para->getParH(level)->mem_size_kFC_off = sizeof(real) * para->getParH(level)->K_FC; - para->getParD(level)->mem_size_kFC_off = sizeof(real) * para->getParD(level)->K_FC; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_FC; u++) - { - //in.readInteger(); - in.readDouble(); - in.readDouble(); - in.readDouble(); - } - } - - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileInterfaceOffset(const std::string fileName, std::string Type, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - if (Type == "CF") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_CF; u++) - { - para->getParH(level)->offCF.xOffCF[u] = (real)in.readDouble(); - para->getParH(level)->offCF.yOffCF[u] = (real)in.readDouble(); - para->getParH(level)->offCF.zOffCF[u] = (real)in.readDouble(); - } - in.readLine(); - } - } - else if (Type == "FC") - { - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->K_FC; u++) - { - //para->getParH(level)->offFC.xOffFC[u] = 0.0; - //para->getParH(level)->offFC.yOffFC[u] = 0.0; - //para->getParH(level)->offFC.zOffFC[u] = 0.0; - //in.readInteger(); - para->getParH(level)->offFC.xOffFC[u] = (real)in.readDouble(); - para->getParH(level)->offFC.yOffFC[u] = (real)in.readDouble(); - para->getParH(level)->offFC.zOffFC[u] = (real)in.readDouble(); - } - in.readLine(); - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileNoSlipBcForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - para->getParH(level)->kQ = in.readInteger(); - para->getParD(level)->kQ = para->getParH(level)->kQ; - para->getParH(level)->QWall.kQ = para->getParH(level)->kQ; - para->getParD(level)->QWall.kQ = para->getParH(level)->kQ; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kQ; u++) - { - in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileNoSlipBcQreadForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - para->getParH(level)->kQread = in.readInteger(); - para->getParD(level)->kQread = para->getParH(level)->kQread; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kQread; u++) - { - in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileNoSlipBcPos(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kQ; u++) - { - para->getParH(level)->QWall.k[u] = in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileNoSlipBcQs(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - real test; - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kQread; u++) - { - test = (real)in.readFloat(); - //if (test <= 0. && test >= -1.) - //{ - // test = -0.5; - //} - //else if (test >= 0. && test <= 1.) - //{ - // test = 0.5; - //} - //else - //{ - // test = 100.; - //} - - ////T�ST -> shit - //para->getParH(level)->QWall.qread[u] = 0.5f; - //orig - para->getParH(level)->QWall.qread[u] = test; - //para->getParH(level)->QWall.qread[u] = (real)in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileNoSlipBcValue(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kQ; u++) - { - para->getParH(level)->QWall.valueQ[u] = in.readLongLong(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::findQs(Parameter* para) -{ - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - ////////////////////////////////////////////////////////////////// - //preprocessing - real* QQ = para->getParH(lev)->QWall.q27[0]; - unsigned int sizeQ = para->getParH(lev)->kQ; - QforBoundaryConditions Q; - Q.q27[dirE ] = &QQ[dirE *sizeQ]; - Q.q27[dirW ] = &QQ[dirW *sizeQ]; - Q.q27[dirN ] = &QQ[dirN *sizeQ]; - Q.q27[dirS ] = &QQ[dirS *sizeQ]; - Q.q27[dirT ] = &QQ[dirT *sizeQ]; - Q.q27[dirB ] = &QQ[dirB *sizeQ]; - Q.q27[dirNE ] = &QQ[dirNE *sizeQ]; - Q.q27[dirSW ] = &QQ[dirSW *sizeQ]; - Q.q27[dirSE ] = &QQ[dirSE *sizeQ]; - Q.q27[dirNW ] = &QQ[dirNW *sizeQ]; - Q.q27[dirTE ] = &QQ[dirTE *sizeQ]; - Q.q27[dirBW ] = &QQ[dirBW *sizeQ]; - Q.q27[dirBE ] = &QQ[dirBE *sizeQ]; - Q.q27[dirTW ] = &QQ[dirTW *sizeQ]; - Q.q27[dirTN ] = &QQ[dirTN *sizeQ]; - Q.q27[dirBS ] = &QQ[dirBS *sizeQ]; - Q.q27[dirBN ] = &QQ[dirBN *sizeQ]; - Q.q27[dirTS ] = &QQ[dirTS *sizeQ]; - Q.q27[dirZERO] = &QQ[dirZERO*sizeQ]; - Q.q27[dirTNE ] = &QQ[dirTNE *sizeQ]; - Q.q27[dirTSW ] = &QQ[dirTSW *sizeQ]; - Q.q27[dirTSE ] = &QQ[dirTSE *sizeQ]; - Q.q27[dirTNW ] = &QQ[dirTNW *sizeQ]; - Q.q27[dirBNE ] = &QQ[dirBNE *sizeQ]; - Q.q27[dirBSW ] = &QQ[dirBSW *sizeQ]; - Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; - Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - ////////////////////////////////////////////////////////////////// - //set all to -1.0 - for(unsigned int u=0; u<para->getParH(lev)->kQ; u++) - { - for (int dir = dirE; dir<=dirBSW; dir++) - { - Q.q27[dir][u] = -1.0f; - } - } - ////////////////////////////////////////////////////////////////// - //find q-directions - unsigned int v = 0; - for(unsigned int u=0; u<para->getParH(lev)->kQ; u++) - { - noslipBoundaryFlags = para->getParH(lev)->QWall.valueQ[u]; - //noSlipBoundaryValueVec[level].push_back(bc->getNoSlipBoundary()); - for(int dir=dirE;dir<=dirBSW;dir++) - { - if(( ( noslipBoundaryFlags>>(optionDigits*dir) ) & maxOptionVal ) != 0 /*hasNoSlipBoundaryFlag(dir)*/) - { - Q.q27[INVDIR[dir]][u] = para->getParH(lev)->QWall.qread[v]; - //noSlipBoundaryQsVec[level].push_back(bc->getQ(LBMD3Q27System::INVDIR[dir])); - v++; - } - } - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileSlipBcForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - para->getParH(level)->kSlipQ = in.readInteger(); - para->getParD(level)->kSlipQ = para->getParH(level)->kSlipQ; - para->getParH(level)->QSlip.kQ = para->getParH(level)->kSlipQ; - para->getParD(level)->QSlip.kQ = para->getParH(level)->kSlipQ; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kSlipQ; u++) - { - in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileSlipBcQreadForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - para->getParH(level)->kSlipQread = in.readInteger(); - para->getParD(level)->kSlipQread = para->getParH(level)->kSlipQread; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kSlipQread; u++) - { - in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileSlipBcPos(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kSlipQ; u++) - { - para->getParH(level)->QSlip.k[u] = in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileSlipBcQs(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kSlipQread; u++) - { - para->getParH(level)->QSlip.qread[u] = (real)in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFileSlipBcValue(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kSlipQ; u++) - { - para->getParH(level)->QSlip.valueQ[u] = in.readLongLong(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::findSlipQs(Parameter* para) -{ - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - ////////////////////////////////////////////////////////////////// - //preprocessing - real* QQ = para->getParH(lev)->QSlip.q27[0]; - unsigned int sizeQ = para->getParH(lev)->kSlipQ; - QforBoundaryConditions Q; - Q.q27[dirE ] = &QQ[dirE *sizeQ]; - Q.q27[dirW ] = &QQ[dirW *sizeQ]; - Q.q27[dirN ] = &QQ[dirN *sizeQ]; - Q.q27[dirS ] = &QQ[dirS *sizeQ]; - Q.q27[dirT ] = &QQ[dirT *sizeQ]; - Q.q27[dirB ] = &QQ[dirB *sizeQ]; - Q.q27[dirNE ] = &QQ[dirNE *sizeQ]; - Q.q27[dirSW ] = &QQ[dirSW *sizeQ]; - Q.q27[dirSE ] = &QQ[dirSE *sizeQ]; - Q.q27[dirNW ] = &QQ[dirNW *sizeQ]; - Q.q27[dirTE ] = &QQ[dirTE *sizeQ]; - Q.q27[dirBW ] = &QQ[dirBW *sizeQ]; - Q.q27[dirBE ] = &QQ[dirBE *sizeQ]; - Q.q27[dirTW ] = &QQ[dirTW *sizeQ]; - Q.q27[dirTN ] = &QQ[dirTN *sizeQ]; - Q.q27[dirBS ] = &QQ[dirBS *sizeQ]; - Q.q27[dirBN ] = &QQ[dirBN *sizeQ]; - Q.q27[dirTS ] = &QQ[dirTS *sizeQ]; - Q.q27[dirZERO] = &QQ[dirZERO*sizeQ]; - Q.q27[dirTNE ] = &QQ[dirTNE *sizeQ]; - Q.q27[dirTSW ] = &QQ[dirTSW *sizeQ]; - Q.q27[dirTSE ] = &QQ[dirTSE *sizeQ]; - Q.q27[dirTNW ] = &QQ[dirTNW *sizeQ]; - Q.q27[dirBNE ] = &QQ[dirBNE *sizeQ]; - Q.q27[dirBSW ] = &QQ[dirBSW *sizeQ]; - Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; - Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - ////////////////////////////////////////////////////////////////// - //set all to -1.0 - for(unsigned int u=0; u<para->getParH(lev)->kSlipQ; u++) - { - for (int dir = dirE; dir<=dirBSW; dir++) - { - Q.q27[dir][u] = -1.0f; - } - } - ////////////////////////////////////////////////////////////////// - //find q-directions - unsigned int v = 0; - for(unsigned int u=0; u<para->getParH(lev)->kSlipQ; u++) - { - noslipBoundaryFlags = para->getParH(lev)->QSlip.valueQ[u]; - for(int dir=dirE;dir<=dirBSW;dir++) - { - if(( ( noslipBoundaryFlags>>(optionDigits*dir) ) & maxOptionVal ) != 0 ) - { - Q.q27[INVDIR[dir]][u] = para->getParH(lev)->QSlip.qread[v]; - v++; - } - } - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePressBcForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - int test = 1; - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - test = in.readInteger(); - //if (test==0) - //{ - // printf("testlevel = %d\n", level); - // //continue; - //} - para->getParH(level)->kPressQ = test; - para->getParD(level)->kPressQ = para->getParH(level)->kPressQ; - para->getParH(level)->QPress.kQ = para->getParH(level)->kPressQ; - para->getParD(level)->QPress.kQ = para->getParH(level)->kPressQ; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kPressQ; u++) - { - in.readInteger(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePressBcQreadForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - int test = 1; - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - test = in.readInteger(); - //if (test==0) - //{ - // printf("testlevel1 = %d\n", level); - // //continue; - //} - para->getParH(level)->kPressQread = test; - para->getParD(level)->kPressQread = para->getParH(level)->kPressQread; - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kPressQread; u++) - { - in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePressBcPos(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kPressQ; u++) - { - if (u==0) - { - para->getParH(level)->QPress.k[u] = in.readInteger();//0; - /*in.readInteger();*/ - } - else - { - para->getParH(level)->QPress.k[u] = in.readInteger(); - } - //setRhoBC - para->getParH(level)->QPress.RhoBC[u] = (real)0.f; - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePressBcQs(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kPressQread; u++) - { - para->getParH(level)->QPress.qread[u] = (real)in.readFloat(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePressBcValue(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - in.readInteger(); - in.readLine(); - for(unsigned int u=0; u<para->getParH(level)->kPressQ; u++) - { - para->getParH(level)->QPress.valueQ[u] = in.readLongLong(); - } - in.readLine(); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::findPressQs(Parameter* para) -{ - for (int lev = 0; lev <= para->getMaxLevel(); lev++) - { - ////////////////////////////////////////////////////////////////// - //preprocessing - real* QQ = para->getParH(lev)->QPress.q27[0]; - unsigned int sizeQ = para->getParH(lev)->kPressQ; - QforBoundaryConditions Q; - Q.q27[dirE ] = &QQ[dirE *sizeQ]; - Q.q27[dirW ] = &QQ[dirW *sizeQ]; - Q.q27[dirN ] = &QQ[dirN *sizeQ]; - Q.q27[dirS ] = &QQ[dirS *sizeQ]; - Q.q27[dirT ] = &QQ[dirT *sizeQ]; - Q.q27[dirB ] = &QQ[dirB *sizeQ]; - Q.q27[dirNE ] = &QQ[dirNE *sizeQ]; - Q.q27[dirSW ] = &QQ[dirSW *sizeQ]; - Q.q27[dirSE ] = &QQ[dirSE *sizeQ]; - Q.q27[dirNW ] = &QQ[dirNW *sizeQ]; - Q.q27[dirTE ] = &QQ[dirTE *sizeQ]; - Q.q27[dirBW ] = &QQ[dirBW *sizeQ]; - Q.q27[dirBE ] = &QQ[dirBE *sizeQ]; - Q.q27[dirTW ] = &QQ[dirTW *sizeQ]; - Q.q27[dirTN ] = &QQ[dirTN *sizeQ]; - Q.q27[dirBS ] = &QQ[dirBS *sizeQ]; - Q.q27[dirBN ] = &QQ[dirBN *sizeQ]; - Q.q27[dirTS ] = &QQ[dirTS *sizeQ]; - Q.q27[dirZERO] = &QQ[dirZERO*sizeQ]; - Q.q27[dirTNE ] = &QQ[dirTNE *sizeQ]; - Q.q27[dirTSW ] = &QQ[dirTSW *sizeQ]; - Q.q27[dirTSE ] = &QQ[dirTSE *sizeQ]; - Q.q27[dirTNW ] = &QQ[dirTNW *sizeQ]; - Q.q27[dirBNE ] = &QQ[dirBNE *sizeQ]; - Q.q27[dirBSW ] = &QQ[dirBSW *sizeQ]; - Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; - Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - ////////////////////////////////////////////////////////////////// - //set all to -1.0 - for(unsigned int u=0; u<para->getParH(lev)->kPressQ; u++) - { - for (int dir = dirE; dir<=dirBSW; dir++) - { - Q.q27[dir][u] = -1.0f; - } - } - ////////////////////////////////////////////////////////////////// - //find q-directions - unsigned int v = 0; - for(unsigned int u=0; u<para->getParH(lev)->kPressQ; u++) - { - noslipBoundaryFlags = para->getParH(lev)->QPress.valueQ[u]; - for(int dir=dirE;dir<=dirBSW;dir++) - { - if(( ( noslipBoundaryFlags>>(optionDigits*dir) ) & maxOptionVal ) != 0 ) - { - Q.q27[INVDIR[dir]][u] = para->getParH(lev)->QPress.qread[v]; - v++; - } - } - } - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePropellerCylinderForAlloc(Parameter* para) -{ - UbFileInputASCII in(para->getpropellerCylinder()); - int test = 0, count = 0; - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - para->getParH(level)->QPropeller.kQ = in.readInteger(); - para->getParD(level)->QPropeller.kQ = para->getParH(level)->QPropeller.kQ; - in.readLine(); - if (level == para->getFine()) - { - for(int u=0; u<para->getParH(level)->QPropeller.kQ; u++) - { - test = in.readInteger(); - if (para->getParH(level)->geoSP[test] == GEO_FLUID) - { - count++; - } - //////////////////////////////////////////////////////////////////////// - //for(unsigned int ix3=0; ix3<para->getParH(level)->nz; ix3++) - //{ - // for(unsigned int ix2=0; ix2<para->getParH(level)->ny; ix2++) - // { - // for(unsigned int ix1=0; ix1<para->getParH(level)->nx; ix1++) - // { - // unsigned int m = para->getParH(level)->nx*(para->getParH(level)->ny*ix3 + ix2) + ix1; - // if (para->getParH(level)->k[m] == test) - // { - // if(para->getParH(level)->geo[m] == 1) - // { - // count++; - // } - // } - // } - // } - //} - //count++; - //////////////////////////////////////////////////////////////////////// - in.readDouble(); - in.readDouble(); - in.readDouble(); - in.readLine(); - } - } - else - { - for(int u=0; u<para->getParH(level)->QPropeller.kQ; u++) - { - in.readInteger(); - in.readDouble(); - in.readDouble(); - in.readDouble(); - in.readLine(); - } - } - para->getParH(level)->QPropeller.kQ = count; - para->getParD(level)->QPropeller.kQ = para->getParH(level)->QPropeller.kQ; - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readFilePropellerCylinder(Parameter* para) -{ - UbFileInputASCII in(para->getpropellerCylinder()); - int test = 0, count = 0; - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level < maxlevel; level++) - { - int allnodes = in.readInteger(); - in.readLine(); - if (level == para->getFine()) - { - for(int u=0; u<allnodes; u++) - { - test = in.readInteger(); - //////////////////////////////////////////////////////////////////////// - if (para->getParH(level)->geoSP[test] == GEO_FLUID) - { - para->getParH(level)->QPropeller.k[count] = test; - para->getParH(level)->QPropeller.Vx[count] = (real)in.readDouble(); - para->getParH(level)->QPropeller.Vy[count] = (real)in.readDouble(); - para->getParH(level)->QPropeller.Vz[count] = (real)in.readDouble(); - para->getParH(level)->QPropeller.RhoBC[count] = 0.0f; - count++; - } - else - { - in.readDouble(); - in.readDouble(); - in.readDouble(); - } - //para->getParH(level)->QPropeller.k[count] = test; - //para->getParH(level)->QPropeller.Vx[count] = (real)in.readDouble(); - //para->getParH(level)->QPropeller.Vy[count] = (real)in.readDouble(); - //para->getParH(level)->QPropeller.Vz[count] = (real)in.readDouble(); - //para->getParH(level)->QPropeller.Vx[count] = 0.07f; - //para->getParH(level)->QPropeller.Vy[count] = 0.0f; - //para->getParH(level)->QPropeller.Vz[count] = 0.0f; - in.readLine(); - } - } - else - { - for(int u=0; u<allnodes; u++) - { - in.readInteger(); - in.readDouble(); - in.readDouble(); - in.readDouble(); - in.readLine(); - } - } - printf("allnodes = %d, count = %d\n", allnodes, count); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::definePropellerQs(Parameter* para) -{ - ////////////////////////////////////////////////////////////////// - //preprocessing - real* QQ = para->getParH(para->getFine())->QPropeller.q27[0]; - unsigned int sizeQ = para->getParH(para->getFine())->QPropeller.kQ; - QforBoundaryConditions Q; - Q.q27[dirE ] = &QQ[dirE *sizeQ]; - Q.q27[dirW ] = &QQ[dirW *sizeQ]; - Q.q27[dirN ] = &QQ[dirN *sizeQ]; - Q.q27[dirS ] = &QQ[dirS *sizeQ]; - Q.q27[dirT ] = &QQ[dirT *sizeQ]; - Q.q27[dirB ] = &QQ[dirB *sizeQ]; - Q.q27[dirNE ] = &QQ[dirNE *sizeQ]; - Q.q27[dirSW ] = &QQ[dirSW *sizeQ]; - Q.q27[dirSE ] = &QQ[dirSE *sizeQ]; - Q.q27[dirNW ] = &QQ[dirNW *sizeQ]; - Q.q27[dirTE ] = &QQ[dirTE *sizeQ]; - Q.q27[dirBW ] = &QQ[dirBW *sizeQ]; - Q.q27[dirBE ] = &QQ[dirBE *sizeQ]; - Q.q27[dirTW ] = &QQ[dirTW *sizeQ]; - Q.q27[dirTN ] = &QQ[dirTN *sizeQ]; - Q.q27[dirBS ] = &QQ[dirBS *sizeQ]; - Q.q27[dirBN ] = &QQ[dirBN *sizeQ]; - Q.q27[dirTS ] = &QQ[dirTS *sizeQ]; - Q.q27[dirZERO] = &QQ[dirZERO*sizeQ]; - Q.q27[dirTNE ] = &QQ[dirTNE *sizeQ]; - Q.q27[dirTSW ] = &QQ[dirTSW *sizeQ]; - Q.q27[dirTSE ] = &QQ[dirTSE *sizeQ]; - Q.q27[dirTNW ] = &QQ[dirTNW *sizeQ]; - Q.q27[dirBNE ] = &QQ[dirBNE *sizeQ]; - Q.q27[dirBSW ] = &QQ[dirBSW *sizeQ]; - Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; - Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - ////////////////////////////////////////////////////////////////// - for(int u=0; u<para->getParH(para->getFine())->QPropeller.kQ; u++) - { - for (int dir = dirE; dir<=dirBSW; dir++) - { - if ((dir==dirE) || - (dir==dirNE) || (dir==dirSE) || (dir==dirTE) || (dir==dirBE) || - (dir==dirTNE)|| (dir==dirBNE)|| (dir==dirTSE)|| (dir==dirBSE)) - { - Q.q27[dir][u] = 1.0f; - } - else - { - Q.q27[dir][u] = -1.0f; - } - } - } - ////////////////////////////////////////////////////////////////// -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// -void PositionReader::readMeasurePoints( Parameter* para ) -{ - UbFileInputASCII in(para->getmeasurePoints()); - int numberOfAllNodes = in.readInteger(); - in.readLine(); - int tempLevel; - MeasurePoints tempMP; - //printf("done, init the values...\n"); - for (int u = 0; u < numberOfAllNodes; u++) - { - tempMP.name = in.readString(); - //printf("done, read the name...\n"); - tempMP.k = in.readInteger(); - //printf("done, read k...\n"); - tempLevel = in.readInteger(); - //printf("done, read level...\n"); - in.readLine(); - //printf("done, read the values...\n"); - para->getParH(tempLevel)->MP.push_back(tempMP); - //printf("done, put it into a vector...\n"); - } -} -////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////// - - diff --git a/src/gpu/VirtualFluids_GPU/Input/PositionReader.h b/src/gpu/VirtualFluids_GPU/Input/PositionReader.h deleted file mode 100644 index 610d2fb5e1e8d225d56931c023ea3855d89bef4b..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/PositionReader.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef POSITION_READER_H -#define POSITION_READER_H - -#include <string> -#include "Parameter/Parameter.h" - -class PositionReader -{ -public: - PositionReader(){} - ~PositionReader(){} - static void readFileForAlloc(const std::string fileName, Parameter* para); - static void readFile(const std::string fileName, std::string Type, Parameter* para); - static void readFileInterfaceForAlloc(const std::string fileName, std::string Type, Parameter* para); - static void readFileInterface(const std::string fileName, std::string Type, Parameter* para); - static void readFileInterfaceOffsetForAlloc(const std::string fileName, std::string Type, Parameter* para); - static void readFileInterfaceOffset(const std::string fileName, std::string Type, Parameter* para); - static void readFileNoSlipBcForAlloc(const std::string fileName, Parameter* para); - static void readFileNoSlipBcQreadForAlloc(const std::string fileName, Parameter* para); - static void readFileNoSlipBcPos(const std::string fileName, Parameter* para); - static void readFileNoSlipBcQs(const std::string fileName, Parameter* para); - static void readFileNoSlipBcValue(const std::string fileName, Parameter* para); - static void findQs(Parameter* para); - static void readFileSlipBcForAlloc(const std::string fileName, Parameter* para); - static void readFileSlipBcQreadForAlloc(const std::string fileName, Parameter* para); - static void readFileSlipBcPos(const std::string fileName, Parameter* para); - static void readFileSlipBcQs(const std::string fileName, Parameter* para); - static void readFileSlipBcValue(const std::string fileName, Parameter* para); - static void findSlipQs(Parameter* para); - static void readFilePressBcForAlloc(const std::string fileName, Parameter* para); - static void readFilePressBcQreadForAlloc(const std::string fileName, Parameter* para); - static void readFilePressBcPos(const std::string fileName, Parameter* para); - static void readFilePressBcQs(const std::string fileName, Parameter* para); - static void readFilePressBcValue(const std::string fileName, Parameter* para); - static void findPressQs(Parameter* para); - static void readFilePropellerCylinderForAlloc(Parameter* para); - static void readFilePropellerCylinder(Parameter* para); - static void definePropellerQs(Parameter* para); - static void readMeasurePoints(Parameter* para); -protected: -private: -}; - -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.cpp b/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.cpp deleted file mode 100644 index 39cbde1d8020d05fafa65253639da4c63a931628..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "VtkGeometryReader.h" - -#include "basics/utilities/UbFileInputASCII.h" - -void VtkGeometryReader::readFile(const std::string& fileName, unsigned int* geoMat) -{ - UbFileInputASCII in(fileName); - - //in.readLine(); - //in.readLine(); - //in.readLine(); - //in.readLine(); - //in.readString(); - //int itsNX1 = in.readInteger(); - //int itsNX2 = in.readInteger(); - //int itsNX3 = in.readInteger(); - //int nn = itsNX1 * itsNX2 * itsNX3; - //in.readLine(); - //in.readString(); - //in.readInteger(); - //in.readString(); - //in.readLine(); - - //for(int k=0 ; k<itsNX3 ; k++){ - // for(int j=0 ; j<itsNX2 ; j++){ - // for(int i=0 ; i<itsNX1 ; i++){ - // //float x = i;//(j&0x1)^(k&0x1) + i*2; - // //float y = j; - // //float z = k; - // in.readFloat(); - // in.readFloat(); - // in.readFloat(); - // in.readLine(); - // } - // } - //} - - - //in.readString(); - //in.readInteger(); - //in.readLine(); - - //in.readLine(); - //in.readLine(); - - //for(int k=0 ; k<itsNX3 ; k++){ - // for(int j=0 ; j<itsNX2 ; j++){ - // for(int i=0 ; i<itsNX1 ; i++){ - // int m = itsNX1*(itsNX2*k + j) + i; - // geoMat[m] = in.readInteger(); - // in.readLine(); - // } - // } - //} - //int nn = itsNX1 * itsNX2 * itsNX3; - in.readLine(); - in.readLine(); - in.readLine(); - in.readLine(); - in.readString(); - unsigned int itsNX1 = in.readInteger(); - unsigned int itsNX2 = in.readInteger(); - unsigned int itsNX3 = in.readInteger(); - //int nn = itsNX1 * itsNX2 * itsNX3; - - std::cout << "NX = " << itsNX1 << "\n"; - std::cout << "NY = " << itsNX2 << "\n"; - std::cout << "NZ = " << itsNX3 << "\n"; - - in.readLine(); - in.readString(); - in.readDouble(); - in.readDouble(); - in.readDouble(); - //in.readInteger(); - //in.readInteger(); - //in.readInteger(); - in.readLine(); - in.readString(); - in.readDouble(); - in.readDouble(); - in.readDouble(); - in.readLine(); - in.readString(); - in.readInteger(); - in.readLine(); - in.readLine(); - in.readLine(); - - for(unsigned int k=0 ; k<itsNX3 ; k++){ - for(unsigned int j=0 ; j<itsNX2 ; j++){ - for(unsigned int i=0 ; i<itsNX1 ; i++){ - //int m = nx*(ny*k + j) + i; - //in.readInteger( itsGeoMatrix(i,j,k) ); - //in.readLine(); - unsigned int m = itsNX1*(itsNX2*k + j) + i; - geoMat[m] = in.readInteger(); - //if (i==0 && j==0 && k>50 && k<60) - //{ - // std::cout << "Read = " << geoMat[m] << "\n"; - //} - } - } - } - -} \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.h b/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.h deleted file mode 100644 index 15cabf8db9510071ec0b7c4a259f6d1647c0760d..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/VtkGeometryReader.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef VTKGEOMETRYREADER_H -#define VTKGEOMETRYREADER_H - -#include <string> - -/** -* @file -* @author Kostyantyn Kucher <k.kucher@gmx.net> -* @version 1.0 -* -* @section LICENSE -* -* @section DESCRIPTION -* -* Read geometry from VTK Lagacy File -* geometry is integer values for node types difinition -* respectively -* SOLID = -* FLUID = -* -*/ - -class VtkGeometryReader -{ -public: - VtkGeometryReader(){} - ~VtkGeometryReader(){} - static void readFile(const std::string& fileName, unsigned int* geoMat); -protected: -private: -}; - -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Input/kFullReader.cpp b/src/gpu/VirtualFluids_GPU/Input/kFullReader.cpp deleted file mode 100644 index 69f20d48dbbe833b5d0cdf808dc057ef2b871cd4..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/kFullReader.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "kFullReader.h" - -#include "basics/utilities/UbFileInputASCII.h" - -void kFullReader::readFileForAlloc(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level <= maxlevel; level++) - { - int nodeNumberX1 = in.readInteger() - (2 * level); - int nodeNumberX2 = in.readInteger() - (2 * level); - int nodeNumberX3 = in.readInteger() - (2 * level); - para->getParH(level)->gridNX = nodeNumberX1; - para->getParH(level)->gridNY = nodeNumberX2; - para->getParH(level)->gridNZ = nodeNumberX3; - para->getParD(level)->gridNX = para->getParH(level)->gridNX; - para->getParD(level)->gridNY = para->getParH(level)->gridNY; - para->getParD(level)->gridNZ = para->getParH(level)->gridNZ; - - //weitere Werte setzen - para->getParH(level)->nx = para->getParH(level)->gridNX + 2 * STARTOFFX; - para->getParH(level)->ny = para->getParH(level)->gridNY + 2 * STARTOFFY; - para->getParH(level)->nz = para->getParH(level)->gridNZ + 2 * STARTOFFZ; - para->getParH(level)->size_Mat = para->getParH(level)->nx * para->getParH(level)->ny * para->getParH(level)->nz; - para->getParH(level)->mem_size_int = sizeof(unsigned int) * para->getParH(level)->size_Mat; - // - para->getParD(level)->nx = para->getParD(level)->gridNX + 2 * STARTOFFX; - para->getParD(level)->ny = para->getParD(level)->gridNY + 2 * STARTOFFY; - para->getParD(level)->nz = para->getParD(level)->gridNZ + 2 * STARTOFFZ; - para->getParD(level)->size_Mat = para->getParD(level)->nx * para->getParD(level)->ny * para->getParD(level)->nz; - para->getParD(level)->mem_size_int = sizeof(unsigned int) * para->getParD(level)->size_Mat; - - - in.readLine(); - for(unsigned int ix3=STARTOFFZ - level; ix3<para->getParH(level)->gridNZ + STARTOFFZ + level ; ix3++) - { - for(unsigned int ix2=STARTOFFY - level; ix2<para->getParH(level)->gridNY + STARTOFFY + level ; ix2++) - { - for(unsigned int ix1=STARTOFFX - level; ix1<para->getParH(level)->gridNX + STARTOFFX + level ; ix1++) - { - in.readInteger(); - } - } - } - in.readLine(); - } //end levelloop -} - -void kFullReader::readFile(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readInteger(); - in.readInteger(); - - in.readLine(); - for(unsigned int ix3=STARTOFFZ - level; ix3<para->getParH(level)->gridNZ + STARTOFFZ + level; ix3++) - { - for(unsigned int ix2=STARTOFFY - level; ix2<para->getParH(level)->gridNY + STARTOFFY + level; ix2++) - { - for(unsigned int ix1=STARTOFFX - level; ix1<para->getParH(level)->gridNX + STARTOFFX + level; ix1++) - { - unsigned int m = para->getParH(level)->nx*(para->getParH(level)->ny*ix3 + ix2) + ix1; - para->getParH(level)->k[m] = in.readInteger();//+1;//!!achtung + 1 - } - } - } - in.readLine(); - } //end levelloop -} - - -//GEO-FULL -void kFullReader::readGeoFull(const std::string fileName, Parameter* para) -{ - UbFileInputASCII in(fileName); - int test = 0; - int maxlevel = in.readInteger(); - in.readLine(); - - for (int level = 0; level <= maxlevel; level++) - { - in.readInteger(); - in.readInteger(); - in.readInteger(); - - in.readLine(); - for(unsigned int ix3=STARTOFFZ - level; ix3<para->getParH(level)->gridNZ + STARTOFFZ + level; ix3++) - { - for(unsigned int ix2=STARTOFFY - level; ix2<para->getParH(level)->gridNY + STARTOFFY + level; ix2++) - { - for(unsigned int ix1=STARTOFFX - level; ix1<para->getParH(level)->gridNX + STARTOFFX + level; ix1++) - { - unsigned int m = para->getParH(level)->nx*(para->getParH(level)->ny*ix3 + ix2) + ix1; - test = in.readInteger(); - if (test == 7) - { - test = 1; - } - else if (test != 1)//??? - { - test = 16; - } - para->getParH(level)->geo[m] = test; - //para->getParH(level)->geo[m] = in.readInteger();//+1;//!!achtung + 1 - } - } - } - in.readLine(); - } //end levelloop -} \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Input/kFullReader.h b/src/gpu/VirtualFluids_GPU/Input/kFullReader.h deleted file mode 100644 index 35298de2b3ac11eef49e675ebf9149def1a07932..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Input/kFullReader.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef KFULL_READER_H -#define KFULL_READER_H - -#include <string> -#include "Parameter/Parameter.h" - -class kFullReader -{ -public: - kFullReader(){} - ~kFullReader(){} - static void readFile(const std::string fileName, Parameter* para); - static void readFileForAlloc(const std::string fileName, Parameter* para); - static void readGeoFull(const std::string fileName, Parameter* para); -protected: -private: -}; - -#endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h b/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h index 213127e64c5e7bfe2b3d4c9d1154c11d374f9552..4b54277ddd405eb619191895065af9bb3b780063 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h @@ -6,6 +6,8 @@ #include "Kernel/Utilities/KernelGroup.h" #include "PreProcessor/PreProcessorType.h" +#include <helper_cuda.h> + class Kernel { public: diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/FluidFlow/Compressible/RunLBMKernel.cuh b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/FluidFlow/Compressible/RunLBMKernel.cuh index b4097851b251b7447f6ce06856d0b9187999a20b..ecfdb8e38bc5da02a473b6f2e67340963ed8b38a 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/FluidFlow/Compressible/RunLBMKernel.cuh +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/FluidFlow/Compressible/RunLBMKernel.cuh @@ -32,9 +32,11 @@ template<typename KernelFunctor> __global__ void runKernel(KernelFunctor kernel, GPUKernelParameter kernelParameter) { const uint k = getNodeIndex(); - const uint nodeType = kernelParameter.typeOfGridNode[k]; - if (!isValidFluidNode(k, kernelParameter.size_Mat, nodeType)) + if(k >= kernelParameter.size_Mat) + return; + + if (!isValidFluidNode(kernelParameter.typeOfGridNode[k])) return; DistributionWrapper distributionWrapper { diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cu b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cu index bbb01d95410612d36d55f1e0113175a8741b9ade..2b9203bf96be89fb328cbbe221994dffed481e14 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cu @@ -158,10 +158,9 @@ __device__ unsigned int getNodeIndex() return nx * (ny * z + y) + x; } -__device__ bool isValidFluidNode(uint k, int size_Mat, uint nodeType) +__device__ bool isValidFluidNode(uint nodeType) { - return (k < size_Mat) && - (nodeType == GEO_FLUID || nodeType == GEO_PM_0 || nodeType == GEO_PM_1 || nodeType == GEO_PM_2); + return (nodeType == GEO_FLUID || nodeType == GEO_PM_0 || nodeType == GEO_PM_1 || nodeType == GEO_PM_2); } diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cuh b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cuh index 935030701924233d959fb69b74a7c3087feb0834..6b38cac75c99680c71420533455dd060195b6c87 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cuh +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/DistributionHelper.cuh @@ -90,7 +90,7 @@ struct DistributionWrapper __device__ unsigned int getNodeIndex(); -__device__ bool isValidFluidNode(uint k, int size_Mat, uint nodeType); +__device__ bool isValidFluidNode(uint nodeType); } } diff --git a/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.cpp b/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.cpp index d5459376a85c72de30b9b5de83c5d0075b28e5f0..299f898aaaf69583a5cba76d824b01c73ace629d 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.cpp @@ -1,12 +1,5 @@ #include "CudaTimer.h" -CudaTimer::CudaTimer() -{ - sdkTimer = 0; - ftimeE = 0.0f; - ftimeS = 0.0f; -} - void CudaTimer::createSdkTimer() { sdkCreateTimer(&sdkTimer); diff --git a/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.h b/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.h index c77f5eafa48d9179baafe0ff0b89bc8629c8e067..cb15eee9c8b7f529a10102c1a7331fa90a714724 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.h +++ b/src/gpu/VirtualFluids_GPU/LBM/CudaTimer.h @@ -10,8 +10,6 @@ class CudaTimer { public: - CudaTimer(); - void createSdkTimer(); void startSdkTimer(); void stopSdkTimer(float &timeSinceLastStop,double &totalTime); @@ -24,11 +22,11 @@ public: private: StopWatchInterface *sdkTimer; - double ftimeS; + double ftimeS = {0.0}; cudaEvent_t stop_t; cudaEvent_t start_t; - double ftimeE; + double ftimeE {0.0}; }; diff --git a/src/gpu/VirtualFluids_GPU/LBM/LB.h b/src/gpu/VirtualFluids_GPU/LBM/LB.h index 52f932c7b751b0d31e9bf733a4f3b5c439a6755f..a33b3b792cd451307825fd0b2c8716e942440582 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/LB.h +++ b/src/gpu/VirtualFluids_GPU/LBM/LB.h @@ -44,31 +44,42 @@ #define INTERFACE_T 4 #define INTERFACE_B 5 -////////////////////////////////////////////////////////////////////////// -// precision (change between double and float) -// + #include "Core/DataTypes.h" -////////////////////////////////////////////////////////////////////////// #include <string> #include <vector> -// Initial condition -typedef struct InitCond{ + +struct InitCondition +{ real Re; - real factorPressBC; - real Diffusivity, Temp, TempBC; - real RealX, RealY; - int numprocs, myid, maxdev; - unsigned int tend, tout, tStartOut, tCalcMedStart, tCalcMedEnd, tDoCheckPoint, tDoRestart; - unsigned int PressInID, PressOutID; - unsigned int PressInZ, PressOutZ; - std::vector<uint> devices; + real factorPressBC {1.0}; + real Diffusivity {0.001}; + real Temp {0.0}; + real TempBC {1.0}; + real RealX {1.0}; + real RealY {1.0}; + int numprocs {1}; + int myid {0}; + int maxdev {1}; + uint tDoCheckPoint {0}; + uint tDoRestart {0}; + uint tCalcMedStart {0}; + uint tCalcMedEnd {10}; + uint tend {10}; + uint tout {1}; + uint tStartOut {0}; + uint PressInID {0}; + uint PressOutID {0}; + uint PressInZ {1}; + uint PressOutZ {2}; + std::vector<uint> devices {1, 0}; // one device with ID = 0 std::vector<int> GridX, GridY, GridZ, DistX, DistY, DistZ; std::vector<real> scaleLBMtoSI, translateLBMtoSI; std::vector<real> minCoordX, minCoordY, minCoordZ, maxCoordX, maxCoordY, maxCoordZ; - std::vector<bool> NeedInterface; - std::string fname, oPath, oPrefix; + std::string fname, oPath; + std::string oPrefix {"MyFile"}; std::string geometryFileC, geometryFileM, geometryFileF; std::string kFull, geoFull, geoVec, coordX, coordY, coordZ, neighborX, neighborY, neighborZ, neighborWSB, scaleCFC, scaleCFF, scaleFCC, scaleFCF, scaleOffsetCF, scaleOffsetFC; std::string noSlipBcPos, noSlipBcQs, noSlipBcValue; @@ -89,16 +100,32 @@ typedef struct InitCond{ std::string cpTop, cpBottom, cpBottom2; std::string concentration, streetVelocity; std::string geomNormalX, geomNormalY, geomNormalZ, inflowNormalX, inflowNormalY, inflowNormalZ, outflowNormalX, outflowNormalY, outflowNormalZ; - unsigned int timeStepForMP; - real clockCycleForMP; - real vis, vis_ratio; - real u0, u0_ratio; - real delta_rho, delta_press; - bool printFiles, readGeo, doRestart, doCheckPoint, isGeo, isProp, isCp, calcMedian, GeometryValues, isConc, is2ndOrderMoments, is3rdOrderMoments, isHighOrderMoments, isWale, isMeasurePoints, isInitNeq; + uint timeStepForMP {10}; + real clockCycleForMP {1.0}; + real vis {0.001}; + real vis_ratio {1.0}; + real u0 {0.01}; + real u0_ratio {1.0}; + real delta_rho {0.0}; + real delta_press {1.0}; + bool printFiles {false}; + bool doRestart {false}; + bool doCheckPoint {false}; + bool readGeo {false}; + bool isGeo, isProp, isCp; + bool GeometryValues {false}; + bool is2ndOrderMoments {false}; + bool is3rdOrderMoments {false}; + bool isHighOrderMoments {false}; + bool calcMedian {false}; + bool isConc {false}; + bool isWale {false}; + bool isMeasurePoints {false}; + bool isInitNeq {false}; bool isGeoNormal, isInflowNormal, isOutflowNormal; - bool simulatePorousMedia; - bool streetVelocityFile; -} InitCondition; + bool simulatePorousMedia {false}; + bool streetVelocityFile {false}; +}; //Interface Cells typedef struct ICellCF{ diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp index 8535567505aba4fcd8efe899ba14275735cb168b..b2ad86c7df9583aa76e52e630bb1ea7a926c089a 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp @@ -13,11 +13,6 @@ #include "GPU/devCheck.h" #include "basics/utilities/UbFileOutputASCII.h" ////////////////////////////////////////////////////////////////////////// -#include "Input/ConfigFile.h" -#include "Input/VtkGeometryReader.h" -#include "Input/kFullReader.h" -#include "Input/PositionReader.h" -////////////////////////////////////////////////////////////////////////// #include "Output/MeasurePointWriter.hpp" #include "Output/AnalysisData.hpp" #include "Output/InterfaceDebugWriter.hpp" @@ -27,8 +22,6 @@ #include "Core/StringUtilities/StringUtil.h" ////////////////////////////////////////////////////////////////////////// #include "Init/InitLattice.h" -#include "Init/DefineGrid.h" -#include "Init/SetParameter.h" #include "Init/VfReader.h" ////////////////////////////////////////////////////////////////////////// #include "FindQ/FindQ.h" @@ -87,11 +80,9 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std comm = vf::gpu::Communicator::getInstanz(); this->para = para; - para->setMyID(comm->getPID()); - para->setNumprocs(comm->getNummberOfProcess()); devCheck(comm->mapCudaDevice(para->getMyID(), para->getNumprocs(), para->getDevices(), para->getMaxDev())); - - para->initParameter(); + + para->initLBMSimulationParameter(); gridProvider->allocAndCopyForcing(); gridProvider->allocAndCopyQuadricLimiters(); @@ -99,7 +90,6 @@ void Simulation::init(SPtr<Parameter> para, SPtr<GridProvider> gridProvider, std gridProvider->setBoundingBox(); para->setRe(para->getVelocity() * (real)1.0 / para->getViscosity()); - para->setPhi((real) 0.0); para->setlimitOfNodesForVTK(30000000); //max 30 Million nodes per VTK file if (para->getDoRestart()) para->setStartTurn(para->getTimeDoRestart()); diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp index a283d11037a3b9efe4a1f909d7f10b0fb5ebeee2..80275f188365c45566a086fbb0bae23b0c40c233 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp @@ -1,601 +1,440 @@ -// _ ___ __ __________ _ __ ______________ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ / ___/ __ / / / / -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ / /___/ /_/ / / / / -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) / /_) / ____/ /__/ / -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ \____/_/ \_____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // -////////////////////////////////////////////////////////////////////////// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Parameter.h +//! \ingroup Parameter +//! \author Martin Schoenherr +//======================================================================================= #include "Parameter.h" -//#include <cuda_runtime.h> -//#include <helper_cuda.h> -// #include <stdio.h> #include <stdlib.h> #include <math.h> +#include <curand_kernel.h> -#include "Core/Input/ConfigData/ConfigData.h" #include "Core/StringUtilities/StringUtil.h" -#include "Communication/Communicator.h" -#include "Visitor/Visitor.h" - -//#ifdef WIN32 -// #include <Winsock2.h> -//#endif -//lib for windows Ws2_32.lib - - -SPtr<Parameter> Parameter::make() -{ - return SPtr<Parameter>(new Parameter()); -} - -SPtr<Parameter> Parameter::make(SPtr<ConfigData> configData, vf::gpu::Communicator* comm) -{ - return SPtr<Parameter>(new Parameter(configData, comm)); -} - -Parameter::Parameter() -{ -} -Parameter::Parameter(SPtr<ConfigData> configData, vf::gpu::Communicator* comm) -{ - ////////////////////////////////////////////////////////////////////////// - this->setNumprocs(comm->getNummberOfProcess()); - this->setMyID(comm->getPID()); - ////////////////////////////////////////////////////////////////////////// - if (configData->isNumberOfDevicesInConfigFile()) - this->setMaxDev(configData->getNumberOfDevices()); - else - this->setMaxDev((int)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isDevicesInConfigFile()) - this->setDevices(configData->getDevices()); - else - this->setDevices(std::vector<uint>{(uint)0}); - ////////////////////////////////////////////////////////////////////////// - if (configData->isOutputPathInConfigFile()) - this->setOutputPath(configData->getOutputPath()); - else - this->setOutputPath("C:/Output/"); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPrefixInConfigFile()) - this->setOutputPrefix(configData->getPrefix()); - else - this->setOutputPrefix("MyFile"); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPrintOutputFilesInConfigFile()) - this->setPrintFiles(configData->getPrintOutputFiles()); - else - this->setPrintFiles(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isGeometryValuesInConfigFile()) - this->setGeometryValues(configData->getGeometryValues()); - else - this->setGeometryValues(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalc2ndOrderMomentsInConfigFile()) - this->setCalc2ndOrderMoments(configData->getCalc2ndOrderMoments()); - else - this->setCalc2ndOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalc3rdOrderMomentsInConfigFile()) - this->setCalc3rdOrderMoments(configData->getCalc3rdOrderMoments()); - else - this->setCalc3rdOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcHighOrderMomentsInConfigFile()) - this->setCalcHighOrderMoments(configData->getCalcHighOrderMoments()); - else - this->setCalcHighOrderMoments(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcMedianInConfigFile()) - this->setCalcMedian(configData->getCalcMedian()); - else - this->setCalcMedian(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcDragLiftInConfigFile()) - this->setCalcDragLift(configData->getCalcDragLift()); - else - this->setCalcDragLift(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcCpInConfigFile()) - this->setCalcCp(configData->getCalcCp()); - else - this->setCalcCp(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isWriteVeloASCIIfilesInConfigFile()) - this->setWriteVeloASCIIfiles(configData->getWriteVeloASCIIfiles()); - else - this->setWriteVeloASCIIfiles(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isCalcPlaneConcInConfigFile()) - this->setCalcPlaneConc(configData->getCalcPlaneConc()); - else - this->setCalcPlaneConc(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isConcFileInConfigFile()) - this->setConcFile(configData->getConcFile()); - else - this->setConcFile(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isStreetVelocityFileInConfigFile()) - this->setStreetVelocityFile(configData->getStreetVelocityFile()); - else - this->setStreetVelocityFile(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseMeasurePointsInConfigFile()) - this->setUseMeasurePoints(configData->getUseMeasurePoints()); - else - this->setUseMeasurePoints(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseWaleInConfigFile()) - this->setUseWale(configData->getUseWale()); - else - this->setUseWale(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isUseInitNeqInConfigFile()) - this->setUseInitNeq(configData->getUseInitNeq()); - else - this->setUseInitNeq(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isSimulatePorousMediaInConfigFile()) - this->setSimulatePorousMedia(configData->getSimulatePorousMedia()); - else - this->setSimulatePorousMedia(false); - ////////////////////////////////////////////////////////////////////////// - if (configData->isD3QxxInConfigFile()) - this->setD3Qxx(configData->getD3Qxx()); - else - this->setD3Qxx((int)27); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTEndInConfigFile()) - this->setTEnd(configData->getTEnd()); - else - this->setTEnd((uint)10); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTOutInConfigFile()) - this->setTOut(configData->getTOut()); - else - this->setTOut((uint)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTStartOutInConfigFile()) - this->setTStartOut(configData->getTStartOut()); - else - this->setTStartOut((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTimeCalcMedStartInConfigFile()) - this->setTimeCalcMedStart(configData->getTimeCalcMedStart()); - else - this->setTimeCalcMedStart((int)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isTimeCalcMedEndInConfigFile()) - this->setTimeCalcMedEnd(configData->getTimeCalcMedEnd()); - else - this->setTimeCalcMedEnd((int)10); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressInIDInConfigFile()) - this->setPressInID(configData->getPressInID()); - else - this->setPressInID((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressOutIDInConfigFile()) - this->setPressOutID(configData->getPressOutID()); - else - this->setPressOutID((uint)0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressInZInConfigFile()) - this->setPressInZ(configData->getPressInZ()); - else - this->setPressInZ((uint)1); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressOutZInConfigFile()) - this->setPressOutZ(configData->getPressOutZ()); - else - this->setPressOutZ((uint)2); - ////////////////////////////////////////////////////////////////////////// - //second component - if (configData->isDiffOnInConfigFile()) - this->setDiffOn(configData->getDiffOn()); - else - this->setDiffOn(false); - - if (configData->isDiffModInConfigFile()) - this->setDiffMod(configData->getDiffMod()); - else - this->setDiffMod((int)27); - - if (configData->isDiffusivityInConfigFile()) - this->setDiffusivity(configData->getDiffusivity()); - else - this->setDiffusivity((real)0.001); - - if (configData->isTemperatureInitInConfigFile()) - this->setTemperatureInit(configData->getTemperatureInit()); - else - this->setTemperatureInit((real)0.0); - - if (configData->isTemperatureBCInConfigFile()) - this->setTemperatureBC(configData->getTemperatureBC()); - else - this->setTemperatureBC((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isViscosityInConfigFile()) - this->setViscosity(configData->getViscosity()); - else - this->setViscosity((real)0.001); - ////////////////////////////////////////////////////////////////////////// - if (configData->isVelocityInConfigFile()) - this->setVelocity(configData->getVelocity()); - else - this->setVelocity((real)0.01); - ////////////////////////////////////////////////////////////////////////// - if (configData->isViscosityRatioInConfigFile()) - this->setViscosityRatio(configData->getViscosityRatio()); - else - this->setViscosityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isVelocityRatioInConfigFile()) - this->setVelocityRatio(configData->getVelocityRatio()); - else - this->setVelocityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isDensityRatioInConfigFile()) - this->setDensityRatio(configData->getDensityRatio()); - else - this->setDensityRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isPressRatioInConfigFile()) - this->setPressRatio(configData->getPressRatio()); - else - this->setPressRatio((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isRealXInConfigFile()) - this->setRealX(configData->getRealX()); - else - this->setRealX((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isRealYInConfigFile()) - this->setRealY(configData->getRealY()); - else - this->setRealY((real)1.0); - ////////////////////////////////////////////////////////////////////////// - if (configData->isFactorPressBCInConfigFile()) - this->setFactorPressBC(configData->getFactorPressBC()); - else - this->setFactorPressBC((real)1.0); - ////////////////////////////////////////////////////////////////////////// - //read Geometry (STL) - if (configData->isReadGeoInConfigFile()) - this->setReadGeo(configData->getReadGeo()); - else - this->setReadGeo(false); - - if (configData->isGeometryFileCInConfigFile()) - this->setGeometryFileC(configData->getGeometryFileC()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileC has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileC(""); - - if (configData->isGeometryFileMInConfigFile()) - this->setGeometryFileM(configData->getGeometryFileM()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileM has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileM(""); - - if (configData->isGeometryFileFInConfigFile()) - this->setGeometryFileF(configData->getGeometryFileF()); - else if (this->getReadGeo()) - { - std::cout << "GeometryFileF has to be defined!" << std::endl; - exit(1); - } - else - this->setGeometryFileF(""); - ////////////////////////////////////////////////////////////////////////// - if (configData->isClockCycleForMPInConfigFile()) - this->setclockCycleForMP(configData->getClockCycleForMP()); - else - this->setclockCycleForMP((real)1.0); - - if (configData->isTimestepForMPInConfigFile()) - this->settimestepForMP(configData->getTimestepForMP()); - else - this->settimestepForMP((uint)10); - ////////////////////////////////////////////////////////////////////////// - std::string gridPath = ""; - if (configData->isGridPathInConfigFile()) - gridPath = configData->getGridPath(); - else - { - std::cout << "GridPath has to be defined!" << std::endl; - exit(1); - } - - if (this->getNumprocs() == 1) - gridPath += "/"; - else - gridPath += "/" + StringUtil::toString(this->getMyID()) + "/"; - ////////////////////////////////////////////////////////////////////////// - this->setFName(this->getOutputPath() + "/" + this->getOutputPrefix()); - ////////////////////////////////////////////////////////////////////////// - this->setgeoVec( gridPath + "geoVec.dat"); - this->setcoordX( gridPath + "coordX.dat"); - this->setcoordY( gridPath + "coordY.dat"); - this->setcoordZ( gridPath + "coordZ.dat"); - this->setneighborX( gridPath + "neighborX.dat"); - this->setneighborY( gridPath + "neighborY.dat"); - this->setneighborZ( gridPath + "neighborZ.dat"); - this->setneighborWSB( gridPath + "neighborWSB.dat"); - this->setscaleCFC( gridPath + "scaleCFC.dat"); - this->setscaleCFF( gridPath + "scaleCFF.dat"); - this->setscaleFCC( gridPath + "scaleFCC.dat"); - this->setscaleFCF( gridPath + "scaleFCF.dat"); - this->setscaleOffsetCF( gridPath + "offsetVecCF.dat"); - this->setscaleOffsetFC( gridPath + "offsetVecFC.dat"); - this->setgeomBoundaryBcQs( gridPath + "geomBoundaryQs.dat"); - this->setgeomBoundaryBcValues( gridPath + "geomBoundaryValues.dat"); - this->setinletBcQs( gridPath + "inletBoundaryQs.dat"); - this->setinletBcValues( gridPath + "inletBoundaryValues.dat"); - this->setoutletBcQs( gridPath + "outletBoundaryQs.dat"); - this->setoutletBcValues( gridPath + "outletBoundaryValues.dat"); - this->settopBcQs( gridPath + "topBoundaryQs.dat"); - this->settopBcValues( gridPath + "topBoundaryValues.dat"); - this->setbottomBcQs( gridPath + "bottomBoundaryQs.dat"); - this->setbottomBcValues( gridPath + "bottomBoundaryValues.dat"); - this->setfrontBcQs( gridPath + "frontBoundaryQs.dat"); - this->setfrontBcValues( gridPath + "frontBoundaryValues.dat"); - this->setbackBcQs( gridPath + "backBoundaryQs.dat"); - this->setbackBcValues( gridPath + "backBoundaryValues.dat"); - this->setnumberNodes( gridPath + "numberNodes.dat"); - this->setLBMvsSI( gridPath + "LBMvsSI.dat"); - this->setmeasurePoints( gridPath + "measurePoints.dat"); - this->setpropellerValues( gridPath + "propellerValues.dat"); - this->setcpTop( gridPath + "cpTop.dat"); - this->setcpBottom( gridPath + "cpBottom.dat"); - this->setcpBottom2( gridPath + "cpBottom2.dat"); - this->setConcentration( gridPath + "conc.dat"); - this->setStreetVelocity( gridPath + "streetVector.dat"); - ////////////////////////////////////////////////////////////////////////// - //Normals - Geometry - this->setgeomBoundaryNormalX(gridPath + "geomBoundaryNormalX.dat"); - this->setgeomBoundaryNormalY(gridPath + "geomBoundaryNormalY.dat"); - this->setgeomBoundaryNormalZ(gridPath + "geomBoundaryNormalZ.dat"); - //Normals - Inlet - this->setInflowBoundaryNormalX(gridPath + "inletBoundaryNormalX.dat"); - this->setInflowBoundaryNormalY(gridPath + "inletBoundaryNormalY.dat"); - this->setInflowBoundaryNormalZ(gridPath + "inletBoundaryNormalZ.dat"); - //Normals - Outlet - this->setOutflowBoundaryNormalX(gridPath + "outletBoundaryNormalX.dat"); - this->setOutflowBoundaryNormalY(gridPath + "outletBoundaryNormalY.dat"); - this->setOutflowBoundaryNormalZ(gridPath + "outletBoundaryNormalZ.dat"); - ////////////////////////////////////////////////////////////////////////// - //Forcing - real forcingX = 0.0; - real forcingY = 0.0; - real forcingZ = 0.0; - - if (configData->isForcingXInConfigFile()) - forcingX = configData->getForcingX(); - if (configData->isForcingYInConfigFile()) - forcingY = configData->getForcingY(); - if (configData->isForcingZInConfigFile()) - forcingZ = configData->getForcingZ(); - - this->setForcing(forcingX, forcingY, forcingZ); - ////////////////////////////////////////////////////////////////////////// - //quadricLimiters - real quadricLimiterP = (real)0.01; - real quadricLimiterM = (real)0.01; - real quadricLimiterD = (real)0.01; - - if (configData->isQuadricLimiterPInConfigFile()) - quadricLimiterP = configData->getQuadricLimiterP(); - if (configData->isQuadricLimiterMInConfigFile()) - quadricLimiterM = configData->getQuadricLimiterM(); - if (configData->isQuadricLimiterDInConfigFile()) - quadricLimiterD = configData->getQuadricLimiterD(); - - this->setQuadricLimiters(quadricLimiterP, quadricLimiterM, quadricLimiterD); - ////////////////////////////////////////////////////////////////////////// - //Particles - if (configData->isCalcParticlesInConfigFile()) - this->setCalcParticles(configData->getCalcParticles()); - else - this->setCalcParticles(false); - - if (configData->isParticleBasicLevelInConfigFile()) - this->setParticleBasicLevel(configData->getParticleBasicLevel()); - else - this->setParticleBasicLevel((int)0); - - if (configData->isParticleInitLevelInConfigFile()) - this->setParticleInitLevel(configData->getParticleInitLevel()); - else - this->setParticleInitLevel((int)0); - - if (configData->isNumberOfParticlesInConfigFile()) - this->setNumberOfParticles(configData->getNumberOfParticles()); - else - this->setNumberOfParticles((int)0); - - if (configData->isStartXHotWallInConfigFile()) - this->setStartXHotWall(configData->getStartXHotWall()); - else - this->setStartXHotWall((real)0); - - if (configData->isEndXHotWallInConfigFile()) - this->setEndXHotWall(configData->getEndXHotWall()); - else - this->setEndXHotWall((real)0); - ////////////////////////////////////////////////////////////////////////// - //for Multi GPU - if (this->getNumprocs() > 1) - { - ////////////////////////////////////////////////////////////////////////// - //3D domain decomposition - std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; - std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; - for (int i = 0; i < this->getNumprocs(); i++) - { - sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); - sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); - sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); - recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); - recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); - recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); - } - this->setPossNeighborFilesX(sendProcNeighborsX, "send"); - this->setPossNeighborFilesY(sendProcNeighborsY, "send"); - this->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); - this->setPossNeighborFilesX(recvProcNeighborsX, "recv"); - this->setPossNeighborFilesY(recvProcNeighborsY, "recv"); - this->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Restart - if (configData->isTimeDoCheckPointInConfigFile()) - this->setTimeDoCheckPoint(configData->getTimeDoCheckPoint()); - else - this->setTimeDoCheckPoint((uint)0); - - if (configData->isTimeDoRestartInConfigFile()) - this->setTimeDoRestart(configData->getTimeDoRestart()); - else - this->setTimeDoRestart((uint)0); - - if (configData->isDoCheckPointInConfigFile()) - this->setDoCheckPoint(configData->getDoCheckPoint()); - else - this->setDoCheckPoint(false); - - if (configData->isDoRestartInConfigFile()) - this->setDoRestart(configData->getDoRestart()); - else - this->setDoRestart(false); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if (configData->isMaxLevelInConfigFile()) - this->setMaxLevel(configData->getMaxLevel()); - else - this->setMaxLevel((int)1); - - if (configData->isGridXInConfigFile()) - this->setGridX(configData->getGridX()); - else - this->setGridX(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isGridYInConfigFile()) - this->setGridY(configData->getGridY()); - else - this->setGridY(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isGridZInConfigFile()) - this->setGridZ(configData->getGridZ()); - else - this->setGridZ(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isDistXInConfigFile()) - this->setDistX(configData->getDistX()); - else - this->setDistX(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isDistYInConfigFile()) - this->setDistY(configData->getDistY()); - else - this->setDistY(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isDistZInConfigFile()) - this->setDistZ(configData->getDistZ()); - else - this->setDistZ(std::vector<int>(this->getMaxLevel()+1, 32)); - - if (configData->isNeedInterfaceInConfigFile()) - this->setNeedInterface(configData->getNeedInterface()); - else - this->setNeedInterface(std::vector<bool>(6, true)); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Kernel - if (configData->isMainKernelInConfigFile()) - this->setMainKernel(configData->getMainKernel()); - else - this->setMainKernel("CumulantK15Comp"); - - if (configData->isMultiKernelOnInConfigFile()) - this->setMultiKernelOn(configData->getMultiKernelOn()); - else - this->setMultiKernelOn(false); - - if (configData->isMultiKernelLevelInConfigFile()) - this->setMultiKernelLevel(configData->getMultiKernelLevel()); - else if (this->getMultiKernelOn()) - { - std::vector<int> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back(i); - } - this->setMultiKernelLevel(tmp); - } - else - this->setMultiKernelLevel(std::vector<int>(0)); - - if (configData->isMultiKernelNameInConfigFile()) { - std::vector<std::string> kernels; - for (std::size_t i = 0; i < configData->getMultiKernelName().size(); i++) { - kernels.push_back(configData->getMultiKernelName().at(i)); - } - this->setMultiKernel(kernels); - } - else if (this->getMultiKernelOn()) - { - std::vector<std::string> tmp; - for (int i = 0; i < this->getMaxLevel()+1; i++) - { - tmp.push_back("CumulantK15Comp"); - } - this->setMultiKernel(tmp); - } - else { +#include <basics/config/ConfigurationFile.h> + + + +Parameter::Parameter(const vf::basics::ConfigurationFile &configData, int numberOfProcesses, int myId) +{ + ic.numprocs = numberOfProcesses; + ic.myid = myId; + + readConfigData(configData); + //initLBMSimulationParameter(); +} + +void Parameter::readConfigData(const vf::basics::ConfigurationFile &configData) +{ + if (configData.contains("NumberOfDevices")) + this->setMaxDev(configData.getValue<int>("NumberOfDevices")); + + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Devices")) + this->setDevices(configData.getVector<uint>("Devices")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Path")) + this->setOutputPath(configData.getValue<std::string>("Path")); + else + throw std::runtime_error("<Path> need to be defined in config file!"); + + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Prefix")) + this->setOutputPrefix(configData.getValue<std::string>("Prefix")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("WriteGrid")) + this->setPrintFiles(configData.getValue<bool>("WriteGrid")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("GeometryValues")) + this->setGeometryValues(configData.getValue<bool>("GeometryValues")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calc2ndOrderMoments")) + this->setCalc2ndOrderMoments(configData.getValue<bool>("calc2ndOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calc3rdOrderMoments")) + this->setCalc3rdOrderMoments(configData.getValue<bool>("calc3rdOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcHigherOrderMoments")) + this->setCalcHighOrderMoments(configData.getValue<bool>("calcHigherOrderMoments")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcMedian")) + this->setCalcMedian(configData.getValue<bool>("calcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcCp")) + this->calcCp = configData.getValue<bool>("calcCp"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcDrafLift")) + this->calcDragLift = configData.getValue<bool>("calcDrafLift"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("writeVeloASCIIfiles")) + this->writeVeloASCII = configData.getValue<bool>("writeVeloASCIIfiles"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("calcPlaneConc")) + this->calcPlaneConc = configData.getValue<bool>("calcPlaneConc"); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseConcFile")) + this->setConcFile(configData.getValue<bool>("UseConcFile")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseStreetVelocityFile")) + this->setStreetVelocityFile(configData.getValue<bool>("UseStreetVelocityFile")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseMeasurePoints")) + this->setUseMeasurePoints(configData.getValue<bool>("UseMeasurePoints")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseWale")) + this->setUseWale(configData.getValue<bool>("UseWale")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("UseInitNeq")) + this->setUseInitNeq(configData.getValue<bool>("UseInitNeq")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SimulatePorousMedia")) + this->setSimulatePorousMedia(configData.getValue<bool>("SimulatePorousMedia")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("D3Qxx")) + this->setD3Qxx(configData.getValue<int>("D3Qxx")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeEnd")) + this->setTEnd(configData.getValue<int>("TimeEnd")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeOut")) + this->setTOut(configData.getValue<int>("TimeOut")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeStartOut")) + this->setTStartOut(configData.getValue<int>("TimeStartOut")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeStartCalcMedian")) + this->setTimeCalcMedStart(configData.getValue<int>("TimeStartCalcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TimeEndCalcMedian")) + this->setTimeCalcMedEnd(configData.getValue<int>("TimeEndCalcMedian")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressInID")) + this->setPressInID(configData.getValue<int>("PressInID")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressOutID")) + this->setPressOutID(configData.getValue<int>("PressOutID")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressInZ")) + this->setPressInZ(configData.getValue<int>("PressInZ")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("PressOutZ")) + this->setPressOutZ(configData.getValue<int>("PressOutZ")); + + ////////////////////////////////////////////////////////////////////////// + //second component + if (configData.contains("DiffOn")) + this->setDiffOn(configData.getValue<bool>("DiffOn")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("DiffMod")) + this->setDiffMod(configData.getValue<int>("DiffMod")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Diffusivity")) + this->setDiffusivity(configData.getValue<real>("Diffusivity")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Temp")) + this->setTemperatureInit(configData.getValue<real>("Temp")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("TempBC")) + this->setTemperatureBC(configData.getValue<real>("TempBC")); + + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Viscosity_LB")) + this->setViscosity(configData.getValue<real>("Viscosity_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Velocity_LB")) + this->setVelocity(configData.getValue<real>("Velocity_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Viscosity_Ratio_World_to_LB")) + this->setViscosityRatio(configData.getValue<real>("Viscosity_Ratio_World_to_LB")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Velocity_Ratio_World_to_LB")) + this->setVelocityRatio(configData.getValue<real>("Velocity_Ratio_World_to_LB")); + // ////////////////////////////////////////////////////////////////////////// + if (configData.contains("Density_Ratio_World_to_LB")) + this->setDensityRatio(configData.getValue<real>("Density_Ratio_World_to_LB")); + + if (configData.contains("Delta_Press")) + this->setPressRatio(configData.getValue<real>("Delta_Press")); + + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SliceRealX")) + this->setRealX(configData.getValue<real>("SliceRealX")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("SliceRealY")) + this->setRealY(configData.getValue<real>("SliceRealY")); + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("FactorPressBC")) + this->setFactorPressBC(configData.getValue<real>("FactorPressBC")); + + ////////////////////////////////////////////////////////////////////////// + //read Geometry (STL) + if (configData.contains("ReadGeometry")) + this->setReadGeo(configData.getValue<bool>("ReadGeometry")); + + if (configData.contains("GeometryC")) + this->setGeometryFileC(configData.getValue<std::string>("GeometryC")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryC has to be set as well!"); + + if (configData.contains("GeometryM")) + this->setGeometryFileM(configData.getValue<std::string>("GeometryM")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryM has to be set as well!"); + + if (configData.contains("GeometryF")) + this->setGeometryFileF(configData.getValue<std::string>("GeometryF")); + else if (this->getReadGeo()) + throw std::runtime_error("readGeo is true, GeometryF has to be set as well!"); + + ////////////////////////////////////////////////////////////////////////// + if (configData.contains("measureClockCycle")) + this->setclockCycleForMP(configData.getValue<real>("measureClockCycle")); + + if (configData.contains("measureTimestep")) + this->settimestepForMP(configData.getValue<uint>("measureTimestep")); + + ////////////////////////////////////////////////////////////////////////// + + std::string gridPath{ "" }; + if (configData.contains("GridPath")) + gridPath = configData.getValue<std::string>("GridPath"); + else + throw std::runtime_error("GridPath has to be defined in config file!"); + + if (this->getNumprocs() == 1) + gridPath += "/"; + else + gridPath += "/" + StringUtil::toString(this->getMyID()) + "/"; + + // ////////////////////////////////////////////////////////////////////////// + this->setFName(this->getOutputPath() + "/" + this->getOutputPrefix()); + ////////////////////////////////////////////////////////////////////////// + this->setgeoVec(gridPath + "geoVec.dat"); + this->setcoordX(gridPath + "coordX.dat"); + this->setcoordY(gridPath + "coordY.dat"); + this->setcoordZ(gridPath + "coordZ.dat"); + this->setneighborX(gridPath + "neighborX.dat"); + this->setneighborY(gridPath + "neighborY.dat"); + this->setneighborZ(gridPath + "neighborZ.dat"); + this->setneighborWSB(gridPath + "neighborWSB.dat"); + this->setscaleCFC(gridPath + "scaleCFC.dat"); + this->setscaleCFF(gridPath + "scaleCFF.dat"); + this->setscaleFCC(gridPath + "scaleFCC.dat"); + this->setscaleFCF(gridPath + "scaleFCF.dat"); + this->setscaleOffsetCF(gridPath + "offsetVecCF.dat"); + this->setscaleOffsetFC(gridPath + "offsetVecFC.dat"); + this->setgeomBoundaryBcQs(gridPath + "geomBoundaryQs.dat"); + this->setgeomBoundaryBcValues(gridPath + "geomBoundaryValues.dat"); + this->setinletBcQs(gridPath + "inletBoundaryQs.dat"); + this->setinletBcValues(gridPath + "inletBoundaryValues.dat"); + this->setoutletBcQs(gridPath + "outletBoundaryQs.dat"); + this->setoutletBcValues(gridPath + "outletBoundaryValues.dat"); + this->settopBcQs(gridPath + "topBoundaryQs.dat"); + this->settopBcValues(gridPath + "topBoundaryValues.dat"); + this->setbottomBcQs(gridPath + "bottomBoundaryQs.dat"); + this->setbottomBcValues(gridPath + "bottomBoundaryValues.dat"); + this->setfrontBcQs(gridPath + "frontBoundaryQs.dat"); + this->setfrontBcValues(gridPath + "frontBoundaryValues.dat"); + this->setbackBcQs(gridPath + "backBoundaryQs.dat"); + this->setbackBcValues(gridPath + "backBoundaryValues.dat"); + this->setnumberNodes(gridPath + "numberNodes.dat"); + this->setLBMvsSI(gridPath + "LBMvsSI.dat"); + this->setmeasurePoints(gridPath + "measurePoints.dat"); + this->setpropellerValues(gridPath + "propellerValues.dat"); + this->setcpTop(gridPath + "cpTop.dat"); + this->setcpBottom(gridPath + "cpBottom.dat"); + this->setcpBottom2(gridPath + "cpBottom2.dat"); + this->setConcentration(gridPath + "conc.dat"); + this->setStreetVelocity(gridPath + "streetVector.dat"); + ////////////////////////////////////////////////////////////////////////// + // Normals - Geometry + this->setgeomBoundaryNormalX(gridPath + "geomBoundaryNormalX.dat"); + this->setgeomBoundaryNormalY(gridPath + "geomBoundaryNormalY.dat"); + this->setgeomBoundaryNormalZ(gridPath + "geomBoundaryNormalZ.dat"); + // Normals - Inlet + this->setInflowBoundaryNormalX(gridPath + "inletBoundaryNormalX.dat"); + this->setInflowBoundaryNormalY(gridPath + "inletBoundaryNormalY.dat"); + this->setInflowBoundaryNormalZ(gridPath + "inletBoundaryNormalZ.dat"); + // Normals - Outlet + this->setOutflowBoundaryNormalX(gridPath + "outletBoundaryNormalX.dat"); + this->setOutflowBoundaryNormalY(gridPath + "outletBoundaryNormalY.dat"); + this->setOutflowBoundaryNormalZ(gridPath + "outletBoundaryNormalZ.dat"); + ////////////////////////////////////////////////////////////////////////// + // //Forcing + real forcingX = 0.0; + real forcingY = 0.0; + real forcingZ = 0.0; + + if (configData.contains("ForcingX")) + forcingX = configData.getValue<real>("ForcingX"); + if (configData.contains("ForcingY")) + forcingY = configData.getValue<real>("ForcingY"); + if (configData.contains("ForcingZ")) + forcingZ = configData.getValue<real>("ForcingZ"); + + this->setForcing(forcingX, forcingY, forcingZ); + ////////////////////////////////////////////////////////////////////////// + // quadricLimiters + real quadricLimiterP = (real)0.01; + real quadricLimiterM = (real)0.01; + real quadricLimiterD = (real)0.01; + + if (configData.contains("QuadricLimiterP")) + quadricLimiterP = configData.getValue<real>("QuadricLimiterP"); + if (configData.contains("QuadricLimiterM")) + quadricLimiterM = configData.getValue<real>("QuadricLimiterM"); + if (configData.contains("QuadricLimiterD")) + quadricLimiterD = configData.getValue<real>("QuadricLimiterD"); + + this->setQuadricLimiters(quadricLimiterP, quadricLimiterM, quadricLimiterD); + ////////////////////////////////////////////////////////////////////////// + // Particles + if (configData.contains("calcParticles")) + this->setCalcParticles(configData.getValue<bool>("calcParticles")); + + if (configData.contains("baseLevel")) + this->setParticleBasicLevel(configData.getValue<int>("baseLevel")); + + if (configData.contains("initLevel")) + this->setParticleInitLevel(configData.getValue<int>("initLevel")); + + if (configData.contains("numberOfParticles")) + this->setNumberOfParticles(configData.getValue<int>("numberOfParticles")); + + if (configData.contains("startXHotWall")) + this->setStartXHotWall(configData.getValue<real>("startXHotWall")); + + if (configData.contains("endXHotWall")) + this->setEndXHotWall(configData.getValue<real>("endXHotWall")); + ////////////////////////////////////////////////////////////////////////// + // for Multi GPU + if (this->getNumprocs() > 1) { + ////////////////////////////////////////////////////////////////////////// + // 3D domain decomposition + std::vector<std::string> sendProcNeighborsX, sendProcNeighborsY, sendProcNeighborsZ; + std::vector<std::string> recvProcNeighborsX, recvProcNeighborsY, recvProcNeighborsZ; + for (int i = 0; i < this->getNumprocs(); i++) { + sendProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xs.dat"); + sendProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Ys.dat"); + sendProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zs.dat"); + recvProcNeighborsX.push_back(gridPath + StringUtil::toString(i) + "Xr.dat"); + recvProcNeighborsY.push_back(gridPath + StringUtil::toString(i) + "Yr.dat"); + recvProcNeighborsZ.push_back(gridPath + StringUtil::toString(i) + "Zr.dat"); + } + this->setPossNeighborFilesX(sendProcNeighborsX, "send"); + this->setPossNeighborFilesY(sendProcNeighborsY, "send"); + this->setPossNeighborFilesZ(sendProcNeighborsZ, "send"); + this->setPossNeighborFilesX(recvProcNeighborsX, "recv"); + this->setPossNeighborFilesY(recvProcNeighborsY, "recv"); + this->setPossNeighborFilesZ(recvProcNeighborsZ, "recv"); + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Restart + if (configData.contains("TimeDoCheckPoint")) + this->setTimeDoCheckPoint(configData.getValue<uint>("TimeDoCheckPoint")); + + if (configData.contains("TimeDoRestart")) + this->setTimeDoRestart(configData.getValue<uint>("TimeDoRestart")); + + if (configData.contains("DoCheckPoint")) + this->setDoCheckPoint(configData.getValue<bool>("DoCheckPoint")); + + if (configData.contains("DoRestart")) + this->setDoRestart(configData.getValue<bool>("DoRestart")); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + if (configData.contains("NOGL")) + setMaxLevel(configData.getValue<int>("NOGL")); + + this->setGridX(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setGridY(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setGridZ(std::vector<int>(this->getMaxLevel() + 1, 32)); + + this->setDistX(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setDistY(std::vector<int>(this->getMaxLevel() + 1, 32)); + this->setDistZ(std::vector<int>(this->getMaxLevel() + 1, 32)); + + if (configData.contains("GridX")) + this->setGridX(configData.getVector<int>("GridX")); + + if (configData.contains("GridY")) + this->setGridY(configData.getVector<int>("GridY")); + + if (configData.contains("GridZ")) + this->setGridZ(configData.getVector<int>("GridZ")); + + if (configData.contains("DistX")) + this->setDistX(configData.getVector<int>("DistX")); + + if (configData.contains("DistY")) + this->setDistY(configData.getVector<int>("DistY")); + + if (configData.contains("DistZ")) + this->setDistZ(configData.getVector<int>("DistZ")); + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Kernel + if (configData.contains("MainKernelName")) + this->setMainKernel(configData.getValue<std::string>("MainKernelName")); + + if (configData.contains("MultiKernelOn")) + this->setMultiKernelOn(configData.getValue<bool>("MultiKernelOn")); + + if (configData.contains("MultiKernelLevel")) + this->setMultiKernelLevel(configData.getVector<int>("MultiKernelLevel")); + else if (this->getMultiKernelOn()) { + std::vector<int> tmp; + for (int i = 0; i < this->getMaxLevel() + 1; i++) { + tmp.push_back(i); + } + this->setMultiKernelLevel(tmp); + } + + if (configData.contains("MultiKernelName")) + this->setMultiKernel(configData.getVector<std::string>("MultiKernelName")); + else if (this->getMultiKernelOn()) { std::vector<std::string> tmp; - this->setMultiKernel(tmp); - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -} -Parameter::~Parameter() -{ + for (int i = 0; i < this->getMaxLevel() + 1; i++) { + tmp.push_back("CumulantK17Comp"); + } + this->setMultiKernel(tmp); + } } -Parameter* Parameter::instanz = 0; -Parameter* Parameter::getInstanz() -{ - if( instanz == 0 ) - instanz = new Parameter(); - return instanz; -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//init-method -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void Parameter::initParameter() -{ - factor_gridNZ = 2; - coarse = 0; - fine = this->maxlevel; - parH.resize(this->maxlevel+1); - parD.resize(this->maxlevel+1); +void Parameter::initLBMSimulationParameter() +{ //host for (int i = coarse; i <= fine; i++) { - parH[i] = new ParameterStruct; + parH[i] = std::make_shared<LBMSimulationParameter>(); parH[i]->numberofthreads = 64;// 128; parH[i]->gridNX = getGridX().at(i); parH[i]->gridNY = getGridY().at(i); @@ -624,7 +463,7 @@ void Parameter::initParameter() parH[i]->XdistKn = getDistX().at(i); parH[i]->YdistKn = getDistY().at(i); parH[i]->ZdistKn = getDistZ().at(i); - if (i==coarse) + if (i == coarse) { parH[i]->distX = (real)getDistX().at(i); parH[i]->distY = (real)getDistY().at(i); @@ -662,18 +501,12 @@ void Parameter::initParameter() //parH[i]->cStartz = (real)parH[i]->XdistKn; //////////////////////////////////////////////////////////////////////////// } - parH[i]->need_interface[INTERFACE_E]=getNeedInterface().at(INTERFACE_E); - parH[i]->need_interface[INTERFACE_W]=getNeedInterface().at(INTERFACE_W); - parH[i]->need_interface[INTERFACE_N]=getNeedInterface().at(INTERFACE_N); - parH[i]->need_interface[INTERFACE_S]=getNeedInterface().at(INTERFACE_S); - parH[i]->need_interface[INTERFACE_T]=getNeedInterface().at(INTERFACE_T); - parH[i]->need_interface[INTERFACE_B]=getNeedInterface().at(INTERFACE_B); } //device for (int i = coarse; i <= fine; i++) { - parD[i] = new ParameterStruct; + parD[i] = std::make_shared<LBMSimulationParameter>(); parD[i]->numberofthreads = parH[i]->numberofthreads; parD[i]->gridNX = parH[i]->gridNX; parD[i]->gridNY = parH[i]->gridNY; @@ -706,249 +539,8 @@ void Parameter::initParameter() parD[i]->distY = parH[i]->distY; parD[i]->distZ = parH[i]->distZ; } - - //Interface - //comment out for geller - //for (int i = coarse; i < fine; i++) - //{ - // initInterfaceParameter(i); - //} -} -void Parameter::setSizeMatSparse(int level) -{ - parH[level]->size_Mat_SP = 1; - parD[level]->size_Mat_SP = 1; - parH[level]->sizePlaneSB = 0; - parH[level]->sizePlaneST = 0; - parH[level]->sizePlaneRB = 0; - parH[level]->sizePlaneRT = 0; - parH[level]->isSetSendB = false; - parH[level]->isSetSendT = false; - parH[level]->isSetRecvB = false; - parH[level]->isSetRecvT = false; - unsigned int mm[8]; - - for (unsigned int k=1; k<parH[level]->gridNZ + 2 * STARTOFFZ - 1; k++) - { - for (unsigned int j=1; j<parH[level]->gridNY + 2 * STARTOFFY - 1; j++) - { - for (unsigned int i=1; i<parH[level]->gridNX + 2 * STARTOFFX - 1; i++) - { - mm[0]= parH[level]->nx*(parH[level]->ny*k + j) + i; - mm[1]= mm[0] -1; //W - mm[2]= mm[0] -parH[level]->nx-1; //SW - mm[3]= mm[0] -parH[level]->nx; //S - mm[4]= mm[0]-(parH[level]->nx*parH[level]->ny); //B - mm[5]= mm[0]-(parH[level]->nx*parH[level]->ny) -1; //BW - mm[6]= mm[0]-(parH[level]->nx*parH[level]->ny)-parH[level]->nx; //BS - mm[7]= mm[0]-(parH[level]->nx*parH[level]->ny)-parH[level]->nx-1; //BSW - - if ( parH[level]->geo[mm[0]] != GEO_VOID || - parH[level]->geo[mm[1]] != GEO_VOID || - parH[level]->geo[mm[2]] != GEO_VOID || - parH[level]->geo[mm[3]] != GEO_VOID || - parH[level]->geo[mm[4]] != GEO_VOID || - parH[level]->geo[mm[5]] != GEO_VOID || - parH[level]->geo[mm[6]] != GEO_VOID || - parH[level]->geo[mm[7]] != GEO_VOID ) - { - ////////////////////////////////////////////////////////////////////////// - //add some stuff for the data exchange between the GPUs ////////////////// - if (k == STARTOFFZ) - { - parH[level]->sizePlaneSB += 1; - if (parH[level]->isSetSendB == false) - { - parH[level]->startB = mm[0]; - parH[level]->isSetSendB = true; - } - } - else if (k == parH[level]->gridNZ + STARTOFFZ - 1) - { - parH[level]->sizePlaneST += 1; - if (parH[level]->isSetSendT == false) - { - parH[level]->startT = mm[0]; - parH[level]->isSetSendT = true; - } - } - else if (k == parH[level]->gridNZ + STARTOFFZ) - { - parH[level]->sizePlaneRB += 1; - if (parH[level]->isSetRecvB == false) - { - parH[level]->endB = mm[0]; - parH[level]->isSetRecvB = true; - } - } - else if (k == STARTOFFZ-1) - { - parH[level]->sizePlaneRT += 1; - if (parH[level]->isSetRecvT == false) - { - parH[level]->endT = mm[0]; - parH[level]->isSetRecvT = true; - } - } - ////////////////////////////////////////////////////////////////////////// - parH[level]->k[mm[0]] = parH[level]->size_Mat_SP; - parH[level]->size_Mat_SP = parH[level]->size_Mat_SP + 1; - parD[level]->size_Mat_SP = parD[level]->size_Mat_SP + 1; - } - else parH[level]->k[mm[0]] = 0; - } - } - } - parH[level]->mem_size_real_SP = sizeof(real ) * parH[level]->size_Mat_SP; - parH[level]->mem_size_int_SP = sizeof(unsigned int) * parH[level]->size_Mat_SP; - parD[level]->mem_size_real_SP = sizeof(real ) * parD[level]->size_Mat_SP; - parD[level]->mem_size_int_SP = sizeof(unsigned int) * parD[level]->size_Mat_SP; } -void Parameter::fillSparse(int level) -{ - //nsigned int li = ((parH[level]->gridNX+STARTOFFX-2)-(STARTOFFX+1)-1); - //unsigned int lj = ((parH[level]->gridNY+STARTOFFY-2)-(STARTOFFY+1)-1); - // real globalX, globalY, globalZ; - real PI = 3.141592653589793238462643383279f; - - for (unsigned int k=1; k<parH[level]->gridNZ + 2 * STARTOFFZ - 1; k++) - { - for (unsigned int j=1; j<parH[level]->gridNY + 2 * STARTOFFY - 1; j++) - { - for (unsigned int i=1; i<parH[level]->gridNX + 2 * STARTOFFX - 1; i++) - { - int m = parH[level]->nx*(parH[level]->ny*k + j) + i; - if ((k < parH[level]->gridNZ + 2 * STARTOFFZ - 2) && (j < parH[level]->gridNY + 2 * STARTOFFY - 2) && (i < parH[level]->gridNX + 2 * STARTOFFX - 2)) - { - if ((X1PERIODIC == true) && (level==coarse) && (i==parH[level]->gridNX + STARTOFFX - 1)) - { - int mm = parH[level]->nx*(parH[level]->ny*k + j) + STARTOFFX; - parH[level]->neighborX_SP[parH[level]->k[m]] = parH[level]->k[mm]; - } - else - { - parH[level]->neighborX_SP[parH[level]->k[m]] = parH[level]->k[m+1]; - } - if ((X2PERIODIC == true) && (level==coarse) && (j==parH[level]->gridNY + STARTOFFY - 1)) - { - int mm = parH[level]->nx*(parH[level]->ny*k + STARTOFFY) + i; - parH[level]->neighborY_SP[parH[level]->k[m]] = parH[level]->k[mm]; - } - else - { - parH[level]->neighborY_SP[parH[level]->k[m]] = parH[level]->k[m+parH[level]->nx]; - } - if ((X3PERIODIC == true) && (level==coarse) && (k==parH[level]->gridNZ + STARTOFFZ - 1)) - { - int mm = parH[level]->nx*(parH[level]->ny*STARTOFFZ + j) + i; - parH[level]->neighborZ_SP[parH[level]->k[m]] = parH[level]->k[mm]; - } - else - { - parH[level]->neighborZ_SP[parH[level]->k[m]] = parH[level]->k[m+(parH[level]->nx*parH[level]->ny)]; - } - } - parH[level]->geoSP[parH[level]->k[m]] = parH[level]->geo[m]; - //////////////////////////////////////////////////////////////////////////// - ////Coordinates - //parH[level]->coordX_SP[parH[level]->k[m]] = i; - //parH[level]->coordY_SP[parH[level]->k[m]] = j; - //parH[level]->coordZ_SP[parH[level]->k[m]] = k; - //////////////////////////////////////////////////////////////////////////// - if (diffOn==true) - { - parH[level]->Conc[parH[level]->k[m]] = parH[level]->Conc_Full[m]; - } - //////////////////////////////////////////////////////////////////////////// - ////set pressure in the middle of the fine grid - //if (level == getFine()) - //{ - // if( i == parH[level]->gridNX/2 + STARTOFFX - // && j == parH[level]->gridNY/2 + STARTOFFY - // && k == parH[level]->gridNZ/2 + STARTOFFZ) - // parH[level]->rho_SP[parH[level]->k[m]] = (real)0.1f; - // else - // parH[level]->rho_SP[parH[level]->k[m]] = (real)0.0f; - //} - //else - //{ - // parH[level]->rho_SP[parH[level]->k[m]] = (real)0.0f; - //} - // globalX = TrafoXtoWorld(i,level); - // globalY = TrafoYtoWorld(j,level); - // globalZ = TrafoZtoWorld(k,level); - //without setting a pressure - parH[level]->rho_SP[parH[level]->k[m]] = (real)0.0f; //parH[level]->Conc_Full[m];//bitte schnell wieder entfernen!!! - ////////////////////////////////////////////////////////////////////////// - parH[level]->vx_SP[parH[level]->k[m]] = (real)0.0f; - //parH[level]->vx_SP[parH[level]->k[m]] = u0/3.0; - parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0f; - //parH[level]->vy_SP[parH[level]->k[m]] = u0/3.0; - parH[level]->vz_SP[parH[level]->k[m]] = (real)0.0f; - //parH[level]->vz_SP[parH[level]->k[m]] = u0/3.0; - //parH[level]->vz_SP[parH[level]->k[m]] = (real)(u0*2.f)*((-4.f*globalX*globalX + parH[level]->gridNX*(-2.f - 4.f*STARTOFFX) - 4.f*(-1.5f + STARTOFFX)*(0.5f + STARTOFFX) + globalX*(-4.f + 4.f*parH[level]->gridNX + 8.f*STARTOFFX))*(-4.f*globalY*globalY + parH[level]->gridNY*(-2.f - 4.f*STARTOFFY) - 4.f*(-1.5f + STARTOFFY)*(0.5f + STARTOFFY) + globalY*(-4.f + 4.f*parH[level]->gridNY + 8.f*STARTOFFY)))/((2.f - parH[level]->gridNX)*(2.f - parH[level]->gridNX)*(2.f - parH[level]->gridNY)*(2.f - parH[level]->gridNY)); - //parH[level]->vz_SP[parH[level]->k[m]] = (real)(u0*2.f)*((-4.f*i*i + parH[level]->gridNX*(-2.f - 4.f*STARTOFFX) - 4.f*(-1.5f + STARTOFFX)*(0.5f + STARTOFFX) + i*(-4.f + 4.f*parH[level]->gridNX + 8.f*STARTOFFX))*(-4.f*j*j + parH[level]->gridNY*(-2.f - 4.f*STARTOFFY) - 4.f*(-1.5f + STARTOFFY)*(0.5f + STARTOFFY) + j*(-4.f + 4.f*parH[level]->gridNY + 8.f*STARTOFFY)))/((2.f - parH[level]->gridNX)*(2.f - parH[level]->gridNX)*(2.f - parH[level]->gridNY)*(2.f - parH[level]->gridNY)); - //parH[level]->vz_SP[parH[level]->k[m]] = (real)(16.f*(u0*2.f)*(i-(STARTOFFX+1)-0.5f)*(li-1.5f-(i-(STARTOFFX+1)))*(j-(STARTOFFY+1)-0.5f)*(lj-1.5f-(j-(STARTOFFY+1))))/(li*lj*li*lj);//(16.f*(u0*2.f)*i*j*(parH[level]->nx-i)*(parH[level]->ny-j))/(parH[level]->nx*parH[level]->nx*parH[level]->ny*parH[level]->ny); //u0; - ////////////////////////////////////////////////////////////////////////// - ////gerade - //parH[level]->vx_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.) / (1000.*(real)parH[level]->gridNX));//(real)parH[level]->gridNX / (real)1000 * 3.0; - //parH[level]->vy_SP[parH[level]->k[m]] = (real)((getVelocity() * sin(2.0 * i / parH[level]->gridNX * PI) * cos(2.0 * k / parH[level]->gridNZ * PI)) * (32. / (real)parH[level]->gridNX)); - //parH[level]->vz_SP[parH[level]->k[m]] = (real)0.0f; - //schraeg x - // parH[level]->vx_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000.*(real)parH[level]->gridNX) + (getVelocity() * cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI)))); - // parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0; - // parH[level]->vz_SP[parH[level]->k[m]] = (real)(getVelocity() * cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI))); - //schraeg z - //parH[level]->vx_SP[parH[level]->k[m]] = (real)(getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI))); - //parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0; - //parH[level]->vz_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000.*(real)parH[level]->gridNZ) + (getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI)))); - - //Taylor Green Vortex uniform - parH[level]->rho_SP[parH[level]->k[m]] = (real)((getVelocity()*getVelocity())*3.0/4.0*(cos((i)*4.0*PI/(real)parH[level]->gridNX)+cos((k)*4.0*PI/(real)parH[level]->gridNZ)))*(real)(parH[level]->gridNZ)/(real)(parH[level]->gridNX); - //inkl. ueberlagerter Geschwindigkeit - // parH[level]->vx_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000.*(real)parH[level]->gridNX) + getVelocity()*sin(((i)*2.0*PI/(real)parH[level]->gridNX))*cos((k)*2.0*PI/(real)parH[level]->gridNZ)); - parH[level]->vx_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000. * 32.) * getVelocity() / 0.001 + getVelocity()*sin(((i)*2.0*PI/(real)parH[level]->gridNX))*cos((k)*2.0*PI/(real)parH[level]->gridNZ)); - //ohne ueberlagerter Geschwindigkeit - // parH[level]->vx_SP[parH[level]->k[m]] = (real)(getVelocity()*sin(((i)*2.0*PI/(real)parH[level]->gridNX))*cos((k)*2.0*PI/(real)parH[level]->gridNZ)); - parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0; - parH[level]->vz_SP[parH[level]->k[m]] = (real)(-getVelocity()*cos(((i)*2.0*PI/(real)parH[level]->gridNX))*sin((k)*2.0*PI/(real)parH[level]->gridNZ))*(real)(parH[level]->gridNZ)/(real)(parH[level]->gridNX); - - //Kernel Fix Test - //parH[level]->vx_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000.*(real)parH[level]->gridNX) + (getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI)))); - //parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0; - //parH[level]->vz_SP[parH[level]->k[m]] = (real)(getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI))); - ////parH[level]->vx_SP[parH[level]->k[m]] = (real)(getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI))); - ////parH[level]->vy_SP[parH[level]->k[m]] = (real)0.0; - ////parH[level]->vz_SP[parH[level]->k[m]] = (real)((32. * 32. * 3.)/(1000.*(real)parH[level]->gridNZ) + (getVelocity() * std::cos((2.0 * k / parH[level]->gridNZ * PI) + (2.0 * i / parH[level]->gridNX * PI)))); - ////////////////////////////////////////////////////////////////////////// - //Taylor Green Vortex - //InitglobalX = TrafoXtoMGsWorld(i,level); - //InitglobalY = TrafoYtoMGsWorld(j,level); - //InitglobalZ = TrafoZtoMGsWorld(k,level); - //parH[level]->rho_SP[parH[level]->k[m]] = (real)((u0*u0)*3.f/4.f*(cos((InitglobalX)*4.f*PI/parH[level]->gridNX)+cos((InitglobalY)*4.f*PI/parH[level]->gridNY))); - //parH[level]->vx_SP[parH[level]->k[m]] = (real)( u0*sin(((InitglobalX)*2.f*PI/parH[level]->gridNX))*cos((InitglobalY)*2.f*PI/parH[level]->gridNY)); - //parH[level]->vy_SP[parH[level]->k[m]] = (real)(-u0*cos(((InitglobalX)*2.f*PI/parH[level]->gridNX))*sin((InitglobalY)*2.f*PI/parH[level]->gridNY)); - //parH[level]->vz_SP[parH[level]->k[m]] = (real)0.0f; - ////////////////////////////////////////////////////////////////////////// - } - } - } - parH[level]->neighborX_SP[parH[level]->k[0]] = 0; - parH[level]->neighborY_SP[parH[level]->k[0]] = 0; - parH[level]->neighborZ_SP[parH[level]->k[0]] = 0; - parH[level]->geoSP[ parH[level]->k[0]] = GEO_VOID; - parH[level]->rho_SP[ parH[level]->k[0]] = (real)0.f; - parH[level]->vx_SP[ parH[level]->k[0]] = (real)0.f; - parH[level]->vy_SP[ parH[level]->k[0]] = (real)0.f; - parH[level]->vz_SP[ parH[level]->k[0]] = (real)0.f; - //////////////////////////////////////////////////////////////////////////// - ////Coordinates - //parH[level]->coordX_SP[parH[level]->k[0]] = 0; - //parH[level]->coordY_SP[parH[level]->k[0]] = 0; - //parH[level]->coordZ_SP[parH[level]->k[0]] = 0; - //////////////////////////////////////////////////////////////////////////// -} void Parameter::copyMeasurePointsArrayToVector(int lev) { int valuesPerClockCycle = (int)(getclockCycleForMP()/getTimestepForMP()); @@ -964,12 +556,6 @@ void Parameter::copyMeasurePointsArrayToVector(int lev) } } } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1029,7 +615,10 @@ void Parameter::setD3Qxx(int d3qxx) } void Parameter::setMaxLevel(int maxlevel) { - this->maxlevel = maxlevel-1; + this->maxlevel = maxlevel-1; + this->fine = this->maxlevel; + parH.resize(this->maxlevel + 1); + parD.resize(this->maxlevel + 1); } void Parameter::setParticleBasicLevel(int pbl) { @@ -1209,10 +798,6 @@ void Parameter::setGeometryFileF(std::string GeometryFileF) { ic.geometryFileF = GeometryFileF; } -void Parameter::setNeedInterface(std::vector<bool> NeedInterface) -{ - ic.NeedInterface = NeedInterface; -} void Parameter::setRe(real Re) { ic.Re = Re; @@ -1975,11 +1560,11 @@ unsigned int Parameter::getStartTurn() { return startTurn; } -ParameterStruct* Parameter::getParD(int level) +std::shared_ptr<LBMSimulationParameter> Parameter::getParD(int level) { return parD[level]; } -ParameterStruct* Parameter::getParH(int level) +std::shared_ptr<LBMSimulationParameter> Parameter::getParH(int level) { return parH[level]; } @@ -2237,10 +1822,6 @@ std::string Parameter::getGeometryFileF() { return ic.geometryFileF; } -std::vector<bool> Parameter::getNeedInterface() -{ - return ic.NeedInterface; -} real Parameter::getRe() { return ic.Re; @@ -2688,16 +2269,9 @@ bool Parameter::getIsProp() { return ic.isProp; } -bool Parameter::overWritingRestart(unsigned int t) +bool Parameter::overWritingRestart(uint t) { - if (t == getTimeDoRestart()) - { - return true; - } - else - { - return false; - } + return t == getTimeDoRestart(); } unsigned int Parameter::getTimestepForMP() { @@ -2879,7 +2453,7 @@ std::vector< int> Parameter::getMultiKernelLevel() { return multiKernelLevel; } -std::vector< std::string> Parameter::getMultiKernel() +std::vector<std::string> Parameter::getMultiKernel() { return multiKernel; } @@ -2900,65 +2474,6 @@ std::function<void(real,real,real,real&,real&,real&,real&)>& Parameter::getIniti return this->initialCondition; } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//private methods -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void Parameter::initInterfaceParameter(int level) -{ - /////////////////////////////////////////////////////////////////////////////////////////////////// - //host - parH[level]->K_CF = 0; - parH[level]->K_FC = 0; - if (parH[level]->need_interface[INTERFACE_E]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNY /2)*( parH[level+1]->gridNZ /2); - parH[level]->K_FC += ((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNZ-6)/2); - } - if (parH[level]->need_interface[INTERFACE_W]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNY /2)*( parH[level+1]->gridNZ /2); - parH[level]->K_FC += ((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNZ-6)/2); - } - if (parH[level]->need_interface[INTERFACE_N]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNX /2)*( parH[level+1]->gridNZ /2); - parH[level]->K_FC += ((parH[level+1]->gridNX-6)/2)*((parH[level+1]->gridNZ-6)/2); - } - if (parH[level]->need_interface[INTERFACE_S]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNX /2)*( parH[level+1]->gridNZ /2); - parH[level]->K_FC += ((parH[level+1]->gridNX-6)/2)*((parH[level+1]->gridNZ-6)/2); - } - if (parH[level]->need_interface[INTERFACE_T]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNY /2)*( parH[level+1]->gridNX /2); - parH[level]->K_FC += ((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNX-6)/2); - } - if (parH[level]->need_interface[INTERFACE_B]==true) - { - parH[level]->K_CF += ( parH[level+1]->gridNY /2)*( parH[level+1]->gridNX /2); - parH[level]->K_FC += ((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNX-6)/2); - } - //parH[level]->K_CF = (( parH[level+1]->gridNY /2)*( parH[level+1]->gridNZ /2)*2)+ - // (( parH[level+1]->gridNX /2)*( parH[level+1]->gridNZ /2)*2)+ - // (( parH[level+1]->gridNY /2)*( parH[level+1]->gridNX /2)*2); - //parH[level]->K_FC = (((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNZ-6)/2)*2)+ - // (((parH[level+1]->gridNX-6)/2)*((parH[level+1]->gridNZ-6)/2)*2)+ - // (((parH[level+1]->gridNY-6)/2)*((parH[level+1]->gridNX-6)/2)*2); - parH[level]->mem_size_kCF = sizeof(unsigned int)*parH[level]->K_CF; - parH[level]->mem_size_kFC = sizeof(unsigned int)*parH[level]->K_FC; - parH[level]->mem_size_kCF_off = sizeof(real)*parH[level]->K_CF; - parH[level]->mem_size_kFC_off = sizeof(real)*parH[level]->K_FC; - /////////////////////////////////////////////////////////////////////////////////////////////////// - //device - parD[level]->K_CF = parH[level]->K_CF; - parD[level]->K_FC = parH[level]->K_FC; - parD[level]->mem_size_kCF = parH[level]->mem_size_kCF; - parD[level]->mem_size_kFC = parH[level]->mem_size_kFC; - parD[level]->mem_size_kCF_off = parH[level]->mem_size_kCF_off; - parD[level]->mem_size_kFC_off = parH[level]->mem_size_kFC_off; - /////////////////////////////////////////////////////////////////////////////////////////////////// -} real Parameter::TrafoXtoWorld(int CoordX, int level) { return (parH[level]->mTtoWx*CoordX+parH[level]->cTtoWx); diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index 37dc7e9644a14f7992e35964a5ac6f593740cee1..565b0ab984671e72414699eb5298f913bc062579 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -1,855 +1,854 @@ -// _ ___ __ __________ _ __ ______________ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ / ___/ __ / / / / -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ / /___/ /_/ / / / / -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) / /_) / ____/ /__/ / -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ \____/_/ \_____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // -////////////////////////////////////////////////////////////////////////// -#ifndef PARAMETER_H -#define PARAMETER_H +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Parameter.h +//! \ingroup Parameter +//! \author Martin Schoenherr +//======================================================================================= +#ifndef GPU_PARAMETER_H +#define GPU_PARAMETER_H #include <vector> +#include <string> +#include <memory> #include <functional> -#include "LBM/LB.h" + #include "LBM/D3Q27.h" -#include "Calculation/PorousMedia.h" +#include "LBM/LB.h" #include "Visitor/Visitor.h" -//#include "Output/LogWriter.hpp" - -#include <cuda_runtime.h> -#include <helper_cuda.h> -//random numbers -#include <curand.h> -#include <curand_kernel.h> -#include "PointerDefinitions.h" #include "VirtualFluids_GPU_export.h" -class ConfigData; +struct curandStateXORWOW; +typedef struct curandStateXORWOW curandState; namespace vf { -namespace gpu +namespace basics { -class Communicator; +class ConfigurationFile; } } -//struct -struct ParameterStruct{ - bool evenOrOdd; - unsigned int numberofthreads; - - //distributions/////////// - //Distributions19 d0; - Distributions27 d0; - Distributions27 d0SP; - - //distributions F3//////// - Distributions6 g6; - - //thermo////////////////// - Distributions7 d7; - Distributions27 d27; - real *Conc, *Conc_Full; - real diffusivity; - //BC NoSlip - TempforBoundaryConditions Temp; - //BC Velocity - TempVelforBoundaryConditions TempVel; - //BC Pressure - TempPressforBoundaryConditions TempPress; - //Plane Conc - real *ConcPlaneIn, *ConcPlaneOut1, *ConcPlaneOut2; - std::vector<double> PlaneConcVectorIn, PlaneConcVectorOut1, PlaneConcVectorOut2; - - //trafo/////////////////// - real mTtoWx, mTtoWy, mTtoWz; - real cTtoWx, cTtoWy, cTtoWz; - - //MGstrafo//////////////// - real cStartx, cStarty, cStartz; - real cFx, cFy, cFz; - - //geo///////////////////// - int *geo; - unsigned int *geoSP; - - //k/////////////////////// - unsigned int *k; - - //neighbor//////////////// - //unsigned int *neighborX, *neighborY, *neighborZ; - unsigned int *neighborX_SP, *neighborY_SP, *neighborZ_SP, *neighborWSB_SP; - - //coordinates//////////// - //unsigned int *coordX_SP, *coordY_SP, *coordZ_SP; - real *coordX_SP, *coordY_SP, *coordZ_SP; - - //body forces//////////// - real *forceX_SP, *forceY_SP, *forceZ_SP; - - //vel parab/////////////// - real *vParab; - - // turbulent viscosity /// - real *turbViscosity; - real *gSij, *gSDij, *gDxvx, *gDyvx, *gDzvx, *gDxvy, *gDyvy, *gDzvy, *gDxvz, *gDyvz, *gDzvz; //DebugInformation - - //macroscopic values////// - real *vx, *vy, *vz, *rho; - real *vx_SP, *vy_SP, *vz_SP, *rho_SP, *press_SP; - real vis, omega; - - //derivations for iso test - real *dxxUx, *dyyUy, *dzzUz; - - //median-macro-values///// - real *vx_SP_Med, *vy_SP_Med, *vz_SP_Med, *rho_SP_Med, *press_SP_Med; - real *vx_SP_Med_Out, *vy_SP_Med_Out, *vz_SP_Med_Out, *rho_SP_Med_Out, *press_SP_Med_Out; - //Advection-Diffusion - real *Conc_Med, *Conc_Med_Out; - - //grid//////////////////// - unsigned int nx, ny, nz; - unsigned int gridNX, gridNY, gridNZ; - - //size of matrix////////// - unsigned int size_Mat; - unsigned int sizePlaneXY, sizePlaneYZ, sizePlaneXZ; - - //size of sparse matrix////////// - unsigned int size_Mat_SP; - unsigned int size_Array_SP; - - //size of Plane btw. 2 GPUs////// - unsigned int sizePlaneSB, sizePlaneRB, startB, endB; - unsigned int sizePlaneST, sizePlaneRT, startT, endT; - bool isSetSendB, isSetRecvB, isSetSendT, isSetRecvT; - int *SendT, *SendB, *RecvT, *RecvB; - - //size of Plane for PressMess - unsigned int sizePlanePress, startP; - unsigned int sizePlanePressIN, startPIN; - unsigned int sizePlanePressOUT, startPOUT; - bool isSetPress; - - //memsizeSP///////////////// - unsigned int mem_size_real_SP; - unsigned int mem_size_int_SP; - - //memsize///////////////// - unsigned int mem_size_real; - unsigned int mem_size_int; - unsigned int mem_size_bool; - unsigned int mem_size_real_yz; - - //print/////////////////// - unsigned int startz, endz; - real Lx,Ly,Lz,dx; - real distX, distY, distZ; - - //interface//////////////// - bool need_interface[6]; - unsigned int XdistKn, YdistKn, ZdistKn; - InterpolationCellCF intCF; - InterpolationCellFC intFC; - unsigned int K_CF; - unsigned int K_FC; - unsigned int mem_size_kCF; - unsigned int mem_size_kFC; - - //offset////////////////// - OffsetCF offCF; - OffsetFC offFC; - unsigned int mem_size_kCF_off; - unsigned int mem_size_kFC_off; - - //BC's//////////////////// - QforBoundaryConditions QWall, Qinflow, Qoutflow, QSlip; - unsigned int kQ=0, kInflowQ=0, kOutflowQ=0, kSlipQ=0; - unsigned int kQread, kInflowQread, kOutflowQread, kSlipQread; - - QforBoundaryConditions QpressX0,QpressX1,QpressY0,QpressY1,QpressZ0,QpressZ1; - QforBoundaryConditions QPropeller; - QforBoundaryConditions QPress; - QforBoundaryConditions QGeom; - QforBoundaryConditions QGeomNormalX, QGeomNormalY, QGeomNormalZ; - QforBoundaryConditions QInflowNormalX, QInflowNormalY, QInflowNormalZ; - QforBoundaryConditions QOutflowNormalX, QOutflowNormalY, QOutflowNormalZ; - QforBoundaryConditions QInlet, QOutlet, QPeriodic; - unsigned int kInletQread, kOutletQread; - unsigned int kPressQ=0, kPressQread; - //testRoundoffError - Distributions27 kDistTestRE; - - ////////////////////////////////////////////////////////////////////////// - //velocities to fit the force - real *VxForce, *VyForce, *VzForce; - ////////////////////////////////////////////////////////////////////////// - real *forcing; - - //Measure Points///////// - std::vector<MeasurePoints> MP; - unsigned int* kMP; - real* VxMP; - real* VyMP; - real* VzMP; - real* RhoMP; - unsigned int memSizerealkMP, memSizeIntkMP, numberOfPointskMP; - unsigned int numberOfValuesMP; - - //Drag Lift////////////// - double *DragPreX, *DragPostX; - double *DragPreY, *DragPostY; - double *DragPreZ, *DragPostZ; - std::vector<double> DragXvector; - std::vector<double> DragYvector; - std::vector<double> DragZvector; - - //2ndMoments//////////// - real *kxyFromfcNEQ, *kyzFromfcNEQ, *kxzFromfcNEQ, *kxxMyyFromfcNEQ, *kxxMzzFromfcNEQ; - - //3rdMoments//////////// - real *CUMbbb, *CUMabc, *CUMbac, *CUMbca, *CUMcba, *CUMacb, *CUMcab; - - //HigherMoments///////// - real *CUMcbb, *CUMbcb, *CUMbbc, *CUMcca, *CUMcac, *CUMacc, *CUMbcc, *CUMcbc, *CUMccb, *CUMccc; - - //CpTop///////////////// - int *cpTopIndex; - double *cpPressTop; - unsigned int numberOfPointsCpTop; - std::vector< std::vector< double > > cpTop; - std::vector< double > pressMirror; - std::vector< bool > isOutsideInterface; - unsigned int numberOfPointsPressWindow; - - - //CpBottom///////////// - int *cpBottomIndex; - double *cpPressBottom; - unsigned int numberOfPointsCpBottom; - std::vector< std::vector< double > > cpBottom; - - //CpBottom2//////////// - int *cpBottom2Index; - double *cpPressBottom2; - unsigned int numberOfPointsCpBottom2; - std::vector< std::vector< double > > cpBottom2; - - //Concentration//////// - int *concIndex; - real *concentration; - unsigned int numberOfPointsConc; - - //street X and Y velocity fractions/////// - real *streetFractionXvelocity; - real *streetFractionYvelocity; - int *naschVelocity; - uint numberOfStreetNodes; - - //deltaPhi - real deltaPhi; - - //////////////////////////////////////////////////////////////////////////// - //particles - PathLineParticles plp; - //////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////// - //1D domain decomposition - std::vector< ProcessNeighbor27 > sendProcessNeighbor; - std::vector< ProcessNeighbor27 > recvProcessNeighbor; - /////////////////////////////////////////////////////// - //3D domain decomposition - std::vector< ProcessNeighbor27 > sendProcessNeighborX; - std::vector< ProcessNeighbor27 > sendProcessNeighborY; - std::vector< ProcessNeighbor27 > sendProcessNeighborZ; - std::vector< ProcessNeighbor27 > recvProcessNeighborX; - std::vector< ProcessNeighbor27 > recvProcessNeighborY; - std::vector< ProcessNeighbor27 > recvProcessNeighborZ; - /////////////////////////////////////////////////////// - //3D domain decomposition convection diffusion - std::vector< ProcessNeighbor27 > sendProcessNeighborADX; - std::vector< ProcessNeighbor27 > sendProcessNeighborADY; - std::vector< ProcessNeighbor27 > sendProcessNeighborADZ; - std::vector< ProcessNeighbor27 > recvProcessNeighborADX; - std::vector< ProcessNeighbor27 > recvProcessNeighborADY; - std::vector< ProcessNeighbor27 > recvProcessNeighborADZ; - /////////////////////////////////////////////////////// - //3D domain decomposition F3 - std::vector< ProcessNeighborF3 > sendProcessNeighborF3X; - std::vector< ProcessNeighborF3 > sendProcessNeighborF3Y; - std::vector< ProcessNeighborF3 > sendProcessNeighborF3Z; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3X; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3Y; - std::vector< ProcessNeighborF3 > recvProcessNeighborF3Z; - //////////////////////////////////////////////////////////////////////////// +//! \struct LBMSimulationParameter +//! \brief struct holds and manages the LB-parameter of the simulation +//! \brief For this purpose it holds structures and pointer for host and device data, respectively. +struct LBMSimulationParameter +{ + bool evenOrOdd; + unsigned int numberofthreads; + + // distributions/////////// + // Distributions19 d0; + Distributions27 d0; + Distributions27 d0SP; + + // distributions F3//////// + Distributions6 g6; + + // thermo////////////////// + Distributions7 d7; + Distributions27 d27; + real *Conc, *Conc_Full; + real diffusivity; + // BC NoSlip + TempforBoundaryConditions Temp; + // BC Velocity + TempVelforBoundaryConditions TempVel; + // BC Pressure + TempPressforBoundaryConditions TempPress; + // Plane Conc + real *ConcPlaneIn, *ConcPlaneOut1, *ConcPlaneOut2; + std::vector<double> PlaneConcVectorIn, PlaneConcVectorOut1, PlaneConcVectorOut2; + + // trafo/////////////////// + real mTtoWx, mTtoWy, mTtoWz; + real cTtoWx, cTtoWy, cTtoWz; + + // MGstrafo//////////////// + real cStartx, cStarty, cStartz; + real cFx, cFy, cFz; + + // geo///////////////////// + int *geo; + unsigned int *geoSP; + + // k/////////////////////// + unsigned int *k; + + // neighbor//////////////// + // unsigned int *neighborX, *neighborY, *neighborZ; + unsigned int *neighborX_SP, *neighborY_SP, *neighborZ_SP, *neighborWSB_SP; + + // coordinates//////////// + // unsigned int *coordX_SP, *coordY_SP, *coordZ_SP; + real *coordX_SP, *coordY_SP, *coordZ_SP; + + // body forces//////////// + real *forceX_SP, *forceY_SP, *forceZ_SP; + + // vel parab/////////////// + real *vParab; + + // turbulent viscosity /// + real *turbViscosity; + real *gSij, *gSDij, *gDxvx, *gDyvx, *gDzvx, *gDxvy, *gDyvy, *gDzvy, *gDxvz, *gDyvz, *gDzvz; // DebugInformation + + // macroscopic values////// + real *vx, *vy, *vz, *rho; + real *vx_SP, *vy_SP, *vz_SP, *rho_SP, *press_SP; + real vis, omega; + + // derivations for iso test + real *dxxUx, *dyyUy, *dzzUz; + + // median-macro-values///// + real *vx_SP_Med, *vy_SP_Med, *vz_SP_Med, *rho_SP_Med, *press_SP_Med; + real *vx_SP_Med_Out, *vy_SP_Med_Out, *vz_SP_Med_Out, *rho_SP_Med_Out, *press_SP_Med_Out; + // Advection-Diffusion + real *Conc_Med, *Conc_Med_Out; + + // grid//////////////////// + unsigned int nx, ny, nz; + unsigned int gridNX, gridNY, gridNZ; + + // size of matrix////////// + unsigned int size_Mat; + unsigned int sizePlaneXY, sizePlaneYZ, sizePlaneXZ; + + // size of sparse matrix////////// + unsigned int size_Mat_SP; + unsigned int size_Array_SP; + + // size of Plane btw. 2 GPUs////// + unsigned int sizePlaneSB, sizePlaneRB, startB, endB; + unsigned int sizePlaneST, sizePlaneRT, startT, endT; + bool isSetSendB, isSetRecvB, isSetSendT, isSetRecvT; + int *SendT, *SendB, *RecvT, *RecvB; + + // size of Plane for PressMess + unsigned int sizePlanePress, startP; + unsigned int sizePlanePressIN, startPIN; + unsigned int sizePlanePressOUT, startPOUT; + bool isSetPress; + + // memsizeSP///////////////// + unsigned int mem_size_real_SP; + unsigned int mem_size_int_SP; + + // memsize///////////////// + unsigned int mem_size_real; + unsigned int mem_size_int; + unsigned int mem_size_bool; + unsigned int mem_size_real_yz; + + // print/////////////////// + unsigned int startz, endz; + real Lx, Ly, Lz, dx; + real distX, distY, distZ; + + // interface//////////////// + bool need_interface[6]; + unsigned int XdistKn, YdistKn, ZdistKn; + InterpolationCellCF intCF; + InterpolationCellFC intFC; + unsigned int K_CF; + unsigned int K_FC; + unsigned int mem_size_kCF; + unsigned int mem_size_kFC; + + // offset////////////////// + OffsetCF offCF; + OffsetFC offFC; + unsigned int mem_size_kCF_off; + unsigned int mem_size_kFC_off; + + // BC's//////////////////// + QforBoundaryConditions QWall, Qinflow, Qoutflow, QSlip; + unsigned int kQ = 0, kInflowQ = 0, kOutflowQ = 0, kSlipQ = 0; + unsigned int kQread, kInflowQread, kOutflowQread, kSlipQread; + + QforBoundaryConditions QpressX0, QpressX1, QpressY0, QpressY1, QpressZ0, QpressZ1; + QforBoundaryConditions QPropeller; + QforBoundaryConditions QPress; + QforBoundaryConditions QGeom; + QforBoundaryConditions QGeomNormalX, QGeomNormalY, QGeomNormalZ; + QforBoundaryConditions QInflowNormalX, QInflowNormalY, QInflowNormalZ; + QforBoundaryConditions QOutflowNormalX, QOutflowNormalY, QOutflowNormalZ; + QforBoundaryConditions QInlet, QOutlet, QPeriodic; + unsigned int kInletQread, kOutletQread; + unsigned int kPressQ = 0, kPressQread; + // testRoundoffError + Distributions27 kDistTestRE; + + ////////////////////////////////////////////////////////////////////////// + // velocities to fit the force + real *VxForce, *VyForce, *VzForce; + ////////////////////////////////////////////////////////////////////////// + real *forcing; + + // Measure Points///////// + std::vector<MeasurePoints> MP; + unsigned int *kMP; + real *VxMP; + real *VyMP; + real *VzMP; + real *RhoMP; + unsigned int memSizerealkMP, memSizeIntkMP, numberOfPointskMP; + unsigned int numberOfValuesMP; + + // Drag Lift////////////// + double *DragPreX, *DragPostX; + double *DragPreY, *DragPostY; + double *DragPreZ, *DragPostZ; + std::vector<double> DragXvector; + std::vector<double> DragYvector; + std::vector<double> DragZvector; + + // 2ndMoments//////////// + real *kxyFromfcNEQ, *kyzFromfcNEQ, *kxzFromfcNEQ, *kxxMyyFromfcNEQ, *kxxMzzFromfcNEQ; + + // 3rdMoments//////////// + real *CUMbbb, *CUMabc, *CUMbac, *CUMbca, *CUMcba, *CUMacb, *CUMcab; + + // HigherMoments///////// + real *CUMcbb, *CUMbcb, *CUMbbc, *CUMcca, *CUMcac, *CUMacc, *CUMbcc, *CUMcbc, *CUMccb, *CUMccc; + + // CpTop///////////////// + int *cpTopIndex; + double *cpPressTop; + unsigned int numberOfPointsCpTop; + std::vector<std::vector<double>> cpTop; + std::vector<double> pressMirror; + std::vector<bool> isOutsideInterface; + unsigned int numberOfPointsPressWindow; + + // CpBottom///////////// + int *cpBottomIndex; + double *cpPressBottom; + unsigned int numberOfPointsCpBottom; + std::vector<std::vector<double>> cpBottom; + + // CpBottom2//////////// + int *cpBottom2Index; + double *cpPressBottom2; + unsigned int numberOfPointsCpBottom2; + std::vector<std::vector<double>> cpBottom2; + + // Concentration//////// + int *concIndex; + real *concentration; + unsigned int numberOfPointsConc; + + // street X and Y velocity fractions/////// + real *streetFractionXvelocity; + real *streetFractionYvelocity; + int *naschVelocity; + uint numberOfStreetNodes; + + // deltaPhi + real deltaPhi; + + //////////////////////////////////////////////////////////////////////////// + // particles + PathLineParticles plp; + //////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // 1D domain decomposition + std::vector<ProcessNeighbor27> sendProcessNeighbor; + std::vector<ProcessNeighbor27> recvProcessNeighbor; + /////////////////////////////////////////////////////// + // 3D domain decomposition + std::vector<ProcessNeighbor27> sendProcessNeighborX; + std::vector<ProcessNeighbor27> sendProcessNeighborY; + std::vector<ProcessNeighbor27> sendProcessNeighborZ; + std::vector<ProcessNeighbor27> recvProcessNeighborX; + std::vector<ProcessNeighbor27> recvProcessNeighborY; + std::vector<ProcessNeighbor27> recvProcessNeighborZ; + /////////////////////////////////////////////////////// + // 3D domain decomposition convection diffusion + std::vector<ProcessNeighbor27> sendProcessNeighborADX; + std::vector<ProcessNeighbor27> sendProcessNeighborADY; + std::vector<ProcessNeighbor27> sendProcessNeighborADZ; + std::vector<ProcessNeighbor27> recvProcessNeighborADX; + std::vector<ProcessNeighbor27> recvProcessNeighborADY; + std::vector<ProcessNeighbor27> recvProcessNeighborADZ; + /////////////////////////////////////////////////////// + // 3D domain decomposition F3 + std::vector<ProcessNeighborF3> sendProcessNeighborF3X; + std::vector<ProcessNeighborF3> sendProcessNeighborF3Y; + std::vector<ProcessNeighborF3> sendProcessNeighborF3Z; + std::vector<ProcessNeighborF3> recvProcessNeighborF3X; + std::vector<ProcessNeighborF3> recvProcessNeighborF3Y; + std::vector<ProcessNeighborF3> recvProcessNeighborF3Z; + //////////////////////////////////////////////////////////////////////////// }; class VIRTUALFLUIDS_GPU_EXPORT Parameter { public: - //////////////////////////////////////////////////////////////////////////// - ////really ugly...should be in private... - //Parameter(); - //////////////////////////////////////////////////////////////////////////// - static SPtr<Parameter> make(); - static SPtr<Parameter> make(SPtr<ConfigData> configData, vf::gpu::Communicator* comm); - - - static Parameter* getInstanz(); - ParameterStruct* getParH(int level); - ParameterStruct* getParD(int level); - void initParameter(); - void fillSparse(int level); - - //measure points - void copyMeasurePointsArrayToVector(int lev); - - ////////////////////////////////////////////////////////////////////////// - //setter - void setForcing(real forcingX, real forcingY, real forcingZ); - void setQuadricLimiters(real quadricLimiterP, real quadricLimiterM, real quadricLimiterD); - void setPhi(real inPhi); - void setAngularVelocity(real inAngVel); - void setStepEnsight(unsigned int step); - void setOutputCount(unsigned int outputCount); - void setlimitOfNodesForVTK(unsigned int limitOfNodesForVTK); - void setStartTurn(unsigned int inStartTurn); - void setSizeMatSparse(int level); - void setDiffOn(bool isDiff); - void setCompOn(bool isComp); - void setDiffMod(int DiffMod); - void setDiffusivity(real Diffusivity); - void setD3Qxx(int d3qxx); - void setMaxLevel(int maxlevel); - void setParticleBasicLevel(int pbl); - void setParticleInitLevel(int pil); - void setNumberOfParticles(int nop); - void setCalcParticles(bool calcParticles); - void setStartXHotWall(real startXHotWall); - void setEndXHotWall(real endXHotWall); - void setTEnd(unsigned int tend); - void setTOut(unsigned int tout); - void setTStartOut(unsigned int tStartOut); - void setTimestepOfCoarseLevel(unsigned int timestep); - void setCalcMedian(bool calcMedian); - void setCalcDragLift(bool calcDragLift); - void setCalcCp(bool calcCp); - void setWriteVeloASCIIfiles(bool writeVeloASCII); - void setCalcPlaneConc(bool calcPlaneConc); - void setTimeCalcMedStart(int CalcMedStart); - void setTimeCalcMedEnd(int CalcMedEnd); - void setMaxDev(int maxdev); - void setMyID(int myid); - void setNumprocs(int numprocs); - void setPressInID(unsigned int PressInID); - void setPressOutID(unsigned int PressOutID); - void setPressInZ(unsigned int PressInZ); - void setPressOutZ(unsigned int PressOutZ); - void settimestepForMP(unsigned int timestepForMP); - void setOutputPath(std::string oPath); - void setOutputPrefix(std::string oPrefix); - void setFName(std::string fname); - void setGeometryFileC(std::string GeometryFileC); - void setGeometryFileM(std::string GeometryFileM); - void setGeometryFileF(std::string GeometryFileF); - void setkFull(std::string kFull); - void setgeoFull(std::string geoFull); - void setgeoVec(std::string geoVec); - void setcoordX(std::string coordX); - void setcoordY(std::string coordY); - void setcoordZ(std::string coordZ); - void setneighborX(std::string neighborX); - void setneighborY(std::string neighborY); - void setneighborZ(std::string neighborZ); - void setneighborWSB(std::string neighborWSB); - void setscaleCFC(std::string scaleCFC); - void setscaleCFF(std::string scaleCFF); - void setscaleFCC(std::string scaleFCC); - void setscaleFCF(std::string scaleFCF); - void setscaleOffsetCF(std::string scaleOffsetCF); - void setscaleOffsetFC(std::string scaleOffsetFC); - void setgeomBoundaryBcQs(std::string geomBoundaryBcQs); - void setgeomBoundaryBcValues(std::string geomBoundaryBcValues); - void setnoSlipBcPos(std::string noSlipBcPos); - void setnoSlipBcQs(std::string noSlipBcQs); - void setnoSlipBcValue(std::string noSlipBcValue); - void setnoSlipBcValues(std::string noSlipBcValues); - void setslipBcPos(std::string slipBcPos); - void setslipBcQs(std::string slipBcQs); - void setslipBcValue(std::string slipBcValue); - void setpressBcPos(std::string pressBcPos); - void setpressBcQs(std::string pressBcQs); - void setpressBcValue(std::string pressBcValue); - void setpressBcValues(std::string pressBcValues); - void setvelBcQs(std::string velBcQs); - void setvelBcValues(std::string velBcValues); - void setinletBcQs(std::string inletBcQs); - void setinletBcValues(std::string inletBcValues); - void setoutletBcQs(std::string outletBcQs); - void setoutletBcValues(std::string outletBcValues); - void settopBcQs(std::string topBcQs); - void settopBcValues(std::string topBcValues); - void setbottomBcQs(std::string bottomBcQs); - void setbottomBcValues(std::string bottomBcValues); - void setfrontBcQs(std::string frontBcQs); - void setfrontBcValues(std::string frontBcValues); - void setbackBcQs(std::string backBcQs); - void setbackBcValues(std::string backBcValues); - void setwallBcQs(std::string wallBcQs); - void setwallBcValues(std::string wallBcValues); - void setperiodicBcQs(std::string periodicBcQs); - void setperiodicBcValues(std::string periodicBcValues); - void setpropellerCylinder(std::string propellerCylinder); - void setpropellerValues(std::string propellerValues); - void setpropellerQs(std::string propellerQs); - void setmeasurePoints(std::string measurePoints); - void setnumberNodes(std::string numberNodes); - void setLBMvsSI(std::string LBMvsSI); - void setcpTop(std::string cpTop); - void setcpBottom(std::string cpBottom); - void setcpBottom2(std::string cpBottom2); - void setConcentration(std::string concFile); - void setStreetVelocity(std::string streetVelocity); - void setPrintFiles(bool printfiles); - void setReadGeo(bool readGeo); - void setTemperatureInit(real Temp); - void setTemperatureBC(real TempBC); - void setViscosity(real Viscosity); - void setVelocity(real Velocity); - void setViscosityRatio(real ViscosityRatio); - void setVelocityRatio(real VelocityRatio); - void setDensityRatio(real DensityRatio); - void setPressRatio(real PressRatio); - void setTimeRatio(real TimeRatio); - void setLengthRatio(real LengthRatio); - void setForceRatio(real ForceRatio); - void setRealX(real RealX); - void setRealY(real RealY); - void setRe(real Re); - void setFactorPressBC(real factorPressBC); - void setIsGeo(bool isGeo); - void setIsGeoNormal(bool isGeoNormal); - void setIsInflowNormal(bool isInflowNormal); - void setIsOutflowNormal(bool isOutflowNormal); - void setIsProp(bool isProp); - void setIsCp(bool isCp); - void setConcFile(bool concFile); - void setStreetVelocityFile(bool streetVelocityFile); - void setUseMeasurePoints(bool useMeasurePoints); - void setUseWale(bool useWale); - void setUseInitNeq(bool useInitNeq); - void setSimulatePorousMedia(bool simulatePorousMedia); - void setIsF3(bool isF3); + Parameter(const vf::basics::ConfigurationFile &configData, int numberOfProcesses, int myId); + void initLBMSimulationParameter(); + + std::shared_ptr<LBMSimulationParameter> getParH(int level); + std::shared_ptr<LBMSimulationParameter> getParD(int level); + + void copyMeasurePointsArrayToVector(int lev); + + ////////////////////////////////////////////////////////////////////////// + // setter + void setForcing(real forcingX, real forcingY, real forcingZ); + void setQuadricLimiters(real quadricLimiterP, real quadricLimiterM, real quadricLimiterD); + void setPhi(real inPhi); + void setAngularVelocity(real inAngVel); + void setStepEnsight(unsigned int step); + void setOutputCount(unsigned int outputCount); + void setlimitOfNodesForVTK(unsigned int limitOfNodesForVTK); + void setStartTurn(unsigned int inStartTurn); + void setDiffOn(bool isDiff); + void setCompOn(bool isComp); + void setDiffMod(int DiffMod); + void setDiffusivity(real Diffusivity); + void setD3Qxx(int d3qxx); + void setMaxLevel(int maxlevel); + void setParticleBasicLevel(int pbl); + void setParticleInitLevel(int pil); + void setNumberOfParticles(int nop); + void setCalcParticles(bool calcParticles); + void setStartXHotWall(real startXHotWall); + void setEndXHotWall(real endXHotWall); + void setTEnd(unsigned int tend); + void setTOut(unsigned int tout); + void setTStartOut(unsigned int tStartOut); + void setTimestepOfCoarseLevel(unsigned int timestep); + void setCalcMedian(bool calcMedian); + void setCalcDragLift(bool calcDragLift); + void setCalcCp(bool calcCp); + void setWriteVeloASCIIfiles(bool writeVeloASCII); + void setCalcPlaneConc(bool calcPlaneConc); + void setTimeCalcMedStart(int CalcMedStart); + void setTimeCalcMedEnd(int CalcMedEnd); + void setMaxDev(int maxdev); + void setMyID(int myid); + void setNumprocs(int numprocs); + void setPressInID(unsigned int PressInID); + void setPressOutID(unsigned int PressOutID); + void setPressInZ(unsigned int PressInZ); + void setPressOutZ(unsigned int PressOutZ); + void settimestepForMP(unsigned int timestepForMP); + void setOutputPath(std::string oPath); + void setOutputPrefix(std::string oPrefix); + void setFName(std::string fname); + void setGeometryFileC(std::string GeometryFileC); + void setGeometryFileM(std::string GeometryFileM); + void setGeometryFileF(std::string GeometryFileF); + void setkFull(std::string kFull); + void setgeoFull(std::string geoFull); + void setgeoVec(std::string geoVec); + void setcoordX(std::string coordX); + void setcoordY(std::string coordY); + void setcoordZ(std::string coordZ); + void setneighborX(std::string neighborX); + void setneighborY(std::string neighborY); + void setneighborZ(std::string neighborZ); + void setneighborWSB(std::string neighborWSB); + void setscaleCFC(std::string scaleCFC); + void setscaleCFF(std::string scaleCFF); + void setscaleFCC(std::string scaleFCC); + void setscaleFCF(std::string scaleFCF); + void setscaleOffsetCF(std::string scaleOffsetCF); + void setscaleOffsetFC(std::string scaleOffsetFC); + void setgeomBoundaryBcQs(std::string geomBoundaryBcQs); + void setgeomBoundaryBcValues(std::string geomBoundaryBcValues); + void setnoSlipBcPos(std::string noSlipBcPos); + void setnoSlipBcQs(std::string noSlipBcQs); + void setnoSlipBcValue(std::string noSlipBcValue); + void setnoSlipBcValues(std::string noSlipBcValues); + void setslipBcPos(std::string slipBcPos); + void setslipBcQs(std::string slipBcQs); + void setslipBcValue(std::string slipBcValue); + void setpressBcPos(std::string pressBcPos); + void setpressBcQs(std::string pressBcQs); + void setpressBcValue(std::string pressBcValue); + void setpressBcValues(std::string pressBcValues); + void setvelBcQs(std::string velBcQs); + void setvelBcValues(std::string velBcValues); + void setinletBcQs(std::string inletBcQs); + void setinletBcValues(std::string inletBcValues); + void setoutletBcQs(std::string outletBcQs); + void setoutletBcValues(std::string outletBcValues); + void settopBcQs(std::string topBcQs); + void settopBcValues(std::string topBcValues); + void setbottomBcQs(std::string bottomBcQs); + void setbottomBcValues(std::string bottomBcValues); + void setfrontBcQs(std::string frontBcQs); + void setfrontBcValues(std::string frontBcValues); + void setbackBcQs(std::string backBcQs); + void setbackBcValues(std::string backBcValues); + void setwallBcQs(std::string wallBcQs); + void setwallBcValues(std::string wallBcValues); + void setperiodicBcQs(std::string periodicBcQs); + void setperiodicBcValues(std::string periodicBcValues); + void setpropellerCylinder(std::string propellerCylinder); + void setpropellerValues(std::string propellerValues); + void setpropellerQs(std::string propellerQs); + void setmeasurePoints(std::string measurePoints); + void setnumberNodes(std::string numberNodes); + void setLBMvsSI(std::string LBMvsSI); + void setcpTop(std::string cpTop); + void setcpBottom(std::string cpBottom); + void setcpBottom2(std::string cpBottom2); + void setConcentration(std::string concFile); + void setStreetVelocity(std::string streetVelocity); + void setPrintFiles(bool printfiles); + void setReadGeo(bool readGeo); + void setTemperatureInit(real Temp); + void setTemperatureBC(real TempBC); + void setViscosity(real Viscosity); + void setVelocity(real Velocity); + void setViscosityRatio(real ViscosityRatio); + void setVelocityRatio(real VelocityRatio); + void setDensityRatio(real DensityRatio); + void setPressRatio(real PressRatio); + void setRealX(real RealX); + void setRealY(real RealY); + void setRe(real Re); + void setFactorPressBC(real factorPressBC); + void setIsGeo(bool isGeo); + void setIsGeoNormal(bool isGeoNormal); + void setIsInflowNormal(bool isInflowNormal); + void setIsOutflowNormal(bool isOutflowNormal); + void setIsProp(bool isProp); + void setIsCp(bool isCp); + void setConcFile(bool concFile); + void setStreetVelocityFile(bool streetVelocityFile); + void setUseMeasurePoints(bool useMeasurePoints); + void setUseWale(bool useWale); + void setUseInitNeq(bool useInitNeq); + void setSimulatePorousMedia(bool simulatePorousMedia); + void setIsF3(bool isF3); void setIsBodyForce(bool isBodyForce); - void setclockCycleForMP(real clockCycleForMP); - void setDevices(std::vector<uint> devices); - void setGridX(std::vector<int> GridX); - void setGridY(std::vector<int> GridY); - void setGridZ(std::vector<int> GridZ); - void setDistX(std::vector<int> DistX); - void setDistY(std::vector<int> DistY); - void setDistZ(std::vector<int> DistZ); - void setScaleLBMtoSI(std::vector<real> scaleLBMtoSI); - void setTranslateLBMtoSI(std::vector<real> translateLBMtoSI); - void setMinCoordX(std::vector<real> MinCoordX); - void setMinCoordY(std::vector<real> MinCoordY); - void setMinCoordZ(std::vector<real> MinCoordZ); - void setMaxCoordX(std::vector<real> MaxCoordX); - void setMaxCoordY(std::vector<real> MaxCoordY); - void setMaxCoordZ(std::vector<real> MaxCoordZ); - void setNeedInterface(std::vector<bool> NeedInterface); - void setTempH(TempforBoundaryConditions* TempH); - void setTempD(TempforBoundaryConditions* TempD); - void setTempVelH(TempVelforBoundaryConditions* TempVelH); - void setTempVelD(TempVelforBoundaryConditions* TempVelD); - void setTempPressH(TempPressforBoundaryConditions* TempPressH); - void setTempPressD(TempPressforBoundaryConditions* TempPressD); - void setTimeDoCheckPoint(unsigned int tDoCheckPoint); - void setTimeDoRestart(unsigned int tDoRestart); - void setDoCheckPoint(bool doCheckPoint); - void setDoRestart(bool doRestart); - void setObj(std::string str, bool isObj); - void setGeometryValues(bool GeometryValues); - void setCalc2ndOrderMoments(bool is2ndOrderMoments); - void setCalc3rdOrderMoments(bool is3rdOrderMoments); - void setCalcHighOrderMoments(bool isHighOrderMoments); - void setMemsizeGPU(double admem, bool reset); - //1D domain decomposition - void setPossNeighborFiles(std::vector<std::string> possNeighborFiles, std::string sor); - void setNumberOfProcessNeighbors(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setIsNeighbor(bool isNeighbor); - //3D domain decomposition - void setPossNeighborFilesX(std::vector<std::string> possNeighborFiles, std::string sor); - void setPossNeighborFilesY(std::vector<std::string> possNeighborFiles, std::string sor); - void setPossNeighborFilesZ(std::vector<std::string> possNeighborFiles, std::string sor); - void setNumberOfProcessNeighborsX(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setNumberOfProcessNeighborsY(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setNumberOfProcessNeighborsZ(unsigned int numberOfProcessNeighbors, int level, std::string sor); - void setIsNeighborX(bool isNeighbor); - void setIsNeighborY(bool isNeighbor); - void setIsNeighborZ(bool isNeighbor); - //void setkInflowQ(unsigned int kInflowQ); - //void setkOutflowQ(unsigned int kOutflowQ); - //void setQinflowH(QforBoundaryConditions* QinflowH); - //void setQinflowD(QforBoundaryConditions* QinflowD); - //void setQoutflowH(QforBoundaryConditions* QoutflowH); - //void setQoutflowD(QforBoundaryConditions* QoutflowD); - //Normals - void setgeomBoundaryNormalX(std::string geomNormalX); - void setgeomBoundaryNormalY(std::string geomNormalY); - void setgeomBoundaryNormalZ(std::string geomNormalZ); - void setInflowBoundaryNormalX(std::string inflowNormalX); - void setInflowBoundaryNormalY(std::string inflowNormalY); - void setInflowBoundaryNormalZ(std::string inflowNormalZ); - void setOutflowBoundaryNormalX(std::string outflowNormalX); - void setOutflowBoundaryNormalY(std::string outflowNormalY); - void setOutflowBoundaryNormalZ(std::string outflowNormalZ); - //Kernel + void setclockCycleForMP(real clockCycleForMP); + void setDevices(std::vector<uint> devices); + void setGridX(std::vector<int> GridX); + void setGridY(std::vector<int> GridY); + void setGridZ(std::vector<int> GridZ); + void setDistX(std::vector<int> DistX); + void setDistY(std::vector<int> DistY); + void setDistZ(std::vector<int> DistZ); + void setScaleLBMtoSI(std::vector<real> scaleLBMtoSI); + void setTranslateLBMtoSI(std::vector<real> translateLBMtoSI); + void setMinCoordX(std::vector<real> MinCoordX); + void setMinCoordY(std::vector<real> MinCoordY); + void setMinCoordZ(std::vector<real> MinCoordZ); + void setMaxCoordX(std::vector<real> MaxCoordX); + void setMaxCoordY(std::vector<real> MaxCoordY); + void setMaxCoordZ(std::vector<real> MaxCoordZ); + void setTempH(TempforBoundaryConditions *TempH); + void setTempD(TempforBoundaryConditions *TempD); + void setTempVelH(TempVelforBoundaryConditions *TempVelH); + void setTempVelD(TempVelforBoundaryConditions *TempVelD); + void setTempPressH(TempPressforBoundaryConditions *TempPressH); + void setTempPressD(TempPressforBoundaryConditions *TempPressD); + void setTimeDoCheckPoint(unsigned int tDoCheckPoint); + void setTimeDoRestart(unsigned int tDoRestart); + void setDoCheckPoint(bool doCheckPoint); + void setDoRestart(bool doRestart); + void setObj(std::string str, bool isObj); + void setGeometryValues(bool GeometryValues); + void setCalc2ndOrderMoments(bool is2ndOrderMoments); + void setCalc3rdOrderMoments(bool is3rdOrderMoments); + void setCalcHighOrderMoments(bool isHighOrderMoments); + void setMemsizeGPU(double admem, bool reset); + // 1D domain decomposition + void setPossNeighborFiles(std::vector<std::string> possNeighborFiles, std::string sor); + void setNumberOfProcessNeighbors(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setIsNeighbor(bool isNeighbor); + // 3D domain decomposition + void setPossNeighborFilesX(std::vector<std::string> possNeighborFiles, std::string sor); + void setPossNeighborFilesY(std::vector<std::string> possNeighborFiles, std::string sor); + void setPossNeighborFilesZ(std::vector<std::string> possNeighborFiles, std::string sor); + void setNumberOfProcessNeighborsX(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setNumberOfProcessNeighborsY(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setNumberOfProcessNeighborsZ(unsigned int numberOfProcessNeighbors, int level, std::string sor); + void setIsNeighborX(bool isNeighbor); + void setIsNeighborY(bool isNeighbor); + void setIsNeighborZ(bool isNeighbor); + // void setkInflowQ(unsigned int kInflowQ); + // void setkOutflowQ(unsigned int kOutflowQ); + // void setQinflowH(QforBoundaryConditions* QinflowH); + // void setQinflowD(QforBoundaryConditions* QinflowD); + // void setQoutflowH(QforBoundaryConditions* QoutflowH); + // void setQoutflowD(QforBoundaryConditions* QoutflowD); + // Normals + void setgeomBoundaryNormalX(std::string geomNormalX); + void setgeomBoundaryNormalY(std::string geomNormalY); + void setgeomBoundaryNormalZ(std::string geomNormalZ); + void setInflowBoundaryNormalX(std::string inflowNormalX); + void setInflowBoundaryNormalY(std::string inflowNormalY); + void setInflowBoundaryNormalZ(std::string inflowNormalZ); + void setOutflowBoundaryNormalX(std::string outflowNormalX); + void setOutflowBoundaryNormalY(std::string outflowNormalY); + void setOutflowBoundaryNormalZ(std::string outflowNormalZ); + // Kernel void setMainKernel(std::string kernel); - void setMultiKernelOn(bool isOn); - void setMultiKernelLevel(std::vector<int> kernelLevel); + void setMultiKernelOn(bool isOn); + void setMultiKernelLevel(std::vector<int> kernelLevel); void setMultiKernel(std::vector<std::string> kernel); - void setADKernel(std::string adKernel); - + void setADKernel(std::string adKernel); - //adder + //adder void addActuator(Visitor* actuator); void addProbe(Visitor* probes); - //getter - double* getForcesDouble(); - real* getForcesHost(); - real* getForcesDev(); - double* getQuadricLimitersDouble(); - real* getQuadricLimitersHost(); - real* getQuadricLimitersDev(); - real getPhi(); - real getAngularVelocity(); - real getStartXHotWall(); - real getEndXHotWall(); - unsigned int getStepEnsight(); - unsigned int getOutputCount(); - unsigned int getlimitOfNodesForVTK(); - unsigned int getStartTurn(); - bool getEvenOrOdd(int level); - bool getDiffOn(); - bool getCompOn(); - bool getPrintFiles(); - bool getReadGeo(); - bool getCalcMedian(); - bool getCalcDragLift(); - bool getCalcCp(); - bool getCalcParticle(); - bool getWriteVeloASCIIfiles(); - bool getCalcPlaneConc(); - int getFine(); - int getCoarse(); - int getParticleBasicLevel(); - int getParticleInitLevel(); - int getNumberOfParticles(); - int getDiffMod(); - int getFactorNZ(); - int getD3Qxx(); - int getMaxLevel(); - int getTimeCalcMedStart(); - int getTimeCalcMedEnd(); - int getMaxDev(); - int getMyID(); - int getNumprocs(); - std::string getOutputPath(); - std::string getOutputPrefix(); - std::string getFName(); - std::string getGeometryFileC(); - std::string getGeometryFileM(); - std::string getGeometryFileF(); - std::string getkFull(); - std::string getgeoFull(); - std::string getgeoVec(); - std::string getcoordX(); - std::string getcoordY(); - std::string getcoordZ(); - std::string getneighborX(); - std::string getneighborY(); - std::string getneighborZ(); - std::string getneighborWSB(); - std::string getscaleCFC(); - std::string getscaleCFF(); - std::string getscaleFCC(); - std::string getscaleFCF(); - std::string getscaleOffsetCF(); - std::string getscaleOffsetFC(); - std::string getgeomBoundaryBcQs(); - std::string getgeomBoundaryBcValues(); - std::string getnoSlipBcPos(); - std::string getnoSlipBcQs(); - std::string getnoSlipBcValue(); - std::string getnoSlipBcValues(); - std::string getslipBcPos(); - std::string getslipBcQs(); - std::string getslipBcValue(); - std::string getpressBcPos(); - std::string getpressBcQs(); - std::string getpressBcValue(); - std::string getpressBcValues(); - std::string getvelBcQs(); - std::string getvelBcValues(); - std::string getinletBcQs(); - std::string getinletBcValues(); - std::string getoutletBcQs(); - std::string getoutletBcValues(); - std::string gettopBcQs(); - std::string gettopBcValues(); - std::string getbottomBcQs(); - std::string getbottomBcValues(); - std::string getfrontBcQs(); - std::string getfrontBcValues(); - std::string getbackBcQs(); - std::string getbackBcValues(); - std::string getwallBcQs(); - std::string getwallBcValues(); - std::string getperiodicBcQs(); - std::string getperiodicBcValues(); - std::string getpropellerQs(); - std::string getpropellerCylinder(); - std::string getpropellerValues(); - std::string getmeasurePoints(); - std::string getnumberNodes(); - std::string getLBMvsSI(); - std::string getcpTop(); - std::string getcpBottom(); - std::string getcpBottom2(); - std::string getConcentration(); - std::string getStreetVelocityFilePath(); - unsigned int getPressInID(); - unsigned int getPressOutID(); - unsigned int getPressInZ(); - unsigned int getPressOutZ(); - unsigned int getMemSizereal(int level); - unsigned int getMemSizeInt(int level); - unsigned int getMemSizeBool(int level); - unsigned int getMemSizerealYZ(int level); - unsigned int getSizeMat(int level); - unsigned int getTStart(); - unsigned int getTInit(); - unsigned int getTEnd(); - unsigned int getTOut(); - unsigned int getTStartOut(); - unsigned int getTimestepForMP(); - unsigned int getTimestepOfCoarseLevel(); - real getDiffusivity(); - real getTemperatureInit(); - real getTemperatureBC(); - real getViscosity(); - real getVelocity(); - real getViscosityRatio(); - real getVelocityRatio(); - real getDensityRatio(); - real getPressRatio(); - real getTimeRatio(); - real getLengthRatio(); - real getForceRatio(); - real getRealX(); - real getRealY(); - real getRe(); - real getFactorPressBC(); - real getclockCycleForMP(); - std::vector<uint> getDevices(); - std::vector<int> getGridX(); - std::vector<int> getGridY(); - std::vector<int> getGridZ(); - std::vector<int> getDistX(); - std::vector<int> getDistY(); - std::vector<int> getDistZ(); - std::vector<real> getScaleLBMtoSI(); - std::vector<real> getTranslateLBMtoSI(); - std::vector<real> getMinCoordX(); - std::vector<real> getMinCoordY(); - std::vector<real> getMinCoordZ(); - std::vector<real> getMaxCoordX(); - std::vector<real> getMaxCoordY(); - std::vector<real> getMaxCoordZ(); - std::vector<bool> getNeedInterface(); - TempforBoundaryConditions* getTempH(); - TempforBoundaryConditions* getTempD(); - TempVelforBoundaryConditions* getTempVelH(); - TempVelforBoundaryConditions* getTempVelD(); - TempPressforBoundaryConditions* getTempPressH(); - TempPressforBoundaryConditions* getTempPressD(); - std::vector<Visitor*> getActuators(); - std::vector<Visitor*> getProbes(); - unsigned int getTimeDoCheckPoint(); - unsigned int getTimeDoRestart(); - bool getDoCheckPoint(); - bool getDoRestart(); - bool overWritingRestart(unsigned int t); - bool getIsGeo(); - bool getIsGeoNormal(); - bool getIsInflowNormal(); - bool getIsOutflowNormal(); - bool getIsProp(); - bool getIsCp(); - bool getIsGeometryValues(); - bool getCalc2ndOrderMoments(); - bool getCalc3rdOrderMoments(); - bool getCalcHighOrderMoments(); - bool getConcFile(); - bool isStreetVelocityFile(); - bool getUseMeasurePoints(); - bool getUseWale(); - bool getUseInitNeq(); - bool getSimulatePorousMedia(); - bool getIsF3(); + // getter + double *getForcesDouble(); + real *getForcesHost(); + real *getForcesDev(); + double *getQuadricLimitersDouble(); + real *getQuadricLimitersHost(); + real *getQuadricLimitersDev(); + real getPhi(); + real getAngularVelocity(); + real getStartXHotWall(); + real getEndXHotWall(); + unsigned int getStepEnsight(); + unsigned int getOutputCount(); + unsigned int getlimitOfNodesForVTK(); + unsigned int getStartTurn(); + bool getEvenOrOdd(int level); + bool getDiffOn(); + bool getCompOn(); + bool getPrintFiles(); + bool getReadGeo(); + bool getCalcMedian(); + bool getCalcDragLift(); + bool getCalcCp(); + bool getCalcParticle(); + bool getWriteVeloASCIIfiles(); + bool getCalcPlaneConc(); + int getFine(); + int getCoarse(); + int getParticleBasicLevel(); + int getParticleInitLevel(); + int getNumberOfParticles(); + int getDiffMod(); + int getFactorNZ(); + int getD3Qxx(); + int getMaxLevel(); + int getTimeCalcMedStart(); + int getTimeCalcMedEnd(); + int getMaxDev(); + int getMyID(); + int getNumprocs(); + std::string getOutputPath(); + std::string getOutputPrefix(); + std::string getFName(); + std::string getGeometryFileC(); + std::string getGeometryFileM(); + std::string getGeometryFileF(); + std::string getkFull(); + std::string getgeoFull(); + std::string getgeoVec(); + std::string getcoordX(); + std::string getcoordY(); + std::string getcoordZ(); + std::string getneighborX(); + std::string getneighborY(); + std::string getneighborZ(); + std::string getneighborWSB(); + std::string getscaleCFC(); + std::string getscaleCFF(); + std::string getscaleFCC(); + std::string getscaleFCF(); + std::string getscaleOffsetCF(); + std::string getscaleOffsetFC(); + std::string getgeomBoundaryBcQs(); + std::string getgeomBoundaryBcValues(); + std::string getnoSlipBcPos(); + std::string getnoSlipBcQs(); + std::string getnoSlipBcValue(); + std::string getnoSlipBcValues(); + std::string getslipBcPos(); + std::string getslipBcQs(); + std::string getslipBcValue(); + std::string getpressBcPos(); + std::string getpressBcQs(); + std::string getpressBcValue(); + std::string getpressBcValues(); + std::string getvelBcQs(); + std::string getvelBcValues(); + std::string getinletBcQs(); + std::string getinletBcValues(); + std::string getoutletBcQs(); + std::string getoutletBcValues(); + std::string gettopBcQs(); + std::string gettopBcValues(); + std::string getbottomBcQs(); + std::string getbottomBcValues(); + std::string getfrontBcQs(); + std::string getfrontBcValues(); + std::string getbackBcQs(); + std::string getbackBcValues(); + std::string getwallBcQs(); + std::string getwallBcValues(); + std::string getperiodicBcQs(); + std::string getperiodicBcValues(); + std::string getpropellerQs(); + std::string getpropellerCylinder(); + std::string getpropellerValues(); + std::string getmeasurePoints(); + std::string getnumberNodes(); + std::string getLBMvsSI(); + std::string getcpTop(); + std::string getcpBottom(); + std::string getcpBottom2(); + std::string getConcentration(); + std::string getStreetVelocityFilePath(); + unsigned int getPressInID(); + unsigned int getPressOutID(); + unsigned int getPressInZ(); + unsigned int getPressOutZ(); + unsigned int getMemSizereal(int level); + unsigned int getMemSizeInt(int level); + unsigned int getMemSizeBool(int level); + unsigned int getMemSizerealYZ(int level); + unsigned int getSizeMat(int level); + unsigned int getTStart(); + unsigned int getTInit(); + unsigned int getTEnd(); + unsigned int getTOut(); + unsigned int getTStartOut(); + unsigned int getTimestepForMP(); + unsigned int getTimestepOfCoarseLevel(); + real getDiffusivity(); + real getTemperatureInit(); + real getTemperatureBC(); + real getViscosity(); + real getVelocity(); + real getViscosityRatio(); + real getVelocityRatio(); + real getDensityRatio(); + real getPressRatio(); + real getTimeRatio(); + real getLengthRatio(); + real getForceRatio(); + real getRealX(); + real getRealY(); + real getRe(); + real getFactorPressBC(); + real getclockCycleForMP(); + std::vector<uint> getDevices(); + std::vector<int> getGridX(); + std::vector<int> getGridY(); + std::vector<int> getGridZ(); + std::vector<int> getDistX(); + std::vector<int> getDistY(); + std::vector<int> getDistZ(); + std::vector<real> getScaleLBMtoSI(); + std::vector<real> getTranslateLBMtoSI(); + std::vector<real> getMinCoordX(); + std::vector<real> getMinCoordY(); + std::vector<real> getMinCoordZ(); + std::vector<real> getMaxCoordX(); + std::vector<real> getMaxCoordY(); + std::vector<real> getMaxCoordZ(); + TempforBoundaryConditions *getTempH(); + TempforBoundaryConditions *getTempD(); + TempVelforBoundaryConditions *getTempVelH(); + TempVelforBoundaryConditions *getTempVelD(); + TempPressforBoundaryConditions *getTempPressH(); + TempPressforBoundaryConditions *getTempPressD(); + std::vector<Visitor*> getActuators(); + std::vector<Visitor*> getProbes(); + unsigned int getTimeDoCheckPoint(); + unsigned int getTimeDoRestart(); + bool getDoCheckPoint(); + bool getDoRestart(); + bool overWritingRestart(unsigned int t); + bool getIsGeo(); + bool getIsGeoNormal(); + bool getIsInflowNormal(); + bool getIsOutflowNormal(); + bool getIsProp(); + bool getIsCp(); + bool getIsGeometryValues(); + bool getCalc2ndOrderMoments(); + bool getCalc3rdOrderMoments(); + bool getCalcHighOrderMoments(); + bool getConcFile(); + bool isStreetVelocityFile(); + bool getUseMeasurePoints(); + bool getUseWale(); + bool getUseInitNeq(); + bool getSimulatePorousMedia(); + bool getIsF3(); bool getIsBodyForce(); - double getMemsizeGPU(); - //1D domain decomposition - std::vector<std::string> getPossNeighborFiles(std::string sor); - unsigned int getNumberOfProcessNeighbors(int level, std::string sor); - bool getIsNeighbor(); - //3D domain decomposition - std::vector<std::string> getPossNeighborFilesX(std::string sor); - std::vector<std::string> getPossNeighborFilesY(std::string sor); - std::vector<std::string> getPossNeighborFilesZ(std::string sor); - unsigned int getNumberOfProcessNeighborsX(int level, std::string sor); - unsigned int getNumberOfProcessNeighborsY(int level, std::string sor); - unsigned int getNumberOfProcessNeighborsZ(int level, std::string sor); - bool getIsNeighborX(); - bool getIsNeighborY(); - bool getIsNeighborZ(); - //Normals - std::string getgeomBoundaryNormalX(); - std::string getgeomBoundaryNormalY(); - std::string getgeomBoundaryNormalZ(); - std::string getInflowBoundaryNormalX(); - std::string getInflowBoundaryNormalY(); - std::string getInflowBoundaryNormalZ(); - std::string getOutflowBoundaryNormalX(); - std::string getOutflowBoundaryNormalY(); - std::string getOutflowBoundaryNormalZ(); - //CUDA random number - curandState* getRandomState(); - //Kernel + double getMemsizeGPU(); + // 1D domain decomposition + std::vector<std::string> getPossNeighborFiles(std::string sor); + unsigned int getNumberOfProcessNeighbors(int level, std::string sor); + bool getIsNeighbor(); + // 3D domain decomposition + std::vector<std::string> getPossNeighborFilesX(std::string sor); + std::vector<std::string> getPossNeighborFilesY(std::string sor); + std::vector<std::string> getPossNeighborFilesZ(std::string sor); + unsigned int getNumberOfProcessNeighborsX(int level, std::string sor); + unsigned int getNumberOfProcessNeighborsY(int level, std::string sor); + unsigned int getNumberOfProcessNeighborsZ(int level, std::string sor); + bool getIsNeighborX(); + bool getIsNeighborY(); + bool getIsNeighborZ(); + // Normals + std::string getgeomBoundaryNormalX(); + std::string getgeomBoundaryNormalY(); + std::string getgeomBoundaryNormalZ(); + std::string getInflowBoundaryNormalX(); + std::string getInflowBoundaryNormalY(); + std::string getInflowBoundaryNormalZ(); + std::string getOutflowBoundaryNormalX(); + std::string getOutflowBoundaryNormalY(); + std::string getOutflowBoundaryNormalZ(); + // CUDA random number + curandState *getRandomState(); + // Kernel std::string getMainKernel(); - bool getMultiKernelOn(); - std::vector<int> getMultiKernelLevel(); + bool getMultiKernelOn(); + std::vector<int> getMultiKernelLevel(); std::vector<std::string> getMultiKernel(); - std::string getADKernel(); + std::string getADKernel(); - - ~Parameter(); - - public: - //Forcing/////////////// - real *forcingH, *forcingD; - double hostForcing[3]; + // Forcing/////////////// + real *forcingH, *forcingD; + double hostForcing[3]; ////////////////////////////////////////////////////////////////////////// // limiters real *quadricLimitersH, *quadricLimitersD; double hostQuadricLimiters[3]; - //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// // initial condition - void setInitialCondition(std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition); - std::function<void(real,real,real,real&,real&,real&,real&)>& getInitialCondition(); + void setInitialCondition(std::function<void(real, real, real, real &, real &, real &, real &)> initialCondition); + std::function<void(real, real, real, real &, real &, real &, real &)> &getInitialCondition(); -protected: + std::vector<std::shared_ptr<LBMSimulationParameter>> parH = std::vector<std::shared_ptr<LBMSimulationParameter>>(1); + std::vector<std::shared_ptr<LBMSimulationParameter>> parD = std::vector<std::shared_ptr<LBMSimulationParameter>>(1); private: - static Parameter* instanz; - bool compOn; - bool diffOn; - bool isF3; - bool calcDragLift, calcCp; - bool writeVeloASCII; - bool calcPlaneConc; + void readConfigData(const vf::basics::ConfigurationFile &configData); + + bool compOn { false }; + bool diffOn { false }; + bool isF3 { false }; + bool calcDragLift { false }; + bool calcCp { false }; + bool writeVeloASCII { false }; + bool calcPlaneConc { false }; bool isBodyForce; - int diffMod; - int coarse, fine, maxlevel; - int factor_gridNZ; - int D3Qxx; - InitCondition ic; - double memsizeGPU; - unsigned int limitOfNodesForVTK; - unsigned int outputCount; - unsigned int timestep; - real timeRatio, lengthRatio, forceRatio; - - - //Kernel - std::string mainKernel; - bool multiKernelOn; - std::vector<int> multiKernelLevel; + int diffMod {27}; + int maxlevel {0}; + int coarse {0}; + int fine {0}; + int factor_gridNZ {2}; + int D3Qxx {27}; + InitCondition ic; + double memsizeGPU; + unsigned int limitOfNodesForVTK; + unsigned int outputCount; + unsigned int timestep; + + // Kernel + std::string mainKernel { "CumulantK17Comp" }; + bool multiKernelOn { false }; + std::vector<int> multiKernelLevel; std::vector<std::string> multiKernel; - std::string adKernel; - - ////////////////////////////////////////////////////////////////////////// - //particles - int particleBasicLevel, particleInitLevel; - int numberOfParticles; - bool calcParticles; - real stickToSolid; - real startXHotWall, endXHotWall; - ////////////////////////////////////////////////////////////////////////// - //CUDA random number generation - curandState* devState; - ////////////////////////////////////////////////////////////////////////// - - //Temperature - TempforBoundaryConditions *TempH, *TempD; - //Temperature Velocity - TempVelforBoundaryConditions *TempVelH, *TempVelD; - //Temperature Pressure - TempPressforBoundaryConditions *TempPressH, *TempPressD; - - std::vector<Visitor*> actuators; - std::vector<Visitor*> probes; + std::string adKernel; + + ////////////////////////////////////////////////////////////////////////// + // particles + int particleBasicLevel {0}; + int particleInitLevel {0}; + int numberOfParticles {0}; + bool calcParticles {false}; + real startXHotWall {(real)0.0}; + real endXHotWall {(real)0.0}; + ////////////////////////////////////////////////////////////////////////// + // CUDA random number generation + curandState *devState; + ////////////////////////////////////////////////////////////////////////// + + // Temperature + TempforBoundaryConditions *TempH, *TempD; + // Temperature Velocity + TempVelforBoundaryConditions *TempVelH, *TempVelD; + // Temperature Pressure + TempPressforBoundaryConditions *TempPressH, *TempPressD; + + // Drehung/////////////// + real Phi {0.0}; + real angularVelocity; + unsigned int startTurn; - //Drehung/////////////// - real Phi, angularVelocity; - unsigned int startTurn; + // Visitors ////////////// + std::vector<Visitor*> actuators; + std::vector<Visitor*> probes; - //Step of Ensight writing// - unsigned int stepEnsight; + // Step of Ensight writing// + unsigned int stepEnsight; - std::vector<ParameterStruct*> parH; - std::vector<ParameterStruct*> parD; - //LogWriter output; + real TrafoXtoWorld(int CoordX, int level); + real TrafoYtoWorld(int CoordY, int level); + real TrafoZtoWorld(int CoordZ, int level); - Parameter(); - Parameter(SPtr<ConfigData> configData, vf::gpu::Communicator* comm); - Parameter(const Parameter&); - void initInterfaceParameter(int level); - real TrafoXtoWorld(int CoordX, int level); - real TrafoYtoWorld(int CoordY, int level); - real TrafoZtoWorld(int CoordZ, int level); public: - real TrafoXtoMGsWorld(int CoordX, int level); - real TrafoYtoMGsWorld(int CoordY, int level); - real TrafoZtoMGsWorld(int CoordZ, int level); + real TrafoXtoMGsWorld(int CoordX, int level); + real TrafoYtoMGsWorld(int CoordY, int level); + real TrafoZtoMGsWorld(int CoordZ, int level); + private: - //Multi GPGPU/////////////// - //1D domain decomposition - std::vector<std::string> possNeighborFilesSend; - std::vector<std::string> possNeighborFilesRecv; - bool isNeigbor; - //3D domain decomposition - std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; - std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; - bool isNeigborX, isNeigborY, isNeigborZ; - - - - //////////////////////////////////////////////////////////////////////////// + // Multi GPGPU/////////////// + // 1D domain decomposition + std::vector<std::string> possNeighborFilesSend; + std::vector<std::string> possNeighborFilesRecv; + bool isNeigbor; + // 3D domain decomposition + std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; + std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; + bool isNeigborX, isNeigborY, isNeigborZ; + + //////////////////////////////////////////////////////////////////////////// // initial condition - std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition; + std::function<void(real, real, real, real &, real &, real &, real &)> initialCondition; }; #endif - diff --git a/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp b/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa0551632e566768aaa9b087c072f665d6f7bc3d --- /dev/null +++ b/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp @@ -0,0 +1,158 @@ +#include <gmock/gmock.h> + +#include <iostream> +#include <string> +#include <filesystem> + +#include "Parameter.h" +#include <basics/config/ConfigurationFile.h> + + +auto RealEq = [](auto value) { +#ifdef VF_DOUBLE_ACCURACY + return testing::DoubleEq(value); +#else + return testing::FloatEq(value); +#endif +}; + + +TEST(ParameterTest, passingEmptyFileWithoutPath_ShouldThrow) +{ + // assuming that the config files is stored parallel to this file. + std::filesystem::path filePath = __FILE__; + filePath.replace_filename("parameterTest_emptyfile.cfg"); + + vf::basics::ConfigurationFile config; + config.load(filePath.string()); + + EXPECT_THROW(Parameter para(config, 1, 0), std::runtime_error); +} + +// TODO: test setPossNeighborFilesX +// TODO: test default values + +TEST(ParameterTest, check_all_Parameter_CanBePassedToConstructor) +{ + // assuming that the config files is stored parallel to this file. + std::filesystem::path filePath = __FILE__; + filePath.replace_filename("parameterTest.cfg"); + + vf::basics::ConfigurationFile config; + config.load(filePath.string()); + + Parameter para(config, 1, 0); + + // this two parameters need to be defined in each config file + EXPECT_THAT(para.getOutputPath(), testing::Eq("/output/path")); + EXPECT_THAT(para.getgeoVec(), testing::Eq("/path/to/grid/geoVec.dat")); + // ... all grid files could be tested as well + + // test optional parameter + EXPECT_THAT(para.getMaxDev(), testing::Eq(2)); + EXPECT_THAT(para.getDevices(), testing::ElementsAreArray({2,3})); + EXPECT_THAT(para.getOutputPrefix(), testing::Eq("MyPrefix")); + EXPECT_THAT(para.getPrintFiles(), testing::Eq(true)); + EXPECT_THAT(para.getIsGeometryValues(), testing::Eq(true)); + EXPECT_THAT(para.getCalc2ndOrderMoments(), testing::Eq(true)); + EXPECT_THAT(para.getCalc3rdOrderMoments(), testing::Eq(true)); + EXPECT_THAT(para.getCalcHighOrderMoments(), testing::Eq(true)); + EXPECT_THAT(para.getCalcMedian(), testing::Eq(true)); + EXPECT_THAT(para.getCalcCp(), testing::Eq(true)); + EXPECT_THAT(para.getCalcDragLift(), testing::Eq(true)); + EXPECT_THAT(para.getWriteVeloASCIIfiles(), testing::Eq(true)); + EXPECT_THAT(para.getCalcPlaneConc(), testing::Eq(true)); + EXPECT_THAT(para.getConcFile(), testing::Eq(true)); + EXPECT_THAT(para.isStreetVelocityFile(), testing::Eq(true)); + EXPECT_THAT(para.getUseMeasurePoints(), testing::Eq(true)); + EXPECT_THAT(para.getUseWale(), testing::Eq(true)); + EXPECT_THAT(para.getUseInitNeq(), testing::Eq(true)); + EXPECT_THAT(para.getSimulatePorousMedia(), testing::Eq(true)); + + EXPECT_THAT(para.getD3Qxx(), testing::Eq(99)); + EXPECT_THAT(para.getTEnd(), testing::Eq(33)); + EXPECT_THAT(para.getTOut(), testing::Eq(22)); + EXPECT_THAT(para.getTStartOut(), testing::Eq(11)); + EXPECT_THAT(para.getTimeCalcMedStart(), testing::Eq(22)); + EXPECT_THAT(para.getTimeCalcMedEnd(), testing::Eq(44)); + EXPECT_THAT(para.getPressInID(), testing::Eq(25)); + EXPECT_THAT(para.getPressOutID(), testing::Eq(26)); + EXPECT_THAT(para.getPressInZ(), testing::Eq(27)); + EXPECT_THAT(para.getPressOutZ(), testing::Eq(28)); + + EXPECT_THAT(para.getDiffOn(), testing::Eq(true)); + EXPECT_THAT(para.getDiffMod(), testing::Eq(99)); + EXPECT_THAT(para.getDiffusivity(), RealEq(1.11)); + EXPECT_THAT(para.getTemperatureInit(), RealEq(2.22)); + EXPECT_THAT(para.getTemperatureBC(), RealEq(3.33)); + + EXPECT_THAT(para.getViscosity(), RealEq(4.44)); + EXPECT_THAT(para.getVelocity(), RealEq(5.55)); + EXPECT_THAT(para.getViscosityRatio(), RealEq(6.66)); + EXPECT_THAT(para.getVelocityRatio(), RealEq(7.77)); + EXPECT_THAT(para.getDensityRatio(), RealEq(8.88)); + EXPECT_THAT(para.getPressRatio(), RealEq(9.99)); + + EXPECT_THAT(para.getRealX(), RealEq(0.1)); + EXPECT_THAT(para.getRealY(), RealEq(0.2)); + EXPECT_THAT(para.getFactorPressBC(), RealEq(0.3)); + + EXPECT_THAT(para.getReadGeo(), testing::Eq(true)); + EXPECT_THAT(para.getGeometryFileC(), testing::Eq("/pass/to/c")); + EXPECT_THAT(para.getGeometryFileM(), testing::Eq("/pass/to/m")); + EXPECT_THAT(para.getGeometryFileF(), testing::Eq("/pass/to/f")); + + EXPECT_THAT(para.getclockCycleForMP(), RealEq(0.4)); + EXPECT_THAT(para.getTimestepForMP(), testing::Eq(4)); + + std::vector<real> forces {2.0,2.1,2.2}; + double* forces_actual = para.getForcesDouble(); + for (size_t i = 0; i < forces.size(); ++i) { + EXPECT_THAT((real)forces_actual[i], RealEq(forces[i])); + } + + std::vector<real> limiters {3.0,3.1,3.2}; + double* limiters_actual = para.getQuadricLimitersDouble(); + for (size_t i = 0; i < limiters.size(); ++i) { + EXPECT_THAT((real)limiters_actual[i], RealEq(limiters[i])); + } + + EXPECT_THAT(para.getCalcParticle(), testing::Eq(true)); + EXPECT_THAT(para.getParticleBasicLevel(), testing::Eq(1)); + EXPECT_THAT(para.getParticleInitLevel(), testing::Eq(2)); + EXPECT_THAT(para.getNumberOfParticles(), testing::Eq(1111)); + EXPECT_THAT(para.getStartXHotWall(), RealEq(4.1)); + EXPECT_THAT(para.getEndXHotWall(), RealEq(4.2)); + + EXPECT_THAT(para.getTimeDoCheckPoint(), testing::Eq(33)); + EXPECT_THAT(para.getTimeDoRestart(), testing::Eq(44)); + EXPECT_THAT(para.getDoCheckPoint(), testing::Eq(true)); + EXPECT_THAT(para.getDoRestart(), testing::Eq(true)); + EXPECT_THAT(para.getMaxLevel(), testing::Eq(1)); // NOGL - 1 + + EXPECT_THAT(para.getGridX(), testing::ElementsAreArray({100, 101})); + EXPECT_THAT(para.getGridY(), testing::ElementsAreArray({200, 201})); + EXPECT_THAT(para.getGridZ(), testing::ElementsAreArray({300, 301})); + EXPECT_THAT(para.getDistX(), testing::ElementsAreArray({400, 401})); + EXPECT_THAT(para.getDistY(), testing::ElementsAreArray({500, 501})); + EXPECT_THAT(para.getDistZ(), testing::ElementsAreArray({600, 601})); + + EXPECT_THAT(para.getMainKernel(), testing::Eq("KernelName")); + EXPECT_THAT(para.getMultiKernelOn(), testing::Eq(true)); + EXPECT_THAT(para.getMultiKernelLevel(), testing::ElementsAreArray({3, 2, 1})); + + std::vector<std::string> kernel {"Kernel1", "Kernel2", "Kernel3"}; + auto kernel_actual = para.getMultiKernel(); + for (size_t i = 0; i < kernel.size(); ++i) { + EXPECT_THAT(kernel_actual[i], testing::Eq(kernel[i])); + } + + + EXPECT_THAT(para.getCoarse(), testing::Eq(0)); + EXPECT_THAT(para.getFine(), testing::Eq(1)); // NOGL - 1 + EXPECT_THAT(para.parH.size(), testing::Eq(2)); + EXPECT_THAT(para.parD.size(), testing::Eq(2)); +} + + + diff --git a/src/gpu/VirtualFluids_GPU/Parameter/parameterTest.cfg b/src/gpu/VirtualFluids_GPU/Parameter/parameterTest.cfg new file mode 100644 index 0000000000000000000000000000000000000000..8b6a75ddabaf3a9a570d08982ddad6a00e7b41c5 --- /dev/null +++ b/src/gpu/VirtualFluids_GPU/Parameter/parameterTest.cfg @@ -0,0 +1,93 @@ +# this two parameters need to be defined in each config file +Path = /output/path +GridPath = /path/to/grid + +# optional parameter +NumberOfDevices = 2 +Devices = 2 3 +Prefix = MyPrefix +WriteGrid = true +GeometryValues = true +calc2ndOrderMoments = true +calc3rdOrderMoments = true +calcHigherOrderMoments = true +calcMedian = true +calcCp = true +calcDrafLift = true +writeVeloASCIIfiles = true +calcPlaneConc = true +UseConcFile = true +UseStreetVelocityFile = true +UseMeasurePoints = true +UseWale = true +UseInitNeq = true +SimulatePorousMedia = true + +D3Qxx = 99 +TimeEnd = 33 +TimeOut = 22 +TimeStartOut = 11 +TimeStartCalcMedian = 22 +TimeEndCalcMedian = 44 +PressInID = 25 +PressOutID = 26 +PressInZ = 27 +PressOutZ = 28 + +DiffOn = true +DiffMod = 99 +Diffusivity = 1.11 +Temp = 2.22 +TempBC = 3.33 + +Viscosity_LB = 4.44 +Velocity_LB = 5.55 +Viscosity_Ratio_World_to_LB = 6.66 +Velocity_Ratio_World_to_LB = 7.77 +Density_Ratio_World_to_LB = 8.88 +Delta_Press = 9.99 + +SliceRealX = 0.1 +SliceRealY = 0.2 +FactorPressBC = 0.3 + +ReadGeometry = true +GeometryC = /pass/to/c +GeometryM = /pass/to/m +GeometryF = /pass/to/f + +measureClockCycle = 0.4 +measureTimestep = 4 + +ForcingX = 2.0 +ForcingY = 2.1 +ForcingZ = 2.2 + +QuadricLimiterP = 3.0 +QuadricLimiterM = 3.1 +QuadricLimiterD = 3.2 + +calcParticles = true +baseLevel = 1 +initLevel = 2 +numberOfParticles = 1111 +startXHotWall = 4.1 +endXHotWall = 4.2 + +TimeDoCheckPoint = 33 +TimeDoRestart = 44 +DoCheckPoint = true +DoRestart = true +NOGL = 2 + +GridX = 100 101 +GridY = 200 201 +GridZ = 300 301 +DistX = 400 401 +DistY = 500 501 +DistZ = 600 601 + +MainKernelName = KernelName +MultiKernelOn = true +MultiKernelLevel = 3 2 1 +MultiKernelName = Kernel1 Kernel2 Kernel3 \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Parameter/parameterTest_emptyfile.cfg b/src/gpu/VirtualFluids_GPU/Parameter/parameterTest_emptyfile.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp index c5f391e5a75bb59ce599a603b7c824a387f4615f..c2fd7b995b5b9fe28981ed9a11caf8bf6464e292 100644 --- a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp +++ b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp @@ -261,7 +261,8 @@ void findTemp(Parameter* para) int ex[6]={ 1, -1, 0, 0, 0, 0}; int ey[6]={ 0, 0, 1, -1, 0, 0}; int ez[6]={ 0, 0, 0, 0, 1, -1}; - real ON[7]; + + real ON[7] = {0, 0, 0, 0, 0, 0, 0}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned int i, j, k, m, mm, l; int nx = para->getParH(para->getCoarse())->nx; diff --git a/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.cpp b/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.cpp index e975d23b635db862ff97712987f885d9c9db5e87..906bdb57255513a4dd76df6eee6789a34ef2a816 100644 --- a/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.cpp +++ b/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.cpp @@ -10,20 +10,15 @@ #include <helper_cuda.h> #include "GPU/CudaMemoryManager.h" +#include "GPU/GPU_Interface.h" +#include "Parameter/Parameter.h" +#include "Temperature/FindQTemp.h" void initTemperatur(Parameter* para, CudaMemoryManager* cudaManager, int lev) { - printf("innerhalb initTemperatur\n"); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // alloc F's - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - cudaManager->cudaAllocTempFs(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //copy host to device - cudaManager->cudaCopyConcHD(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + cudaManager->cudaAllocTempFs(lev); + + cudaManager->cudaCopyConcHD(lev); if (para->getDiffMod() == 7) { @@ -40,7 +35,6 @@ void initTemperatur(Parameter* para, CudaMemoryManager* cudaManager, int lev) //InitThS7(); getLastCudaError("Kernel execution failed"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //printf("nach InitThS7 2\n"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CalcMacThS7(para->getParD(lev)->Conc, @@ -85,20 +79,10 @@ void initTemperatur(Parameter* para, CudaMemoryManager* cudaManager, int lev) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //copy device to host cudaManager->cudaCopyConcDH(lev); - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void findTempSim(Parameter* para, CudaMemoryManager* cudaManager) { findKforTemp(para); @@ -109,15 +93,8 @@ void findTempSim(Parameter* para, CudaMemoryManager* cudaManager) cudaManager->cudaCopyTempNoSlipBCHD(para->getCoarse()); } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void findTempVelSim(Parameter* para, CudaMemoryManager* cudaManager) { findKforTempVel(para); @@ -128,15 +105,8 @@ void findTempVelSim(Parameter* para, CudaMemoryManager* cudaManager) cudaManager->cudaCopyTempVeloBCHD(para->getCoarse()); } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void findTempPressSim(Parameter* para, CudaMemoryManager* cudaManager) { findKforTempPress(para); @@ -147,4 +117,3 @@ void findTempPressSim(Parameter* para, CudaMemoryManager* cudaManager) cudaManager->cudaCopyTempPressBCHD(para->getCoarse()); } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.h b/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.h index 4520e157dfe82f05d8168bcb935918559147c007..cfd36f90884008c0a27ce873b3edad31cd94112c 100644 --- a/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.h +++ b/src/gpu/VirtualFluids_GPU/Temperature/FindTemperature.h @@ -1,19 +1,18 @@ #ifndef FIND_TEMPERATURE_H #define FIND_TEMPERATURE_H -#include "LBM/LB.h" -#include "GPU/GPU_Interface.h" -#include "Parameter/Parameter.h" -#include "Temperature/FindQTemp.h" class CudaMemoryManager; +class Parameter; -extern "C" void initTemperatur(Parameter* para, CudaMemoryManager* cudaManager, int lev); -extern "C" void findTempSim(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void findTempVelSim(Parameter* para, CudaMemoryManager* cudaManager); - -extern "C" void findTempPressSim(Parameter* para, CudaMemoryManager* cudaManager); +void initTemperatur(Parameter* para, CudaMemoryManager* cudaManager, int lev); + +void findTempSim(Parameter* para, CudaMemoryManager* cudaManager); + +void findTempVelSim(Parameter* para, CudaMemoryManager* cudaManager); + +void findTempPressSim(Parameter* para, CudaMemoryManager* cudaManager); + #endif diff --git a/src/gpu/VirtualFluids_GPU/Utilities/EnumMapper/EnumMapperImp.h b/src/gpu/VirtualFluids_GPU/Utilities/EnumMapper/EnumMapperImp.h deleted file mode 100644 index 6e7238a0a64893a4e479d5a8173a6a643e03956b..0000000000000000000000000000000000000000 --- a/src/gpu/VirtualFluids_GPU/Utilities/EnumMapper/EnumMapperImp.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef ENUM_MAPPER_IMP_H -#define ENUM_MAPPER_IMP_H - -#include <map> -#include <string> -#include <stdexcept> - -template <typename T> -class EnumMapperImp -{ -public: - std::string getString(T enumeration); - T getEnum(std::string name); - void addEnum(T enumeration, std::string name); - -private: - std::map< T, std::string> enumMap; - std::map< std::string, T> stringMap; - -}; -#endif - -template<typename T> -inline std::string EnumMapperImp<T>::getString(T enumeration) -{ - typename std::map< T, std::string>::iterator it; - it = enumMap.find(enumeration); - if (it == enumMap.end()) { - throw std::runtime_error("Enumeration is not registered."); - } - else - return it->second; -} - -template<typename T> -inline T EnumMapperImp<T>::getEnum(std::string name) -{ - typename std::map< std::string, T>::iterator it; - it = stringMap.find(name); - if (it == stringMap.end()) { - throw std::runtime_error("String is not registered."); - } - else - return it->second; -} - -template<typename T> -inline void EnumMapperImp<T>::addEnum(T enumeration, std::string name) -{ - enumMap.insert(std::pair< T, std::string>(enumeration, name)); - stringMap.insert(std::pair< std::string, T>(name, enumeration)); -}