-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fluid species dimensions implementation
This merge request adds the support for describing a fluid species in prevision for the neutral model added in another merge request. This is done by adding a new dimension: - the `M`dimension (for Moments): a discrete space for describing the fluid moments of the fluid species. This dimension can be initialized with a varying number of moments that should be taken into account by the underlying physical model (ex. the code can solve only for the density, or for the density and velocity, etc.). - A new version of the predictor corrector scheme is added, to solve fluid models for these fluid species on top of the Vlasov-Poisson system. - A bunch of tests are added. See merge request gysela-developpers/gyselalibxx!385 -------------------------------------------- Co-authored-by: Emily Bourne <[email protected]> Co-authored-by: yannm <[email protected]> Co-authored-by: Baptiste LEGOUIX <[email protected]>
- Loading branch information
1 parent
9194a7b
commit 0315225
Showing
32 changed files
with
1,302 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
add_subdirectory(fluidinitialization) | ||
add_subdirectory(fluidsolver) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Geometry (x) | ||
|
||
The `geometryMX` folder contains all the code describing methods which are specific to a geometry with 1 spatial dimension and one dimension describing fluid moments (ex: density, temperature, mean velocity). It is broken up into the following sub-folders: | ||
|
||
- [fluidinitialization](./fluidinitialization/README.md) : Initialization methods for fluid species. | ||
- [fluidsolver](./fluidsolver/README.md) : Solver for fluid models. |
26 changes: 26 additions & 0 deletions
26
src/geometryXVx/geometryMX/fluidinitialization/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
foreach(GEOMETRY_VARIANT IN LISTS GEOMETRY_XVx_VARIANTS_LIST) | ||
|
||
add_library("fluidinitialization_${GEOMETRY_VARIANT}" STATIC | ||
constantfluidinitialization.cpp | ||
) | ||
|
||
target_compile_features("fluidinitialization_${GEOMETRY_VARIANT}" | ||
PUBLIC | ||
cxx_std_17 | ||
) | ||
|
||
target_include_directories("fluidinitialization_${GEOMETRY_VARIANT}" | ||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
target_link_libraries("fluidinitialization_${GEOMETRY_VARIANT}" | ||
PUBLIC | ||
DDC::DDC | ||
gslx::geometry_${GEOMETRY_VARIANT} | ||
) | ||
|
||
add_library("gslx::fluidinitialization_${GEOMETRY_VARIANT}" ALIAS "fluidinitialization_${GEOMETRY_VARIANT}") | ||
|
||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Fluid Initialization methods | ||
|
||
The fluidinitialization folder contains any methods that define the value of a fluid species at the start of the simulation. The fluid species is described by its fluid moments. | ||
|
||
The implemented initialization methods are: | ||
- ConstantFluidInitialization |
24 changes: 24 additions & 0 deletions
24
src/geometryXVx/geometryMX/fluidinitialization/constantfluidinitialization.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include <ddc/ddc.hpp> | ||
|
||
#include "constantfluidinitialization.hpp" | ||
|
||
ConstantFluidInitialization::ConstantFluidInitialization(host_t<DViewSpM> moments) | ||
: m_moments_alloc(moments.domain()) | ||
{ | ||
ddc::parallel_deepcopy(m_moments_alloc, moments); | ||
} | ||
|
||
DSpanSpMX ConstantFluidInitialization::operator()(DSpanSpMX const fluid_moments) const | ||
{ | ||
ddc::ChunkSpan moments(m_moments_alloc.span_view()); | ||
ddc::parallel_for_each( | ||
Kokkos::DefaultExecutionSpace(), | ||
fluid_moments.domain(), | ||
KOKKOS_LAMBDA(IndexSpMX const ispmx) { | ||
IndexSpM ispm(ddc::select<IDimSp, IDimM>(ispmx)); | ||
fluid_moments(ispmx) = moments(ispm); | ||
}); | ||
return fluid_moments; | ||
} |
Oops, something went wrong.