diff --git a/Unstructured_mesh/Unstructured_mesh.pro b/Unstructured_mesh/Unstructured_mesh.pro index dddbf505555544dfa2544307ee097ef57c18d233..be7540b11f95af4c43b65ae44f5b7f3b3ed1699a 100644 --- a/Unstructured_mesh/Unstructured_mesh.pro +++ b/Unstructured_mesh/Unstructured_mesh.pro @@ -14,12 +14,12 @@ HEADERS += \ ../src/Debug/HTMLLogger.h \ ../src/Debug/VariableExport.h \ ../src/InlineArrayOperations.h \ - ../src/UnstructuredMesh/MeshDataContainer/MemberApproach.h \ + ../src/Traits/MemberApproach/MemberApproach.h \ ../src/UnstructuredMesh/MeshDataContainer/MeshDataContainer.h \ ../src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h \ ../src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h \ - ../src/UnstructuredMesh/MeshDataContainer/Singleton.h \ - ../src/UnstructuredMesh/MeshDataContainer/Traits.h \ + ../src/Singleton/Singleton.h \ + ../src/Traits/Traits.h \ ../src/UnstructuredMesh/MeshElements/CellBoundaryConnection.h \ ../src/UnstructuredMesh/MeshElements/CellConnection.h \ ../src/UnstructuredMesh/MeshElements/ComputationalySignificantElement.h \ @@ -34,5 +34,5 @@ HEADERS += \ ../src/UnstructuredMesh/MeshIO/MeshWriter/VTKMeshWriter.h \ ../src/UnstructuredMesh/UnstructedMeshDefine.h \ ../src/UnstructuredMesh/UnstructuredMesh.h \ - ../src/Vector.h \ - ../src/Vertex.h + ../src/NumericStaticArray/Vector.h \ + ../src/NumericStaticArray/Vertex.h diff --git a/Unstructured_mesh/Unstructured_mesh.pro.user b/Unstructured_mesh/Unstructured_mesh.pro.user index 2a2de9d0b1d0baaea025cda61a2ab95376cd874c..07c45b2e9706bd47f53e67f40bd750b2d665dc23 100644 --- a/Unstructured_mesh/Unstructured_mesh.pro.user +++ b/Unstructured_mesh/Unstructured_mesh.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.10.0, 2019-11-19T14:29:57. --> +<!-- Written by QtCreator 4.10.0, 2019-11-19T15:30:25. --> <qtcreator> <data> <variable>EnvironmentId</variable> diff --git a/Unstructured_mesh/main.cpp b/Unstructured_mesh/main.cpp index 1bca456796f54d1f684d649f38147e7dac9cfe80..97c89f1fa7e50929fae742d9c505e557bd2eb055 100644 --- a/Unstructured_mesh/main.cpp +++ b/Unstructured_mesh/main.cpp @@ -10,7 +10,7 @@ #include "../src/UnstructuredMesh/MeshIO/MeshReader/FPMAMeshReader.h" #include "../src/UnstructuredMesh/MeshIO/MeshWriter/FPMAMeshWriter.h" -#include "../src/UnstructuredMesh/MeshDataContainer/MemberApproach.h" +#include "../src/Traits/MemberApproach/MemberApproach.h" #include <fstream> #include <list> using namespace std; diff --git a/src/Debug/VariableExport.h b/src/Debug/VariableExport.h index 0f2af8cbedd21b7b5484fd21c3bc93768853104c..09dda936c88b2f26fd2938458d05043d50bbedf6 100644 --- a/src/Debug/VariableExport.h +++ b/src/Debug/VariableExport.h @@ -3,7 +3,7 @@ #include <iostream> #include <fstream> #include <string> -#include "../UnstructuredMesh/MeshDataContainer/Traits.h" +#include "../Traits/Traits.h" namespace Detail { diff --git a/src/InlineArrayOperations.h b/src/InlineArrayOperations.h deleted file mode 100644 index 00256779168a75b6dbd2f05b0bfdfaa97f8d8945..0000000000000000000000000000000000000000 --- a/src/InlineArrayOperations.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef INLINE_ARRAY_OPERATIONS_H -#define INLINE_ARRAY_OPERATIONS_H - - -template <unsigned int N, typename Real> -struct inlineScalarProduct { - static inline Real computation(const Real *x, const Real *y){ - return inlineScalarProduct<N-1, Real>::computation(x, y) + x[N-1] * y[N-1]; - } -}; - - -template <typename Real> -struct inlineScalarProduct<1, Real> -{ - static inline double computation(const Real *x, const Real *y){ - return x[0] * y[0]; - } -}; - - - - -template <unsigned int N, typename Real> -struct inlineAddition{ - static inline void computation(Real *res, const Real *x, const Real *y){ - inlineAddition<N-1, Real>::computation(res, x, y); - res[N-1] = x[N-1] + y[N-1]; - } - static inline void computation(Real *x, const Real *y){ - inlineAddition<N-1, Real>::computation(x, y); - x[N-1] += y[N-1]; - } -}; - -template <typename Real> -struct inlineAddition<1, Real>{ - static inline void computation(Real *res, const Real *x, const Real *y){ - res[0] = x[0] + y[0]; - } - static inline void computation(Real *x, const Real *y){ - x[0] += y[0]; - } -}; - - -template <unsigned int N, typename Real> -struct inlineSubtraction{ - static inline void computation(Real *res, const Real *x, const Real *y){ - inlineSubtraction<N-1, Real>::computation(res, x, y); - res[N-1] = x[N-1] - y[N-1]; - } - static inline void computation(Real *x, const Real *y){ - inlineSubtraction<N-1, Real>::computation(x, y); - x[N-1] -= y[N-1]; - } -}; - -template <typename Real> -struct inlineSubtraction<1, Real>{ - static inline void computation(Real *res, const Real *x, const Real *y){ - res[0] = x[0] - y[0]; - } - static inline void computation(Real *x, const Real *y){ - x[0] -= y[0]; - } -}; - - - -template <unsigned int N, typename Real> -struct inlineMultiplication{ - static inline void computation(Real *res, const Real *x, const Real& alpha){ - inlineMultiplication<N-1, Real>::computation(res, x, alpha); - res[N-1] = x[N-1] * alpha; - } - static inline void computation(Real *x, const Real alpha){ - inlineMultiplication<N-1, Real>::computation(x, alpha); - x[N-1] *= alpha; - } -}; - -template <typename Real> -struct inlineMultiplication<1, Real>{ - static inline void computation(Real *res, const Real *x, const Real& alpha){ - res[0] = x[0] * alpha; - } - static inline void computation(Real *x, const Real alpha){ - x[0] *= alpha; - } -}; - - - -#endif // INLINE_ARRAY_OPERATIONS_H diff --git a/src/Vector.h b/src/NumericStaticArray/Vector.h similarity index 100% rename from src/Vector.h rename to src/NumericStaticArray/Vector.h diff --git a/src/Vertex.h b/src/NumericStaticArray/Vertex.h similarity index 100% rename from src/Vertex.h rename to src/NumericStaticArray/Vertex.h diff --git a/src/UnstructuredMesh/MeshDataContainer/Singleton.h b/src/Singleton/Singleton.h similarity index 100% rename from src/UnstructuredMesh/MeshDataContainer/Singleton.h rename to src/Singleton/Singleton.h diff --git a/src/UnstructuredMesh/MeshDataContainer/MemberApproach.h b/src/Traits/MemberApproach/MemberApproach.h similarity index 100% rename from src/UnstructuredMesh/MeshDataContainer/MemberApproach.h rename to src/Traits/MemberApproach/MemberApproach.h diff --git a/src/UnstructuredMesh/MeshDataContainer/Traits.h b/src/Traits/Traits.h similarity index 97% rename from src/UnstructuredMesh/MeshDataContainer/Traits.h rename to src/Traits/Traits.h index f1d67cb5878a6416976f0ee00efb8b3b153301b6..2a24a0a10dce2a2b9558e9ddfe2f35395cefa3c4 100644 --- a/src/UnstructuredMesh/MeshDataContainer/Traits.h +++ b/src/Traits/Traits.h @@ -1,9 +1,9 @@ #ifndef TRAITS_H #define TRAITS_H -#include "MemberApproach.h" +#include "MemberApproach/MemberApproach.h" #include <string> #include <memory> -#include "Singleton.h" +#include "../Singleton/Singleton.h" template<typename Class, typename...Types> class Traits { @@ -117,7 +117,7 @@ public: static constexpr std::false_type is_specialized{}; }; -#include "../../Macros/MacroForEach.h" +#include "../Macros/MacroForEach.h" #define MEMREF_TYPE_CUSTOM(name, memberRef) typename MemberReferenceType<decltype(memberRef)>::type diff --git a/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h b/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h index ab00077174e61d2cb77bcfb4ad503e45344c01c8..74e25233351fcf4006e0dc9d5ae9e0550d60a457 100644 --- a/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h +++ b/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h @@ -1,7 +1,8 @@ #ifndef VTKMESHDATAREADER_H #define VTKMESHDATAREADER_H -#include "../Traits.h" +#include "../../../Traits/Traits.h" #include "../MeshDataContainer.h" +#include "../../../Debug/Debug.h" #include <istream> #include <map> #include <sstream> diff --git a/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h b/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h index 59ad59bad6b44950a98ebcef1a719b0b1370bf95..90a8b15cb1aaec80275d5a23688cf594e2f3106b 100644 --- a/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h +++ b/src/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h @@ -1,7 +1,8 @@ #ifndef VTKMESHDATAWRITER_H #define VTKMESHDATAWRITER_H -#include "../Traits.h" +#include "../../../Traits/Traits.h" #include "../MeshDataContainer.h" +#include "../../../Debug/Debug.h" #include "../../MeshIO/MeshWriter/VTKMeshWriter.h" #include <ostream> diff --git a/src/UnstructuredMesh/MeshElements/ComputationalySignificantElement.h b/src/UnstructuredMesh/MeshElements/ComputationalySignificantElement.h index 69efb58f8b9d03e3477d105a9f2b55807176c39a..c8e1dbe6a7937848723793267f295c697e5d7da8 100644 --- a/src/UnstructuredMesh/MeshElements/ComputationalySignificantElement.h +++ b/src/UnstructuredMesh/MeshElements/ComputationalySignificantElement.h @@ -1,6 +1,6 @@ #ifndef COMPUTATIONALY_SIGNIFICANT_ELEMENT_H #define COMPUTATIONALY_SIGNIFICANT_ELEMENT_H -#include "../../Vertex.h" +#include "../../NumericStaticArray/Vertex.h" template <unsigned int MeshDim, typename Real> class ComputationallySignificantElement diff --git a/src/UnstructuredMesh/MeshElements/MeshElement.h b/src/UnstructuredMesh/MeshElements/MeshElement.h index d7978fa46e152beb1b369c2858dfc474cb3c2788..a3efb53b50fb09348068eb2c827bd32f2f26f36a 100644 --- a/src/UnstructuredMesh/MeshElements/MeshElement.h +++ b/src/UnstructuredMesh/MeshElements/MeshElement.h @@ -1,7 +1,7 @@ #ifndef MESH_ELEMENT_H #define MESH_ELEMENT_H #include "../UnstructedMeshDefine.h" -#include "../../Vertex.h" +#include "../../NumericStaticArray/Vertex.h" #include "CellBoundaryConnection.h" #include "ComputationalySignificantElement.h" #include "type_traits" diff --git a/src/UnstructuredMesh/MeshFunctions/MeshFunctions.h b/src/UnstructuredMesh/MeshFunctions/MeshFunctions.h index 5f0f203953b0764aa7c1b8cdd0916da87f3a46a5..e8608c7d2a3487e113a74a156abf91f19c547997 100644 --- a/src/UnstructuredMesh/MeshFunctions/MeshFunctions.h +++ b/src/UnstructuredMesh/MeshFunctions/MeshFunctions.h @@ -3,7 +3,7 @@ #define MESH_FUNCTIONS_H #include "../MeshElements/MeshElement.h" #include "../MeshDataContainer/MeshDataContainer.h" -#include "../../Vector.h" +#include "../../NumericStaticArray/Vector.h" #include <valarray> #include <functional> #include <set> diff --git a/src/UnstructuredMesh/MeshIO/MeshWriter/MeshWriter.h b/src/UnstructuredMesh/MeshIO/MeshWriter/MeshWriter.h index c44dd8e7491700ed2a43a5ab2c0b5252fa62ccb1..950f73a03a953be33d51154ddd9248fe921d588f 100644 --- a/src/UnstructuredMesh/MeshIO/MeshWriter/MeshWriter.h +++ b/src/UnstructuredMesh/MeshIO/MeshWriter/MeshWriter.h @@ -1,7 +1,7 @@ #ifndef MESHWRITER_H #define MESHWRITER_H #include "../MeshNativeType.h" -#include "../../../Vertex.h" +#include "../../../NumericStaticArray/Vertex.h" #include "../../MeshElements/MeshElement.h" template<unsigned int MeshDimension>