diff --git a/sdpm/src/sdpmBody.cpp b/sdpm/src/sdpmBody.cpp index 6d850325326a94705906d87833a9644ff7fe8993..9f9e496c59ed099efa90316eddf1c581e4178880 100644 --- a/sdpm/src/sdpmBody.cpp +++ b/sdpm/src/sdpmBody.cpp @@ -44,7 +44,7 @@ Body::Body(Mesh &msh, std::string const &name, std::string const &teName, double if (it == tags.end()) { // create tag and add it to the mesh - Tag *tagp = new Tag(tags.rbegin()->second->getId() + 1, wkName, 2); + Tag *tagp = new Tag(tags.size() + 1, wkName, 2); _msh.addTag(wkName, tagp); // translate TE nodes (along x-coordinate) std::vector<Node *> wkNodes; diff --git a/sdpm/src/sdpmGmshExport.cpp b/sdpm/src/sdpmGmshExport.cpp index c83af975b7dbf4af75ecc9f14f57651fcc21a50c..dc0bd089ba745210b255cf9877e079858624105a 100644 --- a/sdpm/src/sdpmGmshExport.cpp +++ b/sdpm/src/sdpmGmshExport.cpp @@ -69,13 +69,13 @@ void GmshExport::save(std::string const &sfx) const for (auto e : elems) { fprintf(file, "%zu %zu %zu", e->getId(), static_cast<size_t>(e->getType()), static_cast<size_t>(2)); - // physical tag + // physical and elementary (equal to physical since not recorded) tags if (e->getTag()) - fprintf(file, " %zu", e->getTag()->getId()); + for (size_t i = 0; i < 2; ++i) + fprintf(file, " %zu", e->getTag()->getId()); else - fprintf(file, " 0"); - // elementary tag (always 0 since not recorded) - fprintf(file, " 0"); + for (size_t i = 0; i < 2; ++i) + fprintf(file, " 0"); // nodes for (auto n : e->getNodes()) fprintf(file, " %zu", n->getId());