forked from adda-team/adda
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 443f00a Author: Maxim Yurkin <yurkin@gmail.com> Date: Tue Mar 29 13:34:30 2022 +0700 Minor changes in figure spacing commit 581bec6 Author: stefaniagl <stefgluhova@gmail.com> Date: Tue Mar 29 00:03:24 2022 +0700 Bessel 0 (adda-team#315) Tests and examples for Bessel beams: - test using equivalent command line strings `tests/equiv/bb_equiv.py` - simple examples `examples/bessel` - scripts to reproduce 4 figures in a recent paper (submitted) Fixes a bug in TML type of Bessel beams. commit d7e6169 Author: Maxim Yurkin <yurkin@gmail.com> Date: Mon Feb 21 23:35:49 2022 +0700 Makes the test for inconsistencies in the input shape format more sensitive. Detects extra number present in a line for ADDA formats (both single- and multi-domain). The formats themselves are now defines instead of static strings. commit 887a63c Author: Maxim Yurkin <yurkin@gmail.com> Date: Mon Feb 21 14:48:46 2022 +0700 - All math constants are now given to 35 significant digits (was 32 in most places) - This includes the LDR constants (for which a separate calculation procedure was performed) - Improves a few related comments commit a993a91 Author: Maxim Yurkin <yurkin@gmail.com> Date: Tue Feb 15 10:21:53 2022 +0700 - renames find_adda.sh into find_adda (and sets executable flag) - this script now returns ADDA path to stdout, hence does not need to be sourced (was a bad idea due to potential variables collision) - updates all calling scripts commit c8ea4ed Author: Maxim Yurkin <yurkin@gmail.com> Date: Mon Jan 31 14:52:02 2022 +0700 minor formatting changes commit a6be5f4 Author: Maxim Yurkin <yurkin@gmail.com> Date: Mon Jan 31 14:31:10 2022 +0700 - adds a special script to locate ADDA binaries (to be used by various examples). - updates existing examples in `examples/papers/2021_WKBr/` and `misc/near_field/` accordingly - other minor changes to `examples/papers/2021_WKBr/calc.sh` commit 2896575 Author: inzhevatkin <51568160+inzhevatkin@users.noreply.github.com> Date: Sun Jan 30 11:40:56 2022 +0700 WKBr scripts (adda-team#311) * Adds scripts to reproduce Figs.15 and 16 from paper (Inzhevatkin & Yurkin, 2022) * Includes general-purpose scripts to generate internal field in a sphere in the framework of the WKBr approximation (two modifications). * Also includes interface with Mie-theory calculations. Co-authored-by: Maxim Yurkin <yurkin@gmail.com> commit 6c0b401 Merge: 49e6c23 deebdbf Author: Maxim Yurkin <yurkin@gmail.com> Date: Tue Jan 11 19:11:38 2022 +0700 Merge branch 'master' of github.com:adda-team/adda commit 49e6c23 Author: Maxim Yurkin <yurkin@gmail.com> Date: Tue Jan 11 19:09:51 2022 +0700 Updates extracting of gcc version in Makefile to be compatible with all possible configurations of gcc. commit deebdbf Author: stefaniagl <stefgluhova@gmail.com> Date: Fri Jan 7 17:44:39 2022 +0700 Changes in tests (adda-team#310) - updates ignores in `comp2exec` so that all tests pass (after recent adda-team#304) - adds -beam_center to various lines in test suites * Corrections in `GenerateB.c`: - removes redundant EOL in multi-line beam descriptions - fixes incorrect calculation of incident plane wave for grazing incidence in surface mode (when prop_z is on the order of 1e-16). For that the code was completely rewritten to specifically calculate potentially small quantities (e.g., expm1 instead of exp and rcp1=rc+1 instead of rc). - removes duplicate initialization of `prIncRefl` - mentions `vorticity` in instructions for adding new beam - in several places (when accounting for `beam_center`) `LinComb()` was replaced by `vSubtr()`. * Other changes: - adds functions `imExpM1()` and `cExpM1()` to `cmplx.h` - definitions of `prIncRelf` and `prIncTran` are now semi-global (only in `GenerateB.c` and `param.c`) - updates copyright year in `param.c` Co-authored-by: Maxim Yurkin <yurkin@gmail.com> commit 6a9ec2e Author: Maxim Yurkin <yurkin@gmail.com> Date: Mon Jan 3 00:02:33 2022 +0700 adds ignoring of errors when getting commit hash (i.e. when compiling from downloaded source code, not from git repository)
- Loading branch information
1 parent
62be280
commit 753f790
Showing
58 changed files
with
2,851 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Various examples of using ADDA. Mostly these are tutorial examples, which illustrate certain features of ADDA and should not consume too much computational time. The only exception is subfolder `papers/`, which additionally aims to reproduce specific published simulations (thus, may require a large cluster). All examples are designed to be run out of the box assuming that compiled binaries are available (either by default compilation or pre-compiled for Windows). Some only run ADDA with proper command lines, others - also plot or post-process the obtained results. See further details inside corresponding folders: | ||
* `bessel/` – examples involving excitation by Bessel beams (will be added after #209) | ||
* `bessel/` – examples involving excitation by Bessel beams | ||
* `eels/` – examples involving excitation by a fast electron (will be added after #155) | ||
* `papers/` – examples reproducing published results | ||
* `find_adda.sh` - common script to locate ADDA binaries and set corresponding environmenal variables |
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,2 @@ | ||
/option*/ | ||
/saved/ |
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,2 +1,6 @@ | ||
This python code "bb_examples" represents the comparison of scattering intensities calculated with DDA (ADDA code) | ||
for the scattering of Bessel beam of 2 options by choice (option_1 and option_2). | ||
The python code `bb_examples.py` performs the comparison of scattering intensities calculated with ADDA for two different Bessel beams. By default, they are LE and LM beams of order 2 scattered by a wavelength-sized sphere, but it can be easily modified inside the script. | ||
|
||
Other folders (produced by the script): | ||
* `option_1/` - contains raw ADDA results (log file, mueller matrix, incident field, and cross sections by default) for the 1st command line option | ||
* `option_2/` - the same for the 2nd option | ||
* `saved/` - final figures in PDF format |
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,56 @@ | ||
#!/bin/bash | ||
# Copyright (C) ADDA contributors | ||
# GNU General Public License version 3 | ||
|
||
# Finds adda binary and returns its path to stdout. If the variable ADDA_SEQ, ADDA_MPI, or ADDA_OCL is already defined, | ||
# returns its value, but first tests that the file exist. Otherwise, first checks if the binary is directly available | ||
# (on the PATH), then looks at the corresponding compilation folder, and finally (on Windows only) looks for precompiled | ||
# binary in win64/ | ||
|
||
# A single optional argument is the mode (seq, mpi, or ocl), which binary to search. 'seq' is the default one. | ||
# The script must not be moved from this folder (searches for a few places relative to its position), | ||
# but can be executed from anywhere. | ||
|
||
# The minimal test example is the following (note the test for exit value) | ||
#ADDA_SEQ=$(./find_adda) | ||
#if [ $? -ne 0 ]; then | ||
# exit 1 | ||
#fi | ||
|
||
mode=${1:-seq} | ||
|
||
# We do not add .exe for Windows, since all Bash interpreters for Windows seem to work fine without it | ||
if [ $mode == "seq" ]; then | ||
var=ADDA_SEQ | ||
bin=adda | ||
elif [ $mode == "mpi" ]; then | ||
var=ADDA_MPI | ||
bin=adda_mpi | ||
elif [ $mode == "ocl" ]; then | ||
var=ADDA_OCL | ||
bin=adda_ocl | ||
else | ||
echo "ERROR: unkwnown mode '$mode'" >&2 | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${!var}" ]; then | ||
# Locates root path for ADDA (relative to script's location), https://stackoverflow.com/a/246128/2633728 | ||
top=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../" &> /dev/null && pwd) | ||
if command -v $bin &> /dev/null; then | ||
path="$bin" | ||
elif [ -f "$top/src/$mode/$bin" ]; then | ||
path="$top/src/$mode/$bin" | ||
elif [[ ("$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" || "$OSTYPE" == "win64" ) && -f "$top/win64/$bin" ]]; then | ||
path="$top/win64/$bin" | ||
else | ||
echo "ERROR: No $bin binary found (and variable $var is not defined)" >&2 | ||
exit 1 | ||
fi | ||
elif [ ! -f "${!var}" ]; then | ||
echo "ERROR: No $bin binary found (path given by $var='${!var}' does not exist)" >&2 | ||
exit 1 | ||
else | ||
path="${!var}" | ||
fi | ||
echo "$path" |
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,5 @@ | ||
/*/__pycache__ | ||
/*/*.dat | ||
/Mie_solution/work/* | ||
/run* | ||
/ExpCount |
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,8 @@ | ||
The script `exact-script.sh` calculates the exact internal electric field using either [`Bhfield`](https://scattport.org/index.php/light-scattering-software/mie-type-codes/list/521-bhfield) or [`Scattnlay`](https://github.com/ovidiopr/scattnlay) (to be obtained separately). The `toADDA.py` script changes Bhfield / Scattnlay grid so that it matches the ADDA one. | ||
|
||
After setting the required parameters and paths to scripts, execute: | ||
``` | ||
sh exact-script.sh | ||
python toADDA.py | ||
``` | ||
The scripts can also accept parameters through the command line - see the comments inside. |
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,34 @@ | ||
#!/bin/bash | ||
# The script calculates the exact internal electric field using either Bhfield or Scattnlay. | ||
# You need to obtain the required executables (Bhfield or Scattnlay) separately and specify the path to the corresponding | ||
# executables below (or copy them in work/ subfolder) | ||
|
||
# SET YOUR PARAMETERS (either here or in command line): | ||
size=${1:-10} | ||
m=${2:-1.1} | ||
grid=${3:-16} | ||
type=${4:-scattnlay} # program type: [bhfield, scattnlay] | ||
|
||
# SET YOUR PATHS: | ||
# Path to the working folder (for temporary files, only for bhfield) and for placing output (both must exist) | ||
workpath="$(pwd)/work" | ||
outpath="$(pwd)" | ||
# Executables (with full path) to be used for actual computation | ||
BHFIELD="$workpath/bhfield-std" | ||
# The name of the executable can also be fieldnlay or fieldnlay-mp, depending on installation. | ||
# We tested on the Scattnlay version dated June 7, 2021. | ||
FIELDNLAY="$workpath/fieldnlay-dp" | ||
|
||
# Calculating the required variables: | ||
# simple workaround for float computations using awk | ||
calc() { awk "BEGIN{print $*}"; } | ||
radius=$(calc $size/2) | ||
rb=$(calc $radius - $radius/$grid) | ||
lb=-$rb; | ||
if [ "$type" == "bhfield" ]; then | ||
cd $workpath | ||
"$BHFIELD" 6.28318530718 $radius $radius $grid $lb $rb $grid $lb $rb $grid $lb $rb other 0 1 $m 0 $m 0 | ||
cp V_0Ereim.dat "$outpath/bhfield-$size-$m-$grid.dat" | ||
elif [ "$type" == "scattnlay" ]; then | ||
"$FIELDNLAY" -l 1 $radius $m 0 -p $lb $rb $grid $lb $rb $grid $lb $rb $grid > "$outpath/scattnlay-$size-$m-$grid.dat" | ||
fi |
Oops, something went wrong.