fix some deprecated

This commit is contained in:
Joachim Schoeberl 2022-04-29 13:05:38 +02:00
parent db0339a143
commit aa00749f97
2 changed files with 17 additions and 12 deletions

View File

@ -136,7 +136,7 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
} }
istream * infile; istream * infile;
NgArray<char> buf; // for distributing geometry! Array<char> buf; // for distributing geometry!
int strs; int strs;
if( id == 0) { if( id == 0) {
@ -167,7 +167,7 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
strs = geom_part_string.size(); strs = geom_part_string.size();
// buf = new char[strs]; // buf = new char[strs];
buf.SetSize(strs); buf.SetSize(strs);
memcpy(&buf[0], geom_part_string.c_str(), strs*sizeof(char)); memcpy(buf.Data(), geom_part_string.c_str(), strs*sizeof(char));
delete infile; delete infile;
} }
@ -243,15 +243,18 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
mesh->SendRecvMesh(); mesh->SendRecvMesh();
} }
/*
if(ntasks>1) { if(ntasks>1) {
#ifdef PARALLEL #ifdef PARALLEL
/** Scatter the geometry-string (no dummy-implementation in mpi_interface) **/ // Scatter the geometry-string (no dummy-implementation in mpi_interface)
int strs = buf.Size(); int strs = buf.Size();
MyMPI_Bcast(strs, comm); MyMPI_Bcast(strs, comm);
if(strs>0) if(strs>0)
MyMPI_Bcast(buf, comm); MyMPI_Bcast(buf, comm);
#endif #endif
} }
*/
comm.Bcast(buf);
shared_ptr<NetgenGeometry> geo; shared_ptr<NetgenGeometry> geo;
if(buf.Size()) { // if we had geom-info in the file, take it if(buf.Size()) { // if we had geom-info in the file, take it

View File

@ -94,13 +94,14 @@ namespace netgen
if(velement!=0) if(velement!=0)
{ {
auto & topology = mesh.GetTopology(); auto & topology = mesh.GetTopology();
NgArray<int> faces; // NgArray<int> faces;
topology.GetElementFaces(velement,faces); // topology.GetElementFaces(velement,faces);
auto faces = Array<int> (topology.GetFaces(ElementIndex(velement-1)));
//(*testout) << "faces " << faces << endl; //(*testout) << "faces " << faces << endl;
for(int i=0; i<faces.Size(); i++) for(int i=0; i<faces.Size(); i++)
faces[i] = topology.GetFace2SurfaceElement(faces[i]); faces[i] = topology.GetFace2SurfaceElement(faces[i]+1);
//(*testout) << "surfel " << faces << endl; //(*testout) << "surfel " << faces << endl;
@ -6373,12 +6374,13 @@ namespace netgen
auto el = volelements[ei]; auto el = volelements[ei];
map<PointIndex, Array<PointIndex>> mapped_points; map<PointIndex, Array<PointIndex>> mapped_points;
int nmapped = 0; int nmapped = 0;
NgArray<int> eledges; // NgArray<int> eledges;
topology.GetElementEdges(ei+1, eledges); // topology.GetElementEdges(ei+1, eledges);
for(auto edgei : eledges) // for(auto edgei : eledges)
for(auto edgei : topology.GetEdges(ElementIndex(ei)))
{ {
int p1, p2; int p1, p2;
topology.GetEdgeVertices(edgei, p1, p2); topology.GetEdgeVertices(edgei+1, p1, p2);
auto c1 = inserted_points.count({p1, p2}); auto c1 = inserted_points.count({p1, p2});
auto c2 = inserted_points.count({p2, p1}); auto c2 = inserted_points.count({p2, p1});
if(c1 == 0 && c2 == 0) if(c1 == 0 && c2 == 0)