marcinlos / iga-ads

Isogeometric Finite Element Method framework
MIT License
14 stars 8 forks source link
c-plus-plus fem iga isogeometric-analysis numerical-methods

IGA-ADS

Build status Codecov Codacy Coverity License Language Latest release

IGA-ADS is a C++ framework designed to facilitate creating parallel numerical simulations for time-dependent and stationary PDEs using isogeometric finite element method.

Building

Dependencies

Tools

Libraries

Optional

Compilation

To compile the code, in the project root directory execute the following commands:

mkdir build-dir
cmake -S. -B build-dir [OPTIONS]
cmake --build build-dir --parallel

where OPTIONS are additional build settings described below. By default this builds the entire project, including examples and supporting applications. To build only the library, add --target ADS to the last command:

cmake --build build-dir --parallel --target ADS

Once the library is compiled, in can be installed using

cmake --install build-dir

This installs the library, headers and CMake configuration files in a default system location. To install in a different directory, specify it by using the --prefix option as follows:

cmake --install build-dir --prefix /path/to/desired/directory

For more details and additional options, consult CMake documentation.

Build options

Options are specified as -D option=value, e.g. cmake -S . -B build -D ADS_USE_GALOIS=ON

Using the library

There are three primary ways to use IGA-ADS library in your CMake project.

Importing installed package

If IGA-ADS has been built and installed as described above, it can be imported using find_package command. To import and use the library with some example application, add the following to you CMakeLists.txt:

find_package(ADS 0.1.0 REQUIRED)
add_executable(example ...)
target_link_libraries(example PRIVATE ADS::ADS)

Note that if the library has been installed in a non-standard location, it may be necessary to inform CMake about it via CMAKE_PREFIX_PATH or ADS_ROOT option:

cmake -D ADS_ROOT=/path/to/install/dir ...

Including as a subdirectory

In this method, the entire IGA-ADS directory is added as a subdirectory to the project using it. One easy way to do it is by using git submodules:

git submodule add https://github.com/marcinlos/iga-ads ads

The ads directory then needs to be added in CMakeLists.txt using add_subdirectory. We can also set build options for IGA-ADS:

set(ADS_USE_GALOIS ON)
set(ADS_USE_MUMPS ON)
set(ADS_BUILD_PROBLEMS OFF)
set(ADS_BUILD_TOOLS OFF)

add_subdirectory(ads)
add_executable(example ...)
target_link_libraries(example PRIVATE ADS::ADS)

Using FetchContent

Using FetchContent we can automatically download IGA-ADS to the build directory.

include(FetchContent)

FetchContent_Declare(ADS
  GIT_REPOSITORY https://github.com/marcinlos/iga-ads
  GIT_TAG develop
)

set(ADS_USE_GALOIS ON)
set(ADS_USE_MUMPS ON)
set(ADS_BUILD_PROBLEMS OFF)
set(ADS_BUILD_TOOLS OFF)

FetchContent_MakeAvailable(ADS)
add_executable(example ...)
target_link_libraries(example PRIVATE ADS::ADS)

Note: FetchContent_MakeAvailable requires CMake >= 3.14, see here for solution working in earlier versions.

Citation

If you use this code, please cite: