Skip to content
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

FDTD Solver / Free Electron Laser for ALPINE #289

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b5c8668
FEL-IR-a works
manuel5975p Apr 13, 2024
c8cb043
Working on MPI
manuel5975p Apr 13, 2024
2b25e72
ABC working with mpi
manuel5975p Apr 13, 2024
cfba362
timing
manuel5975p Apr 14, 2024
9da50c9
Remove gathers
manuel5975p Apr 14, 2024
24ff0a6
Custom output path
manuel5975p Apr 14, 2024
35f2d01
Add useful radiation output
manuel5975p Apr 14, 2024
0fbb69a
Correct radiation eval
manuel5975p Apr 14, 2024
eb553ce
Correct now
manuel5975p Apr 14, 2024
120726d
Change colorscheme and labframe rad
manuel5975p Apr 16, 2024
ba073e6
FFMPEG output
manuel5975p Apr 17, 2024
200ad6d
Gauss test
manuel5975p Apr 19, 2024
3958ed8
Revert vector and particle attrib changes, make FDTD Solver compatible
manuel5975p Apr 21, 2024
b45bd97
Gauss and ampere
manuel5975p Apr 22, 2024
d8f7568
Add plotscripts
manuel5975p Apr 22, 2024
46ff0d9
Some things
manuel5975p Apr 29, 2024
68b3111
Second order ABCs working
manuel5975p May 2, 2024
10495c7
Add Solver with particles
manuel5975p May 3, 2024
ae9472c
Support for external fields
manuel5975p May 3, 2024
a72e92f
Particle solwer
manuel5975p May 3, 2024
c4ff276
ParticleAttribute: add custom reduction loop
manuel5975p May 4, 2024
fd86bdc
fdtd particle test
manuel5975p May 4, 2024
5731b7f
Hack gather routine
manuel5975p May 4, 2024
427b5f7
helper structs
manuel5975p May 5, 2024
059807a
FEL-IR working
manuel5975p May 5, 2024
283b271
Merge branch 'master' into migrate_from_working_experiments
manuel5975p May 6, 2024
b1ed73b
Fix FDTD visibility
manuel5975p May 7, 2024
e164a96
hack and fix
manuel5975p May 7, 2024
7f1f396
Add comments, remove dead lines
manuel5975p May 18, 2024
5d6c974
File Split and clang-format
manuel5975p May 18, 2024
7a803ac
Move FEL stuff to separate directory, add matrix type and lorentz tra…
manuel5975p May 24, 2024
b0ba995
Move Particle stuff into fel/
manuel5975p Jun 19, 2024
3906349
Remove some dead code, move everything particle related into fel
manuel5975p Jun 28, 2024
b4ada1c
Merge branch 'FDTDPullRequest' into migrate_from_working_experiments
anekslen Oct 31, 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
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ macro(remove_flag_from_target _target _flag)
endmacro()



if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)

set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
Expand All @@ -34,15 +35,30 @@ else ()
message (STATUS "${Green}Build type is: ${CMAKE_BUILD_TYPE}${ColourReset}")
endif()


if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
add_definitions (-DNOPAssert)
endif ()

add_compile_options (-Wall)
add_compile_options (-Wunused)
add_compile_options (-Wextra)
#¼add_compile_options (-Werror)


# allow deprecated functions
add_compile_options (-Wno-deprecated-declarations)
file(
DOWNLOAD
https://github.com/nlohmann/json/releases/download/v3.11.3/json.hpp
"${CMAKE_BINARY_DIR}/downloaded_headers/json.hpp"
)
file(
DOWNLOAD
https://raw.githubusercontent.com/manuel5975p/stb/master/stb_image_write.h
"${CMAKE_BINARY_DIR}/downloaded_headers/stb_image_write.hpp"
)
include_directories("${CMAKE_BINARY_DIR}/downloaded_headers/")

#add_compile_options (-Werror)

# allow deprecated functions
add_compile_options (-Wno-deprecated-declarations)
Expand Down Expand Up @@ -118,7 +134,7 @@ set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CUDA_EXTENSIONS OFF)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINGO} -O3 -g ")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g ")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
#set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")

Expand Down Expand Up @@ -218,6 +234,7 @@ if (ENABLE_ALPINE)
endif ()
message (STATUS "Enable Alpine")
add_subdirectory (alpine)
add_subdirectory(fel)
endif ()

option (ENABLE_UNIT_TESTS "Enable unit tests" OFF)
Expand Down
85 changes: 85 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"timestep-ratio" : 1.0,
"mesh": {
"length-scale" : "micrometers",
"time-scale" : "picoseconds",
"extents": [3400.0, 3400.0, 280.0],
"resolution": [64, 64, 2800],
"mesh-center": [0.0, 0.0, 0.0],
"total-time": 30000.0,
"bunch-time-step": 1.6,
"mesh-truncation-order": 2,
"space-charge": false,
"solver": "NSFD"
},
"bunch": {
"type": "ellipsoid",
"distribution": "uniform",
"_charge": 1,
"_mass": 1,
"charge": 1.846e8,
"mass": 1.846e8,
"number-of-particles": 1000000,
"gamma": 100.41,
"_gamma": 1.0,
"direction (ignored)": [0.0, 0.0, 1.0],
"position is 0 because that's the center": "",
"position": [0.0, 0.0, 0.0],
"_sigma-position (those are commented out)": [260.0, 260.0, 50.25],
"_sigma-momentum (those are commented out)": [1.0e-8, 1.0e-8, 100.41e-4],
"sigma-position": [260.0, 260.0, 50.25],
"sigma-momentum": [1.0e-8, 1.0e-8, 100.41e-4],
"particle-gammabetas": [0, 0, 0],
"transverse-truncation (Deprecated! see distribution-truncations)": 1040.0,
"longitudinal-truncation (Deprecated! see distribution-truncations)": 90.0,
"distribution-truncations" : [1040.0, 1040.0, 90.0],
"bunching-factor": 0.01,
"update-rule" : {"type" : "lorentz"}
},
"field": {
"update-rule" : "do",
"strength" : 100,
"field-sampling": {
"sample": true,
"type": "at-point",
"field": ["Ex", "Ey", "Ez"],
"directory": "./",
"base-name": "field-sampling/field",
"rhythm": 3.2,
"position": [0.0, 0.0, 110.0]
}
},
"undulator": {
"static-undulator": {
"undulator-parameter": 1.417,
"_undulator-parameter": 0,
"period": 30000.0,
"length": 5e6,
"polarization-angle": 0.0
}
},
"output":{
"rhythm" : 30,
"count" : 20,
"path": "../renderdata",
"type" : "E",
"track" : {
"radiation" : "boundary_radiation.txt",
"particle-position" : "p0pos.txt"
}
},
"fel-output": {
"radiation-power": {
"sample": true,
"type": "at-point",
"directory": "./",
"base-name": "power-sampling/power-NSFD",
"plane-position": 110.0,
"normalized-frequency": 1.0
}
},
"experimentation" : {
"stretch-factor" : 1.0,
"resort" : 1.0
}
}
13 changes: 13 additions & 0 deletions fel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
include_directories (
${CMAKE_SOURCE_DIR}/src
)

link_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${Kokkos_DIR}/..
)
set (IPPL_LIBS ippl ${MPI_CXX_LIBRARIES})
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})

add_executable (FreeElectronLaser FreeElectronLaser.cpp)
target_link_libraries (FreeElectronLaser ${IPPL_LIBS})
Loading