diff --git a/.github/workflows/test_macos.yml b/.github/workflows/test_macos.yml index 76ef33808..3c09d3b82 100644 --- a/.github/workflows/test_macos.yml +++ b/.github/workflows/test_macos.yml @@ -26,7 +26,7 @@ jobs: cd build cmake .. make -j2 - - name: Build svFSIplus + - name: Build svMultiPhysics run: | mkdir build cd build @@ -34,14 +34,14 @@ jobs: make -j2 - name: Install test dependencies run: | - conda create -n svfsiplus python=3.9 - conda run -n svfsiplus pip install pytest pytest-cov pytest-mock numpy meshio pandas + conda create -n svmultiphysics python=3.9 + conda run -n svmultiphysics pip install pytest pytest-cov pytest-mock numpy meshio pandas - name: Run integration tests run: | git lfs pull cd tests - conda run -n svfsiplus pytest -rPv --durations=0 + conda run -n svmultiphysics pytest -rPv --durations=0 - name: Run unit tests run: | - cd build/svFSIplus-build/Source/svFSI + cd build/svMultiPhysics-build/Source/solver ctest --verbose diff --git a/.github/workflows/test_ubuntu.yml b/.github/workflows/test_ubuntu.yml index 6470bad54..08afd5503 100644 --- a/.github/workflows/test_ubuntu.yml +++ b/.github/workflows/test_ubuntu.yml @@ -13,7 +13,7 @@ jobs: version: ubuntu-22.04 image: ubuntu22 runs-on: ${{ matrix.version }} - container: dcodoni/lib:${{ matrix.image }} + container: simvascular/libraries:${{ matrix.image }} steps: - uses: actions/checkout@v3 - name: Build svZeroDSolver @@ -21,14 +21,14 @@ jobs: run: | conda init source /conda/etc/profile.d/conda.sh - conda activate svfsiplus + conda activate svmultiphysics git clone https://github.com/SimVascular/svZeroDSolver.git cd svZeroDSolver mkdir build cd build cmake .. make -j2 - - name: Build svFSIplus + - name: Build svMultiPhysics run: | if [ -d "build" ]; then rm -rf "build" @@ -38,7 +38,7 @@ jobs: cmake -DENABLE_COVERAGE=ON -DENABLE_ARRAY_INDEX_CHECKING=ON -DENABLE_UNIT_TEST=ON -DSV_USE_TRILINOS:BOOL=ON .. make -j2 cd .. - - name: Build svFSIplus (PETSc) + - name: Build svMultiPhysics (PETSc) run: | if [ -d "build-petsc" ]; then rm -rf "build-petsc" @@ -50,23 +50,23 @@ jobs: cd .. - name: Run integration tests run: | - git config --global --add safe.directory /__w/svFSIplus/svFSIplus + git config --global --add safe.directory /__w/svMultiPhysics/svMultiPhysics git lfs pull cd tests - conda run -n svfsiplus pytest -rPv --durations=0 + conda run -n svmultiphysics pytest -rPv --durations=0 - name: Run unit tests run: | - cd build/svFSIplus-build/Source/svFSI + cd build/svMultiPhysics-build/Source/solver ctest --verbose - name: Generate code coverage run: | - cd build/svFSIplus-build + cd build/svMultiPhysics-build make coverage - name: Save coverage report uses: actions/upload-artifact@v3 with: name: coverage_report - path: build/svFSIplus-build/coverage + path: build/svMultiPhysics-build/coverage - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: diff --git a/CMakeLists.txt b/CMakeLists.txt index d5443c659..04425c743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ include(SimVascularFunctionCheckCompilerFlags) # Add additional variables that can be set from the cmake gui or from the command line. # -# These variables must later be add to 'ExternalProject_Add(svFSI' as -D options. +# These variables must later be add to 'ExternalProject_Add(svMultiPhysics' as -D options. # set(SV_USE_TRILINOS OFF CACHE BOOL "Build with the Trilinos linear algebra package") #set(SV_USE_PETSC OFF CACHE BOOL "Build with the PETSc linear algebra package") @@ -118,16 +118,17 @@ ExternalProject_Add(Externals ${SV_EXTERNALS_APPLE_CMAKE_ARGS} ${SV_EXTERNALS_ADDITIONAL_CMAKE_ARGS} ) + set(SV_EXTERNALS_TOPLEVEL_DIR "${CMAKE_BINARY_DIR}/Externals-build/sv_externals") -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# svFSIplus solver. +# svMultiPhysics +# set(SV_ADDITIONAL_CMAKE_ARGS "" CACHE STRING "If more options want to be provided to the sv_externals build, they can be with this string") set(SV_APPLE_CMAKE_ARGS) -ExternalProject_Add(svFSIplus + +ExternalProject_Add(svMultiPhysics SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Code - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/svFSIplus-build + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/svMultiPhysics-build DEPENDS Externals DOWNLOAD_COMMAND "" UPDATE_COMMAND "" diff --git a/Code/CMake/LINEAR_SOLVERConfig.cmake b/Code/CMake/LINEAR_SOLVERConfig.cmake new file mode 100644 index 000000000..b9e1221c6 --- /dev/null +++ b/Code/CMake/LINEAR_SOLVERConfig.cmake @@ -0,0 +1,23 @@ + + +set(LINEAR_SOLVER_DEFINITIONS "") +set(LINEAR_SOLVER_NEEDED_LIBS LINEAR_SOLVER) + +if(IS64 AND (WIN32 OR CYGWIN)) +unset(LINEAR_SOLVER_INCLUDE_DIR) + set(LINEAR_SOLVER_PATH_PREFIX "LINEAR_SOLVER-2013.08.10/win/x64") + set(LINEAR_SOLVER_FULL_PATH "${LicensedLibs_Bin_Directory}${LINEAR_SOLVER_PATH_PREFIX}") + set(LINEAR_SOLVER_LIB_DIR "${LINEAR_SOLVER_FULL_PATH}" CACHE TYPE PATH) + set(LINEAR_SOLVER_POSSIBLE_INCLUDE_DIR "${LINEAR_SOLVER_FULL_PATH}" CACHE TYPE PATH) +endif() + +find_path(LINEAR_SOLVER_INCLUDE_DIR LINEAR_SOLVER.h HINTS ${LINEAR_SOLVER_POSSIBLE_INCLUDE_DIR}) + +GENLIBS(LINEAR_SOLVER_LIBRARY "${LINEAR_SOLVER_NEEDED_LIBS}" "LINEAR_SOLVER" "${LINEAR_SOLVER_LIB_DIR}") +set(LINEAR_SOLVER_LIBRARY ${LINEAR_SOLVER_LINEAR_SOLVER_LIBRARY}) + +include_directories(${LINEAR_SOLVER_INCLUDE_DIR}) +link_directories(${LINEAR_SOLVER_LIB_DIR}) +add_definitions(${LINEAR_SOLVER_DEFINITIONS}) + + diff --git a/Code/CMake/SVFSILSConfig.cmake b/Code/CMake/SVFSILSConfig.cmake deleted file mode 100644 index b68b7f4ad..000000000 --- a/Code/CMake/SVFSILSConfig.cmake +++ /dev/null @@ -1,23 +0,0 @@ - - -set(SVFSILS_DEFINITIONS "") -set(SVFSILS_NEEDED_LIBS SVFSILS) - -if(IS64 AND (WIN32 OR CYGWIN)) -unset(SVFSILS_INCLUDE_DIR) - set(SVFSILS_PATH_PREFIX "SVFSILS-2013.08.10/win/x64") - set(SVFSILS_FULL_PATH "${LicensedLibs_Bin_Directory}${SVFSILS_PATH_PREFIX}") - set(SVFSILS_LIB_DIR "${SVFSILS_FULL_PATH}" CACHE TYPE PATH) - set(SVFSILS_POSSIBLE_INCLUDE_DIR "${SVFSILS_FULL_PATH}" CACHE TYPE PATH) -endif() - -find_path(SVFSILS_INCLUDE_DIR SVFSILS.h HINTS ${SVFSILS_POSSIBLE_INCLUDE_DIR}) - -GENLIBS(SVFSILS_LIBRARY "${SVFSILS_NEEDED_LIBS}" "SVFSILS" "${SVFSILS_LIB_DIR}") -set(SVFSILS_LIBRARY ${SVFSILS_SVFSILS_LIBRARY}) - -include_directories(${SVFSILS_INCLUDE_DIR}) -link_directories(${SVFSILS_LIB_DIR}) -add_definitions(${SVFSILS_DEFINITIONS}) - - diff --git a/Code/CMake/SimVascularInternals.cmake b/Code/CMake/SimVascularInternals.cmake index 430ee65b6..e8678a721 100644 --- a/Code/CMake/SimVascularInternals.cmake +++ b/Code/CMake/SimVascularInternals.cmake @@ -1,13 +1,20 @@ + +# These names are used to create variables used to store the package library name. +# +# THIRDPARTY_METIS_INTERNAL is used to create the variable +# SV_LIB_THIRDPARTY_METIS_INTERNAL_NAME +# +# SV_LIB_THIRDPARTY_METIS_INTERNAL_NAME is later used to set the value +# for the METIS_INTERNAL_LIBRARY_NAME variable in SimVascularThirdParty.cmake. +# set(SV_LIBS - THIRDPARTY_METIS_SVFSI - THIRDPARTY_PARMETIS_SVFSI - THIRDPARTY_GKLIB_SVFSI + THIRDPARTY_METIS_INTERNAL + THIRDPARTY_PARMETIS_INTERNAL + THIRDPARTY_GKLIB_INTERNAL THIRDPARTY_TETGEN THIRDPARTY_TINYXML THIRDPARTY_ZLIB - SVFSILS - SVFSI_CINTERFACE - SVFSILS_CINTERFACE + LINEAR_SOLVER ) foreach(lib ${SV_LIBS}) diff --git a/Code/CMake/SimVascularMacros.cmake b/Code/CMake/SimVascularMacros.cmake index 87c763fa2..9540b7055 100644 --- a/Code/CMake/SimVascularMacros.cmake +++ b/Code/CMake/SimVascularMacros.cmake @@ -155,6 +155,12 @@ endmacro() #----------------------------------------------------------------------------- # simvascular_third_party # +# This adds a package defined in the Code/ThirdParty directory to the build. +# +# 1) Creates an include file +# 2) Adds the package directory to the build +# 3) Creates the _LIBRARY_NAME variable +# macro(simvascular_third_party _pkg) string(TOLOWER "${_pkg}" _lower) string(TOUPPER "${_pkg}" _upper) @@ -163,13 +169,16 @@ macro(simvascular_third_party _pkg) DOWNLOADABLE SYSTEM_DEFAULT SVEXTERN_CONFIG ADD_INSTALL ) + set(oneValueArgs VERSION) set(multiValueArgs PATHS HINTS COMPONENTS) cmake_parse_arguments("simvascular_third_party" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + set(${_upper}_SUBDIR ThirdParty/${_pkg}) + if(simvascular_third_party_SYSTEM_DEFAULT) option(SV_USE_SYSTEM_${_upper} "Use system ${_pkg}" ON) else() @@ -178,9 +187,15 @@ macro(simvascular_third_party _pkg) mark_as_advanced(SV_USE_SYSTEM_${_upper}) + # Create a package include file and to be used in the build. + # configure_file(${SV_SOURCE_DIR}/${${_upper}_SUBDIR}/simvascular_${_lower}.h.in ${SV_BINARY_DIR}/${${_upper}_SUBDIR}/simvascular_${_lower}.h) + include_directories(BEFORE ${SV_BINARY_DIR}/${${_upper}_SUBDIR} ${SV_SOURCE_DIR}/${${_upper}_SUBDIR}) + + # Add the package to the build. + # if(SV_USE_SYSTEM_${_upper}) set(${_upper}_LIBRARIES) set(${_upper}_LIBRARY) @@ -191,6 +206,7 @@ macro(simvascular_third_party _pkg) endif() endif() endmacro() + #----------------------------------------------------------------------------- # print_vars - THis is a simple marco to print out a list of variables # with their names and value, used mostly for debugging diff --git a/Code/CMake/SimVascularOptions.cmake b/Code/CMake/SimVascularOptions.cmake index 826e4a4ca..6eb7485b7 100644 --- a/Code/CMake/SimVascularOptions.cmake +++ b/Code/CMake/SimVascularOptions.cmake @@ -56,13 +56,11 @@ option(SV_USE_NOTIMER "Use notimer" ON) #----------------------------------------------------------------------------- # Solver Build Options (Modules) -option(SV_USE_EIGEN_SVFSI "Use Eigen headers" ON) -option(SV_USE_METIS_SVFSI "Use metis_svfsi Library" ON) -option(SV_USE_GKLIB_SVFSI "Use GKlib_svfsi Library" ON) -option(SV_USE_PARMETIS_SVFSI "Use parmetis_svfsi Library" ON) -option(SV_USE_TETGEN "Use tetgen Library" ON) - -#----------------------------------------------------------------------------- +option(SV_USE_INTERNAL_EIGEN "Use Eigen headers" ON) +option(SV_USE_INTERNAL_METIS "Use the internal metis library" ON) +option(SV_USE_INTERNAL_GKLIB "Use the internal GKlib library" ON) +option(SV_USE_INTERNAL_PARMETIS "Use the internal parmetis library" ON) +option(SV_USE_TETGEN "Use tetgen library" ON) #----------------------------------------------------------------------------- # Externals @@ -78,10 +76,10 @@ option(SV_EXTERNALS_USE_TOPLEVEL_DIR "If ON, SV_EXTERNALS_TOPLEVEL_DIR will be u #----------------------------------------------------------------------------- -# SVFSILS linear solver is always on +# The internal linear solver is always on #----------------------------------------------------------------------------- -set(USE_SVFSILS 1) -set(SVFSILS_BUILD_TYPE "Source") +set(USE_LINEAR_SOLVER 1) +set(LINEAR_SOLVER_BUILD_TYPE "Source") #----------------------------------------------------------------------------- # WIN32 diff --git a/Code/CMake/SimVascularThirdParty.cmake b/Code/CMake/SimVascularThirdParty.cmake index e693acb12..7a4eb9d3a 100644 --- a/Code/CMake/SimVascularThirdParty.cmake +++ b/Code/CMake/SimVascularThirdParty.cmake @@ -1,36 +1,29 @@ -#----------------------------------------------------------------------------- -# GKLIB_SVFSI -if(SV_USE_GKLIB_SVFSI) - set(USE_GKLIB_SVFSI ON) - simvascular_third_party(gklib_svfsi) - # require to be built here - set(GKLIB__SVFSI_LIBRARY ${SV_LIB_THIRDPARTY_GKLIB_SVFSI_NAME}) + +# The Boolean SV_USE variables are set in SimVascularOptions.cmake. +# +# The SV_LIB_THIRDPARTY_*_INTERNAL_NAME is set in SimVascularInternals.cmake. +# +# The *_internal name must match the directory name in Code/ThirdParty +# +if(SV_USE_INTERNAL_GKLIB) + set(USE_INTERNAL_GKLIB ON) + simvascular_third_party(gklib_internal) endif() -# METIS_SVFSI -if(SV_USE_METIS_SVFSI) - set(USE_METIS_SVFSI ON) - simvascular_third_party(metis_svfsi) - # require to be built here - set(METIS_SVFSI_LIBRARY ${SV_LIB_THIRDPARTY_METIS_SVFSI_NAME}) +if(SV_USE_INTERNAL_METIS) + set(USE_INTERNAL_METIS ON) + simvascular_third_party(metis_internal) endif() -#----------------------------------------------------------------------------- -# PARMETIS_SVFSI -if(SV_USE_PARMETIS_SVFSI) - set(USE_PARMETIS_SVFSI ON) - simvascular_third_party(parmetis_svfsi) - # require to be built here - set(PARMETIS_SVFSI_LIBRARY ${SV_LIB_THIRDPARTY_PARMETIS_SVFSI_NAME}) +if(SV_USE_INTERNAL_PARMETIS) + set(USE_INTERNAL_PARMETIS ON) + simvascular_third_party(parmetis_internal) endif() -#----------------------------------------------------------------------------- # TETGEN if(SV_USE_TETGEN) set(USE_TETGEN ON) simvascular_third_party(tetgen) - # require to be built here - set(TETGEN_LIBRARY ${SV_LIB_THIRDPARTY_TETGEN_NAME}) endif() #----------------------------------------------------------------------------- @@ -38,14 +31,10 @@ endif() if(SV_USE_EIGEN) set(USE_EIGEN ON) simvascular_third_party(eigen) - #find_package(Eigen) - # require to be built here - #set(TETGEN_LIBRARY ${SV_LIB_THIRDPARTY_TETGEN_NAME}) endif() # TINYXML simvascular_third_party(tinyxml) -set(TINYXML_LIBRARY ${SV_LIB_THIRDPARTY_TINYXML_NAME}) diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index 4f10255ca..38a9d18b9 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -90,14 +90,14 @@ include(SimVascularDependentOptions) include(SimVascularInstallSetup) #set(SV_USE_TRILINOS {SV_USE_TRILINOS} PARENT_SCOPE) -#set(SV_USE_TRILINOS OFF CACHE INTERNAL BOOL "Use Trilinos Library with svFSIplus") +#set(SV_USE_TRILINOS OFF CACHE INTERNAL BOOL "Use Trilinos Library with svMultiPhysics") #set(SV_USE_TRILINOS OFF CACHE BOOL INTERNAL) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Set EXE names for the executables -set(SV_SVFSI_EXE "svfsiplus") +set(SV_MULTIPHYSICS_EXE "svmultiphysics") #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/Code/Source/CMakeLists.txt b/Code/Source/CMakeLists.txt index 6c949fce9..c08631212 100644 --- a/Code/Source/CMakeLists.txt +++ b/Code/Source/CMakeLists.txt @@ -31,15 +31,15 @@ set(INDENTS "${INDENTS} ") #----------------------------------------------------------------------------- -# svFSI +# solver solver #----------------------------------------------------------------------------- if(SV_USE_DUMMY_MPI) - message(FATAL_ERROR "svFSI requires MPI (not dummyMPI) and SV_USE_DUMMY_MPI \ + message(FATAL_ERROR "svMultiPhysics requires MPI (not dummyMPI) and SV_USE_DUMMY_MPI \ is set to true.") endif() -set(FLOWSOLVER_SUBDIRS ${FLOWSOLVER_SUBDIRS} svFSILS) -set(FLOWSOLVER_SUBDIRS ${FLOWSOLVER_SUBDIRS} svFSI) +set(FLOWSOLVER_SUBDIRS ${FLOWSOLVER_SUBDIRS} liner_solver) +set(FLOWSOLVER_SUBDIRS ${FLOWSOLVER_SUBDIRS} solver) #----------------------------------------------------------------------------- # Optional header path diff --git a/Code/Source/svFSILS/CMakeLists.txt b/Code/Source/liner_solver/CMakeLists.txt similarity index 98% rename from Code/Source/svFSILS/CMakeLists.txt rename to Code/Source/liner_solver/CMakeLists.txt index adf9fcdcc..19c88c167 100644 --- a/Code/Source/svFSILS/CMakeLists.txt +++ b/Code/Source/liner_solver/CMakeLists.txt @@ -19,7 +19,7 @@ endif() #find_package(VTK REQUIRED) #include(${VTK_USE_FILE}) -set(lib ${SV_LIB_SVFSILS_NAME}) +set(lib ${SV_LIB_LINEAR_SOLVER_NAME}) set(CSRCS add_bc_mul.h add_bc_mul.cpp diff --git a/Code/Source/svFSILS/README.md b/Code/Source/liner_solver/README.md similarity index 100% rename from Code/Source/svFSILS/README.md rename to Code/Source/liner_solver/README.md diff --git a/Code/Source/svFSILS/add_bc_mul.cpp b/Code/Source/liner_solver/add_bc_mul.cpp similarity index 100% rename from Code/Source/svFSILS/add_bc_mul.cpp rename to Code/Source/liner_solver/add_bc_mul.cpp diff --git a/Code/Source/svFSILS/add_bc_mul.h b/Code/Source/liner_solver/add_bc_mul.h similarity index 100% rename from Code/Source/svFSILS/add_bc_mul.h rename to Code/Source/liner_solver/add_bc_mul.h diff --git a/Code/Source/svFSILS/bc.cpp b/Code/Source/liner_solver/bc.cpp similarity index 100% rename from Code/Source/svFSILS/bc.cpp rename to Code/Source/liner_solver/bc.cpp diff --git a/Code/Source/svFSILS/bcast.cpp b/Code/Source/liner_solver/bcast.cpp similarity index 100% rename from Code/Source/svFSILS/bcast.cpp rename to Code/Source/liner_solver/bcast.cpp diff --git a/Code/Source/svFSILS/bcast.h b/Code/Source/liner_solver/bcast.h similarity index 100% rename from Code/Source/svFSILS/bcast.h rename to Code/Source/liner_solver/bcast.h diff --git a/Code/Source/svFSILS/bicgs.cpp b/Code/Source/liner_solver/bicgs.cpp similarity index 100% rename from Code/Source/svFSILS/bicgs.cpp rename to Code/Source/liner_solver/bicgs.cpp diff --git a/Code/Source/svFSILS/bicgs.h b/Code/Source/liner_solver/bicgs.h similarity index 100% rename from Code/Source/svFSILS/bicgs.h rename to Code/Source/liner_solver/bicgs.h diff --git a/Code/Source/svFSILS/cgrad.cpp b/Code/Source/liner_solver/cgrad.cpp similarity index 100% rename from Code/Source/svFSILS/cgrad.cpp rename to Code/Source/liner_solver/cgrad.cpp diff --git a/Code/Source/svFSILS/cgrad.h b/Code/Source/liner_solver/cgrad.h similarity index 100% rename from Code/Source/svFSILS/cgrad.h rename to Code/Source/liner_solver/cgrad.h diff --git a/Code/Source/svFSILS/commu.cpp b/Code/Source/liner_solver/commu.cpp similarity index 100% rename from Code/Source/svFSILS/commu.cpp rename to Code/Source/liner_solver/commu.cpp diff --git a/Code/Source/svFSILS/commu.h b/Code/Source/liner_solver/commu.h similarity index 100% rename from Code/Source/svFSILS/commu.h rename to Code/Source/liner_solver/commu.h diff --git a/Code/Source/svFSILS/cput.cpp b/Code/Source/liner_solver/cput.cpp similarity index 100% rename from Code/Source/svFSILS/cput.cpp rename to Code/Source/liner_solver/cput.cpp diff --git a/Code/Source/svFSILS/dot.cpp b/Code/Source/liner_solver/dot.cpp similarity index 100% rename from Code/Source/svFSILS/dot.cpp rename to Code/Source/liner_solver/dot.cpp diff --git a/Code/Source/svFSILS/dot.h b/Code/Source/liner_solver/dot.h similarity index 100% rename from Code/Source/svFSILS/dot.h rename to Code/Source/liner_solver/dot.h diff --git a/Code/Source/svFSILS/fils_struct.cpp b/Code/Source/liner_solver/fils_struct.cpp similarity index 100% rename from Code/Source/svFSILS/fils_struct.cpp rename to Code/Source/liner_solver/fils_struct.cpp diff --git a/Code/Source/svFSILS/fils_struct.hpp b/Code/Source/liner_solver/fils_struct.hpp similarity index 100% rename from Code/Source/svFSILS/fils_struct.hpp rename to Code/Source/liner_solver/fils_struct.hpp diff --git a/Code/Source/svFSILS/fsils.hpp b/Code/Source/liner_solver/fsils.hpp similarity index 100% rename from Code/Source/svFSILS/fsils.hpp rename to Code/Source/liner_solver/fsils.hpp diff --git a/Code/Source/svFSILS/fsils_api.hpp b/Code/Source/liner_solver/fsils_api.hpp similarity index 100% rename from Code/Source/svFSILS/fsils_api.hpp rename to Code/Source/liner_solver/fsils_api.hpp diff --git a/Code/Source/svFSILS/fsils_std.h b/Code/Source/liner_solver/fsils_std.h similarity index 100% rename from Code/Source/svFSILS/fsils_std.h rename to Code/Source/liner_solver/fsils_std.h diff --git a/Code/Source/svFSILS/ge.cpp b/Code/Source/liner_solver/ge.cpp similarity index 100% rename from Code/Source/svFSILS/ge.cpp rename to Code/Source/liner_solver/ge.cpp diff --git a/Code/Source/svFSILS/ge.h b/Code/Source/liner_solver/ge.h similarity index 100% rename from Code/Source/svFSILS/ge.h rename to Code/Source/liner_solver/ge.h diff --git a/Code/Source/svFSILS/gmres.cpp b/Code/Source/liner_solver/gmres.cpp similarity index 100% rename from Code/Source/svFSILS/gmres.cpp rename to Code/Source/liner_solver/gmres.cpp diff --git a/Code/Source/svFSILS/gmres.h b/Code/Source/liner_solver/gmres.h similarity index 100% rename from Code/Source/svFSILS/gmres.h rename to Code/Source/liner_solver/gmres.h diff --git a/Code/Source/svFSILS/in_commu.cpp b/Code/Source/liner_solver/in_commu.cpp similarity index 100% rename from Code/Source/svFSILS/in_commu.cpp rename to Code/Source/liner_solver/in_commu.cpp diff --git a/Code/Source/svFSILS/lhs.cpp b/Code/Source/liner_solver/lhs.cpp similarity index 100% rename from Code/Source/svFSILS/lhs.cpp rename to Code/Source/liner_solver/lhs.cpp diff --git a/Code/Source/svFSILS/lhs.h b/Code/Source/liner_solver/lhs.h similarity index 100% rename from Code/Source/svFSILS/lhs.h rename to Code/Source/liner_solver/lhs.h diff --git a/Code/Source/svFSILS/ls.cpp b/Code/Source/liner_solver/ls.cpp similarity index 100% rename from Code/Source/svFSILS/ls.cpp rename to Code/Source/liner_solver/ls.cpp diff --git a/Code/Source/svFSILS/norm.cpp b/Code/Source/liner_solver/norm.cpp similarity index 100% rename from Code/Source/svFSILS/norm.cpp rename to Code/Source/liner_solver/norm.cpp diff --git a/Code/Source/svFSILS/norm.h b/Code/Source/liner_solver/norm.h similarity index 100% rename from Code/Source/svFSILS/norm.h rename to Code/Source/liner_solver/norm.h diff --git a/Code/Source/svFSILS/ns_solver.cpp b/Code/Source/liner_solver/ns_solver.cpp similarity index 100% rename from Code/Source/svFSILS/ns_solver.cpp rename to Code/Source/liner_solver/ns_solver.cpp diff --git a/Code/Source/svFSILS/ns_solver.h b/Code/Source/liner_solver/ns_solver.h similarity index 100% rename from Code/Source/svFSILS/ns_solver.h rename to Code/Source/liner_solver/ns_solver.h diff --git a/Code/Source/svFSILS/omp_la.cpp b/Code/Source/liner_solver/omp_la.cpp similarity index 100% rename from Code/Source/svFSILS/omp_la.cpp rename to Code/Source/liner_solver/omp_la.cpp diff --git a/Code/Source/svFSILS/omp_la.h b/Code/Source/liner_solver/omp_la.h similarity index 100% rename from Code/Source/svFSILS/omp_la.h rename to Code/Source/liner_solver/omp_la.h diff --git a/Code/Source/svFSILS/pc_gmres.cpp b/Code/Source/liner_solver/pc_gmres.cpp similarity index 100% rename from Code/Source/svFSILS/pc_gmres.cpp rename to Code/Source/liner_solver/pc_gmres.cpp diff --git a/Code/Source/svFSILS/pc_gmres.h b/Code/Source/liner_solver/pc_gmres.h similarity index 100% rename from Code/Source/svFSILS/pc_gmres.h rename to Code/Source/liner_solver/pc_gmres.h diff --git a/Code/Source/svFSILS/precond.cpp b/Code/Source/liner_solver/precond.cpp similarity index 100% rename from Code/Source/svFSILS/precond.cpp rename to Code/Source/liner_solver/precond.cpp diff --git a/Code/Source/svFSILS/precond.h b/Code/Source/liner_solver/precond.h similarity index 100% rename from Code/Source/svFSILS/precond.h rename to Code/Source/liner_solver/precond.h diff --git a/Code/Source/svFSILS/solve.cpp b/Code/Source/liner_solver/solve.cpp similarity index 100% rename from Code/Source/svFSILS/solve.cpp rename to Code/Source/liner_solver/solve.cpp diff --git a/Code/Source/svFSILS/spar_mul.cpp b/Code/Source/liner_solver/spar_mul.cpp similarity index 100% rename from Code/Source/svFSILS/spar_mul.cpp rename to Code/Source/liner_solver/spar_mul.cpp diff --git a/Code/Source/svFSILS/spar_mul.h b/Code/Source/liner_solver/spar_mul.h similarity index 100% rename from Code/Source/svFSILS/spar_mul.h rename to Code/Source/liner_solver/spar_mul.h diff --git a/Code/Source/svFSI/Array.cpp b/Code/Source/solver/Array.cpp similarity index 100% rename from Code/Source/svFSI/Array.cpp rename to Code/Source/solver/Array.cpp diff --git a/Code/Source/svFSI/Array.h b/Code/Source/solver/Array.h similarity index 100% rename from Code/Source/svFSI/Array.h rename to Code/Source/solver/Array.h diff --git a/Code/Source/svFSI/Array3.cpp b/Code/Source/solver/Array3.cpp similarity index 100% rename from Code/Source/svFSI/Array3.cpp rename to Code/Source/solver/Array3.cpp diff --git a/Code/Source/svFSI/Array3.h b/Code/Source/solver/Array3.h similarity index 100% rename from Code/Source/svFSI/Array3.h rename to Code/Source/solver/Array3.h diff --git a/Code/Source/svFSI/CMakeLists.txt b/Code/Source/solver/CMakeLists.txt similarity index 92% rename from Code/Source/svFSI/CMakeLists.txt rename to Code/Source/solver/CMakeLists.txt index d67a9882c..1f125d1ad 100644 --- a/Code/Source/svFSI/CMakeLists.txt +++ b/Code/Source/solver/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) -include_directories(${SV_SOURCE_DIR}/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib) +include_directories(${SV_SOURCE_DIR}/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib) include_directories(${SV_SOURCE_DIR}/ThirdParty/tetgen/simvascular_tetgen) include_directories(${SV_SOURCE_DIR}/ThirdParty/tinyxml/simvascular_tinyxml) include_directories(${MPI_C_INCLUDE_PATH}) @@ -75,7 +75,7 @@ if(SV_USE_TRILINOS) set(USE_TRILINOS 1) ELSE() - MESSAGE(WARNING "Could not find Trilinos. Compiling svFSI without Trilinos.") + MESSAGE(WARNING "Could not find Trilinos. Compiling svMultiPhysics without Trilinos.") ENDIF() endif() @@ -128,7 +128,7 @@ if(ENABLE_ARRAY_INDEX_CHECKING) ADD_DEFINITIONS(-DENABLE_ARRAY_INDEX_CHECKING) endif() -# svFSI requires LAPACK +# svMultiPhysics requires LAPACK find_package(BLAS REQUIRED) find_package(LAPACK REQUIRED) @@ -238,38 +238,38 @@ if(USE_TRILINOS) link_directories(${Trilinos_TPL_LIBRARY_DIRS}) endif() -simvascular_add_executable(${SV_SVFSI_EXE} +simvascular_add_executable(${SV_MULTIPHYSICS_EXE} SRCS ${CSRCS} - DEV_SCRIPT_NAME "mysvfsi" - INSTALL_SCRIPT_NAME "svfsi" + DEV_SCRIPT_NAME "mysvmultiphysics" + INSTALL_SCRIPT_NAME "svmultiphysics" INSTALL_COMP CoreExecutables INSTALL_DESTINATION ${SV_INSTALL_RUNTIME_DIR}) -target_link_libraries(${SV_SVFSI_EXE} +target_link_libraries(${SV_MULTIPHYSICS_EXE} ${GLOBAL_LIBRARIES} ${INTELRUNTIME_LIBRARIES} ${ZLIB_LIBRARY} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${METIS_SVFSI_LIBRARY_NAME} - ${PARMETIS_SVFSI_LIBRARY_NAME} + ${PARMETIS_INTERNAL_LIBRARY_NAME} ${TETGEN_LIBRARY_NAME} ${TINYXML_LIBRARY_NAME} - ${SV_LIB_SVFSILS_NAME}${SV_MPI_NAME_EXT} + ${SV_LIB_LINEAR_SOLVER_NAME}${SV_MPI_NAME_EXT} ${VTK_LIBRARIES} ) # extra MPI libraries only if there are not set to NOT_FOUND or other null if(SV_MPI_EXTRA_LIBRARY) - target_link_libraries(${SV_SVFSI_EXE} ${SV_MPI_EXTRA_LIBRARY}) + target_link_libraries(${SV_MULTIPHYSICS_EXE} ${SV_MPI_EXTRA_LIBRARY}) endif() if(USE_TRILINOS) - target_link_libraries(${SV_SVFSI_EXE} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES}) + target_link_libraries(${SV_MULTIPHYSICS_EXE} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES}) endif() if(USE_PETSC) - target_link_libraries(${SV_SVFSI_EXE} ${PETSC_LIBRARY_DIRS}) + target_link_libraries(${SV_MULTIPHYSICS_EXE} ${PETSC_LIBRARY_DIRS}) endif() # coverage @@ -319,7 +319,7 @@ if(ENABLE_UNIT_TEST) list(REMOVE_ITEM CSRCS "main.cpp") list(APPEND CSRCS ${TEST_SOURCES}) - # include source files (same as what svFSI does except for main.cpp) + # include source files (same as what svMultiPhysics does except for main.cpp) add_executable(run_all_unit_tests ${CSRCS}) if(USE_TRILINOS) @@ -338,10 +338,10 @@ if(ENABLE_UNIT_TEST) ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${METIS_SVFSI_LIBRARY_NAME} - ${PARMETIS_SVFSI_LIBRARY_NAME} + ${PARMETIS_INTERNAL_LIBRARY_NAME} ${TETGEN_LIBRARY_NAME} ${TINYXML_LIBRARY_NAME} - ${SV_LIB_SVFSILS_NAME}${SV_MPI_NAME_EXT} + ${SV_LIB_LINEAR_SOLVER_NAME}${SV_MPI_NAME_EXT} ${VTK_LIBRARIES} ) diff --git a/Code/Source/svFSI/CepMod.cpp b/Code/Source/solver/CepMod.cpp similarity index 100% rename from Code/Source/svFSI/CepMod.cpp rename to Code/Source/solver/CepMod.cpp diff --git a/Code/Source/svFSI/CepMod.h b/Code/Source/solver/CepMod.h similarity index 100% rename from Code/Source/svFSI/CepMod.h rename to Code/Source/solver/CepMod.h diff --git a/Code/Source/svFSI/CepModAp.cpp b/Code/Source/solver/CepModAp.cpp similarity index 100% rename from Code/Source/svFSI/CepModAp.cpp rename to Code/Source/solver/CepModAp.cpp diff --git a/Code/Source/svFSI/CepModAp.h b/Code/Source/solver/CepModAp.h similarity index 100% rename from Code/Source/svFSI/CepModAp.h rename to Code/Source/solver/CepModAp.h diff --git a/Code/Source/svFSI/CepModBo.cpp b/Code/Source/solver/CepModBo.cpp similarity index 100% rename from Code/Source/svFSI/CepModBo.cpp rename to Code/Source/solver/CepModBo.cpp diff --git a/Code/Source/svFSI/CepModBo.h b/Code/Source/solver/CepModBo.h similarity index 100% rename from Code/Source/svFSI/CepModBo.h rename to Code/Source/solver/CepModBo.h diff --git a/Code/Source/svFSI/CepModFn.cpp b/Code/Source/solver/CepModFn.cpp similarity index 100% rename from Code/Source/svFSI/CepModFn.cpp rename to Code/Source/solver/CepModFn.cpp diff --git a/Code/Source/svFSI/CepModFn.h b/Code/Source/solver/CepModFn.h similarity index 100% rename from Code/Source/svFSI/CepModFn.h rename to Code/Source/solver/CepModFn.h diff --git a/Code/Source/svFSI/CepModTtp.cpp b/Code/Source/solver/CepModTtp.cpp similarity index 100% rename from Code/Source/svFSI/CepModTtp.cpp rename to Code/Source/solver/CepModTtp.cpp diff --git a/Code/Source/svFSI/CepModTtp.h b/Code/Source/solver/CepModTtp.h similarity index 100% rename from Code/Source/svFSI/CepModTtp.h rename to Code/Source/solver/CepModTtp.h diff --git a/Code/Source/svFSI/ChnlMod.cpp b/Code/Source/solver/ChnlMod.cpp similarity index 100% rename from Code/Source/svFSI/ChnlMod.cpp rename to Code/Source/solver/ChnlMod.cpp diff --git a/Code/Source/svFSI/ChnlMod.h b/Code/Source/solver/ChnlMod.h similarity index 100% rename from Code/Source/svFSI/ChnlMod.h rename to Code/Source/solver/ChnlMod.h diff --git a/Code/Source/svFSI/CmMod.cpp b/Code/Source/solver/CmMod.cpp similarity index 100% rename from Code/Source/svFSI/CmMod.cpp rename to Code/Source/solver/CmMod.cpp diff --git a/Code/Source/svFSI/CmMod.h b/Code/Source/solver/CmMod.h similarity index 100% rename from Code/Source/svFSI/CmMod.h rename to Code/Source/solver/CmMod.h diff --git a/Code/Source/svFSI/ComMod.cpp b/Code/Source/solver/ComMod.cpp similarity index 100% rename from Code/Source/svFSI/ComMod.cpp rename to Code/Source/solver/ComMod.cpp diff --git a/Code/Source/svFSI/ComMod.h b/Code/Source/solver/ComMod.h similarity index 100% rename from Code/Source/svFSI/ComMod.h rename to Code/Source/solver/ComMod.h diff --git a/Code/Source/svFSI/DebugMsg.h b/Code/Source/solver/DebugMsg.h similarity index 100% rename from Code/Source/svFSI/DebugMsg.h rename to Code/Source/solver/DebugMsg.h diff --git a/Code/Source/svFSI/FsilsLinearAlgebra.cpp b/Code/Source/solver/FsilsLinearAlgebra.cpp similarity index 100% rename from Code/Source/svFSI/FsilsLinearAlgebra.cpp rename to Code/Source/solver/FsilsLinearAlgebra.cpp diff --git a/Code/Source/svFSI/FsilsLinearAlgebra.h b/Code/Source/solver/FsilsLinearAlgebra.h similarity index 100% rename from Code/Source/svFSI/FsilsLinearAlgebra.h rename to Code/Source/solver/FsilsLinearAlgebra.h diff --git a/Code/Source/svFSI/LinearAlgebra.cpp b/Code/Source/solver/LinearAlgebra.cpp similarity index 100% rename from Code/Source/svFSI/LinearAlgebra.cpp rename to Code/Source/solver/LinearAlgebra.cpp diff --git a/Code/Source/svFSI/LinearAlgebra.h b/Code/Source/solver/LinearAlgebra.h similarity index 100% rename from Code/Source/svFSI/LinearAlgebra.h rename to Code/Source/solver/LinearAlgebra.h diff --git a/Code/Source/svFSI/Parameters.cpp b/Code/Source/solver/Parameters.cpp similarity index 99% rename from Code/Source/svFSI/Parameters.cpp rename to Code/Source/solver/Parameters.cpp index 7a5cd131c..dbc6648d4 100644 --- a/Code/Source/svFSI/Parameters.cpp +++ b/Code/Source/solver/Parameters.cpp @@ -104,7 +104,7 @@ void xml_util_set_parameters( std::function Parameters::constitutive_model_names = { "none", diff --git a/Code/Source/svFSI/Parameters.cpp.orig b/Code/Source/solver/Parameters.cpp.orig similarity index 100% rename from Code/Source/svFSI/Parameters.cpp.orig rename to Code/Source/solver/Parameters.cpp.orig diff --git a/Code/Source/svFSI/Parameters.h b/Code/Source/solver/Parameters.h similarity index 99% rename from Code/Source/svFSI/Parameters.h rename to Code/Source/solver/Parameters.h index 2c1cf076c..a89a6241a 100644 --- a/Code/Source/svFSI/Parameters.h +++ b/Code/Source/solver/Parameters.h @@ -59,11 +59,11 @@ template /// branches from the root to sub-elements. All elements can have sub-elements: /// /// \code{.cpp} -/// +/// /// /// ..... /// -/// +/// /// \endcode /// /// The elements in the svFSIplus simulation file are represented by sections of diff --git a/Code/Source/svFSI/PetscLinearAlgebra.cpp b/Code/Source/solver/PetscLinearAlgebra.cpp similarity index 100% rename from Code/Source/svFSI/PetscLinearAlgebra.cpp rename to Code/Source/solver/PetscLinearAlgebra.cpp diff --git a/Code/Source/svFSI/PetscLinearAlgebra.h b/Code/Source/solver/PetscLinearAlgebra.h similarity index 100% rename from Code/Source/svFSI/PetscLinearAlgebra.h rename to Code/Source/solver/PetscLinearAlgebra.h diff --git a/Code/Source/svFSI/README.md b/Code/Source/solver/README.md similarity index 100% rename from Code/Source/svFSI/README.md rename to Code/Source/solver/README.md diff --git a/Code/Source/svFSI/SPLIT.c b/Code/Source/solver/SPLIT.c similarity index 100% rename from Code/Source/svFSI/SPLIT.c rename to Code/Source/solver/SPLIT.c diff --git a/Code/Source/svFSI/Simulation.cpp b/Code/Source/solver/Simulation.cpp similarity index 100% rename from Code/Source/svFSI/Simulation.cpp rename to Code/Source/solver/Simulation.cpp diff --git a/Code/Source/svFSI/Simulation.h b/Code/Source/solver/Simulation.h similarity index 100% rename from Code/Source/svFSI/Simulation.h rename to Code/Source/solver/Simulation.h diff --git a/Code/Source/svFSI/SimulationLogger.h b/Code/Source/solver/SimulationLogger.h similarity index 100% rename from Code/Source/svFSI/SimulationLogger.h rename to Code/Source/solver/SimulationLogger.h diff --git a/Code/Source/svFSI/Tensor4.cpp b/Code/Source/solver/Tensor4.cpp similarity index 100% rename from Code/Source/svFSI/Tensor4.cpp rename to Code/Source/solver/Tensor4.cpp diff --git a/Code/Source/svFSI/Tensor4.h b/Code/Source/solver/Tensor4.h similarity index 100% rename from Code/Source/svFSI/Tensor4.h rename to Code/Source/solver/Tensor4.h diff --git a/Code/Source/svFSI/Timer.h b/Code/Source/solver/Timer.h similarity index 100% rename from Code/Source/svFSI/Timer.h rename to Code/Source/solver/Timer.h diff --git a/Code/Source/svFSI/TrilinosLinearAlgebra.cpp b/Code/Source/solver/TrilinosLinearAlgebra.cpp similarity index 100% rename from Code/Source/svFSI/TrilinosLinearAlgebra.cpp rename to Code/Source/solver/TrilinosLinearAlgebra.cpp diff --git a/Code/Source/svFSI/TrilinosLinearAlgebra.h b/Code/Source/solver/TrilinosLinearAlgebra.h similarity index 100% rename from Code/Source/svFSI/TrilinosLinearAlgebra.h rename to Code/Source/solver/TrilinosLinearAlgebra.h diff --git a/Code/Source/svFSI/Vector.cpp b/Code/Source/solver/Vector.cpp similarity index 100% rename from Code/Source/svFSI/Vector.cpp rename to Code/Source/solver/Vector.cpp diff --git a/Code/Source/svFSI/Vector.h b/Code/Source/solver/Vector.h similarity index 100% rename from Code/Source/svFSI/Vector.h rename to Code/Source/solver/Vector.h diff --git a/Code/Source/svFSI/VtkData.cpp b/Code/Source/solver/VtkData.cpp similarity index 100% rename from Code/Source/svFSI/VtkData.cpp rename to Code/Source/solver/VtkData.cpp diff --git a/Code/Source/svFSI/VtkData.h b/Code/Source/solver/VtkData.h similarity index 100% rename from Code/Source/svFSI/VtkData.h rename to Code/Source/solver/VtkData.h diff --git a/Code/Source/svFSI/all_fun.cpp b/Code/Source/solver/all_fun.cpp similarity index 100% rename from Code/Source/svFSI/all_fun.cpp rename to Code/Source/solver/all_fun.cpp diff --git a/Code/Source/svFSI/all_fun.h b/Code/Source/solver/all_fun.h similarity index 100% rename from Code/Source/svFSI/all_fun.h rename to Code/Source/solver/all_fun.h diff --git a/Code/Source/svFSI/baf_ini.cpp b/Code/Source/solver/baf_ini.cpp similarity index 100% rename from Code/Source/svFSI/baf_ini.cpp rename to Code/Source/solver/baf_ini.cpp diff --git a/Code/Source/svFSI/baf_ini.h b/Code/Source/solver/baf_ini.h similarity index 100% rename from Code/Source/svFSI/baf_ini.h rename to Code/Source/solver/baf_ini.h diff --git a/Code/Source/svFSI/bf.cpp b/Code/Source/solver/bf.cpp similarity index 100% rename from Code/Source/svFSI/bf.cpp rename to Code/Source/solver/bf.cpp diff --git a/Code/Source/svFSI/bf.h b/Code/Source/solver/bf.h similarity index 100% rename from Code/Source/svFSI/bf.h rename to Code/Source/solver/bf.h diff --git a/Code/Source/svFSI/cep.cpp b/Code/Source/solver/cep.cpp similarity index 100% rename from Code/Source/svFSI/cep.cpp rename to Code/Source/solver/cep.cpp diff --git a/Code/Source/svFSI/cep.h b/Code/Source/solver/cep.h similarity index 100% rename from Code/Source/svFSI/cep.h rename to Code/Source/solver/cep.h diff --git a/Code/Source/svFSI/cep_ion.cpp b/Code/Source/solver/cep_ion.cpp similarity index 100% rename from Code/Source/svFSI/cep_ion.cpp rename to Code/Source/solver/cep_ion.cpp diff --git a/Code/Source/svFSI/cep_ion.h b/Code/Source/solver/cep_ion.h similarity index 100% rename from Code/Source/svFSI/cep_ion.h rename to Code/Source/solver/cep_ion.h diff --git a/Code/Source/svFSI/cmm.cpp b/Code/Source/solver/cmm.cpp similarity index 100% rename from Code/Source/svFSI/cmm.cpp rename to Code/Source/solver/cmm.cpp diff --git a/Code/Source/svFSI/cmm.h b/Code/Source/solver/cmm.h similarity index 100% rename from Code/Source/svFSI/cmm.h rename to Code/Source/solver/cmm.h diff --git a/Code/Source/svFSI/consts.cpp b/Code/Source/solver/consts.cpp similarity index 100% rename from Code/Source/svFSI/consts.cpp rename to Code/Source/solver/consts.cpp diff --git a/Code/Source/svFSI/consts.h b/Code/Source/solver/consts.h similarity index 100% rename from Code/Source/svFSI/consts.h rename to Code/Source/solver/consts.h diff --git a/Code/Source/svFSI/contact.cpp b/Code/Source/solver/contact.cpp similarity index 100% rename from Code/Source/svFSI/contact.cpp rename to Code/Source/solver/contact.cpp diff --git a/Code/Source/svFSI/contact.h b/Code/Source/solver/contact.h similarity index 100% rename from Code/Source/svFSI/contact.h rename to Code/Source/solver/contact.h diff --git a/Code/Source/svFSI/distribute.cpp b/Code/Source/solver/distribute.cpp similarity index 100% rename from Code/Source/svFSI/distribute.cpp rename to Code/Source/solver/distribute.cpp diff --git a/Code/Source/svFSI/distribute.h b/Code/Source/solver/distribute.h similarity index 100% rename from Code/Source/svFSI/distribute.h rename to Code/Source/solver/distribute.h diff --git a/Code/Source/svFSI/eq_assem.cpp b/Code/Source/solver/eq_assem.cpp similarity index 100% rename from Code/Source/svFSI/eq_assem.cpp rename to Code/Source/solver/eq_assem.cpp diff --git a/Code/Source/svFSI/eq_assem.h b/Code/Source/solver/eq_assem.h similarity index 100% rename from Code/Source/svFSI/eq_assem.h rename to Code/Source/solver/eq_assem.h diff --git a/Code/Source/svFSI/fft.cpp b/Code/Source/solver/fft.cpp similarity index 100% rename from Code/Source/svFSI/fft.cpp rename to Code/Source/solver/fft.cpp diff --git a/Code/Source/svFSI/fft.h b/Code/Source/solver/fft.h similarity index 100% rename from Code/Source/svFSI/fft.h rename to Code/Source/solver/fft.h diff --git a/Code/Source/svFSI/fluid.cpp b/Code/Source/solver/fluid.cpp similarity index 100% rename from Code/Source/svFSI/fluid.cpp rename to Code/Source/solver/fluid.cpp diff --git a/Code/Source/svFSI/fluid.h b/Code/Source/solver/fluid.h similarity index 100% rename from Code/Source/svFSI/fluid.h rename to Code/Source/solver/fluid.h diff --git a/Code/Source/svFSI/fs.cpp b/Code/Source/solver/fs.cpp similarity index 100% rename from Code/Source/svFSI/fs.cpp rename to Code/Source/solver/fs.cpp diff --git a/Code/Source/svFSI/fs.h b/Code/Source/solver/fs.h similarity index 100% rename from Code/Source/svFSI/fs.h rename to Code/Source/solver/fs.h diff --git a/Code/Source/svFSI/fsi.cpp b/Code/Source/solver/fsi.cpp similarity index 100% rename from Code/Source/svFSI/fsi.cpp rename to Code/Source/solver/fsi.cpp diff --git a/Code/Source/svFSI/fsi.h b/Code/Source/solver/fsi.h similarity index 100% rename from Code/Source/svFSI/fsi.h rename to Code/Source/solver/fsi.h diff --git a/Code/Source/svFSI/heatf.cpp b/Code/Source/solver/heatf.cpp similarity index 100% rename from Code/Source/svFSI/heatf.cpp rename to Code/Source/solver/heatf.cpp diff --git a/Code/Source/svFSI/heatf.h b/Code/Source/solver/heatf.h similarity index 100% rename from Code/Source/svFSI/heatf.h rename to Code/Source/solver/heatf.h diff --git a/Code/Source/svFSI/heats.cpp b/Code/Source/solver/heats.cpp similarity index 100% rename from Code/Source/svFSI/heats.cpp rename to Code/Source/solver/heats.cpp diff --git a/Code/Source/svFSI/heats.h b/Code/Source/solver/heats.h similarity index 100% rename from Code/Source/svFSI/heats.h rename to Code/Source/solver/heats.h diff --git a/Code/Source/svFSI/initialize.cpp b/Code/Source/solver/initialize.cpp similarity index 100% rename from Code/Source/svFSI/initialize.cpp rename to Code/Source/solver/initialize.cpp diff --git a/Code/Source/svFSI/initialize.h b/Code/Source/solver/initialize.h similarity index 100% rename from Code/Source/svFSI/initialize.h rename to Code/Source/solver/initialize.h diff --git a/Code/Source/svFSI/interface.cpp b/Code/Source/solver/interface.cpp similarity index 100% rename from Code/Source/svFSI/interface.cpp rename to Code/Source/solver/interface.cpp diff --git a/Code/Source/svFSI/l_elas.cpp b/Code/Source/solver/l_elas.cpp similarity index 100% rename from Code/Source/svFSI/l_elas.cpp rename to Code/Source/solver/l_elas.cpp diff --git a/Code/Source/svFSI/l_elas.h b/Code/Source/solver/l_elas.h similarity index 100% rename from Code/Source/svFSI/l_elas.h rename to Code/Source/solver/l_elas.h diff --git a/Code/Source/svFSI/lapack_defs.h b/Code/Source/solver/lapack_defs.h similarity index 100% rename from Code/Source/svFSI/lapack_defs.h rename to Code/Source/solver/lapack_defs.h diff --git a/Code/Source/svFSI/lhsa.cpp b/Code/Source/solver/lhsa.cpp similarity index 100% rename from Code/Source/svFSI/lhsa.cpp rename to Code/Source/solver/lhsa.cpp diff --git a/Code/Source/svFSI/lhsa.h b/Code/Source/solver/lhsa.h similarity index 100% rename from Code/Source/svFSI/lhsa.h rename to Code/Source/solver/lhsa.h diff --git a/Code/Source/svFSI/load_msh.cpp b/Code/Source/solver/load_msh.cpp similarity index 100% rename from Code/Source/svFSI/load_msh.cpp rename to Code/Source/solver/load_msh.cpp diff --git a/Code/Source/svFSI/load_msh.h b/Code/Source/solver/load_msh.h similarity index 100% rename from Code/Source/svFSI/load_msh.h rename to Code/Source/solver/load_msh.h diff --git a/Code/Source/svFSI/ls.cpp b/Code/Source/solver/ls.cpp similarity index 100% rename from Code/Source/svFSI/ls.cpp rename to Code/Source/solver/ls.cpp diff --git a/Code/Source/svFSI/ls.h b/Code/Source/solver/ls.h similarity index 100% rename from Code/Source/svFSI/ls.h rename to Code/Source/solver/ls.h diff --git a/Code/Source/svFSI/main.cpp b/Code/Source/solver/main.cpp similarity index 100% rename from Code/Source/svFSI/main.cpp rename to Code/Source/solver/main.cpp diff --git a/Code/Source/svFSI/mat_fun.cpp b/Code/Source/solver/mat_fun.cpp similarity index 100% rename from Code/Source/svFSI/mat_fun.cpp rename to Code/Source/solver/mat_fun.cpp diff --git a/Code/Source/svFSI/mat_fun.h b/Code/Source/solver/mat_fun.h similarity index 100% rename from Code/Source/svFSI/mat_fun.h rename to Code/Source/solver/mat_fun.h diff --git a/Code/Source/svFSI/mat_fun_carray.cpp b/Code/Source/solver/mat_fun_carray.cpp similarity index 100% rename from Code/Source/svFSI/mat_fun_carray.cpp rename to Code/Source/solver/mat_fun_carray.cpp diff --git a/Code/Source/svFSI/mat_fun_carray.h b/Code/Source/solver/mat_fun_carray.h similarity index 100% rename from Code/Source/svFSI/mat_fun_carray.h rename to Code/Source/solver/mat_fun_carray.h diff --git a/Code/Source/svFSI/mat_models.cpp b/Code/Source/solver/mat_models.cpp similarity index 100% rename from Code/Source/svFSI/mat_models.cpp rename to Code/Source/solver/mat_models.cpp diff --git a/Code/Source/svFSI/mat_models.h b/Code/Source/solver/mat_models.h similarity index 100% rename from Code/Source/svFSI/mat_models.h rename to Code/Source/solver/mat_models.h diff --git a/Code/Source/svFSI/mat_models_carray.h b/Code/Source/solver/mat_models_carray.h similarity index 100% rename from Code/Source/svFSI/mat_models_carray.h rename to Code/Source/solver/mat_models_carray.h diff --git a/Code/Source/svFSI/mesh.cpp b/Code/Source/solver/mesh.cpp similarity index 100% rename from Code/Source/svFSI/mesh.cpp rename to Code/Source/solver/mesh.cpp diff --git a/Code/Source/svFSI/mesh.h b/Code/Source/solver/mesh.h similarity index 100% rename from Code/Source/svFSI/mesh.h rename to Code/Source/solver/mesh.h diff --git a/Code/Source/svFSI/nn.cpp b/Code/Source/solver/nn.cpp similarity index 100% rename from Code/Source/svFSI/nn.cpp rename to Code/Source/solver/nn.cpp diff --git a/Code/Source/svFSI/nn.h b/Code/Source/solver/nn.h similarity index 100% rename from Code/Source/svFSI/nn.h rename to Code/Source/solver/nn.h diff --git a/Code/Source/svFSI/nn_elem_gip.h b/Code/Source/solver/nn_elem_gip.h similarity index 100% rename from Code/Source/svFSI/nn_elem_gip.h rename to Code/Source/solver/nn_elem_gip.h diff --git a/Code/Source/svFSI/nn_elem_gnn.h b/Code/Source/solver/nn_elem_gnn.h similarity index 100% rename from Code/Source/svFSI/nn_elem_gnn.h rename to Code/Source/solver/nn_elem_gnn.h diff --git a/Code/Source/svFSI/nn_elem_gnnxx.h b/Code/Source/solver/nn_elem_gnnxx.h similarity index 100% rename from Code/Source/svFSI/nn_elem_gnnxx.h rename to Code/Source/solver/nn_elem_gnnxx.h diff --git a/Code/Source/svFSI/nn_elem_nn_bnds.h b/Code/Source/solver/nn_elem_nn_bnds.h similarity index 100% rename from Code/Source/svFSI/nn_elem_nn_bnds.h rename to Code/Source/solver/nn_elem_nn_bnds.h diff --git a/Code/Source/svFSI/nn_elem_props.h b/Code/Source/solver/nn_elem_props.h similarity index 100% rename from Code/Source/svFSI/nn_elem_props.h rename to Code/Source/solver/nn_elem_props.h diff --git a/Code/Source/svFSI/output.cpp b/Code/Source/solver/output.cpp similarity index 100% rename from Code/Source/svFSI/output.cpp rename to Code/Source/solver/output.cpp diff --git a/Code/Source/svFSI/output.h b/Code/Source/solver/output.h similarity index 100% rename from Code/Source/svFSI/output.h rename to Code/Source/solver/output.h diff --git a/Code/Source/svFSI/petsc_impl.cpp b/Code/Source/solver/petsc_impl.cpp similarity index 100% rename from Code/Source/svFSI/petsc_impl.cpp rename to Code/Source/solver/petsc_impl.cpp diff --git a/Code/Source/svFSI/petsc_impl.h b/Code/Source/solver/petsc_impl.h similarity index 100% rename from Code/Source/svFSI/petsc_impl.h rename to Code/Source/solver/petsc_impl.h diff --git a/Code/Source/svFSI/pic.cpp b/Code/Source/solver/pic.cpp similarity index 100% rename from Code/Source/svFSI/pic.cpp rename to Code/Source/solver/pic.cpp diff --git a/Code/Source/svFSI/pic.h b/Code/Source/solver/pic.h similarity index 100% rename from Code/Source/svFSI/pic.h rename to Code/Source/solver/pic.h diff --git a/Code/Source/svFSI/post.cpp b/Code/Source/solver/post.cpp similarity index 100% rename from Code/Source/svFSI/post.cpp rename to Code/Source/solver/post.cpp diff --git a/Code/Source/svFSI/post.h b/Code/Source/solver/post.h similarity index 100% rename from Code/Source/svFSI/post.h rename to Code/Source/solver/post.h diff --git a/Code/Source/svFSI/read_files.cpp b/Code/Source/solver/read_files.cpp similarity index 100% rename from Code/Source/svFSI/read_files.cpp rename to Code/Source/solver/read_files.cpp diff --git a/Code/Source/svFSI/read_files.h b/Code/Source/solver/read_files.h similarity index 100% rename from Code/Source/svFSI/read_files.h rename to Code/Source/solver/read_files.h diff --git a/Code/Source/svFSI/read_msh.cpp b/Code/Source/solver/read_msh.cpp similarity index 100% rename from Code/Source/svFSI/read_msh.cpp rename to Code/Source/solver/read_msh.cpp diff --git a/Code/Source/svFSI/read_msh.h b/Code/Source/solver/read_msh.h similarity index 100% rename from Code/Source/svFSI/read_msh.h rename to Code/Source/solver/read_msh.h diff --git a/Code/Source/svFSI/remesh.cpp b/Code/Source/solver/remesh.cpp similarity index 100% rename from Code/Source/svFSI/remesh.cpp rename to Code/Source/solver/remesh.cpp diff --git a/Code/Source/svFSI/remesh.h b/Code/Source/solver/remesh.h similarity index 100% rename from Code/Source/svFSI/remesh.h rename to Code/Source/solver/remesh.h diff --git a/Code/Source/svFSI/remeshTet.cpp b/Code/Source/solver/remeshTet.cpp similarity index 100% rename from Code/Source/svFSI/remeshTet.cpp rename to Code/Source/solver/remeshTet.cpp diff --git a/Code/Source/svFSI/remeshTet.h b/Code/Source/solver/remeshTet.h similarity index 100% rename from Code/Source/svFSI/remeshTet.h rename to Code/Source/solver/remeshTet.h diff --git a/Code/Source/svFSI/set_bc.cpp b/Code/Source/solver/set_bc.cpp similarity index 100% rename from Code/Source/svFSI/set_bc.cpp rename to Code/Source/solver/set_bc.cpp diff --git a/Code/Source/svFSI/set_bc.h b/Code/Source/solver/set_bc.h similarity index 100% rename from Code/Source/svFSI/set_bc.h rename to Code/Source/solver/set_bc.h diff --git a/Code/Source/svFSI/set_equation_dof.h b/Code/Source/solver/set_equation_dof.h similarity index 100% rename from Code/Source/svFSI/set_equation_dof.h rename to Code/Source/solver/set_equation_dof.h diff --git a/Code/Source/svFSI/set_equation_props.h b/Code/Source/solver/set_equation_props.h similarity index 100% rename from Code/Source/svFSI/set_equation_props.h rename to Code/Source/solver/set_equation_props.h diff --git a/Code/Source/svFSI/set_material_props.h b/Code/Source/solver/set_material_props.h similarity index 100% rename from Code/Source/svFSI/set_material_props.h rename to Code/Source/solver/set_material_props.h diff --git a/Code/Source/svFSI/set_output_props.h b/Code/Source/solver/set_output_props.h similarity index 100% rename from Code/Source/svFSI/set_output_props.h rename to Code/Source/solver/set_output_props.h diff --git a/Code/Source/svFSI/set_viscosity_props.h b/Code/Source/solver/set_viscosity_props.h similarity index 100% rename from Code/Source/svFSI/set_viscosity_props.h rename to Code/Source/solver/set_viscosity_props.h diff --git a/Code/Source/svFSI/shells.cpp b/Code/Source/solver/shells.cpp similarity index 100% rename from Code/Source/svFSI/shells.cpp rename to Code/Source/solver/shells.cpp diff --git a/Code/Source/svFSI/shells.h b/Code/Source/solver/shells.h similarity index 100% rename from Code/Source/svFSI/shells.h rename to Code/Source/solver/shells.h diff --git a/Code/Source/svFSI/stokes.cpp b/Code/Source/solver/stokes.cpp similarity index 100% rename from Code/Source/svFSI/stokes.cpp rename to Code/Source/solver/stokes.cpp diff --git a/Code/Source/svFSI/stokes.h b/Code/Source/solver/stokes.h similarity index 100% rename from Code/Source/svFSI/stokes.h rename to Code/Source/solver/stokes.h diff --git a/Code/Source/svFSI/svZeroD_interface/LPNSolverInterface.cpp b/Code/Source/solver/svZeroD_interface/LPNSolverInterface.cpp similarity index 100% rename from Code/Source/svFSI/svZeroD_interface/LPNSolverInterface.cpp rename to Code/Source/solver/svZeroD_interface/LPNSolverInterface.cpp diff --git a/Code/Source/svFSI/svZeroD_interface/LPNSolverInterface.h b/Code/Source/solver/svZeroD_interface/LPNSolverInterface.h similarity index 100% rename from Code/Source/svFSI/svZeroD_interface/LPNSolverInterface.h rename to Code/Source/solver/svZeroD_interface/LPNSolverInterface.h diff --git a/Code/Source/svFSI/svZeroD_interface/lpn_interface.cpp b/Code/Source/solver/svZeroD_interface/lpn_interface.cpp similarity index 100% rename from Code/Source/svFSI/svZeroD_interface/lpn_interface.cpp rename to Code/Source/solver/svZeroD_interface/lpn_interface.cpp diff --git a/Code/Source/svFSI/svZeroD_subroutines.cpp b/Code/Source/solver/svZeroD_subroutines.cpp similarity index 100% rename from Code/Source/svFSI/svZeroD_subroutines.cpp rename to Code/Source/solver/svZeroD_subroutines.cpp diff --git a/Code/Source/svFSI/svZeroD_subroutines.h b/Code/Source/solver/svZeroD_subroutines.h similarity index 100% rename from Code/Source/svFSI/svZeroD_subroutines.h rename to Code/Source/solver/svZeroD_subroutines.h diff --git a/Code/Source/svFSI/sv_struct.cpp b/Code/Source/solver/sv_struct.cpp similarity index 100% rename from Code/Source/svFSI/sv_struct.cpp rename to Code/Source/solver/sv_struct.cpp diff --git a/Code/Source/svFSI/sv_struct.h b/Code/Source/solver/sv_struct.h similarity index 100% rename from Code/Source/svFSI/sv_struct.h rename to Code/Source/solver/sv_struct.h diff --git a/Code/Source/svFSI/trilinos_impl.cpp b/Code/Source/solver/trilinos_impl.cpp similarity index 100% rename from Code/Source/svFSI/trilinos_impl.cpp rename to Code/Source/solver/trilinos_impl.cpp diff --git a/Code/Source/svFSI/trilinos_impl.h b/Code/Source/solver/trilinos_impl.h similarity index 100% rename from Code/Source/svFSI/trilinos_impl.h rename to Code/Source/solver/trilinos_impl.h diff --git a/Code/Source/svFSI/txt.cpp b/Code/Source/solver/txt.cpp similarity index 100% rename from Code/Source/svFSI/txt.cpp rename to Code/Source/solver/txt.cpp diff --git a/Code/Source/svFSI/txt.h b/Code/Source/solver/txt.h similarity index 100% rename from Code/Source/svFSI/txt.h rename to Code/Source/solver/txt.h diff --git a/Code/Source/svFSI/ustruct.cpp b/Code/Source/solver/ustruct.cpp similarity index 100% rename from Code/Source/svFSI/ustruct.cpp rename to Code/Source/solver/ustruct.cpp diff --git a/Code/Source/svFSI/ustruct.h b/Code/Source/solver/ustruct.h similarity index 100% rename from Code/Source/svFSI/ustruct.h rename to Code/Source/solver/ustruct.h diff --git a/Code/Source/svFSI/utils.cpp b/Code/Source/solver/utils.cpp similarity index 100% rename from Code/Source/svFSI/utils.cpp rename to Code/Source/solver/utils.cpp diff --git a/Code/Source/svFSI/utils.h b/Code/Source/solver/utils.h similarity index 100% rename from Code/Source/svFSI/utils.h rename to Code/Source/solver/utils.h diff --git a/Code/Source/svFSI/vtk_xml.cpp b/Code/Source/solver/vtk_xml.cpp similarity index 100% rename from Code/Source/svFSI/vtk_xml.cpp rename to Code/Source/solver/vtk_xml.cpp diff --git a/Code/Source/svFSI/vtk_xml.h b/Code/Source/solver/vtk_xml.h similarity index 100% rename from Code/Source/svFSI/vtk_xml.h rename to Code/Source/solver/vtk_xml.h diff --git a/Code/Source/svFSI/vtk_xml_parser.cpp b/Code/Source/solver/vtk_xml_parser.cpp similarity index 100% rename from Code/Source/svFSI/vtk_xml_parser.cpp rename to Code/Source/solver/vtk_xml_parser.cpp diff --git a/Code/Source/svFSI/vtk_xml_parser.h b/Code/Source/solver/vtk_xml_parser.h similarity index 100% rename from Code/Source/svFSI/vtk_xml_parser.h rename to Code/Source/solver/vtk_xml_parser.h diff --git a/Code/Source/svFSILS/back/CMakeLists.txt b/Code/Source/svFSILS/back/CMakeLists.txt deleted file mode 100644 index a49fde0da..000000000 --- a/Code/Source/svFSILS/back/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - -include_directories(${MPI_C_INCLUDE_PATH}) - -if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - set(CMAKE_Fortran_FLAGS "-cpp -pthread") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy") -else() - # nothing for now - # may need to reset for intel compiler or others -endif() - -# Including VTK produces warnings when compiling Fortran code. -# -# -iframe is valid for C/C++/ObjC/ObjC++ but not for Fortran -# -find_package(VTK REQUIRED) -#include(${VTK_USE_FILE}) - -set(lib ${SV_LIB_SVFSILS_CINTERFACE_NAME}) - -set(CSRCS - add_bc_mul.h add_bc_mul.cpp - bcast.h bcast.cpp - bc.cpp - bicgs.h bicgs.cpp - commu.h commu.cpp - cgrad.h cgrad.cpp - cput.cpp - dot.h dot.cpp - fsils.hpp - fsils_api.hpp - fils_struct.hpp fils_struct.cpp - ge.h ge.cpp - gmres.h gmres.cpp - in_commu.cpp - ls.cpp - lhs.h lhs.cpp - norm.h norm.cpp - ns_solver.h ns_solver.cpp - omp_la.h omp_la.cpp - pc_gmres.h pc_gmres.cpp - precond.h precond.cpp - solve.cpp - spar_mul.h spar_mul.cpp -) - -add_library(${lib} ${SV_LIBRARY_TYPE} ${CSRCS}) - -target_link_libraries(${lib} ${MPI_LIBRARY} ${MPI_Fortran_LIBRARIES} ${VTK_LIBRARIES}) - -# extra MPI libraries only if there are not set to NOT_FOUND or other null -if(SV_MPI_EXTRA_LIBRARY) - target_link_libraries(${lib} ${SV_MPI_EXTRA_LIBRARY}) -endif() - -if(SV_INSTALL_LIBS) - install(TARGETS ${lib} - RUNTIME DESTINATION ${SV_INSTALL_RUNTIME_DIR} COMPONENT CoreExecutables - LIBRARY DESTINATION ${SV_INSTALL_LIBRARY_DIR} COMPONENT CoreLibraries - ARCHIVE DESTINATION ${SV_INSTALL_ARCHIVE_DIR} COMPONENT CoreLibraries - ) -endif() -if(SV_INSTALL_HEADERS) - install(FILES ${HDRS} - DESTINATION ${SV_INSTALL_INCLUDE_DIR}/core COMPONENT CoreHeaders - ) -endif() diff --git a/Code/Source/svFSILS/back/README.md b/Code/Source/svFSILS/back/README.md deleted file mode 100644 index 983a8c80f..000000000 --- a/Code/Source/svFSILS/back/README.md +++ /dev/null @@ -1,3 +0,0 @@ - -The include files here are suffixed with .hpp to prevent conflicts with the Fortran .h files in svFSILS. - diff --git a/Code/Source/svFSILS/back/add_bc_mul.cpp b/Code/Source/svFSILS/back/add_bc_mul.cpp deleted file mode 100644 index 4bdf616ff..000000000 --- a/Code/Source/svFSILS/back/add_bc_mul.cpp +++ /dev/null @@ -1,104 +0,0 @@ - -//-------------------------------------------------------------------- -// The contribution of coupled BCs is added to the matrix-vector -// product operation. Depending on the type of operation (adding the -// contribution or compution the PC contribution) different -// coefficients are used. -//-------------------------------------------------------------------- - -// Reproduces code in ADDBCMUL.f. - -#include "add_bc_mul.h" - -#include "dot.h" - -namespace add_bc_mul { - -//------------ -// add_bc_mul -//------------ -// -void add_bc_mul(FSILS_lhsType& lhs, const BcopType op_Type, const int dof, const Array& X, Array& Y) -{ - //int tid = lhs.commu.task; - //auto msg_prefix = std::string("[add_bc_mul:") + std::to_string(tid) + "] "; - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "========== add_bc_mul ==========" << std::endl; - - Vector coef(lhs.nFaces); - Array v(dof,lhs.nNo); - - if (op_Type == BcopType::BCOP_TYPE_ADD) { - //std::cout << msg_prefix << "BCOP_TYPE_ADD" << std::endl; - for (int i = 0; i < lhs.nFaces; i++) { - coef(i) = lhs.face[i].res; - //std::cout << msg_prefix << "coef(" << i+1 << "): " << coef(i) << std::endl; - } - } else if (op_Type == BcopType::BCOP_TYPE_PRE) { - //std::cout << msg_prefix << "BCOP_TYPE_PRE" << std::endl; - for (int i = 0; i < lhs.nFaces; i++) { - coef(i) = -lhs.face[i].res / (1.0 + (lhs.face[i].res*lhs.face[i].nS)); - //std::cout << msg_prefix << "coef(" << i+1 << "): " << coef(i) << std::endl; - } - } else { - //PRINT *, "FSILS: op_Type is not defined" - //STOP "FSILS: FATAL ERROR" - } - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - //std::cout << msg_prefix << "----- faIn " << faIn+1 << " -----" << std::endl; - auto& face = lhs.face[faIn]; - int nsd = std::min(face.dof, dof); - //std::cout << msg_prefix << "nsd: " << nsd << std::endl; - - if (face.coupledFlag) { - //std::cout << msg_prefix << "coupledFlag faIn: " << faIn+1 << std::endl; - if (face.sharedFlag) { - //std::cout << msg_prefix << " sharedFlag " << std::endl; - v = 0.0; - - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - v(i,Ac) = face.valM(i,a); - } - } - - double S = coef(faIn) * dot::fsils_dot_v(dof, lhs.mynNo, lhs.commu, v, X); - - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - Y(i,Ac) = Y(i,Ac) + v(i,Ac)*S; - } - } - - } else { - //std::cout << msg_prefix << " not sharedFlag " << std::endl; - double S = 0.0; - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - S = S + face.valM(i,a)*X(i,Ac); - //std::cout << msg_prefix << " valM(i,a): " << a+1 << " " << i+1 << " " << face.valM(i,a) << std::endl; - } - } - - S = coef(faIn) * S; - //std::cout << msg_prefix << " S: " << S << std::endl; - - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - //std::cout << msg_prefix << " Ac: " << Ac+1 << std::endl; - for (int i = 0; i < nsd; i++) { - Y(i,Ac) = Y(i,Ac) + face.valM(i,a)*S; - //std::cout << msg_prefix << " Y(i,Ac): " << Y(i,Ac) << std::endl; - } - } - } - } - } - -} - -}; diff --git a/Code/Source/svFSILS/back/add_bc_mul.h b/Code/Source/svFSILS/back/add_bc_mul.h deleted file mode 100644 index 30bcd746f..000000000 --- a/Code/Source/svFSILS/back/add_bc_mul.h +++ /dev/null @@ -1,10 +0,0 @@ - -#include "fils_struct.hpp" - -namespace add_bc_mul { - -using namespace fsi_linear_solver; - -void add_bc_mul(FSILS_lhsType& lhs, const BcopType op_Type, const int dof, const Array& X, Array& Y); - -}; diff --git a/Code/Source/svFSILS/back/bc.cpp b/Code/Source/svFSILS/back/bc.cpp deleted file mode 100644 index 18449e05a..000000000 --- a/Code/Source/svFSILS/back/bc.cpp +++ /dev/null @@ -1,133 +0,0 @@ - -#include "fsils_api.hpp" -#include "fils_struct.hpp" - -namespace fsi_linear_solver { - -//----------------- -// fsils_bc_create -//----------------- -// -// Modifies: -// lhs.face[faIn].nNo -// lhs.face[faIn].dof -// lhs.face[faIn].bGrp -// lhs.face[faIn].glob -// lhs.face[faIn].val -// lhs.face[faIn].valM -// -void fsils_bc_create(FSILS_lhsType& lhs, int faIn, int nNo, int dof, BcType BC_type, const Vector& gNodes, - const Array& Val) -{ - using namespace consts; - - #define n_debug_fsils_bc_create - #ifdef debug_fsils_bc_create - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_bc_create:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== fsils_bc_create ==========" << std::endl; - std::cout << msg_prefix << "lhs.nNo: " << lhs.nNo << std::endl; - std::cout << msg_prefix << "lhs.nFaces: " << lhs.nFaces << std::endl; - std::cout << msg_prefix << "faIn: " << faIn << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "BC_type: " << BC_type << std::endl; - std::cout << msg_prefix << "Val.size(): " << Val.size() << std::endl; - std::cout << msg_prefix << "Val.nrows: " << Val.nrows_ << std::endl; - std::cout << msg_prefix << "Val.ncols: " << Val.ncols_ << std::endl; - #endif - - if (faIn >= lhs.nFaces) { - throw std::runtime_error("FSILS: faIn is exceeding lhs structure maximum number of faces (" - + std::to_string(lhs.nFaces) + ") is less than " + std::to_string(faIn) + "."); - } - - if (faIn <= -1) { - //if (faIn <= 0) { - throw std::runtime_error("FSILS: faIn is smaller than zero"); - } - - lhs.face[faIn].nNo = nNo; - lhs.face[faIn].dof = dof; - lhs.face[faIn].bGrp = BC_type; - - lhs.face[faIn].glob.resize(nNo); - lhs.face[faIn].val.resize(dof,nNo); - lhs.face[faIn].valM.resize(dof,nNo); - - for (int a = 0; a < nNo; a++) { - int Ac = lhs.map(gNodes(a)); - lhs.face[faIn].glob(a) = Ac; - } - - if (Val.size() != 0) { - for (int a = 0; a < nNo; a++) { - for (int i = 0; i < Val.num_rows(); i++) { - lhs.face[faIn].val(i,a) = Val(i,a); - //std::cout << msg_prefix << "Val(i,a): " << a+1 << " " << i+1 << " " << Val(i,a) << std::endl; - } - //lhs.face[faIn].val(:,a) = Val(:,a); - } - } else { - lhs.face[faIn].val = 0.0; - } - - if (lhs.commu.nTasks > 1) { - int a = 0; - - //std::cout << msg_prefix << "lhs.face[faIn].nNo: " << lhs.face[faIn].nNo << std::endl; - if (lhs.face[faIn].nNo != 0) { - a = 1; - } - - int Ac; - - MPI_Allreduce(&a, &Ac, 1, cm_mod::mpint, MPI_SUM, lhs.commu.comm); - //CALL MPI_ALLREDUCE(a, Ac, 1, mpint, MPI_SUM, lhs.commu.comm, i) - //std::cout << msg_prefix << "Ac: " << Ac << std::endl; - - if (Ac > 1) { - lhs.face[faIn].sharedFlag = true; - Array v(dof,lhs.nNo); - - for (int a = 0; a < nNo; a++) { - int Ac = lhs.face[faIn].glob(a); - for (int i = 0; i < dof; i++) { - v(i,Ac) = lhs.face[faIn].val(i,a); - } - //v(:,Ac) = lhs.face[faIn].val(:,a) - } - - //std::cout << msg_prefix << "fsils_commuv ..." << std::endl; - //std::cout << msg_prefix << "v.size(): " << v.size() << std::endl; - fsils_commuv(lhs, dof, v); - // CALL FSILS_COMMUV(lhs, dof, v) - - for (int a = 0; a < nNo; a++) { - int Ac = lhs.face[faIn].glob(a); - for (int i = 0; i < dof; i++) { - lhs.face[faIn].val(i,a) = v(i,Ac); - } - //lhs.face(faIn).val(:,a) = v(:,Ac) - } - } - } - //std::cout << msg_prefix << "Done" << std::endl; - //MPI_Barrier(lhs.commu.comm); - //exit(0); -} - -//----------------- -// fsils_bc_create -//----------------- -// fsils_bc_create() without optional 'Val' parameter. -// -void fsils_bc_create(FSILS_lhsType& lhs, int faIn, int nNo, int dof, BcType BC_type, const Vector& gNodes) -{ - Array Val; - fsils_bc_create(lhs, faIn, nNo, dof, BC_type, gNodes, Val); -} - -}; - diff --git a/Code/Source/svFSILS/back/bcast.cpp b/Code/Source/svFSILS/back/bcast.cpp deleted file mode 100644 index 90e841ebc..000000000 --- a/Code/Source/svFSILS/back/bcast.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -// To broadcast a variable to all processors -// -// Reproduces code in BCAST.f. - -#include "bcast.h" - -#include "mpi.h" - -namespace bcast { - -//------------- -// fsils_bcast -//------------- -// -void fsils_bcast(double& u, FSILS_commuType& commu) -{ - if (commu.nTasks > 1) { - double uG; - MPI_Allreduce(&u, &uG, 1, cm_mod::mpreal, MPI_SUM, commu.comm); - //CALL MPI_ALLREDUCE(u, uG, 1, mpreal, MPI_SUM, commu%comm, ierr) - u = uG; - } -} - -//--------------- -// fsils_bcast_v -//--------------- -// -void fsils_bcast_v(const int n, Vector& u, FSILS_commuType& commu) -{ - //std::cout << "[fsils_bcast_v] n: " << n << std::endl; - if (commu.nTasks > 1) { - Vector uG(n); - MPI_Allreduce(u.data(), uG.data(), n, cm_mod::mpreal, MPI_SUM, commu.comm); - u = uG; - } -} - -}; - - diff --git a/Code/Source/svFSILS/back/bcast.h b/Code/Source/svFSILS/back/bcast.h deleted file mode 100644 index e5acd9dbc..000000000 --- a/Code/Source/svFSILS/back/bcast.h +++ /dev/null @@ -1,12 +0,0 @@ - -#include "fils_struct.hpp" - -namespace bcast { - -using namespace fsi_linear_solver; - -void fsils_bcast(double& u, FSILS_commuType& commu); - -void fsils_bcast_v(const int n, Vector& u, FSILS_commuType& commu); - -}; diff --git a/Code/Source/svFSILS/back/bicgs.cpp b/Code/Source/svFSILS/back/bicgs.cpp deleted file mode 100644 index a83c7cd6f..000000000 --- a/Code/Source/svFSILS/back/bicgs.cpp +++ /dev/null @@ -1,138 +0,0 @@ - -//------------------------------------------------------------------ -// Biconjugate-gradient algorithm, available for scaler and vectors. -//------------------------------------------------------------------- - -#include "bicgs.h" - -#include "fsils_api.hpp" - -#include "add_bc_mul.h" -#include "bcast.h" -#include "dot.h" -#include "norm.h" -#include "omp_la.h" -#include "spar_mul.h" - -#include "Array3.h" - -#include - -namespace bicgs { - -//-------- -// bicgsv -//-------- -// -void bicgsv (fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& K, Array& R) -{ - #define n_debug_bicgsv - int tid = lhs.commu.task; - auto msg_prefix = std::string("[bicgsv:") + std::to_string(tid) + "] "; - #ifdef debug_bicgsv - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== bicgsv ==========" << std::endl; - #endif - - using namespace fsi_linear_solver; - - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - #ifdef debug_bicgsv - std::cout << msg_prefix << "ls.mItr: " << ls.mItr << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - //K.write(msg_prefix+"K"); - //R.write(msg_prefix+"R"); - //exit(0); - #endif - - Array P(dof,nNo), Rh(dof,nNo), X(dof,nNo), V(dof,nNo), - S(dof,nNo), T(dof,nNo); - - ls.callD = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - double err = norm::fsi_ls_normv(dof, mynNo, lhs.commu, R); - double errO = err; - ls.iNorm = err; - double eps = std::max(ls.absTol,ls.relTol*err); - double rho = err*err; - double beta = rho; - X = 0.0; - P = R; - Rh = R; - int i_itr = 1; - #ifdef debug_bicgsv - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "err: " << err << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - - for (int i = 0; i < ls.mItr; i++) { - #ifdef debug_bicgsv - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " -----" << std::endl; - std::cout << msg_prefix << "err: " << err << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - if (err < eps) { - ls.suc = true; - break; - } - - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, K, P, V); - double alpha = rho / dot::fsils_dot_v(dof, mynNo, lhs.commu, Rh, V); - S = R - alpha*V; - - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, K, S, T); - double omega = norm::fsi_ls_normv(dof, mynNo, lhs.commu, T); - omega = dot::fsils_dot_v(dof, mynNo, lhs.commu, T, S) / (omega * omega); - - X = X + alpha*P + omega*S; - R = S - omega*T; - - errO = err; - err = norm::fsi_ls_normv(dof, mynNo, lhs.commu, R); - double rhoO = rho; - rho = dot::fsils_dot_v(dof, mynNo, lhs.commu, R, Rh); - beta = rho*alpha / (rhoO*omega); - - #ifdef debug_bicgsv - std::cout << msg_prefix << "alpha: " << alpha << std::endl; - std::cout << msg_prefix << "omega: " << omega << std::endl; - std::cout << msg_prefix << "rho: " << rho << std::endl; - std::cout << msg_prefix << "beta: " << beta << std::endl; - #endif - - P = R + beta * (P - omega*V); - //P.write(msg_prefix+"P"); - //exit(0); - i_itr += 1; - } - - R = X; - ls.itr = i_itr - 1; - ls.fNorm = err; - ls.callD = fsi_linear_solver::fsils_cpu_t() - ls.callD; - #ifdef debug_bicgsv - std::cout << msg_prefix << "ls.itr: " << ls.itr << std::endl; - #endif - - if (errO < std::numeric_limits::epsilon()) { - ls.dB = 0.0; - } else { - ls.dB = 10.0 * log(err / errO); - } - - //R.write(msg_prefix+"R"); - //exit(0); - -} - - -}; - - - diff --git a/Code/Source/svFSILS/back/bicgs.h b/Code/Source/svFSILS/back/bicgs.h deleted file mode 100644 index a713eb44a..000000000 --- a/Code/Source/svFSILS/back/bicgs.h +++ /dev/null @@ -1,9 +0,0 @@ - -#include "fils_struct.hpp" - -namespace bicgs { - -void bicgsv(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& K, Array& R); - -}; diff --git a/Code/Source/svFSILS/back/cgrad.cpp b/Code/Source/svFSILS/back/cgrad.cpp deleted file mode 100644 index 6e90bc7d4..000000000 --- a/Code/Source/svFSILS/back/cgrad.cpp +++ /dev/null @@ -1,281 +0,0 @@ - -// Conjugate-gradient algorithm for scaler, vector and Schur -// complement cases. - -#include "cgrad.h" - -#include "fsils_api.hpp" -#include "add_bc_mul.h" -#include "dot.h" -#include "omp_la.h" -#include "norm.h" -#include "spar_mul.h" - -#include - -namespace cgrad { - -//------- -// schur -//------- -// Reproduces 'SUBROUTINE CGRAD_SCHUR(lhs, ls, dof, D, G, L, R)' -// -// Note [DaveP] This is not producing matching results from the Fortran version. -// The MPI calls seem to be fine. -// -void schur(FSILS_lhsType& lhs, FSILS_subLsType& ls, const int dof, const Array& D, - const Array& G, const Vector& L, Vector& R) -{ - #define n_debug_schur - int tid = lhs.commu.task; - auto msg_prefix = std::string("[schur:") + std::to_string(tid) + "] "; - #ifdef debug_schur - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== schur ==========" << std::endl; - #endif - - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - - Vector X(nNo), P(nNo), SP(nNo), DGP(nNo); - Array GP(dof,nNo), unCondU(dof,nNo); - - double time = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - ls.iNorm = norm::fsi_ls_norms(mynNo, lhs.commu, R); - double eps = pow(std::max(ls.absTol,ls.relTol*ls.iNorm),2.0); - double errO = ls.iNorm*ls.iNorm; - double err = errO; - #ifdef debug_schur - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "ls.iNorm: " << ls.iNorm << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - std::cout << msg_prefix << "errO: " << errO << std::endl; - #endif - - X = 0.0; - P = R; - int last_i = 0; - - #ifdef debug_schur - D.write(msg_prefix+"D"); - G.write(msg_prefix+"G"); - L.write(msg_prefix+"L"); - R.write(msg_prefix+"R"); - #endif - - for (int i = 0; i < ls.mItr; i++) { - #ifdef debug_schur - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " -----" << std::endl; - std::cout << msg_prefix << "err: " << err << std::endl; - auto istr = "_" + std::to_string(i+1); - P.write(msg_prefix+"P"+istr); - #endif - last_i = i; - - if (err < eps) { - ls.suc = true; - break; - } - - errO = err; - - // GP = G * P - spar_mul::fsils_spar_mul_sv(lhs, lhs.rowPtr, lhs.colPtr, dof, G, P, GP); - //CALL FSILS_SPARMULSV(lhs, lhs.rowPtr, lhs.colPtr, dof, G, P,GP) - #ifdef debug_schur - GP.write(msg_prefix+"GP"+istr); - #endif - - //if (ANY(lhs.face.coupledFlag)) { - for (auto& face : lhs.face) { - if (face.coupledFlag) { - auto unCondU = GP; - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_PRE, dof, unCondU, GP); - //CALL ADDBCMUL(lhs, BCOP_TYPE_PRE, dof, unCondU, GP) - //std::cout << msg_prefix << "#### Face is couple " << std::endl; - //exit(0); - break; - } - } - - // DGP = K * GP - spar_mul::fsils_spar_mul_vs(lhs, lhs.rowPtr, lhs.colPtr, dof, D, GP, DGP); - //CALL FSILS_SPARMULVS(lhs, lhs.rowPtr, lhs.colPtr, dof, D,GP,DGP) - #ifdef debug_schur - DGP.write(msg_prefix+"DGP"+istr); - #endif - - // SP = L * P - spar_mul::fsils_spar_mul_ss(lhs, lhs.rowPtr, lhs.colPtr, L, P, SP); - //CALL FSILS_SPARMULSS(lhs, lhs.rowPtr, lhs.colPtr, L, P, SP) - #ifdef debug_schur - SP.write(msg_prefix+"SP_a"+istr); - #endif - - // SP = SP - DGP - omp_la::omp_sum_s(nNo, -1.0, SP, DGP); - //CALL OMPSUMS(nNo, -1._LSRP, SP, DGP) - //!SP = SP - DGP - #ifdef debug_schur - SP.write(msg_prefix+"SP_b"+istr); - #endif - - // Here - double alpha = errO / dot::fsils_dot_s(mynNo, lhs.commu, P, SP); - #ifdef debug_schur - //alpha = errO/FSILS_DOTS(mynNo, lhs.commu, P, SP) - std::cout << msg_prefix << "alpha: " << alpha << std::endl; - #endif - - // X = X + alpha * P - omp_la::omp_sum_s(nNo, alpha, X, P); - //CALL OMPSUMS(nNo, alpha, X, P) - //!X = X + alpha*P - #ifdef debug_schur - X.write(msg_prefix+"X"+istr); - #endif - - // R = R - alpha * SP - omp_la::omp_sum_s(nNo, -alpha, R, SP); - //CALL OMPSUMS(nNo, -alpha, R, SP); - //!R = R - alpha*SP - #ifdef debug_schur - R.write(msg_prefix+"R"+istr); - #endif - - err = norm::fsi_ls_norms(mynNo, lhs.commu, R); - err = err * err; - #ifdef debug_schur - std::cout << msg_prefix << "err: " << err << std::endl; - std::cout << msg_prefix << "errO/err: " << errO/err << std::endl; - std::cout << msg_prefix << "err/errO: " << err/errO << std::endl; - #endif - - // P = P + errO/err * R - double c1 = errO / err; - omp_la::omp_sum_s(nNo, c1, P, R); - //omp_la::omp_sum_s(nNo, errO/err, P, R); - //CALL OMPSUMS(nNo, errO/err, P, R) - - // P = err/errO * P - double c2 = err / errO; - omp_la::omp_mul_s(nNo, c2, P); - //omp_la::omp_mul_s(nNo, err/errO, P); - //CALL OMPMULS(nNo, err/errO, P) - //P = R + err/errO * P; - } - - R = X; - ls.fNorm = sqrt(err); - ls.callD = fsi_linear_solver::fsils_cpu_t() - time + ls.callD; - ls.itr = ls.itr + last_i; - #ifdef debug_schur - std::cout << msg_prefix << "errO: " << errO << std::endl; - std::cout << msg_prefix << "ls.fNorm: " << ls.fNorm << std::endl; - std::cout << msg_prefix << "ls.itr: " << ls.itr << std::endl; - #endif - - if (errO < std::numeric_limits::epsilon()) { - ls.dB = 0.0; - } else { - ls.dB = 5.0 * log(err/errO); - } - - //R.write(msg_prefix+"R"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); -} - -//--------- -// cgrad_v -//--------- -// -void cgrad_v(FSILS_lhsType& lhs, FSILS_subLsType& ls, const int dof, const Array& K, Array& R) -{ - #define n_debug_cgrad_v - int tid = lhs.commu.task; - auto msg_prefix = std::string("[cgrad_v:") + std::to_string(tid) + "] "; - #ifdef debug_cgrad_v - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== cgrad_v ==========" << std::endl; - #endif - - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - #ifdef debug_cgrad_v - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "ls.mItr: " << ls.mItr << std::endl; - #endif - - Array P(dof,nNo), KP(dof,nNo), X(dof,nNo); - - ls.callD = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - ls.iNorm = norm::fsi_ls_normv(dof, mynNo, lhs.commu, R); - double eps = pow(std::max(ls.absTol, ls.relTol* ls.iNorm), 2.0); - - double errO = ls.iNorm * ls.iNorm; - double err = errO; - X = 0.0; - P = R; - int last_i = 0; - #ifdef debug_cgrad_v - std::cout << msg_prefix << "ls.iNorm: " << ls.iNorm << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - std::cout << msg_prefix << "err: " << eps << std::endl; - #endif - - for (int i = 0; i < ls.mItr; i++) { - #ifdef debug_cgrad_v - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " -----" << std::endl; - std::cout << msg_prefix << "err: " << err << std::endl; - auto istr = "_" + std::to_string(i+1); - P.write(msg_prefix+"P"+istr); - #endif - last_i = i; - - if (err < eps) { - ls.suc = true; - break; - } - - errO = err; - - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, K, P, KP); - - double alpha = errO / dot::fsils_dot_v(dof, mynNo, lhs.commu, P, KP); - omp_la::omp_sum_v(dof, nNo, alpha, X, P); - omp_la::omp_sum_v(dof, nNo, -alpha, R, KP); - #ifdef debug_cgrad_v - std::cout << msg_prefix << "alpha: " << alpha << std::endl; - #endif - - err = norm::fsi_ls_normv(dof, mynNo, lhs.commu, R); - err = err * err; - - omp_la::omp_sum_v(dof, nNo, errO/err, P, R); - omp_la::omp_mul_v(dof, nNo, err/errO, P); - } - - R = X; - ls.itr = last_i; - ls.fNorm = sqrt(err); - ls.callD = fsi_linear_solver::fsils_cpu_t() - ls.callD; - - if (errO < std::numeric_limits::epsilon()) { - ls.dB = 0.0; - } else { - ls.dB = 5.0 * log(err/errO); - } -} - - -}; - - diff --git a/Code/Source/svFSILS/back/cgrad.h b/Code/Source/svFSILS/back/cgrad.h deleted file mode 100644 index d0ccf82c9..000000000 --- a/Code/Source/svFSILS/back/cgrad.h +++ /dev/null @@ -1,13 +0,0 @@ - -#include "fils_struct.hpp" - -namespace cgrad { - -using namespace fsi_linear_solver; - -void cgrad_v(FSILS_lhsType& lhs, FSILS_subLsType& ls, const int dof, const Array& K, Array& R); - -void schur(FSILS_lhsType& lhs, FSILS_subLsType& ls, const int dof, const Array& D, - const Array& G, const Vector& L, Vector& R); - -}; diff --git a/Code/Source/svFSILS/back/commu.cpp b/Code/Source/svFSILS/back/commu.cpp deleted file mode 100644 index e1e3fb323..000000000 --- a/Code/Source/svFSILS/back/commu.cpp +++ /dev/null @@ -1,55 +0,0 @@ - -// The functions here reproduce the subroutines defined in svFSILS/COMMU.f. - -#include "fsils.hpp" -#include "CmMod.h" - -#include "mpi.h" - -namespace fsi_linear_solver { - -//-------------------- -// fsils_commu_create -//-------------------- -// -// Modifies: -// commu.task -// commu.nTasks -// -void fsils_commu_create(FSILS_commuType& commu, cm_mod::MpiCommWorldType commi) -{ - // Some of these parameters are set for sequential version - // - commu.foC = true; - commu.comm = commi; - commu.nTasks = 1; - commu.task = 0; - commu.master = 0; - - MPI_Comm_rank(commi, &commu.task); - MPI_Comm_size(commi, &commu.nTasks); - - //auto msg_prefix = std::string("[fsils_commu_create:") + std::to_string(commu.task) + "] "; - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "========== fsils_commu_create ==========" << std::endl; - //std::cout << msg_prefix << "commu.task: " << commu.task << std::endl; - //std::cout << msg_prefix << "commu.nTasks: " << commu.nTasks << std::endl; - - MPI_Allreduce(&commu.task, &commu.master, 1, cm_mod::mpint, MPI_MIN, commi); - - commu.masF = false; - commu.tF = commu.task; - //commu.tF = commu.task + 1; // For Fortran task number - if (commu.task == commu.master) { - commu.masF = true; - } - - //std::cout << msg_prefix << "commu.masF: " << commu.masF << std::endl; - //std::cout << msg_prefix << "commu.tF: " << commu.tF << std::endl; - //std::cout << msg_prefix << "Done." << std::endl; -} - - -}; - - diff --git a/Code/Source/svFSILS/back/commu.h b/Code/Source/svFSILS/back/commu.h deleted file mode 100644 index c6e75b12a..000000000 --- a/Code/Source/svFSILS/back/commu.h +++ /dev/null @@ -1,16 +0,0 @@ - -#include "fsils.hpp" -#include "CmMod.h" - -#ifndef FSI_LINEAR_SOLVER_COMMU_H -#define FSI_LINEAR_SOLVER_COMMU_H - -namespace fsi_linear_solver { - -void fsils_commu_create(FSILS_commuType& commu, cm_mod::MpiCommWorldType commi); - -}; - -#endif - - diff --git a/Code/Source/svFSILS/back/cput.cpp b/Code/Source/svFSILS/back/cput.cpp deleted file mode 100644 index 10c5391d1..000000000 --- a/Code/Source/svFSILS/back/cput.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -// This function will return the current time in sec. - -#include - -namespace fsi_linear_solver { - -//------------- -// fsils_cpu_t -//------------- -// -double fsils_cpu_t() -{ - //auto now = std::chrono::system_clock::now(); - //return static_cast(std::chrono::system_clock::to_time_t(now)); - - auto now = std::chrono::system_clock::now(); - auto now_ms = std::chrono::time_point_cast(now); - - auto value = now_ms.time_since_epoch(); - auto duration = value.count() / 1000.0; - return static_cast(duration); -} - -}; diff --git a/Code/Source/svFSILS/back/dot.cpp b/Code/Source/svFSILS/back/dot.cpp deleted file mode 100644 index 6d3b1ed2a..000000000 --- a/Code/Source/svFSILS/back/dot.cpp +++ /dev/null @@ -1,172 +0,0 @@ - -// The dot product between two scaler-vector container vectors are -// calculated here. -// -// Only the part of U and V which are owned by this processor is -// included in dot product calculation -// In order to have the correct answer it is needed that COMMU has -// been done before calling this function (or the ansesters of U and -// V are passed through COMMU) - -#include "dot.h" - -#include "fils_struct.hpp" - -namespace dot { - -//-------------- -// fsils_dot_s -//-------------- -// Reproduces 'FUNCTION FSILS_DOTS(nNo, commu, U, V)'. -// -double fsils_dot_s(const int nNo, FSILS_commuType& commu, const Vector& U, const Vector& V) -{ - #define n_debug_fsils_dot_s - int tid = commu.task; - auto msg_prefix = std::string("[debug_fsils_dot_s:") + std::to_string(tid) + "] "; - #ifdef debug_fsils_dot_s - std::cout << msg_prefix << "========== fsils_dot_s ==========" << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - #endif - - double result = 0.0; - - for (int i = 0; i < nNo; i++) { - result = result + U(i)*V(i); - } - - if (commu.nTasks == 1) { - return result; - } - - double tmp{0.0}; - MPI_Allreduce(&result, &tmp, 1, cm_mod::mpreal, MPI_SUM, commu.comm); - // CALL MPI_ALLREDUCE(FSILS_DOTS, tmp, 1, mpreal, MPI_SUM, commu%comm, ierr) - - #ifdef debug_fsils_dot_s - std::cout << msg_prefix << "result: " << result << " tmp: " << tmp << std::endl; - #endif - - return tmp; -} - -//------------- -// fsils_dot_v -//------------- -// Reproduces 'FUNCTION FSILS_DOTV(dof, nNo, commu, U, V)'. -// -double fsils_dot_v(const int dof, const int nNo, FSILS_commuType& commu, const Array& U, const Array& V) -{ - double result = 0.0; - - switch (dof) { - case 1: - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i); - } - break; - - case 2: - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i); - } - break; - - case 3: - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i) + U(2,i)*V(2,i); - } - break; - - case 4: - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i) + U(2,i)*V(2,i) + U(3,i)*V(3,i); - } - break; - - defualt: - for (int i = 0; i < nNo; i++) { - double sum{0.0}; - for (int j = 0; j < U.num_rows(); j++) { - sum += U(j,i) * V(j,i); - } - result = result + sum; - //result = result + SUM(U(:,i)*V(:,i)) - } - } - - if (commu.nTasks == 1) { - return result; - } - - double tmp{0.0}; - MPI_Allreduce(&result, &tmp, 1, cm_mod::mpreal, MPI_SUM, commu.comm); - //CALL MPI_ALLREDUCE(result, tmp, 1, mpreal, MPI_SUM, commu%comm, ierr) - - return tmp; -} - -//---------------- -// fsils_nc_dot_s -//---------------- -// Reproduces Fortran 'FSILS_NCDOTS(nNo, , U, V)'. -// -double fsils_nc_dot_s(const int nNo, const Vector& U, const Vector& V) -{ - double result{0.0}; - - for (int i = 0; i < nNo; i++) { - result = result + U(i)*V(i); - } - - return result; -} - -//---------------- -// fsils_nc_dot_v -//---------------- -// Reproduces 'FUNCTION FSILS_NCDOTV(dof, nNo, U, V) RESULT(FSILS_DOTV)'. -// -double fsils_nc_dot_v(const int dof, const int nNo, const Array& U, const Array& V) -{ - double result = 0.0; - - switch (dof) { - case 1: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i); - } - } break; - - case 2: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i); - } - } break; - - case 3: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i) + U(2,i)*V(2,i); - } - } break; - - case 4: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*V(0,i) + U(1,i)*V(1,i) + U(2,i)*V(2,i) + U(3,i)*V(3,i); - } - } break; - - default: { - for (int i = 0; i < nNo; i++) { - result = result + U.col(i) * V.col(i); - } - } break; - } - - return result; -} - - -}; - - diff --git a/Code/Source/svFSILS/back/dot.h b/Code/Source/svFSILS/back/dot.h deleted file mode 100644 index e521540c2..000000000 --- a/Code/Source/svFSILS/back/dot.h +++ /dev/null @@ -1,16 +0,0 @@ - -#include "fils_struct.hpp" - -namespace dot { - -using namespace fsi_linear_solver; - -double fsils_dot_s(const int nNo, FSILS_commuType& commu, const Vector& U, const Vector& V); - -double fsils_dot_v(const int dof, const int nNo, FSILS_commuType& commu, const Array& U, const Array& V); - -double fsils_nc_dot_s(const int nNo, const Vector& U, const Vector& V); - -double fsils_nc_dot_v(const int dof, const int nNo, const Array& U, const Array& V); - -}; diff --git a/Code/Source/svFSILS/back/fils_struct.cpp b/Code/Source/svFSILS/back/fils_struct.cpp deleted file mode 100644 index fd6af260b..000000000 --- a/Code/Source/svFSILS/back/fils_struct.cpp +++ /dev/null @@ -1,3 +0,0 @@ - -#include "fils_struct.hpp" - diff --git a/Code/Source/svFSILS/back/fils_struct.hpp b/Code/Source/svFSILS/back/fils_struct.hpp deleted file mode 100644 index 6d9999d51..000000000 --- a/Code/Source/svFSILS/back/fils_struct.hpp +++ /dev/null @@ -1,229 +0,0 @@ - -#ifndef FSI_LINEAR_SOLVER_H -#define FSI_LINEAR_SOLVER_H - -#include "CmMod.h" - -#include "mpi.h" - -#include - -/* -SELECTED_REAL_KIND(P,R) returns the kind value of a real data type with - - 1) decimal precision of at least P digits, - - 2) exponent range of at least R - -INTEGER, PARAMETER :: LSRP4 = SELECTED_REAL_KIND(6, 37) -INTEGER, PARAMETER :: LSRP8 = SELECTED_REAL_KIND(15, 307) // C++ double -INTEGER, PARAMETER :: LSRP16 = SELECTED_REAL_KIND(33, 4931) // C++ long double -INTEGER, PARAMETER :: LSRP = LSRP8 -*/ - -// The enums here replicate the PARAMETERs defined -// in FSILS_STRUCT.h. - -namespace fsi_linear_solver { - -enum class BcType -{ - BC_TYPE_Dir = 0, - BC_TYPE_Neu = 1 -}; - -enum class BcopType -{ - BCOP_TYPE_ADD = 0, - BCOP_TYPE_PRE = 1 -}; - -//------------------ -// LinearSolverType -//------------------ -// -enum LinearSolverType -{ - LS_TYPE_CG = 798, - LS_TYPE_GMRES = 797, - LS_TYPE_NS = 796, - LS_TYPE_BICGS = 795 -}; - -//----------------- -// FSILS_commuType -//----------------- -// -class FSILS_commuType -{ - public: - int foC; // Free of created (USE) - int masF; // If this the master (USE) - int master; // Master ID (USE) - int task; // ID of this proc. (USE) - int tF; // Task in FORTRAN indexing (USE) - int nTasks; // Total number of tasks (USE) - MPI_Comm comm; // MPI communicator (IN) -}; - -//-------------- -// FSILS_cSType -//-------------- -// -class FSILS_cSType -{ - public: - // The processor to communicate with - int iP = -1; - - // Number of data to be commu - int n = 0; - - // Pointer to the data for commu - Vector ptr; -}; - -//---------------- -// FSILS_faceType -//---------------- -// -class FSILS_faceType -{ - public: - // Free or created (USE) - bool foC = false; - - // Neu: P/Q coupling (USE) - bool coupledFlag = false; - - // Neu: shared between proces (USE) - bool sharedFlag = false; - - // Included in the computations (IN) - bool incFlag = false; - - // Number of nodes (IN) - int nNo = 0; - - // Degrees of freedom for val (IN) - int dof = 0; - - // Dir/Neu (IN) - BcType bGrp = BcType::BC_TYPE_Dir; - - // Only for data alignment - int reserved = 0; - - // Global node number (IN) - Vector glob; - - // ||Sai||**2._LSRP (USE) - double nS = 0.0; - - // Neu: P = res*Q (IN) - double res = 0.0; - - // nodal Sai for Neu (IN) - Array val; - - // Neu W*Sai (TMP) - Array valM; -}; - -//--------------- -// FSILS_lhsType -//--------------- -// -// Modified in: -// -// fsils_lhs_create() -// -class FSILS_lhsType -{ - public: - // Free of created (USE) - bool foC = false; - - bool debug_active = false; - - // Global number of nodes (IN) - int gnNo = 0; - - // Number of nodes (IN) - int nNo = 0; - - // Number of non-zero in lhs (IN) - int nnz = 0; - - // Number of faces (IN) - int nFaces = 0; - - // nNo of this proc (USE) - int mynNo = 0; - - // nNo of shared with lower proc (USE) - int shnNo = 0; - - // Number of communication requests (USE) - int nReq = 0; - - // Column pointer (USE) - Vector colPtr; - - // Row pointer (USE) - Array rowPtr; - - // Diagonal pointer (USE) - Vector diagPtr; - - // Mapping of nodes (USE) - Vector map; - - FSILS_commuType commu; - - std::vector cS; - - std::vector face; -}; - -//----------------- -// FSILS_subLsType -//----------------- -// -class FSILS_subLsType -{ - public: - bool suc; // Successful solving (OUT) - //int suc; // Successful solving (OUT) - int mItr; // Maximum iteration (IN) - int sD; // Space dimension (IN) - int itr; // Number of iteration (OUT) - int cM; // Number of Ax multiply (OUT) - int cN; // Number of |x| norms (OUT) - int cD; // Number of dot products(OUT) - int reserve; // Only for data alignment (-) - double absTol; // Absolute tolerance (IN) - double relTol; // Relative tolerance (IN) - double iNorm; // Initial norm of residual (OUT) - double fNorm; // Final norm of residual (OUT) - double dB; // Res. rduction in last itr. (OUT) - double callD; // Calling duration (OUT) -}; - -class FSILS_lsType -{ - public: - int foC; // Free of created (USE) - LinearSolverType LS_type; // Which one of LS (IN) - int Resm; // Contribution of mom. res. (OUT) - int Resc; // Contribution of cont. res. (OUT) - FSILS_subLsType GM; - FSILS_subLsType CG; - FSILS_subLsType RI; -}; - - -}; - -#endif - diff --git a/Code/Source/svFSILS/back/fsils.hpp b/Code/Source/svFSILS/back/fsils.hpp deleted file mode 100644 index 47cb79d86..000000000 --- a/Code/Source/svFSILS/back/fsils.hpp +++ /dev/null @@ -1,4 +0,0 @@ - -#include "fils_struct.hpp" -#include "fsils_api.hpp" - diff --git a/Code/Source/svFSILS/back/fsils_api.hpp b/Code/Source/svFSILS/back/fsils_api.hpp deleted file mode 100644 index d3e0ca255..000000000 --- a/Code/Source/svFSILS/back/fsils_api.hpp +++ /dev/null @@ -1,34 +0,0 @@ - -#include "fils_struct.hpp" - -#include "consts.h" -#include - -#ifndef FILS_API_H -#define FILS_API_H - -namespace fsi_linear_solver { - -void fsils_bc_create(FSILS_lhsType& lhs, int faIn, int nNo, int dof, BcType BC_type, const Vector& gNodes, - const Array& Val); - -void fsils_bc_create(FSILS_lhsType& lhs, int faIn, int nNo, int dof, BcType BC_type, const Vector& gNodes); - -void fsils_commus(const FSILS_lhsType& lhs, Vector& R); - -void fsils_commuv(const FSILS_lhsType& lhs, const int dof, Array& R); - -double fsils_cpu_t(); - -void fsils_ls_create(FSILS_lsType& ls, LinearSolverType LS_type, double relTol = consts::double_inf, - double absTol = consts::double_inf, int maxItr = consts::int_inf, int dimKry = consts::int_inf, - std::array relTolIn = {}, std::array absTolIn = {}, std::array maxItrIn = {}); - -void fsils_solve(FSILS_lhsType& lhs, FSILS_lsType& ls, const int dof, Array& Ri, Array& Val, - const consts::PreconditionerType prec, const Vector& incL, const Vector& res); - -}; - -#endif - - diff --git a/Code/Source/svFSILS/back/fsils_std.h b/Code/Source/svFSILS/back/fsils_std.h deleted file mode 100644 index 82b054c33..000000000 --- a/Code/Source/svFSILS/back/fsils_std.h +++ /dev/null @@ -1,22 +0,0 @@ - -// This file reproduces FSILS_STD.h. - -#ifndef FILS_STD_H -#define FILS_STD_H - -#include "mpi.h" - -namespace fsi_linear_solver { - -// Set MPI data type names. -const decltype(MPI_LOGICAL) mplog = MPI_LOGICAL; -const decltype(MPI_INTEGER) mpint = MPI_INTEGER; -const decltype(MPI_DOUBLE_PRECISION) mpreal = MPI_DOUBLE_PRECISION; -const decltype(MPI_CHARACTER) mpchar = MPI_CHARACTER; -//const decltype(MPI_STATUS_SIZE) mpsts = MPI_STATUS_SIZE; - -}; - -#endif - - diff --git a/Code/Source/svFSILS/back/ge.cpp b/Code/Source/svFSILS/back/ge.cpp deleted file mode 100644 index 5b5fe70c8..000000000 --- a/Code/Source/svFSILS/back/ge.cpp +++ /dev/null @@ -1,145 +0,0 @@ - -// This subroutine solve a linear system of equations AX=B using -// Gauss elimination and replaces the B with X - -#include "ge.h" - -#include - -namespace ge { - -//---- -// ge -//---- -// -bool ge(const int nV, const int N, const Array& A, Vector& B) -{ - int tid = 0; - auto msg_prefix = std::string("[ge:") + std::to_string(tid) + "] "; - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "========== ge ==========" << std::endl; - //std::cout << msg_prefix << "nV: " << nV << std::endl; - //std::cout << msg_prefix << "N: " << N << std::endl; - - // Constructing a preconditioner. This is to prevent latter problem - // with singular matrix - - Vector W(N); - double tol = std::numeric_limits::denorm_min(); - double eps = std::numeric_limits::epsilon(); - //std::cout << msg_prefix << "tol: " << tol << std::endl; - - // Constructing a preconditioner. - // - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Constructing a preconditioner ..." << std::endl; - - for (int i = 0; i < N; i++) { - if (fabs(A(i,i)) < tol) { - B = 0.0; - //std::cout << msg_prefix << "Done" << std::endl; - return false; - } - - W(i) = 1.0 / sqrt(fabs(A(i,i))); - //std::cout << msg_prefix << "W(" << i << "): " << W(i) << std::endl; - } - - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Constructing C ..." << std::endl; - Array C(N,N+1); - - for (int i = 0; i < N; i++) { - for (int j = 0; j < N; j++) { - C(i,j) = W(i)*W(j)*A(i,j); - //std::cout << msg_prefix << "C(" << i+1 << "," << j+1 << "): " << C(i,j) << std::endl; - } - C(i,N) = W(i)*B(i); - } - - if (N <= 0) { - //std::cout << msg_prefix << "Done" << std::endl; - return false; - - } else if (N == 1) { - B(0) = C(0,1) / C(0,0); - B(0) = B(0)*W(0); - //std::cout << msg_prefix << "Done" << std::endl; - return true; - - } else if (N == 2) { - double pivot = C(0,0)*C(1,1) - C(1,0)*C(0,1); - - // Singular matrix - if (fabs(pivot) < eps) { - B = 0.0; - //std::cout << msg_prefix << "Done" << std::endl; - return false; - } - - B(0) = (C(0,2)*C(1,1) - C(1,2)*C(0,1)) / pivot; - B(1) = (C(1,2)*C(0,0) - C(0,2)*C(1,0)) / pivot; - B(0) = W(0)*B(0); - B(1) = W(1)*B(1); - //std::cout << msg_prefix << "Done" << std::endl; - return true; - } - - //std::cout << msg_prefix << "General with pivots .. " << std::endl; - for (int m = 0; m < N-1; m++) { - int ipv = m; - double pivot = fabs(C(m,m)); - - for (int i = m+1; i < N; i++) { - if (fabs(C(i,m)) > pivot) { - ipv = i; - pivot = fabs(C(i,m)); - } - } - - // Singular matrix - if (fabs(pivot) < eps) { - B = 0.0; - //std::cout << msg_prefix << "Done" << std::endl; - return false; - } - - if (ipv != m) { - for (int j = m; j < N+1; j++) { - double saveEl = C(m,j); - C(m,j) = C(ipv,j); - C(ipv,j) = saveEl; - } - } - - for (int i = m+1; i < N; i++) { - double saveEl = C(i,m) / C(m,m); - C(i,m) = 0.0; - for (int j = m+1; j < N+1; j++) { - C(i,j) = C(i,j) - saveEl*C(m,j); - } - } - } - - for (int j = N-1; j >= 0; j--) { - //for (int j=N, 1, -1 - for (int i = j+1; i < N; i++) { - C(j,N) = C(j,N) - C(j,i)*C(i,N); - //C(j,N+1) = C(j,N+1) - C(j,i)*C(i,N+1); - } - C(j,N) = C(j,N) / C(j,j); - //C(j,N+1) = C(j,N+1) / C(j,j); - } - - for (int i = 0; i < N; i++) { - B(i) = W(i)*C(i,N); - //B(i) = W(i)*C(i,N+1); - } - - //std::cout << msg_prefix << "Done" << std::endl; - return true; -} - -}; - - diff --git a/Code/Source/svFSILS/back/ge.h b/Code/Source/svFSILS/back/ge.h deleted file mode 100644 index a884f2af0..000000000 --- a/Code/Source/svFSILS/back/ge.h +++ /dev/null @@ -1,8 +0,0 @@ - -#include "fils_struct.hpp" - -namespace ge { - -bool ge(const int nV, const int N, const Array& A, Vector& B); - -}; diff --git a/Code/Source/svFSILS/back/gmres.cpp b/Code/Source/svFSILS/back/gmres.cpp deleted file mode 100644 index 3b96bdf9d..000000000 --- a/Code/Source/svFSILS/back/gmres.cpp +++ /dev/null @@ -1,782 +0,0 @@ - -//------------------------------------------------------------------------- -// Graduate [sic] minimum residual algorithm is implemented here for vector -// and scaler problems. -//------------------------------------------------------------------------- - -#include "gmres.h" - -#include "fsils_api.hpp" - -#include "add_bc_mul.h" -#include "bcast.h" -#include "dot.h" -#include "norm.h" -#include "omp_la.h" -#include "spar_mul.h" - -#include "Array3.h" - -#include - -namespace gmres { - -//-------- -// bc_pre -//-------- -// -void bc_pre(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const int mynNo, const int nNo) -{ - int nsd = dof - 1; - Array v(nsd,nNo); - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto &face = lhs.face[faIn]; - if (face.coupledFlag) { - if (face.sharedFlag) { - v = 0.0; - - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - v(i,Ac) = face.valM(i,a); - } - } - - face.nS = pow(norm::fsi_ls_normv(nsd, mynNo, lhs.commu, v), 2.0); - - } else { - face.nS = 0.0; - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - face.nS = face.nS + pow(face.valM(i,a), 2.0); - } - } - } - } - } -} - -//------- -// gmres -//------- -// Solver the system Val * X = R. -// -// Reproduces the Fortran 'GMRES' subroutine. -// -void gmres(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& Val, const Array& R, Array& X) -{ - #define n_debug_gmres - #ifdef debug_gmres - int tid = lhs.commu.task; - auto msg_prefix = std::string("[gmres:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== gmres ==========" << std::endl; - std::cout << msg_prefix << "lhs.debug_active: " << lhs.debug_active << std::endl; - #endif - - using namespace fsi_linear_solver; - - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - #ifdef debug_gmres - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "ls.sD: " << ls.sD << std::endl; - std::cout << msg_prefix << "ls.mItr: " << ls.mItr << std::endl; - std::cout << msg_prefix << "ls.absTol: " << ls.absTol << std::endl; - std::cout << msg_prefix << "ls.relTol: " << ls.relTol << std::endl; - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - #endif - - Array h(ls.sD+1,ls.sD); - Array3 u(dof,nNo,ls.sD+1); - Array unCondU(dof,nNo); - Vector y(ls.sD), c(ls.sD), s(ls.sD), err(ls.sD+1); - - double time = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - double eps = 0.0; - int last_i = 0; - X = 0.0; - - //lhs.rowPtr.write(msg_prefix+"rowPtr"); - //lhs.colPtr.write(msg_prefix+"colPtr"); - - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - for (int l = 0; l < ls.mItr; l++) { - #ifdef debug_gmres - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "---------- l " << l+1 << " ----------" << std::endl; - #endif - - if (l == 0) { - u.set_slice(0, R); - //u(:,:,1) = R - //u.write(msg_prefix+"u_0"); - } else { - auto u_slice = u.slice(0); - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, X, u_slice); - //CALL FSILS_SPARMULVV(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, X, u(:,:,1)) - - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_ADD, dof, X, u_slice); - //CALL ADDBCMUL(lhs, BCOP_TYPE_ADD, dof, X, u(:,:,1)) - - //u_slice.write(msg_prefix+"u_slice"); - //exit(0); - - ls.itr = ls.itr + 1; - u.set_slice(0, R - u_slice); - //u(:,:,1) = R - u(:,:,1) - } - - //if (l == 0) { - //u.write(msg_prefix+"u"); - //} - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - for (auto& face : lhs.face) { - //if (ANY(lhs.face.coupledFlag)) { - if (face.coupledFlag) { - auto u_slice = u.slice(0); - auto unCondU = u.slice(0); - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_PRE, dof, unCondU, u_slice); - //unCondU = u(:,:,1) - //CALL ADDBCMUL(lhs, BCOP_TYPE_PRE, dof, unCondU, u(:,:,1)) - u.set_slice(0, u_slice); - //std::cout << msg_prefix << "###### Has coupled face" << std::endl; - break; - } - } - - err[0] = norm::fsi_ls_normv(dof, mynNo, lhs.commu, u.slice(0)); - #ifdef debug_gmres - std::cout << msg_prefix << "err(1): " << err[0] << std::endl; - #endif - - if (l == 0) { - eps = err[0]; - - if (eps <= ls.absTol) { - ls.callD = std::numeric_limits::epsilon(); - ls.dB = 0.0; - return; - } - - ls.iNorm = eps; - ls.fNorm = eps; - eps = std::max(ls.absTol, ls.relTol*eps); - } - #ifdef debug_gmres - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - - ls.dB = ls.fNorm; - auto u_slice = u.slice(0) / err(0); - u.set_slice(0, u_slice); - //u(:,:,1) = u(:,:,1) / err(1) - - //Val.write(msg_prefix+"Val"); - //exit(0); - - for (int i = 0; i < ls.sD; i++) { - #ifdef debug_gmres - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " -----" << std::endl; - #endif - last_i = i; - auto u_slice = u.slice(i); - auto u_slice_1 = u.slice(i+1); - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, u_slice, u_slice_1); - //CALL FSILS_SPARMULVV(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, u(:,:,i), u(:,:,i+1)) - - //if (i+1 == 3) { - // lhs.debug_active = false; - //} - - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_ADD, dof, u_slice, u_slice_1); - u.set_slice(i+1, u_slice_1); - //CALL ADDBCMUL(lhs, BCOP_TYPE_ADD, dof, u(:,:,i), u(:,:,i+1)) - - //u.write(msg_prefix+"u"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - ls.itr = ls.itr + 1; - - //if (ANY(lhs.face.coupledFlag)) { - for (auto& face : lhs.face) { - if (face.coupledFlag) { - auto u_slice_1 = u.slice(i+1); - auto unCondU = u.slice(i+1); - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_PRE, dof, unCondU, u_slice_1); - u.set_slice(i+1, u_slice_1); - //unCondU = u(:,:,i+1) - //CALL ADDBCMUL(lhs,BCOP_TYPE_PRE,dof, unCondU, u(:,:,i+1)) - break; - } - } - - if (i+1 == 1 && lhs.debug_active) { - //u.write(msg_prefix+"u"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - } - - // [TODO:DaveP] careful here, should j <= i+1 ? - for (int j = 0; j <= i+1; j++) { - //DO j=1, i+1 - h(j,i) = dot::fsils_nc_dot_v(dof, mynNo, u.slice(j), u.slice(i+1)); - //h(j,i) = FSILS_NCDOTV(dof, mynno, u(:,:,j), u(:,:,i+1)) - //std::cout << msg_prefix << "1: h(" << j+1 << "," << i+1 << "): " << h(j,i) << std::endl; - } - - auto h_col = h.col(i); - bcast::fsils_bcast_v(i+2, h_col, lhs.commu); - //bcast::fsils_bcast_v(i+1, h_col, lhs.commu); - h.set_col(i, h_col); - //CALL FSILS_BCASTV(i+1, h(:,i), lhs.commu) - //h.write(msg_prefix+"h"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - // [TODO:DaveP] careful here, should j <= i ? - for (int j = 0; j <= i; j++) { - auto u_slice_1 = u.slice(i+1); - omp_la::omp_sum_v(dof, nNo, -h(j,i), u_slice_1, u.slice(j)); - u.set_slice(i+1, u_slice_1); - //CALL OMPSUMV(dof, nNo, -h(j,i), u(:,:,i+1), u(:,:,j)) - h(i+1,i) = h(i+1,i) - h(j,i)*h(j,i); - //std::cout << msg_prefix << "h(" << i+2 << "," << i+1 << "): " << h(i+1,i) << std::endl; - } - - h(i+1,i) = sqrt(fabs(h(i+1,i))); - //std::cout << msg_prefix << "h(" << i+2 << "," << i+1 << "): " << h(i+1,i) << std::endl; - - u_slice_1 = u.slice(i+1); - omp_la::omp_mul_v(dof, nNo, 1.0/h(i+1,i), u_slice_1); - u.set_slice(i+1, u_slice_1); - //CALL OMPMULV(dof, nNo, 1.0/h(i+1,i), u(:,:,i+1)) - - // [TODO:DaveP] careful here, should j <= i-1 ? - for (int j = 0; j <= i-1; j++) { - //DO j=1, i-1 - double tmp = c(j)*h(j,i) + s(j)*h(j+1,i); - h(j+1,i) = -s(j)*h(j,i) + c(j)*h(j+1,i); - h(j,i) = tmp; - //std::cout << msg_prefix << "### h(j,i): " << h(j,i) << std::endl; - } - - //std::cout << msg_prefix << "h(i,i): " << h(i,i) << std::endl; - //std::cout << msg_prefix << "h(i+1,i): " << h(i+1,i) << std::endl; - - double tmp = sqrt(h(i,i)*h(i,i) + h(i+1,i)*h(i+1,i)); - c(i) = h(i,i) / tmp; - s(i) = h(i+1,i) / tmp; - h(i,i) = tmp; - h(i+1,i) = 0.0; - err(i+1) = -s(i)*err(i); - err(i) = c(i)*err(i); - #ifdef debug_gmres - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "tmp: " << tmp << std::endl; - std::cout << msg_prefix << "err(i): " << err(i) << std::endl; - std::cout << msg_prefix << "err(i+1): " << err(i+1) << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - - //u.write(msg_prefix+"u"); - //h.write(msg_prefix+"h"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - if (fabs(err(i+1)) < eps) { - ls.suc = true; - break; - } - } // for int i = 0; i < ls.sD - #ifdef debug_gmres - std::cout << msg_prefix << "End of i loop" << std::endl; - #endif - - - //h.write(msg_prefix+"h"); - //exit(0); - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "last_i: " << last_i << std::endl; - - // [TODO:DaveP] careful here, last_i is used to index arrays. - // - if (last_i >= ls.sD) { - last_i = ls.sD - 1; - } - - for (int i = 0; i <= last_i; i++) { - y(i) = err(i); - } - //y = err(1:i) - - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "y: " << std::endl; - for (int j = last_i; j >= 0; j--) { - for (int k = j+1; k <= last_i; k++) { - y(j) = y(j) - h(j,k)*y(k); - } - y(j) = y(j) / h(j,j); - //std::cout << msg_prefix << j+1 << " " << y(j) << std::endl; - } - - for (int j = 0; j <= last_i; j++) { - omp_la::omp_sum_v(dof, nNo, y(j), X, u.slice(j)); - //CALL OMPSUMV(dof, nNo, y(j), X, u(:,:,j)) - } - - ls.fNorm = fabs(err(last_i+1)); - if (ls.suc) { - break; - } - - } // for l = 0; l < ls.mItr - #ifdef debug_gmres - std::cout << msg_prefix << "End of l loop" << std::endl; - #endif - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - ls.callD = fsi_linear_solver::fsils_cpu_t() - time + ls.callD; - ls.dB = 10.0 * log(ls.fNorm / ls.dB); - - #ifdef debug_gmres - std::cout << msg_prefix << "Done" << std::endl; - #endif -} - -//--------- -// gmres_s -//--------- -// Reproduces the Fortran 'GMRESS' subroutine. -// -void gmres_s(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Vector& Val, Vector& R) -{ - #define n_debug_gmres_s - #ifdef debug_gmres_s - int tid = lhs.commu.task; - auto msg_prefix = std::string("[gmres_s:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== gmres_s ==========" << std::endl; - #endif - - using namespace fsi_linear_solver; - - bool flag = false; - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - #ifdef debug_gmres_s - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "ls.sD: " << ls.sD << std::endl; - std::cout << msg_prefix << "ls.mItr: " << ls.mItr << std::endl; - std::cout << msg_prefix << "ls.absTol: " << ls.absTol << std::endl; - std::cout << msg_prefix << "ls.relTol: " << ls.relTol << std::endl; - #endif - - Array h(ls.sD+1,ls.sD); - Array u(nNo,ls.sD+1); - Vector X(nNo), y(ls.sD), c(ls.sD), s(ls.sD), err(ls.sD+1); - - ls.callD = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - double eps = norm::fsi_ls_norms(mynNo, lhs.commu, R); - ls.iNorm = eps; - ls.fNorm = eps; - eps = std::max(ls.absTol, ls.relTol*eps); - ls.itr = 0; - int last_i = 0; - #ifdef debug_gmres_s - std::cout << msg_prefix << "ls.iNorm: " << ls.iNorm << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - - if (ls.iNorm <= ls.absTol) { - ls.callD = std::numeric_limits::epsilon(); - ls.dB = 0.0; - return; - } - - //Vector::write_disabled = false; - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - - for (int l = 0; l < ls.mItr; l++) { - #ifdef debug_gmres_s - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "======== l " << l+1 << " ======== " << std::endl; - #endif - ls.dB = ls.fNorm; - ls.itr = ls.itr + 1; - auto u_col = u.col(0); - spar_mul::fsils_spar_mul_ss(lhs, lhs.rowPtr, lhs.colPtr, Val, X, u_col); - //CALL FSILS_SPARMULSS(lhs, lhs%rowPtr, lhs%colPtr, Val,X,u(:,1)) - - u.set_col(0, R - u_col); - //u(:,:,1) = R - u(:,:,1) - - err[0] = norm::fsi_ls_norms(mynNo, lhs.commu, u.col(0)); - u_col = u.col(0) / err[0]; - u.set_col(0, u_col); - //u(:,:,1) = u(:,:,1)/err(1) - #ifdef debug_gmres_s - std::cout << msg_prefix << "err(1): " << err[0] << std::endl; - #endif - - - for (int i = 0; i < ls.sD; i++) { - #ifdef debug_gmres_s - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " ----- " << std::endl; - #endif - ls.itr = ls.itr + 1; - last_i = i; - auto u_col = u.col(i); - auto u_col_1 = u.col(i+1); - spar_mul::fsils_spar_mul_ss(lhs, lhs.rowPtr, lhs.colPtr, Val, u_col, u_col_1); - //CALL FSILS_SPARMULSS(lhs, lhs%rowPtr, lhs%colPtr, Val, u(:,i), u(:,i+1)) - u.set_col(i+1, u_col_1); - - for (int j = 0; j <= i+1; j++) { - h(j,i) = dot::fsils_nc_dot_s(mynNo, u.col(j), u.col(i+1)); - //std::cout << msg_prefix << "h(j,i): " << h(j,i) << std::endl; - } - -#if 0 - if (i+1 == 10) { - Array::write_disabled = false; - u.write(msg_prefix+"u"); - MPI_Barrier(lhs.commu.comm); - exit(0); - } -#endif - - auto h_col = h.col(i); - bcast::fsils_bcast_v(i+2, h_col, lhs.commu); - //CALL FSILS_BCASTV(i+1, h(:,i), lhs.commu) - h.set_col(i, h_col); - - for (int j = 0; j <= i; j++) { - auto u_col_1 = u.col(i+1); - omp_la::omp_sum_s(nNo, -h(j,i), u_col_1, u.col(j)); - u.set_col(i+1, u_col_1); - h(i+1,i) = h(i+1,i) - h(j,i)*h(j,i); - } - h(i+1,i) = sqrt(fabs(h(i+1,i))); - - u_col_1 = u.col(i+1); - omp_la::omp_mul_s(nNo, 1.0/h(i+1,i), u_col_1); - u.set_col(i+1, u_col_1); - //CALL OMPMULV(dof, nNo, 1._LSRP/h(i+1,i), u(:,:,i+1)) - - for (int j = 0; j <= i-1; j++) { - double tmp = c(j)*h(j,i) + s(j)*h(j+1,i); - h(j+1,i) = -s(j)*h(j,i) + c(j)*h(j+1,i); - h(j,i) = tmp; - } - - double tmp = sqrt(h(i,i)*h(i,i) + h(i+1,i)*h(i+1,i)); - c(i) = h(i,i) / tmp; - s(i) = h(i+1,i) / tmp; - h(i,i) = tmp; - h(i+1,i) = 0.0; - err(i+1) = -s(i)*err(i); - err(i) = c(i)*err(i); - #ifdef debug_gmres_s - std::cout << msg_prefix << "err(i+1): " << err(i+1) << std::endl; - std::cout << msg_prefix << "tmp: " << tmp << std::endl; - #endif - - if (fabs(err(i+1)) < eps) { - ls.suc = true; - break; - } - } // for int i = 0; i < ls.sD - - if (last_i >= ls.sD) { - last_i = ls.sD - 1; - } - - for (int i = 0; i <= last_i; i++) { - y(i) = err(i); - } - //y = err(1:i) - - for (int j = last_i; j >= 0; j--) { - for (int k = j+1; k <= last_i; k++) { - y(j) = y(j) - h(j,k)*y(k); - } - y(j) = y(j) / h(j,j); - //std::cout << msg_prefix << j+1 << " " << y(j) << std::endl; - } - - for (int j = 0; j <= last_i; j++) { - omp_la::omp_sum_s(nNo, y(j), X, u.col(j)); - } - - ls.fNorm = fabs(err(last_i+1)); - if (ls.suc) { - break; - } - } - - R = X; - ls.callD = fsi_linear_solver::fsils_cpu_t() - ls.callD; - ls.dB = 10.0 * log(ls.fNorm / ls.dB); - - //exit(0); -} - -//--------- -// gmres_v -//--------- -// Reproduces the Fortran 'GMRESV' subroutine. -// -void gmres_v(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& Val, Array& R) -{ - #define n_debug_gmres_v - int tid = lhs.commu.task; - auto msg_prefix = std::string("[gmres_v:") + std::to_string(tid) + "] "; - #ifdef debug_gmres_v - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== gmres_v ==========" << std::endl; - #endif - double time = fsi_linear_solver::fsils_cpu_t(); - - using namespace fsi_linear_solver; - - bool flag = false; - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - #ifdef debug_gmres_v - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "ls.sD: " << ls.sD << std::endl; - std::cout << msg_prefix << "ls.mItr: " << ls.mItr << std::endl; - std::cout << msg_prefix << "ls.absTol: " << ls.absTol << std::endl; - std::cout << msg_prefix << "ls.relTol: " << ls.relTol << std::endl; - //Array::write_disabled = false; - R.write(msg_prefix+"R"); - Val.write(msg_prefix+"Val"); - //exit(0); - #endif - - Array h(ls.sD+1,ls.sD), X(dof,nNo); - Array3 u(dof,nNo,ls.sD+1); - Array unCondU(dof,nNo); - Vector y(ls.sD), c(ls.sD), s(ls.sD), err(ls.sD+1); - - ls.callD = fsi_linear_solver::fsils_cpu_t(); - ls.suc = false; - double eps = norm::fsi_ls_normv(dof, mynNo, lhs.commu, R); - ls.iNorm = eps; - ls.fNorm = eps; - eps = std::max(ls.absTol, ls.relTol*eps); - ls.itr = 0; - int last_i = 0; - #ifdef debug_gmres_v - std::cout << msg_prefix << "ls.iNorm: " << ls.iNorm << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - #endif - - bc_pre(lhs, ls, dof, mynNo, nNo); - - if (ls.iNorm <= ls.absTol) { - ls.callD = std::numeric_limits::epsilon(); - ls.dB = 0.0; - return; - } - - for (int l = 0; l < ls.mItr; l++) { - //std::cout << msg_prefix << "[GMRES] ===== l " << l+1 << " ===== " << std::endl; - #ifdef debug_gmres_v - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "===== l " << l+1 << " ===== " << std::endl; - #endif - ls.dB = ls.fNorm; - ls.itr = ls.itr + 1; - auto u_slice = u.slice(0); - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, X, u_slice); - //CALL FSILS_SPARMULVV(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, X, u(:,:,1)) - - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_ADD, dof, X, u_slice); - //CALL ADDBCMUL(lhs, BCOP_TYPE_ADD, dof, X, u(:,:,1)) - - u.set_slice(0, R - u_slice); - //u(:,:,1) = R - u(:,:,1) - - for (auto& face : lhs.face) { - //if (ANY(lhs.face.coupledFlag)) { - if (face.coupledFlag && flag) { - auto u_slice = u.slice(0); - auto unCondU = u.slice(0); - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_PRE, dof, unCondU, u_slice); - u.set_slice(0, u_slice); - std::cout << msg_prefix << "face.coupledFlag " << std::endl; - break; - } - } - - err[0] = norm::fsi_ls_normv(dof, mynNo, lhs.commu, u.slice(0)); - u_slice = u.slice(0) / err[0]; - u.set_slice(0, u_slice); - //u(:,:,1) = u(:,:,1)/err(1) - #ifdef debug_gmres_v - std::cout << msg_prefix << "err(1): " << err[0] << std::endl; - #endif - - for (int i = 0; i < ls.sD; i++) { - #ifdef debug_gmres_v - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "----- i " << i+1 << " ----- " << std::endl; - #endif - ls.itr = ls.itr + 1; - last_i = i; - auto u_slice = u.slice(i); - auto u_slice_1 = u.slice(i+1); - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, u_slice, u_slice_1); - //CALL FSILS_SPARMULVV(lhs, lhs.rowPtr, lhs.colPtr, dof, Val, u(:,:,i), u(:,:,i+1)) - - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_ADD, dof, u_slice, u_slice_1); - u.set_slice(i+1, u_slice_1); - //CALL ADDBCMUL(lhs, BCOP_TYPE_ADD, dof, u(:,:,i), u(:,:,i+1)) - - for (auto& face : lhs.face) { - if (face.coupledFlag && flag) { - auto u_slice_1 = u.slice(i+1); - auto unCondU = u.slice(i+1); - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_PRE, dof, unCondU, u_slice_1); - u.set_slice(i+1, u_slice_1); - //unCondU = u(:,:,i+1) - //CALL ADDBCMUL(lhs,BCOP_TYPE_PRE,dof, unCondU, u(:,:,i+1)) - //std::cout << msg_prefix << "face.coupledFlag " << std::endl; - break; - } - } - //if (ANY(lhs.face.coupledFlag).AND.flag) { - // unCondU = u(:,:,i+1) - // CALL ADDBCMUL(lhs,BCOP_TYPE_PRE,dof, unCondU, u(:,:,i+1)) - //} - - for (int j = 0; j <= i+1; j++) { - h(j,i) = dot::fsils_nc_dot_v(dof, mynNo, u.slice(j), u.slice(i+1)); - //h(j,i) = FSILS_NCDOTV(dof, mynno, u(:,:,j), u(:,:,i+1)) - #ifdef debug_gmres_v - std::cout << msg_prefix << "h(j,i): " << h(j,i) << std::endl; - #endif - } - - auto h_col = h.col(i); - bcast::fsils_bcast_v(i+2, h_col, lhs.commu); - //CALL FSILS_BCASTV(i+1, h(:,i), lhs.commu) - h.set_col(i, h_col); - - for (int j = 0; j <= i; j++) { - auto u_slice_1 = u.slice(i+1); - omp_la::omp_sum_v(dof, nNo, -h(j,i), u_slice_1, u.slice(j)); - u.set_slice(i+1, u_slice_1); - //CALL OMPSUMV(dof, nNo, -h(j,i), u(:,:,i+1), u(:,:,j)) - h(i+1,i) = h(i+1,i) - h(j,i)*h(j,i); - //std::cout << msg_prefix << "h(" << i+2 << "," << i+1 << "): " << h(i+1,i) << std::endl; - } - h(i+1,i) = sqrt(fabs(h(i+1,i))); - - u_slice_1 = u.slice(i+1); - omp_la::omp_mul_v(dof, nNo, 1.0/h(i+1,i), u_slice_1); - u.set_slice(i+1, u_slice_1); - //CALL OMPMULV(dof, nNo, 1._LSRP/h(i+1,i), u(:,:,i+1)) - - for (int j = 0; j <= i-1; j++) { - double tmp = c(j)*h(j,i) + s(j)*h(j+1,i); - h(j+1,i) = -s(j)*h(j,i) + c(j)*h(j+1,i); - h(j,i) = tmp; - } - - double tmp = sqrt(h(i,i)*h(i,i) + h(i+1,i)*h(i+1,i)); - c(i) = h(i,i) / tmp; - s(i) = h(i+1,i) / tmp; - h(i,i) = tmp; - h(i+1,i) = 0.0; - err(i+1) = -s(i)*err(i); - err(i) = c(i)*err(i); - #ifdef debug_gmres_v - std::cout << msg_prefix << "err(i+1): " << err(i+1) << std::endl; - std::cout << msg_prefix << "tmp: " << tmp << std::endl; - #endif - - if (fabs(err(i+1)) < eps) { - ls.suc = true; - break; - } - } // for int i = 0; i < ls.sD - - if (last_i >= ls.sD) { - last_i = ls.sD - 1; - } - - for (int i = 0; i <= last_i; i++) { - y(i) = err(i); - } - //y = err(1:i) - - for (int j = last_i; j >= 0; j--) { - for (int k = j+1; k <= last_i; k++) { - y(j) = y(j) - h(j,k)*y(k); - } - y(j) = y(j) / h(j,j); - //std::cout << msg_prefix << j+1 << " " << y(j) << std::endl; - } - - for (int j = 0; j <= last_i; j++) { - omp_la::omp_sum_v(dof, nNo, y(j), X, u.slice(j)); - //CALL OMPSUMV(dof, nNo, y(j), X, u(:,:,j)) - } - - ls.fNorm = fabs(err(last_i+1)); - if (ls.suc) { - break; - } - } - - R = X; - ls.callD = fsi_linear_solver::fsils_cpu_t() - ls.callD; - ls.dB = 10.0 * log(ls.fNorm / ls.dB); - - #ifdef debug_gmres_v - double exec_time = fsi_linear_solver::fsils_cpu_t() - time; - std::cout << msg_prefix << "Execution time: " << exec_time << std::endl; - std::cout << msg_prefix << "Done" << std::endl; - #endif - double exec_time = fsi_linear_solver::fsils_cpu_t() - time; - std::cout << msg_prefix << "Execution time: " << exec_time << std::endl; - std::cout << msg_prefix << "Done" << std::endl; - - //Array::write_disabled = false; - //R.write(msg_prefix+"R"); - //exit(0); -} - - -}; - - diff --git a/Code/Source/svFSILS/back/gmres.h b/Code/Source/svFSILS/back/gmres.h deleted file mode 100644 index bb35190c4..000000000 --- a/Code/Source/svFSILS/back/gmres.h +++ /dev/null @@ -1,15 +0,0 @@ - -#include "fils_struct.hpp" - -namespace gmres { - -void gmres(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& Val, const Array& R, Array& X); - -void gmres_s(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Vector& Val, Vector& R); - -void gmres_v(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& Val, Array& R); - -}; diff --git a/Code/Source/svFSILS/back/in_commu.cpp b/Code/Source/svFSILS/back/in_commu.cpp deleted file mode 100644 index b98abee42..000000000 --- a/Code/Source/svFSILS/back/in_commu.cpp +++ /dev/null @@ -1,300 +0,0 @@ - -// The functions here reproduce the subroutines defined in svFSILS/INCOMMU.f. - -// To syncronize the data on the boundaries between the processors. -// -// This a both way communication with three main part: -// 1 - rTmp {in master} = R {from slave} -// 2 - R {in master} = R + rTmp {both from master} -// 3 - rTmp {in master} = R {from master} -// 4 - R {in slave} = rTmp {from master} - -#include "fsils.hpp" -#include "CmMod.h" -#include "Array3.h" - -#include "fsils_std.h" - -namespace fsi_linear_solver { - -//-------------- -// fsils_commus -//-------------- -// -void fsils_commus(const FSILS_lhsType& lhs, Vector& R) -{ - if (lhs.commu.nTasks == 1) { - return; - } - - #define n_debug_fsils_commus - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_commus:") + std::to_string(tid) + "] "; - #ifdef debug_fsils_commus - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== fsils_commus ==========" << std::endl; - std::cout << msg_prefix << "lhs.cS.size(): " << lhs.cS.size() << std::endl; - #endif - - // [TODO:DaveP] nReq can be 0 so lhs.cS.size() = 0, just return. - // - int nReq = lhs.nReq; - if (lhs.cS.size() == 0) { - return; - } - - int nmax = std::max_element(lhs.cS.begin(), lhs.cS.end(), - [](const FSILS_cSType& a, const FSILS_cSType& b){return a.n < b.n;})->n; - //i = MAXVAL(lhs.cS.n) - - Array sB(nmax,nReq); - Array rB(nmax,nReq); - std::vector rReq(nReq); - std::vector sReq(nReq); - //ALLOCATE(sB(i,nReq), rB(i,nReq), rReq(nReq), sReq(nReq)) - #ifdef debug_fsils_commus - std::cout << msg_prefix << "nReq: " << nReq << std::endl; - std::cout << msg_prefix << "i: " << nmax << std::endl; - #endif - - for (int i = 0; i < nReq; i++) { - for (int j = 0; j < lhs.cS[i].n; j++) { - int k = lhs.cS[i].ptr(j); - //sB(j,i) = j+1; - sB(j,i) = R(k); - //std::cout << msg_prefix << "i,j,k: " << i+1 << " " << j+1 << " " << k+1 << std::endl; - //std::cout << "[fsils_commus] sB(j,i): " << j+1 << " " << i+1 << std::endl; - } - } - - //sB.set_debug(true, "sB " + msg_prefix); - - // [TODO:DaveP] possible problems here. - // - int mpi_tag = 1; - - for (int i = 0; i < nReq; i++) { - #ifdef debug_fsils_commus - std::cout << msg_prefix << ">>> i: " << i << std::endl; - std::cout << msg_prefix << "lhs.cS[i].n: " << lhs.cS[i].n << std::endl; - std::cout << msg_prefix << "Data to recv/send lhs.cS[i].n: " << lhs.cS[i].n << std::endl; - std::cout << msg_prefix << "Recv rB from lhs.cS[i].iP: " << lhs.cS[i].iP << std::endl; - #endif - auto rec_err = MPI_Irecv(rB.col_data(i), lhs.cS[i].n, mpreal, lhs.cS[i].iP, mpi_tag, lhs.commu.comm, &rReq[i]); - //CALL MPI_IRECV(rB(:,i), lhs%cS(i)%n, mpreal, lhs%cS(i)%iP-1, 1, lhs%commu%comm, rReq(i), ierr) - - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Send sB to lhs.cS[i].iP: " << lhs.cS[i].iP << std::endl; - #endif - auto send_err = MPI_Isend(sB.col_data(i), lhs.cS[i].n, mpreal, lhs.cS[i].iP, mpi_tag, lhs.commu.comm, &sReq[i]); - //CALL MPI_ISEND(sB(:,i), lhs%cS(i)%n, mpreal, lhs%cS(i)%iP-1, 1, lhs%commu%comm, sReq(i), ierr) - } - - // Wait for the MPI receive to complete. - // - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Waiting for rB receive complete ..." << std::endl; - #endif - for (int i = 0; i < nReq; i++) { - MPI_Status stat; - auto err = MPI_Wait(&rReq[i], &stat); - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Done Waiting for rB receive" << std::endl; - //std::cout << msg_prefix << "err: " << err << std::endl; - #endif - //CALL MPI_Wait(rReq(i), stat, ierr) - } - - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Set R ..." << std::endl; - #endif - for (int i = 0; i < nReq; i++) { - for (int j = 0; j < lhs.cS[i].n; j++) { - int k = lhs.cS[i].ptr(j); - R(k) = R(k) + rB(j,i); - } - } - - // Wait for the MPI send to complete. - // - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Waiting for sB send complete ..." << std::endl; - //std::cout << std::resetiosflags( std::cout.flags() ); - #endif - for (int i = 0; i < nReq; i++) { - MPI_Status stat; - auto err = MPI_Wait(&sReq[i], &stat); - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Done Waiting for sB send" << std::endl; - //std::cout << msg_prefix << "err: " << err << std::endl; - #endif - //CALL MPI_WAIT(sReq(i), stat, ierr) - } - - /* - if (lhs.debug_active) { - sB.write(msg_prefix+"sB"); - rB.write(msg_prefix+"rB"); - } - */ - - #ifdef debug_fsils_commus - rB.write(msg_prefix+"rB"); - #endif - - #ifdef debug_fsils_commus - std::cout << msg_prefix << "Done" << std::endl; - #endif -} - -//-------------- -// fsils_commuv -//-------------- -// This a both way communication with three main part: -// -// 1 - rTmp {in master} = R {from slave} -// 2 - R {in master} = R + rTmp {both from master} -// 3 - rTmp {in master} = R {from master} -// 4 - R {in slave} = rTmp {from master} -// -void fsils_commuv(const FSILS_lhsType& lhs, int dof, Array& R) -{ - if (lhs.commu.nTasks == 1) { - return; - } - - #define n_debug_fsils_commuv - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_commuv:") + std::to_string(tid) + "] "; - #ifdef debug_fsils_commuv - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== fsils_commuv ==========" << std::endl; - #endif - - // [TODO:DaveP] nReq can be 0 so lhs.cS.size() = 0, just return. - if (lhs.cS.size() == 0) { - return; - } - - int nReq = lhs.nReq; - int nmax = std::max_element(lhs.cS.begin(), lhs.cS.end(), - [](const FSILS_cSType& a, const FSILS_cSType& b){return a.n < b.n;})->n; - //i = MAXVAL(lhs.cS.n) - - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nReq: " << nReq << std::endl; - std::cout << msg_prefix << "nmax: " << nmax << std::endl; - #endif - - Array3 sB(dof,nmax,nReq); - Array3 rB(dof,nmax,nReq); - std::vector rReq(nReq); - std::vector sReq(nReq); - - int n = 1; - - for (int i = 0; i < nReq; i++) { - for (int j = 0; j < lhs.cS[i].n; j++) { - int k = lhs.cS[i].ptr(j); - //std::cout << msg_prefix << "j: " << j+1 << " " << k+1 << std::endl; - for (int l = 0; l < dof; l++) { - //sB(l,j,i) = n++; - sB(l,j,i) = R(l,k); - } - // sB(:,j,i) = R(:,k) - } - } - - //int tid = lhs.commu.task; - //auto msg_prefix = std::string("[fsils_commuv:") + std::to_string(tid) + "] "; - //sB.set_debug(true, "sB " + msg_prefix); - - // [TODO:DaveP] possible problems here. - // - int mpi_tag = 1; - //int mpi_tag = 2; - - for (int i = 0; i < nReq; i++) { - #ifdef debug_fsils_commuv - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "lhs.cS[i].n: " << lhs.cS[i].n << std::endl; - std::cout << msg_prefix << "Data to recv/send lhs.cS[i].n*dof: " << lhs.cS[i].n*dof << std::endl; - std::cout << msg_prefix << "Receive rB slice from lhs.cS[i].iP: " << lhs.cS[i].iP << std::endl; - #endif - - auto rec_err = MPI_Irecv(rB.slice_data(i), lhs.cS[i].n*dof, mpreal, lhs.cS[i].iP, mpi_tag, lhs.commu.comm, &rReq[i]); - //CALL MPI_IRECV(rB(:,:,i), lhs%cS(i)%n*dof, mpreal, lhs%cS(i)%iP-1, 1, lhs%commu%comm, rReq(i), ierr) - - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Send sB slice to lhs.cS[i].iP: " << lhs.cS[i].iP << std::endl; - #endif - - auto send_err = MPI_Isend(sB.slice_data(i), lhs.cS[i].n*dof, mpreal, lhs.cS[i].iP, mpi_tag, lhs.commu.comm, &sReq[i]); - //CALL MPI_ISEND(sB(:,:,i), lhs%cS(i)%n*dof, mpreal, lhs%cS(i)%iP-1, 1, lhs%commu%comm, sReq(i), ierr) - } - - // Wait for the MPI receive to complete. - // - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Waiting for rB receive complete ..." << std::endl; - #endif - for (int i = 0; i < nReq; i++) { - MPI_Status stat; - auto err = MPI_Wait(&rReq[i], &stat); - //std::cout << msg_prefix << "err: " << err << std::endl; - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Done Waiting for rB receive" << std::endl; - #endif - //CALL MPI_Wait(rReq(i), stat, ierr) - } - - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Set R ..." << std::endl; - #endif - for (int i = 0; i < nReq; i++) { - for (int j = 0; j < lhs.cS[i].n; j++) { - int k = lhs.cS[i].ptr(j); - for (int l = 0; l < dof; l++) { - R(l,k) = R(l,k) + rB(l,j,i); - } - // R(:,k) = R(:,k) + rB(:,j,i) - } - } - - // Wait for the MPI send to complete. - // - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Waiting for sB send complete ..." << std::endl; - #endif - for (int i = 0; i < nReq; i++) { - MPI_Status stat; - auto err = MPI_Wait(&sReq[i], &stat); - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Done Waiting for sB send" << std::endl; - //std::cout << msg_prefix << "err: " << err << std::endl; - #endif - //CALL MPI_Wait(sReq(i), stat, ierr) - } - - #ifdef debug_fsils_commuv - if (lhs.debug_active) { - sB.write(msg_prefix+"sB"); - rB.write(msg_prefix+"rB"); - } - #endif - - //sB.write(msg_prefix+"sB"); - //rB.write(msg_prefix+"rB"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - #ifdef debug_fsils_commuv - std::cout << msg_prefix << "Done" << std::endl; - #endif -} - - -}; - - diff --git a/Code/Source/svFSILS/back/lhs.cpp b/Code/Source/svFSILS/back/lhs.cpp deleted file mode 100644 index 1b3437507..000000000 --- a/Code/Source/svFSILS/back/lhs.cpp +++ /dev/null @@ -1,432 +0,0 @@ - -// The functions here reproduce the subroutines defined in svFSILS/LHS.f. - -#include "lhs.h" -#include "CmMod.h" - -#include "mpi.h" - -namespace fsi_linear_solver { - -//------------------ -// fsils_lhs_create -//------------------ -// -// Modifies: -// -// lhs.foC -// lhs.gnNo -// lhs.nNo -// lhs.nnz -// lhs.commu -// lhs.nFaces -// lhs.mynNo -// -// lhs.colPtr -// lhs.rowPtr -// lhs.diagPtr -// lhs.map -// lhs.face -// -void fsils_lhs_create(FSILS_lhsType& lhs, FSILS_commuType& commu, int gnNo, int nNo, int nnz, Vector& gNodes, - Vector &rowPtr, Vector& colPtr, int nFaces) -{ - #define n_debug_fsils_lhs_create - #ifdef debug_fsils_lhs_create - auto msg_prefix = std::string("[fsils_lhs_create:") + std::to_string(commu.task) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== fsils_lhs_create ==========" << std::endl; - #endif - - lhs.foC = true; - lhs.gnNo = gnNo; - lhs.nNo = nNo; - lhs.nnz = nnz; - lhs.commu = commu; - lhs.nFaces = nFaces; - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << "gnNo: " << gnNo << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "nnz: " << nnz << std::endl; - std::cout << msg_prefix << "nFaces: " << nFaces << std::endl; - #endif - - int nTasks = commu.nTasks; - auto comm = commu.comm; - auto tF = commu.tF; - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << "nTasks: " << nTasks << std::endl; - std::cout << msg_prefix << "tF: " << tF << std::endl; - #endif - //rowPtr.write(msg_prefix+"rowPtr",1); - - lhs.colPtr.resize(nnz); - lhs.rowPtr.resize(2,nNo); - lhs.diagPtr.resize(nNo); - lhs.map.resize(nNo); - - // [TODO:DaveP] lhs.face[] is indexed by faIn which seems to be 1-based - // so allocate lhs.face[] to be nFaces+1. - lhs.face.resize(nFaces); - //lhs.face.resize(nFaces+1); - // ALLOCATE (lhs%colPtr(nnz), lhs%rowPtr(2,nNo), lhs%diagPtr(nNo), lhs%map(nNo), lhs%face(nFaces)) - - // For a sequential simulation. - // - if (nTasks == 1) { - - for (int i = 0; i < nnz; i++) { - lhs.colPtr(i) = colPtr(i); - } - - for (int Ac = 0; Ac < nNo; Ac++) { - int s = rowPtr(Ac); - int e = rowPtr(Ac+1) - 1; - - for (int i = s; i <= e; i++) { - int a = colPtr(i); - if (Ac == a) { - lhs.diagPtr(Ac) = i; - break; - } - } - - lhs.rowPtr(0,Ac) = s; - lhs.rowPtr(1,Ac) = e; - lhs.map(Ac) = Ac; - } - - /* - std::cout << msg_prefix << "lhs.diagPtr: " << std::endl; - for (int i = 0; i < nNo; i++) { - std::cout << msg_prefix << i+1 << ": " << lhs.diagPtr(i) << std::endl; - } - - std::cout << msg_prefix << "lhs.rowPtr: " << std::endl; - for (int i = 0; i < nNo; i++) { - std::cout << msg_prefix << i+1 << ": " << lhs.rowPtr(0,i) << " " << lhs.rowPtr(1,i) << std::endl; - } - */ - - lhs.mynNo = nNo; - return; - } - - // Get the number of nodes for this process and the max number of - // nodes for all processes. - // - // Combines values from all processes and distributes the result back to all processes. - // - int maxnNo; - MPI_Allreduce(&nNo, &maxnNo, 1, cm_mod::mpint, MPI_MAX, comm); - - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "maxnNo: " << maxnNo << std::endl; - #endif - //ALLOCATE(aNodes(maxnNo,nTasks), part(maxnNo), sCount(nTasks), disp(nTasks), gtlPtr(gnNo), ltg(nNo)) - - // Initialize some data structures. - // - Vector part(maxnNo); - part = -1; - - for (int i = 0; i < nNo; i++) { - part(i) = gNodes(i); - } - //part = 0 - //part(1:nNo) = gNodes - - Vector sCount(nTasks); - Vector disp(nTasks); - - for (int i = 0; i < nTasks; i++) { - disp(i) = i*maxnNo; - //disp(i) = (i-1)*maxnNo - sCount(i) = maxnNo; - } - - Array aNodes(maxnNo,nTasks); - Vector ltg(nNo, "ltg"); - - // Gather data from all processes and deliver it to all. Each process may contribute a different amount of data. - MPI_Allgatherv(part.data(), maxnNo, cm_mod::mpint, aNodes.data(), sCount.data(), disp.data(), cm_mod::mpint, comm); - // CALL MPI_ALLGATHERV(part, maxnNo, mpint, aNodes, sCount, disp, mpint, comm, ierr) - - Vector gtlPtr(gnNo, "gtlPtr"); - gtlPtr = -1; - //gtlPtr = 0 - - for (int a = 0; a < nNo; a++) { - int Ac = gNodes(a); - gtlPtr(Ac) = a; - } - - // Including the nodes shared by processors with higher ID at the end, - // and including the nodes shared by lower processors IDs at the front. - // shnNo is counter for lower ID and mynNo is counter for higher ID - // - // [TODO:DaveP] lhs.mynNo indexes into an array so must be 0-based? - // - lhs.mynNo = nNo; - //lhs.mynNo = nNo - 1; - lhs.shnNo = 0; - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << "Including the nodes shared ..." << std::endl; - std::cout << msg_prefix << "lhs.mynNo: " << lhs.mynNo << std::endl; - std::cout << msg_prefix << "tF: " << tF << std::endl; - #endif - - for (int i = nTasks-1; i >= 0; i--) { - //std::cout << msg_prefix << "---- i " << i << " ----" << std::endl; - // Will include local nodes later - if (i == tF) { - continue; - } - - for (int a = 0; a < maxnNo; a++) { - //std::cout << msg_prefix << " ---- a " << a << " ----" << std::endl; - // Global node number in processor i at location a - int Ac = aNodes(a,i); - //std::cout << msg_prefix << " Ac: " << Ac << std::endl; - // Exit if this is the last node - if (Ac == -1) { - break; - } - - // Corresponding local node in current processor. - int ai = gtlPtr(Ac); - if (ai != -1) { - // If this node has not been included already - if (aNodes(ai,tF) != -1) { - // If the processor ID is lower, it is appended to the beginning - if (i < tF) { - //std::cout << msg_prefix << " beg Ac: " << Ac << std::endl; - ltg(lhs.shnNo) = Ac; - lhs.shnNo = lhs.shnNo + 1; - // If the processor ID is higher, it is appended to the end - } else { - //std::cout << msg_prefix << " end Ac: " << Ac << std::endl; - ltg(lhs.mynNo-1) = Ac; - lhs.mynNo = lhs.mynNo - 1; - } - aNodes(ai,tF) = -1; - } - } - } - } - - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Including local nodes ..." << std::endl; - std::cout << msg_prefix << "lhs.shnNo: " << lhs.shnNo << std::endl; - std::cout << msg_prefix << "lhs.mynNo: " << lhs.mynNo << std::endl; - #endif - // Now including the local nodes that are left behind - int j = lhs.shnNo + 1; - for (int a = 0; a < nNo; a++) { - int Ac = aNodes(a,tF); - //std::cout << msg_prefix << "a: " << a+1 << " Ac: " << Ac+1 << std::endl; - // If this node has not been included already - if (Ac != -1) { - ltg(j-1) = Ac; - j = j + 1; - //std::cout << msg_prefix << "j: " << j << std::endl; - } - } - - if (j != lhs.mynNo+1) { - //PRINT *, "FSILS: Unexpected behavior", j, lhs.mynNo - throw std::runtime_error("FSILS: Unexpected behavior: j=" + std::to_string(j) + " lhs.mynNo: " + std::to_string(lhs.mynNo) + "."); - MPI_Finalize(); - //STOP "FSILS: FATAL ERROR" - } - - // Having the new ltg pointer, map is constructed - // - gtlPtr = -1; - //gtlPtr = 0; - for (int a = 0; a < nNo; a++) { - int Ac = ltg(a); - gtlPtr(Ac) = a; - } - - for (int a = 0; a < nNo; a++) { - int Ac = gNodes(a); - lhs.map(a) = gtlPtr(Ac); - } - - // Based on the new ordering of the nodes, rowPtr and colPtr are constructed - // - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Construct rowPtr and colPtr ..." << std::endl; - #endif - for (int a = 0; a < nNo; a++) { - int Ac = lhs.map(a); - //std::cout << msg_prefix << a+1 << " Ac: " << Ac+1 << " " << rowPtr(a)+1 << " " << rowPtr(a+1) << std::endl; - lhs.rowPtr(0,Ac) = rowPtr(a); - lhs.rowPtr(1,Ac) = rowPtr(a+1) - 1; - } - //lhs.rowPtr.write(msg_prefix+"rowPtr",true,1); - - for (int i = 0; i < nnz; i++) { - lhs.colPtr(i) = lhs.map(colPtr(i)); - } - - // diagPtr points to the diagonal entries of LHS - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = lhs.rowPtr(0,Ac); i <= lhs.rowPtr(1,Ac); i++) { - int a = lhs.colPtr(i); - if (Ac == a) { - lhs.diagPtr(Ac) = i; - break; - } - } - } - - // Constructing the communication data structure based on the ltg - // - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Constructing the communication data ..." << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - part(i) = ltg(i); - } - // part(1:nNo) = ltg - - MPI_Allgatherv(part.data(), maxnNo, cm_mod::mpint, aNodes.data(), sCount.data(), disp.data(), cm_mod::mpint, comm); - - // This variable keeps track of number of shared nodes - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Process shared nodes ..." << std::endl; - #endif - disp = 0; - //disp = 0; - lhs.nReq = 0; - - for (int i = 0; i < nTasks; i++) { - //std::cout << msg_prefix << "----- i " << i << " -----" << std::endl; - if (i == tF) { - continue; - } - for (int a = 0; a < maxnNo; a++) { - // Global node number in processor i at location a - int Ac = aNodes(a,i); - // Exit if this is the last node - if (Ac == -1) { - break; - } - // Corresponding local node in current processor - int ai = gtlPtr(Ac); - if (ai != -1) { - disp(i) = disp(i) + 1; - } - } - - if (disp(i) != 0) { - lhs.nReq = lhs.nReq + 1; - } - } - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << "lhs.nReq: " << lhs.nReq << std::endl; - #endif - - lhs.cS.resize(lhs.nReq); - //ALLOCATE(lhs.cS(lhs.nReq)) - - // Now that we know which processor is communicating to which, we can - // setup the handles and structures - // - // lhs.cS[j].iP is the processor to communicate with. - // - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Setup the handles ..." << std::endl; - #endif - j = 0; - for (int i = 0; i < nTasks; i++) { - int a = disp(i); - if (a != 0) { - lhs.cS[j].iP = i; - lhs.cS[j].n = a; - //std::cout << msg_prefix << "j: " << j << std::endl; - //std::cout << msg_prefix << "a: " << a << std::endl; - //std::cout << msg_prefix << "lhs.cS[j].iP: " << lhs.cS[j].iP << std::endl; - //std::cout << msg_prefix << "lhs.cS[j].n: " << lhs.cS[j].n << std::endl; - lhs.cS[j].ptr.resize(a); - j = j + 1; - //ALLOCATE(lhs.cS(j).ptr(a)) - } - } - - // Order of nodes in ptr is based on the node order in processor - // with higher ID. ptr is calculated for tF+1:nTasks and will be - // sent over. - // - #ifdef debug_fsils_lhs_create - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Order of nodes ..." << std::endl; - #endif - MPI_Status status; - - for (int i = 0; i < lhs.nReq; i++) { - int iP = lhs.cS[i].iP; - - if (iP < tF) { - //std::cout << msg_prefix << "MPI_Recv from iP: " << iP << std::endl; - //std::cout << msg_prefix << "lhs.cS[i].n: " << lhs.cS[i].n << std::endl; - MPI_Recv(lhs.cS[i].ptr.data(), lhs.cS[i].n, cm_mod::mpint, iP, 1, comm, &status); - // MPI_Recv(lhs.cS[i].ptr, lhs.cS[i].n, cm_mod::mpint, iP-1, 1, comm); - - for (int j = 0; j < lhs.cS[i].n; j++) { - lhs.cS[i].ptr[j] = gtlPtr(lhs.cS[i].ptr[j]); - } - } else { - // This is a counter for the shared nodes - j = 0; - for (int a = 0; a < maxnNo; a++) { - // Global node number in processor i at location a - int Ac = aNodes(a,iP); - // Exit if this is the last node - if (Ac == -1) { - break; - } - // Corresponding local node in current processor - int ai = gtlPtr(Ac); - if (ai != -1) { - // Just for now global node ID is used. Later on this will be changed - // to make sure nodes corresponds to each other on both processors - // and then will be transformed to local node IDs - lhs.cS[i].ptr[j] = Ac; - j = j + 1; - } - } - - //std::cout << msg_prefix << "MPI_Send to iP: " << iP << std::endl; - //std::cout << msg_prefix << "lhs.cS[i].n: " << lhs.cS[i].n << std::endl; - MPI_Send(lhs.cS[i].ptr.data(), lhs.cS[i].n, cm_mod::mpint, iP, 1, comm); - //MPI_Send(lhs.cS[i].ptr, lhs.cS[i].n, cm_mod::mpint, iP-1, 1, comm); - - for (int j = 0; j < lhs.cS[i].n; j++) { - lhs.cS[i].ptr[j] = gtlPtr(lhs.cS[i].ptr[j]); - } - } - } - - /* - for (int i = 0; i < lhs.nReq; i++) { - lhs.cS[i].ptr.write(msg_prefix+"cs_ptr_"+std::to_string(i+1),1); - } - */ - - //std::cout << msg_prefix << "Done" << std::endl; -} - - -}; - - diff --git a/Code/Source/svFSILS/back/lhs.h b/Code/Source/svFSILS/back/lhs.h deleted file mode 100644 index 9ddaeb1e5..000000000 --- a/Code/Source/svFSILS/back/lhs.h +++ /dev/null @@ -1,19 +0,0 @@ - -#include "fsils.hpp" -#include "CmMod.h" - -#include "Vector.h" - -#ifndef FSI_LINEAR_SOLVER_LHS_H -#define FSI_LINEAR_SOLVER_LHS_H - -namespace fsi_linear_solver { - -void fsils_lhs_create(FSILS_lhsType& lhs, FSILS_commuType& commu, int gnNo, int nNo, int nnz, Vector& gNodes, - Vector&rowPtr, Vector&colPtr, int nFaces); - -}; - -#endif - - diff --git a/Code/Source/svFSILS/back/ls.cpp b/Code/Source/svFSILS/back/ls.cpp deleted file mode 100644 index f4c728800..000000000 --- a/Code/Source/svFSILS/back/ls.cpp +++ /dev/null @@ -1,111 +0,0 @@ - -#include "fsils_api.hpp" -#include "fils_struct.hpp" - -namespace fsi_linear_solver { - -//----------------- -// fsils_ls_create -//----------------- -// Set solver parameters. -// -// Reproduces 'SUBROUTINE FSILS_LS_CREATE(ls, LS_type, relTol, absTol, maxItr, dimKry, relTolIn, absTolIn, maxItrIn)'. -// -void fsils_ls_create(FSILS_lsType& ls, LinearSolverType LS_type, double relTol, double absTol, int maxItr, int dimKry, - std::array relTolIn, std::array absTolIn, std::array maxItrIn) -{ - std::cout << "[fsils_ls_create] " << std::endl; - std::cout << "[fsils_ls_create] =========== fsils_ls_create ==========" << std::endl; - - using namespace consts; - ls.foC = true; - ls.LS_type = LS_type; - - // Set default parameters for each solver type. - // - switch (LS_type) { - - case LinearSolverType::LS_TYPE_NS: - std::cout << "[fsils_ls_create] LS_type: LS_TYPE_NS" << std::endl; - ls.RI.relTol = 0.4; - ls.GM.relTol = 1.E-2; - ls.CG.relTol = 0.2; - ls.RI.mItr = 10; - ls.GM.mItr = 2; - ls.CG.mItr = 500; - ls.GM.sD = 100; - ls.RI.sD = 100; - break; - - case LinearSolverType::LS_TYPE_GMRES: - std::cout << "[fsils_ls_create] LS_type: LS_TYPE_GMRES " << std::endl; - ls.RI.relTol = 0.1; - ls.RI.mItr = 4; - ls.RI.sD = 250; - break; - - case LinearSolverType::LS_TYPE_CG: - std::cout << "[fsils_ls_create] LS_type: LS_TYPE_CG " << std::endl; - ls.RI.relTol = 1.E-2; - ls.RI.mItr = 1000; - break; - - case LinearSolverType::LS_TYPE_BICGS: - std::cout << "[fsils_ls_create] LS_type: LS_TYPE_BICGS " << std::endl; - ls.RI.relTol = 1.E-2; - ls.RI.mItr = 500; - break; - - default: - break; - } - - ls.RI.absTol = 1.E-10; - ls.GM.absTol = 1.E-10; - ls.CG.absTol = 1.E-10; - - // Set values optionally passed in. - // - if (present(relTol)) { - std::cout << "[fsils_ls_create] Set ls.RI.relTol " << std::endl; - ls.RI.relTol = relTol; - } - - if (present(absTol)) { - std::cout << "[fsils_ls_create] Set ls.RI.absTol " << std::endl; - ls.RI.absTol = absTol; - } - - if (present(maxItr)) { - ls.RI.mItr = maxItr; - } - - if (present(dimKry)) { - ls.RI.sD = dimKry; - ls.GM.sD = dimKry; - std::cout << "[fsils_ls_create] Set ls.RI.sD: " << ls.RI.sD << std::endl; - std::cout << "[fsils_ls_create] Set ls.GM.sD: " << ls.GM.sD << std::endl; - } - - if (relTolIn.empty() != 0) { - ls.GM.relTol = relTolIn[0]; - ls.CG.relTol = relTolIn[1]; - } - - if (absTolIn.empty() != 0) { - ls.GM.absTol = absTolIn[0]; - ls.CG.absTol = absTolIn[1]; - std::cout << "[fsils_ls_create] Set ls.GM.absTol: " << ls.GM.absTol << std::endl; - } - - if (maxItrIn.empty() != 0) { - ls.GM.mItr = maxItrIn[0]; - ls.CG.mItr = maxItrIn[1]; - } - - std::cout << "[fsils_ls_create] Set ls.RI.absTol: " << ls.RI.absTol << std::endl; - std::cout << "[fsils_ls_create] Set ls.GM.absTol: " << ls.GM.absTol << std::endl; -} - -}; - diff --git a/Code/Source/svFSILS/back/norm.cpp b/Code/Source/svFSILS/back/norm.cpp deleted file mode 100644 index daaa9d3ca..000000000 --- a/Code/Source/svFSILS/back/norm.cpp +++ /dev/null @@ -1,112 +0,0 @@ - -// For calculating the norm of a scaler or vector based vector. -// -// -// Only the part of U which is owned by this processor is included in -// norm calculation, i.e. U(:,1:cS(tF)%ptr+cS(tF)%n-1) -// In order to have the correct answer it is needed that COMMU has -// been done before calling this function (or the ansesters of U -// are passed through COMMU) - -#include "norm.h" - -#include "CmMod.h" - -#include "mpi.h" - -#include - -namespace norm { - -//-------------- -// fsi_ls_norms -//-------------- -// -double fsi_ls_norms(const int nNo, FSILS_commuType& commu, const Vector& U) -{ - #define n_debug_fsi_ls_norms - #ifdef debug_fsi_ls_norms - int tid = commu.task; - auto msg_prefix = std::string("[fsi_ls_norms:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << "========== fsi_ls_norms ==========" << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - #endif - - double result = 0.0; - - for (int i = 0; i < nNo; i++) { - result = result + U(i)*U(i); - } - - #ifdef debug_fsi_ls_norms - std::cout << msg_prefix << "result: " << result << std::endl; - #endif - - if (commu.nTasks != 1) { - double tmp; - MPI_Allreduce(&result, &tmp, 1, cm_mod::mpreal, MPI_SUM, commu.comm); - //CALL MPI_ALLREDUCE(FSILS_NORMS, tmp, 1, mpreal, MPI_SUM, commu%comm, ierr) - result = tmp; - #ifdef debug_fsi_ls_norms - std::cout << msg_prefix << "tmp: " << tmp << std::endl; - std::cout << msg_prefix << "sqrt(tmp): " << sqrt(tmp) << std::endl; - #endif - } - - return sqrt(result); -} - -//-------------- -// fsi_ls_normv -//-------------- -// -double fsi_ls_normv(const int dof, const int nNo, FSILS_commuType& commu, const Array& U) -{ - double result = 0.0; - - switch (dof) { - case 1: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*U(0,i); - } - } break; - - case 2: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*U(0,i) + U(1,i)*U(1,i); - } - } break; - - case 3: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*U(0,i) + U(1,i)*U(1,i) + U(2,i)*U(2,i); - } - } break; - - case 4: { - for (int i = 0; i < nNo; i++) { - result = result + U(0,i)*U(0,i) + U(1,i)*U(1,i) + U(2,i)*U(2,i) + U(3,i)*U(3,i); - } - } break; - - default: { - for (int i = 0; i < nNo; i++) { - for (int j = 0; j < U.num_rows(); j++) { - result = result + U(j,i)*U(j,i); - } - //result = result + U(:,i)*U(:,i); - } - } break; - } - - if (commu.nTasks != 1) { - double tmp; - MPI_Allreduce(&result, &tmp, 1, cm_mod::mpreal, MPI_SUM, commu.comm); - //CALL MPI_ALLREDUCE(result, tmp, 1, mpreal, MPI_SUM, commu.comm, ierr) - result = tmp; - } - - return sqrt(result); -} - -}; diff --git a/Code/Source/svFSILS/back/norm.h b/Code/Source/svFSILS/back/norm.h deleted file mode 100644 index cf0097caa..000000000 --- a/Code/Source/svFSILS/back/norm.h +++ /dev/null @@ -1,12 +0,0 @@ - -#include "fils_struct.hpp" - -namespace norm { - -using namespace fsi_linear_solver; - -double fsi_ls_norms(const int nNo, FSILS_commuType& commu, const Vector& U); - -double fsi_ls_normv(const int dof, const int nNo, FSILS_commuType& commu, const Array& U); - -}; diff --git a/Code/Source/svFSILS/back/ns_solver.cpp b/Code/Source/svFSILS/back/ns_solver.cpp deleted file mode 100644 index 14ae843b3..000000000 --- a/Code/Source/svFSILS/back/ns_solver.cpp +++ /dev/null @@ -1,720 +0,0 @@ - -// This routine is mainley intended for solving incompressible NS or -// FSI equations with a form of AU=R, in which A = [K D;-G L] and -// G = -D^t - -#include "ns_solver.h" - -#include "fsils_api.hpp" -#include "fils_struct.hpp" - -#include "add_bc_mul.h" -#include "cgrad.h" -#include "dot.h" -#include "ge.h" -#include "gmres.h" -#include "norm.h" -#include "spar_mul.h" - -#include "Array3.h" - -#include - -namespace ns_solver { - -//-------- -// bc_pre -//-------- -// -// Modifies: lhs.face[].nS -// -void bc_pre(fsi_linear_solver::FSILS_lhsType& lhs, const int nsd, const int dof, const int nNo, const int mynNo) -{ - /* - int tid = lhs.commu.task; - auto msg_prefix = std::string("[bc_pre:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== bc_pre ==========" << std::endl; - */ - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - - if (face.coupledFlag) { - if (face.sharedFlag) { - Array v(nsd,nNo); - - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - v(i,Ac) = face.valM(i,a); - } - } - - face.nS = pow(norm::fsi_ls_normv(nsd, mynNo, lhs.commu, v),2.0); - - } else { - face.nS = 0.0; - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < nsd; i++) { - face.nS = face.nS + pow(face.valM(i,a),2.0); - } - } - } - } - } - //std::cout << msg_prefix << "Done" << std::endl; -} - -//-------- -// depart -//-------- -// Store sections of the 'Val' into separate arrays: 'Gt', 'mK', etc. -// -// Modifies: no globals -// -void depart(fsi_linear_solver::FSILS_lhsType& lhs, const int nsd, const int dof, const int nNo, const int nnz, - const Array& Val, Array& Gt, Array& mK, Array& mG, Array& mD, Vector& mL) -{ - /* - int tid = lhs.commu.task; - auto msg_prefix = std::string("[depart:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== depart ==========" << std::endl; - std::cout << msg_prefix << "nsd: " << nsd << std::endl; - */ - Vector tmp((nsd+1)*(nsd+1)); - - if (nsd == 2) { - for (int i = 0; i < nnz; i++) { - auto tmp = Val.col(i); - - mK(0,i) = tmp(0); - mK(1,i) = tmp(1); - mK(2,i) = tmp(3); - mK(3,i) = tmp(4); - - mG(0,i) = tmp(2); - mG(1,i) = tmp(5); - - mD(0,i) = tmp(6); - mD(1,i) = tmp(7); - - mL(i) = tmp(8); - } - - } else if (nsd == 3) { - - for (int i = 0; i < nnz; i++) { - auto tmp = Val.col(i); - - mK(0,i) = tmp(0); - mK(1,i) = tmp(1); - mK(2,i) = tmp(2); - mK(3,i) = tmp(4); - mK(4,i) = tmp(5); - mK(5,i) = tmp(6); - mK(6,i) = tmp(8); - mK(7,i) = tmp(9); - mK(8,i) = tmp(10); - - mG(0,i) = tmp(3); - mG(1,i) = tmp(7); - mG(2,i) = tmp(11); - - mD(0,i) = tmp(12); - mD(1,i) = tmp(13); - mD(2,i) = tmp(14); - - mL(i) = tmp(15); - } - - } else { - //PRINT *, "FSILS: Not defined nsd for DEPART", nsd - //STOP "FSILS: FATAL ERROR" - } - - for (int i = 0; i < nNo; i++) { - for (int j = lhs.rowPtr(0,i); j <= lhs.rowPtr(1,i); j++) { - int k = lhs.colPtr(j); - - for (int l = lhs.rowPtr(0,k); l <= lhs.rowPtr(1,k); l++) { - if (lhs.colPtr(l) == i) { - for (int m = 0; m < Gt.num_rows(); m++) { - Gt(m,l) = -mG(m,j); - } - //Gt(:,l) = -mG(:,j) - break; - } - } - } - } -} - -//----------- -// ns_solver -//----------- -// This routine is mainley intended for solving incompressible NS or -// FSI equations with a form of AU=R, in which A = [K D;-G L] and -// G = -D^t -// -// Ri (dof, lhs.nNo ) -// -void ns_solver(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_lsType& ls, const int dof, const Array& Val, Array& Ri) -{ - using namespace consts; - using namespace fsi_linear_solver; - - #define n_debug_ns_solver - int tid = lhs.commu.task; - auto msg_prefix = std::string("[ns_solver:") + std::to_string(tid) + "] "; - #ifdef debug_ns_solver - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== ns_solver ==========" << std::endl; - double time = fsi_linear_solver::fsils_cpu_t(); - #endif - - const int nNo = lhs.nNo; - const int nnz = lhs.nnz; - const int mynNo = lhs.mynNo; - const int nsd = dof - 1; - const int iB = ls.RI.mItr; - const int nB = 2*iB; - - #ifdef debug_ns_solver - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nsd: " << nsd << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "nnz: " << nnz << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "iB: " << iB << std::endl; - std::cout << msg_prefix << "nB: " << nB << std::endl; - Ri.write(msg_prefix+"Ri"); - #endif - - Vector Rc(nNo), Rci(nNo), tmp(nB*nB+nB), tmpG(nB*nB+nB), B(nB), xB(nB), oldxB(nB); - Array Rm(nsd,nNo), Rmi(nsd,nNo), A(nB,nB), P(nNo,iB), MP(nNo,nB); - Array3 U(nsd,nNo,iB), MU(nsd,nNo,nB); - - for (int i = 0; i < nsd; i++) { - for (int j = 0; j < Ri.num_cols(); j++) { - Rmi(i,j) = Ri(i,j); - } - } - //Rmi = Ri(1:nsd,:) - - for (int i = 0; i < Ri.num_cols(); i++) { - Rci(i) = Ri(dof-1,i); - } - //Rci = Ri(dof,:) - - Rm = Rmi; - Rc = Rci; - - double eps = sqrt(pow(norm::fsi_ls_normv(nsd,mynNo,lhs.commu,Rm),2.0) + - pow(norm::fsi_ls_norms(mynNo,lhs.commu,Rc),2.0)); - - #ifdef debug_ns_solver - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "eps (Rm/Rc): " << eps << std::endl; - Rm.write(msg_prefix+"Rm"); - Rc.write(msg_prefix+"Rc"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - #endif - - ls.RI.iNorm = eps; - ls.RI.fNorm = eps*eps; - - // Calling duration - ls.CG.callD = 0.0; - ls.GM.callD = 0.0; - ls.RI.callD = fsi_linear_solver::fsils_cpu_t(); - - ls.CG.itr = 0; - ls.GM.itr = 0; - ls.RI.suc = false; - eps = std::max(ls.RI.absTol, ls.RI.relTol*eps); - #ifdef debug_ns_solver - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "eps: " << eps << std::endl; - std::cout << msg_prefix << "ls.RI.iNorm: " << ls.RI.iNorm << std::endl; - std::cout << msg_prefix << "ls.RI.fNorm: " << ls.RI.fNorm << std::endl; - //MPI_Barrier(lhs.commu.comm); - //exit(0); - #endif - - Array Gt(nsd,nnz), mK(nsd*nsd,nnz), mG(nsd,nnz), mD(nsd,nnz); - Vector mL(nnz); - - // Store sections of the 'Val' array into separate arrays: 'Gt', 'mK', etc. - // - // Modfies: Gt, mK, mG, mD, and mL. - // - //std::cout << msg_prefix << std::endl; - #ifdef debug_ns_solver - std::cout << msg_prefix << "depart ... " << std::endl; - #endif - depart(lhs, nsd, dof, nNo, nnz, Val, Gt, mK, mG, mD, mL); - //CALL DEPART - - #ifdef debug_ns_solver - Gt.write(msg_prefix+"Gt"); - mD.write(msg_prefix+"mD"); - mG.write(msg_prefix+"mG"); - mK.write(msg_prefix+"mK"); - mL.write(msg_prefix+"mL"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - #endif - - // Computes lhs.face[].nS for each face. - // - //std::cout << msg_prefix << std::endl; - #ifdef debug_ns_solver - std::cout << msg_prefix << "bc_pre ... " << std::endl; - #endif - bc_pre(lhs, nsd, dof, nNo, mynNo); - //CALL BCPRE - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - #ifdef debug_ns_solver - std::cout << msg_prefix << "faIn: " << faIn << " face.nS: " << face.nS << std::endl; - #endif - } - - #ifdef debug_ns_solver - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Loop i on ls.RI.mItr ... " << std::endl; - #endif - int iBB{0}; - int i_count{0}; - - // Note: iB and iBB appear to index into arrays. - // - for (int i = 0; i < ls.RI.mItr; i++) { - //for (int i = 0; i < 1; i++) { - #ifdef debug_ns_solver - auto istr = "_" + std::to_string(i+1); - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "---------- i " << i+1 << " ----------" << std::endl; - #endif - - int iB = 2*i; - iBB = 2*i + 1; - //iB = 2*i - 1 - //iBB = 2*i - ls.RI.dB = ls.RI.fNorm; - i_count = i; - #ifdef debug_ns_solver - std::cout << msg_prefix << "iB: " << iB << std::endl; - std::cout << msg_prefix << "iBB: " << iBB << std::endl; - std::cout << msg_prefix << "ls.RI.fNorm: " << ls.RI.fNorm << std::endl; - #endif - - // Solve for U = inv(mK) * Rm - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "Call gmres U = K^-1*Rm ..." << std::endl; - #endif - auto U_slice = U.slice(i); - gmres::gmres(lhs, ls.GM, nsd, mK, Rm, U_slice); - U.set_slice(i, U_slice); - //CALL GMRES(lhs, ls.GM, nsd, mK, Rm, U(:,:,i)) - #ifdef debug_ns_solver_write - U.write(msg_prefix+"U_a"+istr); - #endif - - // P = D*U - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "P = D * U ..." << std::endl; - #endif - auto P_col = P.col(i); - spar_mul::fsils_spar_mul_vs(lhs, lhs.rowPtr, lhs.colPtr, nsd, mD, U.slice(i), P_col); - P.set_col(i, P_col); - //CALL FSILS_SPARMULVS(lhs, lhs.rowPtr, lhs.colPtr, nsd, mD, U(:,:,i), P(:,i)) - #ifdef debug_ns_solver_write - P.write(msg_prefix+"P_a"+istr); - #endif - - // P = Rc - P - // - P.set_col(i, Rc - P.col(i)); - //P(:,i) = Rc - P(:,i) - #ifdef debug_ns_solver_write - P.write(msg_prefix+"P_b"+istr); - #endif - - // P = [L + G^t*G]^-1*P - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "P = inv[L + G^t*G] * P ..." << std::endl; - #endif - - P_col = P.col(i); - #ifdef debug_ns_solver - P_col.write(msg_prefix+"P_col"+istr); - #endif - cgrad::schur(lhs, ls.CG, nsd, Gt, mG, mL, P_col); - P.set_col(i, P_col); - //CALL CGRAD_SCHUR(lhs, ls.CG, nsd, Gt, mG, mL, P(:,i)) - #ifdef debug_ns_solver_write - P.write(msg_prefix+"P_c"+istr); - #endif - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - // MU1 = G*P - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "MU1 = G * P ..." << std::endl; - std::cout << msg_prefix << "i: " << i+1 << std::endl; - std::cout << msg_prefix << "iB: " << iB+1 << std::endl; - #endif - P_col = P.col(i); - auto MU_iB = MU.slice(iB); - spar_mul::fsils_spar_mul_sv(lhs, lhs.rowPtr, lhs.colPtr, nsd, mG, P_col, MU_iB); - MU.set_slice(iB, MU_iB); - //CALL FSILS_SPARMULSV(lhs, lhs.rowPtr, lhs.colPtr, nsd, mG, P(:,i), MU(:,:,iB)) - #ifdef debug_ns_solver_write - MU.write(msg_prefix+"MU_a"+istr); - #endif - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - // MU2 = Rm - G*P - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "MU2 = Rm - G*P ..." << std::endl; - #endif - MU.set_slice(iBB, Rm - MU_iB); - //MU(:,:,iBB) = Rm - MU(:,:,iB) - #ifdef debug_ns_solver_write - MU.write(msg_prefix+"MU_b"+istr); - #endif - - // U = inv(K) * [Rm - G*P] - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "U = inv(K) * [Rm - G*P] ..." << std::endl; - std::cout << msg_prefix << "iBB: " << iBB << std::endl; - #endif - lhs.debug_active = true; - auto U_i = U.slice(i); - gmres::gmres(lhs, ls.GM, nsd, mK, MU.slice(iBB), U_i); - U.set_slice(i, U_i); - // CALL GMRES(lhs, ls.GM, nsd, mK, MU(:,:,iBB), U(:,:,i)) - #ifdef debug_ns_solver_write - U.write(msg_prefix+"U_b"+istr); - #endif - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - // MU2 = K*U - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "MU2 = K*U ..." << std::endl; - #endif - auto MU_iBB = MU.slice(iBB); - spar_mul::fsils_spar_mul_vv(lhs, lhs.rowPtr, lhs.colPtr, nsd, mK, U.slice(i), MU_iBB); - //CALL FSILS_SPARMULVV(lhs, lhs.rowPtr, lhs.colPtr, nsd, mK, U(:,:,i), MU(:,:,iBB)) - MU.set_slice(iBB, MU_iBB); - #ifdef debug_ns_solver_write - MU.write(msg_prefix+"MU_c"+istr); - #endif - - add_bc_mul::add_bc_mul(lhs, BcopType::BCOP_TYPE_ADD, nsd, U.slice(i), MU_iBB); - MU.set_slice(iBB, MU_iBB); - //CALL ADDBCMUL(lhs, BCOP_TYPE_ADD, nsd, U(:,:,i), MU(:,:,iBB)) - #ifdef debug_ns_solver_write - MU.write(msg_prefix+"MU_d"+istr); - #endif - - // MP1 = L*P - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "MP1 = L*P ..." << std::endl; - #endif - auto MP_iB = MP.col(iB); - spar_mul::fsils_spar_mul_ss(lhs, lhs.rowPtr, lhs.colPtr, mL, P.col(i), MP_iB); - MP.set_col(iB, MP_iB); - //CALL FSILS_SPARMULSS(lhs, lhs.rowPtr, lhs.colPtr, mL, P(:,i), MP(:,iB)) - #ifdef debug_ns_solver_write - MP.write(msg_prefix+"MP_a"+istr); - #endif - - // MP2 = D*U - #ifdef debug_ns_solver - std::cout << msg_prefix << "MP2 = D*U ... " << std::endl; - #endif - auto MP_iBB = MP.col(iBB); - spar_mul::fsils_spar_mul_vs(lhs, lhs.rowPtr, lhs.colPtr, nsd, mD, U.slice(i), MP_iBB); - - MP.set_col(iBB, MP_iBB); - //CALL FSILS_SPARMULVS(lhs, lhs.rowPtr, lhs.colPtr, nsd, mD, U(:,:,i), MP(:,iBB)) - #ifdef debug_ns_solver_write - MP.write(msg_prefix+"MP_b"+istr); - #endif - - int c = 0; - - for (int k = iB; k <= iBB; k++) { - for (int j = 0; j <= k; j++) { - tmp(c) = dot::fsils_nc_dot_v(nsd, mynNo, MU.slice(j), MU.slice(k)) + - dot::fsils_nc_dot_s(mynNo, MP.col(j), MP.col(k)); - //tmp(c) = FSILS_NCDOTV(nsd, mynNo, MU(:,:,j), MU(:,:,k)) + FSILS_NCDOTS( mynNo, MP(:,j), MP(:,k)) - #ifdef debug_ns_solver - std::cout << msg_prefix << "tmp(" << c+1 << "): " << tmp(c) << std::endl; - #endif - c = c + 1; - } - - tmp(c) = dot::fsils_nc_dot_v(nsd, mynNo, MU.slice(k), Rmi) + - dot::fsils_nc_dot_s(mynNo, MP.col(k), Rci); - //tmp(c) = FSILS_NCDOTV(nsd, mynNo, MU(:,:,k), Rmi) + FSILS_NCDOTS( mynNo, MP(:,k), Rci) - #ifdef debug_ns_solver - std::cout << msg_prefix << "tmp(" << c+1 << "): " << tmp(c) << std::endl; - #endif - c = c + 1; - } - - #ifdef debug_ns_solver - std::cout << msg_prefix << "c: " << c << std::endl; - std::cout << msg_prefix << "Call MPI_ALLREDUCE .." << std::endl; - #endif - if (lhs.commu.nTasks > 1) { - MPI_Allreduce(tmp.data(), tmpG.data(), c, cm_mod::mpreal, MPI_SUM, lhs.commu.comm); - //CALL MPI_ALLREDUCE(tmp, tmpG, c, mpreal, MPI_SUM, lhs.commu.comm, j) - tmp = tmpG; - } - - // Set arrays for Gauss elimination - // - #ifdef debug_ns_solver - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "Set arrays for Gauss elimination ... " << std::endl; - #endif - c = 0; - - for (int k = iB; k <= iBB; k++) { - for (int j = 0; j <= k; j++) { - A(j,k) = tmp(c); - A(k,j) = tmp(c); - c = c + 1; - } - - B(k) = tmp(c); - c = c + 1; - } - #ifdef debug_ns_solver - std::cout << msg_prefix << "c: " << c << std::endl; - #endif - - xB = B; - - // Perform Gauss elimination. - // - // [TODO:DaveP] careful with iBB, seems to be an index and a counter. - // - #ifdef debug_ns_solver - std::cout << msg_prefix << "Perform Gauss elimination ... " << std::endl; - #endif - if (ge::ge(nB, iBB+1, A, xB)) { - oldxB = xB; - - } else { - if (lhs.commu.masF) { - std::cout << "[FSILS] Singular matrix detected" << std::endl; - //throw std::runtime_error("FSILS: Singular matrix detected"); - //PRINT *,"FSILS: Singular matrix detected" - } - - xB = oldxB; - - // [TODO:DaveP] careful here, shift iB and iBB by -1? - // - if (i > 0) { - iB = iB - 2; - iBB = iBB - 2; - #ifdef debug_ns_solver - std::cout << msg_prefix << "New iB: " << iB << std::endl; - std::cout << msg_prefix << "New iBB: " << iBB << std::endl; - std::cout << msg_prefix << "New iB: " << iB << std::endl; - #endif - } - break; - } - - //std::cout << msg_prefix << "Compute sum ... " << std::endl; - double sum = 0.0; - for (int i = 0; i <= iBB; i++) { - sum += xB(i) * B(i); - } - ls.RI.fNorm = pow(ls.RI.iNorm,2.0) - sum; - //ls.RI.fNorm = ls.RI.iNorm**2.0 - SUM(xB(1:iBB)*B(1:iBB)) - #ifdef debug_ns_solver - std::cout << msg_prefix << "sum: " << sum << std::endl; - std::cout << msg_prefix << "ls.RI.fNorm: " << ls.RI.fNorm << std::endl; - #endif - - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - if (ls.RI.fNorm < eps*eps) { - ls.RI.suc = true; - break; - } - - Rm = Rmi - xB(0)*MU.slice(0); - //Rm = Rmi - xB(1)*MU(:,:,1) - - Rc = Rci - xB(0)*MP.col(0); - //Rc = Rci - xB(1)*MP(:,1) - - for (int j = 1; j <= iBB; j++) { - Rm = Rm - xB(j)*MU.slice(j); - //Rm = Rm - xB(j)*MU(:,:,j) - - Rc = Rc - xB(j)*MP.col(j); - //Rc = Rc - xB(j)*MP(:,j) - } - - //std::cout << msg_prefix << "Exit at i=" << i+1 << std::endl; - //MPI_Barrier(lhs.commu.comm); - //exit(0); - } // for i = 0; i < ls.RI.mItr - - #ifdef debug_ns_solver - std::cout << msg_prefix << "Finished iteration" << std::endl; - std::cout << msg_prefix << std::endl; - #endif - - // [TODO:DaveP] careful here with i_count. - if (i_count >= ls.RI.mItr) { - //if (i > ls.RI.mItr) { - ls.RI.itr = ls.RI.mItr; - } else { - ls.RI.itr = i_count; - //ls.RI.itr = i; - - Rc = Rci - xB(0)*MP.col(0); - //Rc = Rci - xB(1)*MP(:,1) - - for (int j = 1; j <= iBB; j++) { - Rc = Rc - xB(j)*MP.col(j); - //Rc = Rc - xB(j)*MP(:,j) - } - } - - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "i_count: " << i_count << std::endl; - - ls.Resc = static_cast(100.0 * pow(norm::fsi_ls_norms(mynNo, lhs.commu, Rc),2.0) / ls.RI.fNorm); - //ls.Resc = NINT(100.0*FSILS_NORMS(mynNo, lhs.commu, Rc)**2.0 / ls.RI.fNorm, KIND=LSIP) - ls.Resm = 100 - ls.Resc; - - //std::cout << msg_prefix << std::endl; - #ifdef debug_ns_solver - std::cout << msg_prefix << "ls.Resc: " << ls.Resc << std::endl; - std::cout << msg_prefix << "ls.Resm: " << ls.Resm << std::endl; - std::cout << msg_prefix << "ls.RI.itr: " << ls.RI.itr << std::endl; - #endif - - Rmi = xB(1) * U.slice(0); - //Rmi = xB(2)*U(:,:,1) - - Rci = xB(0) * P.col(0); - //Rci = xB(1)*P(:,1) - - // [TODO:DaveP] carfeful with ls.RI.itr. - // - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Compute Rmi ... " << std::endl; - - for (int i = 1; i <= ls.RI.itr; i++) { - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "i: " << i << std::endl; - int iB = 2*i; - int iBB = 2*i + 1; - //int iB = 2*i - 1; - //int iBB = 2*i; - //std::cout << msg_prefix << "iB: " << iB << std::endl; - //std::cout << msg_prefix << "iBB: " << iBB << std::endl; - //std::cout << msg_prefix << "xB(iBB): " << xB(iBB) << std::endl; - - Rmi = Rmi + xB(iBB) * U.slice(i); - //Rmi = Rmi + xB(iBB)*U(:,:,i) - - Rci = Rci + xB(iB) * P.col(i); - //Rci = Rci + xB(iB)*P(:,i) - } - - /* - U.write(msg_prefix+"U"); - P.write(msg_prefix+"P"); - xB.write(msg_prefix+"xB"); - Rc.write(msg_prefix+"Rc"); - MP.write(msg_prefix+"MP"); - Rmi.write(msg_prefix+"Rmi"); - Rci.write(msg_prefix+"Rci"); - */ - - // Set Calling duration. - ls.RI.callD = fsi_linear_solver::fsils_cpu_t() - ls.RI.callD; - //ls.RI.callD = FSILS_CPUT() - ls.RI.callD - - ls.RI.dB = 5.0 * log(ls.RI.fNorm / ls.RI.dB); - //ls.RI.dB = 5.0*LOG(ls.RI.fNorm/ls.RI.dB) - - if (ls.Resc < 0.0 || ls.Resm < 0.0) { - std::cout << msg_prefix << "ls.Resc: " << ls.Resc << std::endl; - std::cout << msg_prefix << "ls.Resm: " << ls.Resm << std::endl; - ls.Resc = 0; - ls.Resm = 0; - ls.RI.dB = 0; - ls.RI.fNorm = 0.0; - - if (lhs.commu.masF) { - std::cout << "[WARNING:ns_solve] unexpected behavior in FSILS (likely due to the ill-conditioned LHS matrix)." << std::endl; - //throw std::runtime_error("FSILS: unexpected behavior in FSILS (likely due to the ill-conditioned LHS matrix)"); - //PRINT "(A)", "Warning: unexpected behavior in FSILS (likely due to the ill-conditioned LHS matrix)" - } - } - - ls.RI.fNorm = sqrt(ls.RI.fNorm); - #ifdef debug_ns_solver - std::cout << msg_prefix << "ls.RI.callD: " << ls.RI.callD << std::endl; - std::cout << msg_prefix << "ls.RI.dB: " << ls.RI.dB << std::endl; - std::cout << msg_prefix << "ls.RI.fNorm: " << ls.RI.fNorm << std::endl; - #endif - - for (int i = 0; i < nsd; i++) { - for (int j = 0; j < Rmi.num_cols(); j++) { - Ri(i, j) = Rmi(i, j); - } - } - //Ri(1:nsd,:) = Rmi - - Ri.set_row(dof-1, Rci); - //Ri(dof,:) = Rci - //Ri.write(msg_prefix+"Ri"); - - if (lhs.commu.masF) { - //CALL LOGFILE - } - - #ifdef debug_ns_solver - double exec_time = fsi_linear_solver::fsils_cpu_t() - time; - std::cout << msg_prefix << "Execution time: " << exec_time << std::endl; - std::cout << msg_prefix << "Done" << std::endl; - #endif - - //MPI_Barrier(lhs.commu.comm); - //exit(0); -} - - -}; - diff --git a/Code/Source/svFSILS/back/ns_solver.h b/Code/Source/svFSILS/back/ns_solver.h deleted file mode 100644 index 6021f14af..000000000 --- a/Code/Source/svFSILS/back/ns_solver.h +++ /dev/null @@ -1,14 +0,0 @@ - -#include "fils_struct.hpp" - -namespace ns_solver { - -void bc_pre(fsi_linear_solver::FSILS_lhsType& lhs, const int nsd, const int dof, const int nNo, const int mynNo); - -void depart(fsi_linear_solver::FSILS_lhsType& lhs, const int nsd, const int dof, const int nNo, const int nnz, - const Array& Val, Array& Gt, Array& mK, Array& mG, Array& mD, Vector& mL); - -void ns_solver(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_lsType& ls, const int dof, const Array& Val, Array& Ri); - - -}; diff --git a/Code/Source/svFSILS/back/omp_la.cpp b/Code/Source/svFSILS/back/omp_la.cpp deleted file mode 100644 index 7a91e93c3..000000000 --- a/Code/Source/svFSILS/back/omp_la.cpp +++ /dev/null @@ -1,132 +0,0 @@ - -// A bunch of operation that benefits from OMP hyperthreading - -#include "omp_la.h" - -namespace omp_la { - -//----------- -// omp_mul_s -//----------- -// Reproduces 'SUBROUTINE OMPMULS (nNo, r, U)'. -// -void omp_mul_s(const int nNo, const double r, Vector& U) -{ - for (int i = 0; i < nNo; i++) { - U(i) = r * U(i); - } -} - -//----------- -// omp_mul_v -//----------- -// Reproduces 'SUBROUTINE OMPMULV (dof, nNo, r, U)'. -// -void omp_mul_v(const int dof, const int nNo, const double r, Array& U) -{ - switch (dof) { - case 1: - for (int i = 0; i < nNo; i++) { - U(0,i) = r * U(0,i); - } - break; - - case 2: - for (int i = 0; i < nNo; i++) { - U(0,i) = r*U(0,i); - U(1,i) = r*U(1,i); - } - break; - - case 3: - for (int i = 0; i < nNo; i++) { - U(0,i) = r*U(0,i); - U(1,i) = r*U(1,i); - U(2,i) = r*U(2,i); - } - break; - - case 4: - for (int i = 0; i < nNo; i++) { - U(0,i) = r*U(0,i); - U(1,i) = r*U(1,i); - U(2,i) = r*U(2,i); - U(3,i) = r*U(3,i); - } - break; - - default: - for (int i = 0; i < nNo; i++) { - for (int j = 0; j < U.num_rows(); j++) { - U(j,i) = r*U(j,i); - } - //U(:,i) = r*U(:,i) - } - } -} - -//----------- -// omp_sum_s -//----------- -// Reproduces 'SUBROUTINE OMPSUMS (nNo, r, U, V)'. -// -void omp_sum_s(const int nNo, const double r, Vector& U, const Vector& V) -{ - for (int i = 0; i < nNo; i++) { - U(i) = U(i) + r*V(i); - } -} - -//----------- -// omp_sum_v -//----------- -// Reproduces 'SUBROUTINE OMPSUMV (dof, nNo, r, U, V)'. -// -void omp_sum_v(const int dof, const int nNo, const double r, Array& U, const Array& V) -{ - switch (dof) { - - case 1: - for (int i = 0; i < nNo; i++) { - U(0,i) = U(0,i) + r*V(0,i); - } - break; - - case 2: - for (int i = 0; i < nNo; i++) { - U(0,i) = U(0,i) + r*V(0,i); - U(1,i) = U(1,i) + r*V(1,i); - } - break; - - case 3: - for (int i = 0; i < nNo; i++) { - U(0,i) = U(0,i) + r*V(0,i); - U(1,i) = U(1,i) + r*V(1,i); - U(2,i) = U(2,i) + r*V(2,i); - } - break; - - case 4: - for (int i = 0; i < nNo; i++) { - U(0,i) = U(0,i) + r*V(0,i); - U(1,i) = U(1,i) + r*V(1,i); - U(2,i) = U(2,i) + r*V(2,i); - U(3,i) = U(3,i) + r*V(3,i); - } - break; - - default: - for (int j = 0; j < U.num_rows(); j++) { - for (int i = 0; i < nNo; i++) { - U(j,i) = U(j,i) + r*V(j,i); - } - //U(:,i) = U(:,i) + r*V(:,i) - } - } -} - - -}; - - diff --git a/Code/Source/svFSILS/back/omp_la.h b/Code/Source/svFSILS/back/omp_la.h deleted file mode 100644 index f9f85710d..000000000 --- a/Code/Source/svFSILS/back/omp_la.h +++ /dev/null @@ -1,16 +0,0 @@ - -#include "fils_struct.hpp" - -namespace omp_la { - -using namespace fsi_linear_solver; - -void omp_mul_s(const int nNo, const double r, Vector& U); - -void omp_mul_v(const int dof, const int nNo, const double r, Array& U); - -void omp_sum_s(const int nNo, const double r, Vector& U, const Vector& V); - -void omp_sum_v(const int dof, const int nNo, const double r, Array& U, const Array& V); - -}; diff --git a/Code/Source/svFSILS/back/pc_gmres.cpp b/Code/Source/svFSILS/back/pc_gmres.cpp deleted file mode 100644 index 4f1c877fd..000000000 --- a/Code/Source/svFSILS/back/pc_gmres.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -#include "pc_gmres.h" - -#include "fsils_api.hpp" - -#include "add_bc_mul.h" -#include "bcast.h" -#include "dot.h" -#include "norm.h" -#include "omp_la.h" -#include "spar_mul.h" - -#include "Array3.h" - -#include - -namespace pc_gmres { - -//---------- -// pc_gmres -//---------- -// -void pc_gmres(fsi_linear_solver::FSILS_lhsType& lhs, fsi_linear_solver::FSILS_subLsType& ls, const int dof, - const Array& Val, const Array& R) -{ - #define n_debug_pc_gmres - #ifdef debug_pc_gmres - int tid = lhs.commu.task; - auto msg_prefix = std::string("[pc_gmres:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== pc_gmres ==========" << std::endl; - #endif - - using namespace fsi_linear_solver; - -/* - int nNo = lhs.nNo; - int mynNo = lhs.mynNo; - int sD = ls.GM.sD; - #ifdef debug_gmres - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "mynNo: " << mynNo << std::endl; - std::cout << msg_prefix << "sD: " << sD << std::endl; - #endif -*/ - -} - -}; diff --git a/Code/Source/svFSILS/back/pc_gmres.h b/Code/Source/svFSILS/back/pc_gmres.h deleted file mode 100644 index dabe880ca..000000000 --- a/Code/Source/svFSILS/back/pc_gmres.h +++ /dev/null @@ -1,7 +0,0 @@ - -#include "fils_struct.hpp" - -namespace pc_gmres { - - -}; diff --git a/Code/Source/svFSILS/back/precond.cpp b/Code/Source/svFSILS/back/precond.cpp deleted file mode 100644 index 5bb8d38c4..000000000 --- a/Code/Source/svFSILS/back/precond.cpp +++ /dev/null @@ -1,792 +0,0 @@ - -// In this routine, the appropriate LS algorithm is called and -// the solution is returned. - -#include "precond.h" - -#include "fsils_api.hpp" - -#include - -namespace precond { - -//--------- -// pos_mul -//--------- -// Post-multipling Val by W: Val = Val*W -// -// Modifies: Val -// -void pos_mul(const Array& rowPtr, const Vector& colPtr, const int nNo, const int nnz, const int dof, Array& Val, const Array& W) -{ - //auto msg_prefix = std::string("[pos_mul] "); - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "========== pos_mul ==========" << std::endl; - //std::cout << msg_prefix << "dof: " << dof << std::endl; - - switch (dof) { - case 1: { - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - int a = colPtr(i); - Val(0,i) = Val(0,i)*W(0,a); - //Val(1,i) = Val(1,i)*W(1,a) - } - } - } break; - - case 2: { - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - int a = colPtr(i); - for (int j = 0; j < 3; j += 2) { - Val(j+0,i) = Val(j+0,i)*W(0,a); - Val(j+1,i) = Val(j+1,i)*W(1,a); - } - //Val(1:3:2,i) = Val(1:3:2,i)*W(1,a) - //Val(2:4:2,i) = Val(2:4:2,i)*W(2,a) - } - } - } break; - - case 3: { - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - int a = colPtr(i); - for (int j = 0; j < 7; j += 3) { - Val(j+0,i) = Val(j+0,i)*W(0,a); - Val(j+1,i) = Val(j+1,i)*W(1,a); - Val(j+2,i) = Val(j+2,i)*W(2,a); - } - //Val(1:7:3,i) = Val(1:7:3,i)*W(1,a) - //Val(2:8:3,i) = Val(2:8:3,i)*W(2,a) - //Val(3:9:3,i) = Val(3:9:3,i)*W(3,a) - } - } - } break; - - case 4: { - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - int a = colPtr(i); - for (int j = 0; j < 13; j += 4) { - Val(j+0,i) = Val(j+0,i)*W(0,a); - Val(j+1,i) = Val(j+1,i)*W(1,a); - Val(j+2,i) = Val(j+2,i)*W(2,a); - Val(j+3,i) = Val(j+3,i)*W(3,a); - } - //Val(1:13:4,i) = Val(1:13:4,i)*W(1,a) - //Val(2:14:4,i) = Val(2:14:4,i)*W(2,a) - //Val(3:15:4,i) = Val(3:15:4,i)*W(3,a) - //Val(4:16:4,i) = Val(4:16:4,i)*W(4,a) - } - } - } break; - - default: { - for (int Ac = 0; Ac < nNo; Ac++) { - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - int a = colPtr(i); - for (int b = 0; b < dof; b++) { - int j = dof*(dof-1) + b; - for (int k = b; k < j; k += dof) { - Val(k,i) = Val(k,i)*W(b,a); - } - //Val(b:j:dof,i) = Val(b:j:dof,i)*W(b,a) - } - } - } - } break; - } -} - -//-------------- -// precond_diag -//-------------- -// Jacobi symmetic preconditioner, to precondition both LHS and RHS. -// -// Modifies: Val, R, W -// -// Reproduces Fortran 'PRECONDDIAG'. -// -void precond_diag(fsi_linear_solver::FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const Vector& diagPtr, const int dof, Array& Val, Array& R, Array& W) -{ - #define n_debug_precond_diag - #ifdef debug_precond_diag - int tid = lhs.commu.task; - auto msg_prefix = std::string("[precond_diag:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== precond_diag ==========" << std::endl; - #endif - - int nNo = lhs.nNo; - #ifdef debug_precond_diag - std::cout << msg_prefix << "lhs.nFaces: " << lhs.nFaces << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "Val.nrows: " << Val.nrows_ << std::endl; - std::cout << msg_prefix << "Val.ncols: " << Val.ncols_ << std::endl; - std::cout << msg_prefix << "W.nrows: " << W.nrows_ << std::endl; - std::cout << msg_prefix << "W.ncols: " << W.ncols_ << std::endl; - #endif - - // Calculating W: W = diag(K) - // - switch (dof) { - case 1: { - for (int Ac = 0; Ac < nNo; Ac++) { - W(0,Ac) = Val(0,diagPtr(Ac)); - } - } break; - - case 2: { - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - W(0,Ac) = Val(0,d); - W(1,Ac) = Val(3,d); - } - } break; - - case 3: { - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - //std::cout << msg_prefix << "d: " << d+1 << " " << Val(8,d) << std::endl; - W(0,Ac) = Val(0,d); - W(1,Ac) = Val(4,d); - W(2,Ac) = Val(8,d); - } - } break; - - case 4: { - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - W(0,Ac) = Val(0,d); - W(1,Ac) = Val(5,d); - W(2,Ac) = Val(10,d); - W(3,Ac) = Val(15,d); - } - } break; - - default: { - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - for (int i = 0; i < dof; i++) { - W(i,Ac) = Val(i*dof-dof+i,d); - } - } - } break; - } - - //W.write(msg_prefix+"W"); - //exit(0); - - fsils_commuv(lhs, dof, W); - //CALL FSILS_COMMUV(lhs, dof, W) - - //W.write(msg_prefix+"W"); - //Vector::write_disabled = false; - //diagPtr.write(msg_prefix+"diagPtr", 1); - //MPI_Barrier(lhs.commu.comm); - - // Accounting for Dirichlet BC and inversing W = W^{-1/2} - // - - for (int Ac = 0; Ac < nNo; Ac++) { - //int d = diagPtr(Ac); - for (int i = 0; i < dof; i++) { - //std::cout << msg_prefix << "W(i,Ac) Ac i: " << Ac+1 << " " << i+1 << " " << W(i,Ac) << std::endl; - if (W(i,Ac) == 0.0) { - //std::cout << msg_prefix << "Ac i: " << Ac+1 << " " << i+1 << std::endl; - //std::cout << msg_prefix << "d: " << d << std::endl; - W(i,Ac) = 1.0; - } - } - } - - for (int i = 0; i < W.size(); i++) { - W(i) = 1.0 / sqrt(fabs(W(i))); - } - //W = 1.0 / sqrt(fabs(W)); - //W.write(msg_prefix+"W"); - //exit(0); - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - #ifdef debug_precond_diag - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << ">>> faIn: " << faIn << std::endl; - std::cout << msg_prefix << "face.incFlag: " << face.incFlag << std::endl; - #endif - - if (!face.incFlag) { - continue; - } - - int n = std::min(face.dof,dof); - //int i = std::min(face.dof,dof); - //std::cout << msg_prefix << "n: " << n << std::endl; - - if (face.bGrp == fsi_linear_solver::BcType::BC_TYPE_Dir) { - //std::cout << msg_prefix << "face.bGrp = BC_TYPE_Dir "<< std::endl; - //std::cout << msg_prefix << "face.nNo: " << face.nNo << std::endl; - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - //std::cout << msg_prefix << "W(i,Ac): "; - for (int i = 0; i < n; i++) { - W(i,Ac) = W(i,Ac) * face.val(i,a); - //std::cout << W(i,Ac) << " "; - } - //std::cout << std::endl; - //W(1:i,Ac) = W(1:i,Ac)*lhs.face(faIn).val(1:i,a) - } - } - } - - //W.write(msg_prefix+"W"); - //exit(0); - - // Pre-multipling K with W: K = W*K - //std::cout << msg_prefix << "pre_mul ... " << std::endl; - pre_mul(rowPtr, lhs.nNo, lhs.nnz, dof, Val, W); - //CALL PREMUL(rowPtr, lhs.nNo, lhs.nnz, dof, Val, W) - - // Multipling R with W: R = W*R - // - // W ( dof, lhs.nNo ) - // - // R ( dof, lhs.nNo ) - // - // ELement-wise multiplication. - // - for (int i = 0; i < W.size(); i++) { - R(i) = W(i) * R(i); - } - //R = W * R; - - // Now post-multipling K by W: K = K*W - //std::cout << msg_prefix << "pos_mul ... " << std::endl; - pos_mul(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, W); - //CALL POSMUL(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, W) - - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - //exit(0); - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - - if (face.coupledFlag) { - //std::cout << msg_prefix << "==== faIn coupledFlag: " << faIn+1 << std::endl; - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < std::min(face.dof,dof); i++) { - face.valM(i,a) = face.val(i,a) * W(i,Ac); - //std::cout << msg_prefix << "a:i: " << a+1 << " " << i+1 << std::endl; - //std::cout << msg_prefix << "W(i,Ac): " << W(i,Ac) << std::endl; - //std::cout << msg_prefix << "face.val(i,a): " << face.val(i,a) << std::endl; - //std::cout << msg_prefix << "face.valM(i,a): " << face.valM(i,a) << std::endl; - } - } - //face.valM.write(msg_prefix+"face_valM"); - //exit(0); - } - } - #ifdef debug_precond_diag - std::cout << msg_prefix << "Done" << std::endl; - #endif -} - -//------------- -// precond_rcs -//------------- -// Row and column preconditioner, to precondition both LHS and RHS. -// -// Reproduces Fortran 'PRECONDRCS'. -// -void precond_rcs(fsi_linear_solver::FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const Vector& diagPtr, const int dof, Array& Val, Array& R, Array& W1, Array& W2) -{ - #define n_debug_precond_rcs - #ifdef debug_precond_rcs - int tid = lhs.commu.task; - auto msg_prefix = std::string("[precond_rcs:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== precond_rcs ==========" << std::endl; - #endif - - const int nNo = lhs.nNo; - #ifdef debug_precond_rcs - std::cout << msg_prefix << "lhs.nFaces: " << lhs.nFaces << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - #endif - - int maxiter = 10; - double tol = 2.0; - int iter = 0; - bool flag = true; - W1 = 1.0; - W2 = 1.0; - - //***************************************************** - // Apply Dirichlet BC - //***************************************************** - // - Array Wr(dof,nNo), Wc(dof,nNo); - Wr = 1.0; - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - if (!face.incFlag) { - continue; - } - - int n = std::min(face.dof,dof); - //i = MIN(lhs.face(faIn).dof,dof) - - if (face.bGrp == fsi_linear_solver::BcType::BC_TYPE_Dir) { - for (int a = 0; a < face.nNo; a++) { - int Ac = face.glob(a); - for (int i = 0; i < n; i++) { - Wr(i,Ac) = Wr(i,Ac) * face.val(i,a); - } - //Wr(1:i,Ac) = Wr(1:i,Ac)*lhs.face(faIn).val(1:i,a) - } - } - } - - fsils_commuv(lhs, dof, Wr); - //CALL FSILS_COMMUV(lhs, dof, Wr) - - // For parallel case, val and Wr can be larger than 1 due to - // the addition operator in FSILS_COMMUV. Hence need renormalization. - // - Wr = Wr - 0.5; - Wr = Wr / abs(Wr); - Wr = (Wr + abs(Wr)) * 0.5; - //Wr.write(msg_prefix+"Wr"); - - // Kill the row and column corresponding to Dirichlet BC - // - // Modifies 'Val'. - // - #ifdef debug_precond_rcs - std::cout << msg_prefix << "Val shape: " << Val.nrows_ << " " << Val.ncols_ << std::endl; - std::cout << msg_prefix << "Wr shape: " << Wr.nrows_ << " " << Wr.ncols_ << std::endl; - std::cout << msg_prefix << "R shape: " << R.nrows_ << " " << R.ncols_ << std::endl; - #endif - pre_mul(rowPtr, lhs.nNo, lhs.nnz, dof, Val, Wr); - //CALL PREMUL(rowPtr, lhs.nNo, lhs.nnz, dof, Val, Wr) - //Val.write(msg_prefix+"Val"); - //exit(0); - - R = Wr * R; - - pos_mul(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, Wr); - //CALL POSMUL(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, Wr) - //Val.write(msg_prefix+"Val"); - //exit(0); - - // Set diagonal term to one - // - switch (dof) { - case 1: - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - Val(0,d) = Wr(0,Ac) * (Val(0,d) - 1.0) + 1.0; - } - break; - - case 2: - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - Val(0,d) = Wr(0,Ac)*(Val(0,d)-1.0) + 1.0; - Val(3,d) = Wr(1,Ac)*(Val(3,d)-1.0) + 1.0; - } - break; - - case 3: - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - Val(0,d) = Wr(0,Ac)*(Val(0,d)-1.0) + 1.0; - Val(4,d) = Wr(1,Ac)*(Val(4,d)-1.0) + 1.0; - Val(8,d) = Wr(2,Ac)*(Val(8,d)-1.0) + 1.0; - } - break; - - case 4: - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - Val(0 ,d) = Wr(0,Ac)*(Val(0 ,d)-1.0) + 1.0; - Val(5 ,d) = Wr(1,Ac)*(Val(5 ,d)-1.0) + 1.0; - Val(10,d) = Wr(2,Ac)*(Val(10,d)-1.0) + 1.0; - Val(15,d) = Wr(3,Ac)*(Val(15,d)-1.0) + 1.0; - } - break; - - default: - for (int Ac = 0; Ac < nNo; Ac++) { - int d = diagPtr(Ac); - for (int i = 0; i < dof; i++) { - Val(i*dof+i,d) = Wr(i,Ac)*(Val(i*dof+i,d) - 1.0) + 1.0; - //Val(i*dof-dof+i,d) = Wr(i,Ac)*(Val(i*dof-dof+i,d) - 1.0) + 1.0; - } - } - break; - } - //Val.write(msg_prefix+"Val"); - //Wr.write(msg_prefix+"Wr"); - //Wc.write(msg_prefix+"Wc"); - //exit(0); - - //***************************************************** - // Row and column scaling - //***************************************************** - // - // Define a lambda function for computing the maximum - // absolute value of a list of values. - auto max_func = [](const double& a, const double& b) { return fabs(a) < fabs(b); }; - - while (flag) { - Wr = 0.0; - Wc = 0.0; - iter = iter + 1; - #ifdef debug_precond_rcs - //std::cout << msg_prefix << "----- iter " << iter << " -----" << std::endl; - #endif - - if (iter >= maxiter) { - std::cout << "[precond_rcs] Warning: maximum iteration number reached" << std::endl; - flag = false; - } - - // Max norm along row and column - // - switch (dof) { - case 1: - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - auto values = Val.get_values({0,0}, {a,b}); - Wr(0,Ac) = fabs(*std::max_element(values.begin(), values.end(), max_func)); - //Wr(1,Ac) = MAXVAL(ABS(Val(1,a:b))); - - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - a = colPtr(i); - Wc(0,a) = std::max(fabs(Val(0,i)), Wc(0,a)); - //Wc(1,a) = MAX(ABS(Val(1,i)),Wc(1,a)) - } - } - break; - - case 2: - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - - auto vals1 = Val.get_values({0,1}, {a,b}); - Wr(0,Ac) = fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)); - //Wr(1,Ac) = MAXVAL(ABS(Val(1:2,a:b))) - - auto vals2 = Val.get_values({2,3}, {a,b}); - Wr(1,Ac) = fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)); - //Wr(2,Ac) = MAXVAL(ABS(Val(3:4,a:b))) - - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - a = colPtr(i); - auto vals1 = Val.get_values({0,2}, {i,i}, 2); - Wc(0,a) = std::max(fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)), Wc(0,a)); - //Wc(1,a) = MAX(MAXVAL(ABS(Val(1:3:2,i))), Wc(1,a)) - - auto vals2 = Val.get_values({1,3}, {i,i}, 2); - Wc(1,a) = std::max(fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)), Wc(1,a)); - //Wc(2,a) = MAX(MAXVAL(ABS(Val(2:4:2,i))), Wc(2,a)) - } - } - break; - - // [TODO:DaveP] there is probably a more efficient way to do this. - // - case 3: - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - #ifdef debug_precond_rcs - //std::cout << msg_prefix << "----- Ac " << Ac+1 << " -----" << std::endl; - //std::cout << msg_prefix << "a: " << a+1 << " b: " << b+1 << std::endl; - #endif - auto vals1 = Val.get_values({0,2}, {a,b}); - Wr(0,Ac) = fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)); - //Wr(1,Ac) = MAXVAL(ABS(Val(1:3,a:b))) - - auto vals2 = Val.get_values({3,5}, {a,b}); - Wr(1,Ac) = fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)); - //Wr(2,Ac) = MAXVAL(ABS(Val(4:6,a:b))) - - auto vals3 = Val.get_values({6,8}, {a,b}); - Wr(2,Ac) = fabs(*std::max_element(vals3.begin(), vals3.end(), max_func)); - //Wr(3,Ac) = MAXVAL(ABS(Val(7:9,a:b))) - - //std::cout << msg_prefix << "Wr(1,Ac): " << Wr(0,Ac) << std::endl; - //std::cout << msg_prefix << "Wr(2,Ac): " << Wr(1,Ac) << std::endl; - //std::cout << msg_prefix << "Wr(3,Ac): " << Wr(2,Ac) << std::endl; - - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - a = colPtr(i); - auto vals1 = Val.get_values({0,6}, {i,i}, 3); - Wc(0,a) = std::max(fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)), Wc(0,a)); - //Wc(1,a) = MAX(MAXVAL(ABS(Val(1:7:3,i))), Wc(1,a)) - - auto vals2 = Val.get_values({1,7}, {i,i}, 3); - Wc(1,a) = std::max(fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)), Wc(1,a)); - //Wc(2,a) = MAX(MAXVAL(ABS(Val(2:8:3,i))), Wc(2,a)) - - auto vals3 = Val.get_values({2,8}, {i,i}, 3); - Wc(2,a) = std::max(fabs(*std::max_element(vals3.begin(), vals3.end(), max_func)), Wc(2,a)); - //Wc(3,a) = MAX(MAXVAL(ABS(Val(3:9:3,i))), Wc(3,a)) - } - } - break; - - case 4: - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - - auto vals1 = Val.get_values({0,3}, {a,b}); - Wr(0,Ac) = fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)); - //Wr(1,Ac) = MAXVAL(ABS(Val(1:4, a:b))) - - auto vals2 = Val.get_values({4,7}, {a,b}); - Wr(1,Ac) = fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)); - //Wr(2,Ac) = MAXVAL(ABS(Val(5 :8 ,a:b))) - - auto vals3 = Val.get_values({8,11}, {a,b}); - Wr(2,Ac) = fabs(*std::max_element(vals3.begin(), vals3.end(), max_func)); - //Wr(3,Ac) = MAXVAL(ABS(Val(9 :12,a:b))) - - auto vals4 = Val.get_values({12,15}, {a,b}); - Wr(3,Ac) = fabs(*std::max_element(vals4.begin(), vals4.end(), max_func)); - //Wr(4,Ac) = MAXVAL(ABS(Val(13:16,a:b))) - - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - a = colPtr(i); - - auto vals1 = Val.get_values({0,12}, {i,i}, 4); - Wc(0,a) = std::max(fabs(*std::max_element(vals1.begin(), vals1.end(), max_func)), Wc(0,a)); - //Wc(1,a) = MAX(MAXVAL(ABS(Val(1:13:4,i))), Wc(1,a)) - - auto vals2 = Val.get_values({1,13}, {i,i}, 4); - Wc(1,a) = std::max(fabs(*std::max_element(vals2.begin(), vals2.end(), max_func)), Wc(1,a)); - //Wc(2,a) = MAX(MAXVAL(ABS(Val(2:14:4,i))), Wc(2,a)) - - auto vals3 = Val.get_values({2,14}, {i,i}, 4); - Wc(2,a) = std::max(fabs(*std::max_element(vals3.begin(), vals3.end(), max_func)), Wc(2,a)); - //Wc(3,a) = MAX(MAXVAL(ABS(Val(3:15:4,i))), Wc(3,a)) - - auto vals4 = Val.get_values({3,15}, {i,i}, 4); - Wc(3,a) = std::max(fabs(*std::max_element(vals4.begin(), vals4.end(), max_func)), Wc(3,a)); - //Wc(4,a) = MAX(MAXVAL(ABS(Val(4:16:4,i))), Wc(4,a)) - } - } - break; - - default: - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - - for (int i = 0; i < dof; i++) { - int j = i*dof + 1; - int k = (i+1)*dof - 1; - //j = i*dof - dof + 1; - auto vals = Val.get_values({j,k}, {a,b}); - Wr(i,Ac) = fabs(*std::max_element(vals.begin(), vals.end(), max_func)); - //Wr(i,Ac) = MAXVAL(ABS(Val(j:i*dof,a:b))) - } - - for (int i = rowPtr(0,Ac); i <= rowPtr(1,Ac); i++) { - a = colPtr(i); - - for (int b = 0; b < dof; b++) { - int j = dof*(dof-1) + b; - auto vals = Val.get_values({b,j}, {i,i}, dof); - Wc(b,a) = std::max(fabs(*std::max_element(vals.begin(), vals.end(), max_func)), Wc(b,a)); - //int j = dof*(dof-1) + b; - //Wc(b,a) = MAX(MAXVAL(ABS(Val(b:j:dof,i))),Wc(b,a)) - } - } - } - break; - } - - //Wr.write(msg_prefix+"Wr"); - //Wc.write(msg_prefix+"Wc"); - //exit(0); - - fsils_commuv(lhs, dof, Wr); - //CALL FSILS_COMMUV(lhs, dof, Wr) - - fsils_commuv(lhs, dof, Wc); - //CALL FSILS_COMMUV(lhs, dof, Wc) - - if ((max(abs(1.0 - Wr)) < tol) && (max(abs(1.0 - Wc)) < tol)) { - flag = false; - } - //if (MAXVAL(ABS(1.0 - Wr)) .LT. tol .AND. MAXVAL(ABS(1.0 - Wc)) .LT. tol) flag = .FALSE. - - //Array A{{4.0, 16.0}, {100.0, 100.0*100.0}}; - //std::cout << msg_prefix << "sqrt(A): " << sqrt(A) << std::endl; - //A = 1.0 / sqrt(A); - //std::cout << msg_prefix << "A: " << A << std::endl; - - Wr = 1.0 / sqrt(Wr); - Wc = 1.0 / sqrt(Wc); - - //Wr.write(msg_prefix+"Wr"); - //Wc.write(msg_prefix+"Wc"); - //exit(0); - - pre_mul(rowPtr, lhs.nNo, lhs.nnz, dof, Val, Wr); - //CALL PREMUL(rowPtr, lhs.nNo, lhs.nnz, dof, Val, Wr) - - pos_mul(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, Wc); - //CALL POSMUL(rowPtr, colPtr, lhs.nNo, lhs.nnz, dof, Val, Wc) - - W1 = W1 * Wr; - W2 = W2 * Wc; - - if (lhs.commu.nTasks > 1) { - int iflag = flag; - std::vector gflag(lhs.commu.nTasks); - MPI_Allgather(&iflag, 1, cm_mod::mplog, gflag.data(), 1, cm_mod::mplog, lhs.commu.comm); - //CALL MPI_ALLGATHER(flag, 1, mplog, gflag, 1, mplog, lhs.commu.comm, ierr) - flag = std::find(gflag.begin(), gflag.end(), 1) != gflag.end(); - //flag = ANY(gflag) - } - } // while - - // Multipling R with Wr: R = Wr*R - R = W1 * R; - - //Wr.write(msg_prefix+"Wr"); - //Wc.write(msg_prefix+"Wc"); - //Val.write(msg_prefix+"Val"); - //R.write(msg_prefix+"R"); - //exit(0); -} - -//--------- -// pre_mul -//--------- -// Pre-multipling Val with W: Val = W*Val. -// -// Modifies: Val(dof*dof, nnz) -// -// W(dof,nNo) -// -void pre_mul(const Array& rowPtr, const int nNo, const int nnz, const int dof, Array& Val, const Array& W) -{ - //auto msg_prefix = std::string("[pre_mul] "); - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "========== pre_mul ==========" << std::endl; - //std::cout << msg_prefix << "dof: " << dof << std::endl; - - switch (dof) { - case 1: { - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - for (int j = a; j <= b; j++) { - Val(0,j) = Val(0,j)*W(0,Ac); - } - //Val(1,a:b) = Val(1,a:b)*W(1,Ac); - } - } break; - - case 2: { - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - for (int i = 0; i < 2; i++) { - for (int j = a; j <= b; j++) { - Val(i+0,j) = Val(i+0,j)*W(0,Ac); - Val(i+2,j) = Val(i+2,j)*W(1,Ac); - } - } - //Val(1:2,a:b) = Val(1:2,a:b)*W(1,Ac) - //Val(3:4,a:b) = Val(3:4,a:b)*W(2,Ac) - } - } break; - - case 3: { - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - for (int i = 0; i < 3; i++) { - for (int j = a; j <= b; j++) { - Val(i+0,j) = Val(i+0,j)*W(0,Ac); - Val(i+3,j) = Val(i+3,j)*W(1,Ac); - Val(i+6,j) = Val(i+6,j)*W(2,Ac); - } - } - //Val(1:3,a:b) = Val(1:3,a:b)*W(1,Ac) - //Val(4:6,a:b) = Val(4:6,a:b)*W(2,Ac) - //Val(7:9,a:b) = Val(7:9,a:b)*W(3,Ac) - } - } break; - - case 4: { - //std::cout << msg_prefix << "case 4 ... " << std::endl; - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - //std::cout << msg_prefix << "a: " << a << " b: " << b << std::endl; - for (int i = 0; i < 4; i++) { - for (int j = a; j <= b; j++) { - Val(i+0,j) = Val(i+0,j)*W(0,Ac); - Val(i+4,j) = Val(i+4,j)*W(1,Ac); - Val(i+8,j) = Val(i+8,j)*W(2,Ac); - Val(i+12,j) = Val(i+12,j)*W(3,Ac); - } - } - //Val(1:4,a:b) = Val(1:4,a:b)*W(1,Ac) - //Val(5:8,a:b) = Val(5:8,a:b)*W(2,Ac) - //Val(9:12,a:b) = Val(9:12,a:b)*W(3,Ac) - //Val(13:16,a:b) = Val(13:16,a:b)*W(4,Ac) - } - } break; - - // Fill rows of 'Val' with length 'dof'. - // - default: { - for (int Ac = 0; Ac < nNo; Ac++) { - int a = rowPtr(0,Ac); - int b = rowPtr(1,Ac); - - // [TODO:DaveP] careful with the indexing - // - // Fortran - // i=1 j=1 - // i=2 j=dof+1 - // i=3 j=2*dof+1 - // - for (int i = 0; i < dof; i++) { - int j = i*dof; - //int j = i*dof - dof + 1; -> dof * (i-1) + 1 - - for (int m = j; m < j+dof; m++) { - for (int n = a; n <= b; n++) { - Val(m,n) = Val(m,n) * W(i,Ac); - } - } - //Val( j:i*dof, a:b ) = Val( j:i*dof , a:b) * W(i,Ac) - - } - } - } break; - } -} - -}; diff --git a/Code/Source/svFSILS/back/precond.h b/Code/Source/svFSILS/back/precond.h deleted file mode 100644 index 53079b97e..000000000 --- a/Code/Source/svFSILS/back/precond.h +++ /dev/null @@ -1,16 +0,0 @@ - -#include "fils_struct.hpp" - -namespace precond { - -void pos_mul(const Array& rowPtr, const Vector& colPtr, const int nNo, const int nnz, const int dof, Array& Val, const Array& W); - -void precond_diag(fsi_linear_solver::FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, const Vector& diagPtr, - const int dof, Array& Val, Array& R, Array& W); - -void precond_rcs(fsi_linear_solver::FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const Vector& diagPtr, const int dof, Array& Val, Array& R, Array& W1, Array& W2); - -void pre_mul(const Array& rowPtr, const int nNo, const int nnz, const int dof, Array& Val, const Array& W); - -}; diff --git a/Code/Source/svFSILS/back/solve.cpp b/Code/Source/svFSILS/back/solve.cpp deleted file mode 100644 index 6705ebbb0..000000000 --- a/Code/Source/svFSILS/back/solve.cpp +++ /dev/null @@ -1,211 +0,0 @@ - -// In this routine, the appropriate LS algorithm is called and -// the solution is returned. - -#include "lhs.h" -#include "CmMod.h" -#include "bicgs.h" -#include "cgrad.h" -#include "gmres.h" -#include "ns_solver.h" -#include "precond.h" - -namespace fsi_linear_solver { - -//------------- -// fsils_solve -//------------- -// -// Modifies: Val, Ri -// -// Ri(dof,lhs.nNo): Residual -// Val(dof*dof,lhs.nnz): LHS -// -// Reproduces 'SUBROUTINE FSILS_SOLVE (lhs, ls, dof, Ri, Val, prec, incL, res)'. -// -void fsils_solve(FSILS_lhsType& lhs, FSILS_lsType& ls, const int dof, Array& Ri, Array& Val, - const consts::PreconditionerType prec, const Vector& incL, const Vector& res) -{ - using namespace consts; - - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_solve:") + std::to_string(tid) + "] "; - #define n_debug_fsils_solve - #ifdef debug_fsils_solve - std::cout << msg_prefix << std::endl; - std::cout << msg_prefix << "========== fsils_solve ==========" << std::endl; - #endif - - const int nNo = lhs.nNo; - const int nnz = lhs.nnz; - const int nFaces = lhs.nFaces; - #ifdef debug_fsils_solve - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - std::cout << msg_prefix << "nnz: " << nnz << std::endl; - std::cout << msg_prefix << "nFaces: " << nFaces << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "ls.LS_type: " << ls.LS_type << std::endl; - #endif - - if (lhs.nFaces != 0) { - for (auto& face : lhs.face) { - face.incFlag = true; - } - - if (incL.size() != 0) { - #ifdef debug_fsils_solve - std::cout << msg_prefix << "incL is present" << std::endl; - #endif - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - #ifdef debug_fsils_solve - std::cout << msg_prefix << "incL[" << faIn << "]: " << incL[faIn] << std::endl; - #endif - if (incL(faIn) == 0) { - lhs.face[faIn].incFlag = false; - } - } - } - - bool flag = false; - for (auto& face : lhs.face) { - if (face.bGrp == BcType::BC_TYPE_Neu) { - flag = true; - break; - } - } - //flag = ANY(lhs%face%bGrp.EQ.BC_TYPE_Neu) - //std::cout << msg_prefix << "flag: " << flag << std::endl; - - if (res.size() == 0 && flag) { - //PRINT *, "FSILS: res is required for Neu surfaces" - //STOP "FSILS: FATAL ERROR" - throw std::runtime_error("[fsils_solve] res is required for Neu surfaces"); - } - - for (int faIn = 0; faIn < lhs.nFaces; faIn++) { - auto& face = lhs.face[faIn]; - face.coupledFlag = false; - if (!face.incFlag) { - continue; - } - bool flag = (face.bGrp == BcType::BC_TYPE_Neu); - if (flag && res(faIn) != 0.0) { - face.res = res(faIn); - face.coupledFlag = true; - } - } - } - - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Copy Ri into R ..." << std::endl; - Array R(dof,nNo), Wr(dof,nNo), Wc(dof,nNo); - - for (int a = 0; a < nNo; a++) { - //std::cout << msg_prefix << "a: " << a+1 << " lhs.map(a): " << lhs.map(a) << std::endl; - for (int i = 0; i < dof; i++) { - R(i,lhs.map(a)) = Ri(i,a); - } - //R(:,lhs.map(a)) = Ri(:,a) - } - - //Ri.write(msg_prefix+"Ri"); - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - // Apply preconditioner. - // - // Modifies Val and R. - // - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Compute preconditioner ..." << std::endl; - - if (prec == PreconditionerType::PREC_FSILS) { - #ifdef debug_fsils_solve - std::cout << msg_prefix << "preconditioner PREC_FSILS " << std::endl; - #endif - precond::precond_diag(lhs, lhs.rowPtr, lhs.colPtr, lhs.diagPtr, dof, Val, R, Wc); - //CALL PRECONDDIAG(lhs, lhs.rowPtr, lhs.colPtr, lhs.diagPtr, dof, Val, R, Wc) - } else if (prec == PreconditionerType::PREC_RCS) { - #ifdef debug_fsils_solve - std::cout << msg_prefix << "preconditioner PREC_RCS" << std::endl; - #endif - precond::precond_rcs(lhs, lhs.rowPtr, lhs.colPtr, lhs.diagPtr, dof, Val, R, Wr, Wc); - //CALL PRECONDRCS(lhs, lhs.rowPtr, lhs.colPtr, lhs.diagPtr, dof, Val, R, Wr, Wc) - } else { - //PRINT *, "This linear solver and preconditioner combination is not supported." - } - - //Wc.write(msg_prefix+"Wc"); - //R.write(msg_prefix+"R"); - //Val.write(msg_prefix+"Val"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - //std::cout << msg_prefix << std::endl; - //std::cout << msg_prefix << "Solve ..." << std::endl; - - // Solve for 'R'. - // - switch (ls.LS_type) { - case LinearSolverType::LS_TYPE_NS: - //std::cout << msg_prefix << "solve using LS_TYPE_NS " << std::endl; - ns_solver::ns_solver(lhs, ls, dof, Val, R); - //CALL NSSOLVER(lhs, ls, dof, Val, R) - break; - - case LinearSolverType::LS_TYPE_GMRES: - if (dof == 1) { - auto Valv = Val.row(0); - auto Rv = R.row(0); - gmres::gmres_s(lhs, ls.RI, dof, Valv, Rv); - Val.set_row(0,Valv); - R.set_row(0,Rv); - //CALL GMRESS(lhs, ls.RI, Val, R) - } else { - gmres::gmres_v(lhs, ls.RI, dof, Val, R); - //CALL GMRESV(lhs, ls.RI, dof, Val, R) - } - break; - - case LinearSolverType::LS_TYPE_CG: - if (dof == 1) { - throw std::runtime_error("FSILS: CGRADS is not implemented"); - //CALL CGRADS(lhs, ls.RI, Val, R) - } else { - cgrad::cgrad_v(lhs, ls.RI, dof, Val, R); - //CALL CGRADV(lhs, ls.RI, dof, Val, R) - } - break; - - case LinearSolverType::LS_TYPE_BICGS: - if (dof == 1) { - throw std::runtime_error("FSILS: BICGSS is not implemented"); - //CALL BICGSS(lhs, ls.RI, Val, R) - } else { - bicgs::bicgsv(lhs, ls.RI, dof, Val, R); - //CALL BICGSV(lhs, ls.RI, dof, Val, R) - } - break; - - default: - throw std::runtime_error("FSILS: LS_type not defined"); - } - - // Element-wise multiplication. - // - for (int i = 0; i < Wc.size(); i++) { - R(i) = Wc(i) * R(i); - } - //R = Wc*R; - - for (int a = 0; a < nNo; a++) { - for (int i = 0; i < R.num_rows(); i++) { - Ri(i,a) = R(i,lhs.map(a)); - } - //Ri(:,a) = R(:,lhs.map(a)) - } -} - -}; diff --git a/Code/Source/svFSILS/back/spar_mul.cpp b/Code/Source/svFSILS/back/spar_mul.cpp deleted file mode 100644 index 9e6c78fd8..000000000 --- a/Code/Source/svFSILS/back/spar_mul.cpp +++ /dev/null @@ -1,328 +0,0 @@ - -//-------------------------------------------------------------------- -// Product of a sparse matrix and a vector. The matrix might be -// vector in neither, one or both dimensions. -//-------------------------------------------------------------------- -// -// Reproduces code in SPARMUL.f. - -#include "spar_mul.h" - -#include "fsils_api.hpp" - -namespace spar_mul { - -//------------------- -// fsils_spar_mul_ss -//------------------- -// Reproduces 'SUBROUTINE FSILS_SPARMULSS(lhs, rowPtr, colPtr, K, U, KU)' -// -void fsils_spar_mul_ss(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const Vector& K, const Vector& U, Vector& KU) -{ -#define n_debug_fsils_spar_mul_ss - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_spar_mul_ss:") + std::to_string(tid) + "] "; -#ifdef debug_fsils_spar_mul_ss - std::cout << msg_prefix << "========== fsils_spar_mul_ss ==========" << std::endl; -#endif - - int nNo = lhs.nNo; - KU = 0.0; - - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - KU(i) = KU(i) + K(j) * U(colPtr(j)); - } - } - - fsils_commus(lhs, KU); - //CALL FSILS_COMMUS(lhs, KU) - //std::cout << msg_prefix << "Done" << std::endl; - - //Vector::write_disabled = false; - //KU.write(msg_prefix+"KU"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); -} - -//------------------- -// fsils_spar_mul_sv -//------------------- -// Reproduces 'SUBROUTINE FSILS_SPARMULSV(lhs, rowPtr, colPtr, dof, K, U, KU)'. -// -void fsils_spar_mul_sv(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Vector& U, Array& KU) -{ - #define n_debug_fsils_spar_mul_sv - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_spar_mul_sv:") + std::to_string(tid) + "] "; - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "========== fsils_spar_mul_sv ==========" << std::endl; - #endif - - int nNo = lhs.nNo; - KU = 0.0; - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "dof: " << dof << std::endl; - std::cout << msg_prefix << "nNo: " << nNo << std::endl; - #endif - - switch (dof) { - - case 1: - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "case 1" << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - KU(0,i) = KU(0,i) + K(0,j)*U(colPtr(j)); - } - } - break; - - case 2: { - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "case 2" << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) = KU(0,i) + K(0,j)*U(col); - KU(1,i) = KU(1,i) + K(1,j)*U(col); - } - } - - } break; - - case 3: { - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "case 3" << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) += K(0,j) * U(col); - KU(1,i) += K(1,j) * U(col); - KU(2,i) += K(2,j) * U(col); - } - } - } break; - - case 4: - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "case 4" << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) = KU(0,i) + K(0,j)*U(col); - KU(1,i) = KU(1,i) + K(1,j)*U(col); - KU(2,i) = KU(2,i) + K(2,j)*U(col); - KU(3,i) = KU(3,i) + K(3,j)*U(col); - } - } - break; - - default: - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "defaults" << std::endl; - #endif - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - for (int m = 0; m < KU.num_rows(); m++) { - KU(m,i) = KU(m,i) + K(m,j) * U(col); - } - //KU(:,i) = KU(:,i) + K(:,j)*U(colPtr(j)) - } - } - } - - //U.write(msg_prefix+"U"); - //K.write(msg_prefix+"K"); - //colPtr.write(msg_prefix+"colPtr",1); - //rowPtr.write(msg_prefix+"rowPtr",true,1); - - fsils_commuv(lhs, dof, KU); - //CALL FSILS_COMMUV(lhs, dof, KU) - - //KU.write(msg_prefix+"KU"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); - - #ifdef debug_fsils_spar_mul_sv - std::cout << msg_prefix << "Done" << std::endl; - #endif -} - -//------------------- -// fsils_spar_mul_vs -//------------------- -// Reproduces 'SUBROUTINE FSILS_SPARMULVS(lhs, rowPtr, colPtr, dof, K, U, KU)'. -// -void fsils_spar_mul_vs(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Array& U, Vector& KU) -{ - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_spar_mul_vs:") + std::to_string(tid) + "] "; - /* - std::cout << msg_prefix << "========== fsils_spar_mul_vs ==========" << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - */ - - int nNo = lhs.nNo; - KU = 0.0; - - switch (dof) { - - case 1: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - KU(i) = KU(i) + K(0,j) * U(0,colPtr(j)); - } - } - break; - - case 2: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(i) = KU(i) + K(0,j)*U(0,col) + K(1,j)*U(1,col); - } - } - break; - - case 3: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(i) = KU(i) + K(0,j)*U(0,col) + K(1,j)*U(1,col) + K(2,j)*U(2,col); - } - } - break; - - case 4: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(i) = KU(i) + K(0,j)*U(0,col) + K(1,j)*U(1,col) + K(2,j)*U(2,col) + K(3,j)*U(3,col); - } - } - break; - - default: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - double sum = 0.0; - for (int m = 0; m < K.num_rows(); m++) { - sum += K(m,j) * U(m,col); - } - KU(i) = KU(i) + sum; - //KU(i) = KU(i) + SUM(K(:,j)*U(:,colPtr(j))) - } - } - } - - fsils_commus(lhs, KU); - //CALL FSILS_COMMUS(lhs, KU) - - //KU.write(msg_prefix+"KU"); - //MPI_Barrier(lhs.commu.comm); - //exit(0); -} - -//-------------------- -// fsi_ls_spar_mul_vv -//-------------------- -// Reproduces 'SUBROUTINE FSILS_SPARMULVV(lhs, rowPtr, colPtr, dof, K, U, KU)'. -// -void fsils_spar_mul_vv(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Array& U, Array& KU) -{ - #define n_debug_fsils_spar_mul_vv - #ifdef debug_fsils_spar_mul_vv - int tid = lhs.commu.task; - auto msg_prefix = std::string("[fsils_spar_mul_vv:") + std::to_string(tid) + "] "; - std::cout << msg_prefix << "========== fsils_spar_mul_vv ==========" << std::endl; - std::cout << msg_prefix << "dof: " << dof << std::endl; - #endif - - int nNo = lhs.nNo; - KU = 0.0; - //U.write(msg_prefix+"U"); - - switch (dof) { - - case 1: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - KU(0,i) = KU(0,i) + K(0,j)*U(0,colPtr(j)); - } - } - break; - - case 2: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) = KU(0,i) + K(0,j)*U(0,col) + K(1,j)*U(1,col); - KU(1,i) = KU(1,i) + K(2,j)*U(0,col) + K(3,j)*U(1,col); - } - } - break; - - case 3: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) = KU(0,i) + K(0,j)*U(0,col) + K(1,j)*U(1,col) + K(2,j)*U(2,col); - KU(1,i) = KU(1,i) + K(3,j)*U(0,col) + K(4,j)*U(1,col) + K(5,j)*U(2,col); - KU(2,i) = KU(2,i) + K(6,j)*U(0,col) + K(7,j)*U(1,col) + K(8,j)*U(2,col); - //std::cout << msg_prefix << "col: " << col << std::endl; - } - } - break; - - case 4: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - KU(0,i) = KU(0,i) + K(0 ,j)*U(0,col) + K(1 ,j)*U(1,col) + K(2 ,j)*U(2,col) + K(3 ,j)*U(3,col); - KU(1,i) = KU(1,i) + K(4 ,j)*U(0,col) + K(5 ,j)*U(1,col) + K(6 ,j)*U(2,col) + K(7 ,j)*U(3,col); - KU(2,i) = KU(2,i) + K(8 ,j)*U(0,col) + K(9,j)*U(1,col) + K(10,j)*U(2,col) + K(11,j)*U(3,col); - KU(3,i) = KU(3,i) + K(12,j)*U(0,col) + K(13,j)*U(1,col) + K(14,j)*U(2,col) + K(15,j)*U(3,col); - } - } - break; - - default: - for (int i = 0; i < nNo; i++) { - for (int j = rowPtr(0,i); j <= rowPtr(1,i); j++) { - int col = colPtr(j); - for (int l = 0; l < dof; l++) { - int e = l*dof; - int s = e - dof + 1;; - double sum = 0.0; - for (int k = 0; k < dof; k++) { - sum += K(k+s,j) * U(k,col); - } - KU(l,i) = KU(l,i) + sum; - //KU(l,i) = KU(l,i) + SUM(K(s:e,j)*U(:,col)) - } - } - } - } - - //KU.write(msg_prefix+"KU"); - - fsils_commuv(lhs, dof, KU); - //CALL FSILS_COMMUV(lhs, dof, KU) - //std::cout << msg_prefix << "Done" << std::endl; -} - - -}; - - diff --git a/Code/Source/svFSILS/back/spar_mul.h b/Code/Source/svFSILS/back/spar_mul.h deleted file mode 100644 index 992e8edd9..000000000 --- a/Code/Source/svFSILS/back/spar_mul.h +++ /dev/null @@ -1,20 +0,0 @@ - -#include "fils_struct.hpp" - -namespace spar_mul { - -using namespace fsi_linear_solver; - -void fsils_spar_mul_ss(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const Vector& K, const Vector& U, Vector& KU); - -void fsils_spar_mul_sv(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Vector& U, Array& KU); - -void fsils_spar_mul_vs(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Array& U, Vector& KU); - -void fsils_spar_mul_vv(FSILS_lhsType& lhs, const Array& rowPtr, const Vector& colPtr, - const int dof, const Array& K, const Array& U, Array& KU); - -}; diff --git a/Code/Source/svFSILS/back/t b/Code/Source/svFSILS/back/t deleted file mode 100644 index ba11d0175..000000000 --- a/Code/Source/svFSILS/back/t +++ /dev/null @@ -1,2 +0,0 @@ -diffusion, advection-diffusion, linear elastodynamics, nonlinear elastodynamics, nonlinear elastodynamics, -Stokes flow, the coupled momentum method, FSI, mesh motion, cardiac electrophysiology and thin shell mechanics. diff --git a/Code/Source/svFSILS/t b/Code/Source/svFSILS/t deleted file mode 100644 index ba11d0175..000000000 --- a/Code/Source/svFSILS/t +++ /dev/null @@ -1,2 +0,0 @@ -diffusion, advection-diffusion, linear elastodynamics, nonlinear elastodynamics, nonlinear elastodynamics, -Stokes flow, the coupled momentum method, FSI, mesh motion, cardiac electrophysiology and thin shell mechanics. diff --git a/Code/ThirdParty/README.md b/Code/ThirdParty/README.md index 7c6e0b7ef..e682a832e 100644 --- a/Code/ThirdParty/README.md +++ b/Code/ThirdParty/README.md @@ -1,18 +1,32 @@ -This directory contains the source for external applications used by svFSIplus. The applications are compiled and liked with svFSIplus. +This directory contains the source for external applications used by svFSIplus. The applications are compiled and liked with svMultiPhysics. Each application has its own license agreement. +------------ Applications +------------ eigen - A header-only application for matrix objects. -gklib_svfsi - A library used by METIS and ParMETIS applications. +gklib_internal - A library used by METIS and ParMETIS applications. -metis_svfsi - The METIS mesh partitioning application used by ParMETIS. +metis_internal - The METIS mesh partitioning application used by ParMETIS. -parmetis_svfsi - The ParMETIS parallel mesh partitioning application. +parmetis_internal - The ParMETIS parallel mesh partitioning application. tetgen - A mesh generatin application. tinyxml - A header-only application used to read and write XML files. +--------- +IMPORTANT +--------- + +The *_internal directory names must agree with the names given in + + Code/CMake/SimVascularInternals.cmake + Code/CMake/SimVascularThirdParty.cmake + +They are also referenced in ThirdParty and the solver/CMakeLists.txt file. + + diff --git a/Code/ThirdParty/gklib_internal/CMakeLists.txt b/Code/ThirdParty/gklib_internal/CMakeLists.txt new file mode 100644 index 000000000..507182357 --- /dev/null +++ b/Code/ThirdParty/gklib_internal/CMakeLists.txt @@ -0,0 +1 @@ +simvascular_third_party(gklib_internal) diff --git a/Code/ThirdParty/gklib_svfsi/README.md b/Code/ThirdParty/gklib_internal/README.md similarity index 100% rename from Code/ThirdParty/gklib_svfsi/README.md rename to Code/ThirdParty/gklib_internal/README.md diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi.h.in b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal.h.in similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi.h.in rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal.h.in diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/CMakeLists.txt b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/CMakeLists.txt similarity index 86% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/CMakeLists.txt rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/CMakeLists.txt index f2cc86ada..61695aef9 100644 --- a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/CMakeLists.txt +++ b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.8) -project(GKLIB_SVFSI) +project(GKLIB_INTERNAL) #set default build type to relwithdebinfo, also sets flags O2 on linux if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) @@ -27,13 +27,13 @@ set(CSRCS b64.c blas.c cache.c csr.c error.c evaluate.c ) if(SV_USE_THIRDPARTY_SHARED_LIBRARIES) - add_library(${GKLIB_SVFSI_LIBRARY_NAME} SHARED ${CSRCS}) + add_library(${GKLIB_INTERNAL_LIBRARY_NAME} SHARED ${CSRCS}) else() - add_library(${GKLIB_SVFSI_LIBRARY_NAME} STATIC ${CSRCS}) + add_library(${GKLIB_INTERNAL_LIBRARY_NAME} STATIC ${CSRCS}) endif() if(SV_INSTALL_LIBS) - install(TARGETS ${GKLIB_SVFSI_LIBRARY_NAME} + install(TARGETS ${GKLIB_INTERNAL_LIBRARY_NAME} RUNTIME DESTINATION ${SV_INSTALL_RUNTIME_DIR} COMPONENT ThirdPartyExecutables LIBRARY DESTINATION ${SV_INSTALL_LIBRARY_DIR} COMPONENT ThirdPartyLibraries ARCHIVE DESTINATION ${SV_INSTALL_ARCHIVE_DIR} COMPONENT ThirdPartyLibraries) diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/GKlib.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/GKlib.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/GKlib.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/GKlib.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/b64.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/b64.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/b64.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/b64.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/blas.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/blas.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/blas.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/blas.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/cache.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/cache.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/cache.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/cache.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/csr.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/csr.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/csr.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/csr.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/error.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/error.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/error.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/error.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/evaluate.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/evaluate.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/evaluate.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/evaluate.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/fkvkselect.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/fkvkselect.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/fkvkselect.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/fkvkselect.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/fs.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/fs.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/fs.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/fs.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/getopt.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/getopt.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/getopt.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/getopt.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_arch.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_arch.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_arch.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_arch.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_defs.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_defs.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_defs.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_defs.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_externs.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_externs.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_externs.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_externs.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_getopt.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_getopt.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_getopt.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_getopt.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_macros.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_macros.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_macros.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_macros.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkblas.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkblas.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkblas.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkblas.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkmemory.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkmemory.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkmemory.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkmemory.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkpqueue.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkpqueue.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkpqueue.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkpqueue.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkpqueue2.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkpqueue2.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkpqueue2.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkpqueue2.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkrandom.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkrandom.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkrandom.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkrandom.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mksort.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mksort.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mksort.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mksort.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkutils.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkutils.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_mkutils.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_mkutils.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_inttypes.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_inttypes.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_inttypes.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_inttypes.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_stat.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_stat.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_stat.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_stat.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_stdint.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_stdint.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_ms_stdint.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_ms_stdint.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_proto.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_proto.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_proto.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_proto.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_struct.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_struct.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_struct.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_struct.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_types.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_types.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_types.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_types.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_util.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_util.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gk_util.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gk_util.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gkregex.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gkregex.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gkregex.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gkregex.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gkregex.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gkregex.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/gkregex.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/gkregex.h diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/graph.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/graph.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/graph.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/graph.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/htable.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/htable.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/htable.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/htable.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/io.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/io.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/io.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/io.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/itemsets.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/itemsets.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/itemsets.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/itemsets.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/mcore.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/mcore.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/mcore.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/mcore.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/memory.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/memory.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/memory.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/memory.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/pqueue.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/pqueue.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/pqueue.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/pqueue.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/random.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/random.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/random.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/random.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/rw.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/rw.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/rw.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/rw.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/seq.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/seq.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/seq.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/seq.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/sort.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/sort.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/sort.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/sort.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/string.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/string.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/string.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/string.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/timers.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/timers.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/timers.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/timers.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/tokenizer.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/tokenizer.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/tokenizer.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/tokenizer.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/win32/adapt.c b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/win32/adapt.c similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/win32/adapt.c rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/win32/adapt.c diff --git a/Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/win32/adapt.h b/Code/ThirdParty/gklib_internal/simvascular_gklib_internal/win32/adapt.h similarity index 100% rename from Code/ThirdParty/gklib_svfsi/simvascular_gklib_svfsi/win32/adapt.h rename to Code/ThirdParty/gklib_internal/simvascular_gklib_internal/win32/adapt.h diff --git a/Code/ThirdParty/gklib_svfsi/CMakeLists.txt b/Code/ThirdParty/gklib_svfsi/CMakeLists.txt deleted file mode 100644 index 61844e2dc..000000000 --- a/Code/ThirdParty/gklib_svfsi/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -simvascular_third_party(gklib_svfsi) diff --git a/Code/ThirdParty/metis_internal/CMakeLists.txt b/Code/ThirdParty/metis_internal/CMakeLists.txt new file mode 100644 index 000000000..9b5f56de6 --- /dev/null +++ b/Code/ThirdParty/metis_internal/CMakeLists.txt @@ -0,0 +1 @@ +simvascular_third_party(metis_internal) diff --git a/Code/ThirdParty/metis_svfsi/README.md b/Code/ThirdParty/metis_internal/README.md similarity index 100% rename from Code/ThirdParty/metis_svfsi/README.md rename to Code/ThirdParty/metis_internal/README.md diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi.h.in b/Code/ThirdParty/metis_internal/simvascular_metis_internal.h.in similarity index 92% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi.h.in rename to Code/ThirdParty/metis_internal/simvascular_metis_internal.h.in index 6d34faa32..bef436831 100644 --- a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi.h.in +++ b/Code/ThirdParty/metis_internal/simvascular_metis_internal.h.in @@ -28,10 +28,10 @@ * *=========================================================================*/ -#ifndef __simvascular_metis_svfsi_h -#define __simvascular_metis_svfsi_h +#ifndef __simvascular_metis_internal_h +#define __simvascular_metis_internal_h # hardcoded to build, update if want to allow system version -#include +#include #endif diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/CHANGES b/Code/ThirdParty/metis_internal/simvascular_metis_internal/CHANGES similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/CHANGES rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/CHANGES diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/CMakeLists.txt b/Code/ThirdParty/metis_internal/simvascular_metis_internal/CMakeLists.txt similarity index 76% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/CMakeLists.txt rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/CMakeLists.txt index 4e6d19f05..13bcc2af8 100644 --- a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/CMakeLists.txt +++ b/Code/ThirdParty/metis_internal/simvascular_metis_internal/CMakeLists.txt @@ -1,11 +1,13 @@ cmake_minimum_required(VERSION 2.8.8) -project(METIS_SVFSI) -if (NOT METIS_SVFSI_LIBRARY_NAME) - set(METIS_SVFSI_LIBRARY_NAME metis_svfsi) + +project(METIS_INTERNAL) + +if (NOT METIS_INTERNAL_LIBRARY_NAME) + set(METIS_INTERNAL_LIBRARY_NAME metis_internal) endif() -if (NOT PARMETIS_SVFSI_LIBRARY_NAME) - set(PARMETIS_SVFSI_LIBRARY_NAME parmetis_svfsi) +if (NOT PARMETIS_INTERNAL_LIBRARY_NAME) + set(PARMETIS_INTERNAL_LIBRARY_NAME parmetis_internal) endif() #set default build type to relwithdebinfo, also sets flags O2 on linux diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/INSTALL b/Code/ThirdParty/metis_internal/simvascular_metis_internal/INSTALL similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/INSTALL rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/INSTALL diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/LICENSE.txt b/Code/ThirdParty/metis_internal/simvascular_metis_internal/LICENSE.txt similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/LICENSE.txt rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/LICENSE.txt diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/.gitignore b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/.gitignore similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/.gitignore rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/.gitignore diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/CMakeLists.txt b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/CMakeLists.txt similarity index 60% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/CMakeLists.txt rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/CMakeLists.txt index 451d45832..52b7db33e 100644 --- a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/CMakeLists.txt +++ b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/CMakeLists.txt @@ -1,5 +1,5 @@ include_directories(./) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../gklib_svfsi/simvascular_gklib_svfsi) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../gklib_internal/simvascular_gklib_internal) include_directories(${MPI_C_INCLUDE_PATH}) set(CSRCS auxapi.c balance.c bucketsort.c checkgraph.c coarsen.c @@ -11,13 +11,13 @@ set(CSRCS auxapi.c balance.c bucketsort.c checkgraph.c coarsen.c ) if(SV_USE_THIRDPARTY_SHARED_LIBRARIES) - add_library(${METIS_SVFSI_LIBRARY_NAME} SHARED ${CSRCS}) + add_library(${METIS_INTERNAL_LIBRARY_NAME} SHARED ${CSRCS}) else() - add_library(${METIS_SVFSI_LIBRARY_NAME} STATIC ${CSRCS}) + add_library(${METIS_INTERNAL_LIBRARY_NAME} STATIC ${CSRCS}) endif() if(SV_INSTALL_LIBS) - install(TARGETS ${METIS_SVFSI_LIBRARY_NAME} + install(TARGETS ${METIS_INTERNAL_LIBRARY_NAME} RUNTIME DESTINATION ${SV_INSTALL_RUNTIME_DIR} COMPONENT ThirdPartyExecutables LIBRARY DESTINATION ${SV_INSTALL_LIBRARY_DIR} COMPONENT ThirdPartyLibraries ARCHIVE DESTINATION ${SV_INSTALL_ARCHIVE_DIR} COMPONENT ThirdPartyLibraries) @@ -32,44 +32,44 @@ if(SV_INSTALL_HEADERS) file(READ "metis.h" METIS_H_TEMP) set(filename "macros.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "defs.h") file(COPY ${filename} DESTINATION ${TEMP_DIR}) file(RENAME ${TEMP_DIR}/${filename} ${TEMP_DIR}/metis_${filename} ) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "proto.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "rename.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "stdheaders.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "struct.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "parmetis.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi RENAME metis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal RENAME metis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} metis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} metis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename ${TEMP_DIR}/metis.h) file(WRITE ${filename} ${METIS_H_TEMP}) - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_svfsi + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/metis_internal COMPONENT ThirdPartyHeaders) endif() diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/Makefile b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/Makefile similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/Makefile rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/Makefile diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/auxapi.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/auxapi.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/auxapi.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/auxapi.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/balance.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/balance.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/balance.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/balance.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/bucketsort.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/bucketsort.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/bucketsort.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/bucketsort.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/checkgraph.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/checkgraph.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/checkgraph.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/checkgraph.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/coarsen.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/coarsen.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/coarsen.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/coarsen.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/compress.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/compress.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/compress.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/compress.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/contig.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/contig.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/contig.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/contig.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/debug.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/debug.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/debug.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/debug.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/defs.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/defs.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/defs.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/defs.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/fm.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/fm.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/fm.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/fm.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/fortran.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/fortran.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/fortran.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/fortran.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/frename.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/frename.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/frename.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/frename.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib_defs.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib_defs.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib_defs.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib_defs.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib_rename.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib_rename.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/gklib_rename.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/gklib_rename.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/graph.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/graph.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/graph.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/graph.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/initpart.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/initpart.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/initpart.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/initpart.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kmetis.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kmetis.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kmetis.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kmetis.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kwayfm.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kwayfm.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kwayfm.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kwayfm.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kwayrefine.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kwayrefine.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/kwayrefine.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/kwayrefine.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/macros.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/macros.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/macros.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/macros.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mcutil.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mcutil.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mcutil.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mcutil.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mesh.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mesh.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mesh.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mesh.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/meshpart.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/meshpart.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/meshpart.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/meshpart.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/metis.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/metis.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/metis.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/metis.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/metislib.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/metislib.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/metislib.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/metislib.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/minconn.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/minconn.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/minconn.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/minconn.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mincover.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mincover.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mincover.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mincover.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mmd.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mmd.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/mmd.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/mmd.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/ometis.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/ometis.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/ometis.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/ometis.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/options.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/options.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/options.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/options.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/parmetis.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/parmetis.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/parmetis.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/parmetis.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/pmetis.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/pmetis.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/pmetis.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/pmetis.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/proto.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/proto.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/proto.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/proto.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/refine.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/refine.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/refine.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/refine.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/rename.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/rename.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/rename.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/rename.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/separator.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/separator.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/separator.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/separator.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/sfm.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/sfm.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/sfm.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/sfm.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/srefine.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/srefine.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/srefine.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/srefine.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/stat.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/stat.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/stat.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/stat.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/stdheaders.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/stdheaders.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/stdheaders.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/stdheaders.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/struct.h b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/struct.h similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/struct.h rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/struct.h diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/timing.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/timing.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/timing.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/timing.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/util.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/util.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/util.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/util.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/wspace.c b/Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/wspace.c similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/wspace.c rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/METISLib/wspace.c diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/Makefile b/Code/ThirdParty/metis_internal/simvascular_metis_internal/Makefile similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/Makefile rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/Makefile diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/Makefile.in b/Code/ThirdParty/metis_internal/simvascular_metis_internal/Makefile.in similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/Makefile.in rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/Makefile.in diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/README b/Code/ThirdParty/metis_internal/simvascular_metis_internal/README similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/README rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/README diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/VERSION b/Code/ThirdParty/metis_internal/simvascular_metis_internal/VERSION similarity index 100% rename from Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/VERSION rename to Code/ThirdParty/metis_internal/simvascular_metis_internal/VERSION diff --git a/Code/ThirdParty/metis_svfsi/CMakeLists.txt b/Code/ThirdParty/metis_svfsi/CMakeLists.txt deleted file mode 100644 index 9f8082c4d..000000000 --- a/Code/ThirdParty/metis_svfsi/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -simvascular_third_party(metis_svfsi) diff --git a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/temp/metis.h b/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/temp/metis.h deleted file mode 100644 index c8cd6cde9..000000000 --- a/Code/ThirdParty/metis_svfsi/simvascular_metis_svfsi/METISLib/temp/metis.h +++ /dev/null @@ -1,359 +0,0 @@ -/*! -\file metis.h -\brief This file contains function prototypes and constant definitions for METIS - * -\author George -\date Started 8/9/02 -\version\verbatim $Id$\endverbatim -*/ - -#ifndef _METIS_H_ -#define _METIS_H_ - -/**************************************************************************** -* A set of defines that can be modified by the user -*****************************************************************************/ - -/*-------------------------------------------------------------------------- - Specifies the width of the elementary data type that will hold information - about vertices and their adjacency lists. - - Possible values: - 32 : Use 32 bit signed integers - 64 : Use 64 bit signed integers - - A width of 64 should be specified if the number of vertices or the total - number of edges in the graph exceed the limits of a 32 bit signed integer - i.e., 2^31-1. - Proper use of 64 bit integers requires that the c99 standard datatypes - int32_t and int64_t are supported by the compiler. - GCC does provides these definitions in stdint.h, but it may require some - modifications on other architectures. ---------------------------------------------------------------------------*/ -// IDXTYPEWIDTH must be set to 32, setting it to 64 causes a failure. -#define IDXTYPEWIDTH 32 - -/*-------------------------------------------------------------------------- - Specifies the data type that will hold floating-point style information. - - Possible values: - 32 : single precision floating point (float) - 64 : double precision floating point (double) ---------------------------------------------------------------------------*/ -// REALTYPEWIDTH must be set to 32, setting it to 64 causes a failure. -#define REALTYPEWIDTH 32 - -/**************************************************************************** -* In principle, nothing needs to be changed beyond this point, unless the -* int32_t and int64_t cannot be found in the normal places. -*****************************************************************************/ - -/* Uniform definitions for various compilers */ -#if defined(_MSC_VER) - #define COMPILER_MSC -#endif -#if defined(__ICC) - #define COMPILER_ICC -#endif -#if defined(__GNUC__) - #define COMPILER_GCC -#endif - -/* Include c99 int definitions and need constants. When building the library, - * these are already defined by GKlib hence the test for _GKLIB_H_ */ -#ifndef _GKLIB_H_ -#ifdef COMPILER_MSC -#include - -typedef __int32 int32_t -typedef __int64 int64_t -#define PRId32 "I32d" -#define PRId64 "I64d" -#define SCNd32 "ld" -#define SCNd64 "I64d" -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#else -#include -#endif -#endif - - -/*------------------------------------------------------------------------ -* Setup the basic datatypes -*-------------------------------------------------------------------------*/ -#if IDXTYPEWIDTH == 32 - typedef int32_t idx_t - - #define IDX_MAX INT32_MAX - #define IDX_MIN INT32_MIN - - #define SCIDX SCNd32 - #define PRIDX PRId32 - - #define strtoidx strtol - #define iabs abs -#elif IDXTYPEWIDTH == 64 - typedef int64_t idx_t - - #define IDX_MAX INT64_MAX - #define IDX_MIN INT64_MIN - - #define SCIDX SCNd64 - #define PRIDX PRId64 - -#ifdef COMPILER_MSC - #define strtoidx _strtoi64 -#else - #define strtoidx strtoll -#endif - #define iabs labs -#else - #error "Incorrect user-supplied value fo IDXTYPEWIDTH" -#endif - - -#if REALTYPEWIDTH == 32 - typedef float real_t - - #define SCREAL "f" - #define PRREAL "f" - #define REAL_MAX FLT_MAX - #define REAL_MIN FLT_MIN - #define REAL_EPSILON FLT_EPSILON - - #define rabs fabsf - #define REALEQ(x,y) ((rabs((x)-(y)) <= FLT_EPSILON)) - -#ifdef COMPILER_MSC - #define strtoreal (float)strtod -#else - #define strtoreal strtof -#endif -#elif REALTYPEWIDTH == 64 - typedef double real_t - - #define SCREAL "lf" - #define PRREAL "lf" - #define REAL_MAX DBL_MAX - #define REAL_MIN DBL_MIN - #define REAL_EPSILON DBL_EPSILON - - #define rabs fabs - #define REALEQ(x,y) ((rabs((x)-(y)) <= DBL_EPSILON)) - - #define strtoreal strtod -#else - #error "Incorrect user-supplied value for REALTYPEWIDTH" -#endif - - -/*------------------------------------------------------------------------ -* Constant definitions -*-------------------------------------------------------------------------*/ -/* Metis's version number */ -#define METIS_VER_MAJOR 5 -#define METIS_VER_MINOR 2 -#define METIS_VER_SUBMINOR 1 - -/* The maximum length of the options[] array */ -#define METIS_NOPTIONS 40 - - - -/*------------------------------------------------------------------------ -* Function prototypes -*-------------------------------------------------------------------------*/ - -#ifdef _WINDLL -#define METIS_API(type) __declspec(dllexport) type __cdecl -#elif defined(__cdecl) -#define METIS_API(type) type __cdecl -#else -#define METIS_API(type) type -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - -METIS_API(int) METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, - idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, - idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, - idx_t *edgecut, idx_t *part) - -METIS_API(int) METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, - idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, - idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, - idx_t *edgecut, idx_t *part) - -METIS_API(int) METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, - idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy) - -METIS_API(int) METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, - idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy) - -METIS_API(int) METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, - idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, - idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart) - -METIS_API(int) METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, - idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, - real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, - idx_t *npart) - -METIS_API(int) METIS_NodeND(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, - idx_t *options, idx_t *perm, idx_t *iperm) - -METIS_API(int) METIS_Free(void *ptr) - -METIS_API(int) METIS_SetDefaultOptions(idx_t *options) - - -/* These functions are used by ParMETIS */ - -METIS_API(int) METIS_NodeNDP(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, - idx_t npes, idx_t *options, idx_t *perm, idx_t *iperm, - idx_t *sizes) - -METIS_API(int) METIS_ComputeVertexSeparator(idx_t *nvtxs, idx_t *xadj, idx_t *adjncy, - idx_t *vwgt, idx_t *options, idx_t *sepsize, idx_t *part) - -METIS_API(int) METIS_NodeRefine(idx_t nvtxs, idx_t *xadj, idx_t *vwgt, idx_t *adjncy, - idx_t *where, idx_t *hmarker, real_t ubfactor) - - -/* These functions are used by DGL */ - -METIS_API(int) METIS_CacheFriendlyReordering(idx_t nvtxs, idx_t *xadj, idx_t *adjncy, - idx_t *part, idx_t *old2new) - -#ifdef __cplusplus -} -#endif - - - -/*------------------------------------------------------------------------ -* Enum type definitions -*-------------------------------------------------------------------------*/ -/*! Return codes */ -typedef enum { - METIS_OK = 1, /*!< Returned normally */ - METIS_ERROR_INPUT = -2, /*!< Returned due to erroneous inputs and/or options */ - METIS_ERROR_MEMORY = -3, /*!< Returned due to insufficient memory */ - METIS_ERROR = -4 /*!< Some other errors */ -} rstatus_et - - -/*! Operation type codes */ -typedef enum { - METIS_OP_PMETIS, - METIS_OP_KMETIS, - METIS_OP_OMETIS -} moptype_et - - -/*! Options codes (i.e., options[]) */ -typedef enum { - METIS_OPTION_PTYPE, - METIS_OPTION_OBJTYPE, - METIS_OPTION_CTYPE, - METIS_OPTION_IPTYPE, - METIS_OPTION_RTYPE, - METIS_OPTION_DBGLVL, - METIS_OPTION_NIPARTS, - METIS_OPTION_NITER, - METIS_OPTION_NCUTS, - METIS_OPTION_SEED, - METIS_OPTION_ONDISK, - METIS_OPTION_MINCONN, - METIS_OPTION_CONTIG, - METIS_OPTION_COMPRESS, - METIS_OPTION_CCORDER, - METIS_OPTION_PFACTOR, - METIS_OPTION_NSEPS, - METIS_OPTION_UFACTOR, - METIS_OPTION_NUMBERING, - METIS_OPTION_DROPEDGES, - METIS_OPTION_NO2HOP, - METIS_OPTION_TWOHOP, - METIS_OPTION_FAST, - - /* Used for command-line parameter purposes */ - METIS_OPTION_HELP, - METIS_OPTION_TPWGTS, - METIS_OPTION_NCOMMON, - METIS_OPTION_NOOUTPUT, - METIS_OPTION_BALANCE, - METIS_OPTION_GTYPE, - METIS_OPTION_UBVEC -} moptions_et - - -/*! Partitioning Schemes */ -typedef enum { - METIS_PTYPE_RB, - METIS_PTYPE_KWAY -} mptype_et - -/*! Graph types for meshes */ -typedef enum { - METIS_GTYPE_DUAL, - METIS_GTYPE_NODAL -} mgtype_et - -/*! Coarsening Schemes */ -typedef enum { - METIS_CTYPE_RM, - METIS_CTYPE_SHEM -} mctype_et - -/*! Initial partitioning schemes */ -typedef enum { - METIS_IPTYPE_GROW, - METIS_IPTYPE_RANDOM, - METIS_IPTYPE_EDGE, - METIS_IPTYPE_NODE, - METIS_IPTYPE_METISRB -} miptype_et - - -/*! Refinement schemes */ -typedef enum { - METIS_RTYPE_FM, - METIS_RTYPE_GREEDY, - METIS_RTYPE_SEP2SIDED, - METIS_RTYPE_SEP1SIDED -} mrtype_et - - -/*! Debug Levels */ -typedef enum { - METIS_DBG_INFO = 1, /*!< Shows various diagnostic messages */ - METIS_DBG_TIME = 2, /*!< Perform timing analysis */ - METIS_DBG_COARSEN = 4, /*!< Show the coarsening progress */ - METIS_DBG_REFINE = 8, /*!< Show the refinement progress */ - METIS_DBG_IPART = 16, /*!< Show info on initial partitioning */ - METIS_DBG_MOVEINFO = 32, /*!< Show info on vertex moves during refinement */ - METIS_DBG_SEPINFO = 64, /*!< Show info on vertex moves during sep refinement */ - METIS_DBG_CONNINFO = 128, /*!< Show info on minimization of subdomain connectivity */ - METIS_DBG_CONTIGINFO = 256, /*!< Show info on elimination of connected components */ - METIS_DBG_MEMORY = 2048 /*!< Show info related to wspace allocation */ -} mdbglvl_et - - -/* Types of objectives */ -typedef enum { - METIS_OBJTYPE_CUT, - METIS_OBJTYPE_VOL, - METIS_OBJTYPE_NODE -} mobjtype_et - - - -#endif /* _METIS_H_ */ diff --git a/Code/ThirdParty/parmetis_internal/CMakeLists.txt b/Code/ThirdParty/parmetis_internal/CMakeLists.txt new file mode 100644 index 000000000..a279a50ab --- /dev/null +++ b/Code/ThirdParty/parmetis_internal/CMakeLists.txt @@ -0,0 +1 @@ +simvascular_third_party(parmetis_internal) diff --git a/Code/ThirdParty/parmetis_svfsi/README.md b/Code/ThirdParty/parmetis_internal/README.md similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/README.md rename to Code/ThirdParty/parmetis_internal/README.md diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi.h.in b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal.h.in similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi.h.in rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal.h.in diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/CHANGES b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/CHANGES similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/CHANGES rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/CHANGES diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/CMakeLists.txt b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/CMakeLists.txt similarity index 87% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/CMakeLists.txt rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/CMakeLists.txt index 2a55557a8..e1e89dd2d 100644 --- a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/CMakeLists.txt +++ b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8.8) -if (NOT PARMETIS_SVFSI_LIBRARY_NAME) - set(PARMETIS_SVFSI_LIBRARY_NAME parmetis_svfsi) +if (NOT PARMETIS_INTERNAL_LIBRARY_NAME) + set(PARMETIS_INTERNAL_LIBRARY_NAME parmetis_internal) endif() #set default build type to relwithdebinfo, also sets flags O2 on linux diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/INSTALL b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/INSTALL similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/INSTALL rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/INSTALL diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/LICENSE.txt b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/LICENSE.txt similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/LICENSE.txt rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/LICENSE.txt diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/Makefile b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/Makefile similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/Makefile rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/Makefile diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/Makefile.in b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/Makefile.in similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/Makefile.in rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/Makefile.in diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/CMakeLists.txt b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/CMakeLists.txt similarity index 54% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/CMakeLists.txt rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/CMakeLists.txt index 4dc5c341a..3bef995a9 100644 --- a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/CMakeLists.txt +++ b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/CMakeLists.txt @@ -1,7 +1,7 @@ #include_directories(./) -#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../gklib_svfsi/simvascular_gklib_svfsi) -#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../metis_svfsi/simvascular_metis_svfsi/METISLib) +#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../gklib_internal/simvascular_gklib_internal) +#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../metis_internal/simvascular_metis_internal/METISLib) #include_directories(${MPI_C_INCLUDE_PATH}) set(CSRCS akwayfm.c ametis.c balancemylink.c comm.c @@ -14,22 +14,22 @@ set(CSRCS akwayfm.c ametis.c balancemylink.c comm.c ) if(SV_USE_THIRDPARTY_SHARED_LIBRARIES) - add_library(${PARMETIS_SVFSI_LIBRARY_NAME} SHARED ${CSRCS}) + add_library(${PARMETIS_INTERNAL_LIBRARY_NAME} SHARED ${CSRCS}) else() - add_library(${PARMETIS_SVFSI_LIBRARY_NAME} STATIC ${CSRCS}) + add_library(${PARMETIS_INTERNAL_LIBRARY_NAME} STATIC ${CSRCS}) endif() set(third_party_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../..) -target_include_directories(${PARMETIS_SVFSI_LIBRARY_NAME} PUBLIC ./) -target_include_directories(${PARMETIS_SVFSI_LIBRARY_NAME} PUBLIC ${third_party_dir}/gklib_svfsi/simvascular_gklib_svfsi) -target_include_directories(${PARMETIS_SVFSI_LIBRARY_NAME} PUBLIC ${third_party_dir}/metis_svfsi/simvascular_metis_svfsi/METISLib) -target_include_directories(${PARMETIS_SVFSI_LIBRARY_NAME} PUBLIC ${MPI_C_INCLUDE_PATH}) +target_include_directories(${PARMETIS_INTERNAL_LIBRARY_NAME} PUBLIC ./) +target_include_directories(${PARMETIS_INTERNAL_LIBRARY_NAME} PUBLIC ${third_party_dir}/gklib_internal/simvascular_gklib_internal) +target_include_directories(${PARMETIS_INTERNAL_LIBRARY_NAME} PUBLIC ${third_party_dir}/metis_internal/simvascular_metis_internal/METISLib) +target_include_directories(${PARMETIS_INTERNAL_LIBRARY_NAME} PUBLIC ${MPI_C_INCLUDE_PATH}) -target_link_libraries(${PARMETIS_SVFSI_LIBRARY_NAME} ${METIS_SVFSI_LIBRARY_NAME} ${GKLIB_SVFSI_LIBRARY_NAME}) +target_link_libraries(${PARMETIS_INTERNAL_LIBRARY_NAME} ${METIS_INTERNAL_LIBRARY_NAME} ${GKLIB_INTERNAL_LIBRARY_NAME}) if(SV_INSTALL_LIBS) - install(TARGETS ${PARMETIS_SVFSI_LIBRARY_NAME} + install(TARGETS ${PARMETIS_SV_LIBRARY_NAME} RUNTIME DESTINATION ${SV_INSTALL_RUNTIME_DIR} COMPONENT ThirdPartyExecutables LIBRARY DESTINATION ${SV_INSTALL_LIBRARY_DIR} COMPONENT ThirdPartyLibraries ARCHIVE DESTINATION ${SV_INSTALL_ARCHIVE_DIR} COMPONENT ThirdPartyLibraries) @@ -44,44 +44,44 @@ if(SV_INSTALL_HEADERS) file(READ "parmetislib.h" METIS_H_TEMP) set(filename "macros.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "defs.h") file(COPY ${filename} DESTINATION ${TEMP_DIR}) file(RENAME ${TEMP_DIR}/${filename} ${TEMP_DIR}/metis_${filename} ) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "proto.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "rename.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "stdheaders.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "struct.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename "parmetis.h") - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi RENAME parmetis_svfsi_${filename} + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal RENAME parmetis_internal_${filename} COMPONENT ThirdPartyHeaders) - string(REGEX REPLACE ${filename} parmetis_svfsi_${filename} METIS_H_TEMP ${METIS_H_TEMP}) + string(REGEX REPLACE ${filename} parmetis_internal_${filename} METIS_H_TEMP ${METIS_H_TEMP}) set(filename ${TEMP_DIR}/parmetislib.h) file(WRITE ${filename} ${METIS_H_TEMP}) - install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_svfsi + install(FILES ${filename} DESTINATION ${SV_INSTALL_INCLUDE_DIR}/thirdparty/parmetis_internal COMPONENT ThirdPartyHeaders) endif() diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/Makefile b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/Makefile similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/Makefile rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/Makefile diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/akwayfm.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/akwayfm.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/akwayfm.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/akwayfm.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ametis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ametis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ametis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ametis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/balancemylink.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/balancemylink.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/balancemylink.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/balancemylink.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/comm.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/comm.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/comm.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/comm.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/csrmatch.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/csrmatch.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/csrmatch.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/csrmatch.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ctrl.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ctrl.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ctrl.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ctrl.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/debug.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/debug.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/debug.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/debug.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/defs.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/defs.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/defs.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/defs.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/diffutil.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/diffutil.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/diffutil.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/diffutil.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/frename.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/frename.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/frename.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/frename.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib_defs.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib_defs.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib_defs.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib_defs.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib_rename.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib_rename.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gklib_rename.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gklib_rename.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gkmetis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gkmetis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gkmetis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gkmetis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gkmpi.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gkmpi.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/gkmpi.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/gkmpi.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/graph.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/graph.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/graph.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/graph.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initbalance.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initbalance.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initbalance.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initbalance.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initmsection.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initmsection.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initmsection.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initmsection.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initpart.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initpart.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/initpart.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/initpart.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/kmetis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/kmetis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/kmetis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/kmetis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/kwayrefine.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/kwayrefine.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/kwayrefine.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/kwayrefine.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/macros.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/macros.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/macros.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/macros.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/match.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/match.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/match.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/match.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mdiffusion.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mdiffusion.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mdiffusion.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mdiffusion.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mesh.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mesh.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mesh.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mesh.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mmetis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mmetis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/mmetis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/mmetis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/move.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/move.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/move.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/move.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/msetup.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/msetup.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/msetup.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/msetup.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/node_refine.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/node_refine.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/node_refine.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/node_refine.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ometis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ometis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/ometis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/ometis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/parmetis.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/parmetis.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/parmetis.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/parmetis.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/parmetislib.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/parmetislib.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/parmetislib.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/parmetislib.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/proto.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/proto.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/proto.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/proto.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/pspases.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/pspases.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/pspases.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/pspases.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/redomylink.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/redomylink.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/redomylink.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/redomylink.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/remap.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/remap.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/remap.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/remap.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/rename.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/rename.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/rename.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/rename.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/renumber.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/renumber.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/renumber.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/renumber.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/rmetis.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/rmetis.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/rmetis.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/rmetis.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/selectq.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/selectq.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/selectq.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/selectq.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/serial.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/serial.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/serial.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/serial.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/stat.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/stat.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/stat.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/stat.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/struct.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/struct.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/struct.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/struct.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/metis.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/metis.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/metis.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/metis.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/metis_defs.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/metis_defs.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/metis_defs.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/metis_defs.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/parmetis.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/parmetis.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/parmetis.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/parmetis.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/parmetislib.h b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/parmetislib.h similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/temp/parmetislib.h rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/temp/parmetislib.h diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/timer.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/timer.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/timer.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/timer.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/util.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/util.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/util.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/util.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/wave.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/wave.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/wave.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/wave.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/weird.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/weird.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/weird.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/weird.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/wspace.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/wspace.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/wspace.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/wspace.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/xyzpart.c b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/xyzpart.c similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/ParMETISLib/xyzpart.c rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/ParMETISLib/xyzpart.c diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/README b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/README similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/README rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/README diff --git a/Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/VERSION b/Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/VERSION similarity index 100% rename from Code/ThirdParty/parmetis_svfsi/simvascular_parmetis_svfsi/VERSION rename to Code/ThirdParty/parmetis_internal/simvascular_parmetis_internal/VERSION diff --git a/Code/ThirdParty/parmetis_svfsi/CMakeLists.txt b/Code/ThirdParty/parmetis_svfsi/CMakeLists.txt deleted file mode 100644 index b10939522..000000000 --- a/Code/ThirdParty/parmetis_svfsi/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -simvascular_third_party(parmetis_svfsi) diff --git a/Distribution/CMakeLists.txt b/Distribution/CMakeLists.txt index da86ec99a..9f646916c 100644 --- a/Distribution/CMakeLists.txt +++ b/Distribution/CMakeLists.txt @@ -19,7 +19,7 @@ endif() #----------------------------------------------------------------------------- # Platform independent options #----------------------------------------------------------------------------- -set(CPACK_PACKAGE_NAME "svFSIplus") +set(CPACK_PACKAGE_NAME "svMultiPhysics") set(CPACK_PACKAGE_VENDOR "SimVascular.org") set(CPACK_PACKAGE_CONTACT "SimVascular") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SimVascular Solvers") @@ -35,7 +35,7 @@ string(REPLACE "." "-" SV_INSTALL_VERSION_DIR ${SV_FULL_VERSION}) #----------------------------------------------------------------------------- if(WIN32) # Package name - set(CPACK_PACKAGE_FILE_NAME "svFSIplus-windows-win-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") + set(CPACK_PACKAGE_FILE_NAME "svMultiPhysics-windows-win-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") # MPI dlls find_path(INTEL_REDIST_DIR names fmpich2.dll PATHS $ENV{PATH}) @@ -65,10 +65,10 @@ if(WIN32) set(CPACK_WIX_PROGRAM_MENU_FOLDER "SimVascular") set(CPACK_WIX_PRODUCT_GUID "39068F8A-D4E9-405F-B22B-9B417849AEE6") set(CPACK_WIX_UPGRADE_GUID "2359EF69-C03F-401C-9BC3-C19B10297E3B") - set(PACKAGE_NAME "svFSIplus") + set(PACKAGE_NAME "svMultiPhysics") elseif(SV_RELEASE_TYPE MATCHES "Beta") set(CPACK_WIX_PROGRAM_MENU_FOLDER "SimVascular-Beta") - set(PACKAGE_NAME "svFSIplus-beta") + set(PACKAGE_NAME "svMultiPhysics-beta") set(CPACK_PACKAGE_INSTALL_DIRECTORY "SimVascular/${TIMESTAMP}") set(CPACK_WIX_PRODUCT_GUID "9453BB7E-CD7E-46ED-AA9E-5514B56FC901") set(CPACK_WIX_UPGRADE_GUID "39C845FF-68E1-4AA7-B329-3407B47B3361") @@ -85,11 +85,11 @@ endif() #----------------------------------------------------------------------------- if(LINUX) # Package name - set(CPACK_PACKAGE_FILE_NAME "svFSIplus-linux-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") + set(CPACK_PACKAGE_FILE_NAME "svMultiPhysics-linux-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") if(SV_INSTALLER_TYPE STREQUAL DEB) set(CPACK_GENERATOR "DEB") - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/sv/svFSIplus/${SV_INSTALL_VERSION_DIR}") + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/sv/svMultiPhysics/${SV_INSTALL_VERSION_DIR}") elseif(SV_INSTALLER_TYPE STREQUAL TGZ) set(CPACK_GENERATOR "TGZ") set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON) @@ -101,9 +101,9 @@ endif() #----------------------------------------------------------------------------- if(APPLE) # Package name - set(CPACK_PACKAGE_FILE_NAME "svFSIplus-darwin-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") + set(CPACK_PACKAGE_FILE_NAME "svMultiPhysics-darwin-x64-${SV_FULL_VERSION}${INSTALL_TYPE_STR}") - # Components. Just install the svFSIplus executable. + # Components. Just install the svMultiPhysics executable. set(CPACK_COMPONENTS_ALL CoreExecutables) # Cpack install help @@ -112,7 +112,7 @@ if(APPLE) # ${CMAKE_CURRENT_BINARY_DIR}/OSX/Info.plist @ONLY) # Install location - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/sv/svFSIplus/${SV_INSTALL_VERSION_DIR}") + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/sv/svMultiPhysics/${SV_INSTALL_VERSION_DIR}") endif() if(CPACK_PACKAGE_FILENAME_TAG) diff --git a/Docker/README.md b/Docker/README.md index 86b57debd..760404cbf 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -12,8 +12,8 @@ In the folder Docker/ there are three subfolders solver/, ubuntu20/, ubuntu22/ c For more details about the dockerfiles created in this work, refer to the [simvascular DockerHub page](https://registry.hub.docker.com/u/simvascular). ## Build a container -In this section the steps to build the image with a pre-compiled svFSIplus solver are briefly described. To create the image from the dockerfile provided in Docker/solver, follow the steps below: -1) build an Ubuntu-based image containing the whole environment in which svFSIplus program can be compiled. The provided dockerfiles are based on Ubuntu-20.04 and Ubuntu-22.04, but they can be easily adapted to use the latest version of Ubuntu, by changing the following line in Docker/ubuntu20/dockerfile or Docker/ubuntu22/dockerfile: +In this section the steps to build the image with a pre-compiled svMultiPhysics solver are briefly described. To create the image from the dockerfile provided in Docker/solver, follow the steps below: +1) build an Ubuntu-based image containing the whole environment in which svMultiPhysics program can be compiled. The provided dockerfiles are based on Ubuntu-20.04 and Ubuntu-22.04, but they can be easily adapted to use the latest version of Ubuntu, by changing the following line in Docker/ubuntu20/dockerfile or Docker/ubuntu22/dockerfile: ``` FROM ubuntu:20.04 AS base / FROM ubuntu:22.04 AS base ``` @@ -32,7 +32,7 @@ where -t allows the user to set the name for the image created. For example: ``` docker build -t libraries:latest . ``` -2) build the image containing the compiled svFSIplus program. This image will be based on the environment created in the previous step (libraries:latest). In order to do this, open the Docker/solver/dockerfile and modify the following lines: +2) build the image containing the compiled svMultiPhysics program. This image will be based on the environment created in the previous step (libraries:latest). In order to do this, open the Docker/solver/dockerfile and modify the following lines: ``` FROM simvascular/libraries:ubuntu22 AS builder ``` @@ -55,13 +55,13 @@ cd Docker/solver ``` docker build -t solver:latest . ``` -The image include the PETSc-based svFSIplus executable in: +The image include the PETSc-based svMultiPhysics executable in: ``` -/build-petsc/svFSIplus-build/bin/svfsiplus +/build-petsc/svMultiPhysics-build/bin/svmultiphysics ``` -and the Trilinos-based svFSIplus executable in: +and the Trilinos-based svMultiPhysics executable in: ``` -/build-trilinos/svFSIplus-build/bin/svfsiplus +/build-trilinos/svMultiPhysics-build/bin/svmultiphysics ``` ## Run a container Once the image is created, it can be run interactively by running the following command: diff --git a/Docker/solver/dockerfile b/Docker/solver/dockerfile index 00ead64a1..ac91d40ba 100644 --- a/Docker/solver/dockerfile +++ b/Docker/solver/dockerfile @@ -1,16 +1,16 @@ # Use the pre-configured image from Docker Hub as the base FROM simvascular/libraries:ubuntu22 AS builder -# Get latest svFSIplus solver from GitHub repository -RUN git clone https://github.com/SimVascular/svFSIplus.git +# Get latest svMultiPhysics solver from GitHub repository +RUN git clone https://github.com/SimVascular/svMultiPhysics.git # Trilinos build -WORKDIR /svFSIplus/build-trilinos +WORKDIR /svMultiPhysics/build-trilinos RUN cmake -DSV_USE_TRILINOS:BOOL=ON .. &&\ make -j4 # PETSc build -WORKDIR /svFSIplus/build-petsc +WORKDIR /svMultiPhysics/build-petsc RUN cmake -DSV_PETSC_DIR:STRING=/petsc .. &&\ make -j4 @@ -18,7 +18,7 @@ RUN cmake -DSV_PETSC_DIR:STRING=/petsc .. &&\ # FINAL IMAGE with solver executable FROM simvascular/libraries:ubuntu22 AS final -COPY --from=builder /svFSIplus/build-petsc /build-petsc -COPY --from=builder /svFSIplus/build-trilinos /build-trilinos +COPY --from=builder /svMultiPhysics/build-petsc /build-petsc +COPY --from=builder /svMultiPhysics/build-trilinos /build-trilinos WORKDIR / diff --git a/Docker/ubuntu20/dockerfile b/Docker/ubuntu20/dockerfile index f4a64db0c..6dc875305 100644 --- a/Docker/ubuntu20/dockerfile +++ b/Docker/ubuntu20/dockerfile @@ -474,8 +474,8 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - ENV PATH="${CONDA_DIR}/bin:${PATH}" # Create Conda environment -RUN conda create -y -n svfsiplus && \ - conda run -n svfsiplus pip install pytest pytest-cov pytest-mock numpy meshio pandas +RUN conda create -y -n svmultiphysics && \ + conda run -n svmultiphysics pip install pytest pytest-cov pytest-mock numpy meshio pandas # Set libraries environment ENV PATH="/google:/vtk:/openmpi/bin:/cmake/bin:/trilinos/lib/cmake/Trilinos:${PATH}" diff --git a/Docker/ubuntu22/dockerfile b/Docker/ubuntu22/dockerfile index 8ed2eccde..b7b95eb88 100644 --- a/Docker/ubuntu22/dockerfile +++ b/Docker/ubuntu22/dockerfile @@ -474,8 +474,8 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - ENV PATH="${CONDA_DIR}/bin:${PATH}" # Create Conda environment -RUN conda create -y -n svfsiplus && \ - conda run -n svfsiplus pip install pytest pytest-cov pytest-mock numpy meshio pandas +RUN conda create -y -n svmultiphysics && \ + conda run -n svmultiphysics pip install pytest pytest-cov pytest-mock numpy meshio pandas # Set libraries environment ENV PATH="/google:/vtk:/openmpi/bin:/cmake/bin:/trilinos/lib/cmake/Trilinos:${PATH}" diff --git a/Documentation/Doxyfile b/Documentation/Doxyfile index 72391aec9..411770538 100644 --- a/Documentation/Doxyfile +++ b/Documentation/Doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = svFSIplus +PROJECT_NAME = svMultiPhysics PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = diff --git a/Documentation/internal.md b/Documentation/internal.md index 746b4c5d9..a12cea3d0 100644 --- a/Documentation/internal.md +++ b/Documentation/internal.md @@ -1,9 +1,9 @@ -svFSIplus is a C++ implementation of the Fortran [svFSI](https://github.com/SimVascular/svFSI) multi-physics finite element solver designed for computational modeling of the cardiovascular system. +svMultiPhysics is a C++ implementation of the Fortran [svFSI](https://github.com/SimVascular/svFSI) multi-physics finite element solver designed for computational modeling of the cardiovascular system. -svFSIplus uses a procedural programming paradigm which it inherited from its Fortran predecessor. This means that the code is implemented as a set of functions that call each other. The solver program thus executes by passing data to functions to carry out a series of computational steps. +svMultiPhysics uses a procedural programming paradigm which it inherited from its Fortran predecessor. This means that the code is implemented as a set of functions that call each other. The solver program thus executes by passing data to functions to carry out a series of computational steps. # Namespaces -svFSIplus uses namespaces to help organize the functions defined within each file. Namespace names are the same as the file name containing their functions. +svMultiPhysics uses namespaces to help organize the functions defined within each file. Namespace names are the same as the file name containing their functions. # Classes C++ classes are used to reproduce Fortran modules and user-defined data types. A module is a bit like a C++ class because it can encapsulate both data and procedures. Classes representing Fortan modules are stored in a file using the class name; the A class definition is in an A.h file and its implementation is in a A.cpp file. diff --git a/README.md b/README.md index 9fb02f763..b1714b1f0 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# svFSIplus +# svMultiPhysics -[![Build Status (Ubuntu)](https://github.com/SimVascular/svFSIplus/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/SimVascular/svFSIplus/actions) -[![Build Status (macOS)](https://github.com/SimVascular/svFSIplus/actions/workflows/test_macos.yml/badge.svg)](https://github.com/SimVascular/svFSIplus/actions) -[![codecov](https://codecov.io/github/SimVascular/svFSIplus/graph/badge.svg?token=I848DNIHSP)](https://codecov.io/github/SimVascular/svFSIplus) -![Latest Release](https://img.shields.io/github/v/release/SimVascular/svFSIplus?label=latest) +[![Build Status (Ubuntu)](https://github.com/SimVascular/svMultiPhysics/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/SimVascular/svMultiPhysics/actions) +[![Build Status (macOS)](https://github.com/SimVascular/svMultiPhysics/actions/workflows/test_macos.yml/badge.svg)](https://github.com/SimVascular/svMultiPhysics/actions) +[![codecov](https://codecov.io/github/SimVascular/svMultiPhysics/graph/badge.svg?token=I848DNIHSP)](https://codecov.io/github/SimVascular/svMultiPhysics) +![Latest Release](https://img.shields.io/github/v/release/SimVascular/svMultiPhysics?label=latest) ![Platform](https://img.shields.io/badge/platform-macOS%20|%20linux-blue) [![DOI](https://img.shields.io/badge/DOI-10.21105%2Fjoss.04118-green)](https://doi.org/10.21105/joss.04118) ### Table of Contents **[Introduction](#introduction)**
-**[Building the svFSIplus Program from Source](#building)**
+**[Building the svMultiPhysics Program from Source](#building)**
**[Building with External Linear Algebra Packages](#linear_algebra_packages)**
-**[Running the svFSIplus Program](#running_svfsiplus)**
+**[Running the svMultiPhysics Program](#running_svmultiphysics)**
**[Docker Container](#docker_container)**
**[Testing](tests/README.md)**
@@ -22,25 +22,25 @@

Introduction

-svFSIplus is an open-source, parallel, finite element multi-physics solver providing capabilities to simulate the partial differential equations (PDEs) governing solid and fluid mechanics, diffusion, and electrophysiology. Equations can be solved coupled to simulate the interaction between multiple regions representing different physical systems. For example, in a coupled fluid-solid simulation the motion of the fluid can deform a solid region while the changing geometry of the solid region changes the way the fluid flows. Equation coupling provides a framework for the computational modeling of whole heart dynamics. +svMultiPhysics is an open-source, parallel, finite element multi-physics solver providing capabilities to simulate the partial differential equations (PDEs) governing solid and fluid mechanics, diffusion, and electrophysiology. Equations can be solved coupled to simulate the interaction between multiple regions representing different physical systems. For example, in a coupled fluid-solid simulation the motion of the fluid can deform a solid region while the changing geometry of the solid region changes the way the fluid flows. Equation coupling provides a framework for the computational modeling of whole heart dynamics. -svFSIplus is a C++ implementation of the Fortran [svFSI](https://github.com/SimVascular/svFSI) multi-physics finite element solver designed for computational modeling of the cardiovascular system. The C++ implementation is essentially a line-by-line translation of the svFSI Fortran code and therefore uses a procedural rather than an object oriented programming paradigm. The code will be incrementally refactored into an object oriented code. +svMultiPhysics is a C++ implementation of the Fortran [svFSI](https://github.com/SimVascular/svFSI) multi-physics finite element solver designed for computational modeling of the cardiovascular system. The C++ implementation is essentially a line-by-line translation of the svFSI Fortran code and therefore uses a procedural rather than an object oriented programming paradigm. The code will be incrementally refactored into an object oriented code. -The [SimVascular svFSIplus Documentation](https://simvascular.github.io/documentation/svfsiplus.html) provides documentation describing how to use the svFSIplus solver. It also has developer guide describing the code organization and some implementation details. +The [SimVascular svMultiPhysics Documentation](https://simvascular.github.io/documentation/svmultiphysics.html) provides documentation describing how to use the svMultiPhysics solver. It also has developer guide describing the code organization and some implementation details. -The [svFSIplus Internal Code Documentation](https://simvascular.github.io/svfsiplus/index.html) provides documentation of the svFSIplus source code. It is automatically generated using [Doxygen](https://www.doxygen.nl). +The [svMultiPhysics Internal Code Documentation](https://simvascular.github.io/svmultiphysics/index.html) provides documentation of the svMultiPhysics source code. It is automatically generated using [Doxygen](https://www.doxygen.nl).

Docker

-The preferred way to use svFSIplus on an HPC system, is to take advantage of the provided Docker container, which include the latest version of svFSIplus pre-compiled. To use this option, Docker must be installed first. Please refer to [Docker webpage](https://www.docker.com/products/docker-desktop/) to know more about Docker and how to install it on your machine. The following steps describe how to build a Docker image or pull an existent one from DockerHub, and how to run a Docker container. The last section is a brief guide to perform the same steps but in Singularity, since HPC systems usually use Singularity to handle containers. +The preferred way to use svMultiPhysics on an HPC system, is to take advantage of the provided Docker container, which include the latest version of svMultiPhysics pre-compiled. To use this option, Docker must be installed first. Please refer to [Docker webpage](https://www.docker.com/products/docker-desktop/) to know more about Docker and how to install it on your machine. The following steps describe how to build a Docker image or pull an existent one from DockerHub, and how to run a Docker container. The last section is a brief guide to perform the same steps but in Singularity, since HPC systems usually use Singularity to handle containers. ## Docker image A Docker image is a read-only template that may contain dependencies, libraries, and everything needed to run a program. It is like a snapshot of a particular environment. A Docker image can be created directly from a [dockerfile](https://docs.docker.com/reference/dockerfile/#:~:text=A%20Dockerfile%20is%20a%20text,can%20use%20in%20a%20Dockerfile.) or an existent image can be pulled from [DockerHub](https://hub.docker.com). For this repository, both options are available. -The latest version of svFSIplus program is pre-compiled in a Docker image, built from a dockerfile provided in Docker/solver. The Docker image includes two different type of builds, one where the solver is compiled with Trilinos and the other one where the solver is compiled with PETSc. +The latest version of svMultiPhysics program is pre-compiled in a Docker image, built from a dockerfile provided in Docker/solver. The Docker image includes two different type of builds, one where the solver is compiled with Trilinos and the other one where the solver is compiled with PETSc. This Docker image can be downloaded (pulled) from the dockerhub simvascular repository [simvascular/solver](https://registry.hub.docker.com/u/simvascular). To pull an image, run the command: ``` docker pull simvascular/solver:latest @@ -57,9 +57,9 @@ In this command: - -it: means run interactively Docker image - -v: mounts a directory 'FolderToUpload' from the host machine in the container where the directory has the name '/NameOfFolder'. For example the folder containing the mesh and the input file necessary to run a simulation should be mounted. Once inside the container we can move into the folder jsut mounted and run the simulation, for example with the following command: ``` -mpirun -n 4 /build-trilinos/svFSIplus-build/bin/svfsiplus svFSIplus.xml +mpirun -n 4 /build-trilinos/svMultiPhysics-build/bin/svmultiphysics solver.xml ``` -The previous command will run the solver on 4 processors using the input file svFSIplus.xml and the mesh in the folder 'FolderToUpload' mounted inside the container. +The previous command will run the solver on 4 processors using the input file solver.xml and the mesh in the folder 'FolderToUpload' mounted inside the container. As an example if we want to run the test case in tests/cases/fluid/pipe_RCR_3d we can proceed as follows: ``` docker run -it -v ~/full_path_to/tests/cases/fluid/pipe_RCR_3d:/case solver:latest @@ -67,12 +67,12 @@ docker run -it -v ~/full_path_to/tests/cases/fluid/pipe_RCR_3d:/case solver:late Now we are inside the container and we run the simulation: ``` cd /case -mpirun -n 4 /build-trilinos/svFSIplus-build/bin/svfsiplus svFSIplus.xml +mpirun -n 4 /build-trilinos/svMultiPhysics-build/bin/svmultiphysics solver.xml ``` once it finishes we can exit the container and the results will be saved inside the tests/cases/fluid/pipe_RCR_3d folder. If you encounter permission problems while running mpirun, try this: ``` -mpirun --allow-run-as-root -n 4 /build-trilinos/svFSIplus-build/bin/svfsiplus svFSIplus.xml +mpirun --allow-run-as-root -n 4 /build-trilinos/svMultiPhysics-build/bin/svmultiphysics solver.xml ``` ## Containers on HPC: Singularity @@ -80,8 +80,8 @@ Most of the HPC systems (if not all) are based on AMD64 architecture and the sol ``` singularity pull docker://simvascular/solver:latest ``` -After the pull is complete, you should have a file with extension .sif (solver image). This image contains the two executables of the svFSIplus program build with PETSc and Trilinos support, respectively. -In the following, we provide two example of job submission's scripts that can be used as a reference to run a simulation using the svFSIplus solver on an HPC cluster. +After the pull is complete, you should have a file with extension .sif (solver image). This image contains the two executables of the svMultiPhysics program build with PETSc and Trilinos support, respectively. +In the following, we provide two example of job submission's scripts that can be used as a reference to run a simulation using the svMultiPhysics solver on an HPC cluster. 1) single-node job script: ``` #!/bin/bash @@ -103,7 +103,7 @@ module purge singularity run --bind $FOLDER_TO_BIND1, $FOLDER_TO_BIND2, # and so on \ $PATH_TO_IMAGE \ -mpirun -n $NTASKS /build-trilinos/svFSIplus-build/bin/svfsiplus svFSIplus.xml +mpirun -n $NTASKS /build-trilinos/svMultiPhysics-build/bin/svmultiphysics solver.xml ``` 2) multi-node job script @@ -132,7 +132,7 @@ module purge mpirun -n $NTASKS singularity run --bind $FOLDER_TO_BIND1, $FOLDER_TO_BIND2, # and so on \ $PATH_TO_IMAGE \ -/build-trilinos/svFSIplus-build/bin/svfsiplus svFSIplus.xml +/build-trilinos/svMultiPhysics-build/bin/svmultiphysics solver.xml ``` Since the multi-node relies on both MPI, the one on the HPC and the one inside the container, there may be some problems. In the following, we give a solution (workaround) for two common problems: - if the HPC OpenMPI was built with cuda support, then it may happen that it is expecting that OpenMPI inside the container to be built with cuda support too, which is not the case. Possible solution is to add --mca mpi_cuda_support 0: @@ -145,26 +145,26 @@ mpirun --mca psec ^munge -n #TotalNumberOfTasks ... ``` - + -

Building the svFSIplus Program from Source

-The svFSIplus program can be compiled and linked from the GitHub source using a CMake build process. The build process creates a binary executable file named svfsiplus. +

Building the svMultiPhysics Program from Source

+The svMultiPhysics program can be compiled and linked from the GitHub source using a CMake build process. The build process creates a binary executable file named svmultiphysics. ## Supported Platforms -svFSIplus can be built on most Unix-like operating systems +svMultiPhysics can be built on most Unix-like operating systems - MacOS - Ubuntu - CentOS -A native Windows build is currently not supported. However, svFSIplus can be built and run from an Ubuntu terminal environment on Windows using [Windows Subsystem for Linux (WSL)](https://ubuntu.com/desktop/wsl). +A native Windows build is currently not supported. However, svMultiPhysics can be built and run from an Ubuntu terminal environment on Windows using [Windows Subsystem for Linux (WSL)](https://ubuntu.com/desktop/wsl). ## Software Dependencies -The following software packages are required to be installed in order to build svFSIplus +The following software packages are required to be installed in order to build svMultiPhysics - [git](https://git-scm.com/) - Distributed version control system used to interact with GitHub repositories -- [CMake](https://cmake.org/) - Used to the build the binary executable **svfsiplus** +- [CMake](https://cmake.org/) - Used to the build the binary executable **svmultiphysics** - C++17 compiler - C++ compiler, linker and libraries - [Visualization Toolkit (VTK)](https://vtk.org/) - Used for reading and writing VTK-format VTP and VTU files - [Open MPI](https://www.open-mpi.org/) - Used for parallel processing @@ -182,15 +182,15 @@ These software packages are installed using a package-management system Installing VTK on a high-performance computing (HPC) cluster is typically not supported and may require building it from source. See [Building Visualization Toolkit (VTK) Libraries](#building_vtk). -## Building svFSIplus +## Building svMultiPhysics -svFSIplus is built using the following steps +svMultiPhysics is built using the following steps 1) Download the source from GitHub - `git clone https://github.com/SimVascular/svFSIplus` + `git clone https://github.com/SimVascular/svMultiPhysics` - Creates an `svFSIplus` directory. + Creates an `svMultiPhysics` directory. 3) Create a build directory and change directories to it @@ -202,18 +202,18 @@ svFSIplus is built using the following steps 4) Execute the build ``` - cmake ../svFSIplus + cmake ../svMultiPhysics make ``` - This creates the **svfsiplus** binary executable located in + This creates the **svmultiphysics** binary executable located in ``` - build/svFSIplus-build/bin/svfsiplus + build/svMultiPhysics-build/bin/svmultiphysics ```

Building Visualization Toolkit (VTK) Libraries

-svFSIplus uses VTK to read finite element mesh data (created by the SimVascular mesh generation software), fiber geometry, initial conditions and write simulation results. Building the complete VTK library requires certain graphics libraries to be installed (e.g. OpenGL, X11) which make it difficult to build on an HPC cluster. +svMultiPhysics uses VTK to read finite element mesh data (created by the SimVascular mesh generation software), fiber geometry, initial conditions and write simulation results. Building the complete VTK library requires certain graphics libraries to be installed (e.g. OpenGL, X11) which make it difficult to build on an HPC cluster. However, a subset of the complete VTK library can be built to just include reading/writing functionality without graphics. @@ -277,22 +277,22 @@ You can then build svFISplus with the local VTK libraries using the two CMake co Numerical linear algebra uses computer algorithms to solve the linear system generated by finite element method. Linear algebra libraries provide access to specialized or general purpose routines implementing a significant number of computer algorithms useful when solving linear systems. -svFSIplus supports interfaces to the following numerical linear algebra packages -- Custom numerical linear algebra routines included in the svFSIplus implementation +svMultiPhysics supports interfaces to the following numerical linear algebra packages +- Custom numerical linear algebra routines included in the svMultiPhysics implementation - [Portable, Extensible Toolkit for Scientific Computation (PETSc)](https://petsc.org/release/overview/) - [Trilinos](https://trilinos.github.io/) These packages may be not be available for the latest version using a package-management system or be available on an HPC cluster so they must be built from source. -## Building svFSIplus with External Linear Algebra Packages +## Building svMultiPhysics with External Linear Algebra Packages -The following CMake command-line arguments are used to build svFSIplus with external linear algebra packages +The following CMake command-line arguments are used to build svMultiPhysics with external linear algebra packages ``` -DSV_USE_TRILINOS:BOOL=ON - Sets an option for CMake to look for the Trilinos package -DSV_PETSC_DIR:PathToPetsInstall - Sets the location where the PETSc package is installed ``` -When built with an external linear algebra package svFSIplus can be run using that package by setting the **Linear_algebra** parameter in the solver input file. +When built with an external linear algebra package svMultiPhysics can be run using that package by setting the **Linear_algebra** parameter in the solver input file. For example: PETSc ``` @@ -348,16 +348,16 @@ See the [Quick Start Tutorial](https://petsc.org/release/install/install_tutoria - + -

Running the svFSIplus Program

+

Running the svMultiPhysics Program

-Once the **svfsiplus** binary is available add its location to your environment variable (`PATH` on Unix-like systems). -The **svfsiplus** binary is run from the command line with the name of a input solver parameters XML file as an argument +Once the **svmultiphysics** binary is available add its location to your environment variable (`PATH` on Unix-like systems). +The **svmultiphysics** binary is run from the command line with the name of a input solver parameters XML file as an argument ``` -svfsiplus fluid3d.xml +svmultiphysics fluid3d.xml ``` The simulation progress for each time step will be printed showing @@ -386,6 +386,6 @@ B_NS_WSS_average.txt stFile_002.bin A simulation can be run in parallel on four processors using ``` -mpiexec -np 4 svfsiplus fluid3.xml +mpiexec -np 4 svmultiphysics fluid3.xml ``` In this case a directory named `4-procs` containing the simulation results output will be created. Results from different processors will be combined into a single file for a given time step. diff --git a/tests/README.md b/tests/README.md index 953d28209..b0295c644 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,25 +1,25 @@ # Testing Guide -[Integration testing](https://en.wikipedia.org/wiki/Integration_testing) is an essential part of software development. It is performed when integrating code changes into the main development branch to verify that the code works as expected. The following sections describe how to run and add integration tests used to the svFSIplus program. +[Integration testing](https://en.wikipedia.org/wiki/Integration_testing) is an essential part of software development. It is performed when integrating code changes into the main development branch to verify that the code works as expected. The following sections describe how to run and add integration tests used to the svMultiPhysics program. Running a test case requires -- Build svFSIplus +- Build svMultiPhysics - Install Git LFS used to download test data - Build svZeroDSolver (only required from certain tests) -# Build svFSIplus -svFSIplus can be built following these [instructions](../README.md). +# Build svMultiPhysics +svMultiPhysics can be built following these [instructions](../README.md). -To automatically run test cases using `pytest` you must build svFSIplus in a folder named `build` located at the svFSIplus repository root directory (i.e. the svFSIplus directory created when doing a git clone of the svFSIplus repository). +To automatically run test cases using `pytest` you must build svMultiPhysics in a folder named `build` located at the svMultiPhysics repository root directory (i.e. the svMultiPhysics directory created when doing a git clone of the svMultiPhysics repository). # Install Git LFS -The svFSIplus tests require finite element mesh data stored in VTK-format VTP and VTU files. These large files are managed using the [Git Large File Storage (LFS)](https://git-lfs.com/) extension. *Git LFS* stores files as text pointers inside git until the file contents are explicitly pulled from a remote server. +The svMultiPhysics tests require finite element mesh data stored in VTK-format VTP and VTU files. These large files are managed using the [Git Large File Storage (LFS)](https://git-lfs.com/) extension. *Git LFS* stores files as text pointers inside git until the file contents are explicitly pulled from a remote server. The file extensions currently tracked with *Git LFS* are stored [in this file](../.gitattributes). *Git LFS* is install following [this guide](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage). -To set up *Git LFS* for the svFSIplus repository run the following commands to activate *Git lfs* +To set up *Git LFS* for the svMultiPhysics repository run the following commands to activate *Git lfs* ``` git lfs install ``` @@ -32,7 +32,7 @@ git lfs pull These steps need to be performed only once. All large files are handled automatically during all Git operations, like `push`, `pull`, or `commit`. # Running tests using pytest -You can run an individual test by navigating to the `./tests/cases//` folder you want to run and execute `svFSIplus` with the `svFSI.xml` input file as an argument. A more elegant way, e.g., to run a whole group of tests, is using [`pytest`](https://docs.pytest.org/). By default, it will run all tests defined in the `test_*.py` files in the [./tests](https://github.com/SimVascular/svFSIplus/tree/main/tests) folder. Tests and input files in [./tests/cases](https://github.com/SimVascular/svFSIplus/tree/main/tests/cases) are grouped by physics type, e.g., [struct](https://github.com/SimVascular/svFSIplus/tree/main/tests/cases/struct), [fluid](https://github.com/SimVascular/svFSIplus/tree/main/tests/cases/fluid), or [fsi](https://github.com/SimVascular/svFSIplus/tree/main/tests/cases/fsi) (using the naming convention from `EquationType`). Here are a couple of useful `Pytest` commands: +You can run an individual test by navigating to the `./tests/cases//` folder you want to run and execute `svMultiPhysics` with the `svFSI.xml` input file as an argument. A more elegant way, e.g., to run a whole group of tests, is using [`pytest`](https://docs.pytest.org/). By default, it will run all tests defined in the `test_*.py` files in the [./tests](https://github.com/SimVascular/svMultiPhysics/tree/main/tests) folder. Tests and input files in [./tests/cases](https://github.com/SimVascular/svMultiPhysics/tree/main/tests/cases) are grouped by physics type, e.g., [struct](https://github.com/SimVascular/svMultiPhysics/tree/main/tests/cases/struct), [fluid](https://github.com/SimVascular/svMultiPhysics/tree/main/tests/cases/fluid), or [fsi](https://github.com/SimVascular/svMultiPhysics/tree/main/tests/cases/fsi) (using the naming convention from `EquationType`). Here are a couple of useful `Pytest` commands: - Run only tests matching a pattern (can be physics or test case name): ``` @@ -51,7 +51,7 @@ You can run an individual test by navigating to the `./tests/cases// - + false @@ -67,6 +67,6 @@ - + diff --git a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_BICG_CN_epicardium_BO.xml b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_BICG_CN_epicardium_BO.xml similarity index 98% rename from tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_BICG_CN_epicardium_BO.xml rename to tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_BICG_CN_epicardium_BO.xml index 21428c64d..01a04f28e 100644 --- a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_BICG_CN_epicardium_BO.xml +++ b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_BICG_CN_epicardium_BO.xml @@ -1,5 +1,5 @@ - + false @@ -119,6 +119,6 @@ - + diff --git a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_CG_RK4_myocardium_BO.xml b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_CG_RK4_myocardium_BO.xml similarity index 98% rename from tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_CG_RK4_myocardium_BO.xml rename to tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_CG_RK4_myocardium_BO.xml index b02fc20ff..cf8f9c07f 100644 --- a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_CG_RK4_myocardium_BO.xml +++ b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_CG_RK4_myocardium_BO.xml @@ -1,5 +1,5 @@ - + false @@ -118,6 +118,6 @@ - + diff --git a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_epicardium_TTP.xml b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_epicardium_TTP.xml similarity index 98% rename from tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_epicardium_TTP.xml rename to tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_epicardium_TTP.xml index 40164f9dd..6afd15d44 100644 --- a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_epicardium_TTP.xml +++ b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_epicardium_TTP.xml @@ -1,5 +1,5 @@ - + false @@ -132,6 +132,6 @@ - + diff --git a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_pfib_AP.xml b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xml similarity index 98% rename from tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_pfib_AP.xml rename to tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xml index 726663d54..acd86172b 100644 --- a/tests/cases/cep/niederer_benchmark_ECGs_quadrature/svFSI_GMRES_FE_pfib_AP.xml +++ b/tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xml @@ -1,5 +1,5 @@ - + false @@ -120,6 +120,6 @@ - + diff --git a/tests/cases/cep/purkinje/svFSIplus.xml b/tests/cases/cep/purkinje/solver.xml similarity index 98% rename from tests/cases/cep/purkinje/svFSIplus.xml rename to tests/cases/cep/purkinje/solver.xml index 8aa708247..395aee00b 100644 --- a/tests/cases/cep/purkinje/svFSIplus.xml +++ b/tests/cases/cep/purkinje/solver.xml @@ -1,5 +1,5 @@ - + false @@ -77,6 +77,6 @@ - + diff --git a/tests/cases/cep/spiral_BO_2d/svFSIplus.xml b/tests/cases/cep/spiral_BO_2d/solver.xml similarity index 98% rename from tests/cases/cep/spiral_BO_2d/svFSIplus.xml rename to tests/cases/cep/spiral_BO_2d/solver.xml index 7e37b9fbd..c7a680e8f 100644 --- a/tests/cases/cep/spiral_BO_2d/svFSIplus.xml +++ b/tests/cases/cep/spiral_BO_2d/solver.xml @@ -1,5 +1,5 @@ - + false @@ -95,5 +95,5 @@ - + diff --git a/tests/cases/cep/square_AP_2d/svFSIplus.xml b/tests/cases/cep/square_AP_2d/solver.xml similarity index 97% rename from tests/cases/cep/square_AP_2d/svFSIplus.xml rename to tests/cases/cep/square_AP_2d/solver.xml index d3e54a7d7..462be1563 100644 --- a/tests/cases/cep/square_AP_2d/svFSIplus.xml +++ b/tests/cases/cep/square_AP_2d/solver.xml @@ -1,5 +1,5 @@ - + false @@ -82,6 +82,6 @@ - + diff --git a/tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/svFSIplus.xml b/tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/svFSIplus.xml rename to tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/solver.xml index ea9dec2c1..202c56103 --- a/tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/svFSIplus.xml +++ b/tests/cases/cmm/iliac_artery_variable_wall_props/1-rigid-solution/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -99,4 +99,4 @@ - + diff --git a/tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/svFSIplus.xml b/tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/solver.xml old mode 100755 new mode 100644 similarity index 93% rename from tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/svFSIplus.xml rename to tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/solver.xml index e0b4b3826..7e43a22c9 --- a/tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/svFSIplus.xml +++ b/tests/cases/cmm/iliac_artery_variable_wall_props/2-inflate/solver.xml @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@ 0.5 - ../svFSI_var_wall_props.vtp + ../svMultiPhysics_var_wall_props.vtp @@ -62,5 +62,5 @@ ../1-rigid-solution/rigid_wall_mean_traction.vtp - + diff --git a/tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/svFSIplus.xml b/tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/solver.xml old mode 100755 new mode 100644 similarity index 95% rename from tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/svFSIplus.xml rename to tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/solver.xml index bb68a5eb2..3b72e7b6b --- a/tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/svFSIplus.xml +++ b/tests/cases/cmm/iliac_artery_variable_wall_props/3-inflate-cmm/solver.xml @@ -1,5 +1,5 @@ - + @@ -64,7 +64,7 @@ 0.5 - ../svFSI_var_wall_props.vtp + ../svMultiPhysics_var_wall_props.vtp @@ -112,6 +112,6 @@ - + diff --git a/tests/cases/cmm/iliac_artery_variable_wall_props/svFSI_var_wall_props.vtp b/tests/cases/cmm/iliac_artery_variable_wall_props/svMultiPhysics_var_wall_props.vtp similarity index 100% rename from tests/cases/cmm/iliac_artery_variable_wall_props/svFSI_var_wall_props.vtp rename to tests/cases/cmm/iliac_artery_variable_wall_props/svMultiPhysics_var_wall_props.vtp diff --git a/tests/cases/cmm/pipe_3d/1-rigid-solution/svFSIplus.xml b/tests/cases/cmm/pipe_3d/1-rigid-solution/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/cmm/pipe_3d/1-rigid-solution/svFSIplus.xml rename to tests/cases/cmm/pipe_3d/1-rigid-solution/solver.xml index ac825aa49..d2c0767c4 --- a/tests/cases/cmm/pipe_3d/1-rigid-solution/svFSIplus.xml +++ b/tests/cases/cmm/pipe_3d/1-rigid-solution/solver.xml @@ -1,5 +1,5 @@ - + @@ -100,6 +100,6 @@ 0.0 - + diff --git a/tests/cases/cmm/pipe_3d/2a-inflate/svFSIplus.xml b/tests/cases/cmm/pipe_3d/2a-inflate/solver.xml similarity index 97% rename from tests/cases/cmm/pipe_3d/2a-inflate/svFSIplus.xml rename to tests/cases/cmm/pipe_3d/2a-inflate/solver.xml index 365ff66d6..2c6bed532 100644 --- a/tests/cases/cmm/pipe_3d/2a-inflate/svFSIplus.xml +++ b/tests/cases/cmm/pipe_3d/2a-inflate/solver.xml @@ -1,5 +1,5 @@ - + @@ -58,6 +58,6 @@ ../1-rigid-solution/rigid_wall_mean_traction.vtp - + diff --git a/tests/cases/cmm/pipe_3d/2b-prestress/svFSIplus.xml b/tests/cases/cmm/pipe_3d/2b-prestress/solver.xml similarity index 97% rename from tests/cases/cmm/pipe_3d/2b-prestress/svFSIplus.xml rename to tests/cases/cmm/pipe_3d/2b-prestress/solver.xml index b6639dc43..5a6dd3b63 100644 --- a/tests/cases/cmm/pipe_3d/2b-prestress/svFSIplus.xml +++ b/tests/cases/cmm/pipe_3d/2b-prestress/solver.xml @@ -1,5 +1,5 @@ - + @@ -61,6 +61,6 @@ ../1-rigid-solution/rigid_wall_mean_traction.vtp - + diff --git a/tests/cases/cmm/pipe_3d/3a-inflate-cmm/svFSIplus.xml b/tests/cases/cmm/pipe_3d/3a-inflate-cmm/solver.xml similarity index 98% rename from tests/cases/cmm/pipe_3d/3a-inflate-cmm/svFSIplus.xml rename to tests/cases/cmm/pipe_3d/3a-inflate-cmm/solver.xml index d7407b2a5..a9f89decd 100644 --- a/tests/cases/cmm/pipe_3d/3a-inflate-cmm/svFSIplus.xml +++ b/tests/cases/cmm/pipe_3d/3a-inflate-cmm/solver.xml @@ -1,5 +1,5 @@ - + @@ -105,6 +105,6 @@ - + diff --git a/tests/cases/cmm/pipe_3d/3b-prestress-cmm/svFSIplus.xml b/tests/cases/cmm/pipe_3d/3b-prestress-cmm/solver.xml similarity index 98% rename from tests/cases/cmm/pipe_3d/3b-prestress-cmm/svFSIplus.xml rename to tests/cases/cmm/pipe_3d/3b-prestress-cmm/solver.xml index 0ec907cbd..75392137f 100644 --- a/tests/cases/cmm/pipe_3d/3b-prestress-cmm/svFSIplus.xml +++ b/tests/cases/cmm/pipe_3d/3b-prestress-cmm/solver.xml @@ -1,5 +1,5 @@ - + @@ -106,6 +106,6 @@ - + diff --git a/tests/cases/fluid/carreau_yasuda/svFSIplus.xml b/tests/cases/fluid/carreau_yasuda/solver.xml similarity index 98% rename from tests/cases/fluid/carreau_yasuda/svFSIplus.xml rename to tests/cases/fluid/carreau_yasuda/solver.xml index 3432fbaea..075bbac32 100644 --- a/tests/cases/fluid/carreau_yasuda/svFSIplus.xml +++ b/tests/cases/fluid/carreau_yasuda/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -97,6 +97,6 @@ - + diff --git a/tests/cases/fluid/casson/svFSIplus.xml b/tests/cases/fluid/casson/solver.xml similarity index 98% rename from tests/cases/fluid/casson/svFSIplus.xml rename to tests/cases/fluid/casson/solver.xml index 8856084ad..6163ba89a 100644 --- a/tests/cases/fluid/casson/svFSIplus.xml +++ b/tests/cases/fluid/casson/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -95,6 +95,6 @@ - + diff --git a/tests/cases/fluid/driven_cavity_2d/svFSIplus.xml b/tests/cases/fluid/driven_cavity_2d/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/driven_cavity_2d/svFSIplus.xml rename to tests/cases/fluid/driven_cavity_2d/solver.xml index ea01561a2..015f982bf --- a/tests/cases/fluid/driven_cavity_2d/svFSIplus.xml +++ b/tests/cases/fluid/driven_cavity_2d/solver.xml @@ -1,5 +1,5 @@ - + @@ -109,6 +109,6 @@ - + diff --git a/tests/cases/fluid/driven_cavity_2d_porous/svFSIplus.xml b/tests/cases/fluid/driven_cavity_2d_porous/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/driven_cavity_2d_porous/svFSIplus.xml rename to tests/cases/fluid/driven_cavity_2d_porous/solver.xml index 41ee3bd82..d2ff7d3d2 --- a/tests/cases/fluid/driven_cavity_2d_porous/svFSIplus.xml +++ b/tests/cases/fluid/driven_cavity_2d_porous/solver.xml @@ -1,5 +1,5 @@ - + @@ -120,4 +120,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tests/cases/fluid/dye_AD/svFSIplus.xml b/tests/cases/fluid/dye_AD/solver.xml similarity index 98% rename from tests/cases/fluid/dye_AD/svFSIplus.xml rename to tests/cases/fluid/dye_AD/solver.xml index 729382387..f21ed66c1 100644 --- a/tests/cases/fluid/dye_AD/svFSIplus.xml +++ b/tests/cases/fluid/dye_AD/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -137,6 +137,6 @@ - + diff --git a/tests/cases/fluid/iliac_artery/svFSIplus.xml b/tests/cases/fluid/iliac_artery/solver.xml similarity index 98% rename from tests/cases/fluid/iliac_artery/svFSIplus.xml rename to tests/cases/fluid/iliac_artery/solver.xml index 06b1db1a4..635b4f38b 100644 --- a/tests/cases/fluid/iliac_artery/svFSIplus.xml +++ b/tests/cases/fluid/iliac_artery/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -116,4 +116,4 @@ - + diff --git a/tests/cases/fluid/newtonian/svFSIplus.xml b/tests/cases/fluid/newtonian/solver.xml similarity index 98% rename from tests/cases/fluid/newtonian/svFSIplus.xml rename to tests/cases/fluid/newtonian/solver.xml index 7f2918db1..32661bd44 100644 --- a/tests/cases/fluid/newtonian/svFSIplus.xml +++ b/tests/cases/fluid/newtonian/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -93,6 +93,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_3d/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_3d/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/pipe_RCR_3d/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_3d/solver.xml index 753546402..8150306b2 --- a/tests/cases/fluid/pipe_RCR_3d/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_3d/solver.xml @@ -1,5 +1,5 @@ - + @@ -105,6 +105,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_3d_petsc/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_3d_petsc/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/pipe_RCR_3d_petsc/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_3d_petsc/solver.xml index 3d55be4f5..533fdfb11 --- a/tests/cases/fluid/pipe_RCR_3d_petsc/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_3d_petsc/solver.xml @@ -1,5 +1,5 @@ - + @@ -99,6 +99,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_3d_trilinos_bj/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_3d_trilinos_bj/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/pipe_RCR_3d_trilinos_bj/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_3d_trilinos_bj/solver.xml index 11c6c7fd3..07daf15fe --- a/tests/cases/fluid/pipe_RCR_3d_trilinos_bj/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_3d_trilinos_bj/solver.xml @@ -1,5 +1,5 @@ - + @@ -99,6 +99,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/solver.xml index bf9eea56c..bbac4bd50 --- a/tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_3d_trilinos_ilut/solver.xml @@ -1,5 +1,5 @@ - + @@ -99,6 +99,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_genBC/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_genBC/solver.xml similarity index 98% rename from tests/cases/fluid/pipe_RCR_genBC/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_genBC/solver.xml index 2668aee44..d4204a0db 100644 --- a/tests/cases/fluid/pipe_RCR_genBC/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_genBC/solver.xml @@ -1,5 +1,5 @@ - + @@ -101,6 +101,6 @@ - + diff --git a/tests/cases/fluid/pipe_RCR_sv0D/svFSIplus.xml b/tests/cases/fluid/pipe_RCR_sv0D/solver.xml similarity index 98% rename from tests/cases/fluid/pipe_RCR_sv0D/svFSIplus.xml rename to tests/cases/fluid/pipe_RCR_sv0D/solver.xml index a9e762d62..3a2e96ed7 100644 --- a/tests/cases/fluid/pipe_RCR_sv0D/svFSIplus.xml +++ b/tests/cases/fluid/pipe_RCR_sv0D/solver.xml @@ -1,5 +1,5 @@ - + @@ -100,6 +100,6 @@ - + diff --git a/tests/cases/fluid/precomputed_dye_AD/svFSIplus.xml b/tests/cases/fluid/precomputed_dye_AD/solver.xml similarity index 97% rename from tests/cases/fluid/precomputed_dye_AD/svFSIplus.xml rename to tests/cases/fluid/precomputed_dye_AD/solver.xml index c5546cebf..7fd9dc6db 100644 --- a/tests/cases/fluid/precomputed_dye_AD/svFSIplus.xml +++ b/tests/cases/fluid/precomputed_dye_AD/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -84,6 +84,6 @@ - + diff --git a/tests/cases/fluid/quadratic_tet10/svFSIplus.xml b/tests/cases/fluid/quadratic_tet10/solver.xml old mode 100755 new mode 100644 similarity index 98% rename from tests/cases/fluid/quadratic_tet10/svFSIplus.xml rename to tests/cases/fluid/quadratic_tet10/solver.xml index 0be4a7b6f..43a3b67c8 --- a/tests/cases/fluid/quadratic_tet10/svFSIplus.xml +++ b/tests/cases/fluid/quadratic_tet10/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -103,4 +103,4 @@ - + diff --git a/tests/cases/fsi/pipe_3d/svFSIplus.xml b/tests/cases/fsi/pipe_3d/solver.xml old mode 100755 new mode 100644 similarity index 95% rename from tests/cases/fsi/pipe_3d/svFSIplus.xml rename to tests/cases/fsi/pipe_3d/solver.xml index fb8f03c55..dd9bff3d1 --- a/tests/cases/fsi/pipe_3d/svFSIplus.xml +++ b/tests/cases/fsi/pipe_3d/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -153,4 +153,4 @@ - + diff --git a/tests/cases/fsi/pipe_3d_petsc/svFSIplus.xml b/tests/cases/fsi/pipe_3d_petsc/solver.xml old mode 100755 new mode 100644 similarity index 95% rename from tests/cases/fsi/pipe_3d_petsc/svFSIplus.xml rename to tests/cases/fsi/pipe_3d_petsc/solver.xml index 30ed00bbf..ee6b39e12 --- a/tests/cases/fsi/pipe_3d_petsc/svFSIplus.xml +++ b/tests/cases/fsi/pipe_3d_petsc/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -153,4 +153,4 @@ - + diff --git a/tests/cases/fsi/pipe_3d_trilinos_bj/svFSIplus.xml b/tests/cases/fsi/pipe_3d_trilinos_bj/solver.xml old mode 100755 new mode 100644 similarity index 95% rename from tests/cases/fsi/pipe_3d_trilinos_bj/svFSIplus.xml rename to tests/cases/fsi/pipe_3d_trilinos_bj/solver.xml index 7232e9274..81f2d3430 --- a/tests/cases/fsi/pipe_3d_trilinos_bj/svFSIplus.xml +++ b/tests/cases/fsi/pipe_3d_trilinos_bj/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -153,4 +153,4 @@ - + diff --git a/tests/cases/fsi/pipe_3d_trilinos_ml/svFSIplus.xml b/tests/cases/fsi/pipe_3d_trilinos_ml/solver.xml old mode 100755 new mode 100644 similarity index 95% rename from tests/cases/fsi/pipe_3d_trilinos_ml/svFSIplus.xml rename to tests/cases/fsi/pipe_3d_trilinos_ml/solver.xml index 83a619a7a..f4ddd9d35 --- a/tests/cases/fsi/pipe_3d_trilinos_ml/svFSIplus.xml +++ b/tests/cases/fsi/pipe_3d_trilinos_ml/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -153,4 +153,4 @@ - + diff --git a/tests/cases/heats/diffusion_line_source/svFSI_BICG.xml b/tests/cases/heats/diffusion_line_source/solver_BICG.xml old mode 100755 new mode 100644 similarity index 97% rename from tests/cases/heats/diffusion_line_source/svFSI_BICG.xml rename to tests/cases/heats/diffusion_line_source/solver_BICG.xml index 917c0608f..d3ee72077 --- a/tests/cases/heats/diffusion_line_source/svFSI_BICG.xml +++ b/tests/cases/heats/diffusion_line_source/solver_BICG.xml @@ -1,5 +1,5 @@ - + @@ -83,6 +83,6 @@ - + diff --git a/tests/cases/heats/diffusion_line_source/svFSI_CG.xml b/tests/cases/heats/diffusion_line_source/solver_CG.xml old mode 100755 new mode 100644 similarity index 97% rename from tests/cases/heats/diffusion_line_source/svFSI_CG.xml rename to tests/cases/heats/diffusion_line_source/solver_CG.xml index adb0a73cc..ad4c7ddb7 --- a/tests/cases/heats/diffusion_line_source/svFSI_CG.xml +++ b/tests/cases/heats/diffusion_line_source/solver_CG.xml @@ -1,5 +1,5 @@ - + @@ -82,6 +82,6 @@ - + diff --git a/tests/cases/heats/diffusion_line_source/svFSI_GMRES.xml b/tests/cases/heats/diffusion_line_source/solver_GMRES.xml old mode 100755 new mode 100644 similarity index 97% rename from tests/cases/heats/diffusion_line_source/svFSI_GMRES.xml rename to tests/cases/heats/diffusion_line_source/solver_GMRES.xml index 52002bd55..8d41b627f --- a/tests/cases/heats/diffusion_line_source/svFSI_GMRES.xml +++ b/tests/cases/heats/diffusion_line_source/solver_GMRES.xml @@ -1,5 +1,5 @@ - + @@ -84,6 +84,6 @@ - + diff --git a/tests/cases/shell/plate/svFSIplus.xml b/tests/cases/shell/plate/solver.xml similarity index 98% rename from tests/cases/shell/plate/svFSIplus.xml rename to tests/cases/shell/plate/solver.xml index 12d9d47e2..d9892a0a6 100644 --- a/tests/cases/shell/plate/svFSIplus.xml +++ b/tests/cases/shell/plate/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -108,6 +108,6 @@ - + diff --git a/tests/cases/shell/valve/svFSIplus.xml b/tests/cases/shell/valve/solver.xml similarity index 98% rename from tests/cases/shell/valve/svFSIplus.xml rename to tests/cases/shell/valve/solver.xml index 5df6e564a..4a114db0c 100644 --- a/tests/cases/shell/valve/svFSIplus.xml +++ b/tests/cases/shell/valve/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -179,6 +179,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N004/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N004/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N004/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N004/solver.xml index 6c8410996..9a4618a8f 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N004/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N004/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -97,4 +97,4 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N008/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N008/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N008/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N008/solver.xml index 4f0e2837e..1776496e0 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N008/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N008/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -97,6 +97,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N016/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N016/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N016/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N016/solver.xml index a2337808f..6901cccea 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N016/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N016/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -98,6 +98,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N032/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N032/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N032/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N032/solver.xml index 77e5a9ee6..c5b30bda7 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N032/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N032/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -97,6 +97,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N064/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N064/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N064/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N064/solver.xml index 601115cba..7413970bf 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N064/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N064/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -104,6 +104,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N128/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N128/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N128/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N128/solver.xml index ff3cd9cc4..efbae605e 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N128/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N128/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -103,6 +103,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P1P1/N256/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P1P1/N256/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P1P1/N256/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P1P1/N256/solver.xml index 48712fbf6..e65988784 100644 --- a/tests/cases/stokes/manufactured_solution/P1P1/N256/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P1P1/N256/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -101,6 +101,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N004/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N004/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N004/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N004/solver.xml index 815e63f36..d9fbf88bf 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N004/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N004/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -94,6 +94,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N008/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N008/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N008/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N008/solver.xml index 0238139f3..d4b9e25b2 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N008/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N008/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -93,6 +93,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N016/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N016/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N016/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N016/solver.xml index bbc80b4bd..f23b88d20 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N016/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N016/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -93,6 +93,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N032/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N032/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N032/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N032/solver.xml index f2fbdd7bd..02f748005 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N032/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N032/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -93,6 +93,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N064/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N064/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N064/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N064/solver.xml index 60fac3987..bb43df334 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N064/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N064/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -94,6 +94,6 @@ - + diff --git a/tests/cases/stokes/manufactured_solution/P2P1/N128/svFSIplus.xml b/tests/cases/stokes/manufactured_solution/P2P1/N128/solver.xml similarity index 98% rename from tests/cases/stokes/manufactured_solution/P2P1/N128/svFSIplus.xml rename to tests/cases/stokes/manufactured_solution/P2P1/N128/solver.xml index ff2a77582..549310958 100644 --- a/tests/cases/stokes/manufactured_solution/P2P1/N128/svFSIplus.xml +++ b/tests/cases/stokes/manufactured_solution/P2P1/N128/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -94,6 +94,6 @@ - + diff --git a/tests/cases/struct/LV_Guccione_passive/svFSIplus.xml b/tests/cases/struct/LV_Guccione_passive/solver.xml similarity index 98% rename from tests/cases/struct/LV_Guccione_passive/svFSIplus.xml rename to tests/cases/struct/LV_Guccione_passive/solver.xml index 4f1086c7b..80755e927 100644 --- a/tests/cases/struct/LV_Guccione_passive/svFSIplus.xml +++ b/tests/cases/struct/LV_Guccione_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -101,4 +101,4 @@ - + diff --git a/tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml b/tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml similarity index 98% rename from tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml rename to tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml index 8f1c7955d..560e6cea9 100644 --- a/tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml +++ b/tests/cases/struct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -109,4 +109,4 @@ - + diff --git a/tests/cases/struct/LV_HolzapfelOgden_passive/svFSIplus.xml b/tests/cases/struct/LV_HolzapfelOgden_passive/solver.xml similarity index 98% rename from tests/cases/struct/LV_HolzapfelOgden_passive/svFSIplus.xml rename to tests/cases/struct/LV_HolzapfelOgden_passive/solver.xml index 932d005ae..9a6f9339f 100644 --- a/tests/cases/struct/LV_HolzapfelOgden_passive/svFSIplus.xml +++ b/tests/cases/struct/LV_HolzapfelOgden_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -109,4 +109,4 @@ - + diff --git a/tests/cases/struct/LV_NeoHookean_passive/svFSIplus.xml b/tests/cases/struct/LV_NeoHookean_passive/solver.xml similarity index 98% rename from tests/cases/struct/LV_NeoHookean_passive/svFSIplus.xml rename to tests/cases/struct/LV_NeoHookean_passive/solver.xml index 7086ae20d..d69797993 100644 --- a/tests/cases/struct/LV_NeoHookean_passive/svFSIplus.xml +++ b/tests/cases/struct/LV_NeoHookean_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -96,4 +96,4 @@ - + diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/README.md b/tests/cases/struct/LV_NeoHookean_passive_genBC/README.md index dfcc03655..008e62c85 100644 --- a/tests/cases/struct/LV_NeoHookean_passive_genBC/README.md +++ b/tests/cases/struct/LV_NeoHookean_passive_genBC/README.md @@ -2,7 +2,7 @@ This test case simulates an idealized left ventricle (LV) with a NeoHookean mate coupled to a lumped-parameter network (LPN), implemented in genBC. The LPN consists of a large pressure source and large resistor, which together produce an approximately constant flowrate into the LV. This inflates the LV at an approximately constant rate of change of volume. -Before running svFSIplus, genBC_svFSIplus must be compiled. Navigate to genBC_svFSIplus +Before running svMultiPhysics , genBC_svMultiPhysics must be compiled. Navigate to genBC_svMultiPhysics and run `make clean` then `make`. The results can be post-processed by running `process_results.py`. If run for 100 @@ -26,4 +26,4 @@ ramp the flowrate from 0 to 100 cm^3/s over 10 timesteps.* ![Pressure vs. Volume](pv_plot.png) -*Plot of pressure vs. volume as the LV is inflated.* \ No newline at end of file +*Plot of pressure vs. volume as the LV is inflated.* diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile.in b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile.in similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile.in rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile.in diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/initial_values_final.f b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/initial_values_final.f similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/initial_values_final.f rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/initial_values_final.f diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/parameters_final.f b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/parameters_final.f similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/parameters_final.f rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/parameters_final.f diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/GenBC.f b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/GenBC.f similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/GenBC.f rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/GenBC.f diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/Modules.f b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/Modules.f similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/Modules.f rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/Modules.f diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/USER.f b/tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/USER.f similarity index 100% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/USER.f rename to tests/cases/struct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/USER.f diff --git a/tests/cases/struct/LV_NeoHookean_passive_genBC/svFSIplus.xml b/tests/cases/struct/LV_NeoHookean_passive_genBC/solver.xml similarity index 93% rename from tests/cases/struct/LV_NeoHookean_passive_genBC/svFSIplus.xml rename to tests/cases/struct/LV_NeoHookean_passive_genBC/solver.xml index 40a90c1cd..4d6571e4d 100644 --- a/tests/cases/struct/LV_NeoHookean_passive_genBC/svFSIplus.xml +++ b/tests/cases/struct/LV_NeoHookean_passive_genBC/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -11,7 +11,7 @@ 1 result - + 1 1 @@ -83,7 +83,7 @@ - genBC_svFSIplus/genBC.exe + genBC_svMultiPhysics/genBC.exe @@ -99,4 +99,4 @@ - + diff --git a/tests/cases/struct/LV_NeoHookean_passive_sv0D/svFSIplus.xml b/tests/cases/struct/LV_NeoHookean_passive_sv0D/solver.xml similarity index 98% rename from tests/cases/struct/LV_NeoHookean_passive_sv0D/svFSIplus.xml rename to tests/cases/struct/LV_NeoHookean_passive_sv0D/solver.xml index 83d62a8e4..44e675ed6 100644 --- a/tests/cases/struct/LV_NeoHookean_passive_sv0D/svFSIplus.xml +++ b/tests/cases/struct/LV_NeoHookean_passive_sv0D/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -97,4 +97,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tests/cases/struct/block_compression/svFSIplus.xml b/tests/cases/struct/block_compression/solver.xml similarity index 98% rename from tests/cases/struct/block_compression/svFSIplus.xml rename to tests/cases/struct/block_compression/solver.xml index 8571d652f..eb1543afe 100644 --- a/tests/cases/struct/block_compression/svFSIplus.xml +++ b/tests/cases/struct/block_compression/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -119,6 +119,6 @@ - + diff --git a/tests/cases/struct/robin/svFSIplus.xml b/tests/cases/struct/robin/solver.xml similarity index 97% rename from tests/cases/struct/robin/svFSIplus.xml rename to tests/cases/struct/robin/solver.xml index 3ca743fd2..a61251861 100644 --- a/tests/cases/struct/robin/svFSIplus.xml +++ b/tests/cases/struct/robin/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -91,6 +91,6 @@ - + diff --git a/tests/cases/struct/tensile_adventitia_Guccione_active/svFSIplus.xml b/tests/cases/struct/tensile_adventitia_Guccione_active/solver.xml similarity index 98% rename from tests/cases/struct/tensile_adventitia_Guccione_active/svFSIplus.xml rename to tests/cases/struct/tensile_adventitia_Guccione_active/solver.xml index 089a18037..d70d088ce 100644 --- a/tests/cases/struct/tensile_adventitia_Guccione_active/svFSIplus.xml +++ b/tests/cases/struct/tensile_adventitia_Guccione_active/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -115,4 +115,4 @@ - + diff --git a/tests/cases/struct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml b/tests/cases/struct/tensile_adventitia_Newtonian_viscosity/solver.xml similarity index 98% rename from tests/cases/struct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml rename to tests/cases/struct/tensile_adventitia_Newtonian_viscosity/solver.xml index 8784bd6db..75b720d45 100644 --- a/tests/cases/struct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml +++ b/tests/cases/struct/tensile_adventitia_Newtonian_viscosity/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -122,4 +122,4 @@ - + diff --git a/tests/cases/struct/tensile_adventitia_Potential_viscosity/svFSIplus.xml b/tests/cases/struct/tensile_adventitia_Potential_viscosity/solver.xml similarity index 98% rename from tests/cases/struct/tensile_adventitia_Potential_viscosity/svFSIplus.xml rename to tests/cases/struct/tensile_adventitia_Potential_viscosity/solver.xml index 9b1eeeaa0..cf9b62c0e 100644 --- a/tests/cases/struct/tensile_adventitia_Potential_viscosity/svFSIplus.xml +++ b/tests/cases/struct/tensile_adventitia_Potential_viscosity/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -122,4 +122,4 @@ - + diff --git a/tests/cases/ustruct/LV_Guccione_active/svFSIplus.xml b/tests/cases/ustruct/LV_Guccione_active/solver.xml similarity index 98% rename from tests/cases/ustruct/LV_Guccione_active/svFSIplus.xml rename to tests/cases/ustruct/LV_Guccione_active/solver.xml index 1589360fa..9915c03d3 100644 --- a/tests/cases/ustruct/LV_Guccione_active/svFSIplus.xml +++ b/tests/cases/ustruct/LV_Guccione_active/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -99,6 +99,6 @@ - + diff --git a/tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml b/tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml similarity index 98% rename from tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml rename to tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml index 101e0f0e8..2106e989e 100644 --- a/tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/svFSIplus.xml +++ b/tests/cases/ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -108,6 +108,6 @@ - + diff --git a/tests/cases/ustruct/LV_HolzapfelOgden_passive/svFSIplus.xml b/tests/cases/ustruct/LV_HolzapfelOgden_passive/solver.xml similarity index 98% rename from tests/cases/ustruct/LV_HolzapfelOgden_passive/svFSIplus.xml rename to tests/cases/ustruct/LV_HolzapfelOgden_passive/solver.xml index a634fad5f..304745161 100644 --- a/tests/cases/ustruct/LV_HolzapfelOgden_passive/svFSIplus.xml +++ b/tests/cases/ustruct/LV_HolzapfelOgden_passive/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -108,6 +108,6 @@ - + diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/README.md b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/README.md index dfcc03655..8a715e3ed 100644 --- a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/README.md +++ b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/README.md @@ -2,7 +2,7 @@ This test case simulates an idealized left ventricle (LV) with a NeoHookean mate coupled to a lumped-parameter network (LPN), implemented in genBC. The LPN consists of a large pressure source and large resistor, which together produce an approximately constant flowrate into the LV. This inflates the LV at an approximately constant rate of change of volume. -Before running svFSIplus, genBC_svFSIplus must be compiled. Navigate to genBC_svFSIplus +Before running svMultiPhysics, genBC_svMultiPhysics must be compiled. Navigate to genBC_svMultiPhysics and run `make clean` then `make`. The results can be post-processed by running `process_results.py`. If run for 100 @@ -26,4 +26,4 @@ ramp the flowrate from 0 to 100 cm^3/s over 10 timesteps.* ![Pressure vs. Volume](pv_plot.png) -*Plot of pressure vs. volume as the LV is inflated.* \ No newline at end of file +*Plot of pressure vs. volume as the LV is inflated.* diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile.in b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile.in similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/Makefile.in rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/Makefile.in diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/initial_values_final.f b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/initial_values_final.f similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/initial_values_final.f rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/initial_values_final.f diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/parameters_final.f b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/parameters_final.f similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/include/parameters_final.f rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/include/parameters_final.f diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/GenBC.f b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/GenBC.f similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/GenBC.f rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/GenBC.f diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/Modules.f b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/Modules.f similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/Modules.f rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/Modules.f diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/USER.f b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/USER.f similarity index 100% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svFSIplus/src/USER.f rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/genBC_svMultiPhysics/src/USER.f diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/svFSIplus.xml b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/solver.xml similarity index 93% rename from tests/cases/ustruct/LV_NeoHookean_passive_genBC/svFSIplus.xml rename to tests/cases/ustruct/LV_NeoHookean_passive_genBC/solver.xml index acf1c06c0..af38aeffb 100644 --- a/tests/cases/ustruct/LV_NeoHookean_passive_genBC/svFSIplus.xml +++ b/tests/cases/ustruct/LV_NeoHookean_passive_genBC/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -11,7 +11,7 @@ 1 result - + 1 1 @@ -84,7 +84,7 @@ - genBC_svFSIplus/genBC.exe + genBC_svMultiPhysics/genBC.exe @@ -100,4 +100,4 @@ - + diff --git a/tests/cases/ustruct/LV_NeoHookean_passive_sv0D/svFSIplus.xml b/tests/cases/ustruct/LV_NeoHookean_passive_sv0D/solver.xml similarity index 98% rename from tests/cases/ustruct/LV_NeoHookean_passive_sv0D/svFSIplus.xml rename to tests/cases/ustruct/LV_NeoHookean_passive_sv0D/solver.xml index fc375b067..b0191810a 100644 --- a/tests/cases/ustruct/LV_NeoHookean_passive_sv0D/svFSIplus.xml +++ b/tests/cases/ustruct/LV_NeoHookean_passive_sv0D/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -98,4 +98,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tests/cases/ustruct/block_compression/P1P1_VMS/svFSIplus.xml b/tests/cases/ustruct/block_compression/P1P1_VMS/solver.xml similarity index 98% rename from tests/cases/ustruct/block_compression/P1P1_VMS/svFSIplus.xml rename to tests/cases/ustruct/block_compression/P1P1_VMS/solver.xml index d723f84d1..0268cf049 100644 --- a/tests/cases/ustruct/block_compression/P1P1_VMS/svFSIplus.xml +++ b/tests/cases/ustruct/block_compression/P1P1_VMS/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -130,6 +130,6 @@ - + diff --git a/tests/cases/ustruct/tensile_adventitia_HGO/svFSIplus.xml b/tests/cases/ustruct/tensile_adventitia_HGO/solver.xml similarity index 98% rename from tests/cases/ustruct/tensile_adventitia_HGO/svFSIplus.xml rename to tests/cases/ustruct/tensile_adventitia_HGO/solver.xml index 70c94d936..42bc49bf3 100644 --- a/tests/cases/ustruct/tensile_adventitia_HGO/svFSIplus.xml +++ b/tests/cases/ustruct/tensile_adventitia_HGO/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -146,6 +146,6 @@ - + diff --git a/tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml b/tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/solver.xml similarity index 98% rename from tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml rename to tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/solver.xml index 33b8c5090..8fd66998e 100644 --- a/tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/svFSIplus.xml +++ b/tests/cases/ustruct/tensile_adventitia_Newtonian_viscosity/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -124,4 +124,4 @@ - + diff --git a/tests/cases/ustruct/tensile_adventitia_Potential_viscosity/svFSIplus.xml b/tests/cases/ustruct/tensile_adventitia_Potential_viscosity/solver.xml similarity index 98% rename from tests/cases/ustruct/tensile_adventitia_Potential_viscosity/svFSIplus.xml rename to tests/cases/ustruct/tensile_adventitia_Potential_viscosity/solver.xml index 28a7309d4..c3a133852 100644 --- a/tests/cases/ustruct/tensile_adventitia_Potential_viscosity/svFSIplus.xml +++ b/tests/cases/ustruct/tensile_adventitia_Potential_viscosity/solver.xml @@ -1,5 +1,5 @@ - + 0 @@ -124,4 +124,4 @@ - + diff --git a/tests/conftest.py b/tests/conftest.py index 107a285e8..29430b41a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,8 +11,8 @@ if platform.system() == "Darwin": is_not_Darwin = False this_file_dir = os.path.abspath(os.path.dirname(__file__)) -cpp_exec = os.path.join(this_file_dir, "..", "build", "svFSIplus-build", "bin", "svfsiplus") -cpp_exec_p = os.path.join(this_file_dir, "..", "build-petsc", "svFSIplus-build", "bin", "svfsiplus") +cpp_exec = os.path.join(this_file_dir, "..", "build", "svMultiPhysics-build", "bin", "svmultiphysics") +cpp_exec_p = os.path.join(this_file_dir, "..", "build-petsc", "svMultiPhysics-build", "bin", "svmultiphysics") # Relative tolerances for each tested field RTOL = { @@ -49,7 +49,7 @@ def run_by_name(folder, name, t_max, n_proc=1): Run a test case and return results Args: folder: location from which test will be executed - name: name of svFSIplus input file (.xml) + name: name of svMultiPhysics input file (.xml) t_max: time step to compare n_proc: number of processors @@ -108,7 +108,7 @@ def run_by_name(folder, name, t_max, n_proc=1): folder, str(n_proc) + "-procs", "result_" + str(t_max).zfill(3) + ".vtu" ) if not os.path.exists(fname): - raise RuntimeError("No svFSIplus output: " + fname) + raise RuntimeError("No svMultiPhysics output: " + fname) return meshio.read(fname) @@ -119,7 +119,7 @@ def run_with_reference( n_proc=1, t_max=1, name_ref=None, - name_inp="svFSIplus.xml", + name_inp="solver.xml", ): """ Run a test case and compare it to a stored reference solution @@ -128,7 +128,7 @@ def run_with_reference( fields: array fields to compare (e.g. ["Pressure", "Velocity"]) n_proc: number of processors t_max: time step to compare - name_inp: name of svFSIplus input file (.xml) + name_inp: name of svMultiPhysics input file (.xml) name_ref: name of refence file (.vtu) """ # default reference name diff --git a/tests/test_cep.py b/tests/test_cep.py index 53d5d3d31..57c318460 100644 --- a/tests/test_cep.py +++ b/tests/test_cep.py @@ -44,7 +44,7 @@ def test_purkinje(n_proc): def test_niederer_benchmark_ECGs_quadrature(confs_ecgs, n_proc): test_folder = "niederer_benchmark_ECGs_quadrature" t_max = 1 - name_inp = "svFSI_" + confs_ecgs[0] + ".xml" + name_inp = "solver_" + confs_ecgs[0] + ".xml" name_ref = "result_" + confs_ecgs[0] + "_" + str(t_max).zfill(3) + ".vtu" run_with_reference( base_folder, test_folder, fields, n_proc, t_max, name_ref, name_inp diff --git a/tests/test_heats.py b/tests/test_heats.py index 1c0ee6aff..51dcbbe81 100644 --- a/tests/test_heats.py +++ b/tests/test_heats.py @@ -15,5 +15,5 @@ @pytest.mark.parametrize("linear_solver", ["CG", "BICG", "GMRES"]) def test_diffusion_line_source(linear_solver, n_proc): test_folder = "diffusion_line_source" - name_inp = "svFSI_" + linear_solver + ".xml" + name_inp = "solver_" + linear_solver + ".xml" run_with_reference(base_folder, test_folder, fields, n_proc, 2, name_inp=name_inp) diff --git a/tests/test_struct.py b/tests/test_struct.py index 01cf57d97..243224da5 100644 --- a/tests/test_struct.py +++ b/tests/test_struct.py @@ -54,7 +54,7 @@ def test_LV_NeoHookean_passive_genBC(n_proc): os.remove(name) # Compile genBC - os.chdir("genBC_svFSIplus") + os.chdir("genBC_svMultiPhysics") subprocess.run(["make", "clean"], check=True) subprocess.run(["make"], check=True) diff --git a/tests/test_ustruct.py b/tests/test_ustruct.py index 5b3365afa..905dada21 100644 --- a/tests/test_ustruct.py +++ b/tests/test_ustruct.py @@ -52,7 +52,7 @@ def test_LV_NeoHookean_passive_genBC(n_proc): os.remove(name) # Compile genBC - os.chdir("genBC_svFSIplus") + os.chdir("genBC_svMultiPhysics") subprocess.run(["make", "clean"], check=True) subprocess.run(["make"], check=True) @@ -72,4 +72,4 @@ def test_tensile_adventitia_Newtonian_viscosity(n_proc): def test_tensile_adventitia_Potential_viscosity(n_proc): test_folder = "tensile_adventitia_Potential_viscosity" - run_with_reference(base_folder, test_folder, fields, n_proc, t_max=1) \ No newline at end of file + run_with_reference(base_folder, test_folder, fields, n_proc, t_max=1) diff --git a/tests/unitTests/test.h b/tests/unitTests/test.h index 97a6f26c1..095de587a 100644 --- a/tests/unitTests/test.h +++ b/tests/unitTests/test.h @@ -30,7 +30,7 @@ // -------------------------------------------------------------- // To run the tests in test.cpp -// 1. Navigate to /build/svFSI-build/Source/svFSI +// 1. Navigate to /build/svMultiPhysics-build/Source/solver // 2. Run `make` to build the tests // 3. Run `ctest --verbose` to run the tests @@ -41,7 +41,7 @@ // 1. Create a new material parameters class derived from MatParams (e.g. NeoHookeanParams) // 2. Create a new material model test class derived from TestMaterialModel (e.g. TestNeoHookean) // 3. Implement required functions in the material model test class: -// - Constructor: Sets the material model type and parameters for svFSIplus (e.g. TestNeoHookean()) +// - Constructor: Sets the material model type and parameters for svMultiPhysics (e.g. TestNeoHookean()) // - printMaterialParameters(): Prints the material parameters // - computeStrainEnergy(): Computes the strain energy density function // In test.cpp: @@ -326,7 +326,7 @@ std::pair computeLinearRegression(const std::vector& x, } // -------------------------------------------------------------- -// -------------------- Mock svFSIplus object ------------------- +// -------------------- Mock svMultiPhysics object ------------------- // -------------------------------------------------------------- @@ -376,7 +376,7 @@ class MockComMod : public ComMod { // ------------------ Test Material Model Classes --------------- // -------------------------------------------------------------- -// Class for testing material models in svFSI +// Class for testing material models in svMultiPhysics class TestMaterialModel { public: MockComMod com_mod; @@ -1109,7 +1109,7 @@ class TestMaterialModel { // Compute CC_ijkl(F). // CC is provided in Voigt notation as Dm, and we will convert it to CC double S[3][3], Dm[6][6]; - get_pk2cc(F, S, Dm); // S from svFSI + get_pk2cc(F, S, Dm); // S from solver // Calculate CC from Dm double CC[3][3][3][3]; @@ -1634,14 +1634,14 @@ class TestNeoHookean : public TestMaterialModel { /** * @brief Constructor for the TestNeoHookean class. * - * Initializes the Neo-Hookean material parameters for svFSIplus. + * Initializes the Neo-Hookean material parameters for svMultiPhysics. * * @param[in] params_ Parameters for the Neo-Hookean material model. */ TestNeoHookean(const NeoHookeanParams ¶ms_) : TestMaterialModel( consts::ConstitutiveModelType::stIso_nHook, consts::ConstitutiveModelType::stVol_ST91), params(params_) { - // Set Neo-Hookean material parameters for svFSIplus + // Set Neo-Hookean material parameters for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.C10 = params.C10; dmn.stM.Kpen = 0.0; // Zero volumetric penalty parameter @@ -1689,14 +1689,14 @@ class TestMooneyRivlin : public TestMaterialModel { /** * @brief Constructor for the TestMooneyRivlin class. * - * Initializes the Mooney-Rivlin material parameters for svFSIplus. + * Initializes the Mooney-Rivlin material parameters for svMultiPhysics. * * @param[in] params_ Parameters for the Mooney-Rivlin material model. */ TestMooneyRivlin(const MooneyRivlinParams ¶ms_) : TestMaterialModel( consts::ConstitutiveModelType::stIso_MR, consts::ConstitutiveModelType::stVol_ST91), params(params_) { - // Set Mooney-Rivlin material parameters for svFSIplus + // Set Mooney-Rivlin material parameters for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.C01 = params.C01; dmn.stM.C10 = params.C10; @@ -1746,14 +1746,14 @@ class TestHolzapfelOgden : public TestMaterialModel { /** * @brief Constructor for the TestHolzapfelOgden class. * - * Initializes the Holzapfel-Ogden material parameters for svFSIplus. + * Initializes the Holzapfel-Ogden material parameters for svMultiPhysics. * * @param[in] params_ Parameters for the Holzapfel-Ogden material model. */ TestHolzapfelOgden(const HolzapfelOgdenParams ¶ms_) : TestMaterialModel( consts::ConstitutiveModelType::stIso_HO, consts::ConstitutiveModelType::stVol_ST91), params(params_) { - // Set Holzapfel-Ogden material parameters for svFSIplus + // Set Holzapfel-Ogden material parameters for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.a = params.a; dmn.stM.b = params.b; @@ -1837,7 +1837,7 @@ class TestHolzapfelOgden : public TestMaterialModel { // + a_f/2b_f * chi(I4_bar_f) * (exp{b_f(I4_bar_f - 1)^2} - 1 // + a_s/2b_s * chi(I4_bar_s) * (exp{b_s(I4_bar_s - 1)^2} - 1 // + a_fs/2b_fs * (exp{b_fs*I8_bar_fs^2} - 1) - // This corresponds to the HO implementation in svFSIplus + // This corresponds to the HO implementation in svMultiPhysics // Invariants double I1_bar = smTerms.Ib1; @@ -1880,14 +1880,14 @@ class TestHolzapfelOgdenMA : public TestMaterialModel { /** * @brief Constructor for the TestHolzapfelOgdenMA class. * - * Initializes the Holzapfel-Ogden material parameters for svFSIplus. + * Initializes the Holzapfel-Ogden material parameters for svMultiPhysics. * * @param[in] params_ Parameters for the Holzapfel-Ogden ma material model. */ TestHolzapfelOgdenMA(const HolzapfelOgdenMAParams ¶ms_) : TestMaterialModel( consts::ConstitutiveModelType::stIso_HO_ma, consts::ConstitutiveModelType::stVol_ST91), params(params_) { - // Set Holzapfel-Ogden material parameters for svFSIplus + // Set Holzapfel-Ogden material parameters for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.a = params.a; dmn.stM.b = params.b; @@ -1971,7 +1971,7 @@ class TestHolzapfelOgdenMA : public TestMaterialModel { // + a_f/2b_f * chi(I4_f) * (exp{b_f(I4_f - 1)^2} - 1 // + a_s/2b_s * chi(I4_s) * (exp{b_s(I4_s - 1)^2} - 1 // + a_fs/2b_fs * (exp{b_fs*I8_fs^2} - 1) - // This corresponds to the HO-ma (modified anisotropy) implementation in svFSIplus + // This corresponds to the HO-ma (modified anisotropy) implementation in svMultiPhysics // Invariants double I1_bar = smTerms.Ib1; @@ -2014,7 +2014,7 @@ class TestQuadraticVolumetricPenalty : public TestMaterialModel { /** * @brief Constructor for the TestQuadraticVolumetricPenalty class. * - * Initializes the volumetric penalty parameters for svFSIplus. + * Initializes the volumetric penalty parameters for svMultiPhysics. * * @param[in] params_ Parameters for the volumetric penalty model. */ @@ -2022,7 +2022,7 @@ class TestQuadraticVolumetricPenalty : public TestMaterialModel { params(params_) { - // Set volumetric penalty parameter for svFSIplus + // Set volumetric penalty parameter for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.Kpen = params.kappa; // Volumetric penalty parameter @@ -2073,7 +2073,7 @@ class TestSimoTaylor91VolumetricPenalty : public TestMaterialModel { /** * @brief Constructor for the TestSimoTaylor91VolumetricPenalty class. * - * Initializes the volumetric penalty parameters for svFSIplus. + * Initializes the volumetric penalty parameters for svMultiPhysics. * * @param[in] params_ Parameters for the volumetric penalty model. */ @@ -2081,7 +2081,7 @@ class TestSimoTaylor91VolumetricPenalty : public TestMaterialModel { params(params_) { - // Set volumetric penalty parameter for svFSIplus + // Set volumetric penalty parameter for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.Kpen = params.kappa; // Volumetric penalty parameter @@ -2132,7 +2132,7 @@ class TestMiehe94VolumetricPenalty : public TestMaterialModel { /** * @brief Constructor for the TestMiehe94VolumetricPenalty class. * - * Initializes the volumetric penalty parameters for svFSIplus. + * Initializes the volumetric penalty parameters for svMultiPhysics. * * @param[in] params_ Parameters for the volumetric penalty model. */ @@ -2140,7 +2140,7 @@ class TestMiehe94VolumetricPenalty : public TestMaterialModel { params(params_) { - // Set volumetric penalty parameter for svFSIplus + // Set volumetric penalty parameter for svMultiPhysics auto &dmn = com_mod.mockEq.mockDmn; dmn.stM.Kpen = params.kappa; // Volumetric penalty parameter @@ -2172,4 +2172,4 @@ class TestMiehe94VolumetricPenalty : public TestMaterialModel { return Psi; } -}; \ No newline at end of file +};