From da1cb4da1055b99c017adfa39f16396d7deee628 Mon Sep 17 00:00:00 2001 From: clyne Date: Tue, 21 Apr 2020 08:03:53 -0600 Subject: [PATCH] Fixed #2285 (#2286) --- lib/vdc/DC.cpp | 62 +++++++++++++++++++++++++----------------------- lib/vdc/DCCF.cpp | 4 ++-- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/lib/vdc/DC.cpp b/lib/vdc/DC.cpp index e56290c20..3ed7bdec6 100644 --- a/lib/vdc/DC.cpp +++ b/lib/vdc/DC.cpp @@ -484,43 +484,45 @@ bool DC::_getDataVarDimensions( if (! status) return(false); string mname = var.GetMeshName(); - if (mname.empty()) return(true); // 0-d variable - Mesh mesh; - status = GetMesh(mname, mesh); - if (! status) return(false); - vector dimnames; - if (mesh.GetMeshType() == Mesh::STRUCTURED) { - dimnames = mesh.GetDimNames(); - } - else { - switch (var.GetSamplingLocation()) { - case Mesh::NODE: - dimnames.push_back(mesh.GetNodeDimName()); - break; - case Mesh::EDGE: - dimnames.push_back(mesh.GetEdgeDimName()); - break; - case Mesh::FACE: - dimnames.push_back(mesh.GetFaceDimName()); - break; - case Mesh::VOLUME: - VAssert(0 && "VOLUME cells not supported"); - break; + if (! mname.empty()) {; // 0-d variable + Mesh mesh; + status = GetMesh(mname, mesh); + if (! status) return(false); + + vector dimnames; + if (mesh.GetMeshType() == Mesh::STRUCTURED) { + dimnames = mesh.GetDimNames(); } - if (mesh.GetMeshType() == Mesh::UNSTRUC_LAYERED) { - dimnames.push_back(mesh.GetLayersDimName()); + else { + switch (var.GetSamplingLocation()) { + case Mesh::NODE: + dimnames.push_back(mesh.GetNodeDimName()); + break; + case Mesh::EDGE: + dimnames.push_back(mesh.GetEdgeDimName()); + break; + case Mesh::FACE: + dimnames.push_back(mesh.GetFaceDimName()); + break; + case Mesh::VOLUME: + VAssert(0 && "VOLUME cells not supported"); + break; + } + if (mesh.GetMeshType() == Mesh::UNSTRUC_LAYERED) { + dimnames.push_back(mesh.GetLayersDimName()); + } } - } - for (int i=0; i dvars; - for (int i=2; i<4; i++) { + for (int i=1; i<4; i++) { vector v = ncdfc->GetDataVariableNames(i,true); dvars.insert(dvars.end(), v.begin(), v.end()); }