diff --git a/Sample/Interface/AutocorrelationModels.h b/Sample/Interface/AutocorrelationModels.h index c32d32c70ce55dee53b9a16ed6e043f0faea1dbe..55b269eb0fdc57ee5aff0d1329b9b5e25e131f4e 100644 --- a/Sample/Interface/AutocorrelationModels.h +++ b/Sample/Interface/AutocorrelationModels.h @@ -44,7 +44,7 @@ protected: //! 14472-14478 (1993) class K_CorrelationModel : public AutocorrelationModel { public: - K_CorrelationModel(double sigma = 0, double hurst = 0.7, double lateralCorrLength = 25, + K_CorrelationModel(double sigma, double hurst, double lateralCorrLength, double maxSpatFrequency = 0.5); std::string className() const override { return "K_CorrelationModel"; } std::vector<ParaMeta> parDefs() const final; diff --git a/Sample/Multilayer/Layer.cpp b/Sample/Multilayer/Layer.cpp index 58880f2d976bcecc05d3ef3fd3ddd0083a88615f..555be9f02fe38683f927a73f81963463a891d3c6 100644 --- a/Sample/Multilayer/Layer.cpp +++ b/Sample/Multilayer/Layer.cpp @@ -22,7 +22,7 @@ namespace { LayerRoughness* zeroRoughness() { - K_CorrelationModel autocorr(0); + K_CorrelationModel autocorr(0, 0.7, 25); ErfInterlayer interlayer; return new LayerRoughness(&autocorr, &interlayer); } diff --git a/Sample/StandardSample/FeNiBilayerBuilder.cpp b/Sample/StandardSample/FeNiBilayerBuilder.cpp index c6c161ea610d577c4d9d18bb0fbf1f0298b33e59..ef4c99bc8d6be3634843c8563e9d90f70312cb25 100644 --- a/Sample/StandardSample/FeNiBilayerBuilder.cpp +++ b/Sample/StandardSample/FeNiBilayerBuilder.cpp @@ -110,7 +110,7 @@ std::unique_ptr<Sample> FeNiBilayer::constructSample() auto m_Ni = MaterialBySLD("Ni", sldNi.real(), sldNi.imag()); auto m_Substrate = MaterialBySLD("Au", sldAu.real(), sldAu.imag()); - K_CorrelationModel autocorrelation(sigmaRoughness); + K_CorrelationModel autocorrelation(sigmaRoughness, 0.7, 25); LayerRoughness roughness{&autocorrelation, interlayerModel.get()}; Layer l_Fe{m_Fe, thicknessFe, &roughness}; diff --git a/Sample/StandardSample/MagneticLayersBuilder.cpp b/Sample/StandardSample/MagneticLayersBuilder.cpp index b3da64131ab5426b1ae16a4186db42b62398e86c..4a24d22928ca3d2d15d8e0dcd063ec093e5df8cb 100644 --- a/Sample/StandardSample/MagneticLayersBuilder.cpp +++ b/Sample/StandardSample/MagneticLayersBuilder.cpp @@ -135,7 +135,7 @@ Sample* ExemplarySamples::createSimpleMagneticRotationWithRoughness(const std::s Material substrate_material = RefractiveMaterial("Substrate", 7e-6, 2e-8, substr_field); Material layer_material = RefractiveMaterial("MagLayer", 6e-4, 2e-8, layer_field); - K_CorrelationModel autocorrelation(sigmaRoughness); + K_CorrelationModel autocorrelation(sigmaRoughness, 0.7, 25); auto roughness = LayerRoughness(&autocorrelation, interlayerModel.get()); Layer vacuum_layer(vacuum_material); diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py index ffd2e351953f0185b67955028c5ab047ca23d1b6..1ca96dcab97475edcf99f603931806604a74eba6 100644 --- a/auto/Wrap/libBornAgainSample.py +++ b/auto/Wrap/libBornAgainSample.py @@ -3912,8 +3912,8 @@ class K_CorrelationModel(AutocorrelationModel): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, sigma=0, hurst=0.7, lateralCorrLength=25, maxSpatFrequency=0.5): - r"""__init__(K_CorrelationModel self, double sigma=0, double hurst=0.7, double lateralCorrLength=25, double maxSpatFrequency=0.5) -> K_CorrelationModel""" + def __init__(self, sigma, hurst, lateralCorrLength, maxSpatFrequency=0.5): + r"""__init__(K_CorrelationModel self, double sigma, double hurst, double lateralCorrLength, double maxSpatFrequency=0.5) -> K_CorrelationModel""" _libBornAgainSample.K_CorrelationModel_swiginit(self, _libBornAgainSample.new_K_CorrelationModel(sigma, hurst, lateralCorrLength, maxSpatFrequency)) def className(self): diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp index 658835f88154bd9da036fff2501370aa57b81e29..79ec3e111d377d16c24670fd998ff2a51b01e89d 100644 --- a/auto/Wrap/libBornAgainSample_wrap.cpp +++ b/auto/Wrap/libBornAgainSample_wrap.cpp @@ -45486,96 +45486,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_K_CorrelationModel__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - double arg1 ; - double arg2 ; - double val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - K_CorrelationModel *result = 0 ; - - (void)self; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; - ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_K_CorrelationModel" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_K_CorrelationModel" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - { - try { - result = (K_CorrelationModel *)new K_CorrelationModel(arg1,arg2); - } catch (const bug& ex) { - SWIG_exception(SWIG_RuntimeError, bug_msg(ex).c_str()); - } catch (const std::exception& ex) { - SWIG_exception(SWIG_RuntimeError, exception_msg(ex).c_str()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_K_CorrelationModel, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_K_CorrelationModel__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - double arg1 ; - double val1 ; - int ecode1 = 0 ; - K_CorrelationModel *result = 0 ; - - (void)self; - if ((nobjs < 1) || (nobjs > 1)) SWIG_fail; - ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_K_CorrelationModel" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - { - try { - result = (K_CorrelationModel *)new K_CorrelationModel(arg1); - } catch (const bug& ex) { - SWIG_exception(SWIG_RuntimeError, bug_msg(ex).c_str()); - } catch (const std::exception& ex) { - SWIG_exception(SWIG_RuntimeError, exception_msg(ex).c_str()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_K_CorrelationModel, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_K_CorrelationModel__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { - PyObject *resultobj = 0; - K_CorrelationModel *result = 0 ; - - (void)self; - if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; - { - try { - result = (K_CorrelationModel *)new K_CorrelationModel(); - } catch (const bug& ex) { - SWIG_exception(SWIG_RuntimeError, bug_msg(ex).c_str()); - } catch (const std::exception& ex) { - SWIG_exception(SWIG_RuntimeError, exception_msg(ex).c_str()); - } - } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_K_CorrelationModel, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_new_K_CorrelationModel(PyObject *self, PyObject *args) { Py_ssize_t argc; PyObject *argv[5] = { @@ -45584,35 +45494,6 @@ SWIGINTERN PyObject *_wrap_new_K_CorrelationModel(PyObject *self, PyObject *args if (!(argc = SWIG_Python_UnpackTuple(args, "new_K_CorrelationModel", 0, 4, argv))) SWIG_fail; --argc; - if (argc == 0) { - return _wrap_new_K_CorrelationModel__SWIG_4(self, argc, argv); - } - if (argc == 1) { - int _v = 0; - { - int res = SWIG_AsVal_double(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_K_CorrelationModel__SWIG_3(self, argc, argv); - } - } - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_double(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_K_CorrelationModel__SWIG_2(self, argc, argv); - } - } - } if (argc == 3) { int _v = 0; { @@ -45668,10 +45549,7 @@ fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_K_CorrelationModel'.\n" " Possible C/C++ prototypes are:\n" " K_CorrelationModel::K_CorrelationModel(double,double,double,double)\n" - " K_CorrelationModel::K_CorrelationModel(double,double,double)\n" - " K_CorrelationModel::K_CorrelationModel(double,double)\n" - " K_CorrelationModel::K_CorrelationModel(double)\n" - " K_CorrelationModel::K_CorrelationModel()\n"); + " K_CorrelationModel::K_CorrelationModel(double,double,double)\n"); return 0; } @@ -66172,7 +66050,7 @@ static PyMethodDef SwigMethods[] = { { "AutocorrelationModel_parDefs", _wrap_AutocorrelationModel_parDefs, METH_O, "AutocorrelationModel_parDefs(AutocorrelationModel self) -> std::vector< ParaMeta,std::allocator< ParaMeta > >"}, { "delete_AutocorrelationModel", _wrap_delete_AutocorrelationModel, METH_O, "delete_AutocorrelationModel(AutocorrelationModel self)"}, { "AutocorrelationModel_swigregister", AutocorrelationModel_swigregister, METH_O, NULL}, - { "new_K_CorrelationModel", _wrap_new_K_CorrelationModel, METH_VARARGS, "K_CorrelationModel(double sigma=0, double hurst=0.7, double lateralCorrLength=25, double maxSpatFrequency=0.5)"}, + { "new_K_CorrelationModel", _wrap_new_K_CorrelationModel, METH_VARARGS, "K_CorrelationModel(double sigma, double hurst, double lateralCorrLength, double maxSpatFrequency=0.5)"}, { "K_CorrelationModel_className", _wrap_K_CorrelationModel_className, METH_O, "K_CorrelationModel_className(K_CorrelationModel self) -> std::string"}, { "K_CorrelationModel_parDefs", _wrap_K_CorrelationModel_parDefs, METH_O, "K_CorrelationModel_parDefs(K_CorrelationModel self) -> std::vector< ParaMeta,std::allocator< ParaMeta > >"}, { "K_CorrelationModel_validate", _wrap_K_CorrelationModel_validate, METH_O, "K_CorrelationModel_validate(K_CorrelationModel self) -> std::string"},