diff --git a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp index 9d59d4ab8773748521cc1a3b2ddc494cb3ab0fb4..8a4a0fc467fa24b4fbad5ff8a4cfc79f2f613eae 100644 --- a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp +++ b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp @@ -36,17 +36,6 @@ #include "MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h" #include "MeshLib/MeshEnums.h" -void scaleMeshPropertyVector(MeshLib::Mesh & mesh, - std::string const& property_name, - double factor) -{ - boost::optional<MeshLib::PropertyVector<double> &> pv( - mesh.getProperties().getPropertyVector<double>(property_name)); - - for (auto & v : *pv) - v *= factor; -} - int main(int argc, char* argv[]) { ApplicationsLib::LogogSetup logo_setup; diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index f1308e6e3a20a1cddf8db6bb6895a2c353e38126..d205f39fbf3cb47481d759986256728c53384f18 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -253,5 +253,15 @@ void Mesh::setNodesConnectedByElements() } } +void scaleMeshPropertyVector(MeshLib::Mesh & mesh, + std::string const& property_name, + double factor) +{ + boost::optional<MeshLib::PropertyVector<double> &> pv( + mesh.getProperties().getPropertyVector<double>(property_name)); + + for (auto & v : *pv) + v *= factor; +} } diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h index bb43ae634ae6816f318ebf81765afd9b0da7ea40..0fc14924a85da63e4fa935f7f5a1bd448bbbff3c 100644 --- a/MeshLib/Mesh.h +++ b/MeshLib/Mesh.h @@ -164,6 +164,14 @@ protected: Properties _properties; }; /* class */ + + +/// Scales the mesh property with name \c property_name by given \c factor. +/// \note The property must be a "double" property. +void scaleMeshPropertyVector(MeshLib::Mesh& mesh, + std::string const& property_name, + double factor); + } /* namespace */ #endif /* MESH_H_ */