Skip to content
Open
Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
42a27b3
add fastscapelib cmake config
benbovy Jan 15, 2025
14087d8
Add fastscapelib xtensor xtl to contrib and Cmakelist
Minerallo Jul 8, 2023
bb2724b
add interface fastcapecc.cc .h and prm in cookbook
Minerallo Jul 14, 2023
cceca11
replaced hard variables back
Minerallo Jul 14, 2023
2cc8d89
add test case fastscape_eroding_box_cc.prm
Minerallo Jul 14, 2023
557cffd
add test repository and output_screen
Minerallo Jul 14, 2023
efa08cf
correction of V in m/s
Minerallo Jul 20, 2023
9c1047c
add mpi communication
Minerallo Jul 21, 2023
c73469c
add trimesh and spherical geometry
Minerallo Apr 7, 2024
e25afd9
reactivate box geometry
Minerallo Apr 8, 2024
a7611ec
rebased ASPECT and remove std::cout messages
Minerallo Oct 18, 2024
55514ab
update fastscapelib
Minerallo Oct 18, 2024
7995eb2
update with Healpix
Minerallo Oct 18, 2024
bdc2c0c
add healpix_cxx library
Minerallo Oct 24, 2024
0998c50
Healpix library with box coupling
Minerallo Oct 24, 2024
7876461
error correction and grid_box = std::make_unique to figure out
Minerallo Oct 25, 2024
6a31835
add modules cmake healpix brew
Minerallo Oct 25, 2024
1217b44
add assert if box of shell
Minerallo Oct 25, 2024
97dccf2
setting index nsides
Minerallo Oct 25, 2024
2dc4619
array size
Minerallo Oct 25, 2024
d6041bd
no mst sink
MFraters Oct 25, 2024
5b16c19
timestep to test
Minerallo Oct 25, 2024
4ae27d7
If you read this please send help
MFraters Oct 25, 2024
2a369ba
add mpirun path and addtional modelule to load
Minerallo Oct 28, 2024
cb01fbd
use radial velocity
Minerallo Oct 28, 2024
b0466c0
Add initial fastscape dealii adapter.
MFraters Jan 16, 2025
c2a90c5
indent
MFraters Jan 16, 2025
2e99573
remove fastscapelib, xtensor and healpix sources
benbovy Jan 16, 2025
bdeb3d2
cmake: remove fastscapelib xtensor included from contrib
benbovy Jan 16, 2025
caf31fc
cmake: remove healpix support
benbovy Jan 16, 2025
fb094f6
cleanup and fixes (fastscapelib stable version)
benbovy Jan 16, 2025
df7a739
clean-up (remove healpix)
benbovy Jan 16, 2025
433eddb
add back fastscape (fortran) python VTK script
benbovy Jan 16, 2025
a37729e
update and resolve conflicts
Minerallo Jan 16, 2025
a49d70f
indent + some cleanup
benbovy Jan 16, 2025
569433a
temp link error dirty fix
benbovy Jan 16, 2025
0fff693
add temporary instructions to install fastsacpelib
benbovy Jan 17, 2025
b82cf34
nit
benbovy Jan 17, 2025
b4997af
make fastscapelib grid adapater more agnostic
benbovy Jan 22, 2025
113a73b
clean-up
benbovy Jan 22, 2025
e0d2f56
refactor init surface mesh
benbovy Jan 23, 2025
29fbbc4
remove GeometryType
benbovy Jan 23, 2025
86fe4d7
C++14 support
benbovy Jan 23, 2025
4b936a2
Restore fastscapecc_adapter.h from fastscape adapter commit
Minerallo Jun 4, 2025
a0a51ff
Restore latest fastscapecc_adapter.h from commit 9745776 (refactor in…
Minerallo Jun 4, 2025
8338271
updated Benoit Branch
Minerallo Jun 7, 2025
bb7b926
add fastscape iteration and support for 2D in adapter.h
Minerallo Jun 10, 2025
7f385aa
change back to dynamic cast for model geonetry
Minerallo Jun 11, 2025
ded3ebd
address benoit comment fixed value and flow graph
Minerallo Jun 11, 2025
9414548
add init surface mesh for box
Minerallo Jun 11, 2025
0b3da11
add back condition for box or sphere geometry
Minerallo Jun 11, 2025
962ee9b
correct elevation init
Minerallo Jun 12, 2025
8348a7d
Also make sure the XTL headers can be found.
bangerth Jun 11, 2025
1a32cab
Fix the copyright header.
bangerth Jun 11, 2025
4dfa1ca
add copyright to adapter and remove pout messages
Minerallo Jun 12, 2025
ba9edb7
update h _vz problem
Minerallo Jun 12, 2025
83320b0
push to make PR WIP
Minerallo Jun 12, 2025
d36e812
Deal with the fact that Xtensor moved all of its header files.
bangerth Jun 12, 2025
a7656b3
Account for the fact that FastScape has removed some files after 0.2.2.
bangerth Jun 12, 2025
4385cb8
add projected velocity and radial velocity to projected_solution_surf…
Minerallo Jun 12, 2025
bf08ae3
added mapping for vertex_index for spherical
Minerallo Jun 12, 2025
98e9c06
change back to surface_solution projection and add additional refinement
Minerallo Jun 13, 2025
c85282b
fixed surface_elevation
Minerallo Jun 13, 2025
9f57401
fix model extent and repetition for topography calculation
Minerallo Jun 13, 2025
619c3b4
removed not used variables
Minerallo Jun 13, 2025
ce51b13
Avoid the use of a deprecated function.
bangerth Jun 13, 2025
d459e20
Add a set of necessary braces.
bangerth Jun 13, 2025
87b99ce
Slightly improve the documentation of the FastScapeCC couplers.
bangerth Jun 13, 2025
3969d51
Convert the 'surface_fe' variable into a non-pointer.
bangerth Jun 13, 2025
4fe148d
Merge the init_surface_mesh() functions into one.
bangerth Jun 14, 2025
c39320e
Move common code out of the if-else branches.
bangerth Jun 14, 2025
326ce9c
Add an assertion.
bangerth Jun 14, 2025
7431ca7
Leave a TODO.
bangerth Jun 14, 2025
d38a49d
Minor edits + some TODOs for project_surface_solution().
bangerth Jun 14, 2025
98db3bc
Limit the scope of some variables.
bangerth Jun 14, 2025
c53574b
Add documentation and a TODO.
bangerth Jun 14, 2025
7189a6d
Leave several more TODOs.
bangerth Jun 14, 2025
89ec826
change for n_used_vertices
Minerallo Jun 14, 2025
0740232
made surface_velocity_solution and surface_height local variables for…
Minerallo Jun 14, 2025
74abd77
Use the gravity model to obtain a vertical direction
Minerallo Jun 14, 2025
c1524c4
Use parallel distributed Triangulation for surface mesh
Minerallo Jun 14, 2025
d711623
Query the velocity from Dofs using introspection
Minerallo Jun 14, 2025
6344e5b
remove to do distributed triangulation
Minerallo Jun 14, 2025
b1d6fdb
fixed dx dy calculation
Minerallo Jun 16, 2025
c8c0002
Remove two unused variables.
bangerth Jun 16, 2025
8cdd327
tried debugging and print statement
Minerallo Jun 16, 2025
6dbbcf5
indent
Minerallo Jun 16, 2025
6dc999a
indent and back to old picking value for interpolation
Minerallo Jun 16, 2025
3c4e1dc
add back height variable missing
Minerallo Jun 16, 2025
6935a41
format Fastscape variable with mesh grid.shape
Minerallo Jun 16, 2025
54d607f
fastscape working but error when solving mesh displacement
Minerallo Jun 17, 2025
094d001
add visualization for fastscape
Minerallo Jun 17, 2025
a37293f
add fastscape visualisation repository for 1 aspect timestep test
Minerallo Jun 17, 2025
406678f
correction fastscape visualisation for timestep 0
Minerallo Jun 17, 2025
b0c85fc
add sinker resolver
Minerallo Jun 17, 2025
0af1910
add diffusion_eroder but doesn't seems usefull with dealii grid adapter
Minerallo Jun 17, 2025
031bfb5
Remove unused variables.
bangerth Jun 17, 2025
4cde447
Remove comment that is no longer needed.
bangerth Jun 17, 2025
cf9bbf4
Only compile files when with FastScape++.
bangerth Jun 17, 2025
77b4607
Also export whether we are building with FastScape++.
bangerth Jun 17, 2025
0afabff
deactivate error OFF message during cmake
Minerallo Jun 17, 2025
58c55cf
Merge branch 'main' into add-fastscapelib-cpp-integration_copy
Minerallo Jun 17, 2025
2453282
Leave more TODOs.
bangerth Jun 17, 2025
115881f
correct V unit to m/s and rename grid_extent to Box grid_extent
bangerth Jun 17, 2025
11ccf3e
declare box_grid_extent and rename cell to volume_cell
Minerallo Jun 17, 2025
6a4d926
rename cell
Minerallo Jun 17, 2025
316bbf8
uplift rate in m/s for Fastscape
Minerallo Jun 18, 2025
4186fe0
box working with brut values in flow function
Minerallo Jun 18, 2025
9d00b91
corrected visualisation and made elevation mutable
Minerallo Jun 18, 2025
47151ba
rename variable m and n
Minerallo Jun 18, 2025
4ea2cb1
based node fixed thought function, uplift rate corrected for xt::array
Minerallo Jun 18, 2025
7841b4c
add visu function for later commented
Minerallo Jun 18, 2025
97123f7
MPI send the data place before receiving them
Minerallo Jun 18, 2025
d8a8f6c
Use deal.II's send/receive functionality over MPI's.
bangerth Jun 18, 2025
1b66e0b
Make sure we can actually query the compile guards.
bangerth Jun 18, 2025
0997f1f
Leave more comments and TODOs.
bangerth Jun 18, 2025
aa074f6
Address some comments.
bangerth Jun 18, 2025
e6fee9a
Indent according to our usual scheme.
bangerth Jun 19, 2025
41c579f
Add some compatibility classes.
bangerth Jun 19, 2025
ce49957
Ensure we use the vertical direction, not the z-direction.
bangerth Jun 19, 2025
4f8f097
Merge pull request #1 from bangerth/add-fastscapelib-cpp-integration_…
Minerallo Jun 19, 2025
8666176
tried adding multimap
Minerallo Jun 19, 2025
a8ea6ea
make multimap with isend working
Minerallo Jun 19, 2025
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
33 changes: 33 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,28 @@ if(ASPECT_WITH_FASTSCAPE)
endif()


# Fastscapelib (C++)
set(ASPECT_WITH_FASTSCAPELIB OFF CACHE BOOL "Whether the user wants to compile ASPECT with the landscape evolution C++ code Fastscape(lib), or not.")
if(ASPECT_WITH_FASTSCAPELIB)
find_package(fastscapelib CONFIG)
if(${fastscapelib_FOUND})
set(FS_WITH_HEALPIX OFF CACHE BOOL "Turn off Fastscapelib support of Healpix grid" FORCE)
message(STATUS "Using ASPECT_WITH_FASTSCAPELIB = '${ASPECT_WITH_FASTSCAPELIB}'")
message(STATUS " fastscapelib_INCLUDE_DIR: ${fastscapelib_INCLUDE_DIRS}")
message(STATUS " fastscapelib_VERSION: ${fastscapelib_VERSION}")
# fastscapelib dependencies
find_package(xtensor REQUIRED)
message(STATUS " xtensor_INCLUDE_DIR: ${xtensor_INCLUDE_DIRS}")
message(STATUS " xtensor_VERSION: ${xtensor_VERSION}")
else()
message(STATUS "Fastscapelib not found. Disabling ASPECT_WITH_FASTSCAPELIB. You can specify a hint to your installation directory with fastscapelib_DIR.")
set(ASPECT_WITH_FASTSCAPELIB OFF CACHE BOOL "" FORCE)
endif()
else()
message(STATUS "Using ASPECT_WITH_FASTSCAPELIB = 'OFF'")
endif()


# NetCDF (c including parallel)
set(ASPECT_WITH_NETCDF ON CACHE BOOL "Check if the user wants to compile ASPECT with the NetCDF libraries.")

Expand Down Expand Up @@ -408,6 +430,7 @@ if(ASPECT_WITH_WORLD_BUILDER)
endif()
message(STATUS "")

#include "datatypes.h"

#
# Other stuff about external tools and how we interact with the system:
Expand Down Expand Up @@ -789,6 +812,16 @@ if (FASTSCAPE_LIB_NAME)
endif()
endif()

# Fastscapelib
if (${fastscapelib_FOUND})
message(STATUS "Linking ASPECT against Fastscapelib (header-only)")
foreach(_T ${TARGET_EXECUTABLES})
target_include_directories(${_T} PRIVATE ${fastscapelib_INCLUDE_DIRS})
target_include_directories(${_T} PRIVATE ${xtensor_INCLUDE_DIRS})
target_include_directories(${_T} PRIVATE ${xtl_INCLUDE_DIRS})
endforeach()
endif()

# NetCDF
if(${NETCDF_FOUND})
message(STATUS "Linking ASPECT against NetCDF")
Expand Down
117 changes: 117 additions & 0 deletions WITH_FASTSCAPELIB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Using Aspect with Fastscapelib (C++)

## Install Fastscapelib using conda

You can use conda to install fastscapelib and all of its dependencies (we assume
that you are familiar with managing conda environments):

```
conda install fastscapelib -c conda-forge
```

## Install Fastscapelib from source

You can follow the steps below to install Fastscapelib and its dependencies from
source.

### Set the installation prefix path for Fastscapelib and its dependencies

Choose a common location where you want to download the source files of
Fastscapelib and its dependencies:

```
$ export FS_SOURCE_PATH=/path/to/fastscapelib/source
```

Choose a common location where you want to install Fastscapelib and its
dependencies:

```
export CMAKE_INSTALL_PREFIX=/path/to/fastscapelib/install/dir
```

### Install xtl and xtensor

Download the `xtl` git repository and checkout the last stable version:

```
$ cd $FS_SOURCE_PATH
$ git clone https://github.com/xtensor-stack/xtl
$ cd xtl
$ git checkout 0.7.7
```

Build and install `xtl`:

```
$ cmake -S. -Bbuild
$ cmake --install build
```

Download the `xtensor` git repository and checkout the last stable version:

```
$ cd $FS_SOURCE_PATH
$ git clone https://github.com/xtensor-stack/xtensor
$ cd xtensor
$ git checkout 0.25.0
```

Build and install `xtensor`:

```
$ cmake -S. -Bbuild
$ cmake --install build
```

### Install Fastscapelib

Download the `fastscapelib` git repository and checkout the last stable version:

```
$ cd $FS_SOURCE_PATH
$ git clone https://github.com/fastscape-lem/fastscapelib
$ cd fastscapelib
$ git checkout v0.2.2
```

IMPORTANT: edit the `cmake/fastscapelibConfig.cmake` file with the editor of
your choice and add the following line just below `@PACKAGE_INIT@` (this will be
required every time you checkout another version or branch and re-install
Fastscapelib, but this won't be required for Fastscapelib version >0.2.2):

```
include(CMakeFindDependencyMacro)
```

Build and install `fastscapelib`:

```
$ cmake -S. -Bbuild
$ cmake --install build
```

## Compile Aspect with Fastscapelib enabled

If you have installed Fastscapelib using conda, don't forget to activate the
environment where you have installed Fastscapelib. Once activated, configuring
`aspect` with CMake should then find Fastscapelib automatically.

If you have installed Fastscapelib from source like described above, you can
help CMake find the Fastscapelib installation path using:

```
export CMAKE_PREFIX_PATH=/path/to/fastscapelib/install/dir
```

where the given path corresponds to the path that you set during installation
via the `CMAKE_INSTALL_PREFIX` environment variable (see instructions above).

Configuring `aspect` should then find Fastscapelib. Check the output of the
following command run from aspect's source root directory (note: you might need
to set additional arguments or run extra commands in order to find the other
dependencies of `aspect`, we skipped it here):

```
cmake -S. -Bbuild -DASPECT_WITH_FASTSCAPELIB=ON
```
54 changes: 23 additions & 31 deletions contrib/fastscape/fastscape_rewrite_VTK_with_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_times_pvd(filename):

times[i] = float(temp_str)

return times
return times


#%% Get file paths (absolute, not relative paths!)
Expand All @@ -54,73 +54,73 @@ def absoluteFilePaths(directory):

# trace generated using paraview version 5.8.0
#
# To ensure correct image size when batch processing, please search
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`

for File in FileNames:

#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'Legacy VTK Reader'
topography0000 = LegacyVTKReader(FileNames=File)

# get animation scene
animationScene1 = GetAnimationScene()

# get the time-keeper
timeKeeper1 = GetTimeKeeper()

# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [882, 554]

# get layout
layout1 = GetLayout()

# show data in view
topography0000Display = Show(topography0000, renderView1, 'StructuredGridRepresentation')

# trace defaults for the display properties.
topography0000Display.Representation = 'Surface'

# reset view to fit data
renderView1.ResetCamera()

# get the material library
materialLibrary1 = GetMaterialLibrary()

# show color bar/color legend
topography0000Display.SetScalarBarVisibility(renderView1, True)

# update the view to ensure updated data information
renderView1.Update()

# get color transfer function/color map for 'H'
hLUT = GetColorTransferFunction('H')

# get opacity transfer function/opacity map for 'H'
hPWF = GetOpacityTransferFunction('H')

# save data
SaveData(File[:-4] + '.vts', proxy=topography0000, ChooseArraysToWrite=1,
PointDataArrays=['HHHHH','basement','catchment','drainage_area','erosion_rate','topography','total_erosion'])

#### saving camera placements for all active views

# current camera placement for renderView1
renderView1.CameraPosition = [225625.0, 25625.0, 878497.0779980461]
renderView1.CameraFocalPoint = [225625.0, 25625.0, 1135.7277145385742]
renderView1.CameraParallelScale = 227077.82689023562

#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).

Delete(topography0000)
del topography0000

Expand All @@ -140,17 +140,9 @@ def absoluteFilePaths(directory):

for n, File in enumerate(FileNames):
dataset_attributes = {"timestep": str(times[n]), "group": "", "group": "", "file": os.path.basename(File)[:-4]+'.vts'}

ET.SubElement(doc, "DataSet", attrib=dataset_attributes).text="\n"


tree = ET.ElementTree(root)
tree.write('./VTK/topography.pvd', xml_declaration=True, encoding='utf-8', method="xml")








tree.write('./VTK/topography.pvd', xml_declaration=True, encoding='utf-8', method="xml")
1 change: 1 addition & 0 deletions include/aspect/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#cmakedefine ASPECT_WITH_WORLD_BUILDER
#cmakedefine ASPECT_USE_FP_EXCEPTIONS
#cmakedefine ASPECT_WITH_FASTSCAPE
#cmakedefine ASPECT_WITH_FASTSCAPELIB
#cmakedefine ASPECT_HAVE_FASTSCAPE_NAMED_VTK

#define ASPECT_MAX_NUM_PARTICLE_SYSTEMS @ASPECT_MAX_NUM_PARTICLE_SYSTEMS@
Expand Down
Loading