From f075e5ea370431d768fcd62ffece3f5011dba201 Mon Sep 17 00:00:00 2001
From: acrovato <a.crovato@uliege.be>
Date: Fri, 13 Jan 2023 09:56:45 +0100
Subject: [PATCH] Fix compilation linux

---
 sdpm/src/sdpmBuilder.cpp    | 2 +-
 sdpm/src/sdpmGmshImport.cpp | 4 ++--
 sdpm/src/sdpmMesh.h         | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sdpm/src/sdpmBuilder.cpp b/sdpm/src/sdpmBuilder.cpp
index 709718f..367ee52 100644
--- a/sdpm/src/sdpmBuilder.cpp
+++ b/sdpm/src/sdpmBuilder.cpp
@@ -55,7 +55,7 @@ sdpmMatrixXd Builder::gatherCoords(bool symy, Element const *ej)
 
     // Get coordinates
     Eigen::MatrixXd coords(3, nV);
-    for (int j = 0; j < nV; ++j)
+    for (size_t j = 0; j < nV; ++j)
         coords.col(j) = nods[nV - 1 - j]->getCoords();
     if (symy)
         coords.row(1) = -coords.row(1);
diff --git a/sdpm/src/sdpmGmshImport.cpp b/sdpm/src/sdpmGmshImport.cpp
index 7cfd10f..2b230ae 100644
--- a/sdpm/src/sdpmGmshImport.cpp
+++ b/sdpm/src/sdpmGmshImport.cpp
@@ -90,7 +90,7 @@ void GmshImport::readPhysicalTags(FILE *file)
         {
             Tag *tag = new Tag(no, name, dim);
             _tagMap[no] = tag;
-            _msh.addTag(static_cast<std::string>(name), tag);
+            _msh.addTag(name, tag);
         }
     }
 }
@@ -150,7 +150,7 @@ void GmshImport::readElements(FILE *file)
         if (nbtags > 1)
         {
             size_t idx;
-            for (size_t itag = 1; itag < nbtags; ++itag)
+            for (int itag = 1; itag < nbtags; ++itag)
                 if (fscanf(file, "%zu", &idx) != 1)
                     throw std::runtime_error("GmshImport::readElements: error reading tags!\n");
         }
diff --git a/sdpm/src/sdpmMesh.h b/sdpm/src/sdpmMesh.h
index a85aa8a..f11aaee 100644
--- a/sdpm/src/sdpmMesh.h
+++ b/sdpm/src/sdpmMesh.h
@@ -50,10 +50,10 @@ public:
     std::map<std::string, Tag *> const &getTags() const { return _tags; }
 #ifndef SWIG
     // Setters
-    void setName(std::string &n) { _name = n; }
+    void setName(std::string const &n) { _name = n; }
     void addNode(Node *n) { _nodes.push_back(n); }
     void addElement(Element *e) { _elements.push_back(e); }
-    void addTag(std::string &n, Tag *t) { _tags[n] = t; }
+    void addTag(std::string const &n, Tag *t) { _tags[n] = t; }
     void reserveNodes(size_t n) { _nodes.reserve(n); }
     void reserveElements(size_t n) { _elements.reserve(n); }
 #endif
-- 
GitLab