mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
avoid size_t-int narrowing in nginterfacev2 - GetElement
This commit is contained in:
parent
8e7c043ef4
commit
240a132078
@ -116,7 +116,8 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<1> (size_t nr) const
|
||||
template <>
|
||||
NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<2> (size_t nr) const
|
||||
{
|
||||
const Element2d & el = mesh->SurfaceElement (SurfaceElementIndex (nr));
|
||||
// const Element2d & el = mesh->SurfaceElement (SurfaceElementIndex (nr));
|
||||
const Element2d & el = mesh->SurfaceElements()[nr];
|
||||
|
||||
Ng_Element ret;
|
||||
ret.type = NG_ELEMENT_TYPE(el.GetType());
|
||||
@ -155,7 +156,8 @@ NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<2> (size_t nr) const
|
||||
template <>
|
||||
NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<3> (size_t nr) const
|
||||
{
|
||||
const Element & el = mesh->VolumeElement (ElementIndex (nr));
|
||||
// const Element & el = mesh->VolumeElement (ElementIndex (nr));
|
||||
const Element & el = mesh->VolumeElements()[nr];
|
||||
|
||||
Ng_Element ret;
|
||||
ret.type = NG_ELEMENT_TYPE(el.GetType());
|
||||
|
@ -24,8 +24,9 @@ namespace netgen
|
||||
{
|
||||
public:
|
||||
typedef ::netgen::T_POINTS T_POINTS;
|
||||
typedef Array<Element, 0, ElementIndex> T_VOLELEMENTS;
|
||||
typedef Array<Element2d, 0, SurfaceElementIndex> T_SURFELEMENTS;
|
||||
typedef Array<Element, 0, size_t> T_VOLELEMENTS;
|
||||
// typedef Array<Element2d, 0, SurfaceElementIndex> T_SURFELEMENTS;
|
||||
typedef Array<Element2d, 0, size_t> T_SURFELEMENTS;
|
||||
|
||||
private:
|
||||
/// point coordinates
|
||||
|
@ -458,11 +458,11 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
.def_property("dim", &Mesh::GetDimension, &Mesh::SetDimension)
|
||||
|
||||
.def("Elements3D",
|
||||
static_cast<Array<Element,0,ElementIndex>&(Mesh::*)()> (&Mesh::VolumeElements),
|
||||
static_cast<Array<Element,0,size_t>&(Mesh::*)()> (&Mesh::VolumeElements),
|
||||
py::return_value_policy::reference)
|
||||
|
||||
.def("Elements2D",
|
||||
static_cast<Array<Element2d,0,SurfaceElementIndex>&(Mesh::*)()> (&Mesh::SurfaceElements),
|
||||
static_cast<Array<Element2d,0,size_t>&(Mesh::*)()> (&Mesh::SurfaceElements),
|
||||
py::return_value_policy::reference)
|
||||
|
||||
.def("Elements1D",
|
||||
|
Loading…
Reference in New Issue
Block a user