From 409564ae463df1a57b6ea67f3230045388967c11 Mon Sep 17 00:00:00 2001 From: Pierre Kraemer Date: Mon, 17 Mar 2014 11:05:18 +0100 Subject: [PATCH] update mark vector of Dart & Cell Marker after load --- src/Topology/generic/genericmap.cpp | 32 ++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/Topology/generic/genericmap.cpp b/src/Topology/generic/genericmap.cpp index 36147469..3628b275 100644 --- a/src/Topology/generic/genericmap.cpp +++ b/src/Topology/generic/genericmap.cpp @@ -326,6 +326,17 @@ void GenericMap::removeThreadMarker(unsigned int nb) void GenericMap::restore_shortcuts() { + // NB THREADS + + std::vector typeMark; + unsigned int nbatt0 = m_attribs[0].getAttributesTypes(typeMark); + m_nbThreads = 0; + for (unsigned int i = 0; i < nbatt0; ++i) + { + if (typeMark[i] == "Mark") + ++m_nbThreads; + } + // EMBEDDING // get container of dart orbit @@ -384,14 +395,14 @@ void GenericMap::restore_shortcuts() AttributeMultiVector* amvMark = cont.getDataVector(i); m_markTables[orbit][thread] = amvMark ; - if ((orbit == DART) && (thread == 0)) // for Marker of dart of thread O keep the boundary marker - { + if ((orbit == DART) && (thread == 0)) // for Dart Marker of thread O + { // clear all marks expect boundary marks Mark m(m_boundaryMarkers[0] + m_boundaryMarkers[1]); m.invert(); for (unsigned int i = cont.begin(); i != cont.end(); cont.next(i)) amvMark->operator[](i).unsetMark(m); } - else // for others clear all + else // for others clear all { for (unsigned int i = cont.begin(); i != cont.end(); cont.next(i)) amvMark->operator[](i).clear(); @@ -400,16 +411,13 @@ void GenericMap::restore_shortcuts() } } - // NB THREADS + // restore mark vectors in Dart & Cell Markers + for (std::vector::iterator it = dartMarkers.begin(); it != dartMarkers.end(); ++it) + (*it)->updateMarkVector(m_markTables[DART][(*it)->getThread()]); + + for (std::vector::iterator it = cellMarkers.begin(); it != cellMarkers.end(); ++it) + (*it)->updateMarkVector(m_markTables[(*it)->getCell()][(*it)->getThread()]); - std::vector typeMark; - unsigned int nbatt0 = m_attribs[0].getAttributesTypes(typeMark); - m_nbThreads = 0; - for (unsigned int i = 0; i < nbatt0; ++i) - { - if (typeMark[i] == "Mark") - ++m_nbThreads; - } } void GenericMap::dumpAttributesAndMarkers() -- GitLab