UIndirectList

This commit is contained in:
mattijs 2009-03-12 19:25:21 +00:00
parent 6c387489d7
commit 0128b2be68
49 changed files with 390 additions and 197 deletions

View File

@ -0,0 +1,3 @@
UIndirectListTest.C
EXE = $(FOAM_USER_APPBIN)/UIndirectListTest

View File

@ -26,51 +26,68 @@ Description
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
#include "UIndirectList.H"
#include "IOstreams.H"
//- Construct given size
template<class T>
inline Foam::IndirectList<T>::IndirectList
(
const Foam::UList<T>& completeList,
const Foam::List<label>& addresses
)
:
completeList_(completeList),
addresses_(addresses)
{}
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline Foam::label Foam::IndirectList<T>::size() const
int main(int argc, char *argv[])
{
return addresses_.size();
}
List<double> completeList(10);
forAll(completeList, i)
{
completeList[i] = 0.1*i;
}
List<label> addresses(5);
addresses[0] = 1;
addresses[1] = 0;
addresses[2] = 7;
addresses[3] = 8;
addresses[4] = 5;
UIndirectList<double> idl(completeList, addresses);
forAll(idl, i)
{
Info<< idl[i] << token::SPACE;
}
Info<< endl;
idl[1] = -666;
Info<< "idl[1] changed:" << idl() << endl;
idl = -999;
Info<< "idl changed:" << idl() << endl;
UIndirectList<double> idl2(idl);
Info<< "idl2:" << idl2() << endl;
idl = idl2();
Info<< "idl assigned from UList:" << idl() << endl;
template<class T>
inline const Foam::UList<T>& Foam::IndirectList<T>::
completeList() const
{
return completeList_;
}
List<double> realList = UIndirectList<double>(completeList, addresses);
Info<< "realList:" << realList << endl;
List<double> realList2(UIndirectList<double>(completeList, addresses));
Info<< "realList2:" << realList2 << endl;
template<class T>
inline const Foam::List<Foam::label>& Foam::IndirectList<T>::addresses() const
{
return addresses_;
}
Info << "\nEnd\n" << endl;
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
inline const T& Foam::IndirectList<T>::operator[](const Foam::label i) const
{
return completeList_[addresses_[i]];
return 0;
}

View File

@ -177,7 +177,7 @@ label mergePatchFaces
List<faceList> allFaceSetsFaces(allFaceSets.size());
forAll(allFaceSets, setI)
{
allFaceSetsFaces[setI] = IndirectList<face>
allFaceSetsFaces[setI] = UIndirectList<face>
(
mesh.faces(),
allFaceSets[setI]

View File

@ -76,7 +76,7 @@ void Foam::meshDualiser::checkPolyTopoChange(const polyTopoChange& meshMod)
"meshDualiser::checkPolyTopoChange(const polyTopoChange&)"
) << "duplicate verts:" << newToOld[newI]
<< " coords:"
<< IndirectList<point>(points, newToOld[newI])()
<< UIndirectList<point>(points, newToOld[newI])()
<< abort(FatalError);
}
}
@ -226,10 +226,7 @@ Foam::label Foam::meshDualiser::addInternalFace
if (debug)
{
pointField facePoints
(
IndirectList<point>(meshMod.points(), newFace)()
);
pointField facePoints(meshMod.points(), newFace);
labelList oldToNew;
pointField newPoints;
@ -289,7 +286,7 @@ Foam::label Foam::meshDualiser::addInternalFace
//n /= mag(n);
//Pout<< "Generated internal dualFace:" << dualFaceI
// << " verts:" << newFace
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n
// << " between dualowner:" << dualCell0
// << " dualneigbour:" << dualCell1
@ -316,7 +313,7 @@ Foam::label Foam::meshDualiser::addInternalFace
//n /= mag(n);
//Pout<< "Generated internal dualFace:" << dualFaceI
// << " verts:" << newFace
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n
// << " between dualowner:" << dualCell1
// << " dualneigbour:" << dualCell0
@ -373,7 +370,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
//n /= mag(n);
//Pout<< "Generated boundary dualFace:" << dualFaceI
// << " verts:" << newFace
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n
// << " on dualowner:" << dualCellI
// << endl;
@ -568,7 +565,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
//Pout<< "createFaceFromInternalFace : At face:" << faceI
// << " verts:" << f
// << " points:" << IndirectList<point>(mesh_.points(), f)()
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
// << " started walking at edge:" << fEdges[fp]
// << " verts:" << mesh_.edges()[fEdges[fp]]
// << endl;
@ -617,7 +614,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
{
FatalErrorIn("createFacesFromInternalFace(..)")
<< "face:" << faceI << " verts:" << f
<< " points:" << IndirectList<point>(mesh_.points(), f)()
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
<< " no feature edge between " << f[fp]
<< " and " << f[nextFp] << " although have different"
<< " dual cells." << endl

View File

@ -70,7 +70,7 @@ void writePointSet
labelList pointLabels(set.toc());
pointField setPoints(IndirectList<point>(mesh.points(), pointLabels)());
pointField setPoints(mesh.points(), pointLabels);
// Write points

View File

@ -22,14 +22,11 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "regionSide.H"
#include "meshTools.H"
#include "primitiveMesh.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -113,7 +110,7 @@ Foam::label Foam::regionSide::otherEdge
) << "Cannot find other edge on face " << faceI << " that uses point "
<< pointI << " but not point " << freePointI << endl
<< "Edges on face:" << fEdges
<< " verts:" << IndirectList<edge>(mesh.edges(), fEdges)()
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
<< " Vertices on face:"
<< mesh.faces()[faceI]
<< " Vertices on original edge:" << e << abort(FatalError);

View File

@ -50,15 +50,12 @@ Description
#include "attachDetach.H"
#include "attachPolyTopoChanger.H"
#include "regionSide.H"
#include "primitiveFacePatch.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Calculation engine for set of faces in a mesh
typedef PrimitivePatch<face, List, const pointField&> facePatch;
// Find edge between points v0 and v1.
label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
{
@ -163,10 +160,16 @@ int main(int argc, char *argv[])
// set of edges on side of this region. Use PrimitivePatch to find these.
//
IndirectList<face> zoneFaces(mesh.faces(), faces);
// Addressing on faces only in mesh vertices.
facePatch fPatch(zoneFaces(), mesh.points());
primitiveFacePatch fPatch
(
UIndirectList<face>
(
mesh.faces(),
faces
),
mesh.points()
);
const labelList& meshPoints = fPatch.meshPoints();

View File

@ -60,7 +60,6 @@ Description
#include "polyTopoChanger.H"
#include "mapPolyMesh.H"
#include "ListOps.H"
#include "IndirectList.H"
#include "slidingInterface.H"
#include "perfectInterface.H"
#include "IOobjectList.H"

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "writePointSet.H"
@ -76,7 +74,7 @@ void writePointSet
writeFuns::insert
(
IndirectList<point>(vMesh.mesh().points(), set.toc())(),
UIndirectList<point>(vMesh.mesh().points(), set.toc())(),
ptField
);

View File

@ -306,7 +306,7 @@ label findEdge
FatalErrorIn("findEdge") << "Cannot find edge with labels " << v0
<< ' ' << v1 << " in candidates " << edgeLabels
<< " with vertices:" << IndirectList<edge>(surf.edges(), edgeLabels)()
<< " with vertices:" << UIndirectList<edge>(surf.edges(), edgeLabels)()
<< abort(FatalError);
return -1;
@ -346,7 +346,7 @@ label otherEdge
FatalErrorIn("otherEdge") << "Cannot find other edge on face " << faceI
<< " verts:" << surf.localPoints()[faceI]
<< " connected to point " << pointI
<< " faceEdges:" << IndirectList<edge>(surf.edges(), fEdges)()
<< " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)()
<< abort(FatalError);
return -1;

View File

@ -31,6 +31,7 @@ License
#include "PtrList.H"
#include "SLList.H"
#include "IndirectList.H"
#include "UIndirectList.H"
#include "BiIndirectList.H"
#include "contiguous.H"
@ -321,6 +322,28 @@ Foam::List<T>::List(const IndirectList<T>& lst)
}
// Construct as copy of UIndirectList<T>
template<class T>
Foam::List<T>::List(const UIndirectList<T>& lst)
:
UList<T>(NULL, lst.size())
{
if (this->size_)
{
this->v_ = new T[this->size_];
forAll(*this, i)
{
this->operator[](i) = lst[i];
}
}
else
{
this->v_ = 0;
}
}
// Construct as copy of BiIndirectList<T>
template<class T>
Foam::List<T>::List(const BiIndirectList<T>& lst)
@ -590,6 +613,28 @@ void Foam::List<T>::operator=(const IndirectList<T>& lst)
}
// Assignment operator. Takes linear time.
template<class T>
void Foam::List<T>::operator=(const UIndirectList<T>& lst)
{
if (lst.size() != this->size_)
{
if (this->v_) delete[] this->v_;
this->v_ = 0;
this->size_ = lst.size();
if (this->size_) this->v_ = new T[this->size_];
}
if (this->size_)
{
forAll(*this, i)
{
this->operator[](i) = lst[i];
}
}
}
// Assignment operator. Takes linear time.
template<class T>
void Foam::List<T>::operator=(const BiIndirectList<T>& lst)

View File

@ -66,6 +66,7 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
class DynamicList;
template<class T> class SortableList;
template<class T> class IndirectList;
template<class T> class UIndirectList;
template<class T> class BiIndirectList;
typedef UList<label> unallocLabelList;
@ -133,6 +134,9 @@ public:
//- Construct as copy of IndirectList<T>
List(const IndirectList<T>&);
//- Construct as copy of UIndirectList<T>
List(const UIndirectList<T>&);
//- Construct as copy of BiIndirectList<T>
List(const BiIndirectList<T>&);
@ -210,6 +214,9 @@ public:
//- Assignment from IndirectList operator. Takes linear time.
void operator=(const IndirectList<T>&);
//- Assignment from UIndirectList operator. Takes linear time.
void operator=(const UIndirectList<T>&);
//- Assignment from BiIndirectList operator. Takes linear time.
void operator=(const BiIndirectList<T>&);

View File

@ -23,17 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::IndirectList
Foam::UIndirectList
Description
A List with indirect addressing. Like IndirectList but does not store
addressing.
SourceFiles
IndirectListI.H
UIndirectListI.H
\*---------------------------------------------------------------------------*/
#ifndef IndirectList_H
#define IndirectList_H
#ifndef UIndirectList_H
#define UIndirectList_H
#include "List.H"
@ -43,22 +45,16 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class IndirectList Declaration
Class UIndirectList Declaration
\*---------------------------------------------------------------------------*/
template<class T>
class IndirectList
class UIndirectList
{
// Private data
const UList<T>& completeList_;
List<label> addresses_;
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const IndirectList<T>&);
UList<T>& completeList_;
const UList<label>& addressing_;
public:
@ -66,7 +62,7 @@ public:
// Constructors
//- Construct given the complete list and the addressing array
inline IndirectList(const UList<T>&, const List<label>&);
inline UIndirectList(const UList<T>&, const UList<label>&);
// Member Functions
@ -74,14 +70,28 @@ public:
// Access
inline label size() const;
inline bool empty() const;
inline const UList<T>& completeList() const;
inline const List<label>& addresses() const;
inline const List<label>& addressing() const;
// Member Operators
//- Return the addressed elements as a List
inline List<T> operator()() const;
//- Return non-const access to an element
inline T& operator[](const label);
//- Return const access to an element
inline const T& operator[](const label) const;
//- Assignment from UList of addressed elements
inline void operator=(const UList<T>&);
//- Assignment of all entries to the given value
inline void operator=(const T&);
};
@ -91,7 +101,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "IndirectListI.H"
#include "UIndirectListI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T>
inline Foam::UIndirectList<T>::UIndirectList
(
const UList<T>& completeList,
const UList<label>& addr
)
:
completeList_(const_cast<UList<T>&>(completeList)),
addressing_(addr)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline Foam::label Foam::UIndirectList<T>::size() const
{
return addressing_.size();
}
template<class T>
inline bool Foam::UIndirectList<T>::empty() const
{
return addressing_.empty();
}
template<class T>
inline const Foam::UList<T>& Foam::UIndirectList<T>::completeList() const
{
return completeList_;
}
template<class T>
inline const Foam::List<Foam::label>& Foam::UIndirectList<T>::addressing() const
{
return addressing_;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>
inline Foam::List<T> Foam::UIndirectList<T>::operator()() const
{
List<T> result(size());
forAll(*this, i)
{
result[i] = operator[](i);
}
return result;
}
template<class T>
inline T& Foam::UIndirectList<T>::operator[](const label i)
{
return completeList_[addressing_[i]];
}
template<class T>
inline const T& Foam::UIndirectList<T>::operator[](const label i) const
{
return completeList_[addressing_[i]];
}
template<class T>
inline void Foam::UIndirectList<T>::operator=(const UList<T>& ae)
{
if (addressing_.size() != ae.size())
{
FatalErrorIn("UIndirectList<T>::operator=(const UList<T>&)")
<< "Addressing and list of addressed elements "
"have different sizes: "
<< addressing_.size() << " " << ae.size()
<< abort(FatalError);
}
forAll(addressing_, i)
{
completeList_[addressing_[i]] = ae[i];
}
}
template<class T>
inline void Foam::UIndirectList<T>::operator=(const T& t)
{
forAll(addressing_, i)
{
completeList_[addressing_[i]] = t;
}
}
// ************************************************************************* //

View File

@ -629,7 +629,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
toMaster
<< sharedPointAddr_
<< IndirectList<point>(mesh_.points(), sharedPointLabels_)();
<< UIndirectList<point>(mesh_.points(), sharedPointLabels_)();
}
// Receive sharedPoints

View File

@ -653,8 +653,8 @@ void Foam::globalPoints::sendSharedPoints(const labelList& changedIndices) const
}
toNeighbour
<< IndirectList<label>(sharedPointAddr_, changedIndices)()
<< IndirectList<label>(sharedPointLabels_, changedIndices)();
<< UIndirectList<label>(sharedPointAddr_, changedIndices)()
<< UIndirectList<label>(sharedPointLabels_, changedIndices)();
}
}
}

View File

@ -124,7 +124,7 @@ Foam::List<Foam::labelPair> Foam::mapDistribute::schedule
);
// Processors involved in my schedule
return IndirectList<labelPair>(allComms, mySchedule);
return UIndirectList<labelPair>(allComms, mySchedule);
//if (debug)

View File

@ -188,11 +188,11 @@ void Foam::cyclicPolyPatch::calcTransforms()
<< endl
<< "Mesh face:" << start()+facei
<< " vertices:"
<< IndirectList<point>(points, operator[](facei))()
<< UIndirectList<point>(points, operator[](facei))()
<< endl
<< "Neighbour face:" << start()+nbrFacei
<< " vertices:"
<< IndirectList<point>(points, operator[](nbrFacei))()
<< UIndirectList<point>(points, operator[](nbrFacei))()
<< endl
<< "Rerun with cyclic debug flag set"
<< " for more information." << exit(FatalError);
@ -403,12 +403,12 @@ bool Foam::cyclicPolyPatch::getGeometricHalves
fileName nm0(casePath/name()+"_half0_faces.obj");
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half0"
<< " faces to OBJ file " << nm0 << endl;
writeOBJ(nm0, IndirectList<face>(pp, half0ToPatch)(), pp.points());
writeOBJ(nm0, UIndirectList<face>(pp, half0ToPatch)(), pp.points());
fileName nm1(casePath/name()+"_half1_faces.obj");
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half1"
<< " faces to OBJ file " << nm1 << endl;
writeOBJ(nm1, IndirectList<face>(pp, half1ToPatch)(), pp.points());
writeOBJ(nm1, UIndirectList<face>(pp, half1ToPatch)(), pp.points());
}
// Dump face centres
@ -672,7 +672,7 @@ bool Foam::cyclicPolyPatch::matchAnchors
) << "Patch:" << name() << " : "
<< "Cannot find point on face " << f
<< " with vertices:"
<< IndirectList<point>(pp.points(), f)()
<< UIndirectList<point>(pp.points(), f)()
<< " that matches point " << wantedAnchor
<< " when matching the halves of cyclic patch " << name()
<< endl
@ -1133,8 +1133,8 @@ bool Foam::cyclicPolyPatch::order
half1ToPatch = half0ToPatch + halfSize;
// Get faces
faceList half0Faces(IndirectList<face>(pp, half0ToPatch));
faceList half1Faces(IndirectList<face>(pp, half1ToPatch));
faceList half0Faces(UIndirectList<face>(pp, half0ToPatch));
faceList half1Faces(UIndirectList<face>(pp, half1ToPatch));
// Get geometric quantities
pointField half0Ctrs, half1Ctrs, anchors0, ppPoints;
@ -1221,8 +1221,8 @@ bool Foam::cyclicPolyPatch::order
}
// And redo all matching
half0Faces = IndirectList<face>(pp, half0ToPatch);
half1Faces = IndirectList<face>(pp, half1ToPatch);
half0Faces = UIndirectList<face>(pp, half0ToPatch);
half1Faces = UIndirectList<face>(pp, half1ToPatch);
getCentresAndAnchors
(
@ -1334,8 +1334,8 @@ bool Foam::cyclicPolyPatch::order
if (baffleI == halfSize)
{
// And redo all matching
half0Faces = IndirectList<face>(pp, half0ToPatch);
half1Faces = IndirectList<face>(pp, half1ToPatch);
half0Faces = UIndirectList<face>(pp, half0ToPatch);
half1Faces = UIndirectList<face>(pp, half1ToPatch);
getCentresAndAnchors
(
@ -1420,8 +1420,8 @@ bool Foam::cyclicPolyPatch::order
}
// And redo all matching
half0Faces = IndirectList<face>(pp, half0ToPatch);
half1Faces = IndirectList<face>(pp, half1ToPatch);
half0Faces = UIndirectList<face>(pp, half0ToPatch);
half1Faces = UIndirectList<face>(pp, half1ToPatch);
getCentresAndAnchors
(

View File

@ -207,7 +207,7 @@ void Foam::processorPolyPatch::calcGeometry()
<< endl
<< "Mesh face:" << start()+facei
<< " vertices:"
<< IndirectList<point>(points(), operator[](facei))()
<< UIndirectList<point>(points(), operator[](facei))()
<< endl
<< "Rerun with processor debug flag set for"
<< " more information." << exit(FatalError);
@ -731,7 +731,7 @@ bool Foam::processorPolyPatch::order
<< " : "
<< "Cannot find point on face " << pp[oldFaceI]
<< " with vertices "
<< IndirectList<point>(pp.points(), pp[oldFaceI])()
<< UIndirectList<point>(pp.points(), pp[oldFaceI])()
<< " that matches point " << wantedAnchor
<< " when matching the halves of processor patch " << name()
<< "Continuing with incorrect face ordering from now on!"

View File

@ -87,8 +87,7 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
labelList minProc(mesh.globalData().nGlobalPoints(), labelMax);
IndirectList<label>(minProc, sharedPointAddr) =
Pstream::myProcNo();
UIndirectList<label>(minProc, sharedPointAddr) = Pstream::myProcNo();
Pstream::listCombineGather(minProc, minEqOp<label>());
Pstream::listCombineScatter(minProc);
@ -207,8 +206,7 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
labelList minProc(mesh.globalData().nGlobalEdges(), labelMax);
IndirectList<label>(minProc, sharedEdgeAddr) =
Pstream::myProcNo();
UIndirectList<label>(minProc, sharedEdgeAddr) = Pstream::myProcNo();
Pstream::listCombineGather(minProc, minEqOp<label>());
Pstream::listCombineScatter(minProc);

View File

@ -37,7 +37,6 @@ SourceFiles
#define ZoneMesh_H
#include "List.H"
#include "IndirectList.H"
#include "regIOobject.H"
#include "HashSet.H"
#include "pointFieldsFwd.H"

View File

@ -81,7 +81,7 @@ Foam::PatchTools::edgeOwner
<< "Edge " << edgeI << " vertices:" << edges[edgeI]
<< " is used by faces " << nbrFaces
<< " vertices:"
<< IndirectList<Face>(localFaces, nbrFaces)()
<< UIndirectList<Face>(localFaces, nbrFaces)()
<< " none of which use the edge vertices in the same order"
<< nl << "I give up" << abort(FatalError);
}

View File

@ -108,7 +108,7 @@ Foam::PatchTools::sortedEdgeFaces
faceAngles.sort();
sortedEdgeFaces[edgeI] = IndirectList<label>
sortedEdgeFaces[edgeI] = UIndirectList<label>
(
faceNbs,
faceAngles.indices()

View File

@ -1238,10 +1238,7 @@ void Foam::autoSnapDriver::smoothDisplacement
magDisp().write();
Pout<< "Writing actual patch displacement ..." << endl;
vectorField actualPatchDisp
(
IndirectList<point>(disp, pp.meshPoints())()
);
vectorField actualPatchDisp(disp, pp.meshPoints());
dumpMove
(
mesh.time().path()/"actualPatchDisplacement.obj",

View File

@ -922,7 +922,7 @@ void Foam::refinementSurfaces::findNearest
List<pointIndexHit>& hitInfo
) const
{
labelList geometries(IndirectList<label>(surfaces_, surfacesToTest));
labelList geometries(UIndirectList<label>(surfaces_, surfacesToTest));
// Do the tests. Note that findNearest returns index in geometries.
searchableSurfacesQueries::findNearest
@ -955,7 +955,7 @@ void Foam::refinementSurfaces::findNearestRegion
labelList& hitRegion
) const
{
labelList geometries(IndirectList<label>(surfaces_, surfacesToTest));
labelList geometries(UIndirectList<label>(surfaces_, surfacesToTest));
// Do the tests. Note that findNearest returns index in geometries.
List<pointIndexHit> hitInfo;
@ -991,7 +991,7 @@ void Foam::refinementSurfaces::findNearestRegion
List<pointIndexHit> localHits
(
IndirectList<pointIndexHit>
UIndirectList<pointIndexHit>
(
hitInfo,
localIndices

View File

@ -718,7 +718,7 @@ void Foam::fvMeshDistribute::getNeighbourData
// Which processor they will end up on
const labelList newProc
(
IndirectList<label>(distribution, pp.faceCells())
UIndirectList<label>(distribution, pp.faceCells())
);
OPstream toNeighbour(Pstream::blocking, procPatch.neighbProcNo());
@ -1192,7 +1192,7 @@ void Foam::fvMeshDistribute::sendMesh
//
// forAll(cellZones, zoneI)
// {
// IndirectList<label>(cellZoneID, cellZones[zoneI]) = zoneI;
// UIndirectList<label>(cellZoneID, cellZones[zoneI]) = zoneI;
// }
//}

View File

@ -269,7 +269,7 @@ bool Foam::hexCellLooper::cut
{
FatalErrorIn("hexCellLooper::walkHex") << "Face:" << faceVerts
<< " on points:" << facePoints << endl
<< IndirectList<point>(facePoints, faceVerts)()
<< UIndirectList<point>(facePoints, faceVerts)()
<< abort(FatalError);
}
}

View File

@ -103,8 +103,8 @@ void Foam::polyMeshGeometry::updateCellCentresAndVols
)
{
// Clear the fields for accumulation
IndirectList<vector>(cellCentres_, changedCells) = vector::zero;
IndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
UIndirectList<vector>(cellCentres_, changedCells) = vector::zero;
UIndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
const labelList& own = mesh_.faceOwner();
const labelList& nei = mesh_.faceNeighbour();
@ -112,9 +112,9 @@ void Foam::polyMeshGeometry::updateCellCentresAndVols
// first estimate the approximate cell centre as the average of face centres
vectorField cEst(mesh_.nCells());
IndirectList<vector>(cEst, changedCells) = vector::zero;
UIndirectList<vector>(cEst, changedCells) = vector::zero;
scalarField nCellFaces(mesh_.nCells());
IndirectList<scalar>(nCellFaces, changedCells) = 0.0;
UIndirectList<scalar>(nCellFaces, changedCells) = 0.0;
forAll(changedFaces, i)
{

View File

@ -32,7 +32,6 @@ License
#include "treeDataFace.H"
#include "indexedOctree.H"
#include "OFstream.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -153,11 +152,7 @@ void Foam::faceCoupleInfo::writePointsFaces() const
(
"cutToMasterPoints.obj",
m.localPoints(),
pointField
(
IndirectList<point>(c.localPoints(), masterToCutPoints_)()
)
);
pointField(c.localPoints(), masterToCutPoints_));
}
{
Pout<< "Writing cutToSlavePoints to cutToSlavePoints.obj" << endl;
@ -166,10 +161,7 @@ void Foam::faceCoupleInfo::writePointsFaces() const
(
"cutToSlavePoints.obj",
s.localPoints(),
pointField
(
IndirectList<point>(c.localPoints(), slaveToCutPoints_)()
)
pointField(c.localPoints(), slaveToCutPoints_)
);
}
@ -405,7 +397,7 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
if (report)
{
Pout<< "mostAlignedEdge : finding nearest edge among "
<< IndirectList<edge>(cutFaces().edges(), pEdges)()
<< UIndirectList<edge>(cutFaces().edges(), pEdges)()
<< " connected to point " << pointI
<< " coord:" << localPoints[pointI]
<< " running between " << edgeStart << " coord:"
@ -623,7 +615,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
"(const labelList&)"
) << " unsplitEdge:" << unsplitEdge
<< " does not correspond to split edges "
<< IndirectList<edge>(cutEdges, stringedEdges)()
<< UIndirectList<edge>(cutEdges, stringedEdges)()
<< abort(FatalError);
}
}
@ -631,7 +623,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
//Pout<< "For master edge:"
// << unsplitEdge
// << " Found stringed points "
// << IndirectList<point>
// << UIndirectList<point>
// (
// cutFaces().localPoints(),
// splitPoints.shrink()
@ -664,9 +656,9 @@ Foam::label Foam::faceCoupleInfo::matchFaces
"(const scalar, const face&, const pointField&"
", const face&, const pointField&)"
) << "Different sizes for supposedly matching faces." << nl
<< "f0:" << f0 << " coords:" << IndirectList<point>(points0, f0)()
<< "f0:" << f0 << " coords:" << UIndirectList<point>(points0, f0)()
<< nl
<< "f1:" << f1 << " coords:" << IndirectList<point>(points1, f1)()
<< "f1:" << f1 << " coords:" << UIndirectList<point>(points1, f1)()
<< abort(FatalError);
}
@ -721,10 +713,9 @@ Foam::label Foam::faceCoupleInfo::matchFaces
", const face&, const pointField&)"
) << "No unique match between two faces" << nl
<< "Face " << f0 << " coords "
<< IndirectList<point>(points0, f0)()
<< nl
<< UIndirectList<point>(points0, f0)() << nl
<< "Face " << f1 << " coords "
<< IndirectList<point>(points1, f1)()
<< UIndirectList<point>(points1, f1)()
<< "when using tolerance " << absTol
<< " and forwardMatching:" << sameOrientation
<< abort(FatalError);
@ -1575,7 +1566,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
// Use compaction lists to renumber cutPoints.
cutPoints_ = IndirectList<point>(cutPoints_, compactToCut)();
cutPoints_ = UIndirectList<point>(cutPoints_, compactToCut)();
{
const faceList& cutLocalFaces = cutFaces().localFaces();
@ -1770,11 +1761,11 @@ void Foam::faceCoupleInfo::subDivisionMatch
writeOBJ
(
"errorEdges.obj",
IndirectList<edge>
UIndirectList<edge>
(
cutFaces().edges(),
cutFaces().pointEdges()[cutPointI]
)(),
),
cutFaces().localPoints(),
false
);
@ -1894,7 +1885,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
"(const polyMesh&, const bool, const scalar)"
) << "Did not match all of cutFaces to a master face" << nl
<< "First unmatched cut face:" << cutFaceI << " with points:"
<< IndirectList<point>(cutFaces().points(), cutF)()
<< UIndirectList<point>(cutFaces().points(), cutF)()
<< nl
<< "This usually means that the slave patch is not a"
<< " subdivision of the master patch"

View File

@ -1929,11 +1929,8 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
//(
// pointField
// (
// IndirectList<point>
// (
// mesh.points(),
// sharedPointLabels
// )()
// mesh.points(),
// sharedPointLabels
// ),
// mergeDist,
// false,

View File

@ -110,7 +110,7 @@ Foam::labelListList Foam::addPatchCellLayer::calcGlobalEdgeFaces
);
// Extract pp part
return IndirectList<labelList>(globalEdgeFaces, meshEdges)();
return UIndirectList<labelList>(globalEdgeFaces, meshEdges);
}
@ -629,7 +629,7 @@ void Foam::addPatchCellLayer::setRefinement
{
labelList n(mesh_.nPoints(), 0);
IndirectList<label>(n, meshPoints) = nPointLayers;
UIndirectList<label>(n, meshPoints) = nPointLayers;
syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0, false);
// Non-synced
@ -706,7 +706,7 @@ void Foam::addPatchCellLayer::setRefinement
{
pointField d(mesh_.nPoints(), wallPoint::greatPoint);
IndirectList<point>(d, meshPoints) = firstLayerDisp;
UIndirectList<point>(d, meshPoints) = firstLayerDisp;
syncTools::syncPointList
(
mesh_,

View File

@ -565,7 +565,7 @@ void Foam::combineFaces::setRefinement
const labelList& setFaces = faceSets[setI];
masterFace_[setI] = setFaces[0];
faceSetsVertices_[setI] = IndirectList<face>
faceSetsVertices_[setI] = UIndirectList<face>
(
mesh_.faces(),
setFaces

View File

@ -28,7 +28,6 @@ License
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "ListOps.H"
#include "IndirectList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -746,7 +746,7 @@ Foam::label Foam::hexRef8::findLevel
FatalErrorIn("hexRef8::findLevel(..)")
<< "face:" << f
<< " level:" << IndirectList<label>(pointLevel_, f)()
<< " level:" << UIndirectList<label>(pointLevel_, f)()
<< " startFp:" << startFp
<< " wantedLevel:" << wantedLevel
<< abort(FatalError);
@ -774,7 +774,7 @@ Foam::label Foam::hexRef8::findLevel
FatalErrorIn("hexRef8::findLevel(..)")
<< "face:" << f
<< " level:" << IndirectList<label>(pointLevel_, f)()
<< " level:" << UIndirectList<label>(pointLevel_, f)()
<< " startFp:" << startFp
<< " wantedLevel:" << wantedLevel
<< abort(FatalError);
@ -823,7 +823,7 @@ void Foam::hexRef8::checkInternalOrientation
)
{
face compactFace(identity(newFace.size()));
pointField compactPoints(IndirectList<point>(meshMod.points(), newFace)());
pointField compactPoints(meshMod.points(), newFace);
vector n(compactFace.normal(compactPoints));
@ -869,7 +869,7 @@ void Foam::hexRef8::checkBoundaryOrientation
)
{
face compactFace(identity(newFace.size()));
pointField compactPoints(IndirectList<point>(meshMod.points(), newFace)());
pointField compactPoints(meshMod.points(), newFace);
vector n(compactFace.normal(compactPoints));
@ -1308,11 +1308,11 @@ void Foam::hexRef8::createInternalFaces
<< "cell:" << cellI << " cLevel:" << cLevel
<< " cell points:" << cPoints
<< " pointLevel:"
<< IndirectList<label>(pointLevel_, cPoints)()
<< UIndirectList<label>(pointLevel_, cPoints)()
<< " face:" << faceI
<< " f:" << f
<< " pointLevel:"
<< IndirectList<label>(pointLevel_, f)()
<< UIndirectList<label>(pointLevel_, f)()
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
<< " faceMidPoint:" << faceMidPoint[faceI]
<< " faceMidPointI:" << faceMidPointI
@ -1381,11 +1381,11 @@ void Foam::hexRef8::createInternalFaces
<< "cell:" << cellI << " cLevel:" << cLevel
<< " cell points:" << cPoints
<< " pointLevel:"
<< IndirectList<label>(pointLevel_, cPoints)()
<< UIndirectList<label>(pointLevel_, cPoints)()
<< " face:" << faceI
<< " f:" << f
<< " pointLevel:"
<< IndirectList<label>(pointLevel_, f)()
<< UIndirectList<label>(pointLevel_, f)()
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
<< " faceMidPoint:" << faceMidPoint[faceI]
<< " faceMidPointI:" << faceMidPointI
@ -3511,7 +3511,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
<< " lower level" << endl
<< "cellPoints:" << cPoints << endl
<< "pointLevels:"
<< IndirectList<label>(pointLevel_, cPoints)() << endl
<< UIndirectList<label>(pointLevel_, cPoints)() << endl
<< abort(FatalError);
}
}
@ -4473,7 +4473,7 @@ void Foam::hexRef8::checkMesh() const
<< "Coupled face " << faceI
<< " on patch " << patchI
<< " " << mesh_.boundaryMesh()[patchI].name()
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
<< " has face area:" << magArea
<< " (coupled) neighbour face area differs:"
<< neiFaceAreas[i]
@ -4515,7 +4515,7 @@ void Foam::hexRef8::checkMesh() const
<< "Coupled face " << faceI
<< " on patch " << patchI
<< " " << mesh_.boundaryMesh()[patchI].name()
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
<< " has size:" << f.size()
<< " (coupled) neighbour face has size:"
<< nVerts[i]
@ -4565,7 +4565,7 @@ void Foam::hexRef8::checkMesh() const
<< "Coupled face " << faceI
<< " on patch " << patchI
<< " " << mesh_.boundaryMesh()[patchI].name()
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
<< " has anchor vector:" << anchorVec
<< " (coupled) neighbour face anchor vector differs:"
<< anchorPoints[i]

View File

@ -375,7 +375,7 @@ void Foam::removeFaces::mergeFaces
//{
// Pout<< "Modifying masterface " << faceI
// << " from faces:" << faceLabels
// << " old verts:" << IndirectList<face>(mesh_.faces(), faceLabels)
// << " old verts:" << UIndirectList<face>(mesh_.faces(), faceLabels)
// << " for new verts:"
// << mergedFace
// << " possibly new owner " << own

View File

@ -353,7 +353,7 @@ void Foam::removePoints::setRefinement
// Points from the mesh
List<point> meshPoints
(
IndirectList<point>
UIndirectList<point>
(
mesh_.points(),
mesh_.faces()[savedFaceLabels_[saveI]] // mesh face

View File

@ -202,7 +202,7 @@ void Foam::enrichedPatch::calcCutFaces() const
// Grab the next point options
// Pout << "curPointLabel: " << mp[curPointLabel] << endl;
const labelList& nextPoints = pp[curPointLabel];
// Pout << "nextPoints: " << IndirectList<label>(mp, nextPoints) << endl;
// Pout << "nextPoints: " << UIndirectList<label>(mp, nextPoints) << endl;
// Get the vector along the edge and the right vector
vector ahead = curPoint - lp[prevPointLabel];
ahead -= normal*(normal & ahead);

View File

@ -165,7 +165,7 @@ void directMappedFixedValueFvPatchField<Type>::getNewValues
if (Pstream::myProcNo() == sendProc)
{
OPstream toProc(Pstream::scheduled, recvProc);
toProc<< IndirectList<Type>(sendValues, sendLabels[recvProc])();
toProc<< UIndirectList<Type>(sendValues, sendLabels[recvProc])();
}
else
{
@ -188,7 +188,11 @@ void directMappedFixedValueFvPatchField<Type>::getNewValues
// Do data from myself
{
IndirectList<Type> fromFld(sendValues, sendLabels[Pstream::myProcNo()]);
UIndirectList<Type> fromFld
(
sendValues,
sendLabels[Pstream::myProcNo()]
);
// Destination faces
const labelList& faceLabels = receiveFaceLabels[Pstream::myProcNo()];

View File

@ -162,8 +162,8 @@ void directMappedVelocityFluxFixedValueFvPatchField::getNewValues
if (Pstream::myProcNo() == sendProc)
{
OPstream toProc(Pstream::scheduled, recvProc);
toProc<< IndirectList<vector>(sendUValues, sendLabels[recvProc])();
toProc<< IndirectList<scalar>
toProc<< UIndirectList<vector>(sendUValues, sendLabels[recvProc])();
toProc<< UIndirectList<scalar>
(
sendPhiValues,
sendLabels[recvProc]
@ -192,13 +192,13 @@ void directMappedVelocityFluxFixedValueFvPatchField::getNewValues
// Do data from myself
{
IndirectList<vector> fromUFld
UIndirectList<vector> fromUFld
(
sendUValues,
sendLabels[Pstream::myProcNo()]
);
IndirectList<scalar> fromPhiFld
UIndirectList<scalar> fromPhiFld
(
sendPhiValues,
sendLabels[Pstream::myProcNo()]

View File

@ -474,7 +474,7 @@ void Foam::directMappedPolyPatch::calcMapping() const
forAll(subMap, procI)
{
sendLabels[procI] = IndirectList<label>
sendLabels[procI] = UIndirectList<label>
(
sampleIndices,
subMap[procI]
@ -493,7 +493,7 @@ void Foam::directMappedPolyPatch::calcMapping() const
forAll(constructMap, procI)
{
receiveFaceLabels[procI] =
IndirectList<label>(patchFaces, constructMap[procI]);
UIndirectList<label>(patchFaces, constructMap[procI]);
if (debug)
{

View File

@ -545,7 +545,7 @@ Foam::label Foam::meshTools::otherEdge
"meshTools::otherEdge(const primitiveMesh&, const labelList&"
", const label, const label)"
) << "Can not find edge in "
<< IndirectList<edge>(mesh.edges(), edgeLabels)()
<< UIndirectList<edge>(mesh.edges(), edgeLabels)()
<< " connected to edge "
<< thisEdgeI << " with vertices " << mesh.edges()[thisEdgeI]
<< " on side " << thisVertI << abort(FatalError);

View File

@ -102,8 +102,8 @@ void Foam::primitiveMeshGeometry::updateCellCentresAndVols
)
{
// Clear the fields for accumulation
IndirectList<vector>(cellCentres_, changedCells) = vector::zero;
IndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
UIndirectList<vector>(cellCentres_, changedCells) = vector::zero;
UIndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
const labelList& own = mesh_.faceOwner();
const labelList& nei = mesh_.faceNeighbour();
@ -111,9 +111,9 @@ void Foam::primitiveMeshGeometry::updateCellCentresAndVols
// first estimate the approximate cell centre as the average of face centres
vectorField cEst(mesh_.nCells());
IndirectList<vector>(cEst, changedCells) = vector::zero;
UIndirectList<vector>(cEst, changedCells) = vector::zero;
scalarField nCellFaces(mesh_.nCells());
IndirectList<scalar>(nCellFaces, changedCells) = 0.0;
UIndirectList<scalar>(nCellFaces, changedCells) = 0.0;
forAll(changedFaces, i)
{

View File

@ -432,7 +432,7 @@ void Foam::searchableSurfaceCollection::getRegion
labelList surfRegion;
subGeom_[surfI].getRegion
(
IndirectList<pointIndexHit>(info, indices),
UIndirectList<pointIndexHit>(info, indices),
surfRegion
);
forAll(indices, i)
@ -495,7 +495,7 @@ void Foam::searchableSurfaceCollection::getNormal
vectorField surfNormal;
subGeom_[surfI].getNormal
(
IndirectList<pointIndexHit>(info, indices),
UIndirectList<pointIndexHit>(info, indices),
surfNormal
);
forAll(indices, i)

View File

@ -255,10 +255,7 @@ void topoSet::writeDebug
) const
{
// Bounding box of contents.
boundBox bb
(
pointField(IndirectList<point>(coords, toc())())
);
boundBox bb(pointField(coords, toc()));
Pout<< "Set bounding box: min = "
<< bb.min() << " max = " << bb.max() << " meters. " << endl << endl;

View File

@ -212,7 +212,7 @@ void Foam::sampledSets::combineSampledSets
(
samplePts.name(),
samplePts.axis(),
IndirectList<point>(allPts, indexSets[seti]),
UIndirectList<point>(allPts, indexSets[seti]),
refPt
)
);

View File

@ -198,8 +198,11 @@ void Foam::sampledSets::combineSampledValues
)
);
masterValues[seti] =
IndirectList<T>(allData, indexSets[seti])();
masterValues[seti] = UIndirectList<T>
(
allData,
indexSets[seti]
)();
}
}

View File

@ -422,7 +422,7 @@ bool Foam::faceTriangulation::split
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Illegal face:" << f
<< " with points " << IndirectList<point>(points, f)()
<< " with points " << UIndirectList<point>(points, f)()
<< endl;
return false;
@ -501,7 +501,8 @@ bool Foam::faceTriangulation::split
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Cannot find valid diagonal on face " << f
<< " with points " << IndirectList<point>(points, f)() << nl
<< " with points " << UIndirectList<point>(points, f)()
<< nl
<< "Returning naive triangulation starting from "
<< f[maxIndex] << " which might not be correct for a"
<< " concave or warped face" << endl;
@ -530,7 +531,8 @@ bool Foam::faceTriangulation::split
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Cannot find valid diagonal on face " << f
<< " with points " << IndirectList<point>(points, f)() << nl
<< " with points " << UIndirectList<point>(points, f)()
<< nl
<< "Returning empty triFaceList" << endl;
return false;
@ -564,7 +566,7 @@ bool Foam::faceTriangulation::split
"split(const bool, const pointField&, const face&"
", const vector&, label&)"
) << "Illegal split of face:" << f
<< " with points " << IndirectList<point>(points, f)()
<< " with points " << UIndirectList<point>(points, f)()
<< " at indices " << index1 << " and " << index2
<< abort(FatalError);
}

View File

@ -112,7 +112,7 @@ void triSurface::calcSortedEdgeFaces() const
faceAngles.sort();
sortedEdgeFaces[edgeI] = IndirectList<label>
sortedEdgeFaces[edgeI] = UIndirectList<label>
(
myFaceNbs,
faceAngles.indices()
@ -179,7 +179,7 @@ void triSurface::calcEdgeOwner() const
<< "Edge " << edgeI << " vertices:" << e
<< " is used by faces " << myFaces
<< " vertices:"
<< IndirectList<labelledTri>(localFaces(), myFaces)()
<< UIndirectList<labelledTri>(localFaces(), myFaces)()
<< " none of which use the edge vertices in the same order"
<< nl << "I give up" << abort(FatalError);
}