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

Space charge Mayes IPAC2018 benchmark #429

Open
wants to merge 50 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
877484e
Examples for 3D space charge benchmarking
cemitch99 Jun 7, 2022
1b55a2e
Update input_kurth_10nC.in
cemitch99 Dec 5, 2022
50d3900
Add expanding test from Mayes IPAC2018
cemitch99 Sep 8, 2023
bb79449
Delete examples/kurth/input_kurth_10nC.in
cemitch99 Sep 8, 2023
c5ad4d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 8, 2023
b934cb3
Correct file suffix.
cemitch99 Sep 9, 2023
5b0421c
Delete examples/ipac2018_mayes/input_expanding_ipac2018.py
cemitch99 Sep 9, 2023
94451ce
Adding field line-out prediction data.
cemitch99 Sep 26, 2023
557439f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 26, 2023
41f67d7
Add Gnuplot scripts for Mayes Fig. 1
cemitch99 Sep 27, 2023
f6d275e
Use latest pyAMReX
ax3l Sep 27, 2023
a3a7e9f
Plot Space-Charge Field
ax3l Sep 27, 2023
9a29e25
Merge remote-tracking branch 'mainline/development' into mayes_benchmark
ax3l Sep 28, 2023
c578df9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2023
fec4f2c
Correct Reference Frame and + Charge
cemitch99 Sep 28, 2023
55f63b1
MLMG: Expose Solver Parameters
ax3l Sep 28, 2023
efc8ee5
Improve Doc Strings: Ref Kin Energy
ax3l Sep 29, 2023
506a092
Plot multiple r runs together
ax3l Sep 29, 2023
0b197c6
r=0.2,0.5,1,10
ax3l Sep 29, 2023
ec0e65a
Add README doc for examples.
cemitch99 Mar 4, 2024
41571c8
Merge branch 'development' into mayes_benchmark
cemitch99 Mar 4, 2024
3341c6e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
66b652e
Update input_expanding_ipac2018.in
cemitch99 Mar 4, 2024
f748296
Update run_expanding_ipac2018.py
cemitch99 Mar 4, 2024
4f5a15b
Update run_fieldplots_ipac2018.py
cemitch99 Mar 4, 2024
ded7055
Update run_expanding_ipac2018.py
cemitch99 Mar 4, 2024
a656033
Update run_expanding_ipac2018.py
cemitch99 Mar 4, 2024
645680e
Update run_fieldplots_ipac2018.py
cemitch99 Mar 4, 2024
949f8e2
Update run_fieldplots_ipac2018.py
cemitch99 Mar 4, 2024
abc7ece
Resolve merge conflicts.
cemitch99 Mar 4, 2024
9c6c030
Update examples/CMakeLists.txt
cemitch99 Mar 4, 2024
54768c6
Update run_fieldplots_ipac2018.py
cemitch99 Mar 4, 2024
ffc3e02
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
ee089f6
Update CMakeLists.txt
cemitch99 Mar 4, 2024
44cf429
Update CMakeLists.txt
cemitch99 Mar 4, 2024
68899e3
Update CMakeLists.txt
cemitch99 Mar 4, 2024
6e7a232
Update CMakeLists.txt
cemitch99 Mar 4, 2024
a96319a
Add analysis scripts (draft).
cemitch99 Mar 4, 2024
e49c5e0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
951bab3
Update analysis_expanding_ipac2018.py
cemitch99 Mar 4, 2024
a14db92
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
a8ae329
Update analysis_fieldplots_ipac2018.py
cemitch99 Mar 4, 2024
70bb47c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
6297c5b
Update run_expanding_ipac2018.py
cemitch99 Mar 4, 2024
ae5f6ea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 4, 2024
6d24c07
Update CMakeLists.txt
cemitch99 Mar 5, 2024
4b32436
Update CMakeLists.txt
cemitch99 Mar 5, 2024
0d7f934
Update CMakeLists.txt
cemitch99 Mar 5, 2024
59d898e
Update run_fieldplots_ipac2018.py
cemitch99 Mar 5, 2024
10e0ba9
Update CMakeLists.txt
cemitch99 Mar 5, 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
1 change: 1 addition & 0 deletions docs/source/usage/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This section allows you to **download input files** that correspond to different
examples/pytorch_surrogate_model/README.rst
examples/apochromatic/README.rst
examples/fodo_tune/README.rst
examples/ipac2018_mayes/README.rst


Unit tests
Expand Down
23 changes: 23 additions & 0 deletions docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,29 @@ Numerics and algorithms
Currently MLMG solver looks for verbosity levels from 0-5.
A higher number results in more verbose output.

* ``algo.mlmg_relative_tolerance`` (``float``, optional, default: ``1.e-7``)
The relative precision with which the electrostatic space-charge fields should be calculated.
More specifically, the space-charge fields are computed with an iterative Multi-Level Multi-Grid (MLMG) solver.
This solver can fail to reach the default precision within a reasonable time.

* ``algo.mlmg_absolute_tolerance`` (``float``, optional, default: ``0``, which means: ignored)
The absolute tolerance with which the space-charge fields should be calculated in units of V/m^2.
More specifically, the acceptable residual with which the solution can be considered converged.
In general this should be left as the default, but in cases where the simulation state changes very
little between steps it can occur that the initial guess for the MLMG solver is so close to the
converged value that it fails to improve that solution sufficiently to reach the
mlmg_relative_tolerance value."

* ``algo.mlmg_max_iters`` (``integer``, optional, default: ``100``)
Maximum number of iterations used for MLMG solver for space-charge fields calculation.
In case if MLMG converges but fails to reach the desired self_fields_required_precision,
this parameter may be increased.

* ``algo.mlmg_verbosity`` (``integer``, optional, default: ``1``)
The verbosity used for MLMG solver for space-charge fields calculation.
Currently MLMG solver looks for verbosity levels from 0-5.
A higher number results in more verbose output.

.. _running-cpp-parameters-diagnostics:

Diagnostics and output
Expand Down
33 changes: 33 additions & 0 deletions docs/source/usage/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,39 @@ General
Currently MLMG solver looks for verbosity levels from 0-5.
A higher number results in more verbose output.

.. py:property:: mlmg_relative_tolerance

Default: ``1.e-7``

The relative precision with which the electrostatic space-charge fields should be calculated.
More specifically, the space-charge fields are computed with an iterative Multi-Level Multi-Grid (MLMG) solver.
This solver can fail to reach the default precision within a reasonable time.

.. py:property:: mlmg_absolute_tolerance

Default: ``0``, which means: ignored

The absolute tolerance with which the space-charge fields should be calculated in units of :math:`V/m^2`.
More specifically, the acceptable residual with which the solution can be considered converged.
In general this should be left as the default, but in cases where the simulation state changes very
little between steps it can occur that the initial guess for the MLMG solver is so close to the
converged value that it fails to improve that solution sufficiently to reach the ``mlmg_relative_tolerance`` value.

.. py:property:: mlmg_max_iters

Default: ``100``

Maximum number of iterations used for MLMG solver for space-charge fields calculation.
In case if MLMG converges but fails to reach the desired self_fields_required_precision, this parameter may be increased.

.. py:property:: mlmg_verbosity

Default: ``1``

The verbosity used for MLMG solver for space-charge fields calculation.
Currently MLMG solver looks for verbosity levels from 0-5.
A higher number results in more verbose output.

.. py:property:: diagnostics

Enable (``True``) or disable (``False``) diagnostics generally (default: ``True``).
Expand Down
34 changes: 34 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -894,3 +894,37 @@ add_impactx_test(fodo_tune.py
examples/fodo_tune/analysis_fodo_tune.py
OFF # no plot script yet
)

# Space charge fields (Gaussian bunch) #################################################
#
# w/ space charge
# copy nominal field data files
file(COPY ${ImpactX_SOURCE_DIR}/examples/ipac2018_mayes/Ex_Mayes.dat
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gaussian-SCfields.py)
file(COPY ${ImpactX_SOURCE_DIR}/examples/ipac2018_mayes/Ez_Mayes.dat
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gaussian-SCfields.py)
add_impactx_test(gaussian-SCfields.py
examples/ipac2018_mayes/run_fieldplots_ipac2018.py
OFF # ImpactX MPI-parallel
ON # ImpactX Python interface
# examples/ipac2018_mayes/analysis_fieldplots_ipac2018.py
OFF # no plot script yet
)

# Space charge in a coasting Gaussian bunch ############################################
#
# w/ space charge
add_impactx_test(gaussian-SCdrift
examples/ipac2018_mayes/input_expanding_ipac2018.in
ON # ImpactX MPI-parallel
OFF # ImpactX Python interface
examples/ipac2018_mayes/analysis_expanding_ipac2018.py
OFF # no plot script yet
)
add_impactx_test(gaussian-SCdrift.py
examples/ipac2018_mayes/run_expanding_ipac2018.py
OFF # ImpactX MPI-parallel
ON # ImpactX Python interface
examples/ipac2018_mayes/analysis_expanding_ipac2018.py
OFF # no plot script yet
)
Loading
Loading