Skip to content

Commit

Permalink
Merge pull request #232 from vickysharma0812/dev
Browse files Browse the repository at this point in the history
v23.10.1
  • Loading branch information
vickysharma0812 authored Dec 1, 2023
2 parents bf37b5f + 301bc68 commit 4c0dea1
Show file tree
Hide file tree
Showing 308 changed files with 31,034 additions and 10,415 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

vscode-settings
media/
include/
lib/
opt/
bin/
Expand Down
29 changes: 28 additions & 1 deletion cmake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,34 @@ ENDIF()
IF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" OR Fortran_COMPILER_NAME MATCHES "gfortran*")
LIST(APPEND FORTRAN_FLAGS "-ffree-form" "-ffree-line-length-none" "-std=f2018" "-fimplicit-none" )
LIST(APPEND FORTRAN_FLAGS_RELEASE "-O3" )
LIST(APPEND FORTRAN_FLAGS_DEBUG "-fbounds-check" "-g" "-fbacktrace" "-Wextra" "-Wall" "-fprofile-arcs" "-ftest-coverage" "-Wimplicit-interface" )

IF(APPLE)
LIST(
APPEND
FORTRAN_FLAGS_DEBUG
"-fbounds-check"
"-g"
"-fbacktrace"
"-Wextra"
"-Wall"
# "-fprofile-arcs"
"-ftest-coverage"
"-Wimplicit-interface"
)
ELSE()
LIST(
APPEND
FORTRAN_FLAGS_DEBUG
"-fbounds-check"
"-g"
"-fbacktrace"
"-Wextra"
"-Wall"
# "-fprofile-arcs"
"-ftest-coverage"
"-Wimplicit-interface"
)
ENDIF()

ELSEIF(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR Fortran_COMPILER_NAME MATCHES "ifort*")
LIST(APPEND FORTRAN_FLAGS "-r8" "-W1")
Expand Down
2 changes: 0 additions & 2 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# find_package(easifemBase 1.0.0 CONFIG REQUIRED)
#
# The following variables can be set to guide the search for this package:
#
#

@PACKAGE_INIT@

Expand Down
39 changes: 39 additions & 0 deletions cmake/Modules/FindGmsh.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ##############################################################################
# Try to find Gmsh # # Once done this
# will define: # GMSH_FOUND - system has Gmsh #
# GMSH_INC - Gmsh include directory (static or dynamic) # GMSH_LIB -
# Gmsh library # # Usage: # find_package(Gmsh) # #
# Setting these changes the behavior of the search # GMSH_INC - Gmsh
# include directory # GMSH_LIB - Gmsh library path
# (static or dynamic) #
# ##############################################################################

# Try to set GMSH_LIB and GMSH_INC from environment variables ##
# ##############################################################################

if(NOT DEFINED GMSH_LIB)

find_package(Python3 COMPONENTS Interpreter Development)

if(Python3_FOUND)
message(STATUS "FOUND Python3")
message(STATUS "Python3_LIBRARY_DIRS ${Python3_LIBRARY_DIRS}")
find_library(GMSH_LIB "gmsh" HINTS $ENV{GMSH_LIB} ${Python3_LIBRARY_DIRS}
NO_CACHE)
else()
message(STATUS "NOT FOUND Python3")
find_library(GMSH_LIB "gmsh" HINTS $ENV{GMSH_LIB} NO_CACHE)
endif()
endif()

# if(NOT DEFINED GMSH_INC) find_path(GMSH_INC "gmsh.h" HINTS $ENV{GMSH_INC}
# NO_CACHE) endif()

# CMake check and done ##
# ##############################################################################
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Gmsh
"Gmsh could not be found: be sure to set GMSH_LIB and GMSH_INC in your environment variables"
GMSH_LIB)
# GMSH_INC)
84 changes: 49 additions & 35 deletions cmake/addGmsh.cmake
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
# This program is a part of EASIFEM library
# Copyright (C) 2020-2021 Vikas Sharma, Ph.D
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#
#GMSH SDK
IF( ${PROJECT_NAME} MATCHES "easifemClasses" )
OPTION( USE_GMSH_SDK OFF )
IF( USE_GMSH_SDK )
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_GMSH_SDK" )
IF( UNIX )
IF(APPLE)
SET( GMSH_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/libgmsh.dylib" )
ELSE()
# SET( GMSH_LIBRARIES "$ENV{HOME}/.local/lib/libgmsh.so" )
SET( GMSH_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/libgmsh.so" )
ENDIF()
ENDIF()
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${GMSH_LIBRARIES} )
MESSAGE( STATUS "GMSH_LIBRARIES : ${GMSH_LIBRARIES}" )
ELSE()
MESSAGE( STATUS "NOT USING GMSH SDK LIBRARIES" )
ENDIF()
ENDIF()
# This program is a part of EASIFEM library Copyright (C) 2020-2021 Vikas
# Sharma, Ph.D
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https: //www.gnu.org/licenses/>
#
# GMSH SDK IF( ${PROJECT_NAME} MATCHES "easifemClasses" ) OPTION( USE_GMSH_SDK
# OFF ) IF( USE_GMSH_SDK ) LIST( APPEND TARGET_COMPILE_DEF "-DUSE_GMSH_SDK" )
# FIND_PACKAGE(PkgConfig REQUIRED) FIND_LIBRARY(GMSH_LIBRARY NAMES gmsh PATHS
# "$ENV{CONDA_PREFIX}/lib" "/opt/homebrew/lib" ) # PATHS "/opt/homebrew/lib" )
# SET(GMSH_LIBRARIES ${GMSH_LIBRARY})
#
# INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS( GMSH
# DEFAULT_MSG GMSH_LIBRARIES )
#
# # SET(GMSH_LIBRARIES "$ENV{CONDA_PREFIX}/lib/libgmsh.so")
#
# TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${GMSH_LIBRARIES} )
#
# MESSAGE( STATUS "GMSH_LIBRARIES : ${GMSH_LIBRARIES}" ) ELSE() MESSAGE( STATUS
# "NOT USING GMSH SDK LIBRARIES" ) ENDIF() ENDIF()

if(${PROJECT_NAME} MATCHES "easifemClasses")
option(USE_GMSH_SDK OFF)
if(USE_GMSH_SDK)
message(STATUS "USING GMSH SDK")
list(APPEND TARGET_COMPILE_DEF "-DUSE_GMSH_SDK")
find_package(Gmsh REQUIRED)
if(GMSH_FOUND)
message(STATUS "FOUND Gmsh")
message(STATUS "GMSH_LIBRARIES : ${GMSH_LIB}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${GMSH_LIB})
else()
message(STATUS "NOT FOUND Gmsh")
endif()
else()
message(STATUS "NOT USING GMSH SDK")
endif()
endif()
4 changes: 2 additions & 2 deletions cmake/targetCompileDefs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ ENDIF()
LIST( APPEND TARGET_COMPILE_DEF "-D${CMAKE_HOST_SYSTEM_NAME}_SYSTEM" )

#DEFINE DEBUG
IF( $<CONFIG:DEBUG> )
IF (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
LIST( APPEND TARGET_COMPILE_DEF "-DDEBUG_VER" )
ENDIF()

#ADD TO PROJECT
TARGET_COMPILE_DEFINITIONS( ${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_DEF} )
MESSAGE( STATUS "COMPILE DEFINITIONS USED ARE ${TARGET_COMPILE_DEF}")
MESSAGE( STATUS "COMPILE DEFINITIONS USED ARE ${TARGET_COMPILE_DEF}")
43 changes: 0 additions & 43 deletions cmake/targetLinkLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,6 @@
#
#

# Link libs to the project

#....................................................................
#
#....................................................................

FUNCTION(FIND_EASIFEM_DEPENDENCY EXT_PKG_LIST)
FOREACH(p ${EXT_PKG_LIST})
FIND_PACKAGE( ${p} REQUIRED )
IF( ${p}_FOUND )
MESSAGE(STATUS "FOUND ${p}")
ELSE()
MESSAGE(ERROR "NOT FOUND ${p}")
ENDIF()
ENDFOREACH()
ENDFUNCTION(FIND_EASIFEM_DEPENDENCY)

#....................................................................
#
#....................................................................

FUNCTION(LINK_EASIFEM_DEPENDENCY EXT_PKG_LIST PROJECT_NAME)
FOREACH(p ${EXT_PKG_LIST})
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${p}::${p} )
ENDFOREACH()
ENDFUNCTION(LINK_EASIFEM_DEPENDENCY)

#....................................................................
#
#....................................................................

IF( ${PROJECT_NAME} MATCHES "easifemBase" )
IF( USE_LAPACK95 )
LIST(APPEND EXT_PKGS LAPACK95)
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_LAPACK95" )
ENDIF()

LIST(APPEND EXT_PKGS Sparsekit)

FIND_EASIFEM_DEPENDENCY( "${EXT_PKGS}" )
LINK_EASIFEM_DEPENDENCY( "${EXT_PKGS}" "${PROJECT_NAME}" )
ENDIF()

#....................................................................
#
#....................................................................
Expand Down
11 changes: 11 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"markdown": {
},
"toml": {
},
"excludes": [],
"plugins": [
"https://plugins.dprint.dev/markdown-0.16.3.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm"
]
}
4 changes: 2 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
else:
cmake_def = ""
cmake_def += '-G "Ninja"'
cmake_def += " -D USE_GMSH_SDK:BOOL=OFF"
cmake_def += " -D CMAKE_BUILD_TYPE:STRING=Release"
cmake_def += " -D USE_GMSH_SDK:BOOL=ON"
cmake_def += " -D CMAKE_BUILD_TYPE=Debug"
cmake_def += " -D BUILD_SHARED_LIBS:BOOL=ON"
cmake_def += " -D CMAKE_INSTALL_PREFIX:PATH=${EASIFEM_CLASSES}"
print("CMAKE DEF : ", cmake_def)
Expand Down
19 changes: 18 additions & 1 deletion src/modules/AbstractBC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# This program is a part of EASIFEM library
# Copyright (C) 2020-2021 Vikas Sharma, Ph.D
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#

SET(src_path "${CMAKE_CURRENT_LIST_DIR}/src/")
TARGET_SOURCES(
${PROJECT_NAME} PRIVATE
${src_path}/AbstractBC_Class.F90
)
)
Loading

0 comments on commit 4c0dea1

Please sign in to comment.