Skip to content

Commit

Permalink
KEMField: Throw error in case of invalid nmax
Browse files Browse the repository at this point in the history
Not allowing nmax <= 1 and recommending nmax=500 was suggested by Ferenc.

Fix previous commit

Fix previous commits
  • Loading branch information
2xB authored and richeldichel committed Jun 7, 2024
1 parent 07553ad commit eee1f79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ target_link_libraries (KEMMagfieldCoils
# KEMCore
# KEMMath
# KEMFieldSolverCore
KEMFieldExceptions
)

kasper_install_headers (${MAGFIELDCOILS_HEADERFILES})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "MagfieldCoils.h"
#include "KEMSimpleException.hh"


MagfieldCoils::MagfieldCoils(string inputdirname, string inputobjectname, string inputcoilfilename, int inputNelliptic,
Expand All @@ -14,6 +15,9 @@ MagfieldCoils::MagfieldCoils(string inputdirname, string inputobjectname, string
fcoilfilename = inputcoilfilename; // name of coil input file
fNelliptic =
inputNelliptic; // radial numerical integration parameter for magnetic field calc. with elliptic integrals
if(inputnmax <= 1) {
throw KEMField::KEMSimpleException("MagfieldCoils: nmax can't be <= 1. A recommended value for nmax is 500.\nThis error was added in May 2024, before results in this case could not be trusted.");
}
fnmax = inputnmax; // number of source coefficients for fixed source point: nmax+1
fepstol = inputepstol; // small tolerance parameter needed for the symmetry group definitions
// Recommended values: inputNelliptic=32, inputnmax=500, inputepstol=1.e-8.
Expand Down

0 comments on commit eee1f79

Please sign in to comment.