From 8b16019183f93902acd27ad7106e6068a0bae839 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Tue, 13 Dec 2022 10:44:44 +0100 Subject: [PATCH] consolidate Polyhedra.cpp --- Sample/HardParticle/Polyhedra.cpp | 211 +----------------------------- 1 file changed, 4 insertions(+), 207 deletions(-) diff --git a/Sample/HardParticle/Polyhedra.cpp b/Sample/HardParticle/Polyhedra.cpp index b18399a6d77..ed113f7d882 100644 --- a/Sample/HardParticle/Polyhedra.cpp +++ b/Sample/HardParticle/Polyhedra.cpp @@ -12,9 +12,12 @@ // // ************************************************************************************************ +#include "Sample/HardParticle/Polyhedra.h" + +#include "Base/Math/Constants.h" #include "Base/Math/Functions.h" #include "Base/Util/Assert.h" -#include "Sample/HardParticle/Polyhedra.h" +#include <ff/Make.h> Box::Box(const std::vector<double> P) : IFormFactorPrism(P) @@ -55,22 +58,7 @@ std::string Box::validate() const m_validated = true; return ""; } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Prism3.cpp -//! @brief Implements class Prism3. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Prism3::Prism3(const std::vector<double> P) : IFormFactorPrism(P) @@ -85,22 +73,7 @@ Prism3::Prism3(double base_edge, double height) : Prism3(std::vector<double>{base_edge, height}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Prism6.cpp -//! @brief Implements class Prism6. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Prism6::Prism6(const std::vector<double> P) : IFormFactorPrism(P) @@ -115,24 +88,7 @@ Prism6::Prism6(double base_edge, double height) : Prism6(std::vector<double>{base_edge, height}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/PlatonicTetrahedron.cpp -//! @brief Implements class PlatonicTetrahedron. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> PlatonicTetrahedron::PlatonicTetrahedron(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -146,24 +102,7 @@ PlatonicTetrahedron::PlatonicTetrahedron(double edge) : PlatonicTetrahedron(std::vector<double>{edge}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/PlatonicOctahedron.cpp -//! @brief Implements class PlatonicOctahedron. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> PlatonicOctahedron::PlatonicOctahedron(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -177,22 +116,7 @@ PlatonicOctahedron::PlatonicOctahedron(double edge) : PlatonicOctahedron(std::vector<double>{edge}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Dodecahedron.cpp -//! @brief Implements class Dodecahedron. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Dodecahedron::Dodecahedron(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -206,22 +130,7 @@ Dodecahedron::Dodecahedron(double edge) : Dodecahedron(std::vector<double>{edge}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Icosahedron.cpp -//! @brief Implements class Icosahedron. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Icosahedron::Icosahedron(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -235,24 +144,7 @@ Icosahedron::Icosahedron(double edge) : Icosahedron(std::vector<double>{edge}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Pyramid2.cpp -//! @brief Implements class Pyramid2. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Pyramid2::Pyramid2(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -269,24 +161,7 @@ Pyramid2::Pyramid2(double length, double width, double height, double alpha) : Pyramid2(std::vector<double>{length, width, height, alpha}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Pyramid3.cpp -//! @brief Implements class Pyramid3. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" -#include <ff/Make.h> Pyramid3::Pyramid3(const std::vector<double> P) : IFormFactorPolyhedron(P) @@ -302,23 +177,7 @@ Pyramid3::Pyramid3(double base_edge, double height, double alpha) : Pyramid3(std::vector<double>{base_edge, height, alpha}) { } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Pyramid4.cpp -//! @brief Implements class Pyramid4. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" const ff::Topology Pyramid4::topology = {{{{3, 2, 1, 0}, true}, {{0, 1, 5, 4}, false}, @@ -378,23 +237,7 @@ std::string Pyramid4::validate() const m_validated = true; return ""; } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Pyramid6.cpp -//! @brief Implements class Pyramid6. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" const ff::Topology Pyramid6::topology = {{{{5, 4, 3, 2, 1, 0}, true}, {{0, 1, 7, 6}, false}, @@ -465,24 +308,7 @@ std::string Pyramid6::validate() const m_validated = true; return ""; } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/Bipyramid4.cpp -//! @brief Implements class Bipyramid4. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Base/Math/Constants.h" -#include "Base/Math/Functions.h" -#include "Sample/HardParticle/Polyhedra.h" -#include "Sample/HardParticle/Polyhedra.h" const ff::Topology Bipyramid4::topology = {{{{3, 2, 1, 0}, true}, {{0, 1, 5, 4}, false}, @@ -564,21 +390,7 @@ std::string Bipyramid4::validate() const m_validated = true; return ""; } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/CantellatedCube.cpp -//! @brief Implements class CantellatedCube. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" const ff::Topology CantellatedCube::topology = {{ /* 0 */ {{0, 1, 2, 3}, true}, @@ -650,21 +462,7 @@ std::string CantellatedCube::validate() const m_validated = true; return ""; } -// ************************************************************************************************ -// -// BornAgain: simulate and fit reflection and scattering -// -//! @file Sample/HardParticle/TruncatedCube.cpp -//! @brief Implements class TruncatedCube. -//! -//! @homepage http://www.bornagainproject.org -//! @license GNU General Public License v3 or higher (see COPYING) -//! @copyright Forschungszentrum Jülich GmbH 2018 -//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) -// -// ************************************************************************************************ -#include "Sample/HardParticle/Polyhedra.h" const ff::Topology TruncatedCube::topology = {{{{0, 1, 7, 6, 9, 10, 4, 3}, true}, {{0, 2, 1}, false}, @@ -708,7 +506,6 @@ std::string TruncatedCube::validate() const if (c < 0) return jointError({"parameters violate condition removed_length <= 0.5*length"}); - setPolyhedron(topology, -a, {{-c, -a, -a}, {-a, -c, -a}, {-a, -a, -c}, {c, -a, -a}, {a, -c, -a}, {a, -a, -c}, {-c, a, -a}, {-a, c, -a}, {-a, a, -c}, {c, a, -a}, {a, c, -a}, {a, a, -c}, -- GitLab