mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
GetFaceEdges in new mesh-interface (without global ptr)
This commit is contained in:
parent
dbb7989363
commit
523b8c086c
@ -44,6 +44,19 @@ namespace netgen
|
|||||||
size_t Size() const { return s; }
|
size_t Size() const { return s; }
|
||||||
T * Release() { T * hd = data; data = nullptr; return hd; }
|
T * Release() { T * hd = data; data = nullptr; return hd; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T, int S>
|
||||||
|
class Ng_BufferMS
|
||||||
|
{
|
||||||
|
size_t s;
|
||||||
|
T data[S];
|
||||||
|
public:
|
||||||
|
Ng_BufferMS (size_t as) : s(as) { ; }
|
||||||
|
size_t Size() const { return s; }
|
||||||
|
T & operator[] (size_t i) { return data[i]; }
|
||||||
|
T operator[] (size_t i) const { return data[i]; }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Ng_Element
|
class Ng_Element
|
||||||
{
|
{
|
||||||
@ -185,6 +198,7 @@ namespace netgen
|
|||||||
int operator[] (size_t i) const { return ptr[i]-POINTINDEX_BASE; }
|
int operator[] (size_t i) const { return ptr[i]-POINTINDEX_BASE; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
class Ng_Edges
|
class Ng_Edges
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -194,11 +208,11 @@ namespace netgen
|
|||||||
size_t Size() const { return ned; }
|
size_t Size() const { return ned; }
|
||||||
int operator[] (size_t i) const { return ptr[i]-1; }
|
int operator[] (size_t i) const { return ptr[i]-1; }
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Ng_Vertices vertices;
|
Ng_Vertices vertices;
|
||||||
Ng_Edges edges;
|
// Ng_Edges edges;
|
||||||
int surface_el; // -1 if face not on surface
|
int surface_el; // -1 if face not on surface
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -282,7 +296,8 @@ namespace netgen
|
|||||||
|
|
||||||
template <int DIM>
|
template <int DIM>
|
||||||
const Ng_Node<DIM> GetNode (int nr) const;
|
const Ng_Node<DIM> GetNode (int nr) const;
|
||||||
|
|
||||||
|
Ng_BufferMS<int,4> GetFaceEdges (int fnr) const;
|
||||||
|
|
||||||
template <int DIM>
|
template <int DIM>
|
||||||
int GetNNodes ();
|
int GetNNodes ();
|
||||||
|
@ -717,6 +717,16 @@ namespace netgen
|
|||||||
return mesh->GetIdentifications().GetType(idnr+1);
|
return mesh->GetIdentifications().GetType(idnr+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ng_BufferMS<int,4> Ngx_Mesh::GetFaceEdges (int fnr) const
|
||||||
|
{
|
||||||
|
const MeshTopology & topology = mesh->GetTopology();
|
||||||
|
ArrayMem<int,4> ia;
|
||||||
|
topology.GetFaceEdges (fnr+1, ia);
|
||||||
|
Ng_BufferMS<int,4> res(ia.Size());
|
||||||
|
for (size_t i = 0; i < ia.Size(); i++)
|
||||||
|
res[i] = ia[i]-1;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user