Skip to content
Snippets Groups Projects
Commit 4b61f7b6 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by Tom Fischer
Browse files

Save only used data. No id. Update memory not realloc.

44.4 seconds on 1/8 unstrut.vtu ~ 1100769 cells

info: Read geometry from file "ArcGisRivers.gml".
info: first part of advancedMapOnMesh(): 21.645936 seconds
info: Extracting mesh surface...
info: mapOnMesh(): 0.202910 seconds

Base line is: 44.55 seconds
info: Read geometry from file "ArcGisRivers.gml".
info: first part of advancedMapOnMesh(): 21.936575 seconds
info: Extracting mesh surface...
info: mapOnMesh(): 0.200034 seconds






Previous
parent d6f73714
No related branches found
No related tags found
No related merge requests found
......@@ -279,10 +279,11 @@ void GeoMapper::advancedMapOnMesh(
std::vector<int> closest_geo_point(nMeshNodes);
// distance between geo points and mesh nodes in (x,y)-plane
std::vector<double> dist(nMeshNodes);
auto zero_coords = GeoLib::Point{}; // All coordinates zero.
for (std::size_t i=0; i<nMeshNodes; ++i)
{
auto const zero_coords = GeoLib::Point((*mesh->getNode(i))[0],
(*mesh->getNode(i))[1], 0.0, mesh->getNode(i)->getID());
zero_coords[0] = (*mesh->getNode(i))[0];
zero_coords[1] = (*mesh->getNode(i))[1];
GeoLib::Point* pnt = grid.getNearestPoint(zero_coords);
dist[i] = MathLib::sqrDist(*pnt, zero_coords);
closest_geo_point[i] = (dist[i]<=max_segment_length) ? pnt->getID() : -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment