mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
use segmentindex as index for mesh.segments array
This commit is contained in:
parent
22d6303c5c
commit
ee430a6e1e
@ -38,7 +38,7 @@ namespace netgen
|
||||
NgMPI_Comm comm;
|
||||
|
||||
/// line-segments at edges
|
||||
Array<Segment> segments;
|
||||
Array<Segment, SegmentIndex> segments;
|
||||
/// surface elements, 2d-inner elements
|
||||
Array<Element2d, SurfaceElementIndex> surfelements;
|
||||
/// volume elements
|
||||
|
@ -306,13 +306,17 @@ namespace netgen
|
||||
SegmentIndex & operator= (const SegmentIndex & ai)
|
||||
{ i = ai.i; return *this; }
|
||||
SegmentIndex & operator= (int ai) { i = ai; return *this; }
|
||||
operator int () const { return i; }
|
||||
constexpr operator int () const { return i; }
|
||||
SegmentIndex& operator++ () { ++i; return *this; }
|
||||
SegmentIndex& operator-- () { --i; return *this; }
|
||||
SegmentIndex operator++ (int) { return i++; }
|
||||
SegmentIndex operator-- (int) { return i--; }
|
||||
};
|
||||
|
||||
inline void SetInvalid (SegmentIndex & id) { id = -1; }
|
||||
inline bool IsInvalid (SegmentIndex & id) { return id == -1; }
|
||||
|
||||
|
||||
inline istream & operator>> (istream & ist, SegmentIndex & pi)
|
||||
{
|
||||
int i; ist >> i; pi = i; return ist;
|
||||
|
@ -603,7 +603,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
|
||||
ExportArray<Element,size_t>(m);
|
||||
ExportArray<Element2d,SurfaceElementIndex>(m);
|
||||
ExportArray<Segment,size_t>(m);
|
||||
ExportArray<Segment,SegmentIndex>(m);
|
||||
ExportArray<Element0d>(m);
|
||||
ExportArray<MeshPoint,PointIndex>(m);
|
||||
ExportArray<FaceDescriptor>(m);
|
||||
@ -823,7 +823,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
||||
py::return_value_policy::reference)
|
||||
|
||||
.def("Elements1D",
|
||||
static_cast<Array<Segment>&(Mesh::*)()> (&Mesh::LineSegments),
|
||||
static_cast<Array<Segment, SegmentIndex>&(Mesh::*)()> (&Mesh::LineSegments),
|
||||
py::return_value_policy::reference)
|
||||
|
||||
.def("Elements0D", FunctionPointer([] (Mesh & self) -> Array<Element0d>&
|
||||
|
Loading…
Reference in New Issue
Block a user