From cdb5b74f532fc937702752e7588d1ab8acf76e9b Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Thu, 2 May 2024 12:26:47 +0100 Subject: [PATCH] Added ``curved'' field for Datalayout of Element and Elements2D Signed-off-by: Umberto Zerbinati --- libsrc/meshing/meshtype.cpp | 2 +- libsrc/meshing/meshtype.hpp | 10 ++++++---- libsrc/meshing/python_mesh.cpp | 10 +++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index c082e767..dfc8663a 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -216,7 +216,7 @@ namespace netgen orderx = ordery = 1; refflag = 1; strongrefflag = false; - is_curved = false; + is_curved = 0; } Element2d :: Element2d (int anp) diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 62d9f0b8..c9528c61 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -423,7 +423,7 @@ namespace netgen // Set a new property for each element, to // control whether it is visible or not bool visible:1; // element visible - bool is_curved:1; // element is (high order) curved + bool is_curved; // element is (high order) curved /// order for hp-FEM unsigned int orderx:6; unsigned int ordery:6; @@ -440,7 +440,8 @@ namespace netgen { "pnum", offsetof(Element2d, pnum)}, { "index", offsetof(Element2d, index) }, { "np", offsetof(Element2d, np) }, - { "refine", offsetof(Element2d, refflag) } + { "refine", offsetof(Element2d, refflag) }, + { "curved", offsetof(Element2d, is_curved)} }); } @@ -741,7 +742,7 @@ namespace netgen unsigned int levelz:6; */ /// stored shape-badness of element float badness; - bool is_curved:1; // element is (high order) curved + bool is_curved; // element is (high order) curved class flagstruct { public: @@ -767,7 +768,8 @@ namespace netgen { "pnum", offsetof(Element, pnum)}, { "index", offsetof(Element, index) }, { "np", offsetof(Element, np) }, - { "refine", offsetof(Element, flags.refflag) } + { "refine", offsetof(Element, flags.refflag) }, + { "curved", offsetof(Element, is_curved)} }); } diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index f7bd1e22..15a29c47 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -466,7 +466,11 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::detail::field_descriptor { "refine", data_layout["refine"], sizeof(bool), py::format_descriptor::format(), - py::detail::npy_format_descriptor::dtype() } + py::detail::npy_format_descriptor::dtype() }, + py::detail::field_descriptor { + "curved", data_layout["curved"], sizeof(bool), + py::format_descriptor::format(), + py::detail::npy_format_descriptor::dtype()} }); } @@ -557,6 +561,10 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) py::detail::field_descriptor { "refine", data_layout["refine"], sizeof(bool), py::format_descriptor::format(), + py::detail::npy_format_descriptor::dtype() }, + py::detail::field_descriptor { + "curved", data_layout["curved"], sizeof(bool), + py::format_descriptor::format(), py::detail::npy_format_descriptor::dtype() } }); }