diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d2d9bc3d6518bdc652d7a88ca4a2c4f85a2d04a..0d889ff730beab09113900336eb5b71908e016ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,9 +175,6 @@ if(BORNAGAIN_TIDY) set(CMAKE_CXX_CLANG_TIDY "clang-tidy") # has effect only if compiler is clang; uses .clang-tidy endif() -################################## TEMPORARY formfactor #################################### -add_subdirectory(ff) - # core components foreach(lib ${CoreComponents}) add_subdirectory(${lib}) diff --git a/Sample/CMakeLists.txt b/Sample/CMakeLists.txt index 984853ecc027c13e69e43537c4e0e93f18e05e59..20fdf3f58614f6823ea917daee355896000396f9 100644 --- a/Sample/CMakeLists.txt +++ b/Sample/CMakeLists.txt @@ -21,7 +21,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) target_link_libraries(${lib} PUBLIC ${BornAgainParam_LIBRARY} - formfactor + # formfactor ) target_include_directories(${lib} PUBLIC diff --git a/Sample/HardParticle/IFormFactorPolyhedron.cpp b/Sample/HardParticle/IFormFactorPolyhedron.cpp index 6b1f9d4894ec3f964e4feaaccc94c16a34262614..85ab2068bb2896a42556c4908fddce2ee79a77d6 100644 --- a/Sample/HardParticle/IFormFactorPolyhedron.cpp +++ b/Sample/HardParticle/IFormFactorPolyhedron.cpp @@ -17,8 +17,8 @@ //! "Form factor (Fourier shape transform) of polygon and polyhedron." #include "Sample/HardParticle/IFormFactorPolyhedron.h" -#include <ff/PolyhedralComponents.h> -#include <ff/Polyhedron.h> +#include "Sample/ff/PolyhedralComponents.h" +#include "Sample/ff/Polyhedron.h" // #ifdef ALGORITHM_DIAGNOSTIC // TODO restore // void IFormFactorPolyhedron::setLimits(double _q, int _n) diff --git a/Sample/HardParticle/IFormFactorPolyhedron.h b/Sample/HardParticle/IFormFactorPolyhedron.h index 062bf4d2312998312faddef47ceab237722affa2..b499bdbca82dab65c8d85128c52a0fa87949d738 100644 --- a/Sample/HardParticle/IFormFactorPolyhedron.h +++ b/Sample/HardParticle/IFormFactorPolyhedron.h @@ -17,7 +17,7 @@ #define BORNAGAIN_SAMPLE_HARDPARTICLE_IFORMFACTORPOLYHEDRON_H #include "Sample/Scattering/IBornFF.h" -#include <ff/PolyhedralTopology.h> +#include "Sample/ff/PolyhedralTopology.h" #include <memory> namespace ff { diff --git a/Sample/HardParticle/Prism.h b/Sample/HardParticle/Prism.h index 263e7ca272f6ae8b7257677c9d793e9f4408d0a2..443f58a91b0dae98151f928c7eef9ca8c27c710b 100644 --- a/Sample/HardParticle/Prism.h +++ b/Sample/HardParticle/Prism.h @@ -20,8 +20,8 @@ #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_PRISM_H #define BORNAGAIN_SAMPLE_HARDPARTICLE_PRISM_H -#include <ff/PolyhedralComponents.h> -#include <ff/PolyhedralTopology.h> +#include "Sample/ff/PolyhedralComponents.h" +#include "Sample/ff/PolyhedralTopology.h" #include <memory> class Prism { diff --git a/ff/Factorial.h b/Sample/ff/Factorial.h similarity index 100% rename from ff/Factorial.h rename to Sample/ff/Factorial.h diff --git a/ff/PolyhedralComponents.cpp b/Sample/ff/PolyhedralComponents.cpp similarity index 99% rename from ff/PolyhedralComponents.cpp rename to Sample/ff/PolyhedralComponents.cpp index 59937d13097bd02973904623af09a05953dc7341..c8ed8e33987c1f27bde51c900b87d01406da1ca8 100644 --- a/ff/PolyhedralComponents.cpp +++ b/Sample/ff/PolyhedralComponents.cpp @@ -12,8 +12,8 @@ // // ************************************************************************************************ -#include "ff/PolyhedralComponents.h" -#include "ff/Factorial.h" +#include "Sample/ff/PolyhedralComponents.h" +#include "Sample/ff/Factorial.h" #include <iomanip> #include <stdexcept> diff --git a/ff/PolyhedralComponents.h b/Sample/ff/PolyhedralComponents.h similarity index 100% rename from ff/PolyhedralComponents.h rename to Sample/ff/PolyhedralComponents.h diff --git a/ff/PolyhedralTopology.h b/Sample/ff/PolyhedralTopology.h similarity index 100% rename from ff/PolyhedralTopology.h rename to Sample/ff/PolyhedralTopology.h diff --git a/ff/Polyhedron.cpp b/Sample/ff/Polyhedron.cpp similarity index 98% rename from ff/Polyhedron.cpp rename to Sample/ff/Polyhedron.cpp index 87584be8bc522e0454f21be6a563fe6b03c98a18..684e1be305ad3cc68c46d8040e40770061bb16db 100644 --- a/ff/Polyhedron.cpp +++ b/Sample/ff/Polyhedron.cpp @@ -16,9 +16,9 @@ //! by Joachim Wuttke, entitled //! "Numerically stable form factor of any polygon and polyhedron" -#include "ff/Polyhedron.h" -#include "ff/PolyhedralComponents.h" -#include "ff/PolyhedralTopology.h" +#include "Sample/ff/Polyhedron.h" +#include "Sample/ff/PolyhedralComponents.h" +#include "Sample/ff/PolyhedralTopology.h" #include <stdexcept> #ifdef ALGORITHM_DIAGNOSTIC_LEVEL2 diff --git a/ff/Polyhedron.h b/Sample/ff/Polyhedron.h similarity index 100% rename from ff/Polyhedron.h rename to Sample/ff/Polyhedron.h diff --git a/Tests/Unit/Numeric/FormFactorSpecializationTest.cpp b/Tests/Unit/Numeric/FormFactorSpecializationTest.cpp index 310073a56dc34b273a7ce67d4e83aebccbc6198b..969198eb0907686a27d50aa77c96a14a5317ba17 100644 --- a/Tests/Unit/Numeric/FormFactorSpecializationTest.cpp +++ b/Tests/Unit/Numeric/FormFactorSpecializationTest.cpp @@ -1,7 +1,7 @@ #include "Sample/HardParticle/HardParticles.h" #include "Tests/GTestWrapper/google_test.h" #include "Tests/Unit/Numeric/MultiQTestbed.h" -#include <ff/PolyhedralComponents.h> // for diagnostic +#include "Sample/ff/PolyhedralComponents.h" // for diagnostic //! Compare form factor for particle shapes A and B, where A is given special //! parameter values so that it coincides with the more symmetric B. diff --git a/Tests/Unit/Numeric/FormFactorSymmetryTest.cpp b/Tests/Unit/Numeric/FormFactorSymmetryTest.cpp index 699940631a3dc38c49c65a8ba7a5dce23b6fe30f..283348d77fb0dadae68c5f5df3c052d9bebd69e3 100644 --- a/Tests/Unit/Numeric/FormFactorSymmetryTest.cpp +++ b/Tests/Unit/Numeric/FormFactorSymmetryTest.cpp @@ -2,7 +2,7 @@ #include "Sample/HardParticle/HardParticles.h" #include "Tests/GTestWrapper/google_test.h" #include "Tests/Unit/Numeric/MultiQTestbed.h" -#include <ff/PolyhedralComponents.h> // for diagnostic +#include "Sample/ff/PolyhedralComponents.h" // for diagnostic //! Check that form factors are invariant when q is transformed according to particle symmetry. diff --git a/auto/Wrap/doxygenSample.i b/auto/Wrap/doxygenSample.i index a0b9d4145340eeb7f5b2954a58fde128083ef636..7cfdd889e5e8ecaa32c3eae8e12f57c394a41a97 100644 --- a/auto/Wrap/doxygenSample.i +++ b/auto/Wrap/doxygenSample.i @@ -5046,6 +5046,154 @@ Sets the relative weight of this layout. "; +// File: classff_1_1PolygonalTopology.xml +%feature("docstring") ff::PolygonalTopology " + +For internal use in PolyhedralFace. + +C++ includes: PolyhedralTopology.h +"; + + +// File: classff_1_1PolyhedralEdge.xml +%feature("docstring") ff::PolyhedralEdge " + +One edge of a polygon, for form factor computation. + +C++ includes: PolyhedralComponents.h +"; + +%feature("docstring") ff::PolyhedralEdge::PolyhedralEdge "ff::PolyhedralEdge::PolyhedralEdge(R3 Vlow, R3 Vhig) +"; + +%feature("docstring") ff::PolyhedralEdge::E "R3 ff::PolyhedralEdge::E() const +"; + +%feature("docstring") ff::PolyhedralEdge::R "R3 ff::PolyhedralEdge::R() const +"; + +%feature("docstring") ff::PolyhedralEdge::qE "complex_t ff::PolyhedralEdge::qE(C3 q) const +"; + +%feature("docstring") ff::PolyhedralEdge::qR "complex_t ff::PolyhedralEdge::qR(C3 q) const +"; + +%feature("docstring") ff::PolyhedralEdge::contrib "complex_t ff::PolyhedralEdge::contrib(int m, C3 qpa, complex_t qrperp) const + +Returns sum_l=0^M/2 u^2l v^(M-2l) / (2l+1)!(M-2l)! - vperp^M/M! +"; + + +// File: classff_1_1PolyhedralFace.xml +%feature("docstring") ff::PolyhedralFace " + +A polygon, for form factor computation. + +C++ includes: PolyhedralComponents.h +"; + +%feature("docstring") ff::PolyhedralFace::PolyhedralFace "ff::PolyhedralFace::PolyhedralFace(const std::vector< R3 > &_V=std::vector< R3 >(), bool _sym_S2=false) + +Sets internal variables for given vertex chain. + +Parameters: +----------- + +V: +oriented vertex list + +_sym_S2: +true if face has a perpedicular two-fold symmetry axis +"; + +%feature("docstring") ff::PolyhedralFace::area "double ff::PolyhedralFace::area() const +"; + +%feature("docstring") ff::PolyhedralFace::pyramidalVolume "double ff::PolyhedralFace::pyramidalVolume() const +"; + +%feature("docstring") ff::PolyhedralFace::radius3d "double ff::PolyhedralFace::radius3d() const +"; + +%feature("docstring") ff::PolyhedralFace::normalProjectionConj "complex_t ff::PolyhedralFace::normalProjectionConj(C3 q) const + +Returns conj(q)*normal [BasicVector3D::dot is antilinear in 'this' argument]. +"; + +%feature("docstring") ff::PolyhedralFace::ff_n "complex_t ff::PolyhedralFace::ff_n(int n, C3 q) const + +Returns contribution qn*f_n [of order q^(n+1)] from this face to the polyhedral form factor. +"; + +%feature("docstring") ff::PolyhedralFace::ff "complex_t ff::PolyhedralFace::ff(C3 q, bool sym_Ci) const + +Returns the contribution ff(q) of this face to the polyhedral form factor. +"; + +%feature("docstring") ff::PolyhedralFace::ff_2D "complex_t ff::PolyhedralFace::ff_2D(C3 qpa) const + +Returns the two-dimensional form factor of this face, for use in a prism. +"; + +%feature("docstring") ff::PolyhedralFace::ff_2D_direct "complex_t ff::PolyhedralFace::ff_2D_direct(C3 qpa) const + +Two-dimensional form factor, for use in prism, from sum over edge form factors. +"; + +%feature("docstring") ff::PolyhedralFace::ff_2D_expanded "complex_t ff::PolyhedralFace::ff_2D_expanded(C3 qpa) const + +Two-dimensional form factor, for use in prism, from power series. +"; + +%feature("docstring") ff::PolyhedralFace::assert_Ci "void ff::PolyhedralFace::assert_Ci(const PolyhedralFace &other) const + +Throws if deviation from inversion symmetry is detected. Does not check vertices. +"; + + +// File: classff_1_1PolyhedralTopology.xml +%feature("docstring") ff::PolyhedralTopology " + +For internal use in IFormFactorPolyhedron. + +C++ includes: PolyhedralTopology.h +"; + + +// File: classff_1_1Polyhedron.xml +%feature("docstring") ff::Polyhedron " + +A polyhedron, implementation class for use in IFormFactorPolyhedron. + +C++ includes: Polyhedron.h +"; + +%feature("docstring") ff::Polyhedron::Polyhedron "ff::Polyhedron::Polyhedron(const PolyhedralTopology &topology, double z_bottom, const std::vector< R3 > &vertices) +"; + +%feature("docstring") ff::Polyhedron::Polyhedron "ff::Polyhedron::Polyhedron(const Polyhedron &)=delete +"; + +%feature("docstring") ff::Polyhedron::assert_platonic "void ff::Polyhedron::assert_platonic() const +"; + +%feature("docstring") ff::Polyhedron::volume "double ff::Polyhedron::volume() const +"; + +%feature("docstring") ff::Polyhedron::radius "double ff::Polyhedron::radius() const +"; + +%feature("docstring") ff::Polyhedron::vertices "const std::vector< R3 > ff::Polyhedron::vertices() const +"; + +%feature("docstring") ff::Polyhedron::evaluate_for_q "complex_t ff::Polyhedron::evaluate_for_q(const C3 &q) const + +needed for topZ, bottomZ computation + +Returns the form factor F(q) of this polyhedron, respecting the offset z_bottom. +"; + + // File: classPrism.xml %feature("docstring") Prism ""; @@ -5419,43 +5567,43 @@ C++ includes: ZLimits.h "; -// File: namespace_0d124.xml +// File: namespace_0d130.xml -// File: namespace_0d128.xml +// File: namespace_0d134.xml -// File: namespace_0d132.xml +// File: namespace_0d138.xml -// File: namespace_0d142.xml +// File: namespace_0d148.xml -// File: namespace_0d144.xml +// File: namespace_0d150.xml // File: namespace_0d16.xml -// File: namespace_0d173.xml +// File: namespace_0d179.xml // File: namespace_0d2.xml -// File: namespace_0d201.xml +// File: namespace_0d207.xml -// File: namespace_0d214.xml +// File: namespace_0d220.xml -// File: namespace_0d224.xml +// File: namespace_0d230.xml -// File: namespace_0d246.xml +// File: namespace_0d252.xml -// File: namespace_0d259.xml +// File: namespace_0d265.xml // File: namespace_0d36.xml @@ -5470,6 +5618,15 @@ C++ includes: ZLimits.h // File: namespace_0d44.xml +// File: namespace_0d46.xml + + +// File: namespace_0d47.xml + + +// File: namespace_0d50.xml + + // File: namespacebake.xml %feature("docstring") bake::CubicLattice "Lattice3D bake::CubicLattice(double a) @@ -5720,6 +5877,13 @@ Returns a body-centered cubic (cI) lattice with edge length a. TODO: Clarify mea // File: namespaceff.xml +// File: namespaceff__aux.xml +%feature("docstring") ff_aux::generateReciprocalFactorialArray "constexpr std::array<double, N> ff_aux::generateReciprocalFactorialArray() + +Returns a compile-time generated std::array of reciprocal factorials. +"; + + // File: namespaceMaterialUtils.xml %feature("docstring") MaterialUtils::ScalarReducedPotential "complex_t MaterialUtils::ScalarReducedPotential(complex_t n, R3 k, double n_ref) @@ -5978,6 +6142,24 @@ Used by the hard sphere and by several soft sphere classes. // File: IPeakShape_8h.xml +// File: Factorial_8h.xml + + +// File: PolyhedralComponents_8cpp.xml + + +// File: PolyhedralComponents_8h.xml + + +// File: PolyhedralTopology_8h.xml + + +// File: Polyhedron_8cpp.xml + + +// File: Polyhedron_8h.xml + + // File: FormFactorAnisoPyramid_8cpp.xml @@ -6750,6 +6932,9 @@ Generate vertices of centered ellipse with given semi-axes at height z. // File: dir_7b210e8d28f50f0c519681ee1b473363.xml +// File: dir_8dce49f7ddb29807dd12921987aafe35.xml + + // File: dir_844f24c588eea1b259def164cc466f1a.xml diff --git a/ff/CMakeLists.txt b/ff/CMakeLists.txt deleted file mode 100644 index 8dc836ac3c259ae48f6d63f51a3c2935c5010230..0000000000000000000000000000000000000000 --- a/ff/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(lib formfactor) - -file(GLOB src_files *.cpp) -set(api_files Polyhedron.h PolyhedralTopology.h PolyhedralComponents.h) - -add_library(${lib} ${src_files}) - -target_include_directories(${lib} - PUBLIC - $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> - $<INSTALL_INTERFACE:include> - ) -target_include_directories(${lib} PRIVATE ${LibHeinz_INCLUDE_DIR}) - -set_target_properties( - ${lib} PROPERTIES - OUTPUT_NAME ${lib} - VERSION ${formfactor_VERSION} - SOVERSION ${formfactor_VERSION_MAJOR}) - -install( - TARGETS ${lib} - EXPORT formfactorTargets - LIBRARY DESTINATION lib - RUNTIME DESTINATION lib - ARCHIVE DESTINATION lib - COMPONENT Libraries) - -install( - FILES ${api_files} - DESTINATION include/ff - COMPONENT Headers)