diff --git a/NumLib/DOF/LocalToGlobalIndexMap.cpp b/NumLib/DOF/LocalToGlobalIndexMap.cpp index 92456d96a6a09c5d4d9251c1ed381a9ae2cfc293..5c892d56c4b09e6efcf6a09567af0cf6ea86486b 100644 --- a/NumLib/DOF/LocalToGlobalIndexMap.cpp +++ b/NumLib/DOF/LocalToGlobalIndexMap.cpp @@ -304,11 +304,11 @@ LocalToGlobalIndexMap::getNumberOfElementComponents(std::size_t const mesh_item_ return n; } -std::vector<std::size_t> -LocalToGlobalIndexMap::getElementVariableIDs(std::size_t const mesh_item_id) const +std::vector<int> LocalToGlobalIndexMap::getElementVariableIDs( + std::size_t const mesh_item_id) const { - std::vector<std::size_t> vec; - for (unsigned i=0; i<getNumberOfVariables(); i++) + std::vector<int> vec; + for (int i = 0; i < getNumberOfVariables(); i++) { for (int j=0; j<getNumberOfVariableComponents(i); j++) { diff --git a/NumLib/DOF/LocalToGlobalIndexMap.h b/NumLib/DOF/LocalToGlobalIndexMap.h index 0784de22416daf4d7e13ff471846a561943d753d..c40a4d08dd35210a91900bf85344b92cb5a871ef 100644 --- a/NumLib/DOF/LocalToGlobalIndexMap.h +++ b/NumLib/DOF/LocalToGlobalIndexMap.h @@ -103,7 +103,10 @@ public: std::size_t size() const; - std::size_t getNumberOfVariables() const { return (_variable_component_offsets.size() - 1); } + int getNumberOfVariables() const + { + return static_cast<int>(_variable_component_offsets.size()) - 1; + } int getNumberOfVariableComponents(int variable_id) const { @@ -119,7 +122,8 @@ public: std::size_t getNumberOfElementComponents(std::size_t const mesh_item_id) const; - std::vector<std::size_t> getElementVariableIDs(std::size_t const mesh_item_id) const; + std::vector<int> getElementVariableIDs( + std::size_t const mesh_item_id) const; GlobalIndexType getGlobalIndex(MeshLib::Location const& l, int const variable_id, diff --git a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h index 0b68a86c9c500c89562beb5f5055dc7dbe2cfa67..0082088412ced699d1421ad08a652b82465a1059 100644 --- a/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h @@ -199,7 +199,7 @@ public: type_idx.name()); auto const n_local_dof = _dof_table.getNumberOfElementDOF(id); - const std::vector<std::size_t> varIDs(_dof_table.getElementVariableIDs(id)); + auto const varIDs = _dof_table.getElementVariableIDs(id); bool const isPressureDeactivated = (varIDs.front()!=0); std::vector<int> involved_varIDs; // including deactived elements involved_varIDs.reserve(varIDs.size()+1); @@ -215,7 +215,7 @@ public: //TODO how to get the shape function order for each variable? vec_n_element_nodes.push_back(mesh_item.getNumberOfBaseNodes()); // pressure auto const max_varID = *std::max_element(varIDs.begin(), varIDs.end()); - for (unsigned i=1; i<max_varID+1; i++) + for (int i = 1; i < max_varID + 1; i++) vec_n_element_nodes.push_back(mesh_item.getNumberOfNodes()); // displacements unsigned local_id = 0; diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h index 2f0ad662cf7bf4ac75e7ca8236105e4b6e2ef9d4..55bd3fc08757dc06f473f623596f1e6ef3b75878 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h @@ -249,8 +249,7 @@ public: auto const n_local_dof = _dof_table.getNumberOfElementDOF(id); auto const n_global_components = _dof_table.getNumberOfElementComponents(id); - const std::vector<std::size_t> varIDs( - _dof_table.getElementVariableIDs(id)); + const std::vector<int> varIDs(_dof_table.getElementVariableIDs(id)); std::vector<unsigned> dofIndex_to_localIndex; if (mesh_item.getDimension() < GlobalDim ||