Skip to content
Snippets Groups Projects
Commit 25e7d800 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: fix inconsistent ListOps behaviour with DynamicList

parent 3715ed22
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -37,6 +37,9 @@ ListType Foam::renumber
// Create copy
ListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
forAll(lst, elemI)
{
if (lst[elemI] >= 0)
......@@ -76,6 +79,9 @@ ListType Foam::reorder
// Create copy
ListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
forAll(lst, elemI)
{
if (oldToNew[elemI] >= 0)
......@@ -101,6 +107,9 @@ void Foam::inplaceReorder
// Create copy
ListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
forAll(lst, elemI)
{
if (oldToNew[elemI] >= 0)
......@@ -258,6 +267,9 @@ ListType Foam::subset
ListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
label nElem = 0;
forAll(lst, elemI)
{
......@@ -318,6 +330,9 @@ ListType Foam::subset
ListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
label nElem = 0;
forAll(lst, elemI)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -57,8 +57,12 @@ StringListType Foam::subsetMatchingStrings
const bool invert
)
{
// Create copy
StringListType newLst(lst.size());
// ensure consistent addressable size (eg, DynamicList)
newLst.setSize(lst.size());
label nElem = 0;
forAll(lst, elemI)
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment