From 0a389fc03f677255b911ef26a33ca706f9fc6059 Mon Sep 17 00:00:00 2001 From: HenrikAsmuth <henrik.asmuth@geo.uu.se> Date: Tue, 13 Dec 2022 15:32:00 +0100 Subject: [PATCH] Small refactoring and mods in TransientBCSetter --- src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp | 4 ++-- src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp b/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp index 7c2c41bb8..8b3fca3e3 100644 --- a/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp +++ b/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.cpp @@ -156,7 +156,7 @@ void VTKFile::unloadFile() this->loaded = false; } -void VTKFile::getData(real* data, uint numberOfNodes, std::vector<uint> readIndeces, std::vector<uint> writeIndices, uint offsetRead, uint offsetWrite) +void VTKFile::getData(real* data, uint numberOfNodes, const std::vector<uint>& readIndices, const std::vector<uint>& writeIndices, uint offsetRead, uint offsetWrite) { if(!this->loaded) loadFile(); @@ -167,7 +167,7 @@ void VTKFile::getData(real* data, uint numberOfNodes, std::vector<uint> readInde real* quant = &data[j*numberOfNodes]; for(size_t i=0; i<nPoints; i++) { - quant[offsetWrite+writeIndices[i]] = this->quantities[j].values[readIndeces[i]+offsetRead]; + quant[offsetWrite+writeIndices[i]] = this->quantities[j].values[readIndices[i]+offsetRead]; } } } diff --git a/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.h b/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.h index 7b1145185..49b085973 100644 --- a/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.h +++ b/src/gpu/GridGenerator/TransientBCSetter/TransientBCSetter.h @@ -40,7 +40,7 @@ public: // printFileInfo(); }; - void getData(real* data, uint numberOfNodes, std::vector<uint> readIndeces, std::vector<uint> writeIndices, uint offsetRead, uint offsetWrite); + void getData(real* data, uint numberOfNodes, const std::vector<uint>& readIndices, const std::vector<uint>& writeIndices, uint offsetRead, uint offsetWrite); bool markNANs(std::vector<uint> readIndices); bool inBoundingBox(real posX, real posY, real posZ){return inXBounds(posX) && inYBounds(posY) && inZBounds(posZ); }; bool inXBounds(real posX){ return posX<=maxX && posX>=minX; }; -- GitLab