UIndirectList
This commit is contained in:
parent
6c387489d7
commit
0128b2be68
3
applications/test/UIndirectListTest/Make/files
Normal file
3
applications/test/UIndirectListTest/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
UIndirectListTest.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/UIndirectListTest
|
0
applications/test/UIndirectListTest/Make/options
Normal file
0
applications/test/UIndirectListTest/Make/options
Normal file
@ -26,51 +26,68 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
#include "UIndirectList.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
//- Construct given size
|
using namespace Foam;
|
||||||
template<class T>
|
|
||||||
inline Foam::IndirectList<T>::IndirectList
|
|
||||||
(
|
|
||||||
const Foam::UList<T>& completeList,
|
|
||||||
const Foam::List<label>& addresses
|
|
||||||
)
|
|
||||||
:
|
|
||||||
completeList_(completeList),
|
|
||||||
addresses_(addresses)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
int main(int argc, char *argv[])
|
||||||
|
|
||||||
template<class T>
|
|
||||||
inline Foam::label Foam::IndirectList<T>::size() const
|
|
||||||
{
|
{
|
||||||
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>
|
List<double> realList = UIndirectList<double>(completeList, addresses);
|
||||||
inline const Foam::UList<T>& Foam::IndirectList<T>::
|
|
||||||
completeList() const
|
Info<< "realList:" << realList << endl;
|
||||||
{
|
|
||||||
return completeList_;
|
List<double> realList2(UIndirectList<double>(completeList, addresses));
|
||||||
}
|
|
||||||
|
Info<< "realList2:" << realList2 << endl;
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
Info << "\nEnd\n" << endl;
|
||||||
inline const Foam::List<Foam::label>& Foam::IndirectList<T>::addresses() const
|
|
||||||
{
|
|
||||||
return addresses_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
inline const T& Foam::IndirectList<T>::operator[](const Foam::label i) const
|
|
||||||
{
|
|
||||||
return completeList_[addresses_[i]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,7 +177,7 @@ label mergePatchFaces
|
|||||||
List<faceList> allFaceSetsFaces(allFaceSets.size());
|
List<faceList> allFaceSetsFaces(allFaceSets.size());
|
||||||
forAll(allFaceSets, setI)
|
forAll(allFaceSets, setI)
|
||||||
{
|
{
|
||||||
allFaceSetsFaces[setI] = IndirectList<face>
|
allFaceSetsFaces[setI] = UIndirectList<face>
|
||||||
(
|
(
|
||||||
mesh.faces(),
|
mesh.faces(),
|
||||||
allFaceSets[setI]
|
allFaceSets[setI]
|
||||||
|
@ -76,7 +76,7 @@ void Foam::meshDualiser::checkPolyTopoChange(const polyTopoChange& meshMod)
|
|||||||
"meshDualiser::checkPolyTopoChange(const polyTopoChange&)"
|
"meshDualiser::checkPolyTopoChange(const polyTopoChange&)"
|
||||||
) << "duplicate verts:" << newToOld[newI]
|
) << "duplicate verts:" << newToOld[newI]
|
||||||
<< " coords:"
|
<< " coords:"
|
||||||
<< IndirectList<point>(points, newToOld[newI])()
|
<< UIndirectList<point>(points, newToOld[newI])()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,10 +226,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
pointField facePoints
|
pointField facePoints(meshMod.points(), newFace);
|
||||||
(
|
|
||||||
IndirectList<point>(meshMod.points(), newFace)()
|
|
||||||
);
|
|
||||||
|
|
||||||
labelList oldToNew;
|
labelList oldToNew;
|
||||||
pointField newPoints;
|
pointField newPoints;
|
||||||
@ -289,7 +286,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " between dualowner:" << dualCell0
|
// << " between dualowner:" << dualCell0
|
||||||
// << " dualneigbour:" << dualCell1
|
// << " dualneigbour:" << dualCell1
|
||||||
@ -316,7 +313,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " between dualowner:" << dualCell1
|
// << " between dualowner:" << dualCell1
|
||||||
// << " dualneigbour:" << dualCell0
|
// << " dualneigbour:" << dualCell0
|
||||||
@ -373,7 +370,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
|||||||
//n /= mag(n);
|
//n /= mag(n);
|
||||||
//Pout<< "Generated boundary dualFace:" << dualFaceI
|
//Pout<< "Generated boundary dualFace:" << dualFaceI
|
||||||
// << " verts:" << newFace
|
// << " verts:" << newFace
|
||||||
// << " points:" << IndirectList<point>(meshMod.points(), newFace)()
|
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||||
// << " n:" << n
|
// << " n:" << n
|
||||||
// << " on dualowner:" << dualCellI
|
// << " on dualowner:" << dualCellI
|
||||||
// << endl;
|
// << endl;
|
||||||
@ -568,7 +565,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
|
|
||||||
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
||||||
// << " verts:" << f
|
// << " verts:" << f
|
||||||
// << " points:" << IndirectList<point>(mesh_.points(), f)()
|
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
// << " started walking at edge:" << fEdges[fp]
|
// << " started walking at edge:" << fEdges[fp]
|
||||||
// << " verts:" << mesh_.edges()[fEdges[fp]]
|
// << " verts:" << mesh_.edges()[fEdges[fp]]
|
||||||
// << endl;
|
// << endl;
|
||||||
@ -617,7 +614,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
|||||||
{
|
{
|
||||||
FatalErrorIn("createFacesFromInternalFace(..)")
|
FatalErrorIn("createFacesFromInternalFace(..)")
|
||||||
<< "face:" << faceI << " verts:" << f
|
<< "face:" << faceI << " verts:" << f
|
||||||
<< " points:" << IndirectList<point>(mesh_.points(), f)()
|
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " no feature edge between " << f[fp]
|
<< " no feature edge between " << f[fp]
|
||||||
<< " and " << f[nextFp] << " although have different"
|
<< " and " << f[nextFp] << " although have different"
|
||||||
<< " dual cells." << endl
|
<< " dual cells." << endl
|
||||||
|
@ -70,7 +70,7 @@ void writePointSet
|
|||||||
|
|
||||||
labelList pointLabels(set.toc());
|
labelList pointLabels(set.toc());
|
||||||
|
|
||||||
pointField setPoints(IndirectList<point>(mesh.points(), pointLabels)());
|
pointField setPoints(mesh.points(), pointLabels);
|
||||||
|
|
||||||
// Write points
|
// Write points
|
||||||
|
|
||||||
|
@ -22,14 +22,11 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "regionSide.H"
|
#include "regionSide.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
#include "primitiveMesh.H"
|
#include "primitiveMesh.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -113,7 +110,7 @@ Foam::label Foam::regionSide::otherEdge
|
|||||||
) << "Cannot find other edge on face " << faceI << " that uses point "
|
) << "Cannot find other edge on face " << faceI << " that uses point "
|
||||||
<< pointI << " but not point " << freePointI << endl
|
<< pointI << " but not point " << freePointI << endl
|
||||||
<< "Edges on face:" << fEdges
|
<< "Edges on face:" << fEdges
|
||||||
<< " verts:" << IndirectList<edge>(mesh.edges(), fEdges)()
|
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
|
||||||
<< " Vertices on face:"
|
<< " Vertices on face:"
|
||||||
<< mesh.faces()[faceI]
|
<< mesh.faces()[faceI]
|
||||||
<< " Vertices on original edge:" << e << abort(FatalError);
|
<< " Vertices on original edge:" << e << abort(FatalError);
|
||||||
|
@ -50,15 +50,12 @@ Description
|
|||||||
#include "attachDetach.H"
|
#include "attachDetach.H"
|
||||||
#include "attachPolyTopoChanger.H"
|
#include "attachPolyTopoChanger.H"
|
||||||
#include "regionSide.H"
|
#include "regionSide.H"
|
||||||
|
#include "primitiveFacePatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
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.
|
// Find edge between points v0 and v1.
|
||||||
label findEdge(const primitiveMesh& mesh, const label v0, const label 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.
|
// 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.
|
// 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();
|
const labelList& meshPoints = fPatch.meshPoints();
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@ Description
|
|||||||
#include "polyTopoChanger.H"
|
#include "polyTopoChanger.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
#include "slidingInterface.H"
|
#include "slidingInterface.H"
|
||||||
#include "perfectInterface.H"
|
#include "perfectInterface.H"
|
||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
|
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "writePointSet.H"
|
#include "writePointSet.H"
|
||||||
@ -76,7 +74,7 @@ void writePointSet
|
|||||||
|
|
||||||
writeFuns::insert
|
writeFuns::insert
|
||||||
(
|
(
|
||||||
IndirectList<point>(vMesh.mesh().points(), set.toc())(),
|
UIndirectList<point>(vMesh.mesh().points(), set.toc())(),
|
||||||
ptField
|
ptField
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ label findEdge
|
|||||||
|
|
||||||
FatalErrorIn("findEdge") << "Cannot find edge with labels " << v0
|
FatalErrorIn("findEdge") << "Cannot find edge with labels " << v0
|
||||||
<< ' ' << v1 << " in candidates " << edgeLabels
|
<< ' ' << v1 << " in candidates " << edgeLabels
|
||||||
<< " with vertices:" << IndirectList<edge>(surf.edges(), edgeLabels)()
|
<< " with vertices:" << UIndirectList<edge>(surf.edges(), edgeLabels)()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -346,7 +346,7 @@ label otherEdge
|
|||||||
FatalErrorIn("otherEdge") << "Cannot find other edge on face " << faceI
|
FatalErrorIn("otherEdge") << "Cannot find other edge on face " << faceI
|
||||||
<< " verts:" << surf.localPoints()[faceI]
|
<< " verts:" << surf.localPoints()[faceI]
|
||||||
<< " connected to point " << pointI
|
<< " connected to point " << pointI
|
||||||
<< " faceEdges:" << IndirectList<edge>(surf.edges(), fEdges)()
|
<< " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -31,6 +31,7 @@ License
|
|||||||
#include "PtrList.H"
|
#include "PtrList.H"
|
||||||
#include "SLList.H"
|
#include "SLList.H"
|
||||||
#include "IndirectList.H"
|
#include "IndirectList.H"
|
||||||
|
#include "UIndirectList.H"
|
||||||
#include "BiIndirectList.H"
|
#include "BiIndirectList.H"
|
||||||
#include "contiguous.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>
|
// Construct as copy of BiIndirectList<T>
|
||||||
template<class T>
|
template<class T>
|
||||||
Foam::List<T>::List(const BiIndirectList<T>& lst)
|
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.
|
// Assignment operator. Takes linear time.
|
||||||
template<class T>
|
template<class T>
|
||||||
void Foam::List<T>::operator=(const BiIndirectList<T>& lst)
|
void Foam::List<T>::operator=(const BiIndirectList<T>& lst)
|
||||||
|
@ -66,6 +66,7 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
|
|||||||
class DynamicList;
|
class DynamicList;
|
||||||
template<class T> class SortableList;
|
template<class T> class SortableList;
|
||||||
template<class T> class IndirectList;
|
template<class T> class IndirectList;
|
||||||
|
template<class T> class UIndirectList;
|
||||||
template<class T> class BiIndirectList;
|
template<class T> class BiIndirectList;
|
||||||
|
|
||||||
typedef UList<label> unallocLabelList;
|
typedef UList<label> unallocLabelList;
|
||||||
@ -133,6 +134,9 @@ public:
|
|||||||
//- Construct as copy of IndirectList<T>
|
//- Construct as copy of IndirectList<T>
|
||||||
List(const IndirectList<T>&);
|
List(const IndirectList<T>&);
|
||||||
|
|
||||||
|
//- Construct as copy of UIndirectList<T>
|
||||||
|
List(const UIndirectList<T>&);
|
||||||
|
|
||||||
//- Construct as copy of BiIndirectList<T>
|
//- Construct as copy of BiIndirectList<T>
|
||||||
List(const BiIndirectList<T>&);
|
List(const BiIndirectList<T>&);
|
||||||
|
|
||||||
@ -210,6 +214,9 @@ public:
|
|||||||
//- Assignment from IndirectList operator. Takes linear time.
|
//- Assignment from IndirectList operator. Takes linear time.
|
||||||
void operator=(const IndirectList<T>&);
|
void operator=(const IndirectList<T>&);
|
||||||
|
|
||||||
|
//- Assignment from UIndirectList operator. Takes linear time.
|
||||||
|
void operator=(const UIndirectList<T>&);
|
||||||
|
|
||||||
//- Assignment from BiIndirectList operator. Takes linear time.
|
//- Assignment from BiIndirectList operator. Takes linear time.
|
||||||
void operator=(const BiIndirectList<T>&);
|
void operator=(const BiIndirectList<T>&);
|
||||||
|
|
||||||
|
@ -23,17 +23,19 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::IndirectList
|
Foam::UIndirectList
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
A List with indirect addressing. Like IndirectList but does not store
|
||||||
|
addressing.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
IndirectListI.H
|
UIndirectListI.H
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef IndirectList_H
|
#ifndef UIndirectList_H
|
||||||
#define IndirectList_H
|
#define UIndirectList_H
|
||||||
|
|
||||||
#include "List.H"
|
#include "List.H"
|
||||||
|
|
||||||
@ -43,22 +45,16 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class IndirectList Declaration
|
Class UIndirectList Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class IndirectList
|
class UIndirectList
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
const UList<T>& completeList_;
|
UList<T>& completeList_;
|
||||||
List<label> addresses_;
|
const UList<label>& addressing_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const IndirectList<T>&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -66,7 +62,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given the complete list and the addressing array
|
//- 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
|
// Member Functions
|
||||||
@ -74,14 +70,28 @@ public:
|
|||||||
// Access
|
// Access
|
||||||
|
|
||||||
inline label size() const;
|
inline label size() const;
|
||||||
|
inline bool empty() const;
|
||||||
|
|
||||||
inline const UList<T>& completeList() const;
|
inline const UList<T>& completeList() const;
|
||||||
inline const List<label>& addresses() const;
|
inline const List<label>& addressing() const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// 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
|
//- Return const access to an element
|
||||||
inline const T& operator[](const label) const;
|
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"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
130
src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H
Normal file
130
src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
@ -629,7 +629,7 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
|||||||
|
|
||||||
toMaster
|
toMaster
|
||||||
<< sharedPointAddr_
|
<< sharedPointAddr_
|
||||||
<< IndirectList<point>(mesh_.points(), sharedPointLabels_)();
|
<< UIndirectList<point>(mesh_.points(), sharedPointLabels_)();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receive sharedPoints
|
// Receive sharedPoints
|
||||||
|
@ -653,8 +653,8 @@ void Foam::globalPoints::sendSharedPoints(const labelList& changedIndices) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
toNeighbour
|
toNeighbour
|
||||||
<< IndirectList<label>(sharedPointAddr_, changedIndices)()
|
<< UIndirectList<label>(sharedPointAddr_, changedIndices)()
|
||||||
<< IndirectList<label>(sharedPointLabels_, changedIndices)();
|
<< UIndirectList<label>(sharedPointLabels_, changedIndices)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ Foam::List<Foam::labelPair> Foam::mapDistribute::schedule
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Processors involved in my schedule
|
// Processors involved in my schedule
|
||||||
return IndirectList<labelPair>(allComms, mySchedule);
|
return UIndirectList<labelPair>(allComms, mySchedule);
|
||||||
|
|
||||||
|
|
||||||
//if (debug)
|
//if (debug)
|
||||||
|
@ -188,11 +188,11 @@ void Foam::cyclicPolyPatch::calcTransforms()
|
|||||||
<< endl
|
<< endl
|
||||||
<< "Mesh face:" << start()+facei
|
<< "Mesh face:" << start()+facei
|
||||||
<< " vertices:"
|
<< " vertices:"
|
||||||
<< IndirectList<point>(points, operator[](facei))()
|
<< UIndirectList<point>(points, operator[](facei))()
|
||||||
<< endl
|
<< endl
|
||||||
<< "Neighbour face:" << start()+nbrFacei
|
<< "Neighbour face:" << start()+nbrFacei
|
||||||
<< " vertices:"
|
<< " vertices:"
|
||||||
<< IndirectList<point>(points, operator[](nbrFacei))()
|
<< UIndirectList<point>(points, operator[](nbrFacei))()
|
||||||
<< endl
|
<< endl
|
||||||
<< "Rerun with cyclic debug flag set"
|
<< "Rerun with cyclic debug flag set"
|
||||||
<< " for more information." << exit(FatalError);
|
<< " for more information." << exit(FatalError);
|
||||||
@ -403,12 +403,12 @@ bool Foam::cyclicPolyPatch::getGeometricHalves
|
|||||||
fileName nm0(casePath/name()+"_half0_faces.obj");
|
fileName nm0(casePath/name()+"_half0_faces.obj");
|
||||||
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half0"
|
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half0"
|
||||||
<< " faces to OBJ file " << nm0 << endl;
|
<< " 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");
|
fileName nm1(casePath/name()+"_half1_faces.obj");
|
||||||
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half1"
|
Pout<< "cyclicPolyPatch::getGeometricHalves : Writing half1"
|
||||||
<< " faces to OBJ file " << nm1 << endl;
|
<< " 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
|
// Dump face centres
|
||||||
@ -672,7 +672,7 @@ bool Foam::cyclicPolyPatch::matchAnchors
|
|||||||
) << "Patch:" << name() << " : "
|
) << "Patch:" << name() << " : "
|
||||||
<< "Cannot find point on face " << f
|
<< "Cannot find point on face " << f
|
||||||
<< " with vertices:"
|
<< " with vertices:"
|
||||||
<< IndirectList<point>(pp.points(), f)()
|
<< UIndirectList<point>(pp.points(), f)()
|
||||||
<< " that matches point " << wantedAnchor
|
<< " that matches point " << wantedAnchor
|
||||||
<< " when matching the halves of cyclic patch " << name()
|
<< " when matching the halves of cyclic patch " << name()
|
||||||
<< endl
|
<< endl
|
||||||
@ -1133,8 +1133,8 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
half1ToPatch = half0ToPatch + halfSize;
|
half1ToPatch = half0ToPatch + halfSize;
|
||||||
|
|
||||||
// Get faces
|
// Get faces
|
||||||
faceList half0Faces(IndirectList<face>(pp, half0ToPatch));
|
faceList half0Faces(UIndirectList<face>(pp, half0ToPatch));
|
||||||
faceList half1Faces(IndirectList<face>(pp, half1ToPatch));
|
faceList half1Faces(UIndirectList<face>(pp, half1ToPatch));
|
||||||
|
|
||||||
// Get geometric quantities
|
// Get geometric quantities
|
||||||
pointField half0Ctrs, half1Ctrs, anchors0, ppPoints;
|
pointField half0Ctrs, half1Ctrs, anchors0, ppPoints;
|
||||||
@ -1221,8 +1221,8 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
}
|
}
|
||||||
|
|
||||||
// And redo all matching
|
// And redo all matching
|
||||||
half0Faces = IndirectList<face>(pp, half0ToPatch);
|
half0Faces = UIndirectList<face>(pp, half0ToPatch);
|
||||||
half1Faces = IndirectList<face>(pp, half1ToPatch);
|
half1Faces = UIndirectList<face>(pp, half1ToPatch);
|
||||||
|
|
||||||
getCentresAndAnchors
|
getCentresAndAnchors
|
||||||
(
|
(
|
||||||
@ -1334,8 +1334,8 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
if (baffleI == halfSize)
|
if (baffleI == halfSize)
|
||||||
{
|
{
|
||||||
// And redo all matching
|
// And redo all matching
|
||||||
half0Faces = IndirectList<face>(pp, half0ToPatch);
|
half0Faces = UIndirectList<face>(pp, half0ToPatch);
|
||||||
half1Faces = IndirectList<face>(pp, half1ToPatch);
|
half1Faces = UIndirectList<face>(pp, half1ToPatch);
|
||||||
|
|
||||||
getCentresAndAnchors
|
getCentresAndAnchors
|
||||||
(
|
(
|
||||||
@ -1420,8 +1420,8 @@ bool Foam::cyclicPolyPatch::order
|
|||||||
}
|
}
|
||||||
|
|
||||||
// And redo all matching
|
// And redo all matching
|
||||||
half0Faces = IndirectList<face>(pp, half0ToPatch);
|
half0Faces = UIndirectList<face>(pp, half0ToPatch);
|
||||||
half1Faces = IndirectList<face>(pp, half1ToPatch);
|
half1Faces = UIndirectList<face>(pp, half1ToPatch);
|
||||||
|
|
||||||
getCentresAndAnchors
|
getCentresAndAnchors
|
||||||
(
|
(
|
||||||
|
@ -207,7 +207,7 @@ void Foam::processorPolyPatch::calcGeometry()
|
|||||||
<< endl
|
<< endl
|
||||||
<< "Mesh face:" << start()+facei
|
<< "Mesh face:" << start()+facei
|
||||||
<< " vertices:"
|
<< " vertices:"
|
||||||
<< IndirectList<point>(points(), operator[](facei))()
|
<< UIndirectList<point>(points(), operator[](facei))()
|
||||||
<< endl
|
<< endl
|
||||||
<< "Rerun with processor debug flag set for"
|
<< "Rerun with processor debug flag set for"
|
||||||
<< " more information." << exit(FatalError);
|
<< " more information." << exit(FatalError);
|
||||||
@ -731,7 +731,7 @@ bool Foam::processorPolyPatch::order
|
|||||||
<< " : "
|
<< " : "
|
||||||
<< "Cannot find point on face " << pp[oldFaceI]
|
<< "Cannot find point on face " << pp[oldFaceI]
|
||||||
<< " with vertices "
|
<< " with vertices "
|
||||||
<< IndirectList<point>(pp.points(), pp[oldFaceI])()
|
<< UIndirectList<point>(pp.points(), pp[oldFaceI])()
|
||||||
<< " that matches point " << wantedAnchor
|
<< " that matches point " << wantedAnchor
|
||||||
<< " when matching the halves of processor patch " << name()
|
<< " when matching the halves of processor patch " << name()
|
||||||
<< "Continuing with incorrect face ordering from now on!"
|
<< "Continuing with incorrect face ordering from now on!"
|
||||||
|
@ -87,8 +87,7 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
|||||||
|
|
||||||
labelList minProc(mesh.globalData().nGlobalPoints(), labelMax);
|
labelList minProc(mesh.globalData().nGlobalPoints(), labelMax);
|
||||||
|
|
||||||
IndirectList<label>(minProc, sharedPointAddr) =
|
UIndirectList<label>(minProc, sharedPointAddr) = Pstream::myProcNo();
|
||||||
Pstream::myProcNo();
|
|
||||||
|
|
||||||
Pstream::listCombineGather(minProc, minEqOp<label>());
|
Pstream::listCombineGather(minProc, minEqOp<label>());
|
||||||
Pstream::listCombineScatter(minProc);
|
Pstream::listCombineScatter(minProc);
|
||||||
@ -207,8 +206,7 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
|||||||
|
|
||||||
labelList minProc(mesh.globalData().nGlobalEdges(), labelMax);
|
labelList minProc(mesh.globalData().nGlobalEdges(), labelMax);
|
||||||
|
|
||||||
IndirectList<label>(minProc, sharedEdgeAddr) =
|
UIndirectList<label>(minProc, sharedEdgeAddr) = Pstream::myProcNo();
|
||||||
Pstream::myProcNo();
|
|
||||||
|
|
||||||
Pstream::listCombineGather(minProc, minEqOp<label>());
|
Pstream::listCombineGather(minProc, minEqOp<label>());
|
||||||
Pstream::listCombineScatter(minProc);
|
Pstream::listCombineScatter(minProc);
|
||||||
|
@ -37,7 +37,6 @@ SourceFiles
|
|||||||
#define ZoneMesh_H
|
#define ZoneMesh_H
|
||||||
|
|
||||||
#include "List.H"
|
#include "List.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
#include "regIOobject.H"
|
#include "regIOobject.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "pointFieldsFwd.H"
|
#include "pointFieldsFwd.H"
|
||||||
|
@ -81,7 +81,7 @@ Foam::PatchTools::edgeOwner
|
|||||||
<< "Edge " << edgeI << " vertices:" << edges[edgeI]
|
<< "Edge " << edgeI << " vertices:" << edges[edgeI]
|
||||||
<< " is used by faces " << nbrFaces
|
<< " is used by faces " << nbrFaces
|
||||||
<< " vertices:"
|
<< " vertices:"
|
||||||
<< IndirectList<Face>(localFaces, nbrFaces)()
|
<< UIndirectList<Face>(localFaces, nbrFaces)()
|
||||||
<< " none of which use the edge vertices in the same order"
|
<< " none of which use the edge vertices in the same order"
|
||||||
<< nl << "I give up" << abort(FatalError);
|
<< nl << "I give up" << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ Foam::PatchTools::sortedEdgeFaces
|
|||||||
|
|
||||||
faceAngles.sort();
|
faceAngles.sort();
|
||||||
|
|
||||||
sortedEdgeFaces[edgeI] = IndirectList<label>
|
sortedEdgeFaces[edgeI] = UIndirectList<label>
|
||||||
(
|
(
|
||||||
faceNbs,
|
faceNbs,
|
||||||
faceAngles.indices()
|
faceAngles.indices()
|
||||||
|
@ -1238,10 +1238,7 @@ void Foam::autoSnapDriver::smoothDisplacement
|
|||||||
magDisp().write();
|
magDisp().write();
|
||||||
|
|
||||||
Pout<< "Writing actual patch displacement ..." << endl;
|
Pout<< "Writing actual patch displacement ..." << endl;
|
||||||
vectorField actualPatchDisp
|
vectorField actualPatchDisp(disp, pp.meshPoints());
|
||||||
(
|
|
||||||
IndirectList<point>(disp, pp.meshPoints())()
|
|
||||||
);
|
|
||||||
dumpMove
|
dumpMove
|
||||||
(
|
(
|
||||||
mesh.time().path()/"actualPatchDisplacement.obj",
|
mesh.time().path()/"actualPatchDisplacement.obj",
|
||||||
|
@ -922,7 +922,7 @@ void Foam::refinementSurfaces::findNearest
|
|||||||
List<pointIndexHit>& hitInfo
|
List<pointIndexHit>& hitInfo
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
labelList geometries(IndirectList<label>(surfaces_, surfacesToTest));
|
labelList geometries(UIndirectList<label>(surfaces_, surfacesToTest));
|
||||||
|
|
||||||
// Do the tests. Note that findNearest returns index in geometries.
|
// Do the tests. Note that findNearest returns index in geometries.
|
||||||
searchableSurfacesQueries::findNearest
|
searchableSurfacesQueries::findNearest
|
||||||
@ -955,7 +955,7 @@ void Foam::refinementSurfaces::findNearestRegion
|
|||||||
labelList& hitRegion
|
labelList& hitRegion
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
labelList geometries(IndirectList<label>(surfaces_, surfacesToTest));
|
labelList geometries(UIndirectList<label>(surfaces_, surfacesToTest));
|
||||||
|
|
||||||
// Do the tests. Note that findNearest returns index in geometries.
|
// Do the tests. Note that findNearest returns index in geometries.
|
||||||
List<pointIndexHit> hitInfo;
|
List<pointIndexHit> hitInfo;
|
||||||
@ -991,7 +991,7 @@ void Foam::refinementSurfaces::findNearestRegion
|
|||||||
|
|
||||||
List<pointIndexHit> localHits
|
List<pointIndexHit> localHits
|
||||||
(
|
(
|
||||||
IndirectList<pointIndexHit>
|
UIndirectList<pointIndexHit>
|
||||||
(
|
(
|
||||||
hitInfo,
|
hitInfo,
|
||||||
localIndices
|
localIndices
|
||||||
|
@ -718,7 +718,7 @@ void Foam::fvMeshDistribute::getNeighbourData
|
|||||||
// Which processor they will end up on
|
// Which processor they will end up on
|
||||||
const labelList newProc
|
const labelList newProc
|
||||||
(
|
(
|
||||||
IndirectList<label>(distribution, pp.faceCells())
|
UIndirectList<label>(distribution, pp.faceCells())
|
||||||
);
|
);
|
||||||
|
|
||||||
OPstream toNeighbour(Pstream::blocking, procPatch.neighbProcNo());
|
OPstream toNeighbour(Pstream::blocking, procPatch.neighbProcNo());
|
||||||
@ -1192,7 +1192,7 @@ void Foam::fvMeshDistribute::sendMesh
|
|||||||
//
|
//
|
||||||
// forAll(cellZones, zoneI)
|
// forAll(cellZones, zoneI)
|
||||||
// {
|
// {
|
||||||
// IndirectList<label>(cellZoneID, cellZones[zoneI]) = zoneI;
|
// UIndirectList<label>(cellZoneID, cellZones[zoneI]) = zoneI;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ bool Foam::hexCellLooper::cut
|
|||||||
{
|
{
|
||||||
FatalErrorIn("hexCellLooper::walkHex") << "Face:" << faceVerts
|
FatalErrorIn("hexCellLooper::walkHex") << "Face:" << faceVerts
|
||||||
<< " on points:" << facePoints << endl
|
<< " on points:" << facePoints << endl
|
||||||
<< IndirectList<point>(facePoints, faceVerts)()
|
<< UIndirectList<point>(facePoints, faceVerts)()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,8 +103,8 @@ void Foam::polyMeshGeometry::updateCellCentresAndVols
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Clear the fields for accumulation
|
// Clear the fields for accumulation
|
||||||
IndirectList<vector>(cellCentres_, changedCells) = vector::zero;
|
UIndirectList<vector>(cellCentres_, changedCells) = vector::zero;
|
||||||
IndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
|
UIndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
|
||||||
|
|
||||||
const labelList& own = mesh_.faceOwner();
|
const labelList& own = mesh_.faceOwner();
|
||||||
const labelList& nei = mesh_.faceNeighbour();
|
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
|
// first estimate the approximate cell centre as the average of face centres
|
||||||
|
|
||||||
vectorField cEst(mesh_.nCells());
|
vectorField cEst(mesh_.nCells());
|
||||||
IndirectList<vector>(cEst, changedCells) = vector::zero;
|
UIndirectList<vector>(cEst, changedCells) = vector::zero;
|
||||||
scalarField nCellFaces(mesh_.nCells());
|
scalarField nCellFaces(mesh_.nCells());
|
||||||
IndirectList<scalar>(nCellFaces, changedCells) = 0.0;
|
UIndirectList<scalar>(nCellFaces, changedCells) = 0.0;
|
||||||
|
|
||||||
forAll(changedFaces, i)
|
forAll(changedFaces, i)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,6 @@ License
|
|||||||
#include "treeDataFace.H"
|
#include "treeDataFace.H"
|
||||||
#include "indexedOctree.H"
|
#include "indexedOctree.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -153,11 +152,7 @@ void Foam::faceCoupleInfo::writePointsFaces() const
|
|||||||
(
|
(
|
||||||
"cutToMasterPoints.obj",
|
"cutToMasterPoints.obj",
|
||||||
m.localPoints(),
|
m.localPoints(),
|
||||||
pointField
|
pointField(c.localPoints(), masterToCutPoints_));
|
||||||
(
|
|
||||||
IndirectList<point>(c.localPoints(), masterToCutPoints_)()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Pout<< "Writing cutToSlavePoints to cutToSlavePoints.obj" << endl;
|
Pout<< "Writing cutToSlavePoints to cutToSlavePoints.obj" << endl;
|
||||||
@ -166,10 +161,7 @@ void Foam::faceCoupleInfo::writePointsFaces() const
|
|||||||
(
|
(
|
||||||
"cutToSlavePoints.obj",
|
"cutToSlavePoints.obj",
|
||||||
s.localPoints(),
|
s.localPoints(),
|
||||||
pointField
|
pointField(c.localPoints(), slaveToCutPoints_)
|
||||||
(
|
|
||||||
IndirectList<point>(c.localPoints(), slaveToCutPoints_)()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +397,7 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
|||||||
if (report)
|
if (report)
|
||||||
{
|
{
|
||||||
Pout<< "mostAlignedEdge : finding nearest edge among "
|
Pout<< "mostAlignedEdge : finding nearest edge among "
|
||||||
<< IndirectList<edge>(cutFaces().edges(), pEdges)()
|
<< UIndirectList<edge>(cutFaces().edges(), pEdges)()
|
||||||
<< " connected to point " << pointI
|
<< " connected to point " << pointI
|
||||||
<< " coord:" << localPoints[pointI]
|
<< " coord:" << localPoints[pointI]
|
||||||
<< " running between " << edgeStart << " coord:"
|
<< " running between " << edgeStart << " coord:"
|
||||||
@ -623,7 +615,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
|
|||||||
"(const labelList&)"
|
"(const labelList&)"
|
||||||
) << " unsplitEdge:" << unsplitEdge
|
) << " unsplitEdge:" << unsplitEdge
|
||||||
<< " does not correspond to split edges "
|
<< " does not correspond to split edges "
|
||||||
<< IndirectList<edge>(cutEdges, stringedEdges)()
|
<< UIndirectList<edge>(cutEdges, stringedEdges)()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -631,7 +623,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
|
|||||||
//Pout<< "For master edge:"
|
//Pout<< "For master edge:"
|
||||||
// << unsplitEdge
|
// << unsplitEdge
|
||||||
// << " Found stringed points "
|
// << " Found stringed points "
|
||||||
// << IndirectList<point>
|
// << UIndirectList<point>
|
||||||
// (
|
// (
|
||||||
// cutFaces().localPoints(),
|
// cutFaces().localPoints(),
|
||||||
// splitPoints.shrink()
|
// splitPoints.shrink()
|
||||||
@ -664,9 +656,9 @@ Foam::label Foam::faceCoupleInfo::matchFaces
|
|||||||
"(const scalar, const face&, const pointField&"
|
"(const scalar, const face&, const pointField&"
|
||||||
", const face&, const pointField&)"
|
", const face&, const pointField&)"
|
||||||
) << "Different sizes for supposedly matching faces." << nl
|
) << "Different sizes for supposedly matching faces." << nl
|
||||||
<< "f0:" << f0 << " coords:" << IndirectList<point>(points0, f0)()
|
<< "f0:" << f0 << " coords:" << UIndirectList<point>(points0, f0)()
|
||||||
<< nl
|
<< nl
|
||||||
<< "f1:" << f1 << " coords:" << IndirectList<point>(points1, f1)()
|
<< "f1:" << f1 << " coords:" << UIndirectList<point>(points1, f1)()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,10 +713,9 @@ Foam::label Foam::faceCoupleInfo::matchFaces
|
|||||||
", const face&, const pointField&)"
|
", const face&, const pointField&)"
|
||||||
) << "No unique match between two faces" << nl
|
) << "No unique match between two faces" << nl
|
||||||
<< "Face " << f0 << " coords "
|
<< "Face " << f0 << " coords "
|
||||||
<< IndirectList<point>(points0, f0)()
|
<< UIndirectList<point>(points0, f0)() << nl
|
||||||
<< nl
|
|
||||||
<< "Face " << f1 << " coords "
|
<< "Face " << f1 << " coords "
|
||||||
<< IndirectList<point>(points1, f1)()
|
<< UIndirectList<point>(points1, f1)()
|
||||||
<< "when using tolerance " << absTol
|
<< "when using tolerance " << absTol
|
||||||
<< " and forwardMatching:" << sameOrientation
|
<< " and forwardMatching:" << sameOrientation
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -1575,7 +1566,7 @@ void Foam::faceCoupleInfo::perfectPointMatch
|
|||||||
|
|
||||||
|
|
||||||
// Use compaction lists to renumber cutPoints.
|
// Use compaction lists to renumber cutPoints.
|
||||||
cutPoints_ = IndirectList<point>(cutPoints_, compactToCut)();
|
cutPoints_ = UIndirectList<point>(cutPoints_, compactToCut)();
|
||||||
{
|
{
|
||||||
const faceList& cutLocalFaces = cutFaces().localFaces();
|
const faceList& cutLocalFaces = cutFaces().localFaces();
|
||||||
|
|
||||||
@ -1770,11 +1761,11 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
|||||||
writeOBJ
|
writeOBJ
|
||||||
(
|
(
|
||||||
"errorEdges.obj",
|
"errorEdges.obj",
|
||||||
IndirectList<edge>
|
UIndirectList<edge>
|
||||||
(
|
(
|
||||||
cutFaces().edges(),
|
cutFaces().edges(),
|
||||||
cutFaces().pointEdges()[cutPointI]
|
cutFaces().pointEdges()[cutPointI]
|
||||||
)(),
|
),
|
||||||
cutFaces().localPoints(),
|
cutFaces().localPoints(),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@ -1894,7 +1885,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
|||||||
"(const polyMesh&, const bool, const scalar)"
|
"(const polyMesh&, const bool, const scalar)"
|
||||||
) << "Did not match all of cutFaces to a master face" << nl
|
) << "Did not match all of cutFaces to a master face" << nl
|
||||||
<< "First unmatched cut face:" << cutFaceI << " with points:"
|
<< "First unmatched cut face:" << cutFaceI << " with points:"
|
||||||
<< IndirectList<point>(cutFaces().points(), cutF)()
|
<< UIndirectList<point>(cutFaces().points(), cutF)()
|
||||||
<< nl
|
<< nl
|
||||||
<< "This usually means that the slave patch is not a"
|
<< "This usually means that the slave patch is not a"
|
||||||
<< " subdivision of the master patch"
|
<< " subdivision of the master patch"
|
||||||
|
@ -1929,11 +1929,8 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
|
|||||||
//(
|
//(
|
||||||
// pointField
|
// pointField
|
||||||
// (
|
// (
|
||||||
// IndirectList<point>
|
// mesh.points(),
|
||||||
// (
|
// sharedPointLabels
|
||||||
// mesh.points(),
|
|
||||||
// sharedPointLabels
|
|
||||||
// )()
|
|
||||||
// ),
|
// ),
|
||||||
// mergeDist,
|
// mergeDist,
|
||||||
// false,
|
// false,
|
||||||
|
@ -110,7 +110,7 @@ Foam::labelListList Foam::addPatchCellLayer::calcGlobalEdgeFaces
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Extract pp part
|
// 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);
|
labelList n(mesh_.nPoints(), 0);
|
||||||
IndirectList<label>(n, meshPoints) = nPointLayers;
|
UIndirectList<label>(n, meshPoints) = nPointLayers;
|
||||||
syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0, false);
|
syncTools::syncPointList(mesh_, n, maxEqOp<label>(), 0, false);
|
||||||
|
|
||||||
// Non-synced
|
// Non-synced
|
||||||
@ -706,7 +706,7 @@ void Foam::addPatchCellLayer::setRefinement
|
|||||||
|
|
||||||
{
|
{
|
||||||
pointField d(mesh_.nPoints(), wallPoint::greatPoint);
|
pointField d(mesh_.nPoints(), wallPoint::greatPoint);
|
||||||
IndirectList<point>(d, meshPoints) = firstLayerDisp;
|
UIndirectList<point>(d, meshPoints) = firstLayerDisp;
|
||||||
syncTools::syncPointList
|
syncTools::syncPointList
|
||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
|
@ -565,7 +565,7 @@ void Foam::combineFaces::setRefinement
|
|||||||
const labelList& setFaces = faceSets[setI];
|
const labelList& setFaces = faceSets[setI];
|
||||||
|
|
||||||
masterFace_[setI] = setFaces[0];
|
masterFace_[setI] = setFaces[0];
|
||||||
faceSetsVertices_[setI] = IndirectList<face>
|
faceSetsVertices_[setI] = UIndirectList<face>
|
||||||
(
|
(
|
||||||
mesh_.faces(),
|
mesh_.faces(),
|
||||||
setFaces
|
setFaces
|
||||||
|
@ -28,7 +28,6 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "polyTopoChange.H"
|
#include "polyTopoChange.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include "IndirectList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -746,7 +746,7 @@ Foam::label Foam::hexRef8::findLevel
|
|||||||
|
|
||||||
FatalErrorIn("hexRef8::findLevel(..)")
|
FatalErrorIn("hexRef8::findLevel(..)")
|
||||||
<< "face:" << f
|
<< "face:" << f
|
||||||
<< " level:" << IndirectList<label>(pointLevel_, f)()
|
<< " level:" << UIndirectList<label>(pointLevel_, f)()
|
||||||
<< " startFp:" << startFp
|
<< " startFp:" << startFp
|
||||||
<< " wantedLevel:" << wantedLevel
|
<< " wantedLevel:" << wantedLevel
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -774,7 +774,7 @@ Foam::label Foam::hexRef8::findLevel
|
|||||||
|
|
||||||
FatalErrorIn("hexRef8::findLevel(..)")
|
FatalErrorIn("hexRef8::findLevel(..)")
|
||||||
<< "face:" << f
|
<< "face:" << f
|
||||||
<< " level:" << IndirectList<label>(pointLevel_, f)()
|
<< " level:" << UIndirectList<label>(pointLevel_, f)()
|
||||||
<< " startFp:" << startFp
|
<< " startFp:" << startFp
|
||||||
<< " wantedLevel:" << wantedLevel
|
<< " wantedLevel:" << wantedLevel
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
@ -823,7 +823,7 @@ void Foam::hexRef8::checkInternalOrientation
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
face compactFace(identity(newFace.size()));
|
face compactFace(identity(newFace.size()));
|
||||||
pointField compactPoints(IndirectList<point>(meshMod.points(), newFace)());
|
pointField compactPoints(meshMod.points(), newFace);
|
||||||
|
|
||||||
vector n(compactFace.normal(compactPoints));
|
vector n(compactFace.normal(compactPoints));
|
||||||
|
|
||||||
@ -869,7 +869,7 @@ void Foam::hexRef8::checkBoundaryOrientation
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
face compactFace(identity(newFace.size()));
|
face compactFace(identity(newFace.size()));
|
||||||
pointField compactPoints(IndirectList<point>(meshMod.points(), newFace)());
|
pointField compactPoints(meshMod.points(), newFace);
|
||||||
|
|
||||||
vector n(compactFace.normal(compactPoints));
|
vector n(compactFace.normal(compactPoints));
|
||||||
|
|
||||||
@ -1308,11 +1308,11 @@ void Foam::hexRef8::createInternalFaces
|
|||||||
<< "cell:" << cellI << " cLevel:" << cLevel
|
<< "cell:" << cellI << " cLevel:" << cLevel
|
||||||
<< " cell points:" << cPoints
|
<< " cell points:" << cPoints
|
||||||
<< " pointLevel:"
|
<< " pointLevel:"
|
||||||
<< IndirectList<label>(pointLevel_, cPoints)()
|
<< UIndirectList<label>(pointLevel_, cPoints)()
|
||||||
<< " face:" << faceI
|
<< " face:" << faceI
|
||||||
<< " f:" << f
|
<< " f:" << f
|
||||||
<< " pointLevel:"
|
<< " pointLevel:"
|
||||||
<< IndirectList<label>(pointLevel_, f)()
|
<< UIndirectList<label>(pointLevel_, f)()
|
||||||
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
|
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
|
||||||
<< " faceMidPoint:" << faceMidPoint[faceI]
|
<< " faceMidPoint:" << faceMidPoint[faceI]
|
||||||
<< " faceMidPointI:" << faceMidPointI
|
<< " faceMidPointI:" << faceMidPointI
|
||||||
@ -1381,11 +1381,11 @@ void Foam::hexRef8::createInternalFaces
|
|||||||
<< "cell:" << cellI << " cLevel:" << cLevel
|
<< "cell:" << cellI << " cLevel:" << cLevel
|
||||||
<< " cell points:" << cPoints
|
<< " cell points:" << cPoints
|
||||||
<< " pointLevel:"
|
<< " pointLevel:"
|
||||||
<< IndirectList<label>(pointLevel_, cPoints)()
|
<< UIndirectList<label>(pointLevel_, cPoints)()
|
||||||
<< " face:" << faceI
|
<< " face:" << faceI
|
||||||
<< " f:" << f
|
<< " f:" << f
|
||||||
<< " pointLevel:"
|
<< " pointLevel:"
|
||||||
<< IndirectList<label>(pointLevel_, f)()
|
<< UIndirectList<label>(pointLevel_, f)()
|
||||||
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
|
<< " faceAnchorLevel:" << faceAnchorLevel[faceI]
|
||||||
<< " faceMidPoint:" << faceMidPoint[faceI]
|
<< " faceMidPoint:" << faceMidPoint[faceI]
|
||||||
<< " faceMidPointI:" << faceMidPointI
|
<< " faceMidPointI:" << faceMidPointI
|
||||||
@ -3511,7 +3511,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
|||||||
<< " lower level" << endl
|
<< " lower level" << endl
|
||||||
<< "cellPoints:" << cPoints << endl
|
<< "cellPoints:" << cPoints << endl
|
||||||
<< "pointLevels:"
|
<< "pointLevels:"
|
||||||
<< IndirectList<label>(pointLevel_, cPoints)() << endl
|
<< UIndirectList<label>(pointLevel_, cPoints)() << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4473,7 +4473,7 @@ void Foam::hexRef8::checkMesh() const
|
|||||||
<< "Coupled face " << faceI
|
<< "Coupled face " << faceI
|
||||||
<< " on patch " << patchI
|
<< " on patch " << patchI
|
||||||
<< " " << mesh_.boundaryMesh()[patchI].name()
|
<< " " << mesh_.boundaryMesh()[patchI].name()
|
||||||
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
|
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " has face area:" << magArea
|
<< " has face area:" << magArea
|
||||||
<< " (coupled) neighbour face area differs:"
|
<< " (coupled) neighbour face area differs:"
|
||||||
<< neiFaceAreas[i]
|
<< neiFaceAreas[i]
|
||||||
@ -4515,7 +4515,7 @@ void Foam::hexRef8::checkMesh() const
|
|||||||
<< "Coupled face " << faceI
|
<< "Coupled face " << faceI
|
||||||
<< " on patch " << patchI
|
<< " on patch " << patchI
|
||||||
<< " " << mesh_.boundaryMesh()[patchI].name()
|
<< " " << mesh_.boundaryMesh()[patchI].name()
|
||||||
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
|
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " has size:" << f.size()
|
<< " has size:" << f.size()
|
||||||
<< " (coupled) neighbour face has size:"
|
<< " (coupled) neighbour face has size:"
|
||||||
<< nVerts[i]
|
<< nVerts[i]
|
||||||
@ -4565,7 +4565,7 @@ void Foam::hexRef8::checkMesh() const
|
|||||||
<< "Coupled face " << faceI
|
<< "Coupled face " << faceI
|
||||||
<< " on patch " << patchI
|
<< " on patch " << patchI
|
||||||
<< " " << mesh_.boundaryMesh()[patchI].name()
|
<< " " << mesh_.boundaryMesh()[patchI].name()
|
||||||
<< " coords:" << IndirectList<point>(mesh_.points(), f)()
|
<< " coords:" << UIndirectList<point>(mesh_.points(), f)()
|
||||||
<< " has anchor vector:" << anchorVec
|
<< " has anchor vector:" << anchorVec
|
||||||
<< " (coupled) neighbour face anchor vector differs:"
|
<< " (coupled) neighbour face anchor vector differs:"
|
||||||
<< anchorPoints[i]
|
<< anchorPoints[i]
|
||||||
|
@ -375,7 +375,7 @@ void Foam::removeFaces::mergeFaces
|
|||||||
//{
|
//{
|
||||||
// Pout<< "Modifying masterface " << faceI
|
// Pout<< "Modifying masterface " << faceI
|
||||||
// << " from faces:" << faceLabels
|
// << " from faces:" << faceLabels
|
||||||
// << " old verts:" << IndirectList<face>(mesh_.faces(), faceLabels)
|
// << " old verts:" << UIndirectList<face>(mesh_.faces(), faceLabels)
|
||||||
// << " for new verts:"
|
// << " for new verts:"
|
||||||
// << mergedFace
|
// << mergedFace
|
||||||
// << " possibly new owner " << own
|
// << " possibly new owner " << own
|
||||||
|
@ -353,7 +353,7 @@ void Foam::removePoints::setRefinement
|
|||||||
// Points from the mesh
|
// Points from the mesh
|
||||||
List<point> meshPoints
|
List<point> meshPoints
|
||||||
(
|
(
|
||||||
IndirectList<point>
|
UIndirectList<point>
|
||||||
(
|
(
|
||||||
mesh_.points(),
|
mesh_.points(),
|
||||||
mesh_.faces()[savedFaceLabels_[saveI]] // mesh face
|
mesh_.faces()[savedFaceLabels_[saveI]] // mesh face
|
||||||
|
@ -202,7 +202,7 @@ void Foam::enrichedPatch::calcCutFaces() const
|
|||||||
// Grab the next point options
|
// Grab the next point options
|
||||||
// Pout << "curPointLabel: " << mp[curPointLabel] << endl;
|
// Pout << "curPointLabel: " << mp[curPointLabel] << endl;
|
||||||
const labelList& nextPoints = pp[curPointLabel];
|
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
|
// Get the vector along the edge and the right vector
|
||||||
vector ahead = curPoint - lp[prevPointLabel];
|
vector ahead = curPoint - lp[prevPointLabel];
|
||||||
ahead -= normal*(normal & ahead);
|
ahead -= normal*(normal & ahead);
|
||||||
|
@ -165,7 +165,7 @@ void directMappedFixedValueFvPatchField<Type>::getNewValues
|
|||||||
if (Pstream::myProcNo() == sendProc)
|
if (Pstream::myProcNo() == sendProc)
|
||||||
{
|
{
|
||||||
OPstream toProc(Pstream::scheduled, recvProc);
|
OPstream toProc(Pstream::scheduled, recvProc);
|
||||||
toProc<< IndirectList<Type>(sendValues, sendLabels[recvProc])();
|
toProc<< UIndirectList<Type>(sendValues, sendLabels[recvProc])();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -188,7 +188,11 @@ void directMappedFixedValueFvPatchField<Type>::getNewValues
|
|||||||
|
|
||||||
// Do data from myself
|
// Do data from myself
|
||||||
{
|
{
|
||||||
IndirectList<Type> fromFld(sendValues, sendLabels[Pstream::myProcNo()]);
|
UIndirectList<Type> fromFld
|
||||||
|
(
|
||||||
|
sendValues,
|
||||||
|
sendLabels[Pstream::myProcNo()]
|
||||||
|
);
|
||||||
|
|
||||||
// Destination faces
|
// Destination faces
|
||||||
const labelList& faceLabels = receiveFaceLabels[Pstream::myProcNo()];
|
const labelList& faceLabels = receiveFaceLabels[Pstream::myProcNo()];
|
||||||
|
@ -162,8 +162,8 @@ void directMappedVelocityFluxFixedValueFvPatchField::getNewValues
|
|||||||
if (Pstream::myProcNo() == sendProc)
|
if (Pstream::myProcNo() == sendProc)
|
||||||
{
|
{
|
||||||
OPstream toProc(Pstream::scheduled, recvProc);
|
OPstream toProc(Pstream::scheduled, recvProc);
|
||||||
toProc<< IndirectList<vector>(sendUValues, sendLabels[recvProc])();
|
toProc<< UIndirectList<vector>(sendUValues, sendLabels[recvProc])();
|
||||||
toProc<< IndirectList<scalar>
|
toProc<< UIndirectList<scalar>
|
||||||
(
|
(
|
||||||
sendPhiValues,
|
sendPhiValues,
|
||||||
sendLabels[recvProc]
|
sendLabels[recvProc]
|
||||||
@ -192,13 +192,13 @@ void directMappedVelocityFluxFixedValueFvPatchField::getNewValues
|
|||||||
|
|
||||||
// Do data from myself
|
// Do data from myself
|
||||||
{
|
{
|
||||||
IndirectList<vector> fromUFld
|
UIndirectList<vector> fromUFld
|
||||||
(
|
(
|
||||||
sendUValues,
|
sendUValues,
|
||||||
sendLabels[Pstream::myProcNo()]
|
sendLabels[Pstream::myProcNo()]
|
||||||
);
|
);
|
||||||
|
|
||||||
IndirectList<scalar> fromPhiFld
|
UIndirectList<scalar> fromPhiFld
|
||||||
(
|
(
|
||||||
sendPhiValues,
|
sendPhiValues,
|
||||||
sendLabels[Pstream::myProcNo()]
|
sendLabels[Pstream::myProcNo()]
|
||||||
|
@ -474,7 +474,7 @@ void Foam::directMappedPolyPatch::calcMapping() const
|
|||||||
|
|
||||||
forAll(subMap, procI)
|
forAll(subMap, procI)
|
||||||
{
|
{
|
||||||
sendLabels[procI] = IndirectList<label>
|
sendLabels[procI] = UIndirectList<label>
|
||||||
(
|
(
|
||||||
sampleIndices,
|
sampleIndices,
|
||||||
subMap[procI]
|
subMap[procI]
|
||||||
@ -493,7 +493,7 @@ void Foam::directMappedPolyPatch::calcMapping() const
|
|||||||
forAll(constructMap, procI)
|
forAll(constructMap, procI)
|
||||||
{
|
{
|
||||||
receiveFaceLabels[procI] =
|
receiveFaceLabels[procI] =
|
||||||
IndirectList<label>(patchFaces, constructMap[procI]);
|
UIndirectList<label>(patchFaces, constructMap[procI]);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
@ -545,7 +545,7 @@ Foam::label Foam::meshTools::otherEdge
|
|||||||
"meshTools::otherEdge(const primitiveMesh&, const labelList&"
|
"meshTools::otherEdge(const primitiveMesh&, const labelList&"
|
||||||
", const label, const label)"
|
", const label, const label)"
|
||||||
) << "Can not find edge in "
|
) << "Can not find edge in "
|
||||||
<< IndirectList<edge>(mesh.edges(), edgeLabels)()
|
<< UIndirectList<edge>(mesh.edges(), edgeLabels)()
|
||||||
<< " connected to edge "
|
<< " connected to edge "
|
||||||
<< thisEdgeI << " with vertices " << mesh.edges()[thisEdgeI]
|
<< thisEdgeI << " with vertices " << mesh.edges()[thisEdgeI]
|
||||||
<< " on side " << thisVertI << abort(FatalError);
|
<< " on side " << thisVertI << abort(FatalError);
|
||||||
|
@ -102,8 +102,8 @@ void Foam::primitiveMeshGeometry::updateCellCentresAndVols
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Clear the fields for accumulation
|
// Clear the fields for accumulation
|
||||||
IndirectList<vector>(cellCentres_, changedCells) = vector::zero;
|
UIndirectList<vector>(cellCentres_, changedCells) = vector::zero;
|
||||||
IndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
|
UIndirectList<scalar>(cellVolumes_, changedCells) = 0.0;
|
||||||
|
|
||||||
const labelList& own = mesh_.faceOwner();
|
const labelList& own = mesh_.faceOwner();
|
||||||
const labelList& nei = mesh_.faceNeighbour();
|
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
|
// first estimate the approximate cell centre as the average of face centres
|
||||||
|
|
||||||
vectorField cEst(mesh_.nCells());
|
vectorField cEst(mesh_.nCells());
|
||||||
IndirectList<vector>(cEst, changedCells) = vector::zero;
|
UIndirectList<vector>(cEst, changedCells) = vector::zero;
|
||||||
scalarField nCellFaces(mesh_.nCells());
|
scalarField nCellFaces(mesh_.nCells());
|
||||||
IndirectList<scalar>(nCellFaces, changedCells) = 0.0;
|
UIndirectList<scalar>(nCellFaces, changedCells) = 0.0;
|
||||||
|
|
||||||
forAll(changedFaces, i)
|
forAll(changedFaces, i)
|
||||||
{
|
{
|
||||||
|
@ -432,7 +432,7 @@ void Foam::searchableSurfaceCollection::getRegion
|
|||||||
labelList surfRegion;
|
labelList surfRegion;
|
||||||
subGeom_[surfI].getRegion
|
subGeom_[surfI].getRegion
|
||||||
(
|
(
|
||||||
IndirectList<pointIndexHit>(info, indices),
|
UIndirectList<pointIndexHit>(info, indices),
|
||||||
surfRegion
|
surfRegion
|
||||||
);
|
);
|
||||||
forAll(indices, i)
|
forAll(indices, i)
|
||||||
@ -495,7 +495,7 @@ void Foam::searchableSurfaceCollection::getNormal
|
|||||||
vectorField surfNormal;
|
vectorField surfNormal;
|
||||||
subGeom_[surfI].getNormal
|
subGeom_[surfI].getNormal
|
||||||
(
|
(
|
||||||
IndirectList<pointIndexHit>(info, indices),
|
UIndirectList<pointIndexHit>(info, indices),
|
||||||
surfNormal
|
surfNormal
|
||||||
);
|
);
|
||||||
forAll(indices, i)
|
forAll(indices, i)
|
||||||
|
@ -255,10 +255,7 @@ void topoSet::writeDebug
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Bounding box of contents.
|
// Bounding box of contents.
|
||||||
boundBox bb
|
boundBox bb(pointField(coords, toc()));
|
||||||
(
|
|
||||||
pointField(IndirectList<point>(coords, toc())())
|
|
||||||
);
|
|
||||||
|
|
||||||
Pout<< "Set bounding box: min = "
|
Pout<< "Set bounding box: min = "
|
||||||
<< bb.min() << " max = " << bb.max() << " meters. " << endl << endl;
|
<< bb.min() << " max = " << bb.max() << " meters. " << endl << endl;
|
||||||
|
@ -212,7 +212,7 @@ void Foam::sampledSets::combineSampledSets
|
|||||||
(
|
(
|
||||||
samplePts.name(),
|
samplePts.name(),
|
||||||
samplePts.axis(),
|
samplePts.axis(),
|
||||||
IndirectList<point>(allPts, indexSets[seti]),
|
UIndirectList<point>(allPts, indexSets[seti]),
|
||||||
refPt
|
refPt
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -198,8 +198,11 @@ void Foam::sampledSets::combineSampledValues
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
masterValues[seti] =
|
masterValues[seti] = UIndirectList<T>
|
||||||
IndirectList<T>(allData, indexSets[seti])();
|
(
|
||||||
|
allData,
|
||||||
|
indexSets[seti]
|
||||||
|
)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ bool Foam::faceTriangulation::split
|
|||||||
"split(const bool, const pointField&, const face&"
|
"split(const bool, const pointField&, const face&"
|
||||||
", const vector&, label&)"
|
", const vector&, label&)"
|
||||||
) << "Illegal face:" << f
|
) << "Illegal face:" << f
|
||||||
<< " with points " << IndirectList<point>(points, f)()
|
<< " with points " << UIndirectList<point>(points, f)()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -501,7 +501,8 @@ bool Foam::faceTriangulation::split
|
|||||||
"split(const bool, const pointField&, const face&"
|
"split(const bool, const pointField&, const face&"
|
||||||
", const vector&, label&)"
|
", const vector&, label&)"
|
||||||
) << "Cannot find valid diagonal on face " << f
|
) << "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 "
|
<< "Returning naive triangulation starting from "
|
||||||
<< f[maxIndex] << " which might not be correct for a"
|
<< f[maxIndex] << " which might not be correct for a"
|
||||||
<< " concave or warped face" << endl;
|
<< " concave or warped face" << endl;
|
||||||
@ -530,7 +531,8 @@ bool Foam::faceTriangulation::split
|
|||||||
"split(const bool, const pointField&, const face&"
|
"split(const bool, const pointField&, const face&"
|
||||||
", const vector&, label&)"
|
", const vector&, label&)"
|
||||||
) << "Cannot find valid diagonal on face " << f
|
) << "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;
|
<< "Returning empty triFaceList" << endl;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -564,7 +566,7 @@ bool Foam::faceTriangulation::split
|
|||||||
"split(const bool, const pointField&, const face&"
|
"split(const bool, const pointField&, const face&"
|
||||||
", const vector&, label&)"
|
", const vector&, label&)"
|
||||||
) << "Illegal split of face:" << f
|
) << "Illegal split of face:" << f
|
||||||
<< " with points " << IndirectList<point>(points, f)()
|
<< " with points " << UIndirectList<point>(points, f)()
|
||||||
<< " at indices " << index1 << " and " << index2
|
<< " at indices " << index1 << " and " << index2
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ void triSurface::calcSortedEdgeFaces() const
|
|||||||
|
|
||||||
faceAngles.sort();
|
faceAngles.sort();
|
||||||
|
|
||||||
sortedEdgeFaces[edgeI] = IndirectList<label>
|
sortedEdgeFaces[edgeI] = UIndirectList<label>
|
||||||
(
|
(
|
||||||
myFaceNbs,
|
myFaceNbs,
|
||||||
faceAngles.indices()
|
faceAngles.indices()
|
||||||
@ -179,7 +179,7 @@ void triSurface::calcEdgeOwner() const
|
|||||||
<< "Edge " << edgeI << " vertices:" << e
|
<< "Edge " << edgeI << " vertices:" << e
|
||||||
<< " is used by faces " << myFaces
|
<< " is used by faces " << myFaces
|
||||||
<< " vertices:"
|
<< " vertices:"
|
||||||
<< IndirectList<labelledTri>(localFaces(), myFaces)()
|
<< UIndirectList<labelledTri>(localFaces(), myFaces)()
|
||||||
<< " none of which use the edge vertices in the same order"
|
<< " none of which use the edge vertices in the same order"
|
||||||
<< nl << "I give up" << abort(FatalError);
|
<< nl << "I give up" << abort(FatalError);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user