diff --git a/Applications/DataExplorer/Base/RecentFiles.cpp b/Applications/DataExplorer/Base/RecentFiles.cpp index feafc8a55ba884d32d583f8f21c9a7af5f9f1453..4865272e7a9801ff60fef75227fea242119092c7 100644 --- a/Applications/DataExplorer/Base/RecentFiles.cpp +++ b/Applications/DataExplorer/Base/RecentFiles.cpp @@ -17,9 +17,11 @@ #include <QFileInfo> #include <QSettings> +#include <utility> -RecentFiles::RecentFiles( QObject* parent, const char* slot, QString settingsName) - : QObject(parent), _settingsName(settingsName) +RecentFiles::RecentFiles(QObject* parent, const char* slot, + QString settingsName) + : QObject(parent), _settingsName(std::move(settingsName)) { _filesMenu = new QMenu(tr("Recent files")); for (auto& _fileAction : _fileActions) diff --git a/Applications/DataExplorer/Base/TreeItem.cpp b/Applications/DataExplorer/Base/TreeItem.cpp index bbb88c8ba2a94b6885d0741c59571a63d30dba1e..67960c2f927ee0019260421ce9efae1b97ae39d7 100644 --- a/Applications/DataExplorer/Base/TreeItem.cpp +++ b/Applications/DataExplorer/Base/TreeItem.cpp @@ -12,14 +12,16 @@ * */ +#include <utility> + #include "TreeItem.h" /** * The constructor is only used to record the item's parent * and the data associated with each column. */ -TreeItem::TreeItem(const QList<QVariant> &data, TreeItem* parent) -: _itemData(data), _parentItem(parent) +TreeItem::TreeItem(QList<QVariant> data, TreeItem* parent) + : _itemData(std::move(data)), _parentItem(parent) { } diff --git a/Applications/DataExplorer/Base/TreeItem.h b/Applications/DataExplorer/Base/TreeItem.h index 362c1789e19ae9d61a41d6f2bdd860ed1211e691..6741e97bc1c18b03fc0c18ae2423eeeb318f950e 100644 --- a/Applications/DataExplorer/Base/TreeItem.h +++ b/Applications/DataExplorer/Base/TreeItem.h @@ -27,7 +27,7 @@ class TreeItem { public: - TreeItem(const QList<QVariant> &data, TreeItem* parent); + TreeItem(QList<QVariant> data, TreeItem* parent); virtual ~TreeItem(); void appendChild(TreeItem* child); diff --git a/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp b/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp index bc74da0480a878128ca79b68e13cdbe3057c94e0..294dd5ded1b9276a0a3dacb224d7e64ca9bc6997 100644 --- a/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp +++ b/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp @@ -17,13 +17,15 @@ #include <QFileDialog> #include <QSettings> +#include <utility> #include "DirectConditionGenerator.h" #include "OGSError.h" #include "StrictDoubleValidator.h" -CondFromRasterDialog::CondFromRasterDialog(const std::vector<MeshLib::Mesh*> &msh_vec, QDialog* parent) - : QDialog(parent), _msh_vec(msh_vec) +CondFromRasterDialog::CondFromRasterDialog(std::vector<MeshLib::Mesh*> msh_vec, + QDialog* parent) + : QDialog(parent), _msh_vec(std::move(msh_vec)) { setupUi(this); diff --git a/Applications/DataExplorer/DataView/CondFromRasterDialog.h b/Applications/DataExplorer/DataView/CondFromRasterDialog.h index ecf00fef0f5fc2f71f4eb13cfbc8b12543f6a01e..9de5003574a6c5e2e82e18ce9f6f531d6ba6b0cf 100644 --- a/Applications/DataExplorer/DataView/CondFromRasterDialog.h +++ b/Applications/DataExplorer/DataView/CondFromRasterDialog.h @@ -31,7 +31,7 @@ class CondFromRasterDialog : public QDialog, private Ui_CondFromRaster Q_OBJECT public: - CondFromRasterDialog(const std::vector<MeshLib::Mesh*>& msh_vec, + CondFromRasterDialog(std::vector<MeshLib::Mesh*> msh_vec, QDialog* parent = nullptr); ~CondFromRasterDialog(void); diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.cpp b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.cpp index 41673728d01ad494c8c218fd143fea9bc4049a3c..490728c3ecb2ead5005f272ef9093d70e40be4d8 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.cpp @@ -13,15 +13,18 @@ */ // ** INCLUDES ** +#include <utility> + #include "VtkAlgorithmPropertyCheckbox.h" #include "VtkAlgorithmProperties.h" -VtkAlgorithmPropertyCheckbox::VtkAlgorithmPropertyCheckbox(const bool value, - const QString& name, - VtkAlgorithmProperties* algProps, - QWidget* parent /*= 0*/ ) - : QCheckBox(parent), _name(name), _algProps(algProps) +VtkAlgorithmPropertyCheckbox::VtkAlgorithmPropertyCheckbox( + const bool value, + QString name, + VtkAlgorithmProperties* algProps, + QWidget* parent /*= 0*/) + : QCheckBox(parent), _name(std::move(name)), _algProps(algProps) { this->setChecked(value); connect(this, SIGNAL(stateChanged(int)), this, SLOT(setNewValue(int))); diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.h b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.h index 4272845776ad911de0351535e2729a99312ab491..5d4026ca40af5efc4c31ac96b30f336dd5c0558e 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.h +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyCheckbox.h @@ -30,7 +30,7 @@ public: /// @param name The name of the user property to set. /// @param algProps The VtkAlgorithmProperties object. /// @param parent The parent widget. - VtkAlgorithmPropertyCheckbox(const bool value, const QString& name, + VtkAlgorithmPropertyCheckbox(const bool value, QString name, VtkAlgorithmProperties* algProps, QWidget* parent = nullptr); diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.cpp b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.cpp index 28e5be08ac9738124e85a81ec0ec0b37c30cd4a1..3877f75d24e4e5771c7fca26c74dcdedb9510213 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.cpp @@ -19,13 +19,18 @@ #include <QDoubleValidator> #include <QIntValidator> - -VtkAlgorithmPropertyLineEdit::VtkAlgorithmPropertyLineEdit(const QString& contents, - const QString& name, - QVariant::Type type, - VtkAlgorithmProperties* algProps, - QWidget* parent /*= 0*/) - : QLineEdit(contents, parent), _name(name), _algProps(algProps), _type(type) +#include <utility> + +VtkAlgorithmPropertyLineEdit::VtkAlgorithmPropertyLineEdit( + const QString& contents, + QString name, + QVariant::Type type, + VtkAlgorithmProperties* algProps, + QWidget* parent /*= 0*/) + : QLineEdit(contents, parent), + _name(std::move(name)), + _algProps(algProps), + _type(type) { switch(_type) { diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.h b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.h index 9a7da2436883680192cc31c432068af226b276c9..b628d77f3c1635bf0f992490475928d869a59b53 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.h +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyLineEdit.h @@ -34,7 +34,7 @@ public: /// @param algProps The VtkAlgorithmProperties object. /// @param parent The parent widget. VtkAlgorithmPropertyLineEdit(const QString& contents, - const QString& name, + QString name, QVariant::Type type, VtkAlgorithmProperties* algProps, QWidget* parent = nullptr); diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.cpp b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.cpp index b2840e4d70408f914310b168b2eabbc6278230a8..b278a4b4ca5a81b101231f0a1911535dee310b53 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.cpp @@ -22,13 +22,15 @@ #include <QIntValidator> #include <QLineEdit> #include <QSize> +#include <utility> -VtkAlgorithmPropertyVectorEdit::VtkAlgorithmPropertyVectorEdit( const QList<QString> contents, - const QString& name, - QVariant::Type type, - VtkAlgorithmProperties* algProps, - QWidget* parent /*= 0*/ ) - : QWidget(parent), _name(name), _algProps(algProps), _type(type) +VtkAlgorithmPropertyVectorEdit::VtkAlgorithmPropertyVectorEdit( + const QList<QString> contents, + QString name, + QVariant::Type type, + VtkAlgorithmProperties* algProps, + QWidget* parent /*= 0*/) + : QWidget(parent), _name(std::move(name)), _algProps(algProps), _type(type) { auto* layout = new QHBoxLayout; layout->setSpacing(3); diff --git a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.h b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.h index 209f02242c56f79e1cbfb27a723bce685b424397..9242c3ebfd699d71716faa76a096abefb71ffc2d 100644 --- a/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.h +++ b/Applications/DataExplorer/VtkVis/VtkAlgorithmPropertyVectorEdit.h @@ -34,7 +34,7 @@ public: /// @param algProps The VtkAlgorithmProperties object. /// @param parent The parent widget. VtkAlgorithmPropertyVectorEdit(const QList<QString> contents, - const QString& name, + QString name, QVariant::Type type, VtkAlgorithmProperties* algProps, QWidget* parent = nullptr); diff --git a/BaseLib/ConfigTree-impl.h b/BaseLib/ConfigTree-impl.h index 4a51a7cda127fed4be4a3cef819842289a8156b1..79cdcf73e7e37aefac85d2f0cc85c6fd61e061f0 100644 --- a/BaseLib/ConfigTree-impl.h +++ b/BaseLib/ConfigTree-impl.h @@ -10,6 +10,7 @@ #include "ConfigTree.h" #include <sstream> +#include <utility> namespace BaseLib { @@ -20,7 +21,7 @@ class Range { public: explicit Range(Iterator begin, Iterator end) - : _begin(begin), _end(end) + : _begin(std::move(begin)), _end(std::move(end)) {} Iterator begin() const { return _begin; } diff --git a/BaseLib/ConfigTree.cpp b/BaseLib/ConfigTree.cpp index db7c849e4d28a236b1843f360cc470d6b3aaa7cb..e287b015142fef1e82f4f7547f06ec17ed95694f 100644 --- a/BaseLib/ConfigTree.cpp +++ b/BaseLib/ConfigTree.cpp @@ -11,6 +11,7 @@ #include <forward_list> #include <logog/include/logog.hpp> +#include <utility> #include "Error.h" @@ -30,12 +31,14 @@ const char ConfigTree::pathseparator = '/'; const std::string ConfigTree::key_chars_start = "abcdefghijklmnopqrstuvwxyz"; const std::string ConfigTree::key_chars = key_chars_start + "_0123456789"; -ConfigTree:: -ConfigTree(PTree const& tree, - std::string const& filename, - Callback const& error_cb, - Callback const& warning_cb) - : _tree(&tree), _filename(filename), _onerror(error_cb), _onwarning(warning_cb) +ConfigTree::ConfigTree(PTree const& tree, + std::string filename, + Callback error_cb, + Callback warning_cb) + : _tree(&tree), + _filename(std::move(filename)), + _onerror(std::move(error_cb)), + _onwarning(std::move(warning_cb)) { if (!_onerror) { OGS_FATAL("ConfigTree: No valid error handler provided."); diff --git a/BaseLib/ConfigTree.h b/BaseLib/ConfigTree.h index 8f8bcc20fb045191a5e38cd6d014cf8734c0b05d..90d40954287212da524d2bed6f826d241f89fd83 100644 --- a/BaseLib/ConfigTree.h +++ b/BaseLib/ConfigTree.h @@ -14,6 +14,7 @@ #include <functional> #include <memory> +#include <utility> #include <vector> #include <boost/property_tree/ptree.hpp> @@ -105,9 +106,9 @@ public: public: using Iterator = boost::property_tree::ptree::const_assoc_iterator; - explicit SubtreeIterator(Iterator it, std::string const& root, + explicit SubtreeIterator(Iterator it, std::string root, ConfigTree const& parent) - : _it(it), _tagname(root), _parent(parent) + : _it(it), _tagname(std::move(root)), _parent(parent) {} SubtreeIterator& operator++() { @@ -189,9 +190,9 @@ public: public: using Iterator = boost::property_tree::ptree::const_assoc_iterator; - explicit ValueIterator(Iterator it, std::string const& root, + explicit ValueIterator(Iterator it, std::string root, ConfigTree const& parent) - : _it(it), _tagname(root), _parent(parent) + : _it(it), _tagname(std::move(root)), _parent(parent) {} ValueIterator<ValueType>& operator++() { @@ -255,9 +256,9 @@ public: * i.e., warnings will also result in program abortion! */ explicit ConfigTree(PTree const& tree, - std::string const& filename, - Callback const& error_cb, - Callback const& warning_cb); + std::string filename, + Callback error_cb, + Callback warning_cb); /*! This constructor is deleted in order to prevent the user from passing * temporary instances of \c PTree. diff --git a/BaseLib/Histogram.h b/BaseLib/Histogram.h index 3b7780bff41b31537d59afbfc091b87c9481f23f..6d4aa8783c8fb0113a2db58dbb1c4b1ff7c85ffd 100644 --- a/BaseLib/Histogram.h +++ b/BaseLib/Histogram.h @@ -14,9 +14,10 @@ #include <algorithm> #include <cmath> -#include <iterator> -#include <iosfwd> #include <fstream> +#include <iosfwd> +#include <iterator> +#include <utility> #include <vector> #include <logog/include/logog.hpp> @@ -59,9 +60,9 @@ public: * \param computeHistogram Compute histogram if set. If not set user must call * \c update() before accessing data. */ - Histogram(std::vector<T> const& data, const unsigned int nr_bins = 16, + Histogram(std::vector<T> data, const unsigned int nr_bins = 16, const bool computeHistogram = true) - : _data(data), _nr_bins(nr_bins) + : _data(std::move(data)), _nr_bins(nr_bins) { init(computeHistogram); } diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp index 7661895544a349afad4d9455549da6f1066c8770..4fa8ed79033e5dfe46e9e827702584a9a3adf1e1 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp @@ -23,14 +23,14 @@ #include <QCryptographicHash> #include <logog/include/logog.hpp> +#include <utility> namespace BaseLib { namespace IO { - -XMLQtInterface::XMLQtInterface(const std::string &schemaFile) : - _schemaName(schemaFile) +XMLQtInterface::XMLQtInterface(std::string schemaFile) + : _schemaName(std::move(schemaFile)) {} int XMLQtInterface::readFile(const QString &fileName) diff --git a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h index d941114cf0ee8c3466965ef66eb6fd81e1b35e8f..7c21fcf9ac0933e4bfcc28be452c8e99582393f8 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.h @@ -30,7 +30,7 @@ namespace IO class XMLQtInterface { public: - XMLQtInterface(const std::string &schemaFile = ""); + XMLQtInterface(std::string schemaFile = ""); virtual ~XMLQtInterface() = default; /// As QXMLStreamWriter seems currently unable to include style-file links into xml-files, this method will workaround this issue and include the stylefile link. diff --git a/GeoLib/DuplicateGeometry.cpp b/GeoLib/DuplicateGeometry.cpp index 1240c8b23b988bb5586e1c4f33cac4e1cebfddae..8ea38744140a4582fd89031b5717e03116c8b7d8 100644 --- a/GeoLib/DuplicateGeometry.cpp +++ b/GeoLib/DuplicateGeometry.cpp @@ -10,6 +10,7 @@ #include "DuplicateGeometry.h" #include <logog/include/logog.hpp> +#include <utility> #include "GeoLib/GEOObjects.h" #include "GeoLib/Point.h" @@ -20,11 +21,10 @@ namespace GeoLib { - -DuplicateGeometry::DuplicateGeometry(GeoLib::GEOObjects &geo_objects, - std::string const& input_name, - std::string const& output_name) -: _output_name(output_name), _geo_objects(geo_objects) +DuplicateGeometry::DuplicateGeometry(GeoLib::GEOObjects& geo_objects, + std::string const& input_name, + std::string output_name) + : _output_name(std::move(output_name)), _geo_objects(geo_objects) { duplicate(input_name); } diff --git a/GeoLib/DuplicateGeometry.h b/GeoLib/DuplicateGeometry.h index 820f09a3df5fe9a554875ca5665a2324b1540eff..7550f0337644b659926b31da860e523d52d4fb09 100644 --- a/GeoLib/DuplicateGeometry.h +++ b/GeoLib/DuplicateGeometry.h @@ -33,9 +33,9 @@ public: * \param input_name The geometry to be copied * \param output_name The name of the copy (note: this might be modified by GEOObjects) */ - DuplicateGeometry(GeoLib::GEOObjects &geo_objects, - std::string const& input_name, - std::string const& output_name); + DuplicateGeometry(GeoLib::GEOObjects& geo_objects, + std::string const& input_name, + std::string output_name); // Returns the (possibly modified) output name of the new geometry. std::string const& getFinalizedOutputName() const { return _output_name; } diff --git a/GeoLib/QuadTree.h b/GeoLib/QuadTree.h index 7b9878635d7471ab12992ae9e6c9749d22aabf3e..d5132cbb9f5364b37a4fe50749b5fa66d45a40e7 100644 --- a/GeoLib/QuadTree.h +++ b/GeoLib/QuadTree.h @@ -17,6 +17,7 @@ #include <limits> #include <logog/include/logog.hpp> +#include <utility> namespace GeoLib { @@ -47,9 +48,13 @@ public: * @param ur upper right point of the square * @param max_points_per_leaf maximum number of points per leaf */ - QuadTree(POINT const& ll, POINT const& ur, std::size_t max_points_per_leaf) : - _father (nullptr), _ll (ll), _ur (ur), _depth (0), _is_leaf (true), - _max_points_per_leaf (max_points_per_leaf) + QuadTree(POINT ll, POINT ur, std::size_t max_points_per_leaf) + : _father(nullptr), + _ll(std::move(ll)), + _ur(std::move(ur)), + _depth(0), + _is_leaf(true), + _max_points_per_leaf(max_points_per_leaf) { assert (_max_points_per_leaf > 0); @@ -368,13 +373,17 @@ private: * @param max_points_per_leaf maximum number of points per leaf * @return */ - QuadTree (POINT const& ll, - POINT const& ur, - QuadTree* father, - std::size_t depth, - std::size_t max_points_per_leaf) : - _father (father), _ll (ll), _ur (ur), _depth (depth), _is_leaf (true), - _max_points_per_leaf (max_points_per_leaf) + QuadTree(POINT ll, + POINT ur, + QuadTree* father, + std::size_t depth, + std::size_t max_points_per_leaf) + : _father(father), + _ll(std::move(ll)), + _ur(std::move(ur)), + _depth(depth), + _is_leaf(true), + _max_points_per_leaf(max_points_per_leaf) { // init children for (auto& k : _children) diff --git a/GeoLib/Raster.h b/GeoLib/Raster.h index 386ab2ecb59c2a7532b04202d0577b811c9b7ad6..beb70ec56c3c852ef63568d7ddfc3e4616ed5eb5 100644 --- a/GeoLib/Raster.h +++ b/GeoLib/Raster.h @@ -13,6 +13,8 @@ #pragma once +#include <utility> + #include "Surface.h" namespace GeoLib { @@ -49,9 +51,10 @@ public: * @param begin input iterator pointing to the first element of the data * @param end input iterator pointing to the last element of the data, end have to be reachable from begin */ - template<typename InputIterator> - Raster(RasterHeader header, InputIterator begin, InputIterator end) : - _header(header), _raster_data(new double[_header.n_cols*_header.n_rows]) + template <typename InputIterator> + Raster(RasterHeader header, InputIterator begin, InputIterator end) + : _header(std::move(header)), + _raster_data(new double[_header.n_cols * _header.n_rows]) { iterator raster_it(_raster_data); for (InputIterator it(begin); it != end; ++it) { diff --git a/GeoLib/Station.cpp b/GeoLib/Station.cpp index acfee0f1ece279d94e5b31b1af131e1dcf2ac371..27332304b9dca38b4f139bd143fa4eaa815ab093 100644 --- a/GeoLib/Station.cpp +++ b/GeoLib/Station.cpp @@ -23,14 +23,20 @@ namespace GeoLib { -Station::Station(double x, double y, double z, std::string const& name) : - Point (x,y,z), _name(name), _type(Station::StationType::STATION), - _station_value(0.0), _sensor_data(nullptr) +Station::Station(double x, double y, double z, std::string name) + : Point(x, y, z), + _name(std::move(name)), + _type(Station::StationType::STATION), + _station_value(0.0), + _sensor_data(nullptr) {} -Station::Station(Point* coords, std::string const& name) : - Point (*coords), _name(name), _type(Station::StationType::STATION), - _station_value(0.0), _sensor_data(nullptr) +Station::Station(Point* coords, std::string name) + : Point(*coords), + _name(std::move(name)), + _type(Station::StationType::STATION), + _station_value(0.0), + _sensor_data(nullptr) {} Station::Station(Station const& src) : diff --git a/GeoLib/Station.h b/GeoLib/Station.h index adca976c61b3cffe809e6d1f62cf01eec2b570e7..aa131162090df24d7f00c5ea92c7677acf76cc31 100644 --- a/GeoLib/Station.h +++ b/GeoLib/Station.h @@ -55,9 +55,9 @@ public: Station(double x = 0.0, double y = 0.0, double z = 0.0, - std::string const& name = ""); + std::string name = ""); - Station(Point* coords, std::string const& name = ""); + Station(Point* coords, std::string name = ""); /** * Constructor copies the source object diff --git a/GeoLib/TemplateVec.h b/GeoLib/TemplateVec.h index 36a0ba2ab4ca7b96e47e1eecd87014fdb84404c8..81cd5ea02d2a7f1519f2964d21a35ebd9db13dd0 100644 --- a/GeoLib/TemplateVec.h +++ b/GeoLib/TemplateVec.h @@ -20,6 +20,7 @@ #include <map> #include <memory> #include <string> +#include <utility> #include <vector> #include <logog/include/logog.hpp> @@ -55,9 +56,11 @@ public: * of the element and the value for std::size_t stands for an index in * the data_vec. */ - TemplateVec (const std::string &name, std::unique_ptr<std::vector<T*>> data_vec, - NameIdMap* elem_name_map = nullptr) : - _name(name), _data_vec(std::move(data_vec)), _name_id_map (elem_name_map) + TemplateVec(std::string name, std::unique_ptr<std::vector<T*>> data_vec, + NameIdMap* elem_name_map = nullptr) + : _name(std::move(name)), + _data_vec(std::move(data_vec)), + _name_id_map(elem_name_map) { if (_data_vec == nullptr) { diff --git a/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h b/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h index ed94b0fb825c6a06ddd7256f2a209104beb7d3a4..14865299bf62585777bfc0e765008713322d5895 100644 --- a/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h +++ b/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h @@ -13,10 +13,11 @@ #pragma once -#include <string> -#include <vector> #include <array> #include <cmath> +#include <string> +#include <utility> +#include <vector> #include "MaterialLib/Fluid/FluidProperty.h" @@ -37,8 +38,8 @@ public: * \param constants Constants of the fluid. * */ - explicit VogelsLiquidDynamicViscosity(const VogelsConstants& constants) - : _constants(constants) + explicit VogelsLiquidDynamicViscosity(VogelsConstants constants) + : _constants(std::move(constants)) { } diff --git a/MaterialLib/FractureModels/LinearElasticIsotropic.h b/MaterialLib/FractureModels/LinearElasticIsotropic.h index 7c44ede3f584f2752ca600418adb7cd75af226f8..2bc3037dac02979acd8c709d82465358a462e725 100644 --- a/MaterialLib/FractureModels/LinearElasticIsotropic.h +++ b/MaterialLib/FractureModels/LinearElasticIsotropic.h @@ -10,6 +10,7 @@ #pragma once #include <Eigen/Eigen> +#include <utility> #include "ProcessLib/Parameter/Parameter.h" @@ -55,9 +56,8 @@ public: } public: - explicit LinearElasticIsotropic( - MaterialProperties const& material_properties) - : _mp(material_properties) + explicit LinearElasticIsotropic(MaterialProperties material_properties) + : _mp(std::move(material_properties)) { } diff --git a/MaterialLib/FractureModels/MohrCoulomb.h b/MaterialLib/FractureModels/MohrCoulomb.h index a16744bd5acb38c6db4f5dbc4dd756868e487300..e2a8c1b2308bf2bb4dad636c6e9b3c235fb0cf79 100644 --- a/MaterialLib/FractureModels/MohrCoulomb.h +++ b/MaterialLib/FractureModels/MohrCoulomb.h @@ -10,6 +10,7 @@ #pragma once #include <Eigen/Eigen> +#include <utility> #include "ProcessLib/Parameter/Parameter.h" @@ -64,10 +65,8 @@ public: } public: - - explicit MohrCoulomb( - MaterialProperties const& material_properties) - : _mp(material_properties) + explicit MohrCoulomb(MaterialProperties material_properties) + : _mp(std::move(material_properties)) { } diff --git a/MaterialLib/SolidModels/Ehlers.h b/MaterialLib/SolidModels/Ehlers.h index 3cac0f7dc6720b69cbfe6d22ca8377163e7807d1..9b5d9145312e67d0c934dec6d03abae66aedeaf2 100644 --- a/MaterialLib/SolidModels/Ehlers.h +++ b/MaterialLib/SolidModels/Ehlers.h @@ -27,6 +27,7 @@ #include <Eigen/Dense> #include <logog/include/logog.hpp> +#include <utility> #include "BaseLib/Error.h" #include "NumLib/NewtonRaphson.h" @@ -210,12 +211,11 @@ public: public: explicit SolidEhlers( - NumLib::NewtonRaphsonSolverParameters const& - nonlinear_solver_parameters, - MaterialProperties const& material_properties, + NumLib::NewtonRaphsonSolverParameters nonlinear_solver_parameters, + MaterialProperties material_properties, std::unique_ptr<EhlersDamageProperties>&& damage_properties) - : _nonlinear_solver_parameters(nonlinear_solver_parameters), - _mp(material_properties), + : _nonlinear_solver_parameters(std::move(nonlinear_solver_parameters)), + _mp(std::move(material_properties)), _damage_properties(std::move(damage_properties)) { } diff --git a/MaterialLib/SolidModels/LinearElasticIsotropic.h b/MaterialLib/SolidModels/LinearElasticIsotropic.h index 3342eb0b4387e186f999df9c3048c7155b250020..9e6357f40f7e9b75d8b869e0d414fb0eb3a669cb 100644 --- a/MaterialLib/SolidModels/LinearElasticIsotropic.h +++ b/MaterialLib/SolidModels/LinearElasticIsotropic.h @@ -9,6 +9,8 @@ #pragma once +#include <utility> + #include "MechanicsBase.h" namespace MaterialLib @@ -72,9 +74,8 @@ public: using KelvinVector = ProcessLib::KelvinVectorType<DisplacementDim>; using KelvinMatrix = ProcessLib::KelvinMatrixType<DisplacementDim>; - explicit LinearElasticIsotropic( - MaterialProperties const& material_properties) - : _mp(material_properties) + explicit LinearElasticIsotropic(MaterialProperties material_properties) + : _mp(std::move(material_properties)) { } diff --git a/MaterialLib/SolidModels/Lubby2.h b/MaterialLib/SolidModels/Lubby2.h index a53392f25fbd4f9ab17fa2a309493347623efd4e..6ec6d0cdb915e33221aad7145126f62e00e422db 100644 --- a/MaterialLib/SolidModels/Lubby2.h +++ b/MaterialLib/SolidModels/Lubby2.h @@ -10,6 +10,7 @@ #pragma once #include <logog/include/logog.hpp> +#include <utility> #include "BaseLib/Error.h" #include "NumLib/NewtonRaphson.h" @@ -166,10 +167,10 @@ public: Eigen::RowMajor>; public: - explicit Lubby2(NumLib::NewtonRaphsonSolverParameters const& - nonlinear_solver_parameters, - Lubby2MaterialProperties& material_properties) - : _nonlinear_solver_parameters(nonlinear_solver_parameters), + explicit Lubby2( + NumLib::NewtonRaphsonSolverParameters nonlinear_solver_parameters, + Lubby2MaterialProperties& material_properties) + : _nonlinear_solver_parameters(std::move(nonlinear_solver_parameters)), _mp(material_properties) { } diff --git a/MaterialLib/TwoPhaseModels/TwoPhaseFlowWithPPMaterialProperties.cpp b/MaterialLib/TwoPhaseModels/TwoPhaseFlowWithPPMaterialProperties.cpp index 15bc7631967cf691acf56496f28857665e72b924..0b4c981f9268c0f6e185d46f4a348fbba6ae62f7 100644 --- a/MaterialLib/TwoPhaseModels/TwoPhaseFlowWithPPMaterialProperties.cpp +++ b/MaterialLib/TwoPhaseModels/TwoPhaseFlowWithPPMaterialProperties.cpp @@ -9,6 +9,7 @@ #include "TwoPhaseFlowWithPPMaterialProperties.h" #include <logog/include/logog.hpp> +#include <utility> #include "BaseLib/reorderVector.h" #include "MaterialLib/Fluid/FluidProperty.h" #include "MaterialLib/PorousMedium/Porosity/Porosity.h" @@ -46,7 +47,7 @@ TwoPhaseFlowWithPPMaterialProperties::TwoPhaseFlowWithPPMaterialProperties( _gas_density(std::move(gas_density)), _gas_viscosity(std::move(gas_viscosity)), _material_ids(material_ids), - _intrinsic_permeability_models(intrinsic_permeability_models), + _intrinsic_permeability_models(std::move(intrinsic_permeability_models)), _porosity_models(std::move(porosity_models)), _storage_models(std::move(storage_models)) { diff --git a/MathLib/LinearFunction.h b/MathLib/LinearFunction.h index 1d5b593fc2096bae5109e7eded4d8b0590443e60..be6a25d58bced56e19472b09ccb5aa2ab1b417c1 100644 --- a/MathLib/LinearFunction.h +++ b/MathLib/LinearFunction.h @@ -14,6 +14,7 @@ #include <array> #include <numeric> +#include <utility> namespace MathLib { @@ -36,8 +37,8 @@ public: * \param coefficients an array of coefficients of a linear function. * The size of the coefficient array should equal to the number of variables + 1 */ - explicit LinearFunction(const std::array<T_TYPE, N_VARS+1> &coefficients) - : _coefficients(coefficients) + explicit LinearFunction(std::array<T_TYPE, N_VARS + 1> coefficients) + : _coefficients(std::move(coefficients)) {} /** diff --git a/MathLib/TemplatePoint.h b/MathLib/TemplatePoint.h index 92bc97d107f69c413a7b107536bd17fa14ed226c..9b3656164cb159d7f002f81d1102ad91b6f0076c 100644 --- a/MathLib/TemplatePoint.h +++ b/MathLib/TemplatePoint.h @@ -15,12 +15,13 @@ #pragma once // STL -#include <array> #include <algorithm> +#include <array> +#include <cassert> #include <cmath> -#include <iterator> #include <istream> -#include <cassert> +#include <iterator> +#include <utility> namespace MathLib { @@ -42,7 +43,7 @@ public: * * @param x std::array containing the coordinates of the point */ - explicit TemplatePoint(std::array<T,DIM> const& x); + explicit TemplatePoint(std::array<T, DIM> x); /** virtual destructor */ virtual ~TemplatePoint() = default; @@ -100,8 +101,7 @@ TemplatePoint<T,DIM>::TemplatePoint() : {} template <typename T, std::size_t DIM> -TemplatePoint<T,DIM>::TemplatePoint(std::array<T,DIM> const& x) : - _x(x) +TemplatePoint<T, DIM>::TemplatePoint(std::array<T, DIM> x) : _x(std::move(x)) {} /** Equality of TemplatePoint's up to an epsilon. diff --git a/MeshLib/IO/VtkIO/PVDFile.h b/MeshLib/IO/VtkIO/PVDFile.h index 1e7e30ea278d85a27f11440cc16f8ea03dfe7769..e0a7b8bdea84b9e56e11d38f6b879f9031259e9b 100644 --- a/MeshLib/IO/VtkIO/PVDFile.h +++ b/MeshLib/IO/VtkIO/PVDFile.h @@ -10,6 +10,7 @@ #pragma once #include <string> +#include <utility> #include <vector> namespace MeshLib @@ -24,7 +25,10 @@ class PVDFile { public: //! Set a PVD file path - explicit PVDFile(std::string const& pvd_fname) : _pvd_filename(pvd_fname) {} + explicit PVDFile(std::string pvd_fname) + : _pvd_filename(std::move(pvd_fname)) + { + } //! Add a VTU file to this PVD file. void addVTUFile(std::string const& vtu_fname, double timestep); diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index 542d01a96fbfd67c62084314ad375ad46d72a5c7..30747ef61390b9e05fd9989b653856fed14d7b7a 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -15,6 +15,7 @@ #include "Mesh.h" #include <memory> +#include <utility> #include "BaseLib/RunTime.h" @@ -28,23 +29,27 @@ namespace MeshLib { - -Mesh::Mesh(const std::string &name, - const std::vector<Node*> &nodes, - const std::vector<Element*> &elements, +Mesh::Mesh(std::string name, + std::vector<Node*> + nodes, + std::vector<Element*> + elements, Properties const& properties, const std::size_t n_base_nodes) - : _id(_counter_value-1), _mesh_dimension(0), + : _id(_counter_value - 1), + _mesh_dimension(0), _edge_length(std::numeric_limits<double>::max(), 0), _node_distance(std::numeric_limits<double>::max(), 0), - _name(name), _nodes(nodes), _elements(elements), + _name(std::move(name)), + _nodes(std::move(nodes)), + _elements(std::move(elements)), _n_base_nodes(n_base_nodes), _properties(properties) { - assert(n_base_nodes <= nodes.size()); + assert(_n_base_nodes <= _nodes.size()); this->resetNodeIDs(); this->resetElementIDs(); - if ((n_base_nodes==0 && hasNonlinearElement()) || isNonlinear()) + if ((_n_base_nodes == 0 && hasNonlinearElement()) || isNonlinear()) this->checkNonlinearNodeIDs(); this->setDimension(); this->setElementsConnectedToNodes(); diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h index 2d7f63ca0dbb5bdf584e90f66cfd3f5cec602599..6f26b61c0de67fb66186eb037cbee927637d3a52 100644 --- a/MeshLib/Mesh.h +++ b/MeshLib/Mesh.h @@ -56,9 +56,11 @@ public: /// parameter for nonlinear case. If the parameter is /// set to zero, we consider there are no nonlinear /// nodes. - Mesh(const std::string &name, - const std::vector<Node*> &nodes, - const std::vector<Element*> &elements, + Mesh(std::string name, + std::vector<Node*> + nodes, + std::vector<Element*> + elements, Properties const& properties = Properties(), const std::size_t n_base_nodes = 0); diff --git a/MeshLib/PropertyVector.h b/MeshLib/PropertyVector.h index fc3de6dddfbc3f039d38c32ea4403673774dd373..3b33ab3e68f0216830189bfbf679dc2ff8111015 100644 --- a/MeshLib/PropertyVector.h +++ b/MeshLib/PropertyVector.h @@ -14,6 +14,7 @@ #include <iterator> #include <ostream> #include <string> +#include <utility> #include <vector> #include "BaseLib/Error.h" @@ -35,12 +36,12 @@ public: std::size_t getNumberOfComponents() const { return _n_components; } protected: - PropertyVectorBase(std::string const& property_name, + PropertyVectorBase(std::string property_name, MeshItemType mesh_item_type, std::size_t n_components) : _n_components(n_components), _mesh_item_type(mesh_item_type), - _property_name(property_name) + _property_name(std::move(property_name)) {} std::size_t const _n_components; @@ -254,11 +255,12 @@ protected: /// nodes or cells (see enumeration MeshItemType) /// @param n_components the number of elements of a tuple PropertyVector(std::size_t n_prop_groups, - std::vector<std::size_t> const& item2group_mapping, + std::vector<std::size_t> + item2group_mapping, std::string const& property_name, MeshItemType mesh_item_type, std::size_t n_components) - : std::vector<std::size_t>(item2group_mapping), + : std::vector<std::size_t>(std::move(item2group_mapping)), PropertyVectorBase(property_name, mesh_item_type, n_components), _values(n_prop_groups * n_components) {} diff --git a/NumLib/DOF/ComponentGlobalIndexDict.h b/NumLib/DOF/ComponentGlobalIndexDict.h index e844601c7e2af75f482f33e43485a45cc1cb572a..ba7644b7adc2bf8b1e40e9c9895c59823983f53c 100644 --- a/NumLib/DOF/ComponentGlobalIndexDict.h +++ b/NumLib/DOF/ComponentGlobalIndexDict.h @@ -18,6 +18,7 @@ #include <boost/multi_index/member.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index_container.hpp> +#include <utility> #include "MeshLib/Location.h" #include "NumLib/NumericsConfig.h" @@ -39,19 +40,20 @@ struct Line // Position in global matrix or vector GlobalIndexType global_index; - Line(MeshLib::Location const& l, std::size_t c, GlobalIndexType i) - : location(l), comp_id(c), global_index(i) + Line(MeshLib::Location l, std::size_t c, GlobalIndexType i) + : location(std::move(l)), comp_id(c), global_index(i) {} - Line(MeshLib::Location const& l, std::size_t c) - : location(l), comp_id(c), - global_index(std::numeric_limits<GlobalIndexType>::max()) + Line(MeshLib::Location l, std::size_t c) + : location(std::move(l)), + comp_id(c), + global_index(std::numeric_limits<GlobalIndexType>::max()) {} - explicit Line(MeshLib::Location const& l) - : location(l), - comp_id(std::numeric_limits<std::size_t>::max()), - global_index(std::numeric_limits<GlobalIndexType>::max()) + explicit Line(MeshLib::Location l) + : location(std::move(l)), + comp_id(std::numeric_limits<std::size_t>::max()), + global_index(std::numeric_limits<GlobalIndexType>::max()) {} friend std::ostream& operator<<(std::ostream& os, Line const& l) diff --git a/NumLib/Function/TemplateSpatialFunction.h b/NumLib/Function/TemplateSpatialFunction.h index 8b372e1d64330cb2bcd3a1c8ce984e80896cae9a..4f640cb5cc4f466d076afa4736fbf90aa2c25159 100644 --- a/NumLib/Function/TemplateSpatialFunction.h +++ b/NumLib/Function/TemplateSpatialFunction.h @@ -12,6 +12,8 @@ #pragma once +#include <utility> + #include "ISpatialFunction.h" namespace NumLib @@ -30,9 +32,7 @@ public: * Constructor * @param f a function object */ - TemplateSpatialFunction(const T_FUNCTION &f) - : _f(f) {} - + TemplateSpatialFunction(T_FUNCTION f) : _f(std::move(f)) {} /** * evaluate a function * @param pnt a point object diff --git a/NumLib/NamedFunction.h b/NumLib/NamedFunction.h index bea46bac736816048215cd8e63b55f50940f2e1a..a8771d1e53f2bd3a7b791233932f6dbbc11d9aee 100644 --- a/NumLib/NamedFunction.h +++ b/NumLib/NamedFunction.h @@ -14,6 +14,7 @@ #include <memory> #include <string> #include <type_traits> +#include <utility> #include <vector> namespace detail @@ -57,7 +58,7 @@ public: * \param function the actual function object */ template <typename ReturnType, typename... Arguments> - NamedFunction(std::string const& name, + NamedFunction(std::string name, std::vector<std::string>&& argument_names, std::function<ReturnType(Arguments...)>&& function); @@ -92,10 +93,10 @@ private: }; template <typename ReturnType, typename... Arguments> -NamedFunction::NamedFunction(std::string const& name, +NamedFunction::NamedFunction(std::string name, std::vector<std::string>&& argument_names, std::function<ReturnType(Arguments...)>&& function) - : _name(name), + : _name(std::move(name)), _argument_names(std::move(argument_names)), _function( new std::function<ReturnType(Arguments...)>(std::move(function))) diff --git a/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.cpp b/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.cpp index e41318cf79a0eee3e2862912a0b9e06a37abba86..d6e27d960e357f54a1d690ce9fe0ea669dcfb62b 100644 --- a/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.cpp +++ b/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.cpp @@ -11,21 +11,31 @@ #include "IterationNumberBasedAdaptiveTimeStepping.h" -#include <limits> #include <algorithm> #include <cassert> #include <cmath> +#include <limits> +#include <utility> namespace NumLib { - -IterationNumberBasedAdaptiveTimeStepping::IterationNumberBasedAdaptiveTimeStepping(double t0, double tn, - double min_ts, double max_ts, double initial_ts, - const std::vector<std::size_t> &iter_times_vector, - const std::vector<double> &multiplier_vector) -: _t_initial(t0), _t_end(tn), _iter_times_vector(iter_times_vector), _multiplier_vector(multiplier_vector), - _min_ts(min_ts), _max_ts(max_ts), _initial_ts(initial_ts), _max_iter(_iter_times_vector.empty() ? 0 : _iter_times_vector.back()), - _iter_times(0), _ts_pre(t0), _ts_current(t0), _n_rejected_steps(0) +IterationNumberBasedAdaptiveTimeStepping:: + IterationNumberBasedAdaptiveTimeStepping( + double t0, double tn, double min_ts, double max_ts, double initial_ts, + std::vector<std::size_t> iter_times_vector, + std::vector<double> multiplier_vector) + : _t_initial(t0), + _t_end(tn), + _iter_times_vector(std::move(iter_times_vector)), + _multiplier_vector(std::move(multiplier_vector)), + _min_ts(min_ts), + _max_ts(max_ts), + _initial_ts(initial_ts), + _max_iter(_iter_times_vector.empty() ? 0 : _iter_times_vector.back()), + _iter_times(0), + _ts_pre(t0), + _ts_current(t0), + _n_rejected_steps(0) { assert(iter_times_vector.size() == multiplier_vector.size()); } diff --git a/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.h b/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.h index 4ff96ac9a982c3a96d4883f44259030433211cb6..b0c20f7e3801aa3765a00098eaf52171ac8aca2d 100644 --- a/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.h +++ b/NumLib/TimeStepping/Algorithms/IterationNumberBasedAdaptiveTimeStepping.h @@ -74,13 +74,15 @@ public: * (\f$a_1\f$, \f$a_2\f$, ..., \f$a_n\f$) corresponding to the intervals given by iter_times_vector. * A time step size is calculated by \f$\Delta t_{n+1} = a * \Delta t_{n}\f$ */ - IterationNumberBasedAdaptiveTimeStepping( double t_initial, - double t_end, - double min_ts, - double max_ts, - double initial_ts, - const std::vector<std::size_t> &iter_times_vector, - const std::vector<double> &multiplier_vector); + IterationNumberBasedAdaptiveTimeStepping(double t_initial, + double t_end, + double min_ts, + double max_ts, + double initial_ts, + std::vector<std::size_t> + iter_times_vector, + std::vector<double> + multiplier_vector); virtual ~IterationNumberBasedAdaptiveTimeStepping() = default; diff --git a/ProcessLib/CachedSecondaryVariable.h b/ProcessLib/CachedSecondaryVariable.h index 3a8d3e790cec924aec76312137bb2e8378d85616..0c6b5335f6e8c1353cf7cc7343582033baa71d47 100644 --- a/ProcessLib/CachedSecondaryVariable.h +++ b/ProcessLib/CachedSecondaryVariable.h @@ -9,6 +9,8 @@ #pragma once +#include <utility> + #include "NumLib/Extrapolation/ExtrapolatableElementCollection.h" #include "NumLib/NamedFunctionProvider.h" #include "NumLib/NumericsConfig.h" @@ -36,17 +38,17 @@ public: template <typename LocalAssemblerCollection, typename IntegrationPointValuesMethod> CachedSecondaryVariable( - std::string const& internal_variable_name, + std::string internal_variable_name, NumLib::Extrapolator& extrapolator, LocalAssemblerCollection const& local_assemblers, IntegrationPointValuesMethod integration_point_values_method, SecondaryVariableContext const& context) - : _extrapolator(extrapolator) - , _extrapolatables(new NumLib::ExtrapolatableLocalAssemblerCollection< + : _extrapolator(extrapolator), + _extrapolatables(new NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection>{ - local_assemblers, integration_point_values_method}) - , _context(context) - , _internal_variable_name(internal_variable_name) + local_assemblers, integration_point_values_method}), + _context(context), + _internal_variable_name(std::move(internal_variable_name)) { } diff --git a/ProcessLib/HT/HTFEM.h b/ProcessLib/HT/HTFEM.h index 938ba3b1b06a3963deecb3806e76af6ead309e14..f2cbd909e58eb2696a82a20bf71015fea645275e 100644 --- a/ProcessLib/HT/HTFEM.h +++ b/ProcessLib/HT/HTFEM.h @@ -30,10 +30,12 @@ namespace HT template < typename NodalRowVectorType, typename GlobalDimNodalMatrixType> struct IntegrationPointData final { - IntegrationPointData(NodalRowVectorType const& N_, - GlobalDimNodalMatrixType const& dNdx_, + IntegrationPointData(NodalRowVectorType N_, + GlobalDimNodalMatrixType dNdx_, double const& integration_weight_) - : N(N_), dNdx(dNdx_), integration_weight(integration_weight_) + : N(std::move(N_)), + dNdx(std::move(dNdx_)), + integration_weight(integration_weight_) {} NodalRowVectorType const N; diff --git a/ProcessLib/HT/HTProcessData.h b/ProcessLib/HT/HTProcessData.h index ea071ca707c0e8541026bf17129eb1bc24a8e216..f84c7e3ebdd3fb42e08c5c882425c6791dbcc606 100644 --- a/ProcessLib/HT/HTProcessData.h +++ b/ProcessLib/HT/HTProcessData.h @@ -10,6 +10,7 @@ #pragma once #include <memory> +#include <utility> #include "MaterialLib/Fluid/FluidProperty.h" #include "MaterialLib/PorousMedium/Porosity/Porosity.h" @@ -43,7 +44,7 @@ struct HTProcessData ProcessLib::Parameter<double> const& specific_heat_capacity_fluid_, ProcessLib::Parameter<double> const& thermal_conductivity_solid_, ProcessLib::Parameter<double> const& thermal_conductivity_fluid_, - Eigen::Vector3d const& specific_body_force_, + Eigen::Vector3d specific_body_force_, bool const has_gravity_) : porous_media_properties(std::move(porous_media_properties_)), viscosity_model(std::move(viscosity_model_)), @@ -56,7 +57,7 @@ struct HTProcessData thermal_dispersivity_transversal(thermal_dispersivity_transversal_), thermal_conductivity_solid(thermal_conductivity_solid_), thermal_conductivity_fluid(thermal_conductivity_fluid_), - specific_body_force(specific_body_force_), + specific_body_force(std::move(specific_body_force_)), has_gravity(has_gravity_) { } diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h b/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h index 1172958b3afe7646f9d651306039310834cc9f30..2f7c1baebf3609f39eaa9db3e4d6a9f2c73452f2 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h +++ b/ProcessLib/HydroMechanics/HydroMechanicsProcessData.h @@ -10,6 +10,7 @@ #pragma once #include <Eigen/Dense> +#include <utility> namespace MeshLib { @@ -33,7 +34,8 @@ struct HydroMechanicsProcessData Parameter<double> const& biot_coefficient_, Parameter<double> const& porosity_, Parameter<double> const& solid_density_, - Eigen::Matrix<double, DisplacementDim, 1> const& specific_body_force_) + Eigen::Matrix<double, DisplacementDim, 1> + specific_body_force_) : material{std::move(material_)}, intrinsic_permeability(intrinsic_permeability_), specific_storage(specific_storage_), @@ -42,7 +44,7 @@ struct HydroMechanicsProcessData biot_coefficient(biot_coefficient_), porosity(porosity_), solid_density(solid_density_), - specific_body_force(specific_body_force_) + specific_body_force(std::move(specific_body_force_)) { } diff --git a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h index 920a9780727ba8f09f80d60689c3e0a647b7e535..f86382fe908cc4d5722ea5e3fbc250c59f6ad891 100644 --- a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h +++ b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcessData.h @@ -9,8 +9,9 @@ #pragma once -#include <memory> #include <Eigen/Dense> +#include <memory> +#include <utility> #include "MeshLib/ElementStatus.h" #include "MeshLib/PropertyVector.h" @@ -44,13 +45,14 @@ struct HydroMechanicsProcessData Parameter<double> const& biot_coefficient_, Parameter<double> const& porosity_, Parameter<double> const& solid_density_, - Eigen::Matrix<double, GlobalDim, 1> const& specific_body_force_, - std::unique_ptr<MaterialLib::Fracture::FractureModelBase<GlobalDim>>&& fracture_model, + Eigen::Matrix<double, GlobalDim, 1> + specific_body_force_, + std::unique_ptr<MaterialLib::Fracture::FractureModelBase<GlobalDim>>&& + fracture_model, std::unique_ptr<FractureProperty>&& fracture_prop, Parameter<double> const& initial_effective_stress_, Parameter<double> const& initial_fracture_effective_stress_, - bool const deactivate_matrix_in_flow_ - ) + bool const deactivate_matrix_in_flow_) : material{std::move(material_)}, intrinsic_permeability(intrinsic_permeability_), specific_storage(specific_storage_), @@ -59,7 +61,7 @@ struct HydroMechanicsProcessData biot_coefficient(biot_coefficient_), porosity(porosity_), solid_density(solid_density_), - specific_body_force(specific_body_force_), + specific_body_force(std::move(specific_body_force_)), fracture_model{std::move(fracture_model)}, fracture_property{std::move(fracture_prop)}, initial_effective_stress(initial_effective_stress_), diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h index f30d8385a44de60f6f080676d36109e060eeffc9..98dfcd584c3d8ea86113d6bdadf4601bc083eb3c 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h @@ -9,6 +9,7 @@ #pragma once +#include <utility> #include <vector> #include "BaseLib/Error.h" @@ -31,11 +32,12 @@ class HydroMechanicsLocalAssemblerInterface public NumLib::ExtrapolatableElement { public: - HydroMechanicsLocalAssemblerInterface( - MeshLib::Element const& element, - std::size_t n_local_size, - std::vector<unsigned> const& dofIndex_to_localIndex) - : _element(element), _dofIndex_to_localIndex(dofIndex_to_localIndex) + HydroMechanicsLocalAssemblerInterface(MeshLib::Element const& element, + std::size_t n_local_size, + std::vector<unsigned> + dofIndex_to_localIndex) + : _element(element), + _dofIndex_to_localIndex(std::move(dofIndex_to_localIndex)) { _local_u.resize(n_local_size); _local_udot.resize(n_local_size); diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerInterface.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerInterface.h index b082fa43bded15cf9a55af12a1ecde0dfaf14c0d..c7f6dfd91aa5c0be76f7db875a2b4cd17585a283 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerInterface.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerInterface.h @@ -9,6 +9,7 @@ #pragma once +#include <utility> #include <vector> #include "BaseLib/Error.h" @@ -30,11 +31,9 @@ class SmallDeformationLocalAssemblerInterface { public: SmallDeformationLocalAssemblerInterface() : _dofIndex_to_localIndex{} {} - SmallDeformationLocalAssemblerInterface( - std::size_t n_local_size, - std::vector<unsigned> const& dofIndex_to_localIndex) - : _dofIndex_to_localIndex(dofIndex_to_localIndex) + std::size_t n_local_size, std::vector<unsigned> dofIndex_to_localIndex) + : _dofIndex_to_localIndex(std::move(dofIndex_to_localIndex)) { _local_u.resize(n_local_size); _local_b.resize(_local_u.size()); diff --git a/ProcessLib/Output.h b/ProcessLib/Output.h index 8b655ecdd202cd23ae3f3a10bc5a50c818037c78..2d7e099e46130f5d1413f2c0657a62d152952e81 100644 --- a/ProcessLib/Output.h +++ b/ProcessLib/Output.h @@ -9,6 +9,8 @@ #pragma once +#include <utility> + #include "BaseLib/ConfigTree.h" #include "MeshLib/IO/VtkIO/PVDFile.h" #include "Process.h" @@ -82,9 +84,9 @@ private: MeshLib::IO::PVDFile pvd_file; }; - Output(std::string const& prefix, bool const compress_output, + Output(std::string prefix, bool const compress_output, bool const output_nonlinear_iteration_results) - : _output_file_prefix(prefix), + : _output_file_prefix(std::move(prefix)), _output_file_compression(compress_output), _output_nonlinear_iteration_results( output_nonlinear_iteration_results) diff --git a/ProcessLib/Parameter/ConstantParameter.h b/ProcessLib/Parameter/ConstantParameter.h index d754e75727db8b7f54769a1027c473b90890d943..cfc08b74205914668f296310c92dbf54c006c5a9 100644 --- a/ProcessLib/Parameter/ConstantParameter.h +++ b/ProcessLib/Parameter/ConstantParameter.h @@ -9,6 +9,8 @@ #pragma once +#include <utility> + #include "Parameter.h" namespace ProcessLib @@ -25,11 +27,10 @@ struct ConstantParameter final : public Parameter<T> /// Construction with a tuple. /// The given tuple must be non-empty. - explicit ConstantParameter(std::string const& name_, - std::vector<T> const& values) - : Parameter<T>(name_), _values(values) + explicit ConstantParameter(std::string const& name_, std::vector<T> values) + : Parameter<T>(name_), _values(std::move(values)) { - assert(!values.empty()); + assert(!_values.empty()); } bool isTimeDependent() const override { return false; } diff --git a/ProcessLib/Parameter/CurveScaledParameter.h b/ProcessLib/Parameter/CurveScaledParameter.h index 57d39ced101bf62bf0c9268adf55af274d4d691a..0891d69b16a302e05b4c71ee9f50fd54b3907cd4 100644 --- a/ProcessLib/Parameter/CurveScaledParameter.h +++ b/ProcessLib/Parameter/CurveScaledParameter.h @@ -10,6 +10,7 @@ #pragma once #include <map> +#include <utility> #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" #include "Parameter.h" #include "ProcessLib/Utils/ProcessUtils.h" @@ -20,10 +21,10 @@ template <typename T> struct CurveScaledParameter final : public Parameter<T> { CurveScaledParameter(std::string const& name_, MathLib::PiecewiseLinearInterpolation const& curve, - std::string const& referenced_parameter_name) + std::string referenced_parameter_name) : Parameter<T>(name_), _curve(curve), - _referenced_parameter_name(referenced_parameter_name) + _referenced_parameter_name(std::move(referenced_parameter_name)) { } diff --git a/ProcessLib/Parameter/GroupBasedParameter.h b/ProcessLib/Parameter/GroupBasedParameter.h index aa336588c2d2c6fb8f8687f88e9982b8b8699d09..e31c28ceb1877c95df7ab18332a3422ad7cb2f1f 100644 --- a/ProcessLib/Parameter/GroupBasedParameter.h +++ b/ProcessLib/Parameter/GroupBasedParameter.h @@ -9,6 +9,8 @@ #pragma once +#include <utility> + #include "BaseLib/Error.h" #include "MeshLib/PropertyVector.h" @@ -39,10 +41,11 @@ struct GroupBasedParameter final */ GroupBasedParameter(std::string const& name_, MeshLib::PropertyVector<int> const& property, - std::vector<std::vector<double>> const& vec_values) + std::vector<std::vector<double>> + vec_values) : Parameter<T>(name_), _property_index(property), - _vec_values(vec_values) + _vec_values(std::move(vec_values)) { } diff --git a/ProcessLib/Parameter/Parameter.h b/ProcessLib/Parameter/Parameter.h index b9a818944143444c4325321616dcfca2f1771cba..da183f3e7cd520b22278b4bdf4805d7c5a31b05a 100644 --- a/ProcessLib/Parameter/Parameter.h +++ b/ProcessLib/Parameter/Parameter.h @@ -11,6 +11,7 @@ #include <map> #include <memory> +#include <utility> #include <vector> #include "SpatialPosition.h" @@ -36,8 +37,7 @@ namespace ProcessLib /// Its property name helps addressing the right parameter. struct ParameterBase { - ParameterBase(std::string const& name_) : name(name_) {} - + ParameterBase(std::string name_) : name(std::move(name_)) {} virtual ~ParameterBase() = default; virtual bool isTimeDependent() const = 0; diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h index 19104355f44326e69bc091a9f1e9336f33d4b6e3..8915b94b9d24c81b373f02f3a270edb4634783d6 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPLocalAssembler.h @@ -32,11 +32,11 @@ template <typename NodalRowVectorType, typename GlobalDimNodalMatrixType, struct IntegrationPointData final { explicit IntegrationPointData( - NodalRowVectorType const& N_, GlobalDimNodalMatrixType const& dNdx_, + NodalRowVectorType N_, GlobalDimNodalMatrixType dNdx_, TwoPhaseFlowWithPPMaterialProperties& material_property_, double const& integration_weight_, NodalMatrixType const massOperator_) - : N(N_), - dNdx(dNdx_), + : N(std::move(N_)), + dNdx(std::move(dNdx_)), mat_property(material_property_), integration_weight(integration_weight_), massOperator(massOperator_) diff --git a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp index c2ed90e5a791f7822116615a74ad4eaf2df7e688..369eec2abc51f0987acacd492b435a1d5c34c7b0 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp +++ b/ProcessLib/TwoPhaseFlowWithPP/TwoPhaseFlowWithPPMaterialProperties.cpp @@ -9,6 +9,7 @@ #include "TwoPhaseFlowWithPPMaterialProperties.h" #include <logog/include/logog.hpp> +#include <utility> #include "BaseLib/reorderVector.h" #include "MaterialLib/Fluid/FluidProperty.h" #include "MaterialLib/PorousMedium/Porosity/Porosity.h" @@ -53,7 +54,7 @@ TwoPhaseFlowWithPPMaterialProperties::TwoPhaseFlowWithPPMaterialProperties( _gas_density(std::move(gas_density)), _gas_viscosity(std::move(gas_viscosity)), _material_ids(material_ids), - _intrinsic_permeability_models(intrinsic_permeability_models), + _intrinsic_permeability_models(std::move(intrinsic_permeability_models)), _porosity_models(std::move(porosity_models)), _storage_models(std::move(storage_models)), _capillary_pressure_models(std::move(capillary_pressure_models)), diff --git a/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoMaterialProperties.cpp b/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoMaterialProperties.cpp index 242a565dd7c5977f748cdbfe1d0f7b84248e2d5f..687acf6062d0e6b7ea9f204554bbdf2308b20f67 100644 --- a/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoMaterialProperties.cpp +++ b/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoMaterialProperties.cpp @@ -9,6 +9,7 @@ #include "TwoPhaseFlowWithPrhoMaterialProperties.h" #include <logog/include/logog.hpp> +#include <utility> #include "BaseLib/reorderVector.h" #include "MaterialLib/Fluid/FluidProperty.h" #include "MaterialLib/PorousMedium/Porosity/Porosity.h" @@ -58,7 +59,7 @@ TwoPhaseFlowWithPrhoMaterialProperties::TwoPhaseFlowWithPrhoMaterialProperties( _gas_density(std::move(gas_density)), _gas_viscosity(std::move(gas_viscosity)), _material_ids(material_ids), - _intrinsic_permeability_models(intrinsic_permeability_models), + _intrinsic_permeability_models(std::move(intrinsic_permeability_models)), _porosity_models(std::move(porosity_models)), _storage_models(std::move(storage_models)), _capillary_pressure_models(std::move(capillary_pressure_models)), diff --git a/Tests/GeoLib/AutoCheckGenerators.h b/Tests/GeoLib/AutoCheckGenerators.h index 28c799d09393e72b7cd5476f32e1217e63b9e6e2..99abfb6572efe6fc6c8b62aab9733cc2a175db92 100644 --- a/Tests/GeoLib/AutoCheckGenerators.h +++ b/Tests/GeoLib/AutoCheckGenerators.h @@ -11,6 +11,7 @@ #include <cmath> #include <memory> #include <random> +#include <utility> #include "autocheck/autocheck.hpp" #include "MathLib/Point3d.h" @@ -55,9 +56,8 @@ template <typename Gen = RandomCirclePointGeneratorXY<generator<double>>> struct SymmSegmentGeneratorXY { SymmSegmentGeneratorXY( - Gen s, - std::function<MathLib::Point3d(MathLib::Point3d const&)> f) - : source(s), function(f) + Gen s, std::function<MathLib::Point3d(MathLib::Point3d const&)> f) + : source(std::move(s)), function(std::move(f)) {} using result_type = GeoLib::LineSegment; @@ -82,7 +82,7 @@ struct PairSegmentGeneratorXY { PairSegmentGeneratorXY( Gen s, std::function<GeoLib::LineSegment(GeoLib::LineSegment const&)> f) - : segment_generator(s), function(f) + : segment_generator(std::move(s)), function(std::move(f)) { } diff --git a/Tests/NumLib/TestTimeSteppingIterationNumber.cpp b/Tests/NumLib/TestTimeSteppingIterationNumber.cpp index 08e7a054edeb753b892baf03e5de3c8d8cab0e5a..baf12ca923216bb2022bfc3c8720c6cf22bf1363 100644 --- a/Tests/NumLib/TestTimeSteppingIterationNumber.cpp +++ b/Tests/NumLib/TestTimeSteppingIterationNumber.cpp @@ -11,6 +11,7 @@ #include <gtest/gtest.h> +#include <utility> #include <vector> #include <logog/include/logog.hpp> @@ -100,8 +101,11 @@ TEST(NumLib, TimeSteppingIterationNumberBased2) struct IterationNumberUpdate { - IterationNumberUpdate(const std::vector<std::size_t> &vec, std::size_t& counter) - : _nr_iterations(vec), i(counter) {} + IterationNumberUpdate(std::vector<std::size_t> vec, + std::size_t& counter) + : _nr_iterations(std::move(vec)), i(counter) + { + } std::vector<std::size_t> _nr_iterations; std::size_t& i;