Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
beck-llr committed Mar 11, 2022
2 parents 0ce3895 + 3bc318d commit 587c1e1
Show file tree
Hide file tree
Showing 51 changed files with 11,136 additions and 180 deletions.
82 changes: 41 additions & 41 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ install:
stage: install
only:
- develop
- develop-mat
- mergingPML

script:
# Force workdir cleaning in case of retried
- echo "CI_PIPELINE_ID = " $CI_PIPELINE_ID
- env
- if [ -d /sps/gitlab-runner/$CI_PIPELINE_ID ] ; then rm -rf /sps/gitlab-runner/$CI_PIPELINE_ID ; fi
- if [ -d /sps3/gitlab-runner/$CI_PIPELINE_ID ] ; then rm -rf /sps/gitlab-runner/$CI_PIPELINE_ID ; fi
# Move in test dir
- mkdir -p /sps/gitlab-runner/$CI_PIPELINE_ID
- cp -r $CI_PROJECT_DIR /sps/gitlab-runner/$CI_PIPELINE_ID
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei
- mkdir -p /sps3/gitlab-runner/$CI_PIPELINE_ID
- cp -r $CI_PROJECT_DIR /sps3/gitlab-runner/$CI_PIPELINE_ID
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei
# Set the environment
- make uninstall_happi
- make happi
Expand All @@ -31,134 +31,134 @@ compile_default:
stage: compile_default
only:
- develop
- develop-mat
- mergingPML

script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run validation script
- python validation.py -c -v -l "/sps/gitlab-runner/logs" -t "00:30:00"
- python validation.py -c -v -l "/sps3/gitlab-runner/logs" -t "00:30:00"

run1D:
stage: run_default
only:
- develop
- develop-mat
- mergingPML

script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run validation script
- python validation.py -b "tst1d_*_*.py" -m 2 -o 12 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_1d*.py" -m 2 -o 12 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst1d_*_*.py" -m 2 -o 12 -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_1d*.py" -m 2 -o 12 -v -r 1 -l "/sps3/gitlab-runner/logs"

run2D:
stage: run_default
only:
- develop
- develop-mat
- mergingPML


script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run validation script
- python validation.py -b "tst2d_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst2d_s_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst2d_v_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_2d*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst2d_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst2d_s_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst2d_v_??_*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_2d*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"

run3D:
stage: run_default
only:
- develop
- develop-mat
- mergingPML

script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run validation script
- python validation.py -b "tst3d_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst3d_s_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst3d_v_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst3d_a_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_3d*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst3d_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst3d_s_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst3d_v_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst3d_a_??_*.py" -m 8 -o 12 --resource-file resources.json -v -r 1 -l "/sps3/gitlab-runner/logs"
- python validation.py -b "tst_ionization_current_3d*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"

runAM:
stage: run_default
only:
- develop
- develop-mat
- mergingPML

script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run validation script
- python validation.py -b "tstAM_??_*.py" -m 8 -o 12 -v -t 00:30:00 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tstAM_??_*.py" -m 8 -o 12 -v -t 00:30:00 -l "/sps3/gitlab-runner/logs"

runCollisions:
stage: run_default
only:
- develop
- develop-mat
- mergingPML

script:
# Move in test dir
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
# Run checking script
- python validation.py -b "tst_collisions*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps/gitlab-runner/logs"
- python validation.py -b "tst_collisions*.py" -m 4 -o 4 -n 1 -v -r 1 -l "/sps3/gitlab-runner/logs"

compile_picsar:
stage: compile_picsar
only:
- develop
- develop-mat
- mergingPML

script:
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei
- make clean
- python validation/validation.py -k picsar -c -v

run_picsar:
stage: run_picsar
only:
- develop
- develop-mat
- mergingPML

script:
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei/validation
- python validation.py -k picsar -b "tstAM_picsar_04_laser_wake.py" -m 4 -o 4 -n 1 -v

compile_debug:
stage: compile_debug
only:
- develop
- develop-mat
- mergingPML

script:
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei
- make clean
- python validation/validation.py -k debug -c -v

compile_no_mpi_threadmultiple:
stage: compile_no_mpi_threadmultiple
only:
- develop
- develop-mat
- mergingPML

script:
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei
- make clean
- python validation/validation.py -k no_mpi_tm -c -v

compile_no_openmp:
stage: compile_no_openmp
only:
- develop
- develop-mat
- mergingPML


script:
- cd /sps/gitlab-runner/$CI_PIPELINE_ID/smilei
- cd /sps3/gitlab-runner/$CI_PIPELINE_ID/smilei
- make clean
- python validation/validation.py -k noopenmp -c -v
46 changes: 46 additions & 0 deletions benchmarks/tst2d_18_em_pml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ----------------------------------------------------------------------------------------
# SIMULATION PARAMETERS FOR THE PIC-CODE SMILEI
# ----------------------------------------------------------------------------------------

import numpy as np

l0 = 2.*np.pi # laser wavelength
t0 = l0 # optical cycle
Lsim = [20.*l0,20.*l0] # length of the simulation
Tsim = 30.*t0 # duration of the simulation
resx = 8. # nb of cells in on laser wavelength
rest = 1.1*np.sqrt(2)*resx # time of timestep in one optical cycle

Main(
geometry = "2Dcartesian",
maxwell_solver = "Yee",
interpolation_order = 2 ,
cell_length = [l0/resx,l0/resx],
grid_length = Lsim,
number_of_patches = [ 16, 16 ],
timestep = t0/rest,
simulation_time = Tsim,
EM_boundary_conditions = [
['PML','PML'],
['PML','PML'],
],
number_of_pml_cells = [[10,10],[10,10]],
random_seed = smilei_mpi_rank
)

Antenna(
field='Jz',
time_profile = lambda t: np.sin(2.*np.pi*t/t0)*np.sin(2.*np.pi*t/(4*t0))*(1.-np.heaviside(t-2*t0, 1)),
space_profile=gaussian(1., xfwhm=l0, yfwhm=l0, xcenter=Main.grid_length[0]*0.5, ycenter=Main.grid_length[1]*0.5)
)

globalEvery=1.

DiagScalar(
every=globalEvery,
vars=['Uelm']
)

DiagFields(
every = 100,
fields = ['Ez'])
Binary file modified doc/Sphinx/_static/Coordinate_Reference_AMcylindrical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions doc/Sphinx/namelist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ The block ``Main`` is **mandatory** and has the following syntax::
Boundary conditions must be set to ``"remove"`` for particles,
``"silver-muller"`` for longitudinal EM boundaries and
``"buneman"`` for transverse EM boundaries.
Vectorization, collisions, scalar diagnostics and
You can alternatively use ``"PML"`` for all boundaries.
Vectorization, collisions and
order-4 interpolation are not supported yet.

.. py:data:: interpolation_order
Expand Down Expand Up @@ -272,7 +273,7 @@ The block ``Main`` is **mandatory** and has the following syntax::
:default: ``[["periodic"]]``

The boundary conditions for the electromagnetic fields. Each boundary may have one of
the following conditions: ``"periodic"``, ``"silver-muller"``, ``"reflective"`` or ``"ramp??"``.
the following conditions: ``"periodic"``, ``"silver-muller"``, ``"reflective"``, ``"ramp??"`` or ``"PML"``.

| **Syntax 1:** ``[[bc_all]]``, identical for all boundaries.
| **Syntax 2:** ``[[bc_X], [bc_Y], ...]``, different depending on x, y or z.
Expand All @@ -294,6 +295,14 @@ The block ``Main`` is **mandatory** and has the following syntax::
Over the first half, the fields remain untouched.
Over the second half, all fields are progressively reduced down to zero.

* ``"PML"`` stands for Perfectly Matched Layer. It is an open boundary condition.
The number of cells in the layer is defined by ``"number_of_pml_cells"``.
It supports laser injection as in ``"silver-muller"``.

.. warning::

In the current release, in order to use PML all ``"EM_boundary_conditions"`` of the simulation must be ``"PML"``.

.. py:data:: EM_boundary_conditions_k
:type: list of lists of floats
Expand All @@ -311,6 +320,13 @@ The block ``Main`` is **mandatory** and has the following syntax::
| **Syntax 1:** ``[[1,0,0]]``, identical for all boundaries.
| **Syntax 2:** ``[[1,0,0],[-1,0,0], ...]``, different on each boundary.
.. py:data:: number_of_pml_cells
:type: list of lists of integer
:default: ``[[6,6],[6,6],[6,6]]``

Defines the number of cells in the ``"PML"`` layers using the same alternative syntaxes as ``"EM_boundary_conditions"``.

.. py:data:: time_fields_frozen
:default: 0.
Expand Down Expand Up @@ -2272,7 +2288,7 @@ This is done by including the block ``DiagScalar``::

.. warning::

Scalars diagnostics are not yet supported in ``"AMcylindrical"`` geometry.
Scalars diagnostics min/max cell are not yet supported in ``"AMcylindrical"`` geometry.

The full list of available scalars is given in the table below.

Expand Down
4 changes: 2 additions & 2 deletions doc/Sphinx/post-processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ and only one mode between those three.

* ``hindex`` : the starting index of each proc in the hilbert curve
* ``number_of_cells`` : the number of cells in each proc
* ``number_of_particles`` : the number of particles in each proc (except frozen ones)
* ``number_of_particles`` : the total number of non-frozen macro-particles in each proc (includes all species)
* ``number_of_frozen_particles`` : the number of frozen particles in each proc
* ``total_load`` : the `load` of each proc (number of particles and cells with cell_load coefficient)
* ``total_load`` : the `load` of each proc (number of macro-particles and cells weighted by cell_load coefficients)
* ``timer_global`` : global simulation time (only available for proc 0)
* ``timer_particles`` : time spent computing particles by each proc
* ``timer_maxwell`` : time spent solving maxwell by each proc
Expand Down
3 changes: 2 additions & 1 deletion doc/Sphinx/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Get Smilei
Changes made in the repository (not released)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* ``Perfectly Matched Layers`` boundary conditions for EM fields are available. Documentation is updated and a 2D Cartesian benchmark is provided.
* Improved performance for ARM-based processors including the Fujitsu A64FX
* Improved performance for GNU, LLVM, arm-clang and Fujitsu compilers on all types of architectures
* Lasers can be injected from all boundaries
Expand Down Expand Up @@ -75,7 +76,7 @@ Projects

* More spectral solvers
* GPU support
* Perfectly-matched layers
* Perfectly-matched layers for the envelope model

----

Expand Down
2 changes: 2 additions & 0 deletions src/ElectroMagn/ElectroMagn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ void ElectroMagn::boundaryConditions( int itime, double time_dual, Patch *patch,
if( emBoundCond.size()>2 ) {
if( emBoundCond[2]!=NULL ) { // <=> if !periodic
emBoundCond[2]->apply( this, time_dual, patch );
}
if( emBoundCond[3]!=NULL ) { // <=> if !periodic
emBoundCond[3]->apply( this, time_dual, patch );
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/ElectroMagnBC/ElectroMagnBC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ ElectroMagnBC::ElectroMagnBC( Params &params, Patch *patch, unsigned int i_bound
d[i] = params.cell_length[i];
dt_ov_d[i] = dt / d[i];
}

pml_solver_ = NULL;
}

// Destructor for ElectromagnBC
Expand Down
15 changes: 15 additions & 0 deletions src/ElectroMagnBC/ElectroMagnBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Patch;
class ElectroMagn;
class Laser;
class Field;
class Solver;

class ElectroMagnBC
{
Expand All @@ -28,6 +29,19 @@ class ElectroMagnBC

//! Vector for the various lasers
std::vector<Laser *> vecLaser;

virtual Field* getExPML() { ERROR("Not using PML");return NULL;}
virtual Field* getEyPML() { ERROR("Not using PML");return NULL;}
virtual Field* getEzPML() { ERROR("Not using PML");return NULL;}
virtual Field* getBxPML() { ERROR("Not using PML");return NULL;}
virtual Field* getByPML() { ERROR("Not using PML");return NULL;}
virtual Field* getBzPML() { ERROR("Not using PML");return NULL;}
virtual Field* getDxPML() { ERROR("Not using PML");return NULL;}
virtual Field* getDyPML() { ERROR("Not using PML");return NULL;}
virtual Field* getDzPML() { ERROR("Not using PML");return NULL;}
virtual Field* getHxPML() { ERROR("Not using PML");return NULL;}
virtual Field* getHyPML() { ERROR("Not using PML");return NULL;}
virtual Field* getHzPML() { ERROR("Not using PML");return NULL;}

protected:

Expand All @@ -48,6 +62,7 @@ class ElectroMagnBC

//! Ratio of the time-step by the spatial-step
std::vector<double> dt_ov_d;
Solver* pml_solver_;
};

#endif
Expand Down
Loading

0 comments on commit 587c1e1

Please sign in to comment.