diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp index 818d881aa783a0d60e69e4f88965c5cb568641cb..8a59a9bacf1711f87c7b0a38ecbb521316e43155 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp @@ -71,7 +71,7 @@ void VtkColorLookupTable::Build() double val = (it->first < range[0]) ? range[0] : ((it->first > range[1]) ? range[1] : it->first); nextIndex = static_cast<std::size_t>( std::floor(val-range[0]) ); - this->SetTableValue(nextIndex, it->second); + this->SetTableValueRGBA(nextIndex, it->second); if ( nextIndex - lastValue.first > 0 ) for (std::size_t i = lastValue.first + 1; i < nextIndex; i++) @@ -89,7 +89,7 @@ void VtkColorLookupTable::Build() for (std::size_t j = 0; j < 4; j++) int_rgba[j] = (lastValue.second)[j]; - this->SetTableValue(i, int_rgba); + this->SetTableValueRGBA(i, int_rgba); } lastValue.first = nextIndex; @@ -119,7 +119,7 @@ void VtkColorLookupTable::writeToFile(const std::string &filename) out.close(); } -void VtkColorLookupTable::SetTableValue(vtkIdType idx, unsigned char rgba[4]) +void VtkColorLookupTable::SetTableValueRGBA(vtkIdType idx, unsigned char rgba[4]) { double value[4]; diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h index ebbfc9a8350e65815a5b1194f6ad637024e02671..adf56d829b3fac3131fe7fb1d6a91bec710f0ed0 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.h @@ -76,7 +76,7 @@ public: void writeToFile(const std::string &filename); /// Set a value within the LUT - void SetTableValue(vtkIdType idx, unsigned char rgba[4]); + void SetTableValueRGBA(vtkIdType idx, unsigned char rgba[4]); /// Get a value from the LUT void GetTableValue(vtkIdType idx, unsigned char rgba[4]); diff --git a/InSituLib/VtkMappedMeshSource.cpp b/InSituLib/VtkMappedMeshSource.cpp index e04fa66d4df77f0e6c832a91754d9a48d6e9cb41..7ded70e975837b7277e597c709aab3ba8508e137 100644 --- a/InSituLib/VtkMappedMeshSource.cpp +++ b/InSituLib/VtkMappedMeshSource.cpp @@ -93,17 +93,10 @@ int VtkMappedMeshSource::RequestData(vtkInformation *, for(std::vector<std::string>::const_iterator name = propertyNames.cbegin(); name != propertyNames.cend(); ++name) { - if (addProperty<double>(*output, properties, *name)) - continue; - - if (addProperty<int>(*output, properties, *name)) - continue; - - if (addProperty<unsigned>(*output, properties, *name)) - continue; - - if (addProperty<char>(*output, properties, *name)) - continue; + if (addProperty<double>(properties, *name)) continue; + if (addProperty<int>(properties, *name)) continue; + if (addProperty<unsigned>(properties, *name)) continue; + if (addProperty<char>(properties, *name)) continue; DBUG ("Mesh property \"%s\" with unknown data type.", *name->c_str()); } diff --git a/InSituLib/VtkMappedMeshSource.h b/InSituLib/VtkMappedMeshSource.h index ba71e89744987b871253f797f45429bcb2bd7a5d..b661791b938b4c4950fc15c6b5936937b4190ea1 100644 --- a/InSituLib/VtkMappedMeshSource.h +++ b/InSituLib/VtkMappedMeshSource.h @@ -84,9 +84,9 @@ private: /// \param properties MeshLib::Properties object /// \param prop_name The name of the property vector to be mapped from /// vtk-mesh to ogs-mesh - template<typename T> bool addProperty(vtkUnstructuredGrid &output, - MeshLib::Properties const& properties, - std::string const& prop_name) const + template <typename T> + bool addProperty(MeshLib::Properties const& properties, + std::string const& prop_name) const { boost::optional<MeshLib::PropertyVector<T> const &> propertyVector( properties.getPropertyVector<T>(prop_name)); diff --git a/MathLib/LinAlg/Sparse/CRSMatrix.h b/MathLib/LinAlg/Sparse/CRSMatrix.h index ba04ec303b94e5895e54e6229531ba7f544a33ac..8cc6abb25765a2267013501c213727bf4fc9944b 100644 --- a/MathLib/LinAlg/Sparse/CRSMatrix.h +++ b/MathLib/LinAlg/Sparse/CRSMatrix.h @@ -98,7 +98,9 @@ public: delete [] _data; } - virtual void amux(FP_TYPE d, FP_TYPE const * const __restrict__ x, FP_TYPE * __restrict__ y) const + virtual void amux(FP_TYPE const d, + FP_TYPE const* const __restrict__ x, + FP_TYPE* __restrict__ y) const { amuxCRS<FP_TYPE, IDX_TYPE>(d, this->getNRows(), _row_ptr, _col_idx, _data, x, y); } diff --git a/MathLib/LinAlg/Sparse/CRSTools-impl.h b/MathLib/LinAlg/Sparse/CRSTools-impl.h index 717b7366ec7f883ca866eeaeafcbc91c9e01d260..4d237723271505d7db2fb3749d7961b12bf95254 100644 --- a/MathLib/LinAlg/Sparse/CRSTools-impl.h +++ b/MathLib/LinAlg/Sparse/CRSTools-impl.h @@ -55,7 +55,8 @@ void applyKnownSolution(CRSMatrix<FP_TYPE, typename VEC_T::IndexType>*& mat, // set row entries, except the diagonal entry, to zero for (std::size_t r(0); r<rows.size(); ++r) { auto const row = rows[r]; - for (unsigned j(iA[row]); j<iA[row+1]; ++j) { + for (typename VEC_T::IndexType j = iA[row]; j < iA[row + 1]; ++j) + { if (jA[j] == row) { entries[j] = 1.0; // A(row,row) = 1.0 // rhs[row] = A(row,row) * vals[r] diff --git a/MeshLib/ElementStatus.cpp b/MeshLib/ElementStatus.cpp index a825faf7d57a6872e2038eea39623a8c7c1bcc7c..bd10860e5d52584e0a10cf9d764d4c1de59e12aa 100644 --- a/MeshLib/ElementStatus.cpp +++ b/MeshLib/ElementStatus.cpp @@ -31,7 +31,7 @@ ElementStatus::ElementStatus(Mesh const* const mesh, bool hasAnyInactive) } ElementStatus::ElementStatus(Mesh const* const mesh, - std::vector<unsigned> const& vec_inactive_matIDs) + std::vector<int> const& vec_inactive_matIDs) : ElementStatus(mesh, !vec_inactive_matIDs.empty()) { auto materialIds = mesh->getProperties().getPropertyVector<int>("MaterialIDs"); diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h index c3c196c584766b3951ab7989250d3812e184f240..43567ffb2b7f96e37869666ba5a537385e519043 100644 --- a/MeshLib/ElementStatus.h +++ b/MeshLib/ElementStatus.h @@ -31,7 +31,8 @@ public: bool hasAnyInactive = false); /// Constructor taking a vector of inactive material IDs - ElementStatus(MeshLib::Mesh const*const mesh, std::vector<unsigned> const& vec_inactive_matIDs); + ElementStatus(MeshLib::Mesh const* const mesh, + std::vector<int> const& vec_inactive_matIDs); /// Returns a vector of active element IDs std::vector<MeshLib::Element*> const& getActiveElements() const; diff --git a/Tests/AssemblerLib/LocalToGlobalIndexMapMultiComponent.cpp b/Tests/AssemblerLib/LocalToGlobalIndexMapMultiComponent.cpp index 832533be5e7fb3483038602d86d7d12f8257f5d8..b9c087af88e8fd0dfe248ebf5a0bde183c234c31 100644 --- a/Tests/AssemblerLib/LocalToGlobalIndexMapMultiComponent.cpp +++ b/Tests/AssemblerLib/LocalToGlobalIndexMapMultiComponent.cpp @@ -262,7 +262,7 @@ TEST_F(AssemblerLibLocalToGlobalIndexMapMultiDOFTest, Test1Comp) TEST_F(AssemblerLibLocalToGlobalIndexMapMultiDOFTest, TestMultiCompByComponent) { unsigned const num_components = 5; - for (auto c = 0; c < num_components; ++c) + for (unsigned c = 0; c < num_components; ++c) test<AL::ComponentOrder::BY_COMPONENT>( num_components, c, ComputeGlobalIndexByComponent{ (mesh_subdivs + 1) * (mesh_subdivs + 1)}); @@ -271,7 +271,7 @@ TEST_F(AssemblerLibLocalToGlobalIndexMapMultiDOFTest, TestMultiCompByComponent) TEST_F(AssemblerLibLocalToGlobalIndexMapMultiDOFTest, TestMultiCompByLocation) { unsigned const num_components = 5; - for (auto c = 0; c < num_components; ++c) + for (unsigned c = 0; c < num_components; ++c) test<AL::ComponentOrder::BY_LOCATION>( num_components, c, ComputeGlobalIndexByLocation{num_components}); } diff --git a/Tests/MeshLib/TestElementStatus.cpp b/Tests/MeshLib/TestElementStatus.cpp index 06dbfc0cdc29d2cbdccd835ca42d6af0d5dd90f2..5987ec55b00c625f45e34127d9322a082efb3e6f 100644 --- a/Tests/MeshLib/TestElementStatus.cpp +++ b/Tests/MeshLib/TestElementStatus.cpp @@ -53,14 +53,14 @@ TEST(MeshLib, ElementStatus) { // set material 1 to false - std::vector<unsigned> inactiveMat{1}; + std::vector<int> inactiveMat{1}; MeshLib::ElementStatus status(mesh.get(), inactiveMat); ASSERT_EQ (elements.size()-elements_per_side, status.getNActiveElements()); } { // set material 0 and 1 to false - std::vector<unsigned> inactiveMat{0, 1}; + std::vector<int> inactiveMat{0, 1}; MeshLib::ElementStatus status(mesh.get(), inactiveMat); ASSERT_EQ (elements.size()-(2*elements_per_side), status.getNActiveElements()); diff --git a/Tests/NumLib/TestFunctionInterpolation.cpp b/Tests/NumLib/TestFunctionInterpolation.cpp index 1792946cde20fd5cf9bec3f779d077cc1946b923..1dea2a529e042149b0b40d4ebbc7dfd7c48bf068 100644 --- a/Tests/NumLib/TestFunctionInterpolation.cpp +++ b/Tests/NumLib/TestFunctionInterpolation.cpp @@ -26,14 +26,14 @@ TEST(NumLibFunctionInterpolationTest, TwoVariablesTwoNodes) { double variable1 = 0.0; double variable2 = 0.0; - std::array<double*, 2> interpolated_values = { &variable1, &variable2 }; + std::array<double*, 2> interpolated_values = {{&variable1, &variable2}}; - const std::array<double, 4> nodal_values = { - 0.0, 1.0, // for variable1 + const std::array<double, 4> nodal_values = {{ + 0.0, 1.0, // for variable1 -1.0, 1.0 // for variable2 - }; + }}; - const std::array<double, 2> shape_matrix = { 0.25, 0.75 }; + const std::array<double, 2> shape_matrix = {{0.25, 0.75}}; NumLib::shapeFunctionInterpolate(nodal_values, shape_matrix, interpolated_values); @@ -55,10 +55,11 @@ TEST(NumLibFunctionInterpolationTest, Linear1DElement) ShapeFunction::MeshElement>::IntegrationMethod; // set up mesh element - auto pt_a = MeshLib::Node({ 0.0, 0.0, 0.0 }, 0); - auto pt_b = MeshLib::Node({ 1.0, 0.0, 0.0 }, 0); + auto pt_a = MeshLib::Node({{0.0, 0.0, 0.0}}, 0); + auto pt_b = MeshLib::Node({{1.0, 0.0, 0.0}}, 0); - auto const element = MeshLib::Line(std::array<MeshLib::Node*, 2>{&pt_a, &pt_b}); + auto const element = + MeshLib::Line(std::array<MeshLib::Node*, 2>{{&pt_a, &pt_b}}); // set up shape function FemType finite_element(*static_cast<const ShapeFunction::MeshElement*>(&element)); @@ -76,12 +77,12 @@ TEST(NumLibFunctionInterpolationTest, Linear1DElement) // actual test double variable1 = 0.0; double variable2 = 0.0; - std::array<double*, 2> interpolated_values = { &variable1, &variable2 }; + std::array<double*, 2> interpolated_values = {{&variable1, &variable2}}; - const std::array<double, 4> nodal_values = { - 0.0, 1.0, // for variable1 + const std::array<double, 4> nodal_values = {{ + 0.0, 1.0, // for variable1 -1.0, 1.0 // for variable2 - }; + }}; NumLib::shapeFunctionInterpolate(nodal_values, shape_matrix.N, interpolated_values);