Rename FlatArray to NgFlatArray

This commit is contained in:
Matthias Hochsteger 2019-07-09 10:40:35 +02:00
parent cb87362f64
commit 2d46d21a52
22 changed files with 126 additions and 126 deletions

View File

@ -46,15 +46,15 @@ namespace netgen
template <typename T, int BASE = 0, typename TIND = int>
class FlatArray;
class NgFlatArray;
template <typename T, int BASE, typename TIND>
class ArrayIterator
{
FlatArray<T,BASE,TIND> ar;
NgFlatArray<T,BASE,TIND> ar;
TIND ind;
public:
ArrayIterator (FlatArray<T,BASE,TIND> aar, TIND ai) : ar(aar), ind(ai) { ; }
ArrayIterator (NgFlatArray<T,BASE,TIND> aar, TIND ai) : ar(aar), ind(ai) { ; }
ArrayIterator operator++ (int) { return ArrayIterator(ar, ind++); }
ArrayIterator operator++ () { return ArrayIterator(ar, ++ind); }
T operator*() const { return ar[ind]; }
@ -74,7 +74,7 @@ namespace netgen
*/
template <typename T, int BASE, typename TIND>
class FlatArray
class NgFlatArray
{
protected:
/// the size
@ -85,7 +85,7 @@ namespace netgen
typedef T TELEM;
/// provide size and memory
FlatArray (size_t asize, T * adata)
NgFlatArray (size_t asize, T * adata)
: size(asize), data(adata) { ; }
/// the size
@ -112,9 +112,9 @@ namespace netgen
}
template <typename T2, int B2>
IndirectArray<FlatArray, FlatArray<T2,B2> > operator[] (const FlatArray<T2,B2> & ia) const
IndirectArray<NgFlatArray, NgFlatArray<T2,B2> > operator[] (const NgFlatArray<T2,B2> & ia) const
{
return IndirectArray<FlatArray, FlatArray<T2,B2> > (*this, ia);
return IndirectArray<NgFlatArray, NgFlatArray<T2,B2> > (*this, ia);
}
@ -170,7 +170,7 @@ namespace netgen
}
/// Fill array with value val
FlatArray & operator= (const T & val)
NgFlatArray & operator= (const T & val)
{
for (int i = 0; i < size; i++)
data[i] = val;
@ -178,9 +178,9 @@ namespace netgen
}
/// takes range starting from position start of end-start elements
const FlatArray<T> Range (TIND start, TIND end)
const NgFlatArray<T> Range (TIND start, TIND end)
{
return FlatArray<T> (end-start, data+start);
return NgFlatArray<T> (end-start, data+start);
}
/// first position of element elem, returns -1 if element not contained in array
@ -203,7 +203,7 @@ namespace netgen
// print array
template <typename T, int BASE, typename TIND>
inline ostream & operator<< (ostream & s, const FlatArray<T,BASE,TIND> & a)
inline ostream & operator<< (ostream & s, const NgFlatArray<T,BASE,TIND> & a)
{
for (TIND i = a.Begin(); i < a.End(); i++)
s << i << ": " << a[i] << endl;
@ -221,11 +221,11 @@ namespace netgen
or the user provides one block of data.
*/
template <class T, int BASE = 0, typename TIND = int>
class NgArray : public FlatArray<T, BASE, TIND>
class NgArray : public NgFlatArray<T, BASE, TIND>
{
protected:
using FlatArray<T,BASE,TIND>::size;
using FlatArray<T,BASE,TIND>::data;
using NgFlatArray<T,BASE,TIND>::size;
using NgFlatArray<T,BASE,TIND>::data;
/// physical size of array
size_t allocsize;
@ -236,14 +236,14 @@ namespace netgen
/// Generate array of logical and physical size asize
explicit NgArray()
: FlatArray<T, BASE, TIND> (0, NULL)
: NgFlatArray<T, BASE, TIND> (0, NULL)
{
allocsize = 0;
ownmem = 1;
}
explicit NgArray(size_t asize)
: FlatArray<T, BASE, TIND> (asize, asize ? new T[asize] : nullptr)
: NgFlatArray<T, BASE, TIND> (asize, asize ? new T[asize] : nullptr)
{
allocsize = asize;
ownmem = (asize == 0) ? 0 : 1;
@ -251,7 +251,7 @@ namespace netgen
/// Generate array in user data
NgArray(TIND asize, T* adata)
: FlatArray<T, BASE, TIND> (asize, adata)
: NgFlatArray<T, BASE, TIND> (asize, adata)
{
allocsize = asize;
ownmem = 0;
@ -259,7 +259,7 @@ namespace netgen
/// array copy
explicit NgArray (const NgArray<T,BASE,TIND> & a2)
: FlatArray<T, BASE, TIND> (a2.Size(), a2.Size() ? new T[a2.Size()] : 0)
: NgFlatArray<T, BASE, TIND> (a2.Size(), a2.Size() ? new T[a2.Size()] : 0)
{
allocsize = size;
ownmem = 1;
@ -269,7 +269,7 @@ namespace netgen
/// array move
NgArray (NgArray && a2)
: FlatArray<T,BASE,TIND> (a2.size, a2.data), allocsize(a2.allocsize), ownmem(a2.ownmem)
: NgFlatArray<T,BASE,TIND> (a2.size, a2.data), allocsize(a2.allocsize), ownmem(a2.ownmem)
{
a2.size = 0;
a2.data = nullptr;
@ -312,7 +312,7 @@ namespace netgen
}
template <typename T2, int B2>
void Append (FlatArray<T2, B2> a2)
void Append (NgFlatArray<T2, B2> a2)
{
if (size+a2.Size() > allocsize)
ReSize (size+a2.Size());
@ -364,7 +364,7 @@ namespace netgen
/// Fill array with val
NgArray & operator= (const T & val)
{
FlatArray<T, BASE, TIND>::operator= (val);
NgFlatArray<T, BASE, TIND>::operator= (val);
return *this;
}
@ -378,7 +378,7 @@ namespace netgen
}
/// array copy
NgArray & operator= (const FlatArray<T> & a2)
NgArray & operator= (const NgFlatArray<T> & a2)
{
SetSize (a2.Size());
for (TIND i = BASE; i < size+BASE; i++)
@ -488,7 +488,7 @@ namespace netgen
}
/// array copy
ArrayMem & operator= (const FlatArray<T> & a2)
ArrayMem & operator= (const NgFlatArray<T> & a2)
{
this->SetSize (a2.Size());
for (size_t i = 0; i < size; i++)
@ -505,11 +505,11 @@ namespace netgen
template <class T, int B1, int B2>
class IndirectArray
{
const FlatArray<T, B1> & array;
const FlatArray<int, B2> & ia;
const NgFlatArray<T, B1> & array;
const NgFlatArray<int, B2> & ia;
public:
IndirectArray (const FlatArray<T,B1> & aa, const FlatArray<int, B2> & aia)
IndirectArray (const NgFlatArray<T,B1> & aa, const NgFlatArray<int, B2> & aia)
: array(aa), ia(aia) { ; }
int Size() const { return ia.Size(); }
const T & operator[] (int i) const { return array[ia[i]]; }
@ -703,7 +703,7 @@ namespace netgen
/// bubble sort array
template <class T>
inline void BubbleSort (const FlatArray<T> & data)
inline void BubbleSort (const NgFlatArray<T> & data)
{
for (int i = 0; i < data.Size(); i++)
for (int j = i+1; j < data.Size(); j++)
@ -717,7 +717,7 @@ namespace netgen
/// bubble sort array
template <class T, class S>
inline void BubbleSort (FlatArray<T> & data, FlatArray<S> & slave)
inline void BubbleSort (NgFlatArray<T> & data, NgFlatArray<S> & slave)
{
for (int i = 0; i < data.Size(); i++)
for (int j = i+1; j < data.Size(); j++)
@ -735,8 +735,8 @@ namespace netgen
template <class T, class S>
void QuickSortRec (FlatArray<T> & data,
FlatArray<S> & slave,
void QuickSortRec (NgFlatArray<T> & data,
NgFlatArray<S> & slave,
int left, int right)
{
int i = left;
@ -761,7 +761,7 @@ namespace netgen
}
template <class T, class S>
void QuickSort (FlatArray<T> & data, FlatArray<S> & slave)
void QuickSort (NgFlatArray<T> & data, NgFlatArray<S> & slave)
{
if (data.Size() > 1)
QuickSortRec (data, slave, 0, data.Size()-1);
@ -776,7 +776,7 @@ namespace netgen
template <class T>
void Intersection (const FlatArray<T> & in1, const FlatArray<T> & in2,
void Intersection (const NgFlatArray<T> & in1, const NgFlatArray<T> & in2,
NgArray<T> & out)
{
out.SetSize(0);
@ -785,7 +785,7 @@ namespace netgen
out.Append(in1[i]);
}
template <class T>
void Intersection (const FlatArray<T> & in1, const FlatArray<T> & in2, const FlatArray<T> & in3,
void Intersection (const NgFlatArray<T> & in1, const NgFlatArray<T> & in2, const NgFlatArray<T> & in3,
NgArray<T> & out)
{
out.SetSize(0);

View File

@ -1391,7 +1391,7 @@ inline size_t HashValue (INDEX_2 i2, size_t size) { return (113*size_t(i2[0])+si
ClosedHashTable (ClosedHashTable && ht2) = default;
// who needs that ?
ClosedHashTable (FlatArray<T_HASH> _hash, FlatArray<T> _cont)
ClosedHashTable (NgFlatArray<T_HASH> _hash, NgFlatArray<T> _cont)
: size(_hash.Size()), used(0), hash(_hash.Size(), _hash.Addr(0)), cont(_cont.Size(), _cont.Addr(0))
{
for (auto & v : hash)

View File

@ -147,13 +147,13 @@ namespace netgen
template <class T, int BASE>
inline void MyMPI_Send (FlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
inline void MyMPI_Send (NgFlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
{
MPI_Send( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, comm);
}
template <class T, int BASE>
inline void MyMPI_Recv ( FlatArray<T, BASE> s, int src, int tag, MPI_Comm comm /* = ng_comm */)
inline void MyMPI_Recv ( NgFlatArray<T, BASE> s, int src, int tag, MPI_Comm comm /* = ng_comm */)
{
MPI_Status status;
MPI_Recv( &s.First(), s.Size(), MyGetMPIType<T>(), src, tag, comm, &status);
@ -191,21 +191,21 @@ namespace netgen
/*
template <class T, int BASE>
inline void MyMPI_ISend (FlatArray<T, BASE> s, int dest, int tag, MPI_Request & request)
inline void MyMPI_ISend (NgFlatArray<T, BASE> s, int dest, int tag, MPI_Request & request)
{
MPI_Isend( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, MPI_COMM_WORLD, & request);
}
template <class T, int BASE>
inline void MyMPI_IRecv (FlatArray<T, BASE> s, int dest, int tag, MPI_Request & request)
inline void MyMPI_IRecv (NgFlatArray<T, BASE> s, int dest, int tag, MPI_Request & request)
{
MPI_Irecv( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, MPI_COMM_WORLD, & request);
}
*/
template <class T, int BASE>
inline MPI_Request MyMPI_ISend (FlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
inline MPI_Request MyMPI_ISend (NgFlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
{
MPI_Request request;
MPI_Isend( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, comm, &request);
@ -214,7 +214,7 @@ namespace netgen
template <class T, int BASE>
inline MPI_Request MyMPI_IRecv (FlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
inline MPI_Request MyMPI_IRecv (NgFlatArray<T, BASE> s, int dest, int tag, MPI_Comm comm /* = ng_comm */)
{
MPI_Request request;
MPI_Irecv( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, comm, &request);
@ -223,7 +223,7 @@ namespace netgen
/*
template <class T, int BASE>
inline void MyMPI_ISend (FlatArray<T, BASE> s, int dest, int tag)
inline void MyMPI_ISend (NgFlatArray<T, BASE> s, int dest, int tag)
{
MPI_Request request;
MPI_Isend( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, MPI_COMM_WORLD, &request);
@ -232,7 +232,7 @@ namespace netgen
template <class T, int BASE>
inline void MyMPI_IRecv (FlatArray<T, BASE> s, int dest, int tag)
inline void MyMPI_IRecv (NgFlatArray<T, BASE> s, int dest, int tag)
{
MPI_Request request;
MPI_Irecv( &s.First(), s.Size(), MyGetMPIType<T>(), dest, tag, MPI_COMM_WORLD, &request);
@ -359,19 +359,19 @@ namespace netgen
}
template <class T, class T2>
inline void MyMPI_Allgather (const T & send, FlatArray<T2> recv, MPI_Comm comm /* = ng_comm */)
inline void MyMPI_Allgather (const T & send, NgFlatArray<T2> recv, MPI_Comm comm /* = ng_comm */)
{
MPI_Allgather( const_cast<T*> (&send), 1, MyGetMPIType<T>(), &recv[0], 1, MyGetMPIType<T2>(), comm);
}
template <class T, class T2>
inline void MyMPI_Alltoall (FlatArray<T> send, FlatArray<T2> recv, MPI_Comm comm /* = ng_comm */)
inline void MyMPI_Alltoall (NgFlatArray<T> send, NgFlatArray<T2> recv, MPI_Comm comm /* = ng_comm */)
{
MPI_Alltoall( &send[0], 1, MyGetMPIType<T>(), &recv[0], 1, MyGetMPIType<T2>(), comm);
}
// template <class T, class T2>
// inline void MyMPI_Alltoall_Block (FlatArray<T> send, FlatArray<T2> recv, int blocklen, MPI_Comm comm = ng_comm)
// inline void MyMPI_Alltoall_Block (NgFlatArray<T> send, NgFlatArray<T2> recv, int blocklen, MPI_Comm comm = ng_comm)
// {
// MPI_Alltoall( &send[0], blocklen, MyGetMPIType<T>(), &recv[0], blocklen, MyGetMPIType<T2>(), comm);
// }

View File

@ -39,13 +39,13 @@ public:
class Procs
{
const netgen::FlatArray<int> procs;
const netgen::NgFlatArray<int> procs;
public:
Procs ( const netgen::FlatArray<int> & aprocs ) : procs (aprocs) { ; }
Procs ( const netgen::NgFlatArray<int> & aprocs ) : procs (aprocs) { ; }
const netgen::FlatArray<int> & GetProcs () const { return procs; }
const netgen::NgFlatArray<int> & GetProcs () const { return procs; }
};

View File

@ -27,7 +27,7 @@ namespace netgen
oneblock = NULL;
}
BASE_TABLE :: BASE_TABLE (const FlatArray<int> & entrysizes, int elemsize)
BASE_TABLE :: BASE_TABLE (const NgFlatArray<int> & entrysizes, int elemsize)
: data(entrysizes.Size())
{
size_t cnt = 0;

View File

@ -42,7 +42,7 @@ public:
BASE_TABLE (int size);
///
BASE_TABLE (const FlatArray<int> & entrysizes, int elemsize);
BASE_TABLE (const NgFlatArray<int> & entrysizes, int elemsize);
///
~BASE_TABLE ();
@ -115,8 +115,8 @@ public:
inline TABLE (int size) : BASE_TABLE (size) { ; }
/// Creates fixed maximal element size table
inline TABLE (const FlatArray<int,BASE> & entrysizes)
: BASE_TABLE (FlatArray<int> (entrysizes.Size(), const_cast<int*>(&entrysizes[BASE])),
inline TABLE (const NgFlatArray<int,BASE> & entrysizes)
: BASE_TABLE (NgFlatArray<int> (entrysizes.Size(), const_cast<int*>(&entrysizes[BASE])),
sizeof(T))
{ ; }
@ -228,14 +228,14 @@ public:
}
/// Access entry.
FlatArray<T> operator[] (int i) const
NgFlatArray<T> operator[] (int i) const
{
#ifdef DEBUG
if (i-BASE < 0 || i-BASE >= data.Size())
cout << "table out of range, i = " << i << ", s = " << data.Size() << endl;
#endif
return FlatArray<T> (data[i-BASE].size, (T*)data[i-BASE].col);
return NgFlatArray<T> (data[i-BASE].size, (T*)data[i-BASE].col);
}
void DoArchive (Archive & ar)
@ -251,7 +251,7 @@ inline ostream & operator<< (ostream & ost, const TABLE<T,BASE> & table)
for (int i = BASE; i < table.Size()+BASE; i++)
{
ost << i << ": ";
FlatArray<T> row = table[i];
NgFlatArray<T> row = table[i];
ost << "(" << row.Size() << ") ";
for (int j = 0; j < row.Size(); j++)
ost << row[j] << " ";

View File

@ -250,33 +250,33 @@ template <> NGX_INLINE DLL_HEADER const Ng_Node<0> Ngx_Mesh :: GetNode<0> (int v
{
case 3:
{
FlatArray<ElementIndex> ia = mesh->GetTopology().GetVertexElements(vnr);
NgFlatArray<ElementIndex> ia = mesh->GetTopology().GetVertexElements(vnr);
node.elements.ne = ia.Size();
node.elements.ptr = (int*)&ia[0];
FlatArray<SurfaceElementIndex> bia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
NgFlatArray<SurfaceElementIndex> bia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
node.bnd_elements.ne = bia.Size();
node.bnd_elements.ptr = (int*)&bia[0];
break;
}
case 2:
{
FlatArray<SurfaceElementIndex> ia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
NgFlatArray<SurfaceElementIndex> ia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
node.elements.ne = ia.Size();
node.elements.ptr = (int*)&ia[0];
FlatArray<SegmentIndex> bia = mesh->GetTopology().GetVertexSegments(vnr);
NgFlatArray<SegmentIndex> bia = mesh->GetTopology().GetVertexSegments(vnr);
node.bnd_elements.ne = bia.Size();
node.bnd_elements.ptr = (int*)&bia[0];
break;
}
case 1:
{
FlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
NgFlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
node.elements.ne = ia.Size();
node.elements.ptr = (int*)&ia[0];
FlatArray<int> bia = mesh->GetTopology().GetVertexPointElements(vnr);
NgFlatArray<int> bia = mesh->GetTopology().GetVertexPointElements(vnr);
node.bnd_elements.ne = bia.Size();
node.bnd_elements.ptr = (int*)&bia[0];
break;

View File

@ -1638,19 +1638,19 @@ void Ng_GetVertexElements (int vnr, int * els)
{
case 3:
{
FlatArray<ElementIndex> ia = mesh->GetTopology().GetVertexElements(vnr);
NgFlatArray<ElementIndex> ia = mesh->GetTopology().GetVertexElements(vnr);
for (int i = 0; i < ia.Size(); i++) els[i] = ia[i]+1;
break;
}
case 2:
{
FlatArray<SurfaceElementIndex> ia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
NgFlatArray<SurfaceElementIndex> ia = mesh->GetTopology().GetVertexSurfaceElements(vnr);
for (int i = 0; i < ia.Size(); i++) els[i] = ia[i]+1;
break;
}
case 1:
{
FlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
NgFlatArray<SegmentIndex> ia = mesh->GetTopology().GetVertexSegments(vnr);
for (int i = 0; i < ia.Size(); i++) els[i] = ia[i]+1;
break;
/*

View File

@ -1291,17 +1291,17 @@ void Ngx_Mesh::SetSurfaceElementOrders (int enr, int ox, int oy)
{
case 0:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantPNums(locnum);
NgFlatArray<int> dn = mesh->GetParallelTopology().GetDistantPNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
case 1:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantEdgeNums(locnum);
NgFlatArray<int> dn = mesh->GetParallelTopology().GetDistantEdgeNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
case 2:
{
FlatArray<int> dn = mesh->GetParallelTopology().GetDistantFaceNums(locnum);
NgFlatArray<int> dn = mesh->GetParallelTopology().GetDistantFaceNums(locnum);
return std::tuple<int,int*>(dn.Size(), &dn[0]);
}
default:

View File

@ -112,7 +112,7 @@ void WriteDiffPackFormat (const Mesh & mesh,
/*
for (j = 1; j <= nse; j++)
*/
FlatArray<SurfaceElementIndex> sels = point2sel[i];
NgFlatArray<SurfaceElementIndex> sels = point2sel[i];
for (int jj = 0; jj < sels.Size(); jj++)
{
for (k = 1; k <= mesh[sels[jj]].GetNP(); k++)

View File

@ -89,7 +89,7 @@ public:
const PointIndex PNum (int i) const { return pnum[i-1]; }
PointIndex & PNum (int i) { return pnum[i-1]; }
const PointIndex PNumMod (int i) const { return pnum[(i-1)%np]; }
auto PNums() const { return FlatArray<const PointIndex> (np, &pnum[0]); }
auto PNums() const { return NgFlatArray<const PointIndex> (np, &pnum[0]); }
void Delete () { deleted = true; for (PointIndex & p : pnum) p.Invalidate(); }
bool IsDeleted () const { return deleted; }
};

View File

@ -296,7 +296,7 @@ namespace netgen
if (mesh[sei].IsDeleted()) continue;
elmap[0] = sei;
FlatArray<SurfaceElementIndex> neighbours = nbels[sei];
NgFlatArray<SurfaceElementIndex> neighbours = nbels[sei];
for (elrot[0] = 0; elrot[0] < mesh[sei].GetNP(); elrot[0]++)
{

View File

@ -105,7 +105,7 @@ void MeshOptimize3d :: CombineImprove (Mesh & mesh,
hasonepi.SetSize(0);
hasbothpi.SetSize(0);
FlatArray<ElementIndex> row1 = elementsonnode[pi1];
NgFlatArray<ElementIndex> row1 = elementsonnode[pi1];
for (int k = 0; k < row1.Size(); k++)
{
Element & elem = mesh[row1[k]];
@ -122,7 +122,7 @@ void MeshOptimize3d :: CombineImprove (Mesh & mesh,
}
}
FlatArray<ElementIndex> row2 = elementsonnode[pi2];
NgFlatArray<ElementIndex> row2 = elementsonnode[pi2];
for (int k = 0; k < row2.Size(); k++)
{
Element & elem = mesh[row2[k]];
@ -209,7 +209,7 @@ void MeshOptimize3d :: CombineImprove (Mesh & mesh,
mesh[pi1] = pnew;
cnt++;
FlatArray<ElementIndex> row = elementsonnode[pi2];
NgFlatArray<ElementIndex> row = elementsonnode[pi2];
for (int k = 0; k < row.Size(); k++)
{
Element & elem = mesh[row[k]];
@ -2439,7 +2439,7 @@ void MeshOptimize3d :: SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal)
if (bface) continue;
FlatArray<ElementIndex> row = elementsonnode[pi1];
NgFlatArray<ElementIndex> row = elementsonnode[pi1];
for (int k = 0; k < row.Size(); k++)
{
ElementIndex eli2 = row[k];

View File

@ -2019,7 +2019,7 @@ namespace netgen
{
faceht.SetSize (2 * selsonpoint[pi].Size() + 4 * elsonpoint[pi].Size());
FlatArray<SurfaceElementIndex> row = selsonpoint[pi];
NgFlatArray<SurfaceElementIndex> row = selsonpoint[pi];
for (ii = 0; ii < row.Size(); ii++)
{
Element2d hel = SurfaceElement(row[ii]);
@ -2058,7 +2058,7 @@ namespace netgen
}
FlatArray<ElementIndex> rowel = elsonpoint[pi];
NgFlatArray<ElementIndex> rowel = elsonpoint[pi];
for (ii = 0; ii < rowel.Size(); ii++)
{
const Element & el = VolumeElement(rowel[ii]);

View File

@ -456,12 +456,12 @@ namespace netgen
///
const PointIndex & operator[] (int i) const { return pnum[i]; }
FlatArray<const PointIndex> PNums () const
{ return FlatArray<const PointIndex> (np, &pnum[0]); }
FlatArray<PointIndex> PNums ()
{ return FlatArray<PointIndex> (np, &pnum[0]); }
NgFlatArray<const PointIndex> PNums () const
{ return NgFlatArray<const PointIndex> (np, &pnum[0]); }
NgFlatArray<PointIndex> PNums ()
{ return NgFlatArray<PointIndex> (np, &pnum[0]); }
auto Vertices() const
{ return FlatArray<const PointIndex> (GetNV(), &pnum[0]); }
{ return NgFlatArray<const PointIndex> (GetNV(), &pnum[0]); }
///
PointIndex & PNum (int i) { return pnum[i-1]; }
@ -748,10 +748,10 @@ namespace netgen
///
const PointIndex & operator[] (int i) const { return pnum[i]; }
FlatArray<const PointIndex> PNums () const
{ return FlatArray<const PointIndex> (np, &pnum[0]); }
NgFlatArray<const PointIndex> PNums () const
{ return NgFlatArray<const PointIndex> (np, &pnum[0]); }
FlatArray<const PointIndex> Vertices() const { return { GetNV(), &pnum[0] }; }
NgFlatArray<const PointIndex> Vertices() const { return { GetNV(), &pnum[0] }; }
///
PointIndex & PNum (int i) { return pnum[i-1]; }

View File

@ -223,21 +223,21 @@ namespace netgen
vert_flag = -1;
for (int dest = 1; dest < ntasks; dest++)
{
FlatArray<ElementIndex> els = els_of_proc[dest];
NgFlatArray<ElementIndex> els = els_of_proc[dest];
for (int hi = 0; hi < els.Size(); hi++)
{
const Element & el = (*this) [ els[hi] ];
for (int i = 0; i < el.GetNP(); i++)
f(el[i], dest);
}
FlatArray<SurfaceElementIndex> sels = sels_of_proc[dest];
NgFlatArray<SurfaceElementIndex> sels = sels_of_proc[dest];
for (int hi = 0; hi < sels.Size(); hi++)
{
const Element2d & el = (*this) [ sels[hi] ];
for (int i = 0; i < el.GetNP(); i++)
f(el[i], dest);
}
FlatArray<SegmentIndex> segs = segs_of_proc[dest];
NgFlatArray<SegmentIndex> segs = segs_of_proc[dest];
for (int hi = 0; hi < segs.Size(); hi++)
{
const Segment & el = (*this) [segs[hi]];
@ -285,7 +285,7 @@ namespace netgen
**/
for (int vert = 1; vert <= GetNP(); vert++ )
{
FlatArray<int> procs = procs_of_vert[vert];
NgFlatArray<int> procs = procs_of_vert[vert];
for (int j = 0; j < procs.Size(); j++)
{
int dest = procs[j];
@ -297,7 +297,7 @@ namespace netgen
for (int dest = 1; dest < ntasks; dest++)
{
FlatArray<PointIndex> verts = verts_of_proc[dest];
NgFlatArray<PointIndex> verts = verts_of_proc[dest];
sendrequests.Append (MyMPI_ISend (verts, dest, MPI_TAG_MESH+1, comm));
MPI_Datatype mptype = MeshPoint::MyGetMPIType();
@ -387,7 +387,7 @@ namespace netgen
for (int vert = 1; vert <= GetNP(); vert++)
{
FlatArray<int> procs = procs_of_vert[vert];
NgFlatArray<int> procs = procs_of_vert[vert];
for (int j = 0; j < procs.Size(); j++)
num_distpnums[procs[j]] += 3 * (procs.Size()-1);
}
@ -396,7 +396,7 @@ namespace netgen
for (int vert = 1; vert <= GetNP(); vert++)
{
FlatArray<int> procs = procs_of_vert[vert];
NgFlatArray<int> procs = procs_of_vert[vert];
for (int j = 0; j < procs.Size(); j++)
for (int k = 0; k < procs.Size(); k++)
if (j != k)
@ -474,7 +474,7 @@ namespace netgen
{
if(ided_sel[sei]!=-1) continue;
const Element2d & sel = (*this)[sei];
FlatArray<const PointIndex> points = sel.PNums();
NgFlatArray<const PointIndex> points = sel.PNums();
auto ided1 = per_verts[points[0]];
os1.SetSize(0);
for (int j = 0; j < ided1.Size(); j++)
@ -498,7 +498,7 @@ namespace netgen
throw NgException("SurfaceElement identified with more than one other??");
}
const Element2d & sel2 = (*this)[sei];
FlatArray<const PointIndex> points2 = sel2.PNums();
NgFlatArray<const PointIndex> points2 = sel2.PNums();
has_ided_sels = true;
ided_sel[sei] = os1[0];
ided_sel[os1[0]] = sei;
@ -854,7 +854,7 @@ namespace netgen
for(int idnr = 1; idnr < maxidentnr+1; idnr++)
{
int npairs = pp_data[maxidentnr+idnr];
FlatArray<int> pairdata(2*npairs, &pp_data[offset]);
NgFlatArray<int> pairdata(2*npairs, &pp_data[offset]);
offset += 2*npairs;
for (int k = 0; k<npairs; k++) {
PointIndex loc1 = glob2loc_vert_ht.Get(pairdata[2*k]);
@ -1231,8 +1231,8 @@ namespace netgen
{
Element2d & sel = (*this)[sei];
PointIndex pi1 = sel[0];
// FlatArray<ElementIndex> els = pnt2el[pi1];
FlatArray<int> els = pnt2el[pi1];
// NgFlatArray<ElementIndex> els = pnt2el[pi1];
NgFlatArray<int> els = pnt2el[pi1];
// sel.SetPartition (-1);
surf_partition[sei] = -1;
@ -1270,7 +1270,7 @@ namespace netgen
{
Segment & sel = (*this)[si];
PointIndex pi1 = sel[0];
FlatArray<int> els = pnt2el[pi1];
NgFlatArray<int> els = pnt2el[pi1];
// sel.SetPartition (-1);
seg_partition[si] = -1;
@ -1311,7 +1311,7 @@ namespace netgen
seg_partition[segi] = -1;
PointIndex pi1 = seg[0];
FlatArray<int> sels = pnt2el[pi1];
NgFlatArray<int> sels = pnt2el[pi1];
for (int j = 0; j < sels.Size(); j++)
{
SurfaceElementIndex sei = sels[j];
@ -1703,7 +1703,7 @@ namespace netgen
for ( int vert = 0; vert < nn; vert++ )
{
FlatArray<idxtype> array ( cnt[vert], &adjacency[ xadj[vert] ] );
NgFlatArray<idxtype> array ( cnt[vert], &adjacency[ xadj[vert] ] );
BubbleSort(array);
}
@ -1815,7 +1815,7 @@ namespace netgen
for ( int el = 0; el < ne; el++ )
{
FlatArray<idxtype> array ( cnt[el], &adjacency[ xadj[el] ] );
NgFlatArray<idxtype> array ( cnt[el], &adjacency[ xadj[el] ] );
BubbleSort(array);
}

View File

@ -366,7 +366,7 @@ namespace netgen
for (PointIndex pi : dest2vert[dest-1])
loc2exchange[pi] = cnt++;
FlatArray<int> recvarray = recv_verts[dest-1];
NgFlatArray<int> recvarray = recv_verts[dest-1];
for (int ii = 0; ii < recvarray.Size(); ii+=2)
for (PointIndex pi : dest2pair[dest-1])
// for (PointIndex pi = PointIndex::BASE; pi < newnv+PointIndex::BASE; pi++)
@ -464,7 +464,7 @@ namespace netgen
for (int dest = 1; dest < ntasks; dest++)
{
auto ex2loc = dest2vert[dest-1];
FlatArray<int> recvarray = recv_edges[dest-1];
NgFlatArray<int> recvarray = recv_edges[dest-1];
for (int ii = 0; ii < recvarray.Size(); ii+=2)
for (int edge : dest2edge[dest-1])
{
@ -490,7 +490,7 @@ namespace netgen
vert2edge.Set(INDEX_2(v1,v2), edge);
}
FlatArray<int> recvarray = recv_edges[dest-1];
NgFlatArray<int> recvarray = recv_edges[dest-1];
for (int ii = 0; ii < recvarray.Size(); ii+=2)
{
INDEX_2 re(ex2loc[recvarray[ii]],
@ -585,7 +585,7 @@ namespace netgen
for (PointIndex pi : dest2vert[dest-1])
loc2exchange[pi] = cnt++;
FlatArray<int> recvarray = recv_faces[dest-1];
NgFlatArray<int> recvarray = recv_faces[dest-1];
for (int ii = 0; ii < recvarray.Size(); ii+=3)
for (int face : dest2face[dest-1])
{
@ -611,7 +611,7 @@ namespace netgen
vert2face.Set(INDEX_3(verts[0], verts[1], verts[2]), face);
}
FlatArray<int> recvarray = recv_faces[dest-1];
NgFlatArray<int> recvarray = recv_faces[dest-1];
for (int ii = 0; ii < recvarray.Size(); ii+=3)
{
INDEX_3 re(ex2loc[recvarray[ii]],
@ -676,7 +676,7 @@ namespace netgen
for (int sender = 1; sender < ntasks; sender ++)
if (id != sender)
{
FlatArray<int> recvarray = recv_faces[sender-1];
NgFlatArray<int> recvarray = recv_faces[sender-1];
for (int ii = 0; ii < recvarray.Size(); )
{

View File

@ -93,9 +93,9 @@ namespace netgen
distedgenums = loc2distedge[locedgenum-1];
}
FlatArray<int> GetDistantPNums (int locnum) const { return loc2distvert[locnum]; }
FlatArray<int> GetDistantFaceNums (int locnum) const { return loc2distface[locnum]; }
FlatArray<int> GetDistantEdgeNums (int locnum) const { return loc2distedge[locnum]; }
NgFlatArray<int> GetDistantPNums (int locnum) const { return loc2distvert[locnum]; }
NgFlatArray<int> GetDistantFaceNums (int locnum) const { return loc2distface[locnum]; }
NgFlatArray<int> GetDistantEdgeNums (int locnum) const { return loc2distedge[locnum]; }
bool IsExchangeVert (int dest, int vnum) const
{

View File

@ -6,7 +6,7 @@ namespace netgen
template <class T>
void QuickSortRec (FlatArray<T> data,
void QuickSortRec (NgFlatArray<T> data,
int left, int right)
{
int i = left;
@ -30,7 +30,7 @@ namespace netgen
}
template <class T>
void QuickSort (FlatArray<T> data)
void QuickSort (NgFlatArray<T> data)
{
if (data.Size() > 1)
QuickSortRec (data, 0, data.Size()-1);
@ -1205,7 +1205,7 @@ namespace netgen
(*testout) << (*mesh)[(PointIndex)face2vert[i].I(j+1)] << " ";
(*testout) << endl;
FlatArray<ElementIndex> vertels = GetVertexElements (face2vert[i].I(1));
NgFlatArray<ElementIndex> vertels = GetVertexElements (face2vert[i].I(1));
for (int k = 0; k < vertels.Size(); k++)
{
int elfaces[10], orient[10];
@ -1821,7 +1821,7 @@ namespace netgen
// GetVertexElements (pi[0], els);
FlatArray<ElementIndex> els = GetVertexElements (pi[0]);
NgFlatArray<ElementIndex> els = GetVertexElements (pi[0]);
// find one element having all vertices of the face
for (int i = 0; i < els.Size(); i++)
@ -1925,25 +1925,25 @@ namespace netgen
}
/*
FlatArray<ElementIndex> MeshTopology :: GetVertexElements (int vnr) const
NgFlatArray<ElementIndex> MeshTopology :: GetVertexElements (int vnr) const
{
if (vert2element)
return (*vert2element)[vnr];
return FlatArray<ElementIndex> (0,0);
return NgFlatArray<ElementIndex> (0,0);
}
FlatArray<SurfaceElementIndex> MeshTopology :: GetVertexSurfaceElements (int vnr) const
NgFlatArray<SurfaceElementIndex> MeshTopology :: GetVertexSurfaceElements (int vnr) const
{
if (vert2surfelement)
return (*vert2surfelement)[vnr];
return FlatArray<SurfaceElementIndex> (0,0);
return NgFlatArray<SurfaceElementIndex> (0,0);
}
FlatArray<SegmentIndex> MeshTopology :: GetVertexSegments (int vnr) const
NgFlatArray<SegmentIndex> MeshTopology :: GetVertexSegments (int vnr) const
{
if (vert2segment)
return (*vert2segment)[vnr];
return FlatArray<SegmentIndex> (0,0);
return NgFlatArray<SegmentIndex> (0,0);
}
*/

View File

@ -162,17 +162,17 @@ public:
int GetFace2SurfaceElement (int fnr) const { return face2surfel[fnr-1]; }
void GetVertexElements (int vnr, NgArray<ElementIndex> & elements) const;
FlatArray<ElementIndex> GetVertexElements (int vnr) const
NgFlatArray<ElementIndex> GetVertexElements (int vnr) const
{ return vert2element[vnr]; }
void GetVertexSurfaceElements( int vnr, NgArray<SurfaceElementIndex>& elements ) const;
FlatArray<SurfaceElementIndex> GetVertexSurfaceElements (int vnr) const
NgFlatArray<SurfaceElementIndex> GetVertexSurfaceElements (int vnr) const
{ return vert2surfelement[vnr]; }
FlatArray<SegmentIndex> GetVertexSegments (int vnr) const
NgFlatArray<SegmentIndex> GetVertexSegments (int vnr) const
{ return vert2segment[vnr]; }
FlatArray<int> GetVertexPointElements (int vnr) const
NgFlatArray<int> GetVertexPointElements (int vnr) const
{ return vert2pointelement[vnr]; }
int GetVerticesEdge ( int v1, int v2) const;

View File

@ -637,7 +637,7 @@ void STLSurfaceMeshing1 (STLGeometry & geom,
}
}
*/
FlatArray<int> segs = opensegments[fnr];
NgFlatArray<int> segs = opensegments[fnr];
for (int hi = 0; hi < segs.Size(); hi++)
{
int i = segs[hi];
@ -706,7 +706,7 @@ void STLSurfaceMeshing1 (STLGeometry & geom,
*/
// FlatArray<int> segs = opensegments[fnr];
// NgFlatArray<int> segs = opensegments[fnr];
for (int hi = 0; hi < segs.Size(); hi++)
{
int i = segs[hi];

View File

@ -340,7 +340,7 @@ namespace netgen
{
double values[3], sumvalues[3] = { 0, 0, 0 };
FlatArray<int> els = mesh->GetTopology().GetVertexElements(pi);
NgFlatArray<int> els = mesh->GetTopology().GetVertexElements(pi);
for (int j = 0; j < els.Size(); j++)
{