Skip to content

Commit

Permalink
Added additional comments about the fact that averaged over orientati…
Browse files Browse the repository at this point in the history
…on cross sections are calculated for unpolarized incident light (and hence are independent on the alpha range). A number of minor syntax changes.
  • Loading branch information
myurkin committed Mar 27, 2013
1 parent ea85c73 commit 3a95305
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
3 changes: 2 additions & 1 deletion input/avg_params.dat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

alpha:
# calculation for alpha is cheap but only precalculated, therefore Jmax should be rather large.
# Jmin and eps are really not used;
# Jmin and eps are really not used.
# Completely irrelevant, when only cross sections are calculated ('-scat_matr none').
# Do not change the range from default unless you have a good reason; using only one value of gamma for beta=0,pi is
# done only when full range is specified here to avoid possible inaccuracies.
# default: min=0;max=360;Jmax=5;equiv=true;periodic=true
Expand Down
4 changes: 4 additions & 0 deletions src/CalculateE.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ static void CalcIntegralScatQuantities(const enum incpol which)
muel_alpha[-1]=Cabs;
}
else { // which == INCPOL_X
/* These formulae assume that cross sections need to be calculated for unpolarized incident light. It
* doesn't matter (equal to the result for any linear polarization), when full averaging over alpha is
* performed. However, the difference occur for non-full range of alpha (which is hardly ever used).
*/
muel_alpha[-2]=(muel_alpha[-2]+Cext)/2;
muel_alpha[-1]=(muel_alpha[-1]+Cabs)/2;
}
Expand Down
32 changes: 16 additions & 16 deletions src/iterative.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,22 +976,22 @@ ITER_FUNC(_name_) // only '_name_' should be changed, the macro expansion will d
// an example for checking of convergence failure (optional)
if (xxx<EPS1) LogError(ONE_POS,"_name_ fails: xxx is too small ("GFORM_DEBUG").",xxx);

/* _Some_ iterative solvers contain extra checks for convergence in the _middle_ of an iteration, designed to
* save time of, e.g., one matrix-vector product in some cases. They should be performed as follows. In
* particular, the intermediate test will be skipped if final checkpoint is required (checkpoint of type
* 'always').
*/
if (inprodRp1<epsB && chp_type!=CHP_ALWAYS) {
// Additional code, e.g. to set xvec to the final value
complete=false; // this is required to skip saving checkpoint and some timing
}
else {
// Continue the iteration normally
}
/* Common check for convergence at the end of an iteration should not be done here, because it is performed in
* the function IterativeSolver.
*/
return;
/* _Some_ iterative solvers contain extra checks for convergence in the _middle_ of an iteration, designed
* to save time of, e.g., one matrix-vector product in some cases. They should be performed as follows. In
* particular, the intermediate test will be skipped if final checkpoint is required (checkpoint of type
* 'always').
*/
if (inprodRp1<epsB && chp_type!=CHP_ALWAYS) {
// Additional code, e.g. to set xvec to the final value
complete=false; // this is required to skip saving checkpoint and some timing
}
else {
// Continue the iteration normally
}
/* Common check for convergence at the end of an iteration should not be done here, because it is performed in
* the function IterativeSolver.
*/
return;
}
LogError(ONE_POS,"Unknown phase (%d) of the iterative solver",(int)ph);
#undef EPS1
Expand Down
2 changes: 1 addition & 1 deletion src/ocl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ else # the following is only for non-sparse mode
# "...libclAmdFft.Runtime.so: undefined reference to `clRetainContext@OPENCL_1.0'"
# This is caused by Nvidia OpenCL libraries on Linux (hopefully it will disappear in next releases of this library)
# The drawback of this workaround is that a warning would appear at each execution of adda_ocl. If you don't like
# it, provide another libOpenCL.so (e.g. that from AMD) for linkig.
# it, provide another libOpenCL.so (e.g. that from AMD) for linking.
#LDFLAGS +=-Wl,--unresolved-symbols=ignore-in-shared-libs
endif
endif
Expand Down

0 comments on commit 3a95305

Please sign in to comment.