diff --git a/libsrc/general/array.hpp b/libsrc/general/array.hpp index df0cd0a5..07ec23d7 100644 --- a/libsrc/general/array.hpp +++ b/libsrc/general/array.hpp @@ -246,8 +246,7 @@ namespace netgen : FlatArray (asize, asize ? new T[asize] : nullptr) { allocsize = asize; - if(asize) - ownmem = 1; + ownmem = (asize == 0) ? 0 : 1; } /// Generate array in user data diff --git a/libsrc/meshing/parallelmesh.cpp b/libsrc/meshing/parallelmesh.cpp index 45d6f98b..0843ecda 100644 --- a/libsrc/meshing/parallelmesh.cpp +++ b/libsrc/meshing/parallelmesh.cpp @@ -873,7 +873,7 @@ namespace netgen *testout << "got " << numvert << " vertices" << endl; { - Element el; + Element el(dim==2 ? 3 : 4); Array elarray; MyMPI_Recv (elarray, 0, MPI_TAG_MESH+2, comm);