mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
interface
This commit is contained in:
parent
8f59f8bdf8
commit
33322c741c
@ -111,6 +111,40 @@ namespace netgen
|
||||
public:
|
||||
Ng_Vertices vertices;
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <>
|
||||
class Ng_Node<2>
|
||||
{
|
||||
class Ng_Vertices
|
||||
{
|
||||
public:
|
||||
int nv;
|
||||
const int * ptr;
|
||||
|
||||
int Size() const { return nv; }
|
||||
int operator[] (int i) const { return ptr[i]-1; }
|
||||
};
|
||||
|
||||
class Ng_Edges
|
||||
{
|
||||
public:
|
||||
int ned;
|
||||
const int * ptr;
|
||||
|
||||
int Size() const { return ned; }
|
||||
int operator[] (int i) const { return ptr[i]-1; }
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
Ng_Vertices vertices;
|
||||
Ng_Edges edges;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
template <int DIM>
|
||||
DLL_HEADER Ng_Node<DIM> Ng_GetNode (int nr);
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
void GetFaceVertices (int fnr, int * vertices) const;
|
||||
void GetEdgeVertices (int enr, int & v1, int & v2) const;
|
||||
const int * GetEdgeVerticesPtr (int enr) const { return &edge2vert[enr][0]; }
|
||||
const int * GetFaceVerticesPtr (int fnr) const { return &face2vert[fnr][0]; }
|
||||
void GetFaceEdges (int fnr, Array<int> & edges, bool withorientation = false) const;
|
||||
|
||||
ELEMENT_TYPE GetFaceType (int fnr) const;
|
||||
|
@ -263,4 +263,13 @@ namespace netgen
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <> DLL_HEADER Ng_Node<2> Ng_GetNode<2> (int nr)
|
||||
{
|
||||
Ng_Node<2> node;
|
||||
node.vertices.ptr = mesh->GetTopology().GetFaceVerticesPtr(nr);
|
||||
node.vertices.nv = (node.vertices.ptr[3] == 0) ? 3 : 4;
|
||||
return node;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user