ENH: drop polyMeshAdderTemplates.C in favour of using DynamicList::append

This commit is contained in:
Mark Olesen
2010-06-07 14:25:08 +02:00
parent 297a8b7d6c
commit 394b05a7ab
3 changed files with 12 additions and 67 deletions

View File

@ -38,7 +38,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- Append all mapped elements of a list to a DynamicList
// Append all mapped elements of a list to a DynamicList
void Foam::polyMeshAdder::append
(
const labelList& map,
@ -50,7 +50,7 @@ void Foam::polyMeshAdder::append
forAll(lst, i)
{
label newElem = map[lst[i]];
const label newElem = map[lst[i]];
if (newElem != -1)
{
@ -60,7 +60,7 @@ void Foam::polyMeshAdder::append
}
//- Append all mapped elements of a list to a DynamicList
// Append all mapped elements of a list to a DynamicList
void Foam::polyMeshAdder::append
(
const labelList& map,
@ -73,7 +73,7 @@ void Foam::polyMeshAdder::append
forAll(lst, i)
{
label newElem = map[lst[i]];
const label newElem = map[lst[i]];
if (newElem != -1 && findSortedIndex(sortedLst, newElem) == -1)
{
@ -170,8 +170,8 @@ void Foam::polyMeshAdder::mergePatchNames
)
{
// Insert the mesh0 patches and zones
append(patches0.names(), allPatchNames);
append(patches0.types(), allPatchTypes);
allPatchNames.append(patches0.names());
allPatchTypes.append(patches0.types());
// Patches
@ -924,9 +924,7 @@ void Foam::polyMeshAdder::mergePointZones
)
{
zoneNames.setCapacity(pz0.size() + pz1.size());
// Names
append(pz0.names(), zoneNames);
zoneNames.append(pz0.names());
from1ToAll.setSize(pz1.size());
@ -959,7 +957,7 @@ void Foam::polyMeshAdder::mergePointZones
forAll(pz1, zoneI)
{
// Relabel all points of zone and add to correct pzPoints.
label allZoneI = from1ToAll[zoneI];
const label allZoneI = from1ToAll[zoneI];
append
(
@ -991,8 +989,7 @@ void Foam::polyMeshAdder::mergeFaceZones
)
{
zoneNames.setCapacity(fz0.size() + fz1.size());
append(fz0.names(), zoneNames);
zoneNames.append(fz0.names());
from1ToAll.setSize(fz1.size());
@ -1092,8 +1089,7 @@ void Foam::polyMeshAdder::mergeCellZones
)
{
zoneNames.setCapacity(cz0.size() + cz1.size());
append(cz0.names(), zoneNames);
zoneNames.append(cz0.names());
from1ToAll.setSize(cz1.size());
forAll(cz1, zoneI)
@ -1108,14 +1104,14 @@ void Foam::polyMeshAdder::mergeCellZones
forAll(cz0, zoneI)
{
// Insert mesh0 cells
append(cz0[zoneI], czCells[zoneI]);
czCells[zoneI].append(cz0[zoneI]);
}
// Cell mapping is trivial.
forAll(cz1, zoneI)
{
label allZoneI = from1ToAll[zoneI];
const label allZoneI = from1ToAll[zoneI];
append(from1ToAllCells, cz1[zoneI], czCells[allZoneI]);
}

View File

@ -66,10 +66,6 @@ private:
// Private Member Functions
//- Append all elements of a list to a DynamicList
template<class T>
static void append(const List<T>&, DynamicList<T>&);
//- Append all mapped elements of a list to a DynamicList
static void append
(
@ -315,12 +311,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "polyMeshAdderTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,41 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Append all elements of a list to a DynamicList
template<class T>
void Foam::polyMeshAdder::append(const List<T>& lst, DynamicList<T>& dynLst)
{
dynLst.setCapacity(dynLst.size() + lst.size());
forAll(lst, i)
{
dynLst.append(lst[i]);
}
}
// ************************************************************************* //