Skip to content

Commit

Permalink
Merge branch 'main' into git_lfs_warning_26
Browse files Browse the repository at this point in the history
  • Loading branch information
mrp089 committed Feb 23, 2024
2 parents 60b6a53 + 2fd02ed commit 29f4a3b
Show file tree
Hide file tree
Showing 94 changed files with 502 additions and 2,240 deletions.
9 changes: 9 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# configuration for code coverage testing with codecov
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
git lfs pull
cd tests
conda run -n svfsiplus pytest -v --durations=0
conda run -n svfsiplus pytest -rPv --durations=0
- name: Generate code coverage
if: startsWith(matrix.os, 'ubuntu-22.04')
run: |
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ include(SimVascularFunctionCheckCompilerFlags)
#
# These variables must later be add to 'ExternalProject_Add(svFSI' as -D options.
#
set(SV_USE_TRILINOS OFF CACHE BOOL "Use Trilinos Library with svFSI")
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")
set(SV_PETSC_DIR "" CACHE STRING "Path to a local install of the PETSc linear algebra package")
set(ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage")
set(ENABLE_ARRAY_INDEX_CHECKING OFF CACHE BOOL "Enable Array index checking")
set(SV_LOCAL_VTK_PATH "" CACHE STRING "Path to a local build of VTK.")

#-----------------------------------------------------------------------------
# RPATH handling
Expand Down Expand Up @@ -117,7 +120,7 @@ set(SV_EXTERNALS_TOPLEVEL_DIR "${CMAKE_BINARY_DIR}/Externals-build/sv_externals"
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# svSolver!
# svFSIplus solver.
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(svFSI
Expand All @@ -141,8 +144,11 @@ ExternalProject_Add(svFSI
-DSV_EXTERNALS_USE_TOPLEVEL_DIR:BOOL=ON
-DSV_EXTERNALS_TOPLEVEL_DIR:PATH=${SV_EXTERNALS_TOPLEVEL_DIR}
-DSV_USE_TRILINOS:BOOL=${SV_USE_TRILINOS}
#-DSV_USE_PETSC:BOOL=${SV_USE_PETSC}
-DSV_PETSC_DIR:STRING=${SV_PETSC_DIR}
-DENABLE_COVERAGE:BOOL=${ENABLE_COVERAGE}
-DENABLE_ARRAY_INDEX_CHECKING:BOOL=${ENABLE_ARRAY_INDEX_CHECKING}
-DSV_LOCAL_VTK_PATH:STRING=${SV_LOCAL_VTK_PATH}
${SV_APPLE_CMAKE_ARGS}
${SV_ADDITIONAL_CMAKE_ARGS}
)
Expand Down
70 changes: 58 additions & 12 deletions Code/Source/svFSI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,56 @@ if(SV_USE_TRILINOS)
MESSAGE(WARNING "Trilinos_FOUND is true but Trilinos_LIBRARIES is empty. This suggests that FIND_PACKAGE(Trilinos) failed quietly. Proceed with caution.")
endif()

MESSAGE("Setting WITH_TRILINOS to true\n")
set(WITH_TRILINOS 1)
set(USE_TRILINOS 1)
ELSE()
MESSAGE(WARNING "Could not find Trilinos. Compiling svFSI without Trilinos.")
ENDIF()

endif()

# add trilinos flags and defines
if(WITH_TRILINOS)
if(USE_TRILINOS)
ADD_DEFINITIONS(-DWITH_TRILINOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

# Build with the PETSc linear algebra package.
#
if(NOT "${SV_PETSC_DIR}" STREQUAL "")

if(NOT EXISTS ${SV_PETSC_DIR})
message(ERROR "The PETSc directory ${SV_PETSC_DIR} could not be found.")
endif()

if(NOT EXISTS "${SV_PETSC_DIR}/include")
message(ERROR "The PETSc include directory ${SV_PETSC_DIR}/include could not be found.")
endif()

if(NOT EXISTS "${SV_PETSC_DIR}/lib")
message(ERROR "The PETSc library directory ${SV_PETSC_DIR}/lib could not be found.")
endif()

set(PETSC_INCLUDE_DIRS "${SV_PETSC_DIR}/include;${SV_PETSC_DIR}/../include")
set(PETSC_LIBRARY_DIRS "-L${SV_PETSC_DIR}/lib -lpetsc")
message("\nBuilding with the PETSc package; the include and libraries directories are: ")
message(" PETSC_LIBRARY_DIRS = ${PETSC_LIBRARY_DIRS}")
message(" PETSC_INCLUDE_DIRS = ${PETSC_INCLUDE_DIRS}")

# Set PETSc include directory.
include_directories(${PETSC_INCLUDE_DIRS})

# Set C++ directive to use PETSc in svFSIplus code.
ADD_DEFINITIONS(-DWITH_PETSC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -std=c99")

set(USE_PETSC 1)

else()

set(USE_PETSC 0)

endif()

if(ENABLE_ARRAY_INDEX_CHECKING)
ADD_DEFINITIONS(-DENABLE_ARRAY_INDEX_CHECKING)
endif()
Expand All @@ -71,11 +107,15 @@ endif()
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)

# Including VTK produces warnings when compiling Fortran code.
# Include VTK either from a local build using SV_LOCAL_VTK_PATH
# or from a default installed version.
#
# -iframe is valid for C/C++/ObjC/ObjC++ but not for Fortran
#
find_package(VTK REQUIRED)
if("${SV_LOCAL_VTK_PATH}" STREQUAL "")
find_package(VTK REQUIRED )
else()
find_package(VTK PATHS ${SV_LOCAL_VTK_PATH} NO_DEFAULT_PATH REQUIRED)
endif()

include(${VTK_USE_FILE})

set(lib ${SV_LIB_SVFSI_NAME})
Expand Down Expand Up @@ -151,7 +191,12 @@ set(CSRCS
SPLIT.c
)

if(WITH_TRILINOS)
# Set PETSc interace code.
if(USE_PETSC)
#set(CSRCS ${CSRCS} petsc_linear_solver.c)
endif()

if(USE_TRILINOS)
set(CSRCS ${CSRCS} trilinos_linear_solver.cpp)

# trilinos directories and libraries
Expand All @@ -168,9 +213,6 @@ simvascular_add_executable(${SV_SVFSI_EXE}
INSTALL_COMP CoreExecutables
INSTALL_DESTINATION ${SV_INSTALL_RUNTIME_DIR})

message("##### TINY ${TINYXML_LIBRARY_NAME}")
message("##### TET ${TETGEN_LIBRARY_NAME}")

target_link_libraries(${SV_SVFSI_EXE}
${GLOBAL_LIBRARIES}
${INTELRUNTIME_LIBRARIES}
Expand All @@ -190,10 +232,14 @@ if(SV_MPI_EXTRA_LIBRARY)
target_link_libraries(${SV_SVFSI_EXE} ${SV_MPI_EXTRA_LIBRARY})
endif()

if(WITH_TRILINOS)
if(USE_TRILINOS)
target_link_libraries(${SV_SVFSI_EXE} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
endif()

if(USE_PETSC)
target_link_libraries(${SV_SVFSI_EXE} ${PETSC_LIBRARY_DIRS})
endif()

# coverage
if(ENABLE_COVERAGE)
# set compiler flags
Expand Down
2 changes: 1 addition & 1 deletion Code/Source/svFSI/mat_models_carray.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ void get_pk2cc(const ComMod& com_mod, const CepMod& cep_mod, const dmnType& lDmn
for (int j = 0; j < N; j++) {
for (int k = 0; k < N; k++) {
for (int l = 0; l < N; l++) {
CCb[i][j][k][l] += g1 * Hss_prod[i][j][k][l];
CCb[i][j][k][l] += g2 * Hss_prod[i][j][k][l];
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions Code/Source/svFSI/nn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,19 +575,22 @@ void gnnb(const ComMod& com_mod, const faceType& lFa, const int e, const int g,
for (int a = 0; a < eNoNb; a++) {
int Ac = lFa.IEN(a,e);
int b = 0;
bool found_node = false;

for (int ib = 0; ib < eNoN; ib++) {
b = ib;
if (setIt[ib]) {
int Bc = msh.IEN(ib,Ec);
if (Bc == Ac) {
found_node = true;
break;
}
}
}

if (b > eNoN) {
throw std::runtime_error("could not find matching face nodes");
if (!found_node) {
throw std::runtime_error("[svFSIplus::gnnb] The '" + lFa.name + "' face node " + std::to_string(Ac) +
" could not be matched to a node in the '" + msh.name + "' volume mesh.");
}

ptr(a) = b;
Expand Down
3 changes: 1 addition & 2 deletions Code/Source/svFSI/trilinos_linear_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,8 @@ void trilinos_doassem_(int &numNodesPerElement, const int *eqN,
//converts eqN in local proc values to global values
std::vector<int> localToGlobal(numNodesPerElement);

//subtract 1 since eqN is 1 based and C is 0 based indexing
for (int i = 0; i < numNodesPerElement; ++i)
localToGlobal[i] = localToGlobalUnsorted[eqN[i] - 1];
localToGlobal[i] = localToGlobalUnsorted[eqN[i]];

//loop over local nodes on the element
for (int a = 0; a < numNodesPerElement; ++a)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
temp/
Loading

0 comments on commit 29f4a3b

Please sign in to comment.