From 9041c9083ed70534da48b362489364e2b92ba7e7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 12 Dec 2016 17:52:02 +0100 Subject: [PATCH 1/9] BUG: incorrect addressing in ensight faces/cells (issue #334) - was erroneously using global sizing for offsets instead the processor local sizing. -- STYLE: adjust variable naming, indentation for consistency --- src/fileFormats/ensight/part/ensightCells.C | 94 +++++++-------- src/fileFormats/ensight/part/ensightCells.H | 25 ++-- src/fileFormats/ensight/part/ensightFaces.C | 119 +++++++++---------- src/fileFormats/ensight/part/ensightFaces.H | 121 ++++++++++---------- 4 files changed, 165 insertions(+), 194 deletions(-) diff --git a/src/fileFormats/ensight/part/ensightCells.C b/src/fileFormats/ensight/part/ensightCells.C index 141df44053..d08996ad85 100644 --- a/src/fileFormats/ensight/part/ensightCells.C +++ b/src/fileFormats/ensight/part/ensightCells.C @@ -49,41 +49,25 @@ const Foam::NamedEnum // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -inline Foam::label Foam::ensightCells::offset -( - const enum elemType what, - const label i -) const -{ - label n = i; - for (label typeI = 0; typeI < label(what); ++typeI) - { - n += sizes_[typeI]; - } - - return n; -} - - -void Foam::ensightCells::resize() +void Foam::ensightCells::resizeAll() { // overall required size label n = 0; - forAll(sizes_, typeI) + forAll(sizes_, typei) { - n += sizes_[typeI]; + n += sizes_[typei]; } address_.setSize(n, Zero); // assign corresponding sub-lists n = 0; - forAll(sizes_, typeI) + forAll(sizes_, typei) { - deleteDemandDrivenData(lists_[typeI]); + deleteDemandDrivenData(lists_[typei]); - lists_[typeI] = new SubList