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

Fix #413: limit vacuum step size in magnetic field #415

Merged
merged 1 commit into from Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion HEN_HOUSE/src/egsnrc.mortran
Expand Up @@ -1111,6 +1111,10 @@ $start_new_particle;
" direction of motion at the start of the step
" Note that tustep and ustep are modified below.
" The above provide defaults.)

" EM field step size restriction in vacuum
$SET-TUSTEP-EM-FIELD;
ustep = tustep;
]
ELSE
[
Expand Down Expand Up @@ -1383,7 +1387,7 @@ $start_new_particle;
"(allows for EM field deflection
] "end of vacuum step

$electron_region_change;
IF(irnew ~= irold) [ $electron_region_change; ];

IF(ustep ~= 0) [$AUSCALL($TRANAUSA);]
IF(eie <= ecut(irl)) [go to :ECUT-DISCARD:;]
Expand Down
10 changes: 1 addition & 9 deletions HEN_HOUSE/src/emf_macros.mortran
Expand Up @@ -88,7 +88,7 @@ APPEND {;
ufx,ufy,ufz,
bdotub,bsqrd,
ufxpar,ufypar,ufzpar,
ufxprp,ufyprp,ufzprp,ustepold;
ufxprp,ufyprp,ufzprp;
} TO {$DEFINE-LOCAL-VARIABLES-ELECTR;};


Expand Down Expand Up @@ -291,14 +291,6 @@ IF(MEDIUM.EQ.0)[
"$SET-TVSTEP-EM-FIELD;--this is for higher order corrections"
"do first order corrections for now--BW"
IF(ExIN~=0.0 | EyIN~=0.0 | EzIN~=0.0 | BxIN~=0.0 | ByIN~=0.0 | BzIN~=0)[
USTEPOLD=USTEP;
IF(USTEP>smaxir(irl)) USTEP=smaxir(irl);
TUSTEP=USTEP;
$SET-TUSTEP-EM-FIELD;
TVSTEP=TUSTEP;
VSTEP=TVSTEP;
USTEP=VSTEP;
IF(USTEP<USTEPOLD) irnew=irl;
DE=0.0;
$ADD-WORK-EM-FIELD;
PEIE=PEIE-DE;EIE=PEIE;E(NP)=PEIE;
Expand Down