Added ``curved'' field for Datalayout of Element and Elements2D

Signed-off-by: Umberto Zerbinati <zerbinati@maths.ox.ac.uk>
This commit is contained in:
Umberto Zerbinati 2024-05-02 12:26:47 +01:00
parent 331e47830e
commit cdb5b74f53
3 changed files with 16 additions and 6 deletions

View File

@ -216,7 +216,7 @@ namespace netgen
orderx = ordery = 1; orderx = ordery = 1;
refflag = 1; refflag = 1;
strongrefflag = false; strongrefflag = false;
is_curved = false; is_curved = 0;
} }
Element2d :: Element2d (int anp) Element2d :: Element2d (int anp)

View File

@ -423,7 +423,7 @@ namespace netgen
// Set a new property for each element, to // Set a new property for each element, to
// control whether it is visible or not // control whether it is visible or not
bool visible:1; // element visible 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 /// order for hp-FEM
unsigned int orderx:6; unsigned int orderx:6;
unsigned int ordery:6; unsigned int ordery:6;
@ -440,7 +440,8 @@ namespace netgen
{ "pnum", offsetof(Element2d, pnum)}, { "pnum", offsetof(Element2d, pnum)},
{ "index", offsetof(Element2d, index) }, { "index", offsetof(Element2d, index) },
{ "np", offsetof(Element2d, np) }, { "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; */ unsigned int levelz:6; */
/// stored shape-badness of element /// stored shape-badness of element
float badness; float badness;
bool is_curved:1; // element is (high order) curved bool is_curved; // element is (high order) curved
class flagstruct { class flagstruct {
public: public:
@ -767,7 +768,8 @@ namespace netgen
{ "pnum", offsetof(Element, pnum)}, { "pnum", offsetof(Element, pnum)},
{ "index", offsetof(Element, index) }, { "index", offsetof(Element, index) },
{ "np", offsetof(Element, np) }, { "np", offsetof(Element, np) },
{ "refine", offsetof(Element, flags.refflag) } { "refine", offsetof(Element, flags.refflag) },
{ "curved", offsetof(Element, is_curved)}
}); });
} }

View File

@ -466,7 +466,11 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
py::detail::field_descriptor { py::detail::field_descriptor {
"refine", data_layout["refine"], sizeof(bool), "refine", data_layout["refine"], sizeof(bool),
py::format_descriptor<bool>::format(), py::format_descriptor<bool>::format(),
py::detail::npy_format_descriptor<bool>::dtype() } py::detail::npy_format_descriptor<bool>::dtype() },
py::detail::field_descriptor {
"curved", data_layout["curved"], sizeof(bool),
py::format_descriptor<bool>::format(),
py::detail::npy_format_descriptor<bool>::dtype()}
}); });
} }
@ -557,6 +561,10 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
py::detail::field_descriptor { py::detail::field_descriptor {
"refine", data_layout["refine"], sizeof(bool), "refine", data_layout["refine"], sizeof(bool),
py::format_descriptor<bool>::format(), py::format_descriptor<bool>::format(),
py::detail::npy_format_descriptor<bool>::dtype() },
py::detail::field_descriptor {
"curved", data_layout["curved"], sizeof(bool),
py::format_descriptor<bool>::format(),
py::detail::npy_format_descriptor<bool>::dtype() } py::detail::npy_format_descriptor<bool>::dtype() }
}); });
} }