diff --git a/Applications/DataExplorer/DataView/CondFromRasterDialog.h b/Applications/DataExplorer/DataView/CondFromRasterDialog.h index 01c52d0bef8b6e5d7bade92cfc02c75cd9f124e2..ade6924fd1da640fd7b39582a03634aa0ebaa645 100644 --- a/Applications/DataExplorer/DataView/CondFromRasterDialog.h +++ b/Applications/DataExplorer/DataView/CondFromRasterDialog.h @@ -33,7 +33,7 @@ class CondFromRasterDialog : public QDialog, private Ui_CondFromRaster public: CondFromRasterDialog(std::vector<MeshLib::Mesh*> msh_vec, QDialog* parent = nullptr); - ~CondFromRasterDialog(void) override; + ~CondFromRasterDialog() override; private: const std::vector<MeshLib::Mesh*> _msh_vec; diff --git a/Applications/DataExplorer/DataView/DataExplorerSettingsDialog.h b/Applications/DataExplorer/DataView/DataExplorerSettingsDialog.h index 19b47bbb9f073f918082cac8dcc9c3812dcf3ca3..613e5bab35394bef6850f17fc57c4dcb194369f3 100644 --- a/Applications/DataExplorer/DataView/DataExplorerSettingsDialog.h +++ b/Applications/DataExplorer/DataView/DataExplorerSettingsDialog.h @@ -26,7 +26,7 @@ class DataExplorerSettingsDialog : public QDialog, private Ui_DataExplorerSettin public: DataExplorerSettingsDialog(QDialog* parent = nullptr); - ~DataExplorerSettingsDialog(void) override; + ~DataExplorerSettingsDialog() override; private slots: void on_gmshPathButton_clicked(); diff --git a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h index 6a1cbf361c4fedc4476b2b555cd998d0b747d567..35ec29d2c4fff6c33aed2579636eb994bea4e609 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h +++ b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h @@ -44,7 +44,7 @@ public: DetailWindow(std::vector<std::size_t> data, QWidget* parent = nullptr); - ~DetailWindow(void) override; + ~DetailWindow() override; /** * Adds another plot to window. Axes are automatically resized, a random color is used. diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp index ea7d76eb86a103bd505120558921fb037df50f1d..30e968f84727e6e54adfc34d7bd7d6a79b5e7cc6 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp @@ -24,8 +24,8 @@ #include <QTextStream> #include <limits> -DiagramList::DiagramList() : _maxX(0), _maxY(0), _minX(0), _minY(0), _xLabel(""), _yLabel(""), - _xUnit(""), _yUnit(""), _startDate() +DiagramList::DiagramList() + : _xLabel(""), _yLabel(""), _xUnit(""), _yUnit(""), _startDate() { } @@ -192,7 +192,7 @@ int DiagramList::readList(const QString &path, std::vector<DiagramList*> &lists) first_loop = false; } - float const numberOfSecs = + auto const numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); for (int i = 0; i < nLists; i++) { @@ -271,7 +271,7 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis { QDateTime const currentDate( getDateTime(BaseLib::int2date(time_steps[j]))); - float numberOfSecs = + auto numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); lists[i]->addNextPoint(numberOfSecs, (*time_series)[j]); } @@ -292,10 +292,10 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis void DiagramList::truncateToRange(QDateTime const& start, QDateTime const& end) { - float start_secs = static_cast<float>(_startDate.secsTo(start)); + auto start_secs = static_cast<float>(_startDate.secsTo(start)); if (start_secs < 0) start_secs = 0; - float end_secs = static_cast<float>(_startDate.secsTo(end)); + auto end_secs = static_cast<float>(_startDate.secsTo(end)); if (end_secs < start_secs) end_secs = _coords.back().first; diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.h b/Applications/DataExplorer/DataView/DiagramView/DiagramList.h index 71498b5c75d77c295f9bb83fe3d9139255317206..0d670025d21a55169a1141971ad400d0f460504e 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.h @@ -171,10 +171,10 @@ private: /// Updates the bounds of the data points contained in the list. void update(); - float _maxX; - float _maxY; - float _minX; - float _minY; + float _maxX{0}; + float _maxY{0}; + float _minX{0}; + float _minY{0}; std::vector< std::pair<float, float> > _coords; QString _name; QString _xLabel; diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h index f51eeafdf3a13bdc23f2e0eae25302fa30bb73aa..0fe9041baa2ccf5d0b37aa55f05b8a93210578a8 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h @@ -71,7 +71,7 @@ public: DetailWindow* window = nullptr, QDialog* parent = nullptr); - ~DiagramPrefsDialog(void) override; + ~DiagramPrefsDialog() override; private: /** diff --git a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp index c80d8b25664ea2c48aae9b0b126b13c3a44222ca..022effb4bc35eba3199f0fa837aa5a8f4b6f5084 100644 --- a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp +++ b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp @@ -53,8 +53,7 @@ DirectConditionGenerator::directToSurfaceNodes(const MeshLib::Mesh& mesh, { double val(raster->getValueAtPoint(*surface_node)); val = (val == no_data) ? 0 : val; - _direct_values.push_back( - std::make_pair(surface_node->getID(), val)); + _direct_values.emplace_back(surface_node->getID(), val); } delete raster; diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.cpp b/Applications/DataExplorer/DataView/ElementTreeModel.cpp index 310644e40cd1b66afdb03dcc14fd72435863c261..f889f5aef7d866022d19c2cc18790dbfa0d59015 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeModel.cpp @@ -28,8 +28,7 @@ /** * Constructor. */ -ElementTreeModel::ElementTreeModel( QObject* parent ) - : TreeModel(parent), _mesh_source(nullptr) +ElementTreeModel::ElementTreeModel(QObject* parent) : TreeModel(parent) { QList<QVariant> rootData; delete _rootItem; diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.h b/Applications/DataExplorer/DataView/ElementTreeModel.h index 799be62dea14895ed7fb6c29bc473a368d5c83a1..3acf2ef00294cf38783dc2d25655e6c95ffa7827 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.h +++ b/Applications/DataExplorer/DataView/ElementTreeModel.h @@ -48,6 +48,5 @@ public slots: void setMesh(MeshLib::Mesh const& mesh); private: - vtkUnstructuredGridAlgorithm const* _mesh_source; - + vtkUnstructuredGridAlgorithm const* _mesh_source{nullptr}; }; diff --git a/Applications/DataExplorer/DataView/FemConditionModel.h b/Applications/DataExplorer/DataView/FemConditionModel.h index c212ecb175f19656cc6d9ef2b42e21e7f99abf60..d6b21c0ac67efe853554671023f64c911aef29fa 100644 --- a/Applications/DataExplorer/DataView/FemConditionModel.h +++ b/Applications/DataExplorer/DataView/FemConditionModel.h @@ -24,7 +24,11 @@ class FemConditionModel : public TreeModel public: FemConditionModel(QObject* parent = nullptr); - int columnCount(const QModelIndex& /*parent*/ = QModelIndex()) const { return 2; } + int columnCount( + const QModelIndex& /*parent*/ = QModelIndex()) const override + { + return 2; + } public slots: /// Clears the tree. diff --git a/Applications/DataExplorer/DataView/GMSHPrefsDialog.h b/Applications/DataExplorer/DataView/GMSHPrefsDialog.h index e51799bf42c51b54d9269d79d4bb266bdf58a52c..79ea7a486422cf41973bbc7995b2d4ad6fbdf802 100644 --- a/Applications/DataExplorer/DataView/GMSHPrefsDialog.h +++ b/Applications/DataExplorer/DataView/GMSHPrefsDialog.h @@ -33,7 +33,7 @@ class GMSHPrefsDialog : public QDialog, private Ui_GMSHPrefs public: GMSHPrefsDialog(GeoLib::GEOObjects const& geoObjects, QDialog* parent = nullptr); - ~GMSHPrefsDialog(void) override; + ~GMSHPrefsDialog() override; private: std::vector<std::string> getSelectedObjects(QStringList list); diff --git a/Applications/DataExplorer/DataView/GeoOnMeshMappingDialog.h b/Applications/DataExplorer/DataView/GeoOnMeshMappingDialog.h index b3550e0aa976894f1df2631b3528d7f33fe54e87..18775962dd4c9b6c0c70b96b3ec1da5df73d0299 100644 --- a/Applications/DataExplorer/DataView/GeoOnMeshMappingDialog.h +++ b/Applications/DataExplorer/DataView/GeoOnMeshMappingDialog.h @@ -34,7 +34,7 @@ public: GeoOnMeshMappingDialog( std::vector<std::unique_ptr<MeshLib::Mesh>> const& mesh_vec, QDialog* parent = nullptr); - ~GeoOnMeshMappingDialog(void) override; + ~GeoOnMeshMappingDialog() override; std::string const& getNewGeoName() const { return _new_geo_name; }; int getDataSetChoice() const; diff --git a/Applications/DataExplorer/DataView/LineEditDialog.h b/Applications/DataExplorer/DataView/LineEditDialog.h index cfff4ed027368a92915acda0dc1f5e4f18ce6064..cc6df5993a9141ef22aca8ea7735c8214ae2eda7 100644 --- a/Applications/DataExplorer/DataView/LineEditDialog.h +++ b/Applications/DataExplorer/DataView/LineEditDialog.h @@ -33,7 +33,7 @@ class LineEditDialog : public QDialog, private Ui_LineEdit public: LineEditDialog(const GeoLib::PolylineVec& ply_vec, QDialog* parent = nullptr); - ~LineEditDialog(void) override; + ~LineEditDialog() override; private: std::vector<std::size_t> getSelectedIndeces(QStringList list); diff --git a/Applications/DataExplorer/DataView/LinearEditDialog.h b/Applications/DataExplorer/DataView/LinearEditDialog.h index a0adf57f660c5e99350dc3bdcea800f78af682f9..b74e144f882bf42a0c6909efb104fea51a9249fe 100644 --- a/Applications/DataExplorer/DataView/LinearEditDialog.h +++ b/Applications/DataExplorer/DataView/LinearEditDialog.h @@ -31,7 +31,7 @@ public: const std::vector<std::size_t>& dis_nodes, const std::vector<double>& dis_values, QDialog* parent = nullptr); - ~LinearEditDialog(void) override; + ~LinearEditDialog() override; private: void setupDialog(const std::vector<std::size_t> &dis_nodes, const std::vector<double> &dis_values); diff --git a/Applications/DataExplorer/DataView/MergeGeometriesDialog.h b/Applications/DataExplorer/DataView/MergeGeometriesDialog.h index 2f11122dd0f987bb0fa2d614e07e4f5366eb5dd6..af81dd9b3a9e3230fc42af911e36fdfc26f7e4ee 100644 --- a/Applications/DataExplorer/DataView/MergeGeometriesDialog.h +++ b/Applications/DataExplorer/DataView/MergeGeometriesDialog.h @@ -34,7 +34,7 @@ class MergeGeometriesDialog : public QDialog, private Ui_MergeGeometries public: MergeGeometriesDialog(GeoLib::GEOObjects& geoObjects, QDialog* parent = nullptr); - ~MergeGeometriesDialog(void) override; + ~MergeGeometriesDialog() override; /// Returns a vector of selected geometries std::vector<std::string> const getSelectedGeometries() const; diff --git a/Applications/DataExplorer/DataView/MeshAnalysisDialog.h b/Applications/DataExplorer/DataView/MeshAnalysisDialog.h index eab67465004abcb5246c8796635295e0132295c8..0da4a578ba4b4f5a0fea93efa813556235a356b5 100644 --- a/Applications/DataExplorer/DataView/MeshAnalysisDialog.h +++ b/Applications/DataExplorer/DataView/MeshAnalysisDialog.h @@ -36,7 +36,7 @@ public: MeshAnalysisDialog( std::vector<std::unique_ptr<MeshLib::Mesh>> const& mesh_vec, QDialog* parent = nullptr); - ~MeshAnalysisDialog(void) override; + ~MeshAnalysisDialog() override; private: /// Prepares the output for the node message window diff --git a/Applications/DataExplorer/DataView/MeshElementRemovalDialog.h b/Applications/DataExplorer/DataView/MeshElementRemovalDialog.h index e2af34cbb75f0247e5f5a6acb41ae9ac631839f0..93b51d2248f249569b2c658133895ca336774c81 100644 --- a/Applications/DataExplorer/DataView/MeshElementRemovalDialog.h +++ b/Applications/DataExplorer/DataView/MeshElementRemovalDialog.h @@ -41,7 +41,7 @@ class MeshElementRemovalDialog : public QDialog, private Ui_MeshElementRemoval public: MeshElementRemovalDialog(DataHolderLib::Project const& project, QDialog* parent = nullptr); - ~MeshElementRemovalDialog(void) override; + ~MeshElementRemovalDialog() override; private slots: void on_boundingBoxCheckBox_toggled(bool is_checked); diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp index e53d6ba105057a80c46ce69a9dac383a9fafc260..ab62a314cb1b1cbcfe46f3c8d1581101917660dd 100644 --- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp +++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp @@ -155,7 +155,7 @@ void MeshLayerEditDialog::createMeshToolSelection() _ogsMeshButton = new QRadioButton("Prisms", meshToolSelectionBox); QRadioButton* tetgenMeshButton = new QRadioButton("Tetrahedra", meshToolSelectionBox); tetgenMeshButton->setFixedWidth(150); - QLabel* minThicknessLabel = new QLabel(meshToolSelectionBox); + auto* minThicknessLabel = new QLabel(meshToolSelectionBox); minThicknessLabel->setText("Minimum thickness of layers:"); _minThicknessEdit = new QLineEdit(meshToolSelectionBox); _minThicknessEdit->setText("1.0"); diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.h b/Applications/DataExplorer/DataView/MeshLayerEditDialog.h index 51f2daf6985bdaddc56ada01ba82290ca346285d..2d9511200046800370d6a50753e24108a12a99d9 100644 --- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.h +++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.h @@ -41,7 +41,7 @@ class MeshLayerEditDialog : public QDialog, private Ui_MeshLayerEdit public: MeshLayerEditDialog(const MeshLib::Mesh* mesh, QDialog* parent = nullptr); - ~MeshLayerEditDialog(void) override; + ~MeshLayerEditDialog() override; private: void createMeshToolSelection(); diff --git a/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.cpp b/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.cpp index fd26e4c72b1236881db02a89b5a6dbda4f6705ec..c565de0b372dbd1e68c6a91561a82286b202d64b 100644 --- a/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.cpp +++ b/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.cpp @@ -21,7 +21,7 @@ /// Constructor MeshQualitySelectionDialog::MeshQualitySelectionDialog(QDialog* parent) -: QDialog(parent), _metric (MeshLib::MeshQualityType::EDGERATIO), _histogram_path("") + : QDialog(parent), _histogram_path("") { setupUi(this); this->choiceEdges->toggle(); diff --git a/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.h b/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.h index 29569b35db356348d58eab84f98eb7d926b6bc22..76f2c77408d939a464e6af8330420533894dc30c 100644 --- a/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.h +++ b/Applications/DataExplorer/DataView/MeshQualitySelectionDialog.h @@ -30,7 +30,7 @@ class MeshQualitySelectionDialog : public QDialog, private Ui_MeshQualitySelecti public: MeshQualitySelectionDialog(QDialog* parent = nullptr); - ~MeshQualitySelectionDialog(void) override; + ~MeshQualitySelectionDialog() override; /// Returns selected metric MeshLib::MeshQualityType getSelectedMetric() const { return _metric; } @@ -42,7 +42,7 @@ public: std::string getHistogramPath() const { return _histogram_path; } private: - MeshLib::MeshQualityType _metric; + MeshLib::MeshQualityType _metric{MeshLib::MeshQualityType::EDGERATIO}; std::string _histogram_path; private slots: diff --git a/Applications/DataExplorer/DataView/MeshValueEditDialog.h b/Applications/DataExplorer/DataView/MeshValueEditDialog.h index 66f1289f2c466b9289e6ec00cfdec81fbdce065e..c38791d73eac99e3ef0cd16832d8a778ac438b9e 100644 --- a/Applications/DataExplorer/DataView/MeshValueEditDialog.h +++ b/Applications/DataExplorer/DataView/MeshValueEditDialog.h @@ -33,7 +33,7 @@ public: /// Constructor for creating a new FEM condition. MeshValueEditDialog(MeshLib::Mesh* mesh, QDialog* parent = nullptr); - ~MeshValueEditDialog(void) override; + ~MeshValueEditDialog() override; private: MeshLib::Mesh* _mesh; diff --git a/Applications/DataExplorer/DataView/ProcessModel.cpp b/Applications/DataExplorer/DataView/ProcessModel.cpp index 300c45ab6848474608dd56cd831353b5e4ad2d2f..95c92e4a2e737bef499990123f122b9b0ff11527 100644 --- a/Applications/DataExplorer/DataView/ProcessModel.cpp +++ b/Applications/DataExplorer/DataView/ProcessModel.cpp @@ -52,7 +52,7 @@ void ProcessModel::addConditionItem(DataHolderLib::FemCondition* cond, item_data << QString::fromStdString(cond->getParamName()) << QString::fromStdString(cond->getConditionClassStr()); - CondItem* cond_item = new CondItem(item_data, parent, cond); + auto* cond_item = new CondItem(item_data, parent, cond); parent->appendChild(cond_item); } @@ -85,8 +85,7 @@ ProcessVarItem* ProcessModel::addProcessVar(QString const& name) beginResetModel(); QList<QVariant> process_var_data; process_var_data << QVariant(name) << ""; - ProcessVarItem* process_var = - new ProcessVarItem(process_var_data, _rootItem); + auto* process_var = new ProcessVarItem(process_var_data, _rootItem); _rootItem->appendChild(process_var); endResetModel(); return process_var; @@ -97,8 +96,7 @@ ProcessVarItem* ProcessModel::getProcessVarItem(QString const& name) const int const n_children(_rootItem->childCount()); for (int i = 0; i < n_children; ++i) { - ProcessVarItem* item( - dynamic_cast<ProcessVarItem*>(_rootItem->child(i))); + auto* item(dynamic_cast<ProcessVarItem*>(_rootItem->child(i))); if (item != nullptr && item->getName() == name) return item; } @@ -159,8 +157,7 @@ void ProcessModel::clearModel() int const n_process_vars = _rootItem->childCount(); for (int i = n_process_vars; i >= 0; --i) { - ProcessVarItem* pv_item = - dynamic_cast<ProcessVarItem*>(_rootItem->child(i)); + auto* pv_item = dynamic_cast<ProcessVarItem*>(_rootItem->child(i)); removeProcessVariable(pv_item->getName()); } } diff --git a/Applications/DataExplorer/DataView/ProcessModel.h b/Applications/DataExplorer/DataView/ProcessModel.h index fdd7d7945edd0c7cc75fe4952ac5349421426a40..91dab7fc915476c22759beed169be16a02aeedb6 100644 --- a/Applications/DataExplorer/DataView/ProcessModel.h +++ b/Applications/DataExplorer/DataView/ProcessModel.h @@ -39,7 +39,7 @@ class ProcessModel final : public TreeModel public: ProcessModel(DataHolderLib::Project& project, QObject* parent = nullptr); - int columnCount(const QModelIndex& parent = QModelIndex()) const; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; /// Returns the vtk source object for the specified subtree of a process /// with the given name. diff --git a/Applications/DataExplorer/DataView/ProcessView.h b/Applications/DataExplorer/DataView/ProcessView.h index 7a109df14c83db03a5ecb267830c2b8f840ca1f5..b47f947ddda40b08a845e655bae8adc25a091171 100644 --- a/Applications/DataExplorer/DataView/ProcessView.h +++ b/Applications/DataExplorer/DataView/ProcessView.h @@ -40,12 +40,12 @@ public: protected slots: /// Instructions if the selection of items in the view has changed. void selectionChanged(const QItemSelection& selected, - const QItemSelection& deselected); + const QItemSelection& deselected) override; private: /// Actions to be taken after a right mouse click is performed in the /// station view. - void contextMenuEvent(QContextMenuEvent* e); + void contextMenuEvent(QContextMenuEvent* e) override; bool isProcessVarItem(const QModelIndex& idx) const; bool isConditionItem(const QModelIndex& idx) const; diff --git a/Applications/DataExplorer/DataView/StratView/StratBar.cpp b/Applications/DataExplorer/DataView/StratView/StratBar.cpp index ca6efa26ff801eda1b709510f1627af8c57cf4aa..1ec9e964bc84f7592e573257aa9be2ff7d838aa2 100644 --- a/Applications/DataExplorer/DataView/StratView/StratBar.cpp +++ b/Applications/DataExplorer/DataView/StratView/StratBar.cpp @@ -24,14 +24,6 @@ StratBar::StratBar(GeoLib::StationBorehole* station, _stratColors = *stratColors; } -StratBar::~StratBar() -{ -// std::map<std::string, GeoLib::Color*>::iterator it; -// for (it = _stratColors.begin(); it != _stratColors.end(); it++) { -// delete it->second; -// } -} - QRectF StratBar::boundingRect() const { return QRectF(0, 0, BARWIDTH + 10, totalLogHeight()); diff --git a/Applications/DataExplorer/DataView/StratView/StratBar.h b/Applications/DataExplorer/DataView/StratView/StratBar.h index d0d8749d30ae8581937decf3b1712cd8411282fc..7155142d9475efdb9c8871087615b6a7387d1bfc 100644 --- a/Applications/DataExplorer/DataView/StratView/StratBar.h +++ b/Applications/DataExplorer/DataView/StratView/StratBar.h @@ -38,7 +38,7 @@ public: StratBar(GeoLib::StationBorehole* station, std::map<std::string, DataHolderLib::Color>* stratColors = nullptr, QGraphicsItem* parent = nullptr); - ~StratBar() override; + ~StratBar() override = default; /// Returns the bounding rectangle of the bar. QRectF boundingRect() const override; diff --git a/Applications/DataExplorer/DataView/StratView/StratView.h b/Applications/DataExplorer/DataView/StratView/StratView.h index 44990610df3188e0d5975b4b325a873f18cf7d2b..0fc64a60436d5d9901b9e6d8d51af77287bcc82b 100644 --- a/Applications/DataExplorer/DataView/StratView/StratView.h +++ b/Applications/DataExplorer/DataView/StratView/StratView.h @@ -34,7 +34,7 @@ public: /** * Creates an empty view. */ - StratView(QWidget* parent = nullptr) : _scene(nullptr) { Q_UNUSED(parent); } + StratView(QWidget* parent = nullptr) { Q_UNUSED(parent); } ~StratView() override; /// Sets the Borehole whose data should be visualised. @@ -72,5 +72,5 @@ private: /// Updates the view automatically when a Borehole is added or when the window containing the view changes its state. void update(); - StratScene* _scene; + StratScene* _scene{nullptr}; }; diff --git a/Applications/DataExplorer/DataView/StratView/StratWindow.h b/Applications/DataExplorer/DataView/StratView/StratWindow.h index 92de0d186a29fe7ceac3f2e72f3d114f03f034ea..3e44de0bd8520c0f6e52dc874964581af20940b8 100644 --- a/Applications/DataExplorer/DataView/StratView/StratWindow.h +++ b/Applications/DataExplorer/DataView/StratView/StratWindow.h @@ -40,7 +40,7 @@ public: GeoLib::StationBorehole* station, std::map<std::string, DataHolderLib::Color>* stratColors = nullptr, QWidget* parent = nullptr); - ~StratWindow(void) override { this->destroy(); } + ~StratWindow() override { this->destroy(); } private: /// Automatically resize window based on the measurements of the borehole. diff --git a/Applications/DataExplorer/DataView/SurfaceExtractionDialog.cpp b/Applications/DataExplorer/DataView/SurfaceExtractionDialog.cpp index fdd158681a9d9b275bd9711e7dd1eca0f276c3e5..18930bb76c6ee444a28c76648ab8edf0f0b5b650 100644 --- a/Applications/DataExplorer/DataView/SurfaceExtractionDialog.cpp +++ b/Applications/DataExplorer/DataView/SurfaceExtractionDialog.cpp @@ -16,9 +16,8 @@ #include <QDoubleValidator> - SurfaceExtractionDialog::SurfaceExtractionDialog(QDialog* parent) - : QDialog(parent), _tolerance(90), _dir(0,0,-1) + : QDialog(parent) { setupUi(this); this->xNormalEdit->setValidator(new QDoubleValidator(-1, 1, 3, xNormalEdit)); diff --git a/Applications/DataExplorer/DataView/SurfaceExtractionDialog.h b/Applications/DataExplorer/DataView/SurfaceExtractionDialog.h index 2e4ee01e4f5d217170e9a2897423cda832c28787..936ed97f4e4fb60eb69cbc2bd50a6efb113d3258 100644 --- a/Applications/DataExplorer/DataView/SurfaceExtractionDialog.h +++ b/Applications/DataExplorer/DataView/SurfaceExtractionDialog.h @@ -45,6 +45,6 @@ private slots: void reject() override { this->done(QDialog::Rejected); }; private: - int _tolerance; - MathLib::Vector3 _dir; + int _tolerance{90}; + MathLib::Vector3 _dir{0, 0, -1}; }; diff --git a/Applications/DataExplorer/NetCdfDialog/NetCdfConfigureDialog.h b/Applications/DataExplorer/NetCdfDialog/NetCdfConfigureDialog.h index fd93ee60f586e9285c511c0b4e2956cde92df211..eb23e363acdad4b2a823cc88c33dee7e4bbae0a7 100644 --- a/Applications/DataExplorer/NetCdfDialog/NetCdfConfigureDialog.h +++ b/Applications/DataExplorer/NetCdfDialog/NetCdfConfigureDialog.h @@ -35,7 +35,7 @@ class NetCdfConfigureDialog : public QDialog, private Ui_NetCdfConfigure public: NetCdfConfigureDialog(const std::string& fileName, QDialog* parent = nullptr); - ~NetCdfConfigureDialog(void) override; + ~NetCdfConfigureDialog() override; MeshLib::Mesh* getMesh() { return _currentMesh; }; std::string getName(); VtkGeoImageSource* getRaster() { return _currentRaster; }; diff --git a/Applications/DataExplorer/VtkVis/MeshFromRasterDialog.h b/Applications/DataExplorer/VtkVis/MeshFromRasterDialog.h index e54429201312ef498c046e1ab64a7189747657a0..0ea29d3eb33234b75bc945e0a3e2bd74d3bd59d6 100644 --- a/Applications/DataExplorer/VtkVis/MeshFromRasterDialog.h +++ b/Applications/DataExplorer/VtkVis/MeshFromRasterDialog.h @@ -35,7 +35,7 @@ class MeshFromRasterDialog : public QDialog, private Ui_MeshFromRaster public: /// Constructor MeshFromRasterDialog(QDialog* parent = nullptr); - ~MeshFromRasterDialog(void) override; + ~MeshFromRasterDialog() override; std::string getMeshName() const { return _mesh_name; } std::string getArrayName() const { return _array_name; } diff --git a/Applications/DataExplorer/VtkVis/VisualizationWidget.cpp b/Applications/DataExplorer/VtkVis/VisualizationWidget.cpp index 6e4bf917c727dee9424ab8022eefcfb4cfc3f381..229ba5444343299e7343ec446ccb4f3fc6d27a8b 100644 --- a/Applications/DataExplorer/VtkVis/VisualizationWidget.cpp +++ b/Applications/DataExplorer/VtkVis/VisualizationWidget.cpp @@ -44,9 +44,8 @@ #include <QSettings> #include <QString> -VisualizationWidget::VisualizationWidget( QWidget* parent /*= 0*/ ) -: QWidget(parent), _vtkRender(nullptr), _markerWidget(nullptr), - _interactorStyle(nullptr), _vtkPickCallback(nullptr) +VisualizationWidget::VisualizationWidget(QWidget* parent /*= 0*/) + : QWidget(parent) { this->setupUi(this); diff --git a/Applications/DataExplorer/VtkVis/VisualizationWidget.h b/Applications/DataExplorer/VtkVis/VisualizationWidget.h index 14fdb520c1a1fe9d7512df8a01ea1117c27a662d..c0155df259271fbab53e3c1a0886ea4e07c7e2fd 100644 --- a/Applications/DataExplorer/VtkVis/VisualizationWidget.h +++ b/Applications/DataExplorer/VtkVis/VisualizationWidget.h @@ -103,9 +103,9 @@ protected slots: void on_screenshotPushButton_pressed(); private: - vtkRenderer* _vtkRender; - vtkOrientationMarkerWidget* _markerWidget; - VtkCustomInteractorStyle* _interactorStyle; - VtkPickCallback* _vtkPickCallback; + vtkRenderer* _vtkRender{nullptr}; + vtkOrientationMarkerWidget* _markerWidget{nullptr}; + VtkCustomInteractorStyle* _interactorStyle{nullptr}; + VtkPickCallback* _vtkPickCallback{nullptr}; bool _isShowAllOnLoad; }; diff --git a/Applications/DataExplorer/VtkVis/VtkBGImageSource.cpp b/Applications/DataExplorer/VtkVis/VtkBGImageSource.cpp index 8de27e3ab02d04b75af36a61aae98099fad2fea5..fecc58058a0e9dc05755a75dcaed6157dd31a846 100644 --- a/Applications/DataExplorer/VtkVis/VtkBGImageSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkBGImageSource.cpp @@ -30,10 +30,7 @@ vtkStandardNewMacro(VtkBGImageSource); -VtkBGImageSource::VtkBGImageSource() : _origin(0,0), _cellsize(1) -{ -} - +VtkBGImageSource::VtkBGImageSource() = default; VtkBGImageSource::~VtkBGImageSource() = default; void VtkBGImageSource::SetRaster(vtkImageAlgorithm *img, double x0, double y0, double scalingFactor) diff --git a/Applications/DataExplorer/VtkVis/VtkBGImageSource.h b/Applications/DataExplorer/VtkVis/VtkBGImageSource.h index 59a0d0fc35234f497eabc17975d773fc942606dc..e7e1d7bb6ee204c52421921df384c909de2bab41 100644 --- a/Applications/DataExplorer/VtkVis/VtkBGImageSource.h +++ b/Applications/DataExplorer/VtkVis/VtkBGImageSource.h @@ -43,7 +43,6 @@ protected: ~VtkBGImageSource() override; private: - - std::pair<double, double> _origin; - double _cellsize; + std::pair<double, double> _origin{0, 0}; + double _cellsize{1}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp index dd944aa78b59b3bd33191d1e3f4e321cf9b227d6..0d55a23a3d9e82b4e8d69a68177827d9081149fc 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp @@ -33,7 +33,7 @@ vtkStandardNewMacro(VtkColorByHeightFilter); VtkColorByHeightFilter::VtkColorByHeightFilter() -: ColorLookupTable(VtkColorLookupTable::New()), _tableRangeScaling(1.0) + : ColorLookupTable(VtkColorLookupTable::New()) { } diff --git a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.h b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.h index c7e56a8456408d7895bb7e961b10c739227c9b55..d317d00a95fe917addf3fadd7c3f1b1be955c860 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.h @@ -80,5 +80,5 @@ protected: VtkColorLookupTable* ColorLookupTable; double _tableRange[2]; - double _tableRangeScaling; + double _tableRangeScaling{1.0}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp index 2ee0f48f979860e6e31e98c29bcd71a9e57a6be1..d5ea3117ac0ed0a28707de7a390547e78b9967b7 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp @@ -25,15 +25,11 @@ vtkStandardNewMacro(VtkColorLookupTable); -VtkColorLookupTable::VtkColorLookupTable() -: _type(DataHolderLib::LUTType::LINEAR) -{ -} +VtkColorLookupTable::VtkColorLookupTable() = default; VtkColorLookupTable::~VtkColorLookupTable() { - for (std::map<double, unsigned char*>::const_iterator it = _dict.begin(); it != _dict.end(); - ++it) + for (auto it = _dict.begin(); it != _dict.end(); ++it) delete it->second; } diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h index e434e98c1d90ab28d940858e3877c718857fb5be..c68a3feab9eb4c261e92f294273c58fa1727dfaf 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h @@ -92,5 +92,5 @@ private: unsigned char expInterpolation(unsigned char a, unsigned char b, double gamma, double p) const; std::map<double, unsigned char*> _dict; - DataHolderLib::LUTType _type; + DataHolderLib::LUTType _type{DataHolderLib::LUTType::LINEAR}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkCompositeImageToPointCloudFilter.h b/Applications/DataExplorer/VtkVis/VtkCompositeImageToPointCloudFilter.h index da2016615e9e751999f7265b2c6f2288d75e1625..e9ffec6ed5f9b4e67b3f80bd9942aa9fadf55a77 100644 --- a/Applications/DataExplorer/VtkVis/VtkCompositeImageToPointCloudFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkCompositeImageToPointCloudFilter.h @@ -17,7 +17,7 @@ class VtkCompositeImageToPointCloudFilter : public VtkCompositeFilter { public: VtkCompositeImageToPointCloudFilter(vtkAlgorithm* inputAlgorithm); - ~VtkCompositeImageToPointCloudFilter() = default; + ~VtkCompositeImageToPointCloudFilter() override = default; void init() override; diff --git a/Applications/DataExplorer/VtkVis/VtkCompositeImageToSurfacePointsFilter.h b/Applications/DataExplorer/VtkVis/VtkCompositeImageToSurfacePointsFilter.h index 7aa486d0b359053a119d5d2ed025eded5e944c03..f53faf66a40a14535b3827008878277697182d40 100644 --- a/Applications/DataExplorer/VtkVis/VtkCompositeImageToSurfacePointsFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkCompositeImageToSurfacePointsFilter.h @@ -17,7 +17,7 @@ class VtkCompositeImageToSurfacePointsFilter : public VtkCompositeFilter { public: VtkCompositeImageToSurfacePointsFilter(vtkAlgorithm* inputAlgorithm); - ~VtkCompositeImageToSurfacePointsFilter() = default; + ~VtkCompositeImageToSurfacePointsFilter() override = default; void init() override; diff --git a/Applications/DataExplorer/VtkVis/VtkConsoleOutputWindow.h b/Applications/DataExplorer/VtkVis/VtkConsoleOutputWindow.h index 8bd3ddb9458da8d3d388de16df0dd397993b871b..b6db5d80a8352197084272da1e75d560036493b4 100644 --- a/Applications/DataExplorer/VtkVis/VtkConsoleOutputWindow.h +++ b/Applications/DataExplorer/VtkVis/VtkConsoleOutputWindow.h @@ -26,12 +26,10 @@ public: static VtkConsoleOutputWindow * New(); void DisplayText(const char*) override; + VtkConsoleOutputWindow(const VtkConsoleOutputWindow&) = delete; + void operator=(const VtkConsoleOutputWindow&) = delete; + protected: VtkConsoleOutputWindow(); ~VtkConsoleOutputWindow() override; - -private: - VtkConsoleOutputWindow(const VtkConsoleOutputWindow&) = - delete; // Not implemented. - void operator=(const VtkConsoleOutputWindow&) = delete; // Not implemented. }; diff --git a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp index f3cdc31eb8f1ab6e4dd72aab6c8f20f008380430..395f04cf498e74d43be99245e6481da5930f209d 100644 --- a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp +++ b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.cpp @@ -44,7 +44,6 @@ vtkStandardNewMacro(VtkCustomInteractorStyle); VtkCustomInteractorStyle::VtkCustomInteractorStyle() -: _data(nullptr), _highlightActor(false), _alternateMouseActions(false) { _selectedMapper = vtkDataSetMapper::New(); _selectedActor = vtkActor::New(); diff --git a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.h b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.h index 5eac9e85a7e62e98c587cfe895f95cc8c8b73d31..3dc24e3776fb58baba14628ee45d09b8978a0ffd 100644 --- a/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.h +++ b/Applications/DataExplorer/VtkVis/VtkCustomInteractorStyle.h @@ -71,7 +71,7 @@ protected: ~VtkCustomInteractorStyle() override; /// @brief The vtk object to pick. - vtkDataObject* _data; + vtkDataObject* _data{nullptr}; /// @brief The mapper for highlighting the selected cell. vtkDataSetMapper* _selectedMapper; @@ -80,8 +80,8 @@ protected: vtkActor* _selectedActor; private: - bool _highlightActor; - bool _alternateMouseActions; + bool _highlightActor{false}; + bool _alternateMouseActions{false}; signals: /// @brief Emitted when something was picked. diff --git a/Applications/DataExplorer/VtkVis/VtkGeoImageSource.cpp b/Applications/DataExplorer/VtkVis/VtkGeoImageSource.cpp index f93917ba7540d43dc48aa8f5924f79035bb6dc73..cc547b461e686042b8eb19b6c67c15a6c9da8bc0 100644 --- a/Applications/DataExplorer/VtkVis/VtkGeoImageSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkGeoImageSource.cpp @@ -55,10 +55,7 @@ void vtkSimpleImageFilterExampleExecute(vtkImageData* input, outPtr[i] = inPtr[i]; } -VtkGeoImageSource::VtkGeoImageSource() - : _imageSource(nullptr), _x0(0), _y0(0), _z0(0), _spacing(1) -{ -} +VtkGeoImageSource::VtkGeoImageSource() = default; VtkGeoImageSource::~VtkGeoImageSource() { diff --git a/Applications/DataExplorer/VtkVis/VtkGeoImageSource.h b/Applications/DataExplorer/VtkVis/VtkGeoImageSource.h index 06ea8d2be7eae2b9d1eb529066b7c0974246681c..bc686e3f091476560572f4228f3c311d319dd34d 100644 --- a/Applications/DataExplorer/VtkVis/VtkGeoImageSource.h +++ b/Applications/DataExplorer/VtkVis/VtkGeoImageSource.h @@ -38,6 +38,9 @@ public: /// @brief Prints information about itself. void PrintSelf(ostream& os, vtkIndent indent) override; + VtkGeoImageSource(const VtkGeoImageSource&) = delete; + void operator=(const VtkGeoImageSource&) = delete; + /// @brief Returns the ImageData object. vtkImageData* getImageData(); @@ -69,10 +72,7 @@ protected: void SimpleExecute(vtkImageData* input, vtkImageData* output) override; private: - VtkGeoImageSource(const VtkGeoImageSource&) = delete; // Not implemented. - void operator=(const VtkGeoImageSource&) = delete; // Not implemented - - vtkImageAlgorithm* _imageSource; + vtkImageAlgorithm* _imageSource{nullptr}; - double _x0, _y0, _z0, _spacing; + double _x0{0}, _y0{0}, _z0{0}, _spacing{1}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp index aad88a016debd4aefd87fa6114b2c332cee80d2c..9b505443802d9ba0c1e6e117ab304958076cba28 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp @@ -26,9 +26,8 @@ #include <vtkSmartPointer.h> vtkStandardNewMacro(VtkImageDataToLinePolyDataFilter); +VtkImageDataToLinePolyDataFilter::VtkImageDataToLinePolyDataFilter() -VtkImageDataToLinePolyDataFilter::VtkImageDataToLinePolyDataFilter() : - ImageSpacing(0.0) { this->SetLengthScaleFactor(1.0); } diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.h b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.h index 0bed16f401666283a8e45b5d950c20a37e33db40..9f0117190fcd562fa7810d7167b7c04c5a6cfd6c 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.h @@ -48,6 +48,10 @@ public: /// @brief Returns the space between two pixels. vtkGetMacro(ImageSpacing,double); + VtkImageDataToLinePolyDataFilter(const VtkImageDataToLinePolyDataFilter&) = + delete; + void operator=(const VtkImageDataToLinePolyDataFilter&) = delete; + protected: /// @brief Constructor. VtkImageDataToLinePolyDataFilter(); @@ -63,11 +67,5 @@ protected: vtkInformationVector* outputVector) override; /// @brief The spacing of the image - double ImageSpacing; - -private: - VtkImageDataToLinePolyDataFilter(const VtkImageDataToLinePolyDataFilter&) = - delete; // Not implemented. - void operator=(const VtkImageDataToLinePolyDataFilter&) = - delete; // Not implemented + double ImageSpacing{0.0}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.cpp b/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.cpp index a4c7847e263b6ce7bfde7276c64b409eb9fd4602..e437b30ea49eac7c74e145d7094a09621c6c46ce 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.cpp @@ -26,16 +26,7 @@ vtkStandardNewMacro(VtkImageDataToPointCloudFilter); -VtkImageDataToPointCloudFilter::VtkImageDataToPointCloudFilter() - : Gamma(1.0), - PointScaleFactor(1.0), - MinHeight(0), - MaxHeight(1000), - MinNumberOfPointsPerCell(1), - MaxNumberOfPointsPerCell(20), - IsLinear(true) -{ -} +VtkImageDataToPointCloudFilter::VtkImageDataToPointCloudFilter() = default; void VtkImageDataToPointCloudFilter::PrintSelf(ostream& os, vtkIndent indent) { diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.h b/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.h index 6e397d2cd3e867956294f27a8f6fcb7407b29f3b..c948474b04b7b59858e0bb1c68b8a41b9671453c 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToPointCloudFilter.h @@ -61,7 +61,7 @@ public: protected: VtkImageDataToPointCloudFilter(); - ~VtkImageDataToPointCloudFilter() = default; + ~VtkImageDataToPointCloudFilter() override = default; /// Sets input port to vtkImageData. int FillInputPortInformation(int port, vtkInformation* info) override; @@ -70,14 +70,13 @@ protected: int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) override; - double Gamma; - double PointScaleFactor; - double MinHeight; - double MaxHeight; - vtkIdType MinNumberOfPointsPerCell; - vtkIdType MaxNumberOfPointsPerCell; - bool IsLinear; - + double Gamma{1.0}; + double PointScaleFactor{1.0}; + double MinHeight{0}; + double MaxHeight{1000}; + vtkIdType MinNumberOfPointsPerCell{1}; + vtkIdType MaxNumberOfPointsPerCell{20}; + bool IsLinear{true}; private: /// Creates the point objects based on the parameters set by the user diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp index 727b8f9334fac0d2da267a8ceeab2ae4cb9ca90c..77d5bd233f37d4ead300b66e91d22fc95032c3a1 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.cpp @@ -26,10 +26,8 @@ vtkStandardNewMacro(VtkImageDataToSurfacePointsFilter); -VtkImageDataToSurfacePointsFilter::VtkImageDataToSurfacePointsFilter() - : PointsPerPixel(20) -{ -} +VtkImageDataToSurfacePointsFilter::VtkImageDataToSurfacePointsFilter() = + default; void VtkImageDataToSurfacePointsFilter::PrintSelf(ostream& os, vtkIndent indent) { @@ -68,7 +66,7 @@ int VtkImageDataToSurfacePointsFilter::RequestData( "RGB colours detected. Using only first channel for computation."); } - std::size_t const n_points = static_cast<std::size_t>(input->GetNumberOfPoints()); + auto const n_points = static_cast<std::size_t>(input->GetNumberOfPoints()); if (n_points == 0) { vtkDebugMacro("No data found!"); @@ -141,7 +139,7 @@ void VtkImageDataToSurfacePointsFilter::createPointSurface( MathLib::Point3d const& max_pnt, GeoLib::Raster const& raster) { - std::size_t const n_points(static_cast<std::size_t>(this->GetPointsPerPixel())); + auto const n_points(static_cast<std::size_t>(this->GetPointsPerPixel())); for (std::size_t i = 0; i < n_points; ++i) { double p[3]; diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.h b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.h index e0a7220dfa11ef942558ef72213b988caa13104d..33a7348fd3fbdfbfd44e710c6c1749e44fc96a6b 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToSurfacePointsFilter.h @@ -36,7 +36,7 @@ public: protected: VtkImageDataToSurfacePointsFilter(); - ~VtkImageDataToSurfacePointsFilter() = default; + ~VtkImageDataToSurfacePointsFilter() override = default; /// Sets input port to vtkImageData. int FillInputPortInformation(int port, vtkInformation* info) override; @@ -57,5 +57,5 @@ private: /// Returns a random number in [min, max] double getRandomNumber(double const& min, double const& max) const; - vtkIdType PointsPerPixel; + vtkIdType PointsPerPixel{20}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkPointsSource.cpp b/Applications/DataExplorer/VtkVis/VtkPointsSource.cpp index f031865ac45a6a306d624426b3514e99ddcaae98..bdec78b3a6207c376bb550e81592c07d35370a28 100644 --- a/Applications/DataExplorer/VtkVis/VtkPointsSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkPointsSource.cpp @@ -32,7 +32,7 @@ vtkStandardNewMacro(VtkPointsSource); -VtkPointsSource::VtkPointsSource() : _points(nullptr) +VtkPointsSource::VtkPointsSource() { _removable = false; // From VtkAlgorithmProperties this->SetNumberOfInputPorts(0); diff --git a/Applications/DataExplorer/VtkVis/VtkPointsSource.h b/Applications/DataExplorer/VtkVis/VtkPointsSource.h index 1f79546b2ec0bb4dfe15456b26a179d73c9a379c..967854ea71ac77cf74cb7e3347d2568ec971015d 100644 --- a/Applications/DataExplorer/VtkVis/VtkPointsSource.h +++ b/Applications/DataExplorer/VtkVis/VtkPointsSource.h @@ -55,7 +55,7 @@ protected: vtkInformationVector* outputVector) override; /// The points to visualize - const std::vector<GeoLib::Point*>* _points; + const std::vector<GeoLib::Point*>* _points{nullptr}; private: }; diff --git a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp index 4406bea61a23d7933cca370863b3129c07dacdd1..39e31b83a9990662d3cdd4e68635359300d9b216 100644 --- a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp @@ -36,7 +36,7 @@ vtkStandardNewMacro(VtkPolylinesSource); -VtkPolylinesSource::VtkPolylinesSource() : _polylines(nullptr) +VtkPolylinesSource::VtkPolylinesSource() { _removable = false; // From VtkAlgorithmProperties this->SetNumberOfInputPorts(0); diff --git a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.h b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.h index 16f09b32ae7cb0f83b7b68c851936fd2949da2a9..e1ac0d54f90600f09393e6efe025792d18e3366f 100644 --- a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.h +++ b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.h @@ -58,7 +58,7 @@ protected: vtkInformationVector* outputVector) override; /// The polylines to visualize. - const std::vector<GeoLib::Polyline*>* _polylines; + const std::vector<GeoLib::Polyline*>* _polylines{nullptr}; private: }; diff --git a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp index 86c55ff4196083ae22576a92d8664f4702e72335..d7a2279203907ef0b4fec1f451027624d57529b4 100644 --- a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp @@ -35,7 +35,7 @@ vtkStandardNewMacro(VtkStationSource); -VtkStationSource::VtkStationSource() : _stations(nullptr) +VtkStationSource::VtkStationSource() { _removable = false; // From VtkAlgorithmProperties this->SetNumberOfInputPorts(0); diff --git a/Applications/DataExplorer/VtkVis/VtkStationSource.h b/Applications/DataExplorer/VtkVis/VtkStationSource.h index 29abfb101afead102d421fd1a54bb87f373fed8f..403a3f24fd86eceaa2d47ae67278c129124ff91e 100644 --- a/Applications/DataExplorer/VtkVis/VtkStationSource.h +++ b/Applications/DataExplorer/VtkVis/VtkStationSource.h @@ -65,7 +65,7 @@ protected: vtkInformationVector* outputVector) override; /// The stations to visualize - const std::vector<GeoLib::Point*>* _stations; + const std::vector<GeoLib::Point*>* _stations{nullptr}; /// The colour table for stratigraphic data. This table is either set using the setColorLookupTable() method or is generated /// automatically with random colours while creating the VtkStationSource-object. diff --git a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp index d846835ea82f8dd3829fb1ec1aea93a5f96f7138..2d460ad80fc5cd15d78228d81ce1e0392fc514a2 100644 --- a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp @@ -32,7 +32,7 @@ vtkStandardNewMacro(VtkSurfacesSource); -VtkSurfacesSource::VtkSurfacesSource() : _surfaces(nullptr) +VtkSurfacesSource::VtkSurfacesSource() { _removable = false; // From VtkAlgorithmProperties this->SetNumberOfInputPorts(0); diff --git a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.h b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.h index 728bf6a01b02a18e9991596af1acc4a858330db0..59c27ff2d7b007391644f55ccbd627c243195580 100644 --- a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.h +++ b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.h @@ -59,7 +59,7 @@ protected: vtkInformationVector* outputVector) override; /// The surfaces to visualize - const std::vector<GeoLib::Surface*>* _surfaces; + const std::vector<GeoLib::Surface*>* _surfaces{nullptr}; private: }; diff --git a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp index c0c21428317fe1ebb58c0e0461c70e10451338a4..4f7b0f91edde3b77d682c39e033e8e66e719cc4e 100644 --- a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp @@ -35,10 +35,7 @@ vtkStandardNewMacro(VtkTextureOnSurfaceFilter); -VtkTextureOnSurfaceFilter::VtkTextureOnSurfaceFilter() : _origin(.0f,.0f), _scalingFactor(.0f) -{ -} - +VtkTextureOnSurfaceFilter::VtkTextureOnSurfaceFilter() = default; VtkTextureOnSurfaceFilter::~VtkTextureOnSurfaceFilter() = default; void VtkTextureOnSurfaceFilter::PrintSelf( ostream& os, vtkIndent indent ) diff --git a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.h b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.h index 40cd5d5d6a89086cd3a3a56d6ef568989bb75868..8a80dfd50f277d0250caae86e61dd444386c086b 100644 --- a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.h +++ b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.h @@ -61,6 +61,6 @@ protected: vtkInformationVector* outputVector) override; private: - std::pair<float, float> _origin; - double _scalingFactor; + std::pair<float, float> _origin{0, 0}; + double _scalingFactor{0.}; }; diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp b/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp index 760f5ab042ef10eb3783a23897aa79cd0f2efce7..47c30c7e9dd4da6648eaf274b56351bc448d580b 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp @@ -80,7 +80,7 @@ void VtkVisPipelineView::contextMenuEvent( QContextMenuEvent* event ) int objectType = item->algorithm()->GetOutputDataObject(0)->GetDataObjectType(); VtkAlgorithmProperties* vtkProps = item->getVtkProperties(); bool isSourceItem = - (this->selectionModel()->currentIndex().parent().isValid()) ? 0 : 1; + !(this->selectionModel()->currentIndex().parent().isValid()); QMenu menu; QAction* addFilterAction = menu.addAction("Add filter..."); diff --git a/Applications/DataExplorer/VtkVis/VtkVisTabWidget.cpp b/Applications/DataExplorer/VtkVis/VtkVisTabWidget.cpp index 79866e20e74644b1e39feea0aca5e75c44cab95a..ea045e85212625c266b1dcca7dad2f662e23a635 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisTabWidget.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisTabWidget.cpp @@ -30,8 +30,7 @@ #include <vtkTransform.h> #include <vtkTransformFilter.h> -VtkVisTabWidget::VtkVisTabWidget( QWidget* parent /*= 0*/ ) - : QWidget(parent), _item(nullptr) +VtkVisTabWidget::VtkVisTabWidget(QWidget* parent /*= 0*/) : QWidget(parent) { setupUi(this); diff --git a/Applications/DataExplorer/VtkVis/VtkVisTabWidget.h b/Applications/DataExplorer/VtkVis/VtkVisTabWidget.h index 12c52d118ea2e2285db6674d156533edbf41e2ad..1ccd0ac61b09b05fb5a6918188628c9974bac97f 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisTabWidget.h +++ b/Applications/DataExplorer/VtkVis/VtkVisTabWidget.h @@ -69,7 +69,7 @@ private: void translateItem(); - VtkVisPipelineItem* _item; + VtkVisPipelineItem* _item{nullptr}; signals: /// Is emitted when a property was changed. diff --git a/Applications/DataHolderLib/ColorLookupTable.cpp b/Applications/DataHolderLib/ColorLookupTable.cpp index 53539425d12ca3c8cada6b93232704e1258986e7..bd1da866bda643b37ef7ddc891117d4ece4b1eaa 100644 --- a/Applications/DataHolderLib/ColorLookupTable.cpp +++ b/Applications/DataHolderLib/ColorLookupTable.cpp @@ -14,8 +14,7 @@ namespace DataHolderLib { ColorLookupTable::ColorLookupTable() - : _type(DataHolderLib::LUTType::LINEAR), - _range( + : _range( std::make_pair<double, double>(std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max())) diff --git a/Applications/DataHolderLib/ColorLookupTable.h b/Applications/DataHolderLib/ColorLookupTable.h index 317e54b258becc57174df2fc0a3d1fc09ef7ac81..d9864cca10e600a2170430ae647b9d093dee61f9 100644 --- a/Applications/DataHolderLib/ColorLookupTable.h +++ b/Applications/DataHolderLib/ColorLookupTable.h @@ -61,7 +61,7 @@ public: private: std::vector< std::tuple<double, Color, std::string> > _lut; - LUTType _type; + LUTType _type{DataHolderLib::LUTType::LINEAR}; std::pair<double, double> _range; }; diff --git a/Applications/FileIO/CsvInterface.cpp b/Applications/FileIO/CsvInterface.cpp index de5f8eaace6662654a11bbe76cbf0cea003bfb75..b508181b095acd3e388d0007d19e4ab6160083c1 100644 --- a/Applications/FileIO/CsvInterface.cpp +++ b/Applications/FileIO/CsvInterface.cpp @@ -20,12 +20,7 @@ #include "GeoLib/Point.h" namespace FileIO { - -CsvInterface::CsvInterface() -: _writeCsvHeader(true) -{ -} - +CsvInterface::CsvInterface() = default; int CsvInterface::readPoints(std::string const& fname, char delim, std::vector<GeoLib::Point*> &points) diff --git a/Applications/FileIO/CsvInterface.h b/Applications/FileIO/CsvInterface.h index 0206d0c99ab83d36ecb74fbc5a2bb1cb5922d1c0..b2e0bdd62417290c640a4a95ba2ffd7136030aeb 100644 --- a/Applications/FileIO/CsvInterface.h +++ b/Applications/FileIO/CsvInterface.h @@ -233,7 +233,7 @@ private: */ void writeValue(std::size_t vec_idx, std::size_t in_vec_idx); - bool _writeCsvHeader; + bool _writeCsvHeader{true}; std::vector<std::string> _vec_names; std::vector< boost::any > _data; }; diff --git a/Applications/FileIO/GocadIO/GocadSGridReader.cpp b/Applications/FileIO/GocadIO/GocadSGridReader.cpp index cb2bb9a03a217057aef7de61c46fd949d6671d4a..5f8b7dd1384785c82bc07948d60fa63c2fef3300 100644 --- a/Applications/FileIO/GocadIO/GocadSGridReader.cpp +++ b/Applications/FileIO/GocadIO/GocadSGridReader.cpp @@ -308,7 +308,7 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) ++it; face_set_property._property_name += *it; ++it; - std::size_t const n_of_face_set_ids( + auto const n_of_face_set_ids( static_cast<std::size_t>(std::atoi(it->c_str()))); std::size_t face_set_id_cnt(0); @@ -323,10 +323,9 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) for (auto tok_it = tokens.begin(); tok_it != tokens.end();) { - std::size_t const id( - static_cast<std::size_t>(std::atoi(tok_it->c_str()))); + auto const id(static_cast<std::size_t>(std::atoi(tok_it->c_str()))); tok_it++; - std::size_t const face_indicator( + auto const face_indicator( static_cast<std::size_t>(std::atoi(tok_it->c_str()))); tok_it++; @@ -382,7 +381,7 @@ void GocadSGridReader::parseFaceSet(std::string& line, std::istream& in) Bitset readBits(std::ifstream& in, const std::size_t bits) { using block_t = Bitset::block_type; - std::size_t const bytes = static_cast<std::size_t>(std::ceil(bits / 8.)); + auto const bytes = static_cast<std::size_t>(std::ceil(bits / 8.)); std::size_t const blocks = bytes + 1 < sizeof(block_t) ? 1 : (bytes + 1) / sizeof(block_t); diff --git a/Applications/FileIO/TetGenInterface.cpp b/Applications/FileIO/TetGenInterface.cpp index 49ad36708674b41bf1be8018c38fc99054754b58..ca06f246b779aa0e03bc01a77abb73e2c12e6df0 100644 --- a/Applications/FileIO/TetGenInterface.cpp +++ b/Applications/FileIO/TetGenInterface.cpp @@ -33,10 +33,7 @@ namespace FileIO { -TetGenInterface::TetGenInterface() : - _zero_based_idx (false), _boundary_markers (false) -{ -} +TetGenInterface::TetGenInterface() = default; bool TetGenInterface::readTetGenGeometry (std::string const& geo_fname, GeoLib::GEOObjects &geo_objects) diff --git a/Applications/FileIO/TetGenInterface.h b/Applications/FileIO/TetGenInterface.h index c02358ac359c8cd239e7a0dea08d50d257cc2321..f9e57540f44b1602d8bf6e1735d8a6930b1f2e14 100644 --- a/Applications/FileIO/TetGenInterface.h +++ b/Applications/FileIO/TetGenInterface.h @@ -209,9 +209,9 @@ private: std::string const& matId) const; /// the value is true if the indexing is zero based, else false - bool _zero_based_idx; + bool _zero_based_idx{false}; /// true if boundary markers are set, false otherwise - bool _boundary_markers; + bool _boundary_markers{false}; }; } // namespace FileIO diff --git a/Applications/Utils/FileConverter/MeshToRaster.cpp b/Applications/Utils/FileConverter/MeshToRaster.cpp index cf97d4a781043956feaa4dde61d011cdd9af41aa..b7bbe01d0d01abe657733f054fa808a177093fe7 100644 --- a/Applications/Utils/FileConverter/MeshToRaster.cpp +++ b/Applications/Utils/FileConverter/MeshToRaster.cpp @@ -69,7 +69,7 @@ static MeshLib::Element const* getProjectedElement( static double getElevation(MeshLib::Element const& element, MeshLib::Node const& node) { - MathLib::Vector3 const v = node - *element.getNode(0); + MathLib::Vector3 const v{*element.getNode(0), node}; MathLib::Vector3 const n = MeshLib::FaceRule::getSurfaceNormal(&element).getNormalizedVector(); return node[2] - scalarProduct(n, v) * n[2]; diff --git a/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp b/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp index d80629f48c6624b0ca114627ab02a62056fef0af..7c91cf99d56d3bd4bde33a4aebd144f5ffbdf1ba 100644 --- a/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp +++ b/Applications/Utils/MeshGeoTools/ComputeSurfaceNodeIDsInPolygonalRegion.cpp @@ -139,7 +139,7 @@ int main (int argc, char* argv[]) polygon_name = "Polygon-" + std::to_string(j); } // create Polygon from Polyline - GeoLib::Polygon const& polygon(*(plys[j])); + GeoLib::Polygon const& polygon{*plys[j]}; // ids of mesh nodes on surface that are within the given polygon std::vector<std::pair<std::size_t, double>> ids_and_areas; for (std::size_t k(0); k<all_sfc_nodes.size(); k++) { diff --git a/Applications/Utils/OGSFileConverter/FileListDialog.h b/Applications/Utils/OGSFileConverter/FileListDialog.h index 57b80b12adc1cfcc3d182ec181530fa449d4ee30..6cba6c274e00e66a02c8f7304235ad42540684ef 100644 --- a/Applications/Utils/OGSFileConverter/FileListDialog.h +++ b/Applications/Utils/OGSFileConverter/FileListDialog.h @@ -37,7 +37,7 @@ public: /// Constructor FileListDialog(FileType input, FileType output, QWidget* parent = nullptr); /// Destructor - ~FileListDialog(void) override; + ~FileListDialog() override; /// Returns list of all selected files const QStringList getInputFileList() const { return _allFiles.stringList(); }; diff --git a/Applications/Utils/OGSFileConverter/OGSFileConverter.h b/Applications/Utils/OGSFileConverter/OGSFileConverter.h index 47c1c607c835216c76eda2a63d8798c3b7279fed..54c1b883d2eed9c3aea9bb4a23d9f5d8df3c80df 100644 --- a/Applications/Utils/OGSFileConverter/OGSFileConverter.h +++ b/Applications/Utils/OGSFileConverter/OGSFileConverter.h @@ -28,7 +28,7 @@ public: /// Constructor OGSFileConverter(QWidget* parent = nullptr); /// Destructor - ~OGSFileConverter(void) override; + ~OGSFileConverter() override; private: /// Checks if a given file already exists diff --git a/BaseLib/ConfigTree.cpp b/BaseLib/ConfigTree.cpp index 1cf8551998fc760bb65e83a691885653e2d7bb14..ea5f7ee38b0910b6fde1b0c76e1c716f006effde 100644 --- a/BaseLib/ConfigTree.cpp +++ b/BaseLib/ConfigTree.cpp @@ -18,7 +18,7 @@ // Explicitly instantiate the boost::property_tree::ptree which is a typedef to // the following basic_ptree. template class boost::property_tree::basic_ptree<std::string, std::string, - std::less<std::string>>; + std::less<>>; //! Collects swallowed error messages raised by the check during destruction of //! ConfigTree instances. diff --git a/BaseLib/ConfigTree.h b/BaseLib/ConfigTree.h index b56d15010d2e3d0a76628ad936f5d7f492356425..97b5aa726214d407ed2b8a6b6737e7d0aa4e9462 100644 --- a/BaseLib/ConfigTree.h +++ b/BaseLib/ConfigTree.h @@ -20,8 +20,7 @@ #include <boost/property_tree/ptree.hpp> extern template class boost::property_tree::basic_ptree< - std::string, std::string, std::less<std::string>>; - + std::string, std::string, std::less<>>; namespace BaseLib { diff --git a/BaseLib/Error.h b/BaseLib/Error.h index e563d4b90179f97151170c03a09f0bc24278f0d0..f464b25cbc1c5f85271fd86d5b3c351c3f66307d 100644 --- a/BaseLib/Error.h +++ b/BaseLib/Error.h @@ -56,9 +56,9 @@ template <typename Msg> #define OGS_STR(x) #x #define OGS_STRINGIFY(x) OGS_STR(x) -#define OGS_LOCATION \ - " at " + BaseLib::extractBaseName(__FILE__) + \ - ", line " OGS_STRINGIFY(__LINE__) +#define OGS_LOCATION \ + (" at " + BaseLib::extractBaseName(__FILE__) + \ + ", line " OGS_STRINGIFY(__LINE__)) #define OGS_FATAL(fmt, ...) \ BaseLib::detail::error_impl(BaseLib::format(fmt, ##__VA_ARGS__) + \ diff --git a/BaseLib/Histogram.h b/BaseLib/Histogram.h index 4a6159f1495101518e86a8b6e3705d9549185a9a..9a7bdea1704246dcde186294f1a48a66234423cf 100644 --- a/BaseLib/Histogram.h +++ b/BaseLib/Histogram.h @@ -61,8 +61,8 @@ public: * \param computeHistogram Compute histogram if set. If not set user must call * \c update() before accessing data. */ - Histogram(std::vector<T> data, const unsigned int nr_bins = 16, - const bool computeHistogram = true) + explicit Histogram(std::vector<T> data, const unsigned int nr_bins = 16, + const bool computeHistogram = true) : _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 da6a6d42634dcd7a99b9df4bdccc67fd35fd2289..5d0433a787b5326c60a5653e1cce7779aefd7039 100644 --- a/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp +++ b/BaseLib/IO/XmlIO/Qt/XMLQtInterface.cpp @@ -31,8 +31,8 @@ namespace BaseLib { namespace IO { -XMLQtInterface::XMLQtInterface(const QString &schemaFile) - : _schemaFile(schemaFile) +XMLQtInterface::XMLQtInterface(QString schemaFile) + : _schemaFile(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 cd0908bc53d48b7b5f14c759883e6c50cc866432..4426d8cc6c570edd798e42c02421fdeb4c49cc14 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 QString &schemaFile = ""); + XMLQtInterface(QString 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/BaseLib/TimeInterval.cpp b/BaseLib/TimeInterval.cpp index 161f0585053bdfe76599c09a41fe2825e3bbba7c..0c97d8fbe64479e24fe50ab433782b73bf462068 100644 --- a/BaseLib/TimeInterval.cpp +++ b/BaseLib/TimeInterval.cpp @@ -23,11 +23,11 @@ std::unique_ptr<TimeInterval> createTimeInterval( //! \ogs_file_param{prj__time_loop__processes__process__time_interval} auto const& time_interval_config = config.getConfigSubtree("time_interval"); - const double start_time = + const auto start_time = //! \ogs_file_param{prj__time_loop__processes__process__time_interval__start} time_interval_config.getConfigParameter<double>("start"); - const double end_time = + const auto end_time = //! \ogs_file_param{prj__time_loop__processes__process__time_interval__end} time_interval_config.getConfigParameter<double>("end"); diff --git a/GeoLib/AnalyticalGeometry.h b/GeoLib/AnalyticalGeometry.h index b66cd04835a96eec12f6918f07ae3c6acfdb86bb..b28f06f0765b4c56e21ea9f92222eea5b075c202 100644 --- a/GeoLib/AnalyticalGeometry.h +++ b/GeoLib/AnalyticalGeometry.h @@ -21,15 +21,8 @@ #include "Polygon.h" -namespace MathLib -{ - class PointVec; -} - namespace GeoLib { -class Polyline; -class LineSegment; enum Orientation { diff --git a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h index b02b118cc2e6e7ebf818d9fdaf64c2dd37c98ddc..775e51ec8fbfefac6bf1e3b9fa2e12a8d65a600a 100644 --- a/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h +++ b/GeoLib/IO/XmlIO/Boost/BoostXmlGmlInterface.h @@ -35,7 +35,7 @@ namespace IO class BoostXmlGmlInterface : public BaseLib::IO::XMLInterface { public: - BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs); + explicit BoostXmlGmlInterface(GeoLib::GEOObjects& geo_objs); ~BoostXmlGmlInterface() override = default; /// Reads an xml-file containing OGS geometry diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp index 2fef80291b74f8e5177ca64a001df7b0c77d5297..efb893fb60eacb46811298493c2f99d024df316f 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp @@ -364,13 +364,13 @@ bool XmlGmlInterface::write() else { ERR("XmlGmlInterface::write(): Point vector is empty, abort writing geometry."); - return 0; + return false; } } else { ERR("XmlGmlInterface::write(): No point vector found, abort writing geometry."); - return 0; + return false; } // POLYLINES diff --git a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp index 6f73cb03ae39b9a2a959742d1c37ceb629d0685a..22d2facf479691398f5e5b096af38eb10a2ee788 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp @@ -200,7 +200,7 @@ bool XmlStnInterface::write() if (this->_exportName.empty()) { ERR("XmlStnInterface::write(): No station list specified."); - return 0; + return false; } _out << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; // xml definition diff --git a/GeoLib/MinimalBoundingSphere.cpp b/GeoLib/MinimalBoundingSphere.cpp index 8f0ebc47611ec3871cefc263e91647aa554184cf..c0da60b6e16e910696507f267d48d7b99532a926 100644 --- a/GeoLib/MinimalBoundingSphere.cpp +++ b/GeoLib/MinimalBoundingSphere.cpp @@ -21,11 +21,7 @@ #include "MathLib/Vector3.h" namespace GeoLib { - -MinimalBoundingSphere::MinimalBoundingSphere() -: _radius(-1), _center(std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), std::numeric_limits<double>::max()) -{ -} +MinimalBoundingSphere::MinimalBoundingSphere() = default; MinimalBoundingSphere::MinimalBoundingSphere( MathLib::Point3d const& p, double radius) diff --git a/GeoLib/MinimalBoundingSphere.h b/GeoLib/MinimalBoundingSphere.h index adb9b6e5836d4a97ca4a0b24e4d65660e489dc77..b50ab8e0e632aaed36fed05b7f15d99b10151a4c 100644 --- a/GeoLib/MinimalBoundingSphere.h +++ b/GeoLib/MinimalBoundingSphere.h @@ -30,7 +30,9 @@ class MinimalBoundingSphere { public: /// Point-Sphere - MinimalBoundingSphere(MathLib::Point3d const& p, double radius = std::numeric_limits<double>::epsilon()); + explicit MinimalBoundingSphere( + MathLib::Point3d const& p, + double radius = std::numeric_limits<double>::epsilon()); /// Bounding sphere using two points MinimalBoundingSphere(MathLib::Point3d const& p, MathLib::Point3d const& q); /// Bounding sphere using three points @@ -42,7 +44,8 @@ public: MathLib::Point3d const& r, MathLib::Point3d const& s); /// Bounding sphere of n points - MinimalBoundingSphere(std::vector<MathLib::Point3d*> const& points); + explicit MinimalBoundingSphere( + std::vector<MathLib::Point3d*> const& points); /// Returns the center point of the sphere MathLib::Point3d getCenter() const { return MathLib::Point3d(_center); } @@ -80,8 +83,10 @@ private: std::size_t length, std::size_t n_boundary_points); - double _radius; - MathLib::Vector3 _center; + double _radius{-1}; + MathLib::Vector3 _center{std::numeric_limits<double>::max(), + std::numeric_limits<double>::max(), + std::numeric_limits<double>::max()}; }; } // namespace GeoLib diff --git a/GeoLib/Point.h b/GeoLib/Point.h index f8af4d5f3ad221b5ece622a37fd16c5a1fa93e95..4e0160ac77f7a8aade02761db68de99779973a14 100644 --- a/GeoLib/Point.h +++ b/GeoLib/Point.h @@ -46,9 +46,9 @@ public: MathLib::Point3dWithID(x, id), GeoLib::GeoObject() {} - Point(std::array<double,3> const& x, - std::size_t id = std::numeric_limits<std::size_t>::max()) : - MathLib::Point3dWithID(x, id), GeoLib::GeoObject() + explicit Point(std::array<double, 3> const& x, + std::size_t id = std::numeric_limits<std::size_t>::max()) + : MathLib::Point3dWithID(x, id), GeoLib::GeoObject() {} /// return a geometry type diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp index f9c326c24d42d5321678aef1a39b2cc8faee1a80..6405e80ed834e57e9788820b09cb2632ce748c3c 100644 --- a/GeoLib/Polygon.cpp +++ b/GeoLib/Polygon.cpp @@ -537,7 +537,7 @@ GeoLib::Polygon* createPolygonFromCircle (GeoLib::Point const& middle_pnt, doubl } // create polygon - GeoLib::Polygon* polygon (new GeoLib::Polygon (pnts, false)); + GeoLib::Polygon* polygon(new GeoLib::Polygon{Polyline{pnts}, false}); for (std::size_t k(0); k < resolution; k++) { polygon->addPoint(k + off_set); diff --git a/GeoLib/Polygon.h b/GeoLib/Polygon.h index 9729480fb8d48073845c283b466b6833ff73eba4..930ec7b900863786b04c26d196928946f9615259 100644 --- a/GeoLib/Polygon.h +++ b/GeoLib/Polygon.h @@ -49,7 +49,7 @@ public: * @param ply closed Polyline * @param init if true, check if polyline is closed, calculate bounding box */ - Polygon(const Polyline &ply, bool init = true); + explicit Polygon(const Polyline& ply, bool init = true); Polygon(Polygon const& other); Polygon& operator=(Polygon const& rhs) = delete; diff --git a/GeoLib/Polyline.h b/GeoLib/Polyline.h index a37a258a61506c535098a0902733d0b110d05679..8373e14fc0c2170c41ffd72c1098552e7a83f15b 100644 --- a/GeoLib/Polyline.h +++ b/GeoLib/Polyline.h @@ -93,7 +93,7 @@ public: /** constructor * \param pnt_vec a reference to the point vector */ - Polyline(const std::vector<Point*>& pnt_vec); + explicit Polyline(const std::vector<Point*>& pnt_vec); /** * Copy constructor * @param ply Polyline diff --git a/GeoLib/SensorData.h b/GeoLib/SensorData.h index 4c4bec67999b89fe56cdbf6910351934c38e156f..0ca95fa8c0bb2906c9c1fbcbc70421750afb863f 100644 --- a/GeoLib/SensorData.h +++ b/GeoLib/SensorData.h @@ -62,10 +62,10 @@ class SensorData { public: /// Constructor using file name (automatically reads the file and fills all data structures) - SensorData(const std::string &file_name); + explicit SensorData(const std::string& file_name); /// Constructor using a time step vector valid for all time series that will be added later - SensorData(std::vector<std::size_t> time_steps); + explicit SensorData(std::vector<std::size_t> time_steps); /// Constructor using time step bounds for all time series that will be added later SensorData(std::size_t first_timestep, std::size_t last_timestep, std::size_t step_size); diff --git a/GeoLib/Station.cpp b/GeoLib/Station.cpp index ecd98fd41b894a0b81d07c8fb40bd7ee83ed094a..b43f4bf7eea3894c9cbf542ca641fefb95caf466 100644 --- a/GeoLib/Station.cpp +++ b/GeoLib/Station.cpp @@ -24,24 +24,19 @@ namespace GeoLib { 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) + : Point(x, y, z), _name(std::move(name)) + {} Station::Station(Point* coords, std::string name) - : Point(*coords), - _name(std::move(name)), - _type(Station::StationType::STATION), - _station_value(0.0), - _sensor_data(nullptr) + : Point(*coords), _name(std::move(name)) {} -Station::Station(Station const& src) : - Point(src), _name(src._name), _type(src._type), - _station_value(src._station_value), _sensor_data(nullptr) +Station::Station(Station const& src) + : Point(src), + _name(src._name), + _type(src._type), + _station_value(src._station_value) {} Station::~Station() diff --git a/GeoLib/Station.h b/GeoLib/Station.h index 1f50b59723ebf1d33e03145ed47d0f6b4ac5dfa0..4157d4d4cc33264f120a5bff8b9c78cae740d115 100644 --- a/GeoLib/Station.h +++ b/GeoLib/Station.h @@ -52,12 +52,12 @@ public: * \param z The z-coordinate of the station. * \param name The name of the station. */ - Station(double x = 0.0, - double y = 0.0, - double z = 0.0, - std::string name = ""); + explicit Station(double x = 0.0, + double y = 0.0, + double z = 0.0, + std::string name = ""); - Station(Point* coords, std::string name = ""); + explicit Station(Point* coords, std::string name = ""); /** * Constructor copies the source object @@ -95,12 +95,11 @@ public: protected: std::string _name; - StationType _type; // GeoSys Station Type + StationType _type{Station::StationType::STATION}; // GeoSys Station Type private: - double _station_value; - SensorData* _sensor_data; - + double _station_value{0.0}; + SensorData* _sensor_data{nullptr}; }; bool isStation(GeoLib::Point const* pnt); diff --git a/GeoLib/StationBorehole.cpp b/GeoLib/StationBorehole.cpp index ceb00bb4d93b36efd1df093fcea19d587ccb0ee1..bd6d00162fca9a54b45bf443f84b410ddef82b94 100644 --- a/GeoLib/StationBorehole.cpp +++ b/GeoLib/StationBorehole.cpp @@ -30,8 +30,11 @@ namespace GeoLib // The Borehole class // //////////////////////// -StationBorehole::StationBorehole(double x, double y, double z, const std::string &name) : - Station (x, y, z, name), _depth(0), _date(0) +StationBorehole::StationBorehole(double x, + double y, + double z, + const std::string& name) + : Station(x, y, z, name) { _type = Station::StationType::BOREHOLE; @@ -40,7 +43,7 @@ StationBorehole::StationBorehole(double x, double y, double z, const std::string _soilName.emplace_back(""); } -StationBorehole::~StationBorehole(void) +StationBorehole::~StationBorehole() { // deletes profile vector of borehole, starting at layer 1 // the first point is NOT deleted as it points to the station object itself diff --git a/GeoLib/StationBorehole.h b/GeoLib/StationBorehole.h index e8861b01f6cfd7aabc5a7ee27f4c23590bbcbc18..9297cef2a756672e407771a1139ff636d08adb84 100644 --- a/GeoLib/StationBorehole.h +++ b/GeoLib/StationBorehole.h @@ -32,8 +32,11 @@ class StationBorehole : public Station { public: /** constructor initialises the borehole with the given coordinates */ - StationBorehole(double x = 0.0, double y = 0.0, double z = 0.0, const std::string &name = ""); - ~StationBorehole(void) override; + explicit StationBorehole(double x = 0.0, + double y = 0.0, + double z = 0.0, + const std::string& name = ""); + ~StationBorehole() override; /// Creates a StationBorehole-object from a string (assuming the string has the right format) static StationBorehole* createStation(const std::string &line); @@ -105,8 +108,8 @@ private: //long profile_type; //std::vector<long> _soilType; - double _depth; // depth of the borehole - int _date; // date when the borehole has been drilled + double _depth{0}; // depth of the borehole + int _date{0}; // date when the borehole has been drilled /// Contains the names for all the soil layers std::vector<std::string> _soilName; diff --git a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp index b603f09f306ac638161e1234b3f5a058aec41600..7cec562ac27ae53c996679c77de0107c7979dae5 100644 --- a/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp +++ b/MaterialLib/Fluid/Density/CreateFluidDensityModel.cpp @@ -78,14 +78,14 @@ static std::unique_ptr<FluidProperty> createLinearConcentrationDependentDensity( //! \ogs_file_param{material__fluid__density__type} config.checkConfigParameter("type", "ConcentrationDependent"); - const double reference_density = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_density} + const auto reference_density = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_density} config.getConfigParameter<double>("reference_density"); - const double reference_concentration = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_concentration} + const auto reference_concentration = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__reference_concentration} config.getConfigParameter<double>("reference_concentration"); - const double fluid_density_difference_ratio = - //! \ogs_file_param{material__fluid__density__ConcentrationDependent__fluid_density_difference_ratio} + const auto fluid_density_difference_ratio = + //! \ogs_file_param{material__fluid__density__ConcentrationDependent__fluid_density_difference_ratio} config.getConfigParameter<double>("fluid_density_difference_ratio"); return std::make_unique<LinearConcentrationDependentDensity>( reference_density, @@ -99,20 +99,20 @@ createLinearConcentrationAndPressureDependentDensity( //! \ogs_file_param{material__fluid__density__type} config.checkConfigParameter("type", "ConcentrationAndPressureDependent"); - const double reference_density = + const auto reference_density = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_density} config.getConfigParameter<double>("reference_density"); - const double reference_concentration = + const auto reference_concentration = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_concentration} config.getConfigParameter<double>("reference_concentration"); - const double fluid_density_concentration_difference_ratio = + const auto fluid_density_concentration_difference_ratio = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__fluid_density_concentration_difference_ratio} config.getConfigParameter<double>( "fluid_density_concentration_difference_ratio"); - const double reference_pressure = + const auto reference_pressure = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__reference_pressure} config.getConfigParameter<double>("reference_pressure"); - const double fluid_density_pressure_difference_ratio = + const auto fluid_density_pressure_difference_ratio = //! \ogs_file_param{material__fluid__density__ConcentrationAndPressureDependent__fluid_density_pressure_difference_ratio} config.getConfigParameter<double>( "fluid_density_pressure_difference_ratio"); diff --git a/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h b/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h index b2c1ba88574a1d8eac7fabba2f1e4c1ca6bd8e26..3aa1c6c862163d21a96c7cbfa0358330376f24b2 100644 --- a/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h +++ b/MaterialLib/Fluid/Viscosity/VogelsLiquidDynamicViscosity.h @@ -88,7 +88,7 @@ private: * */ struct VogelsViscosityConstantsWater { - VogelsViscosityConstantsWater() {} + VogelsViscosityConstantsWater() = default; const double A = -3.7188; const double B = 578.919; const double C = -137.546; @@ -96,7 +96,7 @@ struct VogelsViscosityConstantsWater struct VogelsViscosityConstantsCO2 { - VogelsViscosityConstantsCO2() {} + VogelsViscosityConstantsCO2() = default; const double A = -24.0592; const double B = 28535.2; const double C = 1037.41; @@ -104,7 +104,7 @@ struct VogelsViscosityConstantsCO2 struct VogelsViscosityConstantsCH4 { - VogelsViscosityConstantsCH4() {} + VogelsViscosityConstantsCH4() = default; const double A = -25.5947; const double B = 25392; const double C = 969.306; diff --git a/MaterialLib/FractureModels/CohesiveZoneModeI.cpp b/MaterialLib/FractureModels/CohesiveZoneModeI.cpp index efb029d3794858bb8864e7f2ea563fea18483851..928b642b17d51933d2d8f79b920e4cd2bd219cb8 100644 --- a/MaterialLib/FractureModels/CohesiveZoneModeI.cpp +++ b/MaterialLib/FractureModels/CohesiveZoneModeI.cpp @@ -58,9 +58,8 @@ void CohesiveZoneModeI<DisplacementDim>::computeConstitutiveRelation( assert(dynamic_cast<StateVariables<DisplacementDim> const*>( &material_state_variables) != nullptr); - StateVariables<DisplacementDim>& state = - static_cast<StateVariables<DisplacementDim> &>( - material_state_variables); + auto& state = + static_cast<StateVariables<DisplacementDim>&>(material_state_variables); //reset damage in each iteration state.setInitialConditions(); diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 0bffdcaf5ed40bde795d4d7ebb0a941d8b126c75..4d456d88049938ce1e3920503472f70efaec52bf 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -101,7 +101,7 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( if (property_type == "Linear") { - double const reference_value = + auto const reference_value = //! \ogs_file_param{properties__property__LinearProperty__reference_value} config.getConfigParameter<double>("reference_value"); @@ -113,11 +113,11 @@ std::unique_ptr<MaterialPropertyLib::Property> createProperty( //! \ogs_file_param{properties__property__LinearProperty__independent_variable__variable_name} independent_variable_config.getConfigParameter<std::string>( "variable_name"); - double const reference_condition = + auto const reference_condition = //! \ogs_file_param{properties__property__LinearProperty__independent_variable__reference_condition} independent_variable_config.getConfigParameter<double>( "reference_condition"); - double const slope = + auto const slope = //! \ogs_file_param{properties__property__LinearProperty__independent_variable__slope} independent_variable_config.getConfigParameter<double>("slope"); diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h index 7362a2b4e423fd02c9a7f10163141815e7868be5..88f7e9455abf8a6661ba7e055efa87cae17bf485 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturationCurve.h @@ -27,7 +27,7 @@ class CapillaryPressureSaturationCurve final : public CapillaryPressureSaturation { public: - CapillaryPressureSaturationCurve( + explicit CapillaryPressureSaturationCurve( std::unique_ptr<MathLib::PiecewiseLinearMonotonicCurve>&& curve_data) : CapillaryPressureSaturation( curve_data->getSupportMin(), diff --git a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h index d4676428ef43584cb2f439d8fd958c100a972cc5..7edb0e8017e61d8933993477653a9f975a028faf 100644 --- a/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h +++ b/MaterialLib/PorousMedium/UnsaturatedProperty/RelativePermeability/RelativePermeabilityCurve.h @@ -25,7 +25,7 @@ namespace PorousMedium class RelativePermeabilityCurve final : public RelativePermeability { public: - RelativePermeabilityCurve( + explicit RelativePermeabilityCurve( std::unique_ptr<MathLib::PiecewiseLinearInterpolation>&& curve_data) : RelativePermeability(curve_data->getSupportMin(), curve_data->getSupportMax()), diff --git a/MathLib/ODE/ConcreteODESolver.h b/MathLib/ODE/ConcreteODESolver.h index 09ddd4935c7b9b6962cae8559923e91fa0240aa6..29db9127fee739dc97531a937cf2b362aa838326 100644 --- a/MathLib/ODE/ConcreteODESolver.h +++ b/MathLib/ODE/ConcreteODESolver.h @@ -104,7 +104,7 @@ public: private: //! Instances of this class shall only be constructed by createODESolver(). - ConcreteODESolver(BaseLib::ConfigTree const& config) + explicit ConcreteODESolver(BaseLib::ConfigTree const& config) : Implementation{config, NumEquations} { } diff --git a/MathLib/Point3dWithID.h b/MathLib/Point3dWithID.h index 87f8fe8a99eb3da226bb7dddd84a8a496d977291..cca3e48c0a7643da9b94e1955e5d0580c3da9fa3 100644 --- a/MathLib/Point3dWithID.h +++ b/MathLib/Point3dWithID.h @@ -40,7 +40,8 @@ public: /// the provided id. /// @param coords coordinates of the point /// @param id the id of the object [default: max of std::size_t] - Point3dWithID(std::array<double,3> const& coords, + explicit Point3dWithID( + std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max()) : Point3d(coords), _id(id) {} diff --git a/MathLib/Vector3.h b/MathLib/Vector3.h index 7b084776d03d97312ef2a07d6944878d9af4eae2..ca63af9a530d829db17dbf7a28c8768fd585ac51 100644 --- a/MathLib/Vector3.h +++ b/MathLib/Vector3.h @@ -130,16 +130,13 @@ public: } /// Returns the squared length - double getSqrLength(void) const + double getSqrLength() const { return this->_x[0]*this->_x[0] + this->_x[1]*this->_x[1] + this->_x[2]*this->_x[2]; } /// Returns the length - double getLength(void) const - { - return sqrt(getSqrLength()); - } + double getLength() const { return sqrt(getSqrLength()); } /** scalarProduct, implementation of scalar product, * sometimes called dot or inner product. diff --git a/MeshGeoToolsLib/CreateSearchLength.cpp b/MeshGeoToolsLib/CreateSearchLength.cpp index b0fd5581ccb50410102e77bde3ba6e4f1f76e240..9830a9f22e41069426d092b43a4091ec0b14d954 100644 --- a/MeshGeoToolsLib/CreateSearchLength.cpp +++ b/MeshGeoToolsLib/CreateSearchLength.cpp @@ -36,7 +36,7 @@ std::unique_ptr<MeshGeoToolsLib::SearchLength> createSearchLengthAlgorithm( if (type == "fixed") { //! \ogs_file_param{prj__search_length_algorithm__fixed__value} - double const length = config->getConfigParameter<double>("value"); + auto const length = config->getConfigParameter<double>("value"); return std::make_unique<MeshGeoToolsLib::SearchLength>(length); } if (type == "heuristic") diff --git a/MeshGeoToolsLib/HeuristicSearchLength.h b/MeshGeoToolsLib/HeuristicSearchLength.h index 34af6a5ca07edf753a443fa0b38648318979998e..d16dc653a9801b384b193d1454f86ae61cd7bfaf 100644 --- a/MeshGeoToolsLib/HeuristicSearchLength.h +++ b/MeshGeoToolsLib/HeuristicSearchLength.h @@ -41,8 +41,8 @@ public: * @param mesh mesh object * @param length_type length type to be sampled */ - HeuristicSearchLength(MeshLib::Mesh const& mesh, - LengthType length_type = LengthType::Edge); + explicit HeuristicSearchLength(MeshLib::Mesh const& mesh, + LengthType length_type = LengthType::Edge); private: MeshLib::Mesh const& _mesh; diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h index ef7d53d33f8404747ea330e12247f175371b3c50..3505a95e15153c76f08f1938deb8b7741f550960 100644 --- a/MeshLib/Elements/TemplateElement.h +++ b/MeshLib/Elements/TemplateElement.h @@ -46,7 +46,9 @@ public: * @param nodes an array of pointers of mesh nodes which form this element * @param id element id */ - TemplateElement(Node* nodes[n_all_nodes], std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit TemplateElement( + Node* nodes[n_all_nodes], + std::size_t id = std::numeric_limits<std::size_t>::max()); /** * Constructor with an array of mesh nodes @@ -54,7 +56,9 @@ public: * @param nodes an array of pointers of mesh nodes which form this element * @param id element id */ - TemplateElement(std::array<Node*, n_all_nodes> const& nodes, std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit TemplateElement( + std::array<Node*, n_all_nodes> const& nodes, + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateElement(const TemplateElement &e); diff --git a/MeshLib/IO/Legacy/MeshIO.cpp b/MeshLib/IO/Legacy/MeshIO.cpp index a238f0a422ab1782d62a03909068a7aa2d22d09c..e3c8398c59da82543e8816a0ddf977bab93eae9d 100644 --- a/MeshLib/IO/Legacy/MeshIO.cpp +++ b/MeshLib/IO/Legacy/MeshIO.cpp @@ -37,11 +37,7 @@ namespace MeshLib namespace IO { namespace Legacy { - -MeshIO::MeshIO() - : _mesh(nullptr) -{ -} +MeshIO::MeshIO() = default; MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name) { diff --git a/MeshLib/IO/Legacy/MeshIO.h b/MeshLib/IO/Legacy/MeshIO.h index f06490b2d48921c1b046885b0cc36af8d6a0ee5d..3c83d858605a9a774965448710e28e7bdf5bc3d5 100644 --- a/MeshLib/IO/Legacy/MeshIO.h +++ b/MeshLib/IO/Legacy/MeshIO.h @@ -59,7 +59,7 @@ private: MeshLib::Element* readElement(std::istream& line, const std::vector<MeshLib::Node*> &nodes) const; std::string ElemType2StringOutput(const MeshLib::MeshElemType t) const; - const MeshLib::Mesh* _mesh; + const MeshLib::Mesh* _mesh{nullptr}; }; /* class */ diff --git a/MeshLib/IO/VtkIO/PVDFile.cpp b/MeshLib/IO/VtkIO/PVDFile.cpp index 897b157fb39ee103ce88d65fe55bb2990b3214e2..5725955779c958dcc93c904727a50dd2ed94415d 100644 --- a/MeshLib/IO/VtkIO/PVDFile.cpp +++ b/MeshLib/IO/VtkIO/PVDFile.cpp @@ -22,7 +22,7 @@ namespace IO void PVDFile::addVTUFile(const std::string &vtu_fname, double timestep) { - _datasets.push_back(std::make_pair(timestep, vtu_fname)); + _datasets.emplace_back(timestep, vtu_fname); std::ofstream fh(_pvd_filename.c_str()); if (!fh) { diff --git a/MeshLib/IO/VtkIO/VtuInterface.h b/MeshLib/IO/VtkIO/VtuInterface.h index cc3c6debdc0934b3de99f3c7101adf5df687cbe4..c21776ee1e3764a6c5a2b86a0def4c911d0b93d0 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.h +++ b/MeshLib/IO/VtkIO/VtuInterface.h @@ -37,7 +37,9 @@ class VtuInterface final { public: /// Provide the mesh to write and set if compression should be used. - VtuInterface(const MeshLib::Mesh* mesh, int dataMode = vtkXMLWriter::Binary, bool compressed = false); + explicit VtuInterface(const MeshLib::Mesh* mesh, + int dataMode = vtkXMLWriter::Binary, + bool compressed = false); /// Read an unstructured grid from a VTU file /// \return The converted mesh or a nullptr if reading failed diff --git a/MeshLib/MeshEditing/MeshRevision.h b/MeshLib/MeshEditing/MeshRevision.h index adcaa308d6536b3b632ae8cf47293b62c172c8a3..e2d6267399d1494dc7737adc7da15428615f64ec 100644 --- a/MeshLib/MeshEditing/MeshRevision.h +++ b/MeshLib/MeshEditing/MeshRevision.h @@ -39,7 +39,7 @@ public: * Constructor * @param mesh The mesh which is being revised. Note that node IDs in mesh are changed during computation but are resetted after the algorithms implemented here are finished */ - MeshRevision(MeshLib::Mesh &mesh); + explicit MeshRevision(MeshLib::Mesh& mesh); virtual ~MeshRevision() = default; diff --git a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp index 2e9a038571a8667505980f851fae364f8564a9b2..91e3fc302f5ede69b8989f24ed6d4015eb3b4fba 100644 --- a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp +++ b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp @@ -29,11 +29,6 @@ #include "MeshLib/MeshSearch/NodeSearch.h" #include "MeshLib/MeshEditing/RemoveMeshComponents.h" -LayeredMeshGenerator::LayeredMeshGenerator() -: _elevation_epsilon(0.0001), _minimum_thickness(std::numeric_limits<float>::epsilon()) -{ -} - bool LayeredMeshGenerator::createLayers( MeshLib::Mesh const& mesh, std::vector<GeoLib::Raster const*> const& rasters, diff --git a/MeshLib/MeshGenerators/LayeredMeshGenerator.h b/MeshLib/MeshGenerators/LayeredMeshGenerator.h index 61d7a5d1cb27ebcf0f6478a72f14b04d4056eb66..8f6079f45605f86348ae768b659fc84c8817aaeb 100644 --- a/MeshLib/MeshGenerators/LayeredMeshGenerator.h +++ b/MeshLib/MeshGenerators/LayeredMeshGenerator.h @@ -65,7 +65,7 @@ public: std::unique_ptr<MeshLib::Mesh> getMesh(std::string const& mesh_name) const; protected: - LayeredMeshGenerator(); + LayeredMeshGenerator() = default; virtual ~LayeredMeshGenerator() = default; /// Adds another layer to the subsurface mesh @@ -92,8 +92,8 @@ protected: /// Cleans up the already created objects in case of an error void cleanUpOnError(); - double _elevation_epsilon; - double _minimum_thickness; + double _elevation_epsilon{0.0001}; + double _minimum_thickness{std::numeric_limits<float>::epsilon()}; std::vector<int> _materials; std::vector<MeshLib::Node*> _nodes; std::vector<MeshLib::Element*> _elements; diff --git a/MeshLib/MeshQuality/AngleSkewMetric.h b/MeshLib/MeshQuality/AngleSkewMetric.h index cbf721f3f3991ef2411156ad3a1d91bba7ad7ecb..4fe5b43d7f151d72c246708373e729286b05c82d 100644 --- a/MeshLib/MeshQuality/AngleSkewMetric.h +++ b/MeshLib/MeshQuality/AngleSkewMetric.h @@ -25,7 +25,7 @@ namespace MeshLib class AngleSkewMetric final : public ElementQualityMetric { public: - AngleSkewMetric(Mesh const& mesh); + explicit AngleSkewMetric(Mesh const& mesh); void calculateQuality() override; diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.h b/MeshLib/MeshQuality/EdgeRatioMetric.h index 6ef677f5a8800de6bfd89d5c8598bf77dbdc2e1f..84dbfb08ed49e96100eb124473362d7149cb8166 100644 --- a/MeshLib/MeshQuality/EdgeRatioMetric.h +++ b/MeshLib/MeshQuality/EdgeRatioMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class EdgeRatioMetric : public ElementQualityMetric { public: - EdgeRatioMetric(Mesh const& mesh); + explicit EdgeRatioMetric(Mesh const& mesh); ~EdgeRatioMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/ElementQualityInterface.h b/MeshLib/MeshQuality/ElementQualityInterface.h index 7fd3742fda4a52e638fade4a6545f812b553311a..83fe3d12aca64c679086ff283ccd8816aaebf9a3 100644 --- a/MeshLib/MeshQuality/ElementQualityInterface.h +++ b/MeshLib/MeshQuality/ElementQualityInterface.h @@ -65,8 +65,7 @@ public: if (_quality_tester) return _quality_tester->getHistogram(static_cast<std::size_t>(n_bins)); - std::vector<double> empty_quality_vec(0); - return empty_quality_vec; + return BaseLib::Histogram<double>{{}}; } /// Writes a histogram of the quality vector to a specified file. diff --git a/MeshLib/MeshQuality/ElementQualityMetric.h b/MeshLib/MeshQuality/ElementQualityMetric.h index 88d62720291d3811f5a9f08cf88f5c2ce1f390f1..de83ac683d8fdf3ac18ca144ecc80dba0f5c894e 100644 --- a/MeshLib/MeshQuality/ElementQualityMetric.h +++ b/MeshLib/MeshQuality/ElementQualityMetric.h @@ -32,7 +32,7 @@ namespace MeshLib class ElementQualityMetric { public: - ElementQualityMetric(Mesh const& mesh); + explicit ElementQualityMetric(Mesh const& mesh); virtual ~ElementQualityMetric() = default; diff --git a/MeshLib/MeshQuality/ElementSizeMetric.h b/MeshLib/MeshQuality/ElementSizeMetric.h index 87730d76ad359f416201a0a7d56792a2d9edb9d1..2277f41d12bd6a34cc0be780c79b475093ce9557 100644 --- a/MeshLib/MeshQuality/ElementSizeMetric.h +++ b/MeshLib/MeshQuality/ElementSizeMetric.h @@ -25,7 +25,7 @@ namespace MeshLib class ElementSizeMetric : public ElementQualityMetric { public: - ElementSizeMetric(Mesh const& mesh); + explicit ElementSizeMetric(Mesh const& mesh); ~ElementSizeMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/MeshValidation.h b/MeshLib/MeshQuality/MeshValidation.h index ce7ccea4c3c1eb6d940a06894afc7f4ec2dd10f9..9a0717d7fda535373c69441c950cc080b592a2bb 100644 --- a/MeshLib/MeshQuality/MeshValidation.h +++ b/MeshLib/MeshQuality/MeshValidation.h @@ -32,7 +32,7 @@ class MeshValidation public: /// Constructor /// \warning This might change the mesh when removing unused mesh nodes. - MeshValidation(MeshLib::Mesh &mesh); + explicit MeshValidation(MeshLib::Mesh& mesh); ~MeshValidation() = default; /** diff --git a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h index 67a96afb40163e29d6107e1b4b9b1014a590eb46..8a91a84273b36790d314a130f821d2e32cee47e9 100644 --- a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h +++ b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class RadiusEdgeRatioMetric : public ElementQualityMetric { public: - RadiusEdgeRatioMetric(Mesh const& mesh); + explicit RadiusEdgeRatioMetric(Mesh const& mesh); ~RadiusEdgeRatioMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/MeshQuality/SizeDifferenceMetric.h b/MeshLib/MeshQuality/SizeDifferenceMetric.h index f05754b9bb9a3c7f140254f4d50af72cc9b0270a..f6af7c9a7b5337464f05a96588d436e2dfc29220 100644 --- a/MeshLib/MeshQuality/SizeDifferenceMetric.h +++ b/MeshLib/MeshQuality/SizeDifferenceMetric.h @@ -26,7 +26,7 @@ namespace MeshLib class SizeDifferenceMetric : public ElementQualityMetric { public: - SizeDifferenceMetric(Mesh const& mesh); + explicit SizeDifferenceMetric(Mesh const& mesh); ~SizeDifferenceMetric() override = default; void calculateQuality() override; diff --git a/MeshLib/Node.h b/MeshLib/Node.h index e3470fff3f2d4c0a39479487a64519b4a076a8d3..657aba03a802931c80855f9f4cd504d59e040d3b 100644 --- a/MeshLib/Node.h +++ b/MeshLib/Node.h @@ -44,10 +44,12 @@ class Node : public MathLib::Point3dWithID public: /// Constructor using a coordinate array - Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit Node(const double coords[3], + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructor using a coordinate array - Node(std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max()); + explicit Node(std::array<double, 3> const& coords, + std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructor using single coordinates Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Vtk/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp index 01e8f1161a73347c78bfba4e120b5f100ccda6ed..253c5f72bc574682e38e5eba417faa53dba77260 100644 --- a/MeshLib/Vtk/VtkMappedMeshSource.cpp +++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp @@ -38,7 +38,7 @@ vtkStandardNewMacro(VtkMappedMeshSource) } VtkMappedMeshSource::VtkMappedMeshSource() - : NumberOfDimensions(0), NumberOfNodes(0) + { this->SetNumberOfInputPorts(0); } diff --git a/MeshLib/Vtk/VtkMappedMeshSource.h b/MeshLib/Vtk/VtkMappedMeshSource.h index b4c0c86497965cf8ae95bf31c9494b048323be14..05e04784cfcd157f51efcb12dddcec39416cf2a7 100644 --- a/MeshLib/Vtk/VtkMappedMeshSource.h +++ b/MeshLib/Vtk/VtkMappedMeshSource.h @@ -48,6 +48,9 @@ public: vtkTypeMacro(VtkMappedMeshSource, vtkUnstructuredGridAlgorithm); void PrintSelf(std::ostream& os, vtkIndent indent) override; + VtkMappedMeshSource(const VtkMappedMeshSource&) = delete; + void operator=(const VtkMappedMeshSource&) = delete; + /// Sets the mesh. Calling is mandatory void SetMesh(const MeshLib::Mesh* mesh) { @@ -70,10 +73,6 @@ protected: vtkInformationVector*) override; private: - VtkMappedMeshSource(const VtkMappedMeshSource&) = - delete; // Not implemented. - void operator=(const VtkMappedMeshSource&) = delete; // Not implemented. - /// Adds a zero-copy vtk array wrapper. /// \param properties MeshLib::Properties object /// \param prop_name The name of the property vector to be mapped @@ -83,8 +82,8 @@ private: const MeshLib::Mesh* _mesh; - int NumberOfDimensions; - int NumberOfNodes; + int NumberOfDimensions{0}; + int NumberOfNodes{0}; vtkNew<vtkPoints> Points; vtkNew<vtkPointData> PointData; diff --git a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h index d42a5e7235de046c51f5fb410f01fd138d9e4a60..39a659db6eda51c3bf607c17b788141e43d3baba 100644 --- a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h +++ b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h @@ -384,11 +384,8 @@ template <class Scalar> void VtkMeshNodalCoordinatesTemplate<Scalar> } template <class Scalar> -VtkMeshNodalCoordinatesTemplate<Scalar>::VtkMeshNodalCoordinatesTemplate() - : _nodes(nullptr), TempDoubleArray(nullptr) -{ - -} +VtkMeshNodalCoordinatesTemplate<Scalar>::VtkMeshNodalCoordinatesTemplate() = + default; template <class Scalar> VtkMeshNodalCoordinatesTemplate<Scalar> ::~VtkMeshNodalCoordinatesTemplate() diff --git a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h index feb32368809d1fcaf888980bd4ad287b250768a6..45d0eb6ba298e9ace2e31454f5de342db89c990a 100644 --- a/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h +++ b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h @@ -115,20 +115,19 @@ public: vtkIdType InsertNextTupleValue(const Scalar* t) override; #endif // vtk version + VtkMeshNodalCoordinatesTemplate(const VtkMeshNodalCoordinatesTemplate&) = + delete; + void operator=(const VtkMeshNodalCoordinatesTemplate&) = delete; + protected: VtkMeshNodalCoordinatesTemplate(); ~VtkMeshNodalCoordinatesTemplate() override; - const std::vector<MeshLib::Node*>* _nodes; + const std::vector<MeshLib::Node*>* _nodes{nullptr}; private: - // Not implemented - VtkMeshNodalCoordinatesTemplate(const VtkMeshNodalCoordinatesTemplate&) = - delete; - void operator=(const VtkMeshNodalCoordinatesTemplate&) = delete; - vtkIdType Lookup(const Scalar &val, vtkIdType startIndex); - double *TempDoubleArray; + double* TempDoubleArray{nullptr}; }; } // namespace MeshLib diff --git a/NumLib/Fem/FiniteElement/TemplateIsoparametric.h b/NumLib/Fem/FiniteElement/TemplateIsoparametric.h index 9a09121fc05b43f4d21711015bf9a1d2021e3eb7..cdbe4fd08a5c05cc652b1231c4911b8954219ffd 100644 --- a/NumLib/Fem/FiniteElement/TemplateIsoparametric.h +++ b/NumLib/Fem/FiniteElement/TemplateIsoparametric.h @@ -55,7 +55,7 @@ public: * * @param e Mesh element object */ - TemplateIsoparametric(const MeshElementType& e) : _ele(&e) {} + explicit TemplateIsoparametric(const MeshElementType& e) : _ele(&e) {} ~TemplateIsoparametric() = default; /// return current mesh element diff --git a/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h b/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h index 0e0fc979b2814a6223f86a827c9741cbf259d8c6..866835bd19fdee070fcb731a726af06fd8b3cfb8 100644 --- a/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendrePrism.h @@ -31,7 +31,6 @@ public: * @param order integration order (default 2) */ explicit IntegrationGaussLegendrePrism(unsigned order = 2) - : _order(2), _n_sampl_pt(0) { this->setIntegrationOrder(order); } @@ -90,8 +89,8 @@ public: } private: - unsigned _order; - unsigned _n_sampl_pt; + unsigned _order{2}; + unsigned _n_sampl_pt{0}; }; } // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h b/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h index 82011adb2ee9e2d80de44c42e7f95f1c58cbc621..220a41eb0b2cfab16f983aab7b6487f13394bf49 100644 --- a/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendrePyramid.h @@ -29,8 +29,7 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussLegendrePyramid(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendrePyramid(unsigned order = 2) : _order(order) { this->setIntegrationOrder(order); } @@ -108,7 +107,7 @@ public: private: unsigned _order; - unsigned _n_sampl_pt; + unsigned _n_sampl_pt{0}; }; } // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h index 3ce7c619ed3187e532a5ed76f981ae36ab7fe141..ecb2e0f2b025ea1f79a790c90d91de24c59bfc79 100644 --- a/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreRegular.h @@ -36,8 +36,7 @@ public: /// integration order. /// /// @param order integration order (default 2) - explicit IntegrationGaussLegendreRegular(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreRegular(unsigned order = 2) : _order(order) { this->setIntegrationOrder(order); } @@ -90,7 +89,7 @@ private: private: unsigned _order; - unsigned _n_sampl_pt; + unsigned _n_sampl_pt{0}; }; } // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h b/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h index 20c131e0e0242f58eaaecdecc8109cb825d914cb..31e77703092b245a601706ac182abf2fdecc7505 100644 --- a/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreTet.h @@ -29,8 +29,7 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussLegendreTet(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreTet(unsigned order = 2) : _order(order) { this->setIntegrationOrder(order); } @@ -108,7 +107,7 @@ public: private: unsigned _order; - unsigned _n_sampl_pt; + unsigned _n_sampl_pt{0}; }; } // namespace NumLib diff --git a/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h b/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h index 80b56fa739841e02f35a6a103f1042797c8fc164..5e97a2d0a25f705e77ff98c4af0ff8f61a5891cf 100644 --- a/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h +++ b/NumLib/Fem/Integration/IntegrationGaussLegendreTri.h @@ -43,8 +43,7 @@ public: * * @param order integration order (default 2) */ - explicit IntegrationGaussLegendreTri(unsigned order = 2) - : _order(order), _n_sampl_pt(0) + explicit IntegrationGaussLegendreTri(unsigned order = 2) : _order(order) { this->setIntegrationOrder(order); } @@ -122,7 +121,7 @@ public: private: unsigned _order; - unsigned _n_sampl_pt; + unsigned _n_sampl_pt{0}; }; } // namespace NumLib diff --git a/NumLib/Function/TemplateSpatialFunction.h b/NumLib/Function/TemplateSpatialFunction.h index f645ace89e37a494ad7e46274a4676993278d964..6535669311b7a6fe52d15644d5f5102a383f7796 100644 --- a/NumLib/Function/TemplateSpatialFunction.h +++ b/NumLib/Function/TemplateSpatialFunction.h @@ -32,7 +32,7 @@ public: * Constructor * @param f a function object */ - TemplateSpatialFunction(T_FUNCTION f) : _f(std::move(f)) {} + explicit TemplateSpatialFunction(T_FUNCTION f) : _f(std::move(f)) {} /** * evaluate a function * @param pnt a point object diff --git a/NumLib/NamedFunctionCaller.h b/NumLib/NamedFunctionCaller.h index 365b1907a373a68141597ec30e994d4fc7f4d9c3..6c98637c2bf377cfd9cb44f338579d0cf6f14535 100644 --- a/NumLib/NamedFunctionCaller.h +++ b/NumLib/NamedFunctionCaller.h @@ -22,7 +22,7 @@ class NamedFunctionCaller final { public: //! Constructs an instance whose unbound arguments have the given names. - explicit NamedFunctionCaller( + NamedFunctionCaller( std::initializer_list<std::string> unbound_argument_names); //! Adds the given named function diff --git a/NumLib/ODESolver/ConvergenceCriterion.h b/NumLib/ODESolver/ConvergenceCriterion.h index a60f0a2f446266db6000120a06ce9a20455692f0..2f139d7ddf56e52ac33a8d5e3ad384d9a6da9030 100644 --- a/NumLib/ODESolver/ConvergenceCriterion.h +++ b/NumLib/ODESolver/ConvergenceCriterion.h @@ -28,7 +28,7 @@ namespace NumLib class ConvergenceCriterion { public: - ConvergenceCriterion(const MathLib::VecNormType norm_type) + explicit ConvergenceCriterion(const MathLib::VecNormType norm_type) : _norm_type(norm_type) { } diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponent.h b/NumLib/ODESolver/ConvergenceCriterionPerComponent.h index 59f2bfb681a739d9b33ae98e3f2619698bb4aa9c..6bc194c42c4da7d8d7bed1a920695ecdae5b2e37 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponent.h +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponent.h @@ -28,7 +28,8 @@ class LocalToGlobalIndexMap; class ConvergenceCriterionPerComponent : public ConvergenceCriterion { public: - ConvergenceCriterionPerComponent(const MathLib::VecNormType norm_type) + explicit ConvergenceCriterionPerComponent( + const MathLib::VecNormType norm_type) : ConvergenceCriterion(norm_type) { } diff --git a/NumLib/ODESolver/MatrixTranslator.h b/NumLib/ODESolver/MatrixTranslator.h index b82b508e5a6641311465c05758c30bbd348de5dd..9e30705e864d87b0fe89bed38bb47e0179f01ba1 100644 --- a/NumLib/ODESolver/MatrixTranslator.h +++ b/NumLib/ODESolver/MatrixTranslator.h @@ -102,7 +102,7 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorGeneral(TimeDiscretization const& timeDisc) + explicit MatrixTranslatorGeneral(TimeDiscretization const& timeDisc) : _time_disc(timeDisc) { } @@ -159,7 +159,7 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorForwardEuler(ForwardEuler const& timeDisc) + explicit MatrixTranslatorForwardEuler(ForwardEuler const& timeDisc) : _fwd_euler(timeDisc) { } @@ -215,12 +215,10 @@ public: * * \param timeDisc the time discretization scheme to be used. */ - MatrixTranslatorCrankNicolson(CrankNicolson const& timeDisc) + explicit MatrixTranslatorCrankNicolson(CrankNicolson const& timeDisc) : _crank_nicolson(timeDisc), - _M_bar(NumLib::GlobalMatrixProvider::provider - .getMatrix()), - _b_bar( - NumLib::GlobalVectorProvider::provider.getVector()) + _M_bar(NumLib::GlobalMatrixProvider::provider.getMatrix()), + _b_bar(NumLib::GlobalVectorProvider::provider.getVector()) { } diff --git a/NumLib/ODESolver/ODESystem.h b/NumLib/ODESolver/ODESystem.h index 59cd23fd63f93f57ab7279b23497cbc1a227e0ce..192e467af7172744f50f1fa97af58d1b04ecb8d5 100644 --- a/NumLib/ODESolver/ODESystem.h +++ b/NumLib/ODESolver/ODESystem.h @@ -78,7 +78,7 @@ class ODESystem<ODESystemTag::FirstOrderImplicitQuasilinear, { public: //! Calls process' pre-assembly with the provided state (\c t, \c x). - virtual void preAssemble(const double t, GlobalVector const& x) = 0; + void preAssemble(const double t, GlobalVector const& x) override = 0; /*! Assemble \c M, \c K, \c b and the Jacobian * \f$ \mathtt{Jac} := \partial r/\partial x_N \f$ diff --git a/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp b/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp index cbb14a1c2531cc4e01ecdff95031cfa044a0a0db..337a0b59cd09881c44df5a90d06bac98769d0d50 100644 --- a/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp +++ b/NumLib/TimeStepping/Algorithms/CreateEvolutionaryPIDcontroller.cpp @@ -49,7 +49,7 @@ std::unique_ptr<TimeStepAlgorithm> createEvolutionaryPIDcontroller( if (!fixed_output_times.empty()) { // Remove possible duplicated elements and sort in descending order. - BaseLib::makeVectorUnique(fixed_output_times, std::greater<double>()); + BaseLib::makeVectorUnique(fixed_output_times, std::greater<>()); } //! \ogs_file_param{prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__tol} diff --git a/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h b/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h index 705d78527477bcb88137365e82863125b0fed30e..73c8edde3a53cde50073ed1a5365a52b17ad11cc 100644 --- a/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h +++ b/ProcessLib/BoundaryCondition/BHEBottomDirichletBoundaryCondition.h @@ -17,7 +17,7 @@ namespace ProcessLib class BHEBottomDirichletBoundaryCondition final : public BoundaryCondition { public: - BHEBottomDirichletBoundaryCondition( + explicit BHEBottomDirichletBoundaryCondition( std::pair<GlobalIndexType, GlobalIndexType>&& in_out_global_indices) : _in_out_global_indices(std::move(in_out_global_indices)) { diff --git a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h index d957ef0e18d6d37773661f665525cbe0b7d7fa27..b6bebef421be6022d3a1e7b8d146e77e8e86a873 100644 --- a/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h +++ b/ProcessLib/BoundaryCondition/BoundaryConditionCollection.h @@ -19,7 +19,7 @@ namespace ProcessLib class BoundaryConditionCollection final { public: - BoundaryConditionCollection( + explicit BoundaryConditionCollection( std::vector<std::unique_ptr<ParameterBase>> const& parameters) : _parameters(parameters) { diff --git a/ProcessLib/ComponentTransport/ComponentTransportFEM.h b/ProcessLib/ComponentTransport/ComponentTransportFEM.h index 6f036701cb8c174d40cff1499a19f010757ff684..5a6939ed1908905d834233c317d03dad58241fb9 100644 --- a/ProcessLib/ComponentTransport/ComponentTransportFEM.h +++ b/ProcessLib/ComponentTransport/ComponentTransportFEM.h @@ -54,7 +54,7 @@ class ComponentTransportLocalAssemblerInterface public NumLib::ExtrapolatableElement { public: - ComponentTransportLocalAssemblerInterface() : _coupled_solutions(nullptr) {} + ComponentTransportLocalAssemblerInterface() = default; void setStaggeredCoupledSolutions( std::size_t const /*mesh_item_id*/, @@ -70,7 +70,7 @@ public: std::vector<double>& cache) const = 0; protected: - CoupledSolutionsForStaggeredScheme* _coupled_solutions; + CoupledSolutionsForStaggeredScheme* _coupled_solutions{nullptr}; }; template <typename ShapeFunction, typename IntegrationMethod, diff --git a/ProcessLib/HT/HTLocalAssemblerInterface.h b/ProcessLib/HT/HTLocalAssemblerInterface.h index 885552d73e10846369d07490fa9e2863a7fc36c4..75ec7e33a370f88b52cd0df68664b115d9663ecc 100644 --- a/ProcessLib/HT/HTLocalAssemblerInterface.h +++ b/ProcessLib/HT/HTLocalAssemblerInterface.h @@ -45,7 +45,7 @@ class HTLocalAssemblerInterface : public ProcessLib::LocalAssemblerInterface, public NumLib::ExtrapolatableElement { public: - HTLocalAssemblerInterface() : _coupled_solutions(nullptr) {} + HTLocalAssemblerInterface() = default; void setStaggeredCoupledSolutions( std::size_t const /*mesh_item_id*/, CoupledSolutionsForStaggeredScheme* const coupling_term) @@ -59,10 +59,10 @@ public: NumLib::LocalToGlobalIndexMap const& /*dof_table*/, std::vector<double>& /*cache*/) const = 0; - virtual Eigen::Vector3d getFlux( - MathLib::Point3d const& pnt_local_coords, - double const t, - std::vector<double> const& local_x) const = 0; + Eigen::Vector3d getFlux(MathLib::Point3d const& pnt_local_coords, + double const t, + std::vector<double> const& local_x) const override = + 0; protected: // TODO: remove _coupled_solutions or move integration point data from @@ -74,7 +74,7 @@ protected: * calculate the secondary variables like velocity for coupled * processes. */ - CoupledSolutionsForStaggeredScheme* _coupled_solutions; + CoupledSolutionsForStaggeredScheme* _coupled_solutions{nullptr}; }; } // namespace HT diff --git a/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp b/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp index 7ace92bbbcf68b1a9a2852d57eedd337b6b81d12..be5d2abe244bcb158552f0273eee921a96c66599 100644 --- a/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/BoreholeGeometry.cpp @@ -20,10 +20,10 @@ namespace BHE { BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const& config) { - const double borehole_length = + const auto borehole_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__length} config.getConfigParameter<double>("length"); - const double borehole_diameter = + const auto borehole_diameter = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__diameter} config.getConfigParameter<double>("diameter"); return {borehole_length, borehole_diameter}; diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp index a16356f1e0f0686225381319cf4c0c0b0a108ff9..0433679c0fe48d6b791c85601e35f22b076747b0 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHE1U.cpp @@ -35,10 +35,10 @@ BHE::BHE_1U createBHE1U( Pipe const outlet_pipe = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__outlet} createPipe(pipes_config.getConfigSubtree("outlet")); - const double pipe_distance = + const auto pipe_distance = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__distance_between_pipes} pipes_config.getConfigParameter<double>("distance_between_pipes"); - const double pipe_longitudinal_dispersion_length = + const auto pipe_longitudinal_dispersion_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length} pipes_config.getConfigParameter<double>( "longitudinal_dispersion_length"); diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp index 32782649f179e11cd914781cbd456945212e626d..8798f5c00069f4299373434c2fe001a82ce475bf 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateBHECoaxial.cpp @@ -43,7 +43,7 @@ parseBHECoaxialConfig( Pipe const inner_pipe = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inner} createPipe(pipes_config.getConfigSubtree("inner")); - const double pipe_longitudinal_dispersion_length = + const auto pipe_longitudinal_dispersion_length = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length} pipes_config.getConfigParameter<double>( "longitudinal_dispersion_length"); diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp index 80d1795e44ab59122b5bb435c3277e980aea15c2..9bdbea2c099d1767d6829006f90c8d286799e5f9 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp @@ -34,7 +34,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( if (type == "TemperatureCurveConstantFlow") { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__TemperatureCurveConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); auto const& temperature_curve = *BaseLib::getOrError( curves, @@ -47,10 +47,10 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( if (type == "FixedPowerConstantFlow") { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerConstantFlow__power} - double const power = config.getConfigParameter<double>("power"); + auto const power = config.getConfigParameter<double>("power"); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); return FixedPowerConstantFlow{flow_rate, power, refrigerant.specific_heat_capacity, refrigerant.density}; @@ -65,7 +65,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( "Required flow rate curve not found."); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__FixedPowerFlowCurve__power} - double const power = config.getConfigParameter<double>("power"); + auto const power = config.getConfigParameter<double>("power"); return FixedPowerFlowCurve{flow_rate_curve, power, refrigerant.specific_heat_capacity, @@ -81,7 +81,7 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( "Required power curve not found."); //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__PowerCurveConstantFlow__flow_rate} - double const flow_rate = config.getConfigParameter<double>("flow_rate"); + auto const flow_rate = config.getConfigParameter<double>("flow_rate"); return PowerCurveConstantFlow{power_curve, flow_rate, refrigerant.specific_heat_capacity, diff --git a/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp b/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp index 36f6d79ef17e20b2a657f805a29ce299d7848505..e220c795bba0e4f2a3c19039c834a6611ec6a1c5 100644 --- a/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/GroutParameters.cpp @@ -20,16 +20,16 @@ namespace BHE { GroutParameters createGroutParameters(BaseLib::ConfigTree const& config) { - const double grout_density = + const auto grout_density = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__density} config.getConfigParameter<double>("density"); - const double grout_porosity = + const auto grout_porosity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__porosity} config.getConfigParameter<double>("porosity"); - const double grout_heat_capacity = + const auto grout_heat_capacity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__heat_capacity} config.getConfigParameter<double>("heat_capacity"); - const double grout_thermal_conductivity = + const auto grout_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__thermal_conductivity} config.getConfigParameter<double>("thermal_conductivity"); return {grout_density, grout_porosity, grout_heat_capacity, diff --git a/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp b/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp index 854f96db4b73e30fb643d0af39042dbbfc9df129..301065b652b997cfe29a1860e06c3c1314e1309f 100644 --- a/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/Pipe.cpp @@ -21,11 +21,11 @@ namespace BHE Pipe createPipe(BaseLib::ConfigTree const& config) { //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__diameter} - const double diameter = config.getConfigParameter<double>("diameter"); - const double wall_thickness = + const auto diameter = config.getConfigParameter<double>("diameter"); + const auto wall_thickness = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thickness} config.getConfigParameter<double>("wall_thickness"); - const double wall_thermal_conductivity = + const auto wall_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thermal_conductivity} config.getConfigParameter<double>("wall_thermal_conductivity"); return {diameter, wall_thickness, wall_thermal_conductivity}; diff --git a/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp b/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp index b338f5483887bca005ec3abb668968e983525942..ac099fc41a9c56908e37da250e296f2f85e252fd 100644 --- a/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/RefrigerantProperties.cpp @@ -21,19 +21,19 @@ namespace BHE RefrigerantProperties createRefrigerantProperties( BaseLib::ConfigTree const& config) { - double const refrigerant_density = + auto const refrigerant_density = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__density} config.getConfigParameter<double>("density"); - double const refrigerant_viscosity = + auto const refrigerant_viscosity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__viscosity} config.getConfigParameter<double>("viscosity"); - double const refrigerant_heat_capacity = + auto const refrigerant_heat_capacity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__specific_heat_capacity} config.getConfigParameter<double>("specific_heat_capacity"); - double const refrigerant_thermal_conductivity = + auto const refrigerant_thermal_conductivity = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__thermal_conductivity} config.getConfigParameter<double>("thermal_conductivity"); - double const refrigerant_reference_temperature = + auto const refrigerant_reference_temperature = //! \ogs_file_param{prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__reference_temperature} config.getConfigParameter<double>("reference_temperature"); return {refrigerant_viscosity, refrigerant_density, diff --git a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp index fb8b8a1913d9c007eee8697b474369fdb09138d7..2028bcbe9dc18c78db25901990c82b4418dc105d 100644 --- a/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/CreateHeatTransportBHEProcess.cpp @@ -184,19 +184,21 @@ std::unique_ptr<Process> createHeatTransportBHEProcess( if (bhe_type == "1U") { - bhes.push_back(BHE::createBHE1U(bhe_config, curves)); + bhes.emplace_back(BHE::createBHE1U(bhe_config, curves)); continue; } if (bhe_type == "CXA") { - bhes.push_back(BHE::createBHECoaxial<BHE::BHE_CXA>(bhe_config, curves)); + bhes.emplace_back( + BHE::createBHECoaxial<BHE::BHE_CXA>(bhe_config, curves)); continue; } if (bhe_type == "CXC") { - bhes.push_back(BHE::createBHECoaxial<BHE::BHE_CXC>(bhe_config, curves)); + bhes.emplace_back( + BHE::createBHECoaxial<BHE::BHE_CXC>(bhe_config, curves)); continue; } OGS_FATAL("Unknown BHE type '%s'.", bhe_type.c_str()); diff --git a/ProcessLib/LIE/Common/LevelSetFunction.cpp b/ProcessLib/LIE/Common/LevelSetFunction.cpp index 3ce37d764f4b9b25309d3442043889e99fec7a07..1cc6dd7bd3ac1e81422405b006a823a1be1c5b76 100644 --- a/ProcessLib/LIE/Common/LevelSetFunction.cpp +++ b/ProcessLib/LIE/Common/LevelSetFunction.cpp @@ -61,9 +61,9 @@ std::vector<double> uGlobalEnrichments( { auto const* frac = frac_props[i]; double enrich = levelsets[i]; - for (std::size_t j = 0; j < frac->branches_slave.size(); j++) + for (const auto& j : frac->branches_slave) { - enrich *= Heaviside(levelsetBranch(frac->branches_slave[j], x)); + enrich *= Heaviside(levelsetBranch(j, x)); } enrichments[i] = enrich; } diff --git a/ProcessLib/LIE/Common/MeshUtils.cpp b/ProcessLib/LIE/Common/MeshUtils.cpp index b66276a059ad8116df9fb7b428f9081abc1e70bb..73b391801af4046139666f0b634e8eb86afe5c3b 100644 --- a/ProcessLib/LIE/Common/MeshUtils.cpp +++ b/ProcessLib/LIE/Common/MeshUtils.cpp @@ -186,7 +186,7 @@ void findFracutreIntersections( matIDs[1] = matid; // slave } } - vec_branch_nodeID_matIDs.push_back(std::make_pair(nodeID, matIDs)); + vec_branch_nodeID_matIDs.emplace_back(nodeID, matIDs); } else { @@ -195,8 +195,7 @@ void findFracutreIntersections( vec_matID_counts.rbegin()->first); matIDs[1] = std::max(vec_matID_counts.begin()->first, vec_matID_counts.rbegin()->first); - vec_junction_nodeID_matIDs.push_back( - std::make_pair(nodeID, matIDs)); + vec_junction_nodeID_matIDs.emplace_back(nodeID, matIDs); } } diff --git a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp index 7b87771ad2fb3d9324589e1ee88069cbc8f62d63..37f878fd6504b4019f1e96ff4a425ffd7e331002 100644 --- a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp @@ -98,10 +98,10 @@ SmallDeformationProcess<DisplacementDim>::SmallDeformationProcess( } // set branches - for (std::size_t i = 0; i < vec_branch_nodeID_matIDs.size(); i++) + for (auto& vec_branch_nodeID_matID : vec_branch_nodeID_matIDs) { - auto master_matId = vec_branch_nodeID_matIDs[i].second[0]; - auto slave_matId = vec_branch_nodeID_matIDs[i].second[1]; + auto master_matId = vec_branch_nodeID_matID.second[0]; + auto slave_matId = vec_branch_nodeID_matID.second[1]; auto& master_frac = _process_data.fracture_properties [_process_data._map_materialID_to_fractureID[master_matId]]; @@ -109,20 +109,20 @@ SmallDeformationProcess<DisplacementDim>::SmallDeformationProcess( _process_data.fracture_properties [_process_data._map_materialID_to_fractureID[slave_matId]]; - master_frac.branches_master.push_back(createBranchProperty( - *mesh.getNode(vec_branch_nodeID_matIDs[i].first), master_frac, - slave_frac)); + master_frac.branches_master.push_back( + createBranchProperty(*mesh.getNode(vec_branch_nodeID_matID.first), + master_frac, slave_frac)); - slave_frac.branches_slave.push_back(createBranchProperty( - *mesh.getNode(vec_branch_nodeID_matIDs[i].first), master_frac, - slave_frac)); + slave_frac.branches_slave.push_back( + createBranchProperty(*mesh.getNode(vec_branch_nodeID_matID.first), + master_frac, slave_frac)); } // set junctions - for (std::size_t i = 0; i < vec_junction_nodeID_matIDs.size(); i++) + for (auto& vec_junction_nodeID_matID : vec_junction_nodeID_matIDs) { _vec_junction_nodes.push_back(const_cast<MeshLib::Node*>( - _mesh.getNode(vec_junction_nodeID_matIDs[i].first))); + _mesh.getNode(vec_junction_nodeID_matID.first))); } for (std::size_t i = 0; i < vec_junction_nodeID_matIDs.size(); i++) { diff --git a/ProcessLib/Output/CreateOutput.cpp b/ProcessLib/Output/CreateOutput.cpp index 98e60d790e4c12779ac3826ef5ade1f0931eea2e..70dd99c741570fd97a835da89a9935bc5765c65a 100644 --- a/ProcessLib/Output/CreateOutput.cpp +++ b/ProcessLib/Output/CreateOutput.cpp @@ -124,7 +124,7 @@ std::unique_ptr<Output> createOutput( { fixed_output_times = std::move(*fixed_output_times_ptr); // Remove possible duplicated elements and sort in descending order. - BaseLib::makeVectorUnique(fixed_output_times, std::greater<double>()); + BaseLib::makeVectorUnique(fixed_output_times, std::greater<>()); } bool const output_iteration_results = diff --git a/ProcessLib/Output/IntegrationPointWriter.cpp b/ProcessLib/Output/IntegrationPointWriter.cpp index 491a5d97a6825578ab48cd5fa2370260b7899f11..bcbc5ca93273a290d965f3613f9f5905fd4d3cf2 100644 --- a/ProcessLib/Output/IntegrationPointWriter.cpp +++ b/ProcessLib/Output/IntegrationPointWriter.cpp @@ -33,9 +33,8 @@ static ProcessLib::IntegrationPointMetaData addIntegrationPointData( writer.numberOfComponents()); field_data.clear(); - for (std::size_t e = 0; e < ip_values.size(); ++e) + for (const auto& element_ip_values : ip_values) { - auto const& element_ip_values = ip_values[e]; std::copy(element_ip_values.begin(), element_ip_values.end(), std::back_inserter(field_data)); } diff --git a/ProcessLib/Output/Output.h b/ProcessLib/Output/Output.h index 4b09525757df84f7aa27103e8f6d7a3e1475c088..4f5b828213cba7c7906ab64d386115e7816770a8 100644 --- a/ProcessLib/Output/Output.h +++ b/ProcessLib/Output/Output.h @@ -83,7 +83,9 @@ public: private: struct ProcessData { - ProcessData(std::string const& filename) : pvd_file(filename) {} + explicit ProcessData(std::string const& filename) : pvd_file(filename) + { + } MeshLib::IO::PVDFile pvd_file; }; diff --git a/ProcessLib/Parameter/FunctionParameter.h b/ProcessLib/Parameter/FunctionParameter.h index f32a3cddc236343f82ad888904d9365f217c414a..9109556b7356598ad83eb292db3ab2bd4b859129 100644 --- a/ProcessLib/Parameter/FunctionParameter.h +++ b/ProcessLib/Parameter/FunctionParameter.h @@ -31,10 +31,10 @@ namespace ProcessLib template <typename T> struct FunctionParameter final : public Parameter<T> { - typedef exprtk::symbol_table<T> symbol_table_t; - typedef exprtk::expression<T> expression_t; - typedef exprtk::parser<T> parser_t; - typedef exprtk::parser_error::type error_t; + using symbol_table_t = exprtk::symbol_table<T>; + using expression_t = exprtk::expression<T>; + using parser_t = exprtk::parser<T>; + using error_t = exprtk::parser_error::type; /** * Constructing from a vector of expressions diff --git a/ProcessLib/PhaseField/PhaseFieldFEM.h b/ProcessLib/PhaseField/PhaseFieldFEM.h index ef131507e98bc573d3dfe5d1525abd99a02e4e4c..fe20b9a87ed47650b84a9193b2adf1298958fba5 100644 --- a/ProcessLib/PhaseField/PhaseFieldFEM.h +++ b/ProcessLib/PhaseField/PhaseFieldFEM.h @@ -273,7 +273,7 @@ private: return cache; } - virtual std::vector<double> const& getIntPtEpsilon( + std::vector<double> const& getIntPtEpsilon( const double /*t*/, GlobalVector const& /*current_solution*/, NumLib::LocalToGlobalIndexMap const& /*dof_table*/, diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index 44adb9b24581d3aeab1ca8c87b00977d8b5655b6..25c70fd6e66867eae2b207ff3f16a7d729146f1d 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -81,7 +81,7 @@ public: void setInitialConditions(const int process_id, const double t, GlobalVector& x); - virtual MathLib::MatrixSpecifications getMatrixSpecifications( + MathLib::MatrixSpecifications getMatrixSpecifications( const int process_id) const override; void setCoupledSolutionsForStaggeredScheme( @@ -94,7 +94,7 @@ public: bool isMonolithicSchemeUsed() const { return _use_monolithic_scheme; } virtual void setCoupledTermForTheStaggeredSchemeToLocalAssemblers() {} - void preAssemble(const double t, GlobalVector const& x) override final; + void preAssemble(const double t, GlobalVector const& x) final; void assemble(const double t, GlobalVector const& x, GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) final; diff --git a/ProcessLib/SmallDeformation/SmallDeformationFEM.h b/ProcessLib/SmallDeformation/SmallDeformationFEM.h index 3c5724bc7e28a9762579b3297ab6867daf1bb959..5a30e3f49767192d7143f7aedeeeca1aa18ece77 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationFEM.h +++ b/ProcessLib/SmallDeformation/SmallDeformationFEM.h @@ -423,7 +423,7 @@ public: return cache; } - virtual std::vector<double> const& getIntPtEpsilon( + std::vector<double> const& getIntPtEpsilon( const double /*t*/, GlobalVector const& /*current_solution*/, NumLib::LocalToGlobalIndexMap const& /*dof_table*/, diff --git a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h index 30a243b0d462a0b67f9f53345dbf87c1e4d7dcab..c668b0c78c054380beee283c94a94722b9a3c28f 100644 --- a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h +++ b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h @@ -672,7 +672,7 @@ public: return cache; } - virtual std::vector<double> const& getIntPtEpsilon( + std::vector<double> const& getIntPtEpsilon( const double /*t*/, GlobalVector const& /*current_solution*/, NumLib::LocalToGlobalIndexMap const& /*dof_table*/, diff --git a/ProcessLib/SourceTerms/SourceTermCollection.h b/ProcessLib/SourceTerms/SourceTermCollection.h index 7de8a0747fcada3397143160c1235e0981341d52..b27a51e878868f7458f1d4305867847ab2bf20a2 100644 --- a/ProcessLib/SourceTerms/SourceTermCollection.h +++ b/ProcessLib/SourceTerms/SourceTermCollection.h @@ -17,7 +17,7 @@ namespace ProcessLib class SourceTermCollection final { public: - SourceTermCollection( + explicit SourceTermCollection( std::vector<std::unique_ptr<ParameterBase>> const& parameters) : _parameters(parameters) { diff --git a/ProcessLib/SourceTerms/VolumetricSourceTerm.h b/ProcessLib/SourceTerms/VolumetricSourceTerm.h index 05f934c2ff5922733b1a33bd3bbeb5d6773f2a54..92e3bb7c74079ea036a03231ecc9ce8ad8cd788f 100644 --- a/ProcessLib/SourceTerms/VolumetricSourceTerm.h +++ b/ProcessLib/SourceTerms/VolumetricSourceTerm.h @@ -27,7 +27,7 @@ public: Parameter<double> const& volumetric_source_term); void integrate(const double t, GlobalVector const& x, GlobalVector& b, - GlobalMatrix* jac) const; + GlobalMatrix* jac) const override; private: Parameter<double> const& _volumetric_source_term; diff --git a/ProcessLib/SurfaceFlux/SurfaceFluxData.h b/ProcessLib/SurfaceFlux/SurfaceFluxData.h index 23d37e9670ec053285457ca210945de664d52170..d2f5cdda22662212c21203c3c788d42f38559c97 100644 --- a/ProcessLib/SurfaceFlux/SurfaceFluxData.h +++ b/ProcessLib/SurfaceFlux/SurfaceFluxData.h @@ -54,14 +54,14 @@ struct SurfaceFluxData std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::string const& output_directory) { - std::string mesh_name = + auto mesh_name = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__mesh} calculatesurfaceflux_config.getConfigParameter<std::string>("mesh"); - std::string surfaceflux_pv_name = + auto surfaceflux_pv_name = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__property_name} calculatesurfaceflux_config.getConfigParameter<std::string>( "property_name"); - std::string surfaceflux_out_fname = + auto surfaceflux_out_fname = //! \ogs_file_param{prj__processes__process__calculatesurfaceflux__output_mesh} calculatesurfaceflux_config.getConfigParameter<std::string>( "output_mesh"); diff --git a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp index aef959058351cc5be07e0be588a56ab3cf98e3b1..b51104304ab685355a5145e5c695d309b58ec817 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp @@ -187,7 +187,7 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( DBUG("Use '%s' as residual thermal conductivity parameter.", residual_thermal_conductivity.name.c_str()); // Reference temperature - const double reference_temperature = + const auto reference_temperature = //! \ogs_file_param{prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__reference_temperature} config.getConfigParameter<double>("reference_temperature"); diff --git a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h index b680eb213ce0317ede0ef1331cbafac3565176ad..ba4b463f951b2ed516890064636e34932b14bb6c 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h +++ b/ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h @@ -269,7 +269,7 @@ private: return cache; } - virtual std::vector<double> const& getIntPtEpsilon( + std::vector<double> const& getIntPtEpsilon( const double /*t*/, GlobalVector const& /*current_solution*/, NumLib::LocalToGlobalIndexMap const& /*dof_table*/, diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h index adf3f482d5285da04f2ea6303f471d2955e0425a..64f4d650cba336e909915f241214f1786bfa4275 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h @@ -541,7 +541,7 @@ private: return ip_epsilon_values; } - virtual std::vector<double> const& getIntPtEpsilon( + std::vector<double> const& getIntPtEpsilon( const double /*t*/, GlobalVector const& /*current_solution*/, NumLib::LocalToGlobalIndexMap const& /*dof_table*/, diff --git a/ProcessLib/Utils/ProcessUtils.cpp b/ProcessLib/Utils/ProcessUtils.cpp index 4e1a78210b1d122dfeaceac76bfd8ad5667860cf..d9d24766da47cdc6726f77a2dda52f1598f55921 100644 --- a/ProcessLib/Utils/ProcessUtils.cpp +++ b/ProcessLib/Utils/ProcessUtils.cpp @@ -90,7 +90,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( for (std::string const& var_name : var_names) { - vars.push_back(findVariableByName(variables, var_name, tag)); + vars.emplace_back(findVariableByName(variables, var_name, tag)); cached_var_names.push_back(var_name); } diff --git a/ProcessLib/VectorMatrixAssembler.cpp b/ProcessLib/VectorMatrixAssembler.cpp index 6434f469e34ef879345fc4e729514e291ce37093..45252c47947d043d857a4ea16162a80dae2a1869 100644 --- a/ProcessLib/VectorMatrixAssembler.cpp +++ b/ProcessLib/VectorMatrixAssembler.cpp @@ -47,10 +47,10 @@ void VectorMatrixAssembler::assemble( { std::vector<std::vector<GlobalIndexType>> indices_of_processes; indices_of_processes.reserve(dof_tables.size()); - for (std::size_t i = 0; i < dof_tables.size(); i++) + for (auto dof_table : dof_tables) { indices_of_processes.emplace_back( - NumLib::getIndices(mesh_item_id, dof_tables[i].get())); + NumLib::getIndices(mesh_item_id, dof_table.get())); } auto const& indices = (cpl_xs == nullptr) @@ -114,10 +114,10 @@ void VectorMatrixAssembler::assembleWithJacobian( { std::vector<std::vector<GlobalIndexType>> indices_of_processes; indices_of_processes.reserve(dof_tables.size()); - for (std::size_t i = 0; i < dof_tables.size(); i++) + for (auto dof_table : dof_tables) { indices_of_processes.emplace_back( - NumLib::getIndices(mesh_item_id, dof_tables[i].get())); + NumLib::getIndices(mesh_item_id, dof_table.get())); } auto const& indices = (cpl_xs == nullptr) diff --git a/Tests/AutoCheckTools.h b/Tests/AutoCheckTools.h index 1b121bf50c73fc43dac71c18c2e222e968847598..f28ebd5ab2ddeb8ff754c434591162257e9e3806 100644 --- a/Tests/AutoCheckTools.h +++ b/Tests/AutoCheckTools.h @@ -143,7 +143,8 @@ struct progressivelySmallerGenerator using result_type = T; - progressivelySmallerGenerator(T max_value = T{1}) : _max_value(max_value) + explicit progressivelySmallerGenerator(T max_value = T{1}) + : _max_value(max_value) { } diff --git a/Tests/BaseLib/TestFunctional.cpp b/Tests/BaseLib/TestFunctional.cpp index 015f37606fb7e8116b11bc742d117efe1e062ed7..afa519ac9963d8d43f1914bee63390527ce96bd3 100644 --- a/Tests/BaseLib/TestFunctional.cpp +++ b/Tests/BaseLib/TestFunctional.cpp @@ -16,7 +16,7 @@ class A : private InstanceCounter<A> { public: - A(const double value) : _value(value) {} + explicit A(const double value) : _value(value) {} A(A const& other) = default; A(A&& other) : InstanceCounter(std::move(other)), _value(other._value) {} A& operator=(A const& other) { _value = other._value; return *this; } diff --git a/Tests/FileIO_Qt/TestQtPrjInterface.cpp b/Tests/FileIO_Qt/TestQtPrjInterface.cpp index 813bdc4cd27a72659693fa9efe4db6833aa2a065..1ef972835c23f9b74e076b672dce2df7bde9e2d5 100644 --- a/Tests/FileIO_Qt/TestQtPrjInterface.cpp +++ b/Tests/FileIO_Qt/TestQtPrjInterface.cpp @@ -21,14 +21,14 @@ TEST(TestQtPrjInterface, QtXmlPrjReader) { - typedef struct + struct TestParams { std::string const file_name; std::size_t n_geo; std::size_t n_mesh; std::size_t n_bc; std::size_t n_st; - } TestParams; + }; std::vector<TestParams> test_files; @@ -40,21 +40,21 @@ TEST(TestQtPrjInterface, QtXmlPrjReader) "/Elliptic/nonuniform_bc_Groundwaterflow/neumann_nonuniform.prj"; test_files.push_back({name, 0, 3, 2, 0}); - for (std::size_t i = 0; i < test_files.size(); ++i) + for (auto& test_file : test_files) { DataHolderLib::Project project; FileIO::XmlPrjInterface xml(project); - int result = xml.readFile(test_files[i].file_name); + int result = xml.readFile(test_file.file_name); EXPECT_EQ(1, result); std::vector<std::string> geo_names; project.getGEOObjects().getGeometryNames(geo_names); - EXPECT_EQ(test_files[i].n_geo, geo_names.size()); - EXPECT_EQ(test_files[i].n_mesh, project.getMeshObjects().size()); + EXPECT_EQ(test_file.n_geo, geo_names.size()); + EXPECT_EQ(test_file.n_mesh, project.getMeshObjects().size()); std::vector<std::unique_ptr<DataHolderLib::BoundaryCondition>> const& bcs = project.getBoundaryConditions(); - EXPECT_EQ(test_files[i].n_bc, bcs.size()); + EXPECT_EQ(test_file.n_bc, bcs.size()); for (auto& bc : bcs) { EXPECT_FALSE(bc->getProcessVarName().empty()); @@ -71,7 +71,7 @@ TEST(TestQtPrjInterface, QtXmlPrjReader) std::vector<std::unique_ptr<DataHolderLib::SourceTerm>> const& sts = project.getSourceTerms(); - EXPECT_EQ(test_files[i].n_st, sts.size()); + EXPECT_EQ(test_file.n_st, sts.size()); for (auto& st : sts) { EXPECT_FALSE(st->getProcessVarName().empty()); diff --git a/Tests/GeoLib/AutoCheckGenerators.h b/Tests/GeoLib/AutoCheckGenerators.h index 627acf88c67476ef51d3e31990073139831e52c7..8d9d73f7681b6b7ca3a11022ffd1cc3551dcd691 100644 --- a/Tests/GeoLib/AutoCheckGenerators.h +++ b/Tests/GeoLib/AutoCheckGenerators.h @@ -25,8 +25,9 @@ namespace autocheck template <typename Gen = generator<double>> struct RandomCirclePointGeneratorXY { - RandomCirclePointGeneratorXY( - MathLib::Point3d const& c = MathLib::Point3d{std::array<double, 3>{{0, 0, 0}}}, + explicit RandomCirclePointGeneratorXY( + MathLib::Point3d const& c = MathLib::Point3d{std::array<double, 3>{ + {0, 0, 0}}}, double r = 1.0) : center(c), radius(r) {} diff --git a/Tests/GeoLib/TestPolygon.cpp b/Tests/GeoLib/TestPolygon.cpp index 8f14534b5eb3f6f6ab04f89be384a7919ca789ba..feedfc0009696a83ce25800111f58fba7e02b96e 100644 --- a/Tests/GeoLib/TestPolygon.cpp +++ b/Tests/GeoLib/TestPolygon.cpp @@ -35,8 +35,7 @@ class PolygonTest : public testing::Test { public: - PolygonTest() : - _polygon(nullptr) + PolygonTest() { // create points and construct polygon _pnts.push_back(new GeoLib::Point( 0.0, 0.0,0.0)); // 0 @@ -75,7 +74,7 @@ public: protected: std::vector<GeoLib::Point*> _pnts; - GeoLib::Polygon *_polygon; + GeoLib::Polygon* _polygon{nullptr}; }; TEST_F(PolygonTest, isPntInPolygonCheckCorners) diff --git a/Tests/GeoLib/TestSimplePolygonTree.cpp b/Tests/GeoLib/TestSimplePolygonTree.cpp index c631c8a3f3d249b9077528b2f281ff1b4659aa82..1278377dbdb7925f59912d14ebf02cb383cdf69c 100644 --- a/Tests/GeoLib/TestSimplePolygonTree.cpp +++ b/Tests/GeoLib/TestSimplePolygonTree.cpp @@ -40,8 +40,7 @@ class CreatePolygonTreesTest : public testing::Test { public: - CreatePolygonTreesTest() : - _p0(nullptr), _p1(nullptr), _p2(nullptr), _p3(nullptr) + CreatePolygonTreesTest() { // create points and construct polygon _pnts.push_back(new GeoLib::Point(0.0,-1.0,0.0)); @@ -100,10 +99,10 @@ public: protected: std::vector<GeoLib::Point*> _pnts; - GeoLib::Polygon *_p0; - GeoLib::Polygon *_p1; - GeoLib::Polygon *_p2; - GeoLib::Polygon *_p3; + GeoLib::Polygon* _p0{nullptr}; + GeoLib::Polygon* _p1{nullptr}; + GeoLib::Polygon* _p2{nullptr}; + GeoLib::Polygon* _p3{nullptr}; }; TEST_F(CreatePolygonTreesTest, P0AndP1) diff --git a/Tests/MaterialLib/TestMPLParseMaterial.cpp b/Tests/MaterialLib/TestMPLParseMaterial.cpp index ab25e27913678667b82709034eb93a8eb6554e57..8f2782bd777d20e657aca011127b82d19fdc6d37 100644 --- a/Tests/MaterialLib/TestMPLParseMaterial.cpp +++ b/Tests/MaterialLib/TestMPLParseMaterial.cpp @@ -35,7 +35,7 @@ struct Phase { std::vector<Component> component; std::vector<std::string> property; - Phase(std::size_t const componentNumber) + explicit Phase(std::size_t const componentNumber) : component(componentNumber), property(MPL::number_of_properties) { } @@ -47,12 +47,12 @@ struct Medium { std::vector<Phase> phases; std::vector<std::string> property; - Medium(std::vector<std::size_t> const& phases_) + explicit Medium(std::vector<std::size_t> const& phases_) : property(MPL::number_of_properties) { for (auto p : phases_) { - phases.push_back(Phase(p)); + phases.emplace_back(p); } } }; diff --git a/Tests/MathLib/TestGaussLegendreIntegration.cpp b/Tests/MathLib/TestGaussLegendreIntegration.cpp index aa74b68729751dce88ec5ba994b3a543de710cae..da34158d39b5ff2c4ca7eeaa6282255d784c10fe 100644 --- a/Tests/MathLib/TestGaussLegendreIntegration.cpp +++ b/Tests/MathLib/TestGaussLegendreIntegration.cpp @@ -168,7 +168,10 @@ private: } public: - FBase(std::size_t const num_coeffs) : coeffs(initCoeffs(num_coeffs)) {} + explicit FBase(std::size_t const num_coeffs) + : coeffs(initCoeffs(num_coeffs)) + { + } virtual double operator()( std::array<double, 3> const& /*coords*/) const = 0; @@ -247,7 +250,7 @@ struct FQuad final : FBase struct F3DSeparablePolynomial final : FBase { - F3DSeparablePolynomial(unsigned polynomial_degree) + explicit F3DSeparablePolynomial(unsigned polynomial_degree) : FBase(3 * polynomial_degree + 3), _degree(polynomial_degree) { } @@ -324,7 +327,7 @@ struct F3DNonseparablePolynomial final : FBase // The number of coefficients/monomials are obtained as follows: Compute the // number of combinations with repititions when drawing // polynomial_degree times from the set { x, y, z, 1 } - F3DNonseparablePolynomial(unsigned polynomial_degree) + explicit F3DNonseparablePolynomial(unsigned polynomial_degree) : FBase(binomial_coefficient(4 + polynomial_degree - 1, 4 - 1)), _degree(polynomial_degree) { diff --git a/Tests/MeshLib/MeshProperties.cpp b/Tests/MeshLib/MeshProperties.cpp index b23c5e27be5d87bcdbf2ebbfbe5d27ed046552e9..d65a7473defd62a55afeffa233dae7ba54c123b2 100644 --- a/Tests/MeshLib/MeshProperties.cpp +++ b/Tests/MeshLib/MeshProperties.cpp @@ -21,14 +21,13 @@ class MeshLibProperties : public ::testing::Test { public: MeshLibProperties() - : mesh(nullptr) { mesh = MeshLib::MeshGenerator::generateRegularHexMesh(1.0, mesh_size); } ~MeshLibProperties() override { delete mesh; } static std::size_t const mesh_size = 5; - MeshLib::Mesh * mesh; + MeshLib::Mesh* mesh{nullptr}; }; std::size_t const MeshLibProperties::mesh_size; diff --git a/Tests/MeshLib/TestBoundaryElementSearch.cpp b/Tests/MeshLib/TestBoundaryElementSearch.cpp index 801cbc2905caf8ec06f7055f90eac808a6051e7d..308d30587fcf7a4bb6122cc375a7ffdf7befbcd6 100644 --- a/Tests/MeshLib/TestBoundaryElementSearch.cpp +++ b/Tests/MeshLib/TestBoundaryElementSearch.cpp @@ -29,9 +29,9 @@ using namespace MeshLib; class MeshLibBoundaryElementSearchInSimpleQuadMesh : public testing::Test { public: - MeshLibBoundaryElementSearchInSimpleQuadMesh() : - _geometric_size(10.0), _number_of_subdivisions_per_direction(10), - _quad_mesh(MeshGenerator::generateRegularQuadMesh(_geometric_size, _number_of_subdivisions_per_direction)) + MeshLibBoundaryElementSearchInSimpleQuadMesh() + : _quad_mesh(MeshGenerator::generateRegularQuadMesh( + _geometric_size, _number_of_subdivisions_per_direction)) {} ~MeshLibBoundaryElementSearchInSimpleQuadMesh() override @@ -43,8 +43,8 @@ public: } protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{10}; std::unique_ptr<Mesh> _quad_mesh; std::vector<GeoLib::Point*> _pnts; }; @@ -52,9 +52,9 @@ protected: class MeshLibBoundaryElementSearchInSimpleHexMesh : public testing::Test { public: - MeshLibBoundaryElementSearchInSimpleHexMesh() : - _geometric_size(10.0), _number_of_subdivisions_per_direction(10), - _hex_mesh(MeshGenerator::generateRegularHexMesh(_geometric_size, _number_of_subdivisions_per_direction)) + MeshLibBoundaryElementSearchInSimpleHexMesh() + : _hex_mesh(MeshGenerator::generateRegularHexMesh( + _geometric_size, _number_of_subdivisions_per_direction)) { // Points for the surfaces. Corners of a cube. _pnts.push_back(new GeoLib::Point(0.0, 0.0, 0.0)); @@ -81,8 +81,8 @@ public: std::size_t const n_eles_2d) const; protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{10}; std::unique_ptr<Mesh> _hex_mesh; std::vector<GeoLib::Point*> _pnts; }; diff --git a/Tests/MeshLib/TestLineMesh.cpp b/Tests/MeshLib/TestLineMesh.cpp index e9e08e82c314fb0f40ded399a8e86c221a4a54ff..af961ae81ccf73e744fdca2fd13df8f06268f83b 100644 --- a/Tests/MeshLib/TestLineMesh.cpp +++ b/Tests/MeshLib/TestLineMesh.cpp @@ -17,7 +17,6 @@ class MeshLibLineMesh : public ::testing::Test { public: MeshLibLineMesh() - : mesh(nullptr) { mesh = MeshLib::MeshGenerator::generateLineMesh(extent, mesh_size); } @@ -25,7 +24,7 @@ class MeshLibLineMesh : public ::testing::Test ~MeshLibLineMesh() override { delete mesh; } static std::size_t const mesh_size = 9; double extent = 1.0; - MeshLib::Mesh const* mesh; + MeshLib::Mesh const* mesh{nullptr}; }; std::size_t const MeshLibLineMesh::mesh_size; diff --git a/Tests/MeshLib/TestMeshNodeSearch.cpp b/Tests/MeshLib/TestMeshNodeSearch.cpp index 83a116f98c96cec1c13b54ce1ffb17f4e7ae77be..d21d6022a4caf6fb013efd675431374ec15592bc 100644 --- a/Tests/MeshLib/TestMeshNodeSearch.cpp +++ b/Tests/MeshLib/TestMeshNodeSearch.cpp @@ -29,32 +29,32 @@ using namespace MeshLib; class MeshLibMeshNodeSearchInSimpleQuadMesh : public testing::Test { public: - MeshLibMeshNodeSearchInSimpleQuadMesh() : - _geometric_size(10.0), _number_of_subdivisions_per_direction(99), - _quad_mesh(MeshGenerator::generateRegularQuadMesh(_geometric_size, _number_of_subdivisions_per_direction)) + MeshLibMeshNodeSearchInSimpleQuadMesh() + : _quad_mesh(MeshGenerator::generateRegularQuadMesh( + _geometric_size, _number_of_subdivisions_per_direction)) {} ~MeshLibMeshNodeSearchInSimpleQuadMesh() override { delete _quad_mesh; } protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{99}; Mesh* _quad_mesh; }; class MeshLibMeshNodeSearchInSimpleHexMesh : public testing::Test { public: - MeshLibMeshNodeSearchInSimpleHexMesh() : - _geometric_size(10.0), _number_of_subdivisions_per_direction(10), - _hex_mesh(MeshGenerator::generateRegularHexMesh(_geometric_size, _number_of_subdivisions_per_direction)) + MeshLibMeshNodeSearchInSimpleHexMesh() + : _hex_mesh(MeshGenerator::generateRegularHexMesh( + _geometric_size, _number_of_subdivisions_per_direction)) {} ~MeshLibMeshNodeSearchInSimpleHexMesh() override { delete _hex_mesh; } protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{10}; Mesh* _hex_mesh; }; diff --git a/Tests/MeshLib/TestQuadMesh.cpp b/Tests/MeshLib/TestQuadMesh.cpp index 357df5b6c9b811dff662b837e41177dc41cf86d3..5af61fc3bcbddb82908a3bb4a18d07765da33a1c 100644 --- a/Tests/MeshLib/TestQuadMesh.cpp +++ b/Tests/MeshLib/TestQuadMesh.cpp @@ -18,7 +18,6 @@ class MeshLibQuadMesh : public ::testing::Test { public: MeshLibQuadMesh() - : mesh(nullptr) { mesh = MeshLib::MeshGenerator::generateRegularQuadMesh(1.0, n_elements); } @@ -29,9 +28,9 @@ class MeshLibQuadMesh : public ::testing::Test static std::size_t const elements_stride = n_elements - 1; static std::size_t const nodes_stride = n_nodes - 1; - MeshLib::Mesh const* mesh; + MeshLib::Mesh const* mesh{nullptr}; - public: +public: // Helper functions to access elements and nodes. MeshLib::Element* getElement(std::size_t const i, std::size_t const j) diff --git a/Tests/MeshLib/TestRasterToMesh.cpp b/Tests/MeshLib/TestRasterToMesh.cpp index 376530b3a78ab142bd8f1cce643f3f71746e318b..874a715f49b7a63a5c5a49700138a219751dbd03 100644 --- a/Tests/MeshLib/TestRasterToMesh.cpp +++ b/Tests/MeshLib/TestRasterToMesh.cpp @@ -40,7 +40,7 @@ public: _raster.reset(FileIO::AsciiRasterInterface::readRaster(_file_name)); } - ~RasterToMeshTest() { std::remove(_mesh_name.c_str()); } + ~RasterToMeshTest() override { std::remove(_mesh_name.c_str()); } protected: std::size_t const _n_pix = 542; diff --git a/Tests/MeshLib/TestTriLineMesh.cpp b/Tests/MeshLib/TestTriLineMesh.cpp index 547835cea346c5c88c86417ac160868f08de5d2b..38e92fbb0c9b90fe27d1621d712eef65af4dd93f 100644 --- a/Tests/MeshLib/TestTriLineMesh.cpp +++ b/Tests/MeshLib/TestTriLineMesh.cpp @@ -19,7 +19,6 @@ class MeshLibTriLineMesh : public ::testing::Test { public: MeshLibTriLineMesh() - : mesh(nullptr) { nodes.push_back(new MeshLib::Node(0, 0, 0)); nodes.push_back(new MeshLib::Node(1, 0, 0)); @@ -55,7 +54,7 @@ class MeshLibTriLineMesh : public ::testing::Test delete mesh; } - MeshLib::Mesh const* mesh; + MeshLib::Mesh const* mesh{nullptr}; std::vector<MeshLib::Node*> nodes; std::vector<MeshLib::Element*> elements; diff --git a/Tests/MeshLib/TestVtkMappedMeshSource.cpp b/Tests/MeshLib/TestVtkMappedMeshSource.cpp index bde8caac0460b16bbbce316de5606add2570941e..8974fb035a9f5837ef5569cdbf7bda89ad712b26 100644 --- a/Tests/MeshLib/TestVtkMappedMeshSource.cpp +++ b/Tests/MeshLib/TestVtkMappedMeshSource.cpp @@ -40,7 +40,6 @@ class InSituMesh : public ::testing::Test { public: InSituMesh() - : mesh(nullptr) { mesh = MeshLib::MeshGenerator::generateRegularHexMesh( this->length, this->subdivisions); @@ -129,7 +128,7 @@ class InSituMesh : public ::testing::Test } ~InSituMesh() override { delete mesh; } - MeshLib::Mesh * mesh; + MeshLib::Mesh* mesh{nullptr}; const std::size_t subdivisions = 5; const double length = 1.0; const double dx = length / subdivisions; diff --git a/Tests/NumLib/NaturalNodeCoordinates.cpp b/Tests/NumLib/NaturalNodeCoordinates.cpp index 6e4a61f849f7b93da4517e91d7781539a4ba22f1..a992fc0550cd47e339baf2da61936328222d32ed 100644 --- a/Tests/NumLib/NaturalNodeCoordinates.cpp +++ b/Tests/NumLib/NaturalNodeCoordinates.cpp @@ -19,6 +19,8 @@ #include "NumLib/Fem/Integration/GaussLegendreIntegrationPolicy.h" #include "NumLib/Fem/ShapeMatrixPolicy.h" +using Node = MeshLib::Node; + template <typename ShapeFunction, int GlobalDim> bool test(MeshLib::Element const& element) { @@ -89,9 +91,8 @@ TEST(NumLibNaturalCoordinates, Line2) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{{xs[0], xs[1]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ - {&ns[0], &ns[1]}}; + std::array<Node, MeshElement::n_all_nodes> ns{{Node{xs[0]}, Node{xs[1]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{{&ns[0], &ns[1]}}; MeshElement element(nodes); bool const test_result1 = test<ShapeFunction, 1>(element); @@ -110,10 +111,9 @@ TEST(NumLibNaturalCoordinates, Line3) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ - {&ns[0], &ns[1], &ns[2]}}; + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{{&ns[0], &ns[1], &ns[2]}}; MeshElement element(nodes); bool const test_result1 = test<ShapeFunction, 1>(element); @@ -132,10 +132,9 @@ TEST(NumLibNaturalCoordinates, Tri3) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ - {&ns[0], &ns[1], &ns[2]}}; + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{{&ns[0], &ns[1], &ns[2]}}; MeshElement element(nodes); bool const test_result2 = test<ShapeFunction, 2>(element); @@ -151,9 +150,10 @@ TEST(NumLibNaturalCoordinates, Tri6) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{{Node{xs[0]}, Node{xs[1]}, + Node{xs[2]}, Node{xs[3]}, + Node{xs[4]}, Node{xs[5]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5]}}; MeshElement element(nodes); @@ -170,9 +170,9 @@ TEST(NumLibNaturalCoordinates, Quad4) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3]}}; MeshElement element(nodes); @@ -189,9 +189,10 @@ TEST(NumLibNaturalCoordinates, Quad8) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7]}}; MeshElement element(nodes); @@ -208,11 +209,12 @@ TEST(NumLibNaturalCoordinates, Quad9) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7], xs[8]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ - {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7], - &ns[8]}}; + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}, Node{xs[8]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{{&ns[0], &ns[1], &ns[2], + &ns[3], &ns[4], &ns[5], + &ns[6], &ns[7], &ns[8]}}; MeshElement element(nodes); bool const test_result2 = test<ShapeFunction, 2>(element); @@ -228,9 +230,9 @@ TEST(NumLibNaturalCoordinates, Tet4) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3]}}; MeshElement element(nodes); @@ -244,9 +246,10 @@ TEST(NumLibNaturalCoordinates, Tet10) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7], xs[8], xs[9]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}, Node{xs[8]}, Node{xs[9]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7], &ns[8], &ns[9]}}; MeshElement element(nodes); @@ -261,9 +264,10 @@ TEST(NumLibNaturalCoordinates, Prism6) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{{Node{xs[0]}, Node{xs[1]}, + Node{xs[2]}, Node{xs[3]}, + Node{xs[4]}, Node{xs[5]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5]}}; MeshElement element(nodes); @@ -277,10 +281,11 @@ TEST(NumLibNaturalCoordinates, Prism15) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7], xs[8], xs[9], - xs[10], xs[11], xs[12], xs[13], xs[14]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}, Node{xs[8]}, Node{xs[9]}, + Node{xs[10]}, Node{xs[11]}, Node{xs[12]}, Node{xs[13]}, Node{xs[14]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7], &ns[8], &ns[9], &ns[10], &ns[11], &ns[12], &ns[13], &ns[14]}}; MeshElement element(nodes); @@ -295,9 +300,9 @@ TEST(NumLibNaturalCoordinates, Pyramid5) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4]}}; MeshElement element(nodes); @@ -311,11 +316,12 @@ TEST(NumLibNaturalCoordinates, Pyramid13) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7], xs[8], xs[9], - xs[10], xs[11], xs[12]}}; + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}, Node{xs[8]}, Node{xs[9]}, + Node{xs[10]}, Node{xs[11]}, Node{xs[12]}}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7], &ns[8], &ns[9], &ns[10], &ns[11], &ns[12]}}; MeshElement element(nodes); @@ -330,9 +336,10 @@ TEST(NumLibNaturalCoordinates, Hex8) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], xs[7]}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}}}; + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7]}}; MeshElement element(nodes); @@ -346,12 +353,13 @@ TEST(NumLibNaturalCoordinates, Hex20) using MeshElement = ShapeFunction::MeshElement; auto const& xs = NumLib::NaturalCoordinates<MeshElement>::coordinates; - std::array<MeshLib::Node, MeshElement::n_all_nodes> ns{ - {xs[0], xs[1], xs[2], xs[3], xs[4], xs[5], xs[6], - xs[7], xs[8], xs[9], xs[10], xs[11], xs[12], xs[13], - xs[14], xs[15], xs[16], xs[17], xs[18], xs[19]}}; + std::array<Node, MeshElement::n_all_nodes> ns{ + {Node{xs[0]}, Node{xs[1]}, Node{xs[2]}, Node{xs[3]}, Node{xs[4]}, + Node{xs[5]}, Node{xs[6]}, Node{xs[7]}, Node{xs[8]}, Node{xs[9]}, + Node{xs[10]}, Node{xs[11]}, Node{xs[12]}, Node{xs[13]}, Node{xs[14]}, + Node{xs[15]}, Node{xs[16]}, Node{xs[17]}, Node{xs[18]}, Node{xs[19]}}}; - std::array<MeshLib::Node*, MeshElement::n_all_nodes> nodes{ + std::array<Node*, MeshElement::n_all_nodes> nodes{ {&ns[0], &ns[1], &ns[2], &ns[3], &ns[4], &ns[5], &ns[6], &ns[7], &ns[8], &ns[9], &ns[10], &ns[11], &ns[12], &ns[13], &ns[14], &ns[15], &ns[16], &ns[17], &ns[18], &ns[19]}}; diff --git a/Tests/NumLib/TestDistribution.cpp b/Tests/NumLib/TestDistribution.cpp index 9a2405fb31f19ff64c18cd285d6fd984d23a3482..5afc6b503a37da0a377a37aca5f80703f881454e 100644 --- a/Tests/NumLib/TestDistribution.cpp +++ b/Tests/NumLib/TestDistribution.cpp @@ -30,15 +30,12 @@ class NumLibDistributionQuad : public testing::Test { public: NumLibDistributionQuad() - : _geometric_size(10.0), - _number_of_subdivisions_per_direction(10), - _msh(MeshLib::MeshGenerator::generateRegularQuadMesh( + : _msh(MeshLib::MeshGenerator::generateRegularQuadMesh( _geometric_size, _number_of_subdivisions_per_direction)), _project_name("test"), _mshNodesSearcher(*_msh, std::make_unique<MeshGeoToolsLib::SearchLength>(), - MeshGeoToolsLib::SearchAllNodes::Yes), - _ply0(nullptr) + MeshGeoToolsLib::SearchAllNodes::Yes) { // create geometry auto pnts = std::make_unique<std::vector<GeoLib::Point*>>(); @@ -73,13 +70,13 @@ public: } protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{10}; std::unique_ptr<MeshLib::Mesh> _msh; GeoLib::GEOObjects _geo_objs; std::string _project_name; MeshGeoToolsLib::MeshNodeSearcher _mshNodesSearcher; - GeoLib::Polyline* _ply0; + GeoLib::Polyline* _ply0{nullptr}; GeoLib::Surface* _sfc1; }; @@ -87,15 +84,12 @@ class NumLibDistributionHex : public testing::Test { public: NumLibDistributionHex() - : _geometric_size(10.0), - _number_of_subdivisions_per_direction(10), - _msh(MeshLib::MeshGenerator::generateRegularHexMesh( + : _msh(MeshLib::MeshGenerator::generateRegularHexMesh( _geometric_size, _number_of_subdivisions_per_direction)), _project_name("test"), _mshNodesSearcher(*_msh, std::make_unique<MeshGeoToolsLib::SearchLength>(), - MeshGeoToolsLib::SearchAllNodes::Yes), - _ply0(nullptr) + MeshGeoToolsLib::SearchAllNodes::Yes) { // create geometry auto pnts = std::make_unique<std::vector<GeoLib::Point*>>(); @@ -133,13 +127,13 @@ public: } protected: - const double _geometric_size; - const std::size_t _number_of_subdivisions_per_direction; + const double _geometric_size{10.0}; + const std::size_t _number_of_subdivisions_per_direction{10}; std::unique_ptr<MeshLib::Mesh> _msh; GeoLib::GEOObjects _geo_objs; std::string _project_name; MeshGeoToolsLib::MeshNodeSearcher _mshNodesSearcher; - GeoLib::Polyline* _ply0; + GeoLib::Polyline* _ply0{nullptr}; GeoLib::Surface* _sfc1; }; diff --git a/Tests/NumLib/TestMeshComponentMap.cpp b/Tests/NumLib/TestMeshComponentMap.cpp index 3fdcd6f7a741e7b97b2d696c74e3cf9a326e6b1c..2f0bce137526409cc55e01892fd675589900df92 100644 --- a/Tests/NumLib/TestMeshComponentMap.cpp +++ b/Tests/NumLib/TestMeshComponentMap.cpp @@ -27,9 +27,8 @@ class NumLibMeshComponentMapTest : public ::testing::Test using MeshComponentMap = NumLib::MeshComponentMap; public: - NumLibMeshComponentMapTest() : mesh(nullptr), cmap(nullptr) + NumLibMeshComponentMapTest() { - mesh = MeshLib::MeshGenerator::generateLineMesh(1.0, mesh_size); MeshLib::MeshSubset nodesSubset{*mesh, mesh->getNodes()}; // Add two components both based on the same nodesSubset. @@ -40,17 +39,17 @@ class NumLibMeshComponentMapTest : public ::testing::Test ~NumLibMeshComponentMapTest() override { delete cmap; - delete mesh; } static std::size_t const mesh_size = 9; - MeshLib::Mesh const* mesh; + std::unique_ptr<MeshLib::Mesh> const mesh{ + MeshLib::MeshGenerator::generateLineMesh(1.0, mesh_size)}; //data component 0 and 1 are assigned to all nodes in the mesh static std::size_t const comp0_id = 0; static std::size_t const comp1_id = 1; std::vector<MeshLib::MeshSubset> components; - MeshComponentMap const* cmap; + MeshComponentMap const* cmap{nullptr}; // // Functions used for checking. diff --git a/Tests/NumLib/TestNamedFunction.cpp b/Tests/NumLib/TestNamedFunction.cpp index 481e23aa886fbd8d02c10730d276825ebb637772..2fd5a402b9bfb52b41cfaa174c395b64e1a2bd5d 100644 --- a/Tests/NumLib/TestNamedFunction.cpp +++ b/Tests/NumLib/TestNamedFunction.cpp @@ -48,7 +48,7 @@ public: class H : public InstanceCounter<H> { public: - H(double const z) : _z(z) {} + explicit H(double const z) : _z(z) {} double h(double arg_x, double arg_y) { return arg_x * arg_y - _z; } double setZ(double const z) {