Skip to content
Snippets Groups Projects
Commit 0ae1414a authored by Tom Fischer's avatar Tom Fischer
Browse files

Init closest_geo_point with -1 instead of 0.

Saves writing it later.

42.7 seconds ( +-  2.54% )

# Conflicts:
#	MeshGeoToolsLib/GeoMapper.cpp
parent 4b61f7b6
No related branches found
No related tags found
No related merge requests found
...@@ -276,12 +276,11 @@ void GeoMapper::advancedMapOnMesh( ...@@ -276,12 +276,11 @@ void GeoMapper::advancedMapOnMesh(
const unsigned nMeshNodes ( mesh->getNNodes() ); const unsigned nMeshNodes ( mesh->getNNodes() );
// index of closest geo point for each mesh node in (x,y)-plane // index of closest geo point for each mesh node in (x,y)-plane
std::vector<int> closest_geo_point(nMeshNodes); std::vector<int> closest_geo_point(nMeshNodes, -1);
// distance between geo points and mesh nodes in (x,y)-plane // distance between geo points and mesh nodes in (x,y)-plane
std::vector<double> dist(nMeshNodes); std::vector<double> dist(nMeshNodes);
auto zero_coords = GeoLib::Point{}; // All coordinates zero. auto zero_coords = GeoLib::Point{}; // All coordinates zero.
for (std::size_t i=0; i<nMeshNodes; ++i) for (std::size_t i=0; i<nMeshNodes; ++i) {
{
zero_coords[0] = (*mesh->getNode(i))[0]; zero_coords[0] = (*mesh->getNode(i))[0];
zero_coords[1] = (*mesh->getNode(i))[1]; zero_coords[1] = (*mesh->getNode(i))[1];
GeoLib::Point* pnt = grid.getNearestPoint(zero_coords); GeoLib::Point* pnt = grid.getNearestPoint(zero_coords);
......
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