diff --git a/src/language/modules/SchemeModule.cpp b/src/language/modules/SchemeModule.cpp index b9b789cfa8e3d7bc5328062c6085217dbe142120..f2570a3c30b911990e9d8d2c12f7bc2de673f4a6 100644 --- a/src/language/modules/SchemeModule.cpp +++ b/src/language/modules/SchemeModule.cpp @@ -65,6 +65,9 @@ #include <utils/checkpointing/WriteIQuadratureDescriptor.hpp> #include <utils/checkpointing/WriteVariableBCDescriptor.hpp> +#warning REMOVE +#include <scheme/test_reconstruction.hpp> + #include <memory> SchemeModule::SchemeModule() @@ -756,6 +759,12 @@ SchemeModule::SchemeModule() )); + this->_addBuiltinFunction("test_reconstruction", std::function{[](std::shared_ptr<const DiscreteFunctionVariant> df, + size_t degree, size_t number) -> void { + // + test_reconstruction(df, degree, number); + }}); + MathFunctionRegisterForVh{*this}; } diff --git a/src/scheme/CMakeLists.txt b/src/scheme/CMakeLists.txt index e5ce50e9e702998c8b2f385ee89a75608b3e2305..c299cd24f1ac2faae22b6b93d86a31bab00bb8bf 100644 --- a/src/scheme/CMakeLists.txt +++ b/src/scheme/CMakeLists.txt @@ -12,6 +12,8 @@ add_library( HyperelasticSolver.cpp LoadBalancer.cpp PolynomialReconstruction.cpp + + test_reconstruction.cpp ) target_link_libraries( diff --git a/src/scheme/test_reconstruction.cpp b/src/scheme/test_reconstruction.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec106f4975653c5b154b6b70f67685b91db88136 --- /dev/null +++ b/src/scheme/test_reconstruction.cpp @@ -0,0 +1,19 @@ +#include <scheme/test_reconstruction.hpp> + +#include <scheme/PolynomialReconstruction.hpp> +#include <utils/Timer.hpp> + +void +test_reconstruction(std::shared_ptr<const DiscreteFunctionVariant> df, size_t degree, size_t number) +{ + PolynomialReconstructionDescriptor descriptor{IntegrationMethodType::boundary, degree}; + PolynomialReconstruction rec_builder{descriptor}; + + Timer t; + + for (size_t i = 0; i < number; ++i) { + auto rec = rec_builder.build(df); + } + + std::cout << "*** Elapsed time for " << number << " reconstructions: " << t.seconds() << "s ***\n"; +} diff --git a/src/scheme/test_reconstruction.hpp b/src/scheme/test_reconstruction.hpp new file mode 100644 index 0000000000000000000000000000000000000000..36ed481ec14f5edc34a677e3fc16d838e1bb6cf1 --- /dev/null +++ b/src/scheme/test_reconstruction.hpp @@ -0,0 +1,8 @@ +#ifndef TEST_RECONSTRUCTION_HPP +#define TEST_RECONSTRUCTION_HPP + +#include <scheme/DiscreteFunctionVariant.hpp> +#warning REMOVE +void test_reconstruction(std::shared_ptr<const DiscreteFunctionVariant> df, size_t degree, size_t number); + +#endif // TEST_RECONSTRUCTION_HPP