Merge branch 'new_interface_zero_based_access' into 'master'

zero based access to identification pairs in new interface

See merge request jschoeberl/netgen!91
This commit is contained in:
Joachim Schöberl 2018-06-12 14:56:53 +02:00
commit 0a01392d80
3 changed files with 13 additions and 1 deletions

View File

@ -300,6 +300,8 @@ namespace netgen
int GetParentElement (int ei) const;
int GetParentSElement (int ei) const;
int GetNIdentifications() const;
int GetIdentificationType(int idnr) const;
Ng_Buffer<int[2]> GetPeriodicVertices(int idnr) const;
// Find element of point, returns local coordinates

View File

@ -300,7 +300,7 @@ template <> NGX_INLINE DLL_HEADER const Ng_Node<2> Ngx_Mesh :: GetNode<2> (int n
NGX_INLINE DLL_HEADER Ng_Buffer<int[2]> Ngx_Mesh :: GetPeriodicVertices(int idnr) const
{
Array<INDEX_2> apairs;
mesh->GetIdentifications().GetPairs (idnr, apairs);
mesh->GetIdentifications().GetPairs (idnr+1, apairs);
for(auto& ind : apairs)
{
ind.I1()--;

View File

@ -720,6 +720,16 @@ namespace netgen
return -1;
}
int Ngx_Mesh :: GetNIdentifications () const
{
return mesh->GetIdentifications().GetMaxNr();
}
int Ngx_Mesh :: GetIdentificationType(int idnr) const
{
return mesh->GetIdentifications().GetType(idnr+1);
}