forked from LASY-org/lasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Documentation Content (LASY-org#117)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maxence Thévenet <[email protected]> Co-authored-by: Remi Lehe <[email protected]>
- Loading branch information
1 parent
f37fd8d
commit a57a8ea
Showing
11 changed files
with
187 additions
and
58 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
9 changes: 9 additions & 0 deletions
9
docs/source/api/profiles/transverse/transverse_profile_from_data.rst
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,9 @@ | ||
Transverse Profile From Data | ||
============================ | ||
|
||
This class allows the user to import an experimentally measured transverse profile into ``lasy`` | ||
|
||
------------ | ||
|
||
.. autoclass:: lasy.profiles.transverse.transverse_profile_from_data.TransverseProfileFromData | ||
:members: |
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 |
---|---|---|
@@ -1,4 +1,17 @@ | ||
Codes Supporting LASY Input Data | ||
================================ | ||
Codes Supporting LASY Data | ||
========================== | ||
|
||
A list of codes which support LASY Data as input. | ||
A list of codes which support LASY Data as input: | ||
|
||
* Many Coming Soon! | ||
|
||
A list of codes currently in the process of adding support: | ||
|
||
* `FBPIC <https://github.com/fbpic/fbpic>`_ | ||
* `Wake-T <https://github.com/AngelFP/Wake-T>`_ | ||
* `WarpX <https://github.com/ECP-WarpX/WarpX>`_ | ||
* `HiPACE++ <https://github.com/Hi-PACE/hipace>`_ | ||
|
||
A list of standard output formats supported by ``lasy``: | ||
|
||
* `openPMD <https://github.com/openPMD/openPMD-viewer>`_ |
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 |
---|---|---|
@@ -1,13 +1,56 @@ | ||
Overview of the Code | ||
==================== | ||
|
||
What's this all about then? | ||
``lasy`` manipulates laser pulses, and operates on the laser envelope. | ||
It can be used to define the 3D profile of a laser pulse. | ||
The user can define seperately the transverse and longitudinal profile of the laser pulse either from a range common analytic profiles or using experimental measurements. | ||
Once defined the laser pulse may be propagated to a user defined location. | ||
Finally the laser profile may be outputted to file for use as an input to a variety of different simulation tools. | ||
|
||
Structure | ||
######### | ||
|
||
All information pertaining to the representation of the laser pulse in the code is stored in the :doc:`laser <../api/laser>` object. | ||
This contains both the physical and computational parameters. | ||
|
||
The physical laser pulse parameters are defined in the laser :doc:`profile <../api/profiles/index>`. | ||
This is typically constructed from a :doc:`combination <../api/profiles/combined_profile>` of two classes representing the :doc:`longitudinal <../api/profiles/longitudinal/index>` and :doc:`transverse <../api/profiles/transverse/index>` profiles of the laser. | ||
Alternatively, one can define the full 3D profile in a single function, for example the :doc:`GaussianProfile <../api/profiles/gaussian>` | ||
|
||
The data associated with a given laser pulse is stored on a :doc:`grid <../api/utils/grid>`. | ||
To create this grid and populate it with a laser pulse, we need to know something about the computational parmaeters being used. | ||
For example, the metadata associated with this grid such as the coordinate system being used, lower and higher ends of the computational domain and number of points etc.. | ||
All of this information is stored in the :doc:`box <../api/utils/box>` class. | ||
|
||
Once a laser :doc:`laser <../api/laser>` object has been defined, we can then propagate it forwards and backwards to see how it evolves or to set it in the right place for the beginning of a subsequent simulation. | ||
The laser object can be :doc:`outputted <../api/utils/openpmd_output>` to a standard file format for these subsequent calculations. This allows for easy incorporation of standardised laser pulses to a range of different simulation tools. | ||
|
||
Coordinate Systems | ||
################## | ||
|
||
In 3D (x,y,t) Cartesian coordinates, the definition used is: | ||
|
||
.. math:: | ||
\begin{aligned} | ||
E_x(x,y,t) = \operatorname{Re} \left( \mathcal{E}(x,y,t) e^{-i \omega_0t}p_x \right)\\ | ||
E_y(x,y,t) = \operatorname{Re} \left( \mathcal{E}(x,y,t) e^{-i \omega_0t}p_y \right)\end{aligned} | ||
where :math:`\operatorname{Re}` stands for real part, :math:`E_x` (resp. :math:`E_y`) is the laser electric field in the :math:`x` (resp. :math:`y`) direction, :math:`\mathcal{E}` is the complex laser envelope stored and used in lasy, :math:`\omega_0 = 2\pi c/\lambda_0` is the angular frequency defined from the laser wavelength :math:`\lambda_0` and :math:`(p_x,p_y)` is the (complex and normalized) polarization vector. | ||
|
||
In cylindrical coordinates, the envelope is decomposed in :math:`N_m` azimuthal modes ( see Ref. [A. Lifschitz et al., J. Comp. Phys. 228.5: 1803-1814 (2009)]). Each mode is stored on a 2D grid :math:`(r,t)`, using the following definition: | ||
|
||
.. math:: | ||
\begin{aligned} | ||
E_x (r,\theta,t) = \operatorname{Re}\left( \sum_{-N_m+1}^{N_m-1}\mathcal{E}_m(r,t) e^{-im\theta}e^{-i\omega_0t}p_x\right)\\ | ||
E_y (r,\theta,t) = \operatorname{Re}\left( \sum_{-N_m+1}^{N_m-1}\mathcal{E}_m(r,t) e^{-im\theta}e^{-i\omega_0t}p_y\right).\end{aligned} | ||
.. toctree:: | ||
:hidden: | ||
:maxdepth: 4 | ||
|
||
motivation | ||
data_standards | ||
codes_supporting_lasy | ||
laser_propagation | ||
codes_supporting_lasy |
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 |
---|---|---|
@@ -1,10 +1,68 @@ | ||
User Guide | ||
========== | ||
|
||
How to get started. | ||
Installation | ||
############ | ||
|
||
.. toctree:: | ||
:hidden: | ||
:maxdepth: 4 | ||
To install the code you will need to first clone the repository to your local machine. | ||
Change into the new directory and then run the install command as given below. | ||
|
||
local_machine_install | ||
.. code-block:: bash | ||
:caption: Installation Instructions | ||
git clone https://github.com/LASY-org/lasy.git | ||
cd lasy | ||
python3 -m pip install -v . | ||
More installation options and further instructions will be added in due course. | ||
|
||
|
||
First Example | ||
############# | ||
|
||
We will try a simple example to get familiar with the code structure and to verify the installation was successful. | ||
Lets generate a Gaussian pulse at focus, propagate it backwards by one Rayeligh Length and then output it to file. | ||
|
||
.. code-block:: python | ||
:caption: First lets load in the required functions from the library. | ||
from lasy.profiles.gaussian_profile import GaussianProfile | ||
.. code-block:: python | ||
:caption: Next, define the physical parameters of the laser pulse and create the laser profile object. | ||
wavelength = 800e-9 # Laser wavelength in meters | ||
polarization = (1,0) # Linearly polarized in the x direction | ||
energy = 1.5 # Energy of the laser pulse in joules | ||
spot_size = 25e-6 # Waist of the laser pulse in meters | ||
pulse_duration = 30e-15 # Pulse duration of the laser in seconds | ||
t_peak = 0.0 # Location of the peak of the laser pulse in time | ||
laser_profile = GaussianProfile(wavelength,polarization,energy,spot_size,pulse_duration,t_peak) | ||
.. code-block:: python | ||
:caption: Now create a full laser object containing the above physical parameters together with the computational settings. | ||
dimensions = 'rt' # Use cylindrical geometry | ||
lo = (0,-2.5*pulse_duration) # Lower bounds of the simulation box | ||
hi = (5*spot_size,2.5*pulse_duration) # Upper bounds of the simulation box | ||
num_points = (300,500) # Number of points in each dimension | ||
laser = Laser(dimensions,lo,hi,num_points,laser_profile) | ||
.. code-block:: python | ||
:caption: Propagate the laser pulse backwards by one Rayeligh length. | ||
z_R = 3.14159*spot_size**2/wavelength # The Rayleigh length. | ||
laser.propagate(-z_R) | ||
.. code-block:: python | ||
:caption: Output the result to file. Here we utilise the openPMD standard. | ||
file_prefix = 'test_output' # The file name will start with this prefix | ||
file_format = 'h5' # Format to be used for the output file | ||
write_to_openpmd_file(dimensions, file_prefix, file_format, laser.field, wavelength, polarization) | ||
This file may now be viewed, copied, shared or used as an input to a variety of other simulation tools. |
This file was deleted.
Oops, something went wrong.
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