Loading Unstructured_mesh/Unstructured_mesh.pro +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ HEADERS += \ ../src/UnstructuredMesh/MeshFunctions/ComputeNormals.h \ ../src/UnstructuredMesh/MeshFunctions/EdgesOrientation.h \ ../src/UnstructuredMesh/MeshFunctions/MeshApply.h \ ../src/UnstructuredMesh/MeshFunctions/MeshColouring.h \ ../src/UnstructuredMesh/MeshFunctions/MeshColoring.h \ ../src/UnstructuredMesh/MeshFunctions/MeshConnections.h \ ../src/UnstructuredMesh/MeshFunctions/MeshFunctions.h \ ../src/UnstructuredMesh/MeshFunctions/MeshFunctionsDefine.h \ Loading Unstructured_mesh/main.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -579,13 +579,13 @@ DBGMSG("tessellated cell volume"); } DBGMSG("face to vertex colouring"); auto colours = ColourMesh<2,0>::colour(mesh3); auto colours = ColorMesh<2,0>::color(mesh3); for (auto& face : mesh3.getFaces()){ DBGVAR(face.getIndex(), colours.at(face)); } DBGMSG("vertex to face colouring"); auto colours1 = ColourMesh<0,2>::colour(mesh3); auto colours1 = ColorMesh<0,2>::color(mesh3); for (auto& vert : mesh3.getVertices()){ DBGVAR(vert.getIndex(), colours1.at(vert)); } Loading Loading @@ -635,7 +635,7 @@ void testMeshRefine() { writer.writeHeader(out3D, "test data"); writer.writeToStream(out3D, mesh, types); auto colours = MeshColouring<3,0>::colour(mesh); auto colours = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << mesh.getCells().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading @@ -650,7 +650,7 @@ void testMeshRefine() { out3D.open("mesh_refine_1.vtk"); writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types1); auto colours1 = MeshColouring<3,0>::colour(mesh); auto colours1 = MeshColoring<3,0>::color(mesh); MeshDataContainer<colourData, 3> cd(mesh); auto normals = mesh.computeFaceNormals(); Loading Loading @@ -699,7 +699,7 @@ void testMeshRefine() { writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types2); auto colours2 = MeshColouring<3,0>::colour(mesh); auto colours2 = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << writer1.cellVert.getDataByPos<0>().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading Loading @@ -727,7 +727,7 @@ void testMeshRefine() { out3D.open("mesh_refine_3.vtk"); writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types3); auto colours3 = MeshColouring<3,0>::colour(mesh); auto colours3 = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << writer1.cellVert.getDataByPos<0>().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading src/UnstructuredMesh/MeshDataContainer/MeshDataContainer.h +12 −4 Original line number Diff line number Diff line Loading @@ -18,13 +18,18 @@ struct DataContainer : public std::vector<DataType> { /** * @brief The MeshDataContainer struct<HR> * A struct designed to manage data boud to mesh. * A struct designed to manage data bound to a mesh. * Creates a serie of vectors sized acording to dimension. */ template <typename DataType, unsigned int ...Dimensions> struct MeshDataContainer{ private: /** * @brief The DimensionPos struct * realizes the method indexof in the parameter pack @a Dimensions. * If the searched value is nor present, the index @a pos ran out of bounds. */ template<unsigned int dim, unsigned int pos, unsigned int _dim> struct DimensionPos : DimensionPos<dim, pos + 1,std::get<pos + 1>(std::array<unsigned int, sizeof... (Dimensions)>{Dimensions...})>{}; Loading Loading @@ -506,11 +511,14 @@ public: /** * @brief The MeshDataContainer struct * @brief The MeshDataContainer<std::tuple<DataTypes>, Dimensions> struct<HR> * This specialization of MeshDataContainer allows to declare * a data type for each dimension separately. The data types are * given by a tuple. * * A struct designed to manage data boud to mesh. * Creates a serie of vectors sized acording to dimension. * @example MeshDataContainer<std::tuple<int, double>, 3,2> data; */ template <typename ...DataTypes, unsigned int ...Dimensions> struct MeshDataContainer<std::tuple<DataTypes...>, Dimensions...>{ Loading src/UnstructuredMesh/MeshFunctions/MeshColouring.h→src/UnstructuredMesh/MeshFunctions/MeshColoring.h +7 −7 Original line number Diff line number Diff line Loading @@ -4,10 +4,10 @@ #include "MeshConnections.h" template<unsigned int FromDim, unsigned int ToDim, bool Descend = true> struct MeshColouring { struct MeshColoring { template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ) { MeshDataContainer<unsigned int, FromDim> result(mesh); Loading Loading @@ -62,9 +62,9 @@ struct MeshColouring { template<unsigned int FromDim, unsigned int ToDim> struct MeshColouring <FromDim, ToDim, false> { struct MeshColoring <FromDim, ToDim, false> { template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ) { // resulting container of colours Loading Loading @@ -117,13 +117,13 @@ struct MeshColouring <FromDim, ToDim, false> { template <unsigned int FromDim, unsigned int ToDim> struct ColourMesh{ struct ColorMesh{ template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ){ return MeshColouring<FromDim, ToDim, (FromDim > ToDim)>::colour(mesh); return MeshColoring<FromDim, ToDim, (FromDim > ToDim)>::color(mesh); } }; Loading src/UnstructuredMesh/MeshFunctions/MeshFunctions.h +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ #include "EdgesOrientation.h" #include "MeshConnections.h" #include "MeshNeighborhood.h" #include "MeshColouring.h" #include "MeshColoring.h" Loading Loading
Unstructured_mesh/Unstructured_mesh.pro +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ HEADERS += \ ../src/UnstructuredMesh/MeshFunctions/ComputeNormals.h \ ../src/UnstructuredMesh/MeshFunctions/EdgesOrientation.h \ ../src/UnstructuredMesh/MeshFunctions/MeshApply.h \ ../src/UnstructuredMesh/MeshFunctions/MeshColouring.h \ ../src/UnstructuredMesh/MeshFunctions/MeshColoring.h \ ../src/UnstructuredMesh/MeshFunctions/MeshConnections.h \ ../src/UnstructuredMesh/MeshFunctions/MeshFunctions.h \ ../src/UnstructuredMesh/MeshFunctions/MeshFunctionsDefine.h \ Loading
Unstructured_mesh/main.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -579,13 +579,13 @@ DBGMSG("tessellated cell volume"); } DBGMSG("face to vertex colouring"); auto colours = ColourMesh<2,0>::colour(mesh3); auto colours = ColorMesh<2,0>::color(mesh3); for (auto& face : mesh3.getFaces()){ DBGVAR(face.getIndex(), colours.at(face)); } DBGMSG("vertex to face colouring"); auto colours1 = ColourMesh<0,2>::colour(mesh3); auto colours1 = ColorMesh<0,2>::color(mesh3); for (auto& vert : mesh3.getVertices()){ DBGVAR(vert.getIndex(), colours1.at(vert)); } Loading Loading @@ -635,7 +635,7 @@ void testMeshRefine() { writer.writeHeader(out3D, "test data"); writer.writeToStream(out3D, mesh, types); auto colours = MeshColouring<3,0>::colour(mesh); auto colours = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << mesh.getCells().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading @@ -650,7 +650,7 @@ void testMeshRefine() { out3D.open("mesh_refine_1.vtk"); writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types1); auto colours1 = MeshColouring<3,0>::colour(mesh); auto colours1 = MeshColoring<3,0>::color(mesh); MeshDataContainer<colourData, 3> cd(mesh); auto normals = mesh.computeFaceNormals(); Loading Loading @@ -699,7 +699,7 @@ void testMeshRefine() { writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types2); auto colours2 = MeshColouring<3,0>::colour(mesh); auto colours2 = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << writer1.cellVert.getDataByPos<0>().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading Loading @@ -727,7 +727,7 @@ void testMeshRefine() { out3D.open("mesh_refine_3.vtk"); writer1.writeHeader(out3D, "test data"); writer1.writeToStream(out3D, mesh, types3); auto colours3 = MeshColouring<3,0>::colour(mesh); auto colours3 = MeshColoring<3,0>::color(mesh); out3D << "CELL_DATA " << writer1.cellVert.getDataByPos<0>().size() << endl; out3D << "SCALARS cell_wrt_vertex_colour double 1\nLOOKUP_TABLE default" << endl; Loading
src/UnstructuredMesh/MeshDataContainer/MeshDataContainer.h +12 −4 Original line number Diff line number Diff line Loading @@ -18,13 +18,18 @@ struct DataContainer : public std::vector<DataType> { /** * @brief The MeshDataContainer struct<HR> * A struct designed to manage data boud to mesh. * A struct designed to manage data bound to a mesh. * Creates a serie of vectors sized acording to dimension. */ template <typename DataType, unsigned int ...Dimensions> struct MeshDataContainer{ private: /** * @brief The DimensionPos struct * realizes the method indexof in the parameter pack @a Dimensions. * If the searched value is nor present, the index @a pos ran out of bounds. */ template<unsigned int dim, unsigned int pos, unsigned int _dim> struct DimensionPos : DimensionPos<dim, pos + 1,std::get<pos + 1>(std::array<unsigned int, sizeof... (Dimensions)>{Dimensions...})>{}; Loading Loading @@ -506,11 +511,14 @@ public: /** * @brief The MeshDataContainer struct * @brief The MeshDataContainer<std::tuple<DataTypes>, Dimensions> struct<HR> * This specialization of MeshDataContainer allows to declare * a data type for each dimension separately. The data types are * given by a tuple. * * A struct designed to manage data boud to mesh. * Creates a serie of vectors sized acording to dimension. * @example MeshDataContainer<std::tuple<int, double>, 3,2> data; */ template <typename ...DataTypes, unsigned int ...Dimensions> struct MeshDataContainer<std::tuple<DataTypes...>, Dimensions...>{ Loading
src/UnstructuredMesh/MeshFunctions/MeshColouring.h→src/UnstructuredMesh/MeshFunctions/MeshColoring.h +7 −7 Original line number Diff line number Diff line Loading @@ -4,10 +4,10 @@ #include "MeshConnections.h" template<unsigned int FromDim, unsigned int ToDim, bool Descend = true> struct MeshColouring { struct MeshColoring { template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ) { MeshDataContainer<unsigned int, FromDim> result(mesh); Loading Loading @@ -62,9 +62,9 @@ struct MeshColouring { template<unsigned int FromDim, unsigned int ToDim> struct MeshColouring <FromDim, ToDim, false> { struct MeshColoring <FromDim, ToDim, false> { template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ) { // resulting container of colours Loading Loading @@ -117,13 +117,13 @@ struct MeshColouring <FromDim, ToDim, false> { template <unsigned int FromDim, unsigned int ToDim> struct ColourMesh{ struct ColorMesh{ template<unsigned int MeshDimension, typename IndexType, typename Real, unsigned int ...Reserve> static MeshDataContainer<unsigned int, FromDim> colour( static MeshDataContainer<unsigned int, FromDim> color( MeshElements<MeshDimension, IndexType, Real, Reserve...>& mesh ){ return MeshColouring<FromDim, ToDim, (FromDim > ToDim)>::colour(mesh); return MeshColoring<FromDim, ToDim, (FromDim > ToDim)>::color(mesh); } }; Loading
src/UnstructuredMesh/MeshFunctions/MeshFunctions.h +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ #include "EdgesOrientation.h" #include "MeshConnections.h" #include "MeshNeighborhood.h" #include "MeshColouring.h" #include "MeshColoring.h" Loading