Skip to content
Snippets Groups Projects
Commit 16b3817a authored by Adrien Crovato's avatar Adrien Crovato
Browse files

Fix tag numbers in Body. Write dummy elementary tags in GmshExport to have...

Fix tag numbers in Body. Write dummy elementary tags in GmshExport to have consistent display in Gmsh.
parent f075e5ea
No related branches found
No related tags found
1 merge request!1USCSDPM v1.0
Pipeline #11031 passed
...@@ -44,7 +44,7 @@ Body::Body(Mesh &msh, std::string const &name, std::string const &teName, double ...@@ -44,7 +44,7 @@ Body::Body(Mesh &msh, std::string const &name, std::string const &teName, double
if (it == tags.end()) if (it == tags.end())
{ {
// create tag and add it to the mesh // 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); _msh.addTag(wkName, tagp);
// translate TE nodes (along x-coordinate) // translate TE nodes (along x-coordinate)
std::vector<Node *> wkNodes; std::vector<Node *> wkNodes;
......
...@@ -69,13 +69,13 @@ void GmshExport::save(std::string const &sfx) const ...@@ -69,13 +69,13 @@ void GmshExport::save(std::string const &sfx) const
for (auto e : elems) for (auto e : elems)
{ {
fprintf(file, "%zu %zu %zu", e->getId(), static_cast<size_t>(e->getType()), static_cast<size_t>(2)); 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()) if (e->getTag())
fprintf(file, " %zu", e->getTag()->getId()); for (size_t i = 0; i < 2; ++i)
fprintf(file, " %zu", e->getTag()->getId());
else else
fprintf(file, " 0"); for (size_t i = 0; i < 2; ++i)
// elementary tag (always 0 since not recorded) fprintf(file, " 0");
fprintf(file, " 0");
// nodes // nodes
for (auto n : e->getNodes()) for (auto n : e->getNodes())
fprintf(file, " %zu", n->getId()); fprintf(file, " %zu", n->getId());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment