25 #include <octave/oct.h>
28 #include "esputr_octave.hpp"
32 Calculate sputtering yields for normal incidence (interface to ESPUTR)\n\
34 [Y1 Y2 ...] = esputr_YN(E0, proj, targ, version, fileN)\n\
36 Y1, Y2 ... : row vectors of sputtering yields - \n\
37 - one vector for each projectile-target combination \n\
38 E0 : row vector of the projectile energies, eV \n\
39 proj : column vector of the projectile names \n\
40 targ : column vector of the target names \n\
41 version : designation of the model ('1993' or '2001') \n\
42 fileN : name of the file (full path) with fitting parameters \n\
44 If the lengths of proj and targ differ, the last element of the shorter vector is repeated \n\
48 D on Be, 2007 model (2001 with coefficients from [Eckstein 2007]) \n\
49 y = esputr_YN([[0:10:200],[2000:1000:10000]], 'D', 'Be', '2001', '../data/ECKSTEIN2007N') \n\
51 D/T on Be and Be on Be, 1993-model (old EIRENE) \n\
52 [D_Be,T_Be,Be_Be] = esputr_YN([10,100,3000],strvcat('D','T','self'), 'Beryllium', '1993', '../data/SPUTER') \n\
54 H on Be, D on C, T on Mo, 2007 model \n\
55 [H_Be,D_C,T_Mo] = esputr_YN([10,100,3000], strvcat('H','D','T'), strvcat('Be','C ','Mo'), '2001', '../data/ECKSTEIN2007N')") {
56 octave_value_list retval;
57 int nargin = args.length();
60 error(
"5 input arguments required");
63 NDArray E0s = args(0).array_value();
65 double* E0s_v = E0s.fortran_vec();
66 octave_idx_type n_E0s = E0s.numel();
68 charMatrix projs = args(1).char_matrix_value();
69 octave_idx_type n_projs = projs.rows();
70 charMatrix targs = args(2).char_matrix_value();
71 octave_idx_type n_targs = targs.rows();
75 std::string version_str = args(3).char_matrix_value().row_as_string(0);
76 const char* version = version_str.c_str();
77 octave_idx_type version_length = version_str.length();
79 std::string fileN = args(4).char_matrix_value().row_as_string(0);
84 error(
"sth went wrong");
89 if(version_str ==
"1993") {
91 }
else if(version_str ==
"2001") {
94 error(
"unknown model");
99 error(
"error during initialization of ESPUTR");
105 std::string proj = projs.row_as_string(std::min(c, n_projs-1));
106 std::string targ = targs.row_as_string(std::min(c, n_targs-1));
107 Matrix YNs (1, n_E0s);
115 F77_CHAR_ARG_LEN(proj.length())
116 F77_CHAR_ARG_LEN(targ.length())
117 F77_CHAR_ARG_LEN(version_length)
120 error(
"error in esputr_matlab_yn");
subroutine esputr_deallocate(err)
call esputr2001_deallocate and esputr1993_deallocate
DEFUN_DLD(esputr_YN, args, nargout,"\n\
Calculate sputtering yields for normal incidence (interface to ESPUTR)\n\
\n\
[Y1 Y2 ...] = esputr_YN(E0, proj, targ, version, fileN)\n\
\n\
Y1, Y2 ... : row vectors of sputtering yields - \n\
- one vector for each projectile-target combination \n\
E0 : row vector of the projectile energies, eV \n\
proj : column vector of the projectile names \n\
targ : column vector of the target names \n\
version : designation of the model ('1993' or '2001') \n\
fileN : name of the file (full path) with fitting parameters \n\
\n\
If the lengths of proj and targ differ, the last element of the shorter vector is repeated \n\
\n\
Examples: \n\
\n\
D on Be, 2007 model (2001 with coefficients from [Eckstein 2007]) \n\
y = esputr_YN([[0:10:200],[2000:1000:10000]], 'D', 'Be', '2001', '../data/ECKSTEIN2007N') \n\
\n\
D/T on Be and Be on Be, 1993-model (old EIRENE) \n\
[D_Be,T_Be,Be_Be] = esputr_YN([10,100,3000],strvcat('D','T','self'), 'Beryllium', '1993', '../data/SPUTER') \n\
\n\
H on Be, D on C, T on Mo, 2007 model \n\
[H_Be,D_C,T_Mo] = esputr_YN([10,100,3000], strvcat('H','D','T'), strvcat('Be','C ','Mo'), '2001', '../data/ECKSTEIN2007N')")
integer, parameter n_combinations
Number of tested projectile-target combinations.
subroutine esputr1993_init_wrapper(fileN, err)
See include esputr_octave.hpp, esputr_YN.cpp, esputr_YTH.cpp as an example of how to use those subrou...
subroutine esputr_yn(E0s, n_E0s, proj, targ, version, YNs, err)
Calculate sputtering yield for normal incidence for selected incident energies and the specified proj...
subroutine esputr2001_initn_wrapper(fileN, err)
module-less wraper for esputr2001_initN