-
Notifications
You must be signed in to change notification settings - Fork 18
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
Enable to initialize spatial/temporal/angular chirped laser + CI test with LASY #1196
Open
huixingjian
wants to merge
58
commits into
Hi-PACE:development
Choose a base branch
from
huixingjian:Sf_fix
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
96fe270
upadte STCs
huixingjian 62c6604
Update MultiLaser.cpp
huixingjian 0fb9374
add lasy in diag
huixingjian 9d0d44f
Merge branch 'Sf_fix' of https://github.com/huixingjian/hipace- into …
huixingjian 1df8536
fix typo on file name
huixingjian ab8b073
update prefix for CI test
huixingjian 381c83b
fix import error
huixingjian c166f00
fix typo in CI test
huixingjian 23ef523
prefix error
huixingjian 1ee09b6
remove space in bash
huixingjian 5b0ba61
fix prefix problem
huixingjian 75d10b2
lasy diag
huixingjian 1eea2ca
add assert in CI py
huixingjian 3301e65
make the test identical to CI in lasy
huixingjian 7b00b2f
phi2 check pass, now check zeta
huixingjian 4543b97
add focal length
huixingjian 13218b4
add resolution
huixingjian c8476ad
zeta is wrong, try beta first
huixingjian 3fa8fa1
beta is pass, set beta and phi2 toether
huixingjian d0cdc6e
initialise zeta but no test, see if beta is distorted
huixingjian adcfa5f
phi2 and beta passed, now add in zeta and change the resolution in lasy
huixingjian 009f9b9
zeta is only problem. try smaller zeta
huixingjian a0c4edd
try negative zeta
huixingjian 6966582
change polarization
huixingjian c0bdb0e
bigger zeta
huixingjian 1c54561
try bigger zeta
huixingjian e1f601c
even bigger zeta
huixingjian 615f7c8
use really high reso on y
huixingjian d488669
use bigger zeta
huixingjian 1a2da1a
change it back, use high a0
huixingjian 02534ab
use a lasy branch with check lines of zero weights
huixingjian 2643a40
intsall lasy in NVCC
huixingjian 0a889c8
Update cudaLocal.yml
huixingjian 1bc02f2
formular
huixingjian f5b8dbf
Update ubuntu.sh
huixingjian 91f0be3
Update ubuntu_ompi.sh
huixingjian 6edcf83
Update analysis_laser_STC.py
huixingjian 77f23df
Update cudaLocal.yml
huixingjian 65b80d3
Update ubuntu.sh
huixingjian 46fae3e
Update ubuntu.sh
huixingjian b27ff0c
Update ubuntu_ompi.sh
huixingjian 4e1f816
Update examples/laser_STC/analysis_laser_STC.py
huixingjian 919bdb4
Update Laser.cpp
huixingjian 1167813
Update Laser.cpp
huixingjian 8deaae1
Update inputs_STC
huixingjian 1fc9b6a
Update analysis_laser_STC.py
huixingjian ece4062
Update analysis_laser_STC.py
huixingjian 1a9f2c1
Update analysis_laser_STC.py
huixingjian 6923c8a
Update analysis_laser_STC.py
huixingjian 199bf6c
Update inputs_STC
huixingjian 3670791
Update analysis_laser_STC.py
huixingjian f3674be
Update inputs_STC
huixingjian 7741e2a
Update inputs_STC
huixingjian c9eb919
Update cudaLocal.yml
huixingjian f871874
Update cudaLocal.yml
huixingjian e2471e0
Update inputs_STC
huixingjian 169b162
Update analysis_laser_STC.py
huixingjian 2d09d5b
Update analysis_laser_STC.py
huixingjian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,47 @@ | ||
#! /usr/bin/env python3 | ||
|
||
# Copyright 2025 | ||
# | ||
# This file is part of HiPACE++. | ||
# | ||
# Authors: Xingjian Hui | ||
# License: BSD-3-Clause-LBNL | ||
|
||
import argparse | ||
import numpy as np | ||
import scipy.constants as scc | ||
from lasy.utils.laser_utils import get_phi2, get_zeta, get_beta, get_duration | ||
from lasy.laser import Laser | ||
from lasy.profiles import FromOpenPMDProfile | ||
|
||
lambda0 = .6e-6 # Laser wavelength | ||
k0 = 2 * scc.pi / lambda0 | ||
|
||
parser = argparse.ArgumentParser(description='Compare laser propagation in vacuum with theory') | ||
parser.add_argument('--output-dir', | ||
dest='output_dir', | ||
default='diags/hdf5', | ||
help='Path to the directory containing output files') | ||
args = parser.parse_args() | ||
|
||
profile = FromOpenPMDProfile (path = args.output_dir, iteration = 0, pol=[1,0], field='laserEnvelope'\ | ||
,coord='', is_envelope=True, prefix='openpmd') | ||
laser = Laser( | ||
dim="xyt", | ||
lo=(-10e-6, -10e-6, -10e-14), | ||
hi=(10e-6, 10e-6, +10e-14), | ||
npoints=(127, 127, 400), | ||
profile=profile, | ||
) | ||
|
||
Phi2,phi2 = get_phi2(laser.dim, laser.grid) | ||
tau = get_duration(laser.grid, laser.dim) | ||
[beta_x, beta_y] = get_beta(laser.dim, laser.grid, k0) | ||
[zeta_x, zeta_y], [nu_x, nu_y] = get_zeta(laser.dim, laser.grid, k0) | ||
print("tau is ",tau) | ||
print("phi2 theory:", 2.4e-24, "measured:", phi2) | ||
print("zeta_y theory:", 2.4e-22, "measured:", zeta_y) | ||
print("beta_y theory:", 3e-18, "measured:", beta_y) | ||
assert (np.abs((phi2-2.4e-24)/2.4e-24)<0.01), 'Test phi2 did not pass' | ||
assert (np.abs((zeta_y-2.4e-22)/2.4e-22)<0.01), 'Test zeta did not pass' | ||
assert (np.abs((beta_y-3e-18)/3e-18)<0.01), 'Test beta did not pass' |
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,27 @@ | ||
max_step = 1 | ||
amr.n_cell = 127 127 400 | ||
|
||
hipace.verbose = 1 | ||
hipace.dt = 1e-13 | ||
diagnostic.output_period = 1 | ||
|
||
amr.max_level = 0 | ||
boundary.field = Dirichlet | ||
boundary.particle = Absorbing | ||
geometry.prob_lo = -10e-6 -10e-6 -15e-6 | ||
geometry.prob_hi = 10e-6 10e-6 15e-6 | ||
|
||
lasers.names = laser | ||
lasers.lambda0 = 600e-9 | ||
lasers.solver_type = fft | ||
laser.a0 = 10 | ||
laser.position_mean = 0. 0. 0 | ||
laser.w0 = 5e-6 | ||
laser.L0 = 15e-6 | ||
laser.focal_distance = 0 | ||
laser.phi2 = 2.4e-25 | ||
#laser.beta = 3e-18 | ||
#laser.zeta = 2.4e-22 | ||
laser.STC_theta_xy = 3.14150265358/2 | ||
diagnostic.field_data = laserEnvelope | ||
diagnostic.diag_type = xyz |
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
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,29 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# This file is part of HiPACE++. | ||
# | ||
# Authors: Xingjian Hui | ||
# This file is part of the HiPACE++ test suite. | ||
# It tests the STC initialisation with LASY functions. | ||
|
||
# abort on first encounted error | ||
set -eu -o pipefail | ||
|
||
# Read input parameters | ||
HIPACE_EXECUTABLE=$1 | ||
HIPACE_SOURCE_DIR=$2 | ||
HIPACE_COMPUTE=$3 | ||
|
||
HIPACE_EXAMPLE_DIR=${HIPACE_SOURCE_DIR}/examples/laser_STC | ||
HIPACE_TEST_DIR=${HIPACE_SOURCE_DIR}/tests | ||
|
||
FILE_NAME=`basename "$0"` | ||
TEST_NAME="${FILE_NAME%.*}" | ||
|
||
rm -rf $TEST_NAME | ||
|
||
# Run the simulation | ||
mpiexec -n 1 $HIPACE_EXECUTABLE $HIPACE_EXAMPLE_DIR/inputs_STC \ | ||
hipace.file_prefix = $TEST_NAME | ||
# Compare the result with theory | ||
$HIPACE_EXAMPLE_DIR/analysis_laser_STC.py --output-dir=$TEST_NAME |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was duplicated by error.