diff --git a/include/NeoFOAM/DSL/coeff.hpp b/include/NeoFOAM/dsl/coeff.hpp similarity index 97% rename from include/NeoFOAM/DSL/coeff.hpp rename to include/NeoFOAM/dsl/coeff.hpp index d2b2a6623..cd91ecdb7 100644 --- a/include/NeoFOAM/DSL/coeff.hpp +++ b/include/NeoFOAM/dsl/coeff.hpp @@ -2,12 +2,12 @@ // SPDX-FileCopyrightText: 2023 NeoFOAM authors #pragma once -namespace NeoFOAM::DSL +namespace NeoFOAM::dsl { /** * @class Coeff - * @brief A class that represents a coefficient for the NeoFOAM DSL. + * @brief A class that represents a coefficient for the NeoFOAM dsl. * * This class stores a single scalar coefficient and optionally span of values. * It is used to delay the evaluation of a scalar multiplication with a field to @@ -107,4 +107,4 @@ inline Coeff operator*(const Coeff& lhs, const Coeff& rhs) return result; } -} // namespace NeoFOAM::DSL +} // namespace NeoFOAM::dsl diff --git a/include/NeoFOAM/DSL/equation.hpp b/include/NeoFOAM/dsl/equation.hpp similarity index 98% rename from include/NeoFOAM/DSL/equation.hpp rename to include/NeoFOAM/dsl/equation.hpp index 87c2f6b01..86ee0109d 100644 --- a/include/NeoFOAM/DSL/equation.hpp +++ b/include/NeoFOAM/dsl/equation.hpp @@ -9,10 +9,10 @@ #include "NeoFOAM/core/primitives/scalar.hpp" #include "NeoFOAM/fields/field.hpp" -#include "NeoFOAM/DSL/operator.hpp" +#include "NeoFOAM/dsl/operator.hpp" #include "NeoFOAM/core/error.hpp" -namespace NeoFOAM::DSL +namespace NeoFOAM::dsl { class Equation @@ -189,4 +189,4 @@ Equation operator-(const Operator& lhs, const Operator& rhs) return equation; } -} // namespace NeoFOAM::DSL +} // namespace NeoFOAM::dsl diff --git a/include/NeoFOAM/DSL/operator.hpp b/include/NeoFOAM/dsl/operator.hpp similarity index 95% rename from include/NeoFOAM/DSL/operator.hpp rename to include/NeoFOAM/dsl/operator.hpp index 64480b7f8..8392a8591 100644 --- a/include/NeoFOAM/DSL/operator.hpp +++ b/include/NeoFOAM/dsl/operator.hpp @@ -10,15 +10,11 @@ #include "NeoFOAM/core/primitives/scalar.hpp" #include "NeoFOAM/fields/field.hpp" -#include "NeoFOAM/core/parallelAlgorithms.hpp" -#include "NeoFOAM/finiteVolume/cellCentred/fields/volumeField.hpp" #include "NeoFOAM/core/input.hpp" -#include "NeoFOAM/DSL/coeff.hpp" +#include "NeoFOAM/dsl/coeff.hpp" -namespace fvcc = NeoFOAM::finiteVolume::cellCentred; - -namespace NeoFOAM::DSL +namespace NeoFOAM::dsl { template @@ -38,10 +34,10 @@ concept HasExplicitOperator = requires(T t) { /* @class OperatorMixin * @brief A mixin class to represent simplify implementations of concrete operators - * in NeoFOAMs DSL + * in NeoFOAMs dsl * * - * @ingroup DSL + * @ingroup dsl */ class OperatorMixin { @@ -70,7 +66,7 @@ class OperatorMixin /* @class Operator - * @brief A class to represent a operator in NeoFOAMs DSL + * @brief A class to represent a operator in NeoFOAMs dsl * * The design here is based on the type erasure design pattern * see https://www.youtube.com/watch?v=4eeESJQk-mw @@ -79,7 +75,7 @@ class OperatorMixin * of Operators e.g Divergence, Laplacian, etc can be stored in a vector of * Operators * - * @ingroup DSL + * @ingroup dsl */ class Operator { @@ -251,4 +247,4 @@ Operator operator*(CoeffFunction coeffFunc, const Operator& lhs) return result; } -} // namespace NeoFOAM::DSL +} // namespace NeoFOAM::dsl diff --git a/include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/forwardEuler.hpp b/include/NeoFOAM/dsl/timeIntegration/forwardEuler.hpp similarity index 72% rename from include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/forwardEuler.hpp rename to include/NeoFOAM/dsl/timeIntegration/forwardEuler.hpp index 3d8b24e96..b5879fa3a 100644 --- a/include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/forwardEuler.hpp +++ b/include/NeoFOAM/dsl/timeIntegration/forwardEuler.hpp @@ -7,10 +7,7 @@ #include #include "NeoFOAM/fields/field.hpp" -#include "NeoFOAM/core/executor/executor.hpp" -#include "NeoFOAM/finiteVolume/cellCentred/timeIntegration/timeIntegration.hpp" -#include "NeoFOAM/mesh/unstructured.hpp" - +#include "NeoFOAM/dsl/timeIntegration/timeIntegration.hpp" namespace NeoFOAM::finiteVolume::cellCentred { @@ -20,7 +17,7 @@ class ForwardEuler : public TimeIntegrationFactory::Register public: - ForwardEuler(const DSL::Equation& eqnSystem, const Dictionary& dict); + ForwardEuler(const dsl::Equation& eqnSystem, const Dictionary& dict); static std::string name() { return "forwardEuler"; } diff --git a/include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/timeIntegration.hpp b/include/NeoFOAM/dsl/timeIntegration/timeIntegration.hpp similarity index 83% rename from include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/timeIntegration.hpp rename to include/NeoFOAM/dsl/timeIntegration/timeIntegration.hpp index b6d7cc8e5..890875efa 100644 --- a/include/NeoFOAM/finiteVolume/cellCentred/timeIntegration/timeIntegration.hpp +++ b/include/NeoFOAM/dsl/timeIntegration/timeIntegration.hpp @@ -7,9 +7,8 @@ #include "NeoFOAM/core/executor/executor.hpp" #include "NeoFOAM/mesh/unstructured.hpp" #include "NeoFOAM/finiteVolume/cellCentred.hpp" - -#include "NeoFOAM/DSL/operator.hpp" -#include "NeoFOAM/DSL/equation.hpp" +#include "NeoFOAM/dsl/operator.hpp" +#include "NeoFOAM/dsl/equation.hpp" #include @@ -19,14 +18,14 @@ namespace NeoFOAM class TimeIntegrationFactory : public RuntimeSelectionFactory< TimeIntegrationFactory, - Parameters> + Parameters> { public: static std::string name() { return "timeIntegrationFactory"; } - TimeIntegrationFactory(const DSL::Equation& eqnSystem, const Dictionary& dict) + TimeIntegrationFactory(const dsl::Equation& eqnSystem, const Dictionary& dict) : eqnSystem_(eqnSystem), dict_(dict) {} @@ -39,7 +38,7 @@ class TimeIntegrationFactory : protected: - DSL::Equation eqnSystem_; + dsl::Equation eqnSystem_; const Dictionary& dict_; }; @@ -55,7 +54,7 @@ class TimeIntegration TimeIntegration(TimeIntegration&& timeIntegrate) : timeIntegrateStrategy_(std::move(timeIntegrate.timeIntegrateStrategy_)) {}; - TimeIntegration(const DSL::Equation& eqnSystem, const Dictionary& dict) + TimeIntegration(const dsl::Equation& eqnSystem, const Dictionary& dict) : timeIntegrateStrategy_( TimeIntegrationFactory::create(dict.get("type"), eqnSystem, dict) ) {}; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86bf09ce3..13fbdd2ab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,7 +30,7 @@ target_sources( "finiteVolume/cellCentred/operators/gaussGreenDiv.cpp" "finiteVolume/cellCentred/interpolation/linear.cpp" "finiteVolume/cellCentred/interpolation/upwind.cpp" - "finiteVolume/cellCentred/timeIntegration/forwardEuler.cpp") + "dsl/timeIntegration/forwardEuler.cpp") include(${CMAKE_SOURCE_DIR}/cmake/Sanitizer.cmake) enable_sanitizers( diff --git a/src/finiteVolume/cellCentred/timeIntegration/forwardEuler.cpp b/src/dsl/timeIntegration/forwardEuler.cpp similarity index 90% rename from src/finiteVolume/cellCentred/timeIntegration/forwardEuler.cpp rename to src/dsl/timeIntegration/forwardEuler.cpp index 8e80367ba..4d21498b9 100644 --- a/src/finiteVolume/cellCentred/timeIntegration/forwardEuler.cpp +++ b/src/dsl/timeIntegration/forwardEuler.cpp @@ -3,9 +3,8 @@ #include -#include "NeoFOAM/finiteVolume/cellCentred/timeIntegration/forwardEuler.hpp" +#include "NeoFOAM/dsl/timeIntegration/forwardEuler.hpp" #include "NeoFOAM/core/error.hpp" -#include "NeoFOAM/core/parallelAlgorithms.hpp" namespace NeoFOAM::finiteVolume::cellCentred { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 80d8ffdce..25609aff4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,7 +6,8 @@ list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras) # has to be first since it adds the main target add_subdirectory(catch2) -# This function creates unit tests. It allows the following keywords: +# include "NeoFOAM/core/parallelAlgorithms.hpp" This function creates unit tests. It allows the +# following keywords: # # * MPI_SIZE: the number of MPI processors to be used, defaults to 1 if not set # * COMMAND: the test command (same behavior as for CMake's add_test), defaults to the test name diff --git a/test/dsl/coeff.cpp b/test/dsl/coeff.cpp index e7c33958e..583fcbd18 100644 --- a/test/dsl/coeff.cpp +++ b/test/dsl/coeff.cpp @@ -8,12 +8,12 @@ #include #include "NeoFOAM/fields/field.hpp" -#include "NeoFOAM/DSL/coeff.hpp" +#include "NeoFOAM/dsl/coeff.hpp" using Field = NeoFOAM::Field; -using Coeff = NeoFOAM::DSL::Coeff; +using Coeff = NeoFOAM::dsl::Coeff; -namespace detail = NeoFOAM::DSL::detail; +namespace detail = NeoFOAM::dsl::detail; TEST_CASE("Coeff") diff --git a/test/dsl/common.hpp b/test/dsl/common.hpp index 434c78e7f..ede411279 100644 --- a/test/dsl/common.hpp +++ b/test/dsl/common.hpp @@ -8,17 +8,19 @@ #include #include "NeoFOAM/fields/field.hpp" -#include "NeoFOAM/DSL/coeff.hpp" -#include "NeoFOAM/DSL/operator.hpp" +#include "NeoFOAM/finiteVolume/cellCentred/fields/volumeField.hpp" +#include "NeoFOAM/dsl/coeff.hpp" +#include "NeoFOAM/dsl/operator.hpp" + +namespace fvcc = NeoFOAM::finiteVolume::cellCentred; using Field = NeoFOAM::Field; -using Coeff = NeoFOAM::DSL::Coeff; -using Operator = NeoFOAM::DSL::Operator; -using OperatorMixin = NeoFOAM::DSL::OperatorMixin; +using Coeff = NeoFOAM::dsl::Coeff; +using Operator = NeoFOAM::dsl::Operator; +using OperatorMixin = NeoFOAM::dsl::OperatorMixin; using Executor = NeoFOAM::Executor; using VolumeField = fvcc::VolumeField; using BoundaryFields = NeoFOAM::BoundaryFields; -namespace fvcc = NeoFOAM::finiteVolume::cellCentred; /* A dummy implementation of a Operator * following the Operator interface */ diff --git a/test/dsl/equation.cpp b/test/dsl/equation.cpp index 11d917a71..42d818ae1 100644 --- a/test/dsl/equation.cpp +++ b/test/dsl/equation.cpp @@ -3,9 +3,9 @@ #define CATCH_CONFIG_RUNNER // Define this before including catch.hpp to create // a custom main #include "common.hpp" -#include "NeoFOAM/DSL/equation.hpp" +#include "NeoFOAM/dsl/equation.hpp" -using Equation = NeoFOAM::DSL::Equation; +using Equation = NeoFOAM::dsl::Equation; TEST_CASE("Equation") { diff --git a/test/finiteVolume/cellCentred/timeIntegration/CMakeLists.txt b/test/dsl/timeIntegration/CMakeLists.txt similarity index 100% rename from test/finiteVolume/cellCentred/timeIntegration/CMakeLists.txt rename to test/dsl/timeIntegration/CMakeLists.txt diff --git a/test/finiteVolume/cellCentred/timeIntegration/timeIntegration.cpp b/test/dsl/timeIntegration/timeIntegration.cpp similarity index 100% rename from test/finiteVolume/cellCentred/timeIntegration/timeIntegration.cpp rename to test/dsl/timeIntegration/timeIntegration.cpp diff --git a/test/finiteVolume/CMakeLists.txt b/test/finiteVolume/CMakeLists.txt index 7213b6f5a..564d38f7b 100644 --- a/test/finiteVolume/CMakeLists.txt +++ b/test/finiteVolume/CMakeLists.txt @@ -4,4 +4,3 @@ add_subdirectory(cellCentred/fields) add_subdirectory(cellCentred/boundary) add_subdirectory(cellCentred/interpolation) -add_subdirectory(cellCentred/timeIntegration)