From f43c9687b38c6b7bdc5478f3abf62f3a6734fb3c Mon Sep 17 00:00:00 2001 From: pospelov <pospelov@fz-juelich.de> Date: Fri, 4 May 2012 17:54:54 +0200 Subject: [PATCH] code cleanup, standard headers in include files --- App/inc/App.h | 13 +++++ App/inc/AppLinkDef.h | 13 +++++ App/inc/DrawHelper.h | 13 +++++ App/inc/TestDWBAFormFactor.h | 21 +++++--- App/inc/TestDiffuseScattering.h | 2 +- App/inc/TestFormFactor.h | 14 +++++ App/inc/TestFresnelCoeff.h | 13 +++++ App/inc/TestRoughness.h | 15 +++++- App/src/DrawHelper.cpp | 11 ++-- App/src/main.cpp | 7 ++- Core/inc/CalculatorOptical.h | 13 +++++ Core/inc/DWBAFormFactor.h | 21 +++++--- Core/inc/DispersedParticleDecorator.h | 14 +++++ .../DoubleToComplexInterpolatingFunction.h | 21 +++++--- Core/inc/Exceptions.h | 14 +++++ Core/inc/FormFactorCylinder.h | 14 +++++ Core/inc/HomogeneousMaterial.h | 2 +- Core/inc/IAlgorithm.h | 14 +++++ Core/inc/IDoubleToComplexFunction.h | 25 ++++++--- Core/inc/IFormFactor.h | 14 +++++ Core/inc/IMaterial.h | 3 +- Core/inc/IRoughness.h | 14 +++++ Core/inc/ISample.h | 14 +++++ Core/inc/ISimulation.h | 14 ++++- Core/inc/IStochasticParameter.h | 14 +++++ Core/inc/Layer.h | 2 +- Core/inc/LayerInterface.h | 3 +- Core/inc/LayerRoughness.h | 36 ++++++------- Core/inc/MaterialManager.h | 12 ++--- Core/inc/MathFunctions.h | 20 +++++-- Core/inc/MultiLayer.h | 54 +++++++++---------- Core/inc/NamedVector.h | 14 +++++ Core/inc/NanoParticle.h | 14 +++++ Core/inc/OpticalFresnel.h | 14 +++++ Core/inc/OutputData.h | 15 +++++- Core/inc/StochasticDiracDelta.h | 14 +++++ Core/inc/StochasticGaussian.h | 14 +++++ Core/inc/Types.h | 15 +++++- Core/src/ISample.cpp | 1 - 39 files changed, 454 insertions(+), 107 deletions(-) diff --git a/App/inc/App.h b/App/inc/App.h index 33a2d6f9b8a..26b64a7b85e 100644 --- a/App/inc/App.h +++ b/App/inc/App.h @@ -1,5 +1,18 @@ #ifndef APP_H #define APP_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file App.h +//! @brief Common include for files involved into ROOT dictionary generation +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "DrawHelper.h" diff --git a/App/inc/AppLinkDef.h b/App/inc/AppLinkDef.h index 18014c817ce..0b39e89dc0e 100644 --- a/App/inc/AppLinkDef.h +++ b/App/inc/AppLinkDef.h @@ -1,4 +1,17 @@ #ifdef __CINT__ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file AppLinkDef.h +//! @brief Steering file for ROOT dictionary generation +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #pragma link off all globals; #pragma link off all classes; diff --git a/App/inc/DrawHelper.h b/App/inc/DrawHelper.h index 2d91d904014..9066497aab2 100644 --- a/App/inc/DrawHelper.h +++ b/App/inc/DrawHelper.h @@ -1,5 +1,18 @@ #ifndef DRAWHELPER_H #define DRAWHELPER_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file DrawHelper.h +//! @brief Helper class definition for sophisticated data drawing +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "TObject.h" diff --git a/App/inc/TestDWBAFormFactor.h b/App/inc/TestDWBAFormFactor.h index c05f66726f2..825c79e6281 100644 --- a/App/inc/TestDWBAFormFactor.h +++ b/App/inc/TestDWBAFormFactor.h @@ -1,12 +1,19 @@ -/* - * TestDWBAFormFactor.h - * - * Created on: May 2, 2012 - * Author: herck - */ - #ifndef TESTDWBAFORMFACTOR_H_ #define TESTDWBAFORMFACTOR_H_ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file TestDWBAFormFactor.h +//! @brief Definition of TestDWBAFormFactor class for formfactor validation +//! @author herk +//! @date 02.05.2012 + #include "IAlgorithm.h" #include "OutputData.h" diff --git a/App/inc/TestDiffuseScattering.h b/App/inc/TestDiffuseScattering.h index cdd8ab173b3..d1e45d64a41 100644 --- a/App/inc/TestDiffuseScattering.h +++ b/App/inc/TestDiffuseScattering.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file TestDiffuseScattering.h //! @brief Test of diffusse (incoherent) scattering from rough multilayer in DWBA. -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include "IAlgorithm.h" diff --git a/App/inc/TestFormFactor.h b/App/inc/TestFormFactor.h index efccc46eab4..205b8dffa69 100644 --- a/App/inc/TestFormFactor.h +++ b/App/inc/TestFormFactor.h @@ -1,10 +1,24 @@ #ifndef TESTFORMFACTOR_H #define TESTFORMFACTOR_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file TestFormFactor.h +//! @brief Definition of TestFormFactor class for formfactor validation +//! @author herk +//! @date 02.05.2012 #include "IAlgorithm.h" #include "OutputData.h" #include "FormFactorCylinder.h" + class TestFormFactor : public IAlgorithm { public: diff --git a/App/inc/TestFresnelCoeff.h b/App/inc/TestFresnelCoeff.h index 47d59927139..5bf60f682a0 100644 --- a/App/inc/TestFresnelCoeff.h +++ b/App/inc/TestFresnelCoeff.h @@ -1,3 +1,16 @@ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file TestFresnelCoeff.h +//! @brief Definition of TestFresnelCoeff class for tests of Fresnel coeffs +//! @author Scientific Computing Group at FRM II +//! @date 02.05.2012 #ifndef TESTFRESNELCOEFF_H #define TESTFRESNELCOEFF_H diff --git a/App/inc/TestRoughness.h b/App/inc/TestRoughness.h index fa751839428..e300af6b8ce 100644 --- a/App/inc/TestRoughness.h +++ b/App/inc/TestRoughness.h @@ -1,9 +1,20 @@ #ifndef TESTROUGHNESS_H #define TESTROUGHNESS_H - +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file TestRoughness.h +//! @brief Tests of roughness +//! @author Scientific Computing Group at FRM II +//! @date 02.05.2012 #include <vector> - #include "IAlgorithm.h" #include "LayerRoughness.h" diff --git a/App/src/DrawHelper.cpp b/App/src/DrawHelper.cpp index 4d76ebe22c6..f522cf40c19 100644 --- a/App/src/DrawHelper.cpp +++ b/App/src/DrawHelper.cpp @@ -177,12 +177,8 @@ void DrawHelper::SaveReport() // canvas->Print(sfilename.c_str()); // simple method if file page and all canvases have same aspect ratio - // user canvas will be redrawn in TPad with preserving initial apsect ratio - - std::cout << c1->GetName() << c1->GetX1() << c1->GetY1() << c1->GetX2() << c1->GetY2() << std::endl; - std::cout << c1->GetName() << " " << c1->GetWindowWidth() << " " << c1->GetWindowHeight() << std::endl; - - // first we need appropriate TPad in our master canvas + // preserving aspect ratio of user's canvas + // first we need appropriate TPad in our master canvas which has same aspect ratio as user canvas double xlow(0), ylow(0), xup(1), yup(1); if( c1->GetWindowWidth() >= c1->GetWindowHeight() ) { double npx_user_new = npx_master; @@ -201,15 +197,14 @@ void DrawHelper::SaveReport() } TPad *pad = new TPad("tmppad", "tmppad", xlow, ylow, xup, yup); + // draw pad in master canvas, draw user canvas in the pad and save whole thing in file cmaster->cd(); pad->Draw(); pad->cd(); c1->DrawClonePad(); - cmaster->Print(sfilename.c_str()); } - stmpname = sfilename + "]"; cmaster->Print(stmpname.c_str()); // close file } diff --git a/App/src/main.cpp b/App/src/main.cpp index 582a255b856..2ebee5d96d5 100644 --- a/App/src/main.cpp +++ b/App/src/main.cpp @@ -1,5 +1,3 @@ -#include <iostream> -#include <string> #include "TestFresnelCoeff.h" #include "TestDiffuseScattering.h" #include "TestFormFactor.h" @@ -7,8 +5,11 @@ #include "TestRoughness.h" #include "DrawHelper.h" +#include <iostream> +#include <string> #include "TApplication.h" + bool exists(int argc, char **argv, const std::string &stext); int main(int argc, char **argv) @@ -42,11 +43,13 @@ int main(int argc, char **argv) test.execute(); } + // user algorithm to test DWBA formfactors if( exists(argc, argv, "dwba") ) { TestDWBAFormFactor test; test.execute(); } + // utility which saves user plots in multi-page pdf file if( exists(argc, argv, "report") ) { DrawHelper::SaveReport(); } diff --git a/Core/inc/CalculatorOptical.h b/Core/inc/CalculatorOptical.h index 82deb220b32..7e3f5d97ad0 100644 --- a/Core/inc/CalculatorOptical.h +++ b/Core/inc/CalculatorOptical.h @@ -1,5 +1,18 @@ #ifndef CALCULATOROPTICAL_H #define CALCULATOROPTICAL_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file CalculatorOptical.h +//! @brief Defenition of base class for optical calculations +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 class CalculatorOptical { diff --git a/Core/inc/DWBAFormFactor.h b/Core/inc/DWBAFormFactor.h index 2f591f8bb13..175756291b3 100644 --- a/Core/inc/DWBAFormFactor.h +++ b/Core/inc/DWBAFormFactor.h @@ -1,16 +1,23 @@ -/* - * DWBAFormFactor.h - * - * Created on: Apr 26, 2012 - * Author: herck - */ - #ifndef DWBAFORMFACTOR_H_ #define DWBAFORMFACTOR_H_ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file DWBAFormFactor.h +//! @brief Definition of DWBAFormFactor +//! @author herck +//! @date 01.05.2012 #include "IFormFactor.h" #include "IDoubleToComplexFunction.h" + class DWBAFormFactor: public IFormFactor { public: diff --git a/Core/inc/DispersedParticleDecorator.h b/Core/inc/DispersedParticleDecorator.h index 880b568f7b1..35d3e1f642e 100644 --- a/Core/inc/DispersedParticleDecorator.h +++ b/Core/inc/DispersedParticleDecorator.h @@ -1,8 +1,22 @@ #ifndef DISPERSEDPARTICLEDECORATOR_H #define DISPERSEDPARTICLEDECORATOR_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file DispersedParticleDecorator.h +//! @brief Defenition of DispersedParticleDecorator +//! @author Scientific Computing Group at FRM II +//! @date 01.05.2012 #include "ISample.h" + class DispersedParticleDecorator : public ISample { public: diff --git a/Core/inc/DoubleToComplexInterpolatingFunction.h b/Core/inc/DoubleToComplexInterpolatingFunction.h index dd2249c12b3..5e8fa0fecf3 100644 --- a/Core/inc/DoubleToComplexInterpolatingFunction.h +++ b/Core/inc/DoubleToComplexInterpolatingFunction.h @@ -1,16 +1,23 @@ -/* - * DoubleToComplexInterpolatingFunction.h - * - * Created on: Apr 27, 2012 - * Author: herck - */ - #ifndef DOUBLETOCOMPLEXINTERPOLATINGFUNCTION_H_ #define DOUBLETOCOMPLEXINTERPOLATINGFUNCTION_H_ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file DoubleToComplexInterpolatingFunction.h +//! @brief Definition of something really cool ane necessary +//! @author herck +//! @date 01.05.2012 #include "IDoubleToComplexFunction.h" #include <map> + class DoubleToComplexInterpolatingFunction : public IDoubleToComplexFunction { public: diff --git a/Core/inc/Exceptions.h b/Core/inc/Exceptions.h index c24d45448e1..5791539a3a4 100644 --- a/Core/inc/Exceptions.h +++ b/Core/inc/Exceptions.h @@ -1,9 +1,23 @@ #ifndef EXCEPTIONS_H #define EXCEPTIONS_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file Exceptions.h +//! @brief Definition of Exceptions +//! @author Scientific Computing Group at FRM II +//! @date 01.05.2012 #include <stdexcept> #include <string> + class NotImplementedException : public std::logic_error { public: diff --git a/Core/inc/FormFactorCylinder.h b/Core/inc/FormFactorCylinder.h index cd141baf6f8..3be3e5f5377 100644 --- a/Core/inc/FormFactorCylinder.h +++ b/Core/inc/FormFactorCylinder.h @@ -1,9 +1,23 @@ #ifndef FORMFACTORCYLINDER_H #define FORMFACTORCYLINDER_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file FormFactorCylinder.h +//! @brief Definition of FormFactorCylinder +//! @author Scientific Computing Group at FRM II +//! @date 01.05.2012 #include "IFormFactor.h" #include "IStochasticParameter.h" + class FormFactorCylinder : public IBornFormFactor { public: diff --git a/Core/inc/HomogeneousMaterial.h b/Core/inc/HomogeneousMaterial.h index 646c8825aaa..a45093538c9 100644 --- a/Core/inc/HomogeneousMaterial.h +++ b/Core/inc/HomogeneousMaterial.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file HomogeneousMaterial.h //! @brief Definition of HomogeneousMaterial class -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include "IMaterial.h" diff --git a/Core/inc/IAlgorithm.h b/Core/inc/IAlgorithm.h index 05017b22567..d768e2b308d 100644 --- a/Core/inc/IAlgorithm.h +++ b/Core/inc/IAlgorithm.h @@ -1,5 +1,19 @@ #ifndef IALGORITHM_H #define IALGORITHM_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file IAlgorithm.h +//! @brief Definition of IAlgorithm +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 + class IAlgorithm { diff --git a/Core/inc/IDoubleToComplexFunction.h b/Core/inc/IDoubleToComplexFunction.h index 47f1eeba91a..482bea7de7c 100644 --- a/Core/inc/IDoubleToComplexFunction.h +++ b/Core/inc/IDoubleToComplexFunction.h @@ -1,22 +1,31 @@ -/* - * IDoubleToComplexFunction.h - * - * Created on: Apr 27, 2012 - * Author: herck - */ - #ifndef IDOUBLETOCOMPLEXFUNCTION_H_ #define IDOUBLETOCOMPLEXFUNCTION_H_ +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file IDoubleToComplexFunction.h +//! @brief Definition of HomogeneousMaterial class +//! @author herck +//! @date 27.04.2012 #include "Types.h" -class IDoubleToComplexFunction { + +class IDoubleToComplexFunction +{ public: virtual ~IDoubleToComplexFunction() {} virtual complex_t evaluate(double value)=0; }; + class DoubleToComplexFunctionWrapper : public IDoubleToComplexFunction { public: diff --git a/Core/inc/IFormFactor.h b/Core/inc/IFormFactor.h index 4d3b07546db..d666527ce24 100644 --- a/Core/inc/IFormFactor.h +++ b/Core/inc/IFormFactor.h @@ -1,8 +1,22 @@ #ifndef IFORMFACTOR_H #define IFORMFACTOR_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file IFormFactor.h +//! @brief Definition of IFormFactor +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "Types.h" + class IFormFactor { public: diff --git a/Core/inc/IMaterial.h b/Core/inc/IMaterial.h index 07469e5d6e5..c66f3fb0d15 100644 --- a/Core/inc/IMaterial.h +++ b/Core/inc/IMaterial.h @@ -11,12 +11,13 @@ // ******************************************************************** //! @file IMaterial.h //! @brief Definition of IMaterial class -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include <string> #include <iostream> + //- ------------------------------------------------------------------- //! @class IMaterial //! @brief Material definition diff --git a/Core/inc/IRoughness.h b/Core/inc/IRoughness.h index e3d888b550d..2c93d7b353b 100644 --- a/Core/inc/IRoughness.h +++ b/Core/inc/IRoughness.h @@ -1,5 +1,19 @@ #ifndef IROUGHNESS_H #define IROUGHNESS_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file IRoughness.h +//! @brief Definition of IRoughness class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 + class IRoughness { diff --git a/Core/inc/ISample.h b/Core/inc/ISample.h index 44d548d4e5f..1adaee4db77 100644 --- a/Core/inc/ISample.h +++ b/Core/inc/ISample.h @@ -1,8 +1,22 @@ #ifndef ISAMPLE_H #define ISAMPLE_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file ISample.h +//! @brief Definition of ISample class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "Exceptions.h" + class ISample { public: diff --git a/Core/inc/ISimulation.h b/Core/inc/ISimulation.h index 898d0113a80..2b75991087e 100644 --- a/Core/inc/ISimulation.h +++ b/Core/inc/ISimulation.h @@ -1,7 +1,19 @@ #ifndef ISIMULATION_H #define ISIMULATION_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file ISimulation.h +//! @brief Definition of ISimulation class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 -// class OutputData; class ISimulation { diff --git a/Core/inc/IStochasticParameter.h b/Core/inc/IStochasticParameter.h index c51e78b05dd..4b3e3f926c3 100644 --- a/Core/inc/IStochasticParameter.h +++ b/Core/inc/IStochasticParameter.h @@ -1,5 +1,19 @@ #ifndef ISTOCHASTICPARAMETER_H #define ISTOCHASTICPARAMETER_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file IStochasticParameter.h +//! @brief Definition of IStochasticParameter class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 + class IStochasticParameter { diff --git a/Core/inc/Layer.h b/Core/inc/Layer.h index ec0c4182400..2c245a7e0c5 100644 --- a/Core/inc/Layer.h +++ b/Core/inc/Layer.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file Layer.h //! @brief Definition of Layer class -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include "ISample.h" diff --git a/Core/inc/LayerInterface.h b/Core/inc/LayerInterface.h index 0fc594fa53c..ff8b02cc5c8 100644 --- a/Core/inc/LayerInterface.h +++ b/Core/inc/LayerInterface.h @@ -11,14 +11,13 @@ // ******************************************************************** //! @file LayerInterface.h //! @brief Definition of LayerInterface class -//! @author JCNS Scientific Computing group +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include "LayerRoughness.h" class Layer; - //- ------------------------------------------------------------------- //! @class LayerInterface //! @brief Interface between two layers. diff --git a/Core/inc/LayerRoughness.h b/Core/inc/LayerRoughness.h index 913b0cd3ce4..c9ef955dccb 100644 --- a/Core/inc/LayerRoughness.h +++ b/Core/inc/LayerRoughness.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file LayerRoughness.h //! @brief Definition of LayerRoughness class -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include "Types.h" @@ -19,13 +19,13 @@ //- ------------------------------------------------------------------- -/// @class LayerRoughness -/// @brief Roughness of interface between two layers. -/// -/// Based on the article -/// D.K.G. de Boer, Physical review B, Volume 51, Number 8, 15 February 1995 -/// "X-ray reflection and transmission by rough surfaces" -/// See Appendix A2 +//! @class LayerRoughness +//! @brief Roughness of interface between two layers. +//! +//! Based on the article +//! D.K.G. de Boer, Physical review B, Volume 51, Number 8, 15 February 1995 +//! "X-ray reflection and transmission by rough surfaces" +//! See Appendix A2 //- ------------------------------------------------------------------- class LayerRoughness : public IRoughness { @@ -33,30 +33,30 @@ public: LayerRoughness(); LayerRoughness(double sigma, double hurstParameter, double latteralCorrLength); - /// return power spectral density of the surface roughness + //! return power spectral density of the surface roughness double getSpectralFun(const kvector_t &kvec) const; double getCorrFun(const kvector_t &k) const; - /// set rms value of roughness + //! set rms value of roughness void setSigma(double sigma) { m_sigma = sigma; } - /// return rms value of roughness + //! return rms value of roughness double getSigma() const { return m_sigma; } - /// Set hurst parameter. It describes how jagged the surface is. + //! Set hurst parameter. It describes how jagged the surface is. inline void setHurstParameter(double hurstParameter) { m_hurstParameter = hurstParameter; } - /// return hurst parameter + //! return hurst parameter inline double getHurstParameter() const { return m_hurstParameter; } - /// set lateral correlation length + //! set lateral correlation length inline void setLatteralCorrLength(double latteralCorrLength) { m_latteralCorrLength = latteralCorrLength; } - /// return latteral correlation length + //! return latteral correlation length inline double getLatteralCorrLength() const { return m_latteralCorrLength; } protected: - double m_sigma; ///< rms of roughness - double m_hurstParameter; ///< Hurst parameter which describes how jagged the interface, 0<H<=1 - double m_latteralCorrLength; ///< latteral correlation length of the roughness + double m_sigma; //!< rms of roughness + double m_hurstParameter; //!< Hurst parameter which describes how jagged the interface, 0<H<=1 + double m_latteralCorrLength; //!< latteral correlation length of the roughness }; #endif // LAYERROUGHNESS_H diff --git a/Core/inc/MaterialManager.h b/Core/inc/MaterialManager.h index 9aba38581b8..417c83d8eb0 100644 --- a/Core/inc/MaterialManager.h +++ b/Core/inc/MaterialManager.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file MaterialManager.h //! @brief Definition of MaterialManager class -//! @author JCNS Scientific Computing Group +//! @author Scientific Computing Group at FRM II //! @date 20.04.2012 #include <iostream> @@ -23,11 +23,11 @@ //- ------------------------------------------------------------------- -/// @class MaterialManager -/// @brief Manager of materials used in simulatiom. -/// -/// It is a singleton which provide common and unique interface for -/// material creation and access. No thread safeness. +//! @class MaterialManager +//! @brief Manager of materials used in simulatiom. +//! +//! It is a singleton which provide common and unique interface for +//! material creation and access. No thread safeness. //- ------------------------------------------------------------------- class MaterialManager { diff --git a/Core/inc/MathFunctions.h b/Core/inc/MathFunctions.h index 957b224b13e..6a205a81bd5 100644 --- a/Core/inc/MathFunctions.h +++ b/Core/inc/MathFunctions.h @@ -1,13 +1,25 @@ #ifndef MATHFUNCTIONS_H #define MATHFUNCTIONS_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file MathFunctions.h +//! @brief Collection of mathematical functions +//! @author Scientific Computing Group at FRM II +//! @date 20.04.2012 #include <cstdlib> - -#include "Types.h" - +#include <vector> #include "gsl/gsl_sf_bessel.h" #include "gsl/gsl_sf_trig.h" -#include <vector> +#include "Types.h" + namespace MathFunctions { diff --git a/Core/inc/MultiLayer.h b/Core/inc/MultiLayer.h index e1f294c7bcd..abe8ebf08c3 100644 --- a/Core/inc/MultiLayer.h +++ b/Core/inc/MultiLayer.h @@ -11,7 +11,7 @@ // ******************************************************************** //! @file MultiLayer.h //! @brief Definition of MultiLayer class -//! @author James Bond <j.bond@fz-juelich.de>, Chuck Norris <c.norris@fz-juelich.de> +//! @author Scientific Computing Group at FRM II //! @date 01.04.2012 #include <vector> @@ -22,19 +22,19 @@ //- ------------------------------------------------------------------- -/// @class MultiLayer -/// @brief Stack of layers one on top of the other -/// -/// Example of system of 4 layers (3 interfaces): -/// -/// ambience layer #0 z=getLayerBottomZ(0)=0.0 -/// --------- interface #0 -/// Fe, 20A layer #1 z=getLayerBottomZ(1)=-20.0 -/// --------- interface #1 -/// Cr, 40A layer #2 z=getLayerBottomZ(2)=-60.0 -/// --------- interface #2 -/// substrate layer #3 z=getLayerBottomZ(3)=-60.0 -/// +//! @class MultiLayer +//! @brief Stack of layers one on top of the other +//! +//! Example of system of 4 layers (3 interfaces): +//! +//! ambience layer #0 z=getLayerBottomZ(0)=0.0 +//! --------- interface #0 +//! Fe, 20A layer #1 z=getLayerBottomZ(1)=-20.0 +//! --------- interface #1 +//! Cr, 40A layer #2 z=getLayerBottomZ(2)=-60.0 +//! --------- interface #2 +//! substrate layer #3 z=getLayerBottomZ(3)=-60.0 +//! //- ------------------------------------------------------------------- class MultiLayer : public ISample { @@ -42,45 +42,45 @@ public: MultiLayer(); ~MultiLayer(); - /// return number of layers in multilayer + //! return number of layers in multilayer inline size_t getNumberOfLayers() const { return m_layers.size(); } - /// add object to multilayer, overrides from ISample + //! add object to multilayer, overrides from ISample void addLayer(const Layer &p_child); - /// add layer with top roughness + //! add layer with top roughness void addLayerWithTopRoughness(const Layer &layer, const LayerRoughness &roughness); - /// return layer with given index + //! return layer with given index const Layer *getLayer(size_t i_layer) const { return m_layers[ check_layer_index(i_layer) ]; } - /// return z-coordinate of the layer's bottom + //! return z-coordinate of the layer's bottom double getLayerBottomZ(size_t i_layer) const { return m_layers_z[ check_layer_index(i_layer) ]; } - /// return top interface of layer + //! return top interface of layer const LayerInterface *getLayerTopInterface(size_t i_layer) const; - /// return bottom interface of layer + //! return bottom interface of layer const LayerInterface *getLayerBottomInterface(size_t i_layer) const; - /// destruct allocated objects + //! destruct allocated objects void clear(); - /// return clone of multilayer with clones of all layers and recreated interfaces between layers + //! return clone of multilayer with clones of all layers and recreated interfaces between layers virtual MultiLayer *clone() const; - /// print structure of multilayer + //! print structure of multilayer void print(); private: - /// hiding copy constructor & assignment operator + //! hiding copy constructor & assignment operator MultiLayer(const MultiLayer &); MultiLayer &operator=(const MultiLayer &); - /// check index of layer w.r.t. vector length + //! check index of layer w.r.t. vector length inline size_t check_layer_index(size_t i_layer) const { return i_layer < m_layers.size() ? i_layer : throw OutOfBoundsException("Layer index is out of bounds"); } - /// check index of interface w.r.t. vector length + //! check index of interface w.r.t. vector length inline size_t check_interface_index(size_t i_interface) const { return i_interface < m_interfaces.size() ? i_interface : throw OutOfBoundsException("Interface index is out of bounds"); } std::vector<Layer *> m_layers; ///< stack of layers [nlayers] diff --git a/Core/inc/NamedVector.h b/Core/inc/NamedVector.h index 5f39e7ebbb0..0a7d731d692 100644 --- a/Core/inc/NamedVector.h +++ b/Core/inc/NamedVector.h @@ -1,9 +1,23 @@ #ifndef NAMEDVECTOR_H #define NAMEDVECTOR_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file NamedVector.h +//! @brief Definition of NamedVector class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include <string> #include <vector> + class NamedVectorBase { public: diff --git a/Core/inc/NanoParticle.h b/Core/inc/NanoParticle.h index 327cc6084d8..989d275cf22 100644 --- a/Core/inc/NanoParticle.h +++ b/Core/inc/NanoParticle.h @@ -1,9 +1,23 @@ #ifndef NANOPARTICLE_H #define NANOPARTICLE_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file NanoParticle.h +//! @brief Definition of NanoParticle +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "ISample.h" #include "IFormFactor.h" + class NanoParticle : public ISample { public: diff --git a/Core/inc/OpticalFresnel.h b/Core/inc/OpticalFresnel.h index ee28aae15fa..406cccec203 100644 --- a/Core/inc/OpticalFresnel.h +++ b/Core/inc/OpticalFresnel.h @@ -1,11 +1,25 @@ #ifndef OPTICALFRESNEL_H #define OPTICALFRESNEL_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file OpticalFresnel.h +//! @brief Definition of OpticalFresnel class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include <vector> #include "Types.h" #include "ISimulation.h" #include "MultiLayer.h" + class OpticalFresnel : public ISimulation { public: diff --git a/Core/inc/OutputData.h b/Core/inc/OutputData.h index abacafe0026..cf58cc1701c 100644 --- a/Core/inc/OutputData.h +++ b/Core/inc/OutputData.h @@ -1,10 +1,23 @@ #ifndef OUTPUTDATA_H #define OUTPUTDATA_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file OutputData.h +//! @brief Definition of OutputData class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "NamedVector.h" - #include <map> + template <class T> class OutputData; class MultiIndex diff --git a/Core/inc/StochasticDiracDelta.h b/Core/inc/StochasticDiracDelta.h index 3f812187de9..daa6040a6a9 100644 --- a/Core/inc/StochasticDiracDelta.h +++ b/Core/inc/StochasticDiracDelta.h @@ -1,8 +1,22 @@ #ifndef STOCHASTICDIRACDELTA_H #define STOCHASTICDIRACDELTA_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file StochasticDiracDelta.h +//! @brief Definition of StochasticDiracDelta class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "IStochasticParameter.h" + template <class T> class StochasticDiracDelta : public StochasticParameter<T> { public: diff --git a/Core/inc/StochasticGaussian.h b/Core/inc/StochasticGaussian.h index d7f55a2f741..5d8fa0849e9 100644 --- a/Core/inc/StochasticGaussian.h +++ b/Core/inc/StochasticGaussian.h @@ -1,8 +1,22 @@ #ifndef STOCHASTICGAUSSIAN_H #define STOCHASTICGAUSSIAN_H +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file StochasticGaussian.h +//! @brief Definition of StochasticGaussian class +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include "IStochasticParameter.h" + class StochasticDoubleGaussian : public StochasticParameter<double> { public: diff --git a/Core/inc/Types.h b/Core/inc/Types.h index f1a4c43b9b9..db0add88bce 100644 --- a/Core/inc/Types.h +++ b/Core/inc/Types.h @@ -1,6 +1,18 @@ #ifndef TYPES_H #define TYPES_H - +// ******************************************************************** +// * The BornAgain project * +// * Simulation of neutron and x-ray scattering at grazing incidence * +// * * +// * LICENSE AND DISCLAIMER * +// * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris * +// * eget quam orci. Quisque porta varius dui, quis posuere nibh * +// * mollis quis. Mauris commodo rhoncus porttitor. * +// ******************************************************************** +//! @file Types.h +//! @brief Definition of Types +//! @author Scientific Computing Group at FRM II +//! @date 01.04.2012 #include <complex> #include <vector> @@ -8,7 +20,6 @@ typedef std::complex<double > complex_t; - // we need forward declaration here to be able to redefine ostream as friend template<typename T> class KVector; template<typename T> std::ostream& operator<< (std::ostream& o, const KVector<T>& ); diff --git a/Core/src/ISample.cpp b/Core/src/ISample.cpp index 7db811f1218..6b6506da6f3 100644 --- a/Core/src/ISample.cpp +++ b/Core/src/ISample.cpp @@ -3,6 +3,5 @@ void ISample::add(ISample* /*p_child*/) { - (void)p_child; throw NotImplementedException("This sample class is not allowed to have subsamples."); } -- GitLab