Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9a58785
Update LICENSE
haykh Dec 13, 2023
e3c1284
Merge pull request #50 from entity-toolkit/1.1.0rc
haykh Jul 29, 2024
236390c
patch version + upd readme
haykh Jul 29, 2024
9246d68
restructure adios to add checkpoints
haykh Aug 9, 2024
7014037
bug in writer test
haykh Aug 9, 2024
07f5931
fixes some issues with prtl output
haykh Aug 9, 2024
a5af284
added report on arch & rocm+cuda versions
haykh Jul 29, 2024
e87ebdf
Update magnetar setup.
Jul 29, 2024
9a88010
version bump
haykh Jul 29, 2024
dfd6d50
fixes some issues with prtl output
haykh Aug 9, 2024
5f38b86
Merge branch 'bug/mpiprtlout' of github.com:entity-toolkit/entity int…
haykh Aug 9, 2024
dc2611e
rebase
haykh Aug 9, 2024
51ad430
skip prtl2phys kernel when nout == 0
haykh Aug 9, 2024
0f3d68a
preliminary checkpoint framework
haykh Aug 10, 2024
517571a
toml11 dependency removed
haykh Aug 10, 2024
83c2249
cmake in test fixed
haykh Aug 10, 2024
86e7f9d
restart dumping
haykh Aug 10, 2024
48a7e36
toml.h bug fixed
haykh Aug 10, 2024
d36d3cd
param reading adapted to checkpoint
haykh Aug 13, 2024
43d66a3
advanced diag output
haykh Aug 17, 2024
e24959f
checkpoint read/write
haykh Aug 17, 2024
71025ca
diag minor issue with non-mpi
haykh Aug 17, 2024
4f2fd30
conditional action launch
haykh Aug 17, 2024
dedbd25
Merge pull request #68 from entity-toolkit/bug/mpiprtlout
haykh Aug 17, 2024
d18e200
Merge pull request #65 from entity-toolkit/1.1.1rc
haykh Aug 17, 2024
08702a6
tasklist upd
haykh Aug 17, 2024
859ee9f
minor
haykh Aug 17, 2024
18084fe
Ongoing.
Aug 18, 2024
08e9acb
minor bugs & leftovers
haykh Aug 22, 2024
bbb3c46
disable checkpoint @ keep=0
haykh Aug 26, 2024
0a3821b
minor warnings & bugs
haykh Aug 26, 2024
52fc130
Add powerlaw distribution function.
Aug 26, 2024
9ad4a8a
checkpoint fixed
haykh Aug 26, 2024
0301034
Ongoing.
Aug 26, 2024
531d4c1
updated checkpoint
haykh Aug 30, 2024
efff789
bugfix (i think it works)
haykh Sep 1, 2024
adfaf84
Fixing a bug in checkpoint writing (prtls).
Sep 4, 2024
2a258c1
Optimizing checkpoint writing (flds/prtls).
Sep 13, 2024
237294e
added test for plaw in all metrics
haykh Oct 14, 2024
a03c0da
runner cuda upd
haykh Oct 14, 2024
4f2c656
version reverse to 1.2.0
haykh Oct 14, 2024
1c94a8d
Merge pull request #71 from entity-toolkit/dev/powerlaw
haykh Oct 14, 2024
3949af9
restructure adios to add checkpoints
haykh Aug 9, 2024
377fa0a
bug in writer test
haykh Aug 9, 2024
c8e809d
preliminary checkpoint framework
haykh Aug 10, 2024
b0f4673
toml11 dependency removed
haykh Aug 10, 2024
747d73a
cmake in test fixed
haykh Aug 10, 2024
b206065
restart dumping
haykh Aug 10, 2024
631793a
toml.h bug fixed
haykh Aug 10, 2024
2fb148e
param reading adapted to checkpoint
haykh Aug 13, 2024
d55d718
advanced diag output
haykh Aug 17, 2024
fc3d967
checkpoint read/write
haykh Aug 17, 2024
0321b9a
diag minor issue with non-mpi
haykh Aug 17, 2024
43e3acb
conditional action launch
haykh Aug 17, 2024
ddc7094
minor
haykh Aug 17, 2024
4ac34e2
minor bugs & leftovers
haykh Aug 22, 2024
550e19d
disable checkpoint @ keep=0
haykh Aug 26, 2024
d77a16a
minor warnings & bugs
haykh Aug 26, 2024
f96f750
checkpoint fixed
haykh Aug 26, 2024
a610fee
updated checkpoint
haykh Aug 30, 2024
795b440
bugfix (i think it works)
haykh Sep 1, 2024
aa2b00d
Fixing a bug in checkpoint writing (prtls).
Sep 4, 2024
1efeffc
Optimizing checkpoint writing (flds/prtls).
Sep 13, 2024
c7225eb
tests fixed
haykh Oct 14, 2024
20801ac
merged
haykh Oct 14, 2024
684627c
checkpoint test
haykh Oct 15, 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
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ IncludeCategories:
Priority: 4
- Regex: '^"engines\/.*\.h"'
Priority: 4
- Regex: '^"checkpoint\/.*\.h"'
Priority: 4
- Regex: '^"output\/.*\.h"'
Priority: 4
- Regex: '^"archetypes\/.*\.h"'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
exclude:
- device: amd-gpu
precision: double
# my AMD GPUs doesn't support fp64 atomics : (
# my AMD GPU doesn't support fp64 atomics : (
runs-on: [self-hosted, "${{ matrix.device }}"]
if: contains(github.event.head_commit.message, 'totest')
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ Testing/
.schema.json
*_old/
action-token
*.vim
ignore-*
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "extern/toml11"]
path = extern/toml11
url = https://github.com/ToruNiina/toml11.git
[submodule "extern/plog"]
path = extern/plog
url = https://github.com/SergiusTheBest/plog.git
Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.cmake)

find_or_fetch_dependency(Kokkos FALSE)
find_or_fetch_dependency(plog TRUE)
find_or_fetch_dependency(toml11 TRUE)
set(DEPENDENCIES Kokkos::kokkos)
include_directories(${plog_SRC}/include)
include_directories(${toml11_SRC})

# -------------------------------- Main code ------------------------------- #
set_precision(${precision})
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Our [detailed documentation](https://entity-toolkit.github.io/) includes everyth

## Core developers (alphabetical)

👀 __Yangyang Cai__ {[@StaticObserver](https://github.com/StaticObserver): GRPIC}

💁‍♂️ __Alexander Chernoglazov__ {[@SChernoglazov](https://github.com/SChernoglazov): PIC}

🍵 __Benjamin Crinquand__ {[@bcrinquand](https://github.com/bcrinquand): GRPIC, cubed-sphere}
Expand Down
30 changes: 0 additions & 30 deletions TASKLIST.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
# v0.8

- [x] thick layer boundary for the monopole
- [x] test with filters
- [x] add diagnostics for nans in fields and particles
- [x] add gravitationally bound atmosphere
- [x] rewrite UniformInjector with global random pool
- [x] add particle deletion routine
- [x] make more user-friendly and understandable boundary conditions
- [x] refine output
- [x] add different moments (momX, momY, momZ, meanGamma)
- [x] add charge
- [x] add per species densities

# v0.9

- [x] add current deposit/filtering for GR
- [x] add moments for GR
- [x] add Maxwellian for GR

# v1.0.0

- [x] particle output
- [x] BUG in MPI particles/currents

# v1.1.0

- [ ] custom boundary conditions for particles and fields
- [ ] transfer GR from v0.9

### Performance improvements to try

- [ ] removing temporary variables in interpolation
Expand Down
7 changes: 4 additions & 3 deletions cmake/report.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,11 @@ endif()

message(" ${PRECISION_REPORT}")
message(" ${OUTPUT_REPORT}")
message("${DASHED_LINE_SYMBOL}
Compile configurations")
message("${DASHED_LINE_SYMBOL}\nCompile configurations")

message(" ${ARCH_REPORT}")
if(NOT "${ARCH_REPORT}" STREQUAL "")
message(" ${ARCH_REPORT}")
endif()
message(" ${CUDA_REPORT}")
message(" ${HIP_REPORT}")
message(" ${OPENMP_REPORT}")
Expand Down
3 changes: 3 additions & 0 deletions cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ add_subdirectory(${SRC_DIR}/archetypes ${CMAKE_CURRENT_BINARY_DIR}/archetypes)
add_subdirectory(${SRC_DIR}/framework ${CMAKE_CURRENT_BINARY_DIR}/framework)
if (${output})
add_subdirectory(${SRC_DIR}/output ${CMAKE_CURRENT_BINARY_DIR}/output)
add_subdirectory(${SRC_DIR}/checkpoint ${CMAKE_CURRENT_BINARY_DIR}/checkpoint)
endif()

if (${mpi})
# tests with mpi
if (${output})
add_subdirectory(${SRC_DIR}/output/tests ${CMAKE_CURRENT_BINARY_DIR}/output/tests)
add_subdirectory(${SRC_DIR}/framework/tests ${CMAKE_CURRENT_BINARY_DIR}/checkpoint/tests)
add_subdirectory(${SRC_DIR}/framework/tests ${CMAKE_CURRENT_BINARY_DIR}/framework/tests)
endif()
else()
Expand All @@ -27,5 +29,6 @@ else()
add_subdirectory(${SRC_DIR}/framework/tests ${CMAKE_CURRENT_BINARY_DIR}/framework/tests)
if (${output})
add_subdirectory(${SRC_DIR}/output/tests ${CMAKE_CURRENT_BINARY_DIR}/output/tests)
add_subdirectory(${SRC_DIR}/checkpoint/tests ${CMAKE_CURRENT_BINARY_DIR}/checkpoint/tests)
endif()
endif()
17 changes: 10 additions & 7 deletions dev/runners/Dockerfile.runner.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ ARG HOME=/home/$USER
WORKDIR $HOME

# gh runner
ARG RUNNER_VERSION=2.317.0
RUN mkdir actions-runner
WORKDIR $HOME/actions-runner

RUN --mount=type=secret,id=ghtoken \
curl -o actions-runner-linux-x64-2.317.0.tar.gz \
-L https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-linux-x64-2.317.0.tar.gz && \
tar xzf ./actions-runner-linux-x64-2.317.0.tar.gz && \
sudo ./bin/installdependencies.sh && \
./config.sh --url https://github.com/entity-toolkit/entity --token "$(sudo cat /run/secrets/ghtoken)" --labels nvidia-gpu
RUN curl -o actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
-L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
sudo ./bin/installdependencies.sh

ENTRYPOINT ["./run.sh"]
ADD start.sh start.sh
RUN sudo chown $USER:$USER start.sh && \
sudo chmod +x start.sh

ENTRYPOINT ["./start.sh"]
2 changes: 1 addition & 1 deletion extern/Kokkos
Submodule Kokkos updated 311 files
2 changes: 1 addition & 1 deletion extern/adios2
Submodule adios2 updated 94 files
+31 −20 .github/workflows/everything.yml
+6 −4 .github/workflows/pypackaging.yml
+1 −0 .github/workflows/sync.yml
+21 −27 ReadMe.md
+17 −5 bindings/Python/CMakeLists.txt
+17 −0 bindings/Python/py11IO.cpp
+5 −0 bindings/Python/py11IO.h
+51 −0 bindings/Python/py11VariableDerived.cpp
+54 −0 bindings/Python/py11VariableDerived.h
+31 −0 bindings/Python/py11glue.cpp
+12 −0 bindings/Python/usercustomize.py.in
+4 −2 cmake/ADIOSFunctions.cmake
+22 −8 cmake/DetectOptions.cmake
+43 −0 python/adios2/derived_variable.py
+26 −0 python/adios2/io.py
+1 −1 python/adios2/variable.py
+6 −4 scripts/build_scripts/build-adios2-kvcache.sh
+0 −28 scripts/ci/cmake/ci-macos-12-xcode13_4_1-shared-serial.cmake
+0 −52 scripts/ci/cmake/ci-macos-12-xcode13_4_1-static-serial.cmake
+16 −3 scripts/ci/cmake/ci-macos-13-xcode14_2-shared-serial.cmake
+16 −3 scripts/ci/cmake/ci-macos-14-xcode15_4-shared-serial.cmake
+3 −2 scripts/ci/cmake/ci-macos-14-xcode15_4-static-serial.cmake
+11 −1 scripts/ci/cmake/ci-win2019-vs2019-msmpi.cmake
+0 −21 scripts/ci/cmake/ci-win2019-vs2019-ninja.cmake
+0 −20 scripts/ci/cmake/ci-win2019-vs2019-serial.cmake
+11 −1 scripts/ci/cmake/ci-win2022-vs2022-msmpi.cmake
+9 −1 scripts/ci/cmake/ci-win2022-vs2022-serial.cmake
+13 −0 scripts/ci/gh-actions/conda-env-macos.yml
+1 −0 scripts/ci/gh-actions/conda-env-win.yml
+30 −31 scripts/ci/gh-actions/macos-setup.sh
+0 −1 scripts/ci/gh-actions/windows-setup.ps1
+11 −7 source/adios2/CMakeLists.txt
+0 −2 source/adios2/common/ADIOSTypes.h
+6 −11 source/adios2/core/IO.cpp
+5 −3 source/adios2/core/VariableDerived.cpp
+3 −1 source/adios2/core/VariableDerived.h
+7 −2 source/adios2/engine/bp5/BP5Reader.cpp
+3 −0 source/adios2/engine/bp5/BP5Reader.h
+1 −0 source/adios2/toolkit/derived/DerivedData.h
+38 −4 source/adios2/toolkit/derived/Expression.cpp
+2 −0 source/adios2/toolkit/derived/Expression.h
+10 −0 source/adios2/toolkit/derived/Function.cpp
+3 −0 source/adios2/toolkit/derived/Function.h
+1 −0 source/adios2/toolkit/derived/parser/ASTDriver.cpp
+1 −0 source/adios2/toolkit/derived/parser/ASTDriver.h
+94 −104 source/adios2/toolkit/derived/parser/lexer.l
+1,182 −1,083 source/adios2/toolkit/derived/parser/pregen-source/lexer.cpp
+8 −0 source/adios2/toolkit/format/bp5/BP5Deserializer.cpp
+30 −0 source/adios2/toolkit/kvcache/KVCacheCommon.cpp
+5 −1 source/adios2/toolkit/kvcache/KVCacheCommon.h
+123 −1 source/adios2/toolkit/sst/cp/cp_common.c
+2 −0 source/adios2/toolkit/sst/cp/cp_internal.h
+1 −1 source/adios2/toolkit/sst/cp/cp_reader.c
+5 −4 source/adios2/toolkit/sst/cp/cp_writer.c
+1 −0 source/adios2/toolkit/sst/sst_data.h
+6 −0 source/adios2/toolkit/sst/win_interface.h
+16 −0 testing/adios2/engine/bp/CMakeLists.txt
+4 −0 testing/adios2/python/CMakeLists.txt
+79 −0 testing/adios2/python/TestDerivedVariable.py
+30 −42 testing/adios2/python/TestVariable.py
+1 −1 thirdparty/EVPath/EVPath/.indent.pro
+16 −9 thirdparty/EVPath/EVPath/CMakeLists.txt
+1 −1 thirdparty/EVPath/EVPath/chr_time.c
+3 −1 thirdparty/EVPath/EVPath/cm.c
+2 −0 thirdparty/EVPath/EVPath/cm_evol.c
+2 −0 thirdparty/EVPath/EVPath/cm_pbio.c
+2 −0 thirdparty/EVPath/EVPath/cm_perf.c
+3 −1 thirdparty/EVPath/EVPath/cm_schedule.h
+9 −16 thirdparty/EVPath/EVPath/cmdemo.c
+6 −3 thirdparty/EVPath/EVPath/cmenet.c
+2 −0 thirdparty/EVPath/EVPath/cmepoll.c
+2 −0 thirdparty/EVPath/EVPath/cmib.c
+6 −2 thirdparty/EVPath/EVPath/cmmulticast.c
+2 −0 thirdparty/EVPath/EVPath/cmselect.c
+4 −2 thirdparty/EVPath/EVPath/cmsockets.c
+6 −2 thirdparty/EVPath/EVPath/cmudp.c
+6 −0 thirdparty/EVPath/EVPath/config.h.cmake
+5 −1 thirdparty/EVPath/EVPath/dlloader.c
+24 −2 thirdparty/EVPath/EVPath/ip_config.c
+2 −2 thirdparty/EVPath/EVPath/metrics.c
+2 −0 thirdparty/EVPath/EVPath/qual_hostname.c
+3 −1 thirdparty/EVPath/EVPath/response.c
+2 −0 thirdparty/EVPath/EVPath/thin_server.c
+1 −1 thirdparty/EVPath/EVPath/version.c
+1 −0 thirdparty/KWSys/CMakeLists.txt
+1 −0 thirdparty/enet/enet/win32.c
+3 −1 thirdparty/ffs/ffs/CMakeLists.txt
+0 −30 thirdparty/ffs/ffs/cod/standard.c
+6 −0 thirdparty/ffs/ffs/config.h.cmake
+5 −0 thirdparty/ffs/ffs/ffs/ffs_file.c
+1 −1 thirdparty/ffs/ffs/fm/fm_formats.c
+5 −3 thirdparty/ffs/ffs/fm/nt_io.c
+3 −0 thirdparty/ffs/ffs/fm/unix_io.c
+1 −1 thirdparty/ffs/ffs/version.c
1 change: 0 additions & 1 deletion extern/toml11
Submodule toml11 deleted from 12c0f3
49 changes: 40 additions & 9 deletions input.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
# @default: 0.9
e_ovr_b_max = ""
# Maximum Larmor radius allowed for GCA particles (in physical units):
# @type: float: > 0
# @type: float
# @default: 0.0
# @note: When `larmor_max` == 0, the limit is disabled
larmor_max = ""
Expand All @@ -253,7 +253,7 @@
# @default: false
use_weights = ""
# Timesteps between particle re-sorting:
# @type: unsigned int: >= 0
# @type: unsigned int
# @default: 100
# @note: When MPI is enable, particles are sorted every step.
# @note: When `sort_interval` == 0, the sorting is disabled.
Expand Down Expand Up @@ -293,7 +293,7 @@
# @valid: "Boris", "Vay", "Boris,GCA", "Vay,GCA", "Photon", "None"
pusher = ""
# Number of additional (payload) variables for each particle of the given species:
# @type: unsigned short: >= 0
# @type: unsigned short
# @default: 0
n_payloads = ""
# Radiation reaction to use for the species:
Expand All @@ -316,7 +316,7 @@
# @default: 1
interval = ""
# Physical (code) time interval between all outputs (overriden by specific output intervals below):
# @type: float: > 0
# @type: float
# @default: -1.0 (disabled)
# @note: When `interval_time` < 0, the output is controlled by `interval`, otherwise by `interval_time`
interval_time = ""
Expand Down Expand Up @@ -345,15 +345,15 @@
# @default: 1
stride = ""
# Smoothing window for the output of moments (e.g., "Rho", "Charge", "T", etc.):
# @type: unsigned short: >= 0
# @type: unsigned short
# @default: 0
mom_smooth = ""
# Number of timesteps between field outputs (overrides `output.interval`):
# @type: unsigned int: > 0
# @type: unsigned int
# @default: 0 (use `output.interval`)
interval = ""
# Physical (code) time interval between field outputs (overrides `output.interval_time`):
# @type: float: > 0
# @type: float
# @default: -1.0 (use `output.interval_time`)
# @note: When `interval_time` < 0, the output is controlled by `interval`, otherwise by `interval_time`
interval_time = ""
Expand All @@ -376,7 +376,7 @@
# @default: 0 (use `output.interval`)
interval = ""
# Physical (code) time interval between field outputs (overrides `output.interval_time`):
# @type: float: > 0
# @type: float
# @default: -1.0 (use `output.interval_time`)
# @note: When `interval_time` < 0, the output is controlled by `interval`, otherwise by `interval_time`
interval_time = ""
Expand Down Expand Up @@ -407,7 +407,7 @@
# @default: 0 (use `output.interval`)
interval = ""
# Physical (code) time interval between spectra outputs (overrides `output.interval_time`):
# @type: float: > 0
# @type: float
# @default: -1.0 (use `output.interval_time`)
# @note: When `interval_time` < 0, the output is controlled by `interval`, otherwise by `interval_time`
interval_time = ""
Expand All @@ -422,6 +422,37 @@
# @default: false
ghosts = ""

[checkpoint]
# Number of timesteps between checkpoints:
# @type: unsigned int: > 0
# @default: 1000
interval = ""
# Physical (code) time interval between checkpoints:
# @type: float: > 0
# @default: -1.0 (disabled)
# @note: When `interval_time` < 0, the output is controlled by `interval`, otherwise by `interval_time`
interval_time = ""
# Number of checkpoints to keep:
# @type: int
# @default: 2
# @note: 0 = disable checkpointing
# @note: -1 = keep all checkpoints
keep = ""

# @inferred:
# - is_resuming
# @brief: Whether the simulation is resuming from a checkpoint
# @type: bool
# @from: command-line flag
# - start_step
# @brief: Timestep of the checkpoint used to resume
# @type: unsigned int
# @from: automatically determined during restart
# - start_time
# @brief: Time of the checkpoint used to resume
# @type: float
# @from: automatically determined during restart

[diagnostics]
# Number of timesteps between diagnostic logs:
# @type: int: > 0
Expand Down
16 changes: 8 additions & 8 deletions legacy/src/framework/utils/particle_injectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace ntt {
* @brief Volumetrically uniform particle injector parallelized over particles.
* @tparam D dimension.
* @tparam S simulation engine.
* @tparam EnDist energy distribution [default = ColdDist].
* @tparam EnDist energy distribution [default = Cold].
*
* @param params simulation parameters.
* @param mblock meshblock.
Expand All @@ -174,7 +174,7 @@ namespace ntt {
* @param region region to inject particles as a list of coordinates [optional].
* @param time current time [optional].
*/
template <Dimension D, SimulationEngine S, template <Dimension, SimulationEngine> class EnDist = ColdDist>
template <Dimension D, SimulationEngine S, template <Dimension, SimulationEngine> class EnDist = Cold>
inline void InjectUniform(const SimulationParams& params,
Meshblock<D, S>& mblock,
const std::vector<int>& species,
Expand Down Expand Up @@ -613,8 +613,8 @@ namespace ntt {
* @brief Particle injector parallelized by cells in a volume.
* @tparam D dimension.
* @tparam S simulation engine.
* @tparam EnDist energy distribution [default = ColdDist].
* @tparam SpDist spatial distribution [default = UniformDist].
* @tparam EnDist energy distribution [default = Cold].
* @tparam SpDist spatial distribution [default = Uniform].
* @tparam InjCrit injection criterion [default = NoCriterion].
*
* @param params simulation parameters.
Expand All @@ -626,8 +626,8 @@ namespace ntt {
*/
template <Dimension D,
SimulationEngine S,
template <Dimension, SimulationEngine> class EnDist = ColdDist,
template <Dimension, SimulationEngine> class SpDist = UniformDist,
template <Dimension, SimulationEngine> class EnDist = Cold,
template <Dimension, SimulationEngine> class SpDist = Uniform,
template <Dimension, SimulationEngine> class InjCrit = NoCriterion>
inline void InjectInVolume(const SimulationParams& params,
Meshblock<D, S>& mblock,
Expand Down Expand Up @@ -928,7 +928,7 @@ namespace ntt {
* @brief ... up to certain number density.
* @tparam D dimension.
* @tparam S simulation engine.
* @tparam EnDist energy distribution [default = ColdDist].
* @tparam EnDist energy distribution [default = Cold].
* @tparam InjCrit injection criterion [default = NoCriterion].
*
* @param params simulation parameters.
Expand All @@ -940,7 +940,7 @@ namespace ntt {
*/
template <Dimension D,
SimulationEngine S,
template <Dimension, SimulationEngine> class EnDist = ColdDist,
template <Dimension, SimulationEngine> class EnDist = Cold,
template <Dimension, SimulationEngine> class InjCrit = NoCriterion>
inline void InjectNonUniform(const SimulationParams& params,
Meshblock<D, S>& mblock,
Expand Down
29 changes: 12 additions & 17 deletions setups/srpic/turbulence/pgen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,30 +185,25 @@ namespace user {
const auto injector = arch::UniformInjector<S, M, arch::Maxwellian>(
energy_dist,
{ 1, 2 });
const real_t ndens = 1.0;
const real_t ndens = 0.9;
arch::InjectUniform<S, M, decltype(injector)>(params,
local_domain,
injector,
ndens);
}

{
// const auto energy_dist = arch::Maxwellian<S, M>(local_domain.mesh.metric,
// local_domain.random_pool,
// temperature*10);
// // const auto energy_dist = arch::Maxwellian<S, M>(local_domain.mesh.metric,
// // local_domain.random_pool,
// // temperature * 2,
// // 10.0,
// // 1);
// const auto injector = arch::UniformInjector<S, M, arch::Maxwellian>(
// energy_dist,
// { 1, 2 });
// const real_t ndens = 0.01;
// arch::InjectUniform<S, M, decltype(injector)>(params,
// local_domain,
// injector,
// ndens);
const auto energy_dist = arch::PowerlawDist<S, M>(local_domain.mesh.metric,
local_domain.random_pool,
0.1, 100.0, -3.0);
const auto injector = arch::UniformInjector<S, M, arch::PowerlawDist>(
energy_dist,
{ 1, 2 });
const real_t ndens = 0.1;
arch::InjectUniform<S, M, decltype(injector)>(params,
local_domain,
injector,
ndens);
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# - ntt_framework [required]
# - ntt_metrics [required]
# - ntt_engine [required]
# - ntt_pgen [required]
# @uses:
# - kokkos [required]
# - plog [required]
Expand All @@ -30,9 +31,12 @@ add_subdirectory(${SRC_DIR}/kernels ${CMAKE_CURRENT_BINARY_DIR}/kernels)
add_subdirectory(${SRC_DIR}/archetypes ${CMAKE_CURRENT_BINARY_DIR}/archetypes)
add_subdirectory(${SRC_DIR}/framework ${CMAKE_CURRENT_BINARY_DIR}/framework)
add_subdirectory(${SRC_DIR}/engines ${CMAKE_CURRENT_BINARY_DIR}/engines)
if (${output} STREQUAL "ON")
add_subdirectory(${SRC_DIR}/output ${CMAKE_CURRENT_BINARY_DIR}/output)

if (${output})
add_subdirectory(${SRC_DIR}/output ${CMAKE_CURRENT_BINARY_DIR}/output)
add_subdirectory(${SRC_DIR}/checkpoint ${CMAKE_CURRENT_BINARY_DIR}/checkpoint)
endif()

add_subdirectory(${SRC_DIR}/../setups ${CMAKE_CURRENT_BINARY_DIR}/setups)

set(libs ntt_global ntt_framework ntt_metrics ntt_engines ntt_pgen)
Expand Down
Loading