Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation is independent of ISCD Commons #3

Draft
wants to merge 27 commits into
base: advects
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4537f6d
Addition of the -nocfl mode to avoid truncation of the time period fo…
Mar 21, 2017
e768421
Add new information in manual and Readme
Mar 21, 2017
52d0f23
Typoe in Readme
Mar 21, 2017
381a400
Adds travis and removes build directory
loicNorgeot Mar 24, 2017
456a512
Correction of a big bug in locelt_3d
Jun 5, 2017
c8a6329
Addition of the extrapolation of characteristic curves in 2d and 3d +…
Jun 15, 2017
7c57301
Removes build directory, fixes #2
loicNorgeot Jul 6, 2017
28f455f
In Travel_2D, change of the AD_EPS value used for advecting at least …
Aug 28, 2017
022679a
Merge branch 'master' of https://github.com/ICStoolbox/Advection
May 17, 2018
4ee1023
fixed cfl condition
May 17, 2018
3f12882
Change in loadChi
Jan 13, 2020
337defa
Change threshold for ht.max from 3.71*np to 5*np un function hashel_2d.
Aug 11, 2020
c873e8a
Make it modulable
cbritopacheco Jan 19, 2022
30cd62b
Good CMakeLists file :)
cbritopacheco Mar 31, 2022
a00a5a9
Merge branch 'master' of https://github.com/ISCDtoolbox/Advection
cbritopacheco Mar 31, 2022
208b6cf
Merge advects into master
cbritopacheco Mar 31, 2022
5d4addb
Silence warnings
cbritopacheco Apr 1, 2022
7ffe59b
Make it standalone
cbritopacheco Apr 1, 2022
3c1bbb4
Remove travis CI
cbritopacheco Apr 1, 2022
b2ff436
Move Build.yml into workflows
cbritopacheco Apr 1, 2022
e4b86de
Update README.md (#1)
cbritopacheco Apr 1, 2022
4ae6b6e
Update README.md
cbritopacheco Apr 1, 2022
3118eeb
Merge branch 'ISCDtoolbox:master' into master
cbritopacheco Jul 13, 2022
5be79dd
Merge branch 'advects' of https://github.com/ISCDtoolbox/Advection
cbritopacheco Feb 7, 2023
3de02c8
Merge branch 'master' of github.com:cbritopacheco/Advection
cbritopacheco Feb 7, 2023
d8efd87
Merge branch 'advects' of https://github.com/ISCDtoolbox/Advection
cbritopacheco Jul 16, 2023
38a5e4d
Cmake
cbritopacheco Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
Matrix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11]
compiler: [gcc-8, clang-7]
build_type: ['Release', 'Debug']
fail-fast: false
env:
MAKEFLAGS: "-j2"
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: cmake --build ${{github.workspace}}/build



154 changes: 151 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,153 @@
CMakeFiles/*
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# ---> Linux
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# ---> C
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# ---> C++
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# ---> CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
CMakeCache.txt
build/*
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
build

# ----> ccls
.ccls-cache

docs

*.vim

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third-party/ISCD/Commons"]
path = third-party/ISCD/Commons
url = https://github.com/ISCDtoolbox/Commons
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

56 changes: 34 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE "Release")
INCLUDE_DIRECTORIES( "$ENV{HOME}/include")
LINK_DIRECTORIES( "$ENV{HOME}/lib")
SET(CMAKE_CXX_FLAGS "-w -g -O3")
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
cmake_minimum_required(VERSION 3.12)

#Advection library
project(Advection)
file( GLOB_RECURSE source_files sources/*)
file( GLOB_RECURSE header_files sources/*.h)
ADD_LIBRARY( Advection SHARED ${source_files})
find_library( Commons NAMES Commons HINTS "$ENV{HOME}/lib")
target_link_libraries( Advection ${Commons})
INSTALL( TARGETS Advection LIBRARY DESTINATION "$ENV{HOME}/lib")
INSTALL( FILES ${header_files} DESTINATION "$ENV{HOME}/include")
project(Advection C)

#Executable
project(main)
add_executable( advect sources/advect.c)
target_link_libraries( advect Commons Advection)
INSTALL( TARGETS advect RUNTIME DESTINATION "$ENV{HOME}/bin")
# ---- Configure compiler ----------------------------------------------------
add_compile_options(
-g
-O0
-Wall
-Wextra
-Wpedantic
-Wno-newline-eof
-Wno-missing-braces
-Wno-char-subscripts
-Wno-unused-variable
-Wno-unused-function
-Wno-unused-parameter
-Wno-sign-compare
-Wno-incompatible-function-pointer-types)


# ---- ISCD::Commons ---------------------------------------------------------
add_subdirectory(
${PROJECT_SOURCE_DIR}/third-party/ISCD/Commons
${PROJECT_BINARY_DIR}/third-party/ISCD/Commons)
target_include_directories(Commons
INTERFACE
${PROJECT_SOURCE_DIR}/third-party/ISCD/Commons/sources)
add_library(ISCD::Commons ALIAS Commons)

# ---- Executable ------------------------------------------------------------
file(GLOB_RECURSE Advection_SRCS sources/*.c)
file(GLOB_RECURSE Advection_HEADERS sources/*.h)

add_executable(Advection ${Advection_SRCS} ${Advection_HEADERS})

target_link_libraries(Advection
PRIVATE
m
pthread
ISCD::Commons)
Binary file removed Documentation/advectguide.pdf
Binary file not shown.
100 changes: 19 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,26 @@
# advect [![Build Status](https://travis-ci.org/ISCDtoolbox/Advection.svg?branch=master)](https://travis-ci.org/ISCDtoolbox/Advection)
Advect is a program for solving linear advection problems in two and three dimensions.
# Advection

#### Installation
| Branch | Matrix |
|:-----------:|:--------:|
| master | [![Build](https://github.com/cbritopacheco/Advection/actions/workflows/Build.yml/badge.svg?branch=master)](https://github.com/cbritopacheco/Advection/actions/workflows/Build.yml) |
| develop | [![Build](https://github.com/cbritopacheco/Advection/actions/workflows/Build.yml/badge.svg?branch=develop)](https://github.com/cbritopacheco/Advection/actions/workflows/Build.yml) |

1. install the [ISCD Commons Library](https://github.com/ISCDtoolbox/Commons) on your system.
Please refer to the instructions provided on the ISCD Commons Library page in order to install this library.
## About
Advection is a program for solving linear advection problems in two and three dimensions.

2. download the zip archive of Advection or clone this repository:
This repo is a fork of the [original
Advection](https://github.com/ISCDtoolbox/Advection) to be used as a dependency in
[Rodin](https://github.com/cbritopacheco/rodin).

` git clone https://github.com/ISCDtoolbox/Advection.git `
## Building

navigate to the downloaded directory:

` cd Advection `

create a build directory and compile with cmake
```
mkdir build
cd build
cmake ..
make
make install
```

#### Usage
After compiling advect as described above, you should have an executable file in your $HOME/bin directory. If your PATH variable is correctly set to this directory, advect can be called with the following syntax:

usage: advect [+/-v | -h] [-dt step] source[.mesh] [-c function[.sol]] [-s data[.sol]] [-o output[.sol]]

The square braces indicate optional arguments. Some commands have flags, some others do not.

The options and flags are:
```bash
git clone --recursive https://github.com/cbritopacheco/Advection
cd Advection
mkdir build && cd build
cmake ..
make -j4
```
--help show the syntax and exit.
--version show the version and date of release and exit.

-dt step time step (time units)
-nocfl avoid truncation of the time period for advection due to cfl condition.
-noex deactivates the default feature whereby characteristic lines are extrapolated outside the domain when the input velocity field causes them to do so.
-v suppress any message (for use with function call).
+v increase the verbosity level for output.

source.mesh name of the mesh file
function.sol name of file containing the (scalar) values to be advected
data.sol name of file containing the velocity field
output.sol name of the output file containing the function values
```

A full description of all parameters and options that can be specified in the command line or in a parameter file [file.advect] can be found in the project [wiki](https://github.com/ISCDtoolbox/Advection/wiki) (Coming soon...).

#### Quickstart (Coming soon...)
You can test the installation and look at examples by entering the [demos](demos) directory and running the program:

cd demos
advect test.mesh -dt 0.01 -s test.sol -c test.chi.sol -o test.chi.sol

that will produce an output that will look like:
```
user:~/code/Advection/demos/2d$ advect test.mesh -dt 0.01 -s test.sol -c test.chi.sol -o test.chi.sol
- ADVECT, Release 3.0a, Feb. 19, 2016
(C) Copyright 2007- , ICS-SU

- LOADING DATA
test.mesh: 2225 vertices, 4222 triangles
test.sol : 2225 data vectors
test.chi.sol : 2225 data scalar
Adjacency table: 12666 updated
- COMPLETED: 0.013s

** MODULE ADVECT: 3.0a
Time stepping: 0.001
Solving: 2225 characteristics
** COMPLETED: 0.009s

- WRITING DATA
test.chi.sol: 2225 data vectors
- COMPLETED: 0.010s

** Cumulative time: 0.032s.
```

#### Authors & contributors
* advect has been initiated by Thi Thu Cuc Bui, Charles Dapogny and Pascal Frey (Université Pierre et Marie Curie).
* Contributors to this project are warmly welcomed.

#### License
advect is given under the [terms of the GNU Lesser General Public License] (LICENSE.md).
## License
Advection is given under the [terms of the GNU Lesser General Public License](LICENSE.md).
Loading