-
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.
Add a first version of the 5D geometry in (tor1,tor2,tor3,vpar,mu)
This version is a temporary step that will quickly be moved to a 4D geometry (tor1,tor2,vpar,mu) because we realized the strategy to create directly a 5D geometry with only one point in tor3 direction is not a good idea. The interest of merging this temporary branch is due to the fact that it contains, - a first example of HDF5 file reading (initialized from external python scripts developed in [gysela_io project](https://gitlab.maisondelasimulation.fr/gysela-developpers/gysela_io) - a first coupling with collision operator developed within [koliop library](https://gitlab.com/cines/code.gysela/libkoliop) - Adastra configuration See merge request gysela-developpers/gyselalibxx!405 -------------------------------------------- Co-authored-by: Etienne Malaboeuf <[email protected]>
- Loading branch information
1 parent
7c5e4de
commit 33b4111
Showing
55 changed files
with
2,083 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build*/ | ||
*.pyc |
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,73 @@ | ||
#!/bin/bash | ||
|
||
[[ -z ${1+x} ]] && echo -e "Gyselalibxx preparation shortcut script:\n ./prepare.gyselalibxx.sh <toolchain/machine [mi250.cce.adastra.spack|...]> <do prepare [default: TRUE|FALSE]> <force a fresh build [default: TRUE|FALSE]> <extra CMake flags>" && exit 1 | ||
|
||
PREPARE_ROOT_DIRECTORY="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)" | ||
|
||
set -eu | ||
|
||
PREPARE_TOOLCHAIN_NAME="${1}" | ||
|
||
if [[ ! -z ${2+x} ]]; then | ||
PREPARE_DONT_SKIP="${2}" | ||
else | ||
PREPARE_DONT_SKIP="TRUE" | ||
fi | ||
|
||
if [[ ! -z ${3+x} ]]; then | ||
PREPARE_FORCE_FRESH_BUILD="${3}" | ||
else | ||
PREPARE_FORCE_FRESH_BUILD="TRUE" | ||
fi | ||
|
||
# A toolchain script should NOT expect we source/execute them from the toolchain | ||
# directory. | ||
PREPARE_TOOLCHAIN_PATH="${PREPARE_ROOT_DIRECTORY}/toolchains/${PREPARE_TOOLCHAIN_NAME}" | ||
|
||
if [[ "${PREPARE_DONT_SKIP}" != "TRUE" ]]; then | ||
echo "[PREPARE] Skipping the environment preparation (presumably already prepared)." | ||
else | ||
# Anything that does not match "TRUE" disable the feature. | ||
echo "[PREPARE] Preparing the environment. Preparation log in 'log.prepare.${PREPARE_TOOLCHAIN_NAME}'." | ||
# Maybe a noop. | ||
"${PREPARE_TOOLCHAIN_PATH}/prepare.sh" >"log.prepare.${PREPARE_TOOLCHAIN_NAME}" 2>&1 || (echo "The environment preparation failed! Check the log." && exit 1) | ||
fi | ||
|
||
PREPARE_BUILD_NAME="build.${PREPARE_TOOLCHAIN_NAME}" | ||
PREPARE_BUILD_DIRECTORY="${PREPARE_ROOT_DIRECTORY}/${PREPARE_BUILD_NAME}" | ||
PREPARE_TOOLCHAIN_FILE="${PREPARE_TOOLCHAIN_PATH}/toolchain.cmake" | ||
|
||
if [[ "${PREPARE_FORCE_FRESH_BUILD}" != "TRUE" ]]; then | ||
echo "[PREPARE] Keeping the old build directory." | ||
else | ||
# Anything that does not machine "TRUE" disable the feature. | ||
echo "[PREPARE] Removing old build directory..." | ||
rm -rf -- "${PREPARE_BUILD_DIRECTORY}" | ||
fi | ||
|
||
PREPARE_BUILD_GENERATOR="Unix Makefiles" | ||
|
||
if which ninja >/dev/null 2>&1; then | ||
PREPARE_BUILD_GENERATOR="Ninja" | ||
fi | ||
|
||
echo "[PREPARE] Using build system: '${PREPARE_BUILD_GENERATOR}'." | ||
|
||
source -- "${PREPARE_TOOLCHAIN_PATH}/environment.sh" | ||
|
||
PREPARE_BUILD_CMAKE_FLAG="${@:4}" | ||
|
||
cmake \ | ||
-B "${PREPARE_BUILD_DIRECTORY}" \ | ||
-S . \ | ||
-G "${PREPARE_BUILD_GENERATOR}" \ | ||
-DCMAKE_TOOLCHAIN_FILE="${PREPARE_TOOLCHAIN_FILE}" \ | ||
"${PREPARE_BUILD_CMAKE_FLAG}" | ||
|
||
echo "Building in '${PREPARE_BUILD_NAME}'. Build log in 'log.build.${PREPARE_TOOLCHAIN_NAME}'." | ||
cmake --build "${PREPARE_BUILD_DIRECTORY}" >"log.build.${PREPARE_TOOLCHAIN_NAME}" 2>&1 || (echo "The build failed! Check the log." && exit 1) | ||
|
||
echo "The build completed. You can use the binaries in the following directory:" | ||
echo " \"${PREPARE_BUILD_DIRECTORY}\"" | ||
echo "Do not forget to source the environment file like so:" | ||
echo " $ source -- \"${PREPARE_TOOLCHAIN_PATH}/environment.sh\"" |
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,3 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
add_subdirectory(testcollisions) |
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,20 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
||
add_executable(testcollisions testcollisions.cpp) | ||
target_compile_features(testcollisions PUBLIC cxx_std_17) | ||
target_link_libraries(testcollisions | ||
PUBLIC | ||
DDC::DDC | ||
DDC::PDI_Wrapper | ||
gslx::speciesinfo | ||
gslx::geometry5D | ||
gslx::paraconfpp | ||
gslx::quadrature | ||
gslx::collisions_rhs_5D | ||
PDI::pdi | ||
paraconf::paraconf | ||
) | ||
|
||
install(TARGETS testcollisions) | ||
|
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,124 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
constexpr char const* const PDI_CFG = R"PDI_CFG( | ||
metadata: | ||
read_restart_filename_size: size_t | ||
read_restart_filename: {type: array, subtype: char, size: "$read_restart_filename_size"} | ||
write_restart_filename_size: size_t | ||
write_restart_filename: {type: array, subtype: char, size: "$write_restart_filename_size"} | ||
iter_start : int | ||
iter_saved : int | ||
time_saved : double | ||
grid_tor1_extents: { type: array, subtype: size_t, size: 1 } | ||
grid_tor2_extents: { type: array, subtype: size_t, size: 1 } | ||
grid_tor3_extents: { type: array, subtype: size_t, size: 1 } | ||
grid_vpar_extents: { type: array, subtype: size_t, size: 1 } | ||
grid_mu_extents: { type: array, subtype: size_t, size: 1 } | ||
species_extents: { type: array, subtype: size_t, size: 1 } | ||
masses_extents: { type: array, subtype: size_t, size: 1 } | ||
charges_extents: { type: array, subtype: size_t, size: 1 } | ||
data: | ||
grid_tor1: | ||
type: array | ||
subtype: double | ||
size: [ '$grid_tor1_extents[0]' ] | ||
grid_tor2: | ||
type: array | ||
subtype: double | ||
size: [ '$grid_tor2_extents[0]' ] | ||
grid_tor3: | ||
type: array | ||
subtype: double | ||
size: [ '$grid_tor3_extents[0]' ] | ||
grid_vpar: | ||
type: array | ||
subtype: double | ||
size: [ '$grid_vpar_extents[0]' ] | ||
grid_mu: | ||
type: array | ||
subtype: double | ||
size: [ '$grid_mu_extents[0]' ] | ||
species: | ||
type: array | ||
subtype: int | ||
size: [ '$species_extents[0]' ] | ||
masses: | ||
type: array | ||
subtype: double | ||
size: [ '$masses_extents[0]' ] | ||
charges: | ||
type: array | ||
subtype: double | ||
size: [ '$charges_extents[0]' ] | ||
densityTorCS: | ||
type: array | ||
subtype: double | ||
size: [ '$species_extents[0]', '$grid_tor2_extents[0]', '$grid_tor1_extents[0]' ] | ||
temperatureTorCS: | ||
type: array | ||
subtype: double | ||
size: [ '$species_extents[0]', '$grid_tor2_extents[0]', '$grid_tor1_extents[0]' ] | ||
UparTorCS: | ||
type: array | ||
subtype: double | ||
size: [ '$species_extents[0]', '$grid_tor2_extents[0]', '$grid_tor1_extents[0]' ] | ||
fdistribu: | ||
type: array | ||
subtype: double | ||
size: [ '$species_extents[0]', '$grid_tor3_extents[0]', '$grid_tor2_extents[0]', '$grid_tor1_extents[0]', '$grid_vpar_extents[0]', '$grid_mu_extents[0]' ] | ||
plugins: | ||
decl_hdf5: | ||
- file: '${read_restart_filename}' | ||
on_event: [read_grid_extents] | ||
read: | ||
grid_tor1_extents: {size_of: grid_tor1} | ||
grid_tor2_extents: {size_of: grid_tor2} | ||
grid_tor3_extents: {size_of: grid_tor3} | ||
grid_vpar_extents: {size_of: grid_vpar} | ||
grid_mu_extents: {size_of: grid_mu} | ||
species_extents: {size_of: species} | ||
masses_extents: {size_of: masses} | ||
charges_extents: {size_of: charges} | ||
- file: '${read_restart_filename}' | ||
on_event: [read_grid] | ||
read: | ||
grid_tor1: ~ | ||
grid_tor2: ~ | ||
grid_tor3: ~ | ||
grid_vpar: ~ | ||
grid_mu: ~ | ||
species: ~ | ||
masses: ~ | ||
charges: ~ | ||
- file: '${read_restart_filename}' | ||
on_event: [read_profiles] | ||
read: | ||
- densityTorCS | ||
- temperatureTorCS | ||
- UparTorCS | ||
- file: '${read_restart_filename}' | ||
on_event: [read_fdistribu] | ||
read: | ||
- time_saved | ||
- fdistribu | ||
- file: '${write_restart_filename}' | ||
on_event: [write_restart] | ||
collision_policy: skip_and_warn | ||
write: | ||
- iter_saved | ||
- time_saved | ||
- grid_tor1 | ||
- grid_tor2 | ||
- grid_tor3 | ||
- grid_vpar | ||
- grid_mu | ||
- species | ||
- masses | ||
- charges | ||
- densityTorCS | ||
- temperatureTorCS | ||
- UparTorCS | ||
- fdistribu | ||
trace: ~ | ||
)PDI_CFG"; |
Oops, something went wrong.