-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add fastscapelib (C++) integration #6204
base: main
Are you sure you want to change the base?
Add fastscapelib (C++) integration #6204
Conversation
Fastscapelib and Xtensor are treated as external dependencies (using find_package in the CMake configuration).
…o add-fastscapelib-cpp-integration
and build aspect with fastscapelib
Agnostic from the wrapped DEAL.II triangulation type.
I've made some progress and cleaned up a few things:
|
// TODO: reuse Fastscapecc's ``dim`` template parameter here? | ||
// (in theory Fastscapelib C++ may support both 1D and 2D surface domains) | ||
using SurfaceMeshType = Triangulation<2, 3>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is something available in Aspect, but in theory it would be possible to support a 2-dimensional "disk" geometry model and run this plugin (fastscape erosion) on the 1-dimensional "circle" boundary. I guess that for the general case we could write this instead?
using SurfaceMeshType = Triangulation<dim-1, dim>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is should be <dim-1,dim>
, yes
// surface_constraints.distribute(surface_solution); | ||
|
||
// Temporary storage for computation | ||
std::vector<std::vector<double>> temporary_variables(dim + 2, std::vector<double>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: using nested vectors seems unnecessary in my opinion. We could use separate variables instead, which is more readable.
Future proof in case the plugin later supports aspect simulations on 2-dimensional domains (i.e., FastScapecc<2>) Use SFINAE to select the right implementation of surface mesh initialization from the input geometry model (still need to check SFINAE substitution order). Using "if constexpr" would have been better but Aspect seems to still use C++14 as the lowest required standard. Also cleaned up header includes and fastscapelib grid adapter.
We don't really need it. We can downcast the geometry model object instead.
std::is_same_v is from C++17 onward.
Related to #5323.
Experimenting with Fastscapelib's flexible grid interface so it is possible to run a Fastscape landscape evolution model based on (any?) deal.ii triangulation used through ASPECT.
cc @MFraters @Minerallo
Before your first pull request:
For all pull requests:
For new features/models or changes of existing features: