From 862e5c33850b802546532a8a5b58966bb1429a37 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@uliege.be> Date: Thu, 12 May 2022 17:38:09 +0200 Subject: [PATCH] nicer debug - thanks @schnaubelt! (cf. #1750) --- src/plugin/Crack.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/plugin/Crack.cpp b/src/plugin/Crack.cpp index a1c932b17d..d7e00f0c43 100644 --- a/src/plugin/Crack.cpp +++ b/src/plugin/Crack.cpp @@ -254,13 +254,6 @@ PView *GMSH_CrackPlugin::execute(PView *view) } } - if(debug) { - std::map<int, std::vector<double> > d; - for(auto e : oneside) d[e.first->getNum()] = {(double)e.first->getNum()}; - view = new PView("Elements on positive side of crack", "ElementData", - GModel::current(), d); - } - // create new crack entity // TODO: the new discrete entities do not have a consistent topology: we don't @@ -332,6 +325,18 @@ PView *GMSH_CrackPlugin::execute(PView *view) } } + if(debug) { + std::map<int, std::vector<double> > d; + for(auto e : oneside) { + // 1: if node duplicated, 0: if node not duplicated + std::vector<double> nodeDuplicated(e.first->getNumVertices(), 0.0); + for(auto & node: e.second) nodeDuplicated[node] = 1.0; + d[e.first->getNum()] = nodeDuplicated; + } + view = new PView("Positive-side elements and duplicated nodes (1: true, 0: false)", + "ElementNodeData", GModel::current(), d, 0, 1); + } + CTX::instance()->mesh.changed = ENT_ALL; return view; -- GitLab