mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Removing old InteractionList classes.
Current InteractionList class will compile on its own, but does not supply all of the interface required by PairCollision, so this model won't compile.
This commit is contained in:
@ -1,548 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "DirectInteractionList.H"
|
||||
#include "InteractionLists.H"
|
||||
#include "ReferredCellList.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::buildDirectInteractionList
|
||||
(
|
||||
bool pointPointListBuild
|
||||
)
|
||||
{
|
||||
Info<< " Building list of direct interaction neighbours" << endl;
|
||||
|
||||
const polyMesh& mesh = il_.mesh();
|
||||
|
||||
List<DynamicList<label> > DirectInteractionList(mesh.nCells());
|
||||
|
||||
if (pointPointListBuild)
|
||||
{
|
||||
Info<< " Point-Point direct interaction list build." << endl;
|
||||
|
||||
label pointJIndex;
|
||||
|
||||
forAll (mesh.points(), pointIIndex)
|
||||
{
|
||||
for
|
||||
(
|
||||
pointJIndex = pointIIndex;
|
||||
pointJIndex != mesh.points().size();
|
||||
++pointJIndex
|
||||
)
|
||||
{
|
||||
if (il_.testPointPointDistance(pointIIndex, pointJIndex))
|
||||
{
|
||||
const labelList& ptICells
|
||||
(
|
||||
mesh.pointCells()[pointIIndex]
|
||||
);
|
||||
|
||||
const labelList& ptJCells
|
||||
(
|
||||
mesh.pointCells()[pointJIndex]
|
||||
);
|
||||
|
||||
forAll(ptICells, pIC)
|
||||
{
|
||||
const label cellI(ptICells[pIC]);
|
||||
|
||||
forAll(ptJCells, pJC)
|
||||
{
|
||||
const label cellJ(ptJCells[pJC]);
|
||||
|
||||
if (cellJ > cellI)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellI],
|
||||
cellJ
|
||||
)
|
||||
== -1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellI].append(cellJ);
|
||||
}
|
||||
}
|
||||
|
||||
if (cellI > cellJ)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellJ],
|
||||
cellI
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellJ].append(cellI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " Point-Face, Edge-Edge direct interaction list build."
|
||||
<< endl;
|
||||
|
||||
forAll(mesh.points(), p)
|
||||
{
|
||||
forAll(mesh.faces(), f)
|
||||
{
|
||||
if (il_.testPointFaceDistance(p, f))
|
||||
{
|
||||
const labelList& pCells(mesh.pointCells()[p]);
|
||||
|
||||
const label cellO(mesh.faceOwner()[f]);
|
||||
|
||||
forAll(pCells, pC)
|
||||
{
|
||||
const label cellI(pCells[pC]);
|
||||
|
||||
// cells are not added to their own DIL
|
||||
|
||||
if (cellO > cellI)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellI],
|
||||
cellO
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellI].append(cellO);
|
||||
}
|
||||
}
|
||||
|
||||
if (cellI > cellO)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellO],
|
||||
cellI
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellO].append(cellI);
|
||||
}
|
||||
}
|
||||
|
||||
if (mesh.isInternalFace(f))
|
||||
{
|
||||
// boundary faces will not have neighbour
|
||||
// information
|
||||
|
||||
const label cellN(mesh.faceNeighbour()[f]);
|
||||
|
||||
if (cellN > cellI)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellI],
|
||||
cellN
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellI].append(cellN);
|
||||
}
|
||||
}
|
||||
|
||||
if (cellI > cellN)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellN],
|
||||
cellI
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellN].append(cellI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label edgeJIndex;
|
||||
|
||||
forAll(mesh.edges(), edgeIIndex)
|
||||
{
|
||||
const edge& eI(mesh.edges()[edgeIIndex]);
|
||||
|
||||
for
|
||||
(
|
||||
edgeJIndex = edgeIIndex + 1;
|
||||
edgeJIndex != mesh.edges().size();
|
||||
++edgeJIndex
|
||||
)
|
||||
{
|
||||
const edge& eJ(mesh.edges()[edgeJIndex]);
|
||||
|
||||
if (il_.testEdgeEdgeDistance(eI, eJ))
|
||||
{
|
||||
const labelList& eICells(mesh.edgeCells()[edgeIIndex]);
|
||||
|
||||
const labelList& eJCells(mesh.edgeCells()[edgeJIndex]);
|
||||
|
||||
forAll(eICells, eIC)
|
||||
{
|
||||
const label cellI(eICells[eIC]);
|
||||
|
||||
forAll(eJCells, eJC)
|
||||
{
|
||||
const label cellJ(eJCells[eJC]);
|
||||
|
||||
if (cellJ > cellI)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellI],
|
||||
cellJ
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellI].append(cellJ);
|
||||
}
|
||||
}
|
||||
|
||||
if (cellI > cellJ)
|
||||
{
|
||||
if
|
||||
(
|
||||
findIndex
|
||||
(
|
||||
DirectInteractionList[cellJ],
|
||||
cellI
|
||||
)
|
||||
==
|
||||
-1
|
||||
)
|
||||
{
|
||||
DirectInteractionList[cellJ].append(cellI);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(DirectInteractionList, transDIL)
|
||||
{
|
||||
(*this)[transDIL].transfer
|
||||
(
|
||||
DirectInteractionList[transDIL].shrink()
|
||||
);
|
||||
}
|
||||
|
||||
// sorting DILs
|
||||
|
||||
forAll((*this), dilI)
|
||||
{
|
||||
sort((*this)[dilI]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::buildWallFaces()
|
||||
{
|
||||
Info<< " Building list of wall faces in range of cells" << endl;
|
||||
|
||||
const polyMesh& mesh = il_.mesh();
|
||||
|
||||
// DynamicLists for data gathering
|
||||
DynamicList<label> thisCellOnlyWallFaces;
|
||||
DynamicList<label> otherCellOnlyWallFaces;
|
||||
|
||||
forAll(wallFaces_, thisCellI)
|
||||
{
|
||||
// Find all of the wall faces for the current cell
|
||||
|
||||
const labelList& thisCellFaces = mesh.cells()[thisCellI];
|
||||
|
||||
labelList& thisCellWallFaces = wallFaces_[thisCellI];
|
||||
|
||||
thisCellOnlyWallFaces.clear();
|
||||
|
||||
forAll(thisCellFaces, tCFI)
|
||||
{
|
||||
label faceI = thisCellFaces[tCFI];
|
||||
|
||||
if (!mesh.isInternalFace(faceI))
|
||||
{
|
||||
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
|
||||
// move reference point for wall
|
||||
if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
thisCellOnlyWallFaces.append(faceI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add all the found wall faces to this cell's list, and
|
||||
// retain the wall faces for this cell only to add to other
|
||||
// cells.
|
||||
thisCellWallFaces.append(thisCellOnlyWallFaces);
|
||||
|
||||
// Loop over all of the cells in the DIL for this cell, adding
|
||||
// the wallFaces for this cell to the other cell's wallFace
|
||||
// list, and all of the wallFaces for the other cell to this
|
||||
// cell's list
|
||||
|
||||
const labelList& dil = (*this)[thisCellI];
|
||||
|
||||
forAll(dil, i)
|
||||
{
|
||||
label otherCellI = dil[i];
|
||||
|
||||
const labelList& otherCellFaces = mesh.cells()[otherCellI];
|
||||
|
||||
labelList& otherCellWallFaces = wallFaces_[otherCellI];
|
||||
|
||||
otherCellOnlyWallFaces.clear();
|
||||
|
||||
forAll(otherCellFaces, oCFI)
|
||||
{
|
||||
label faceI = otherCellFaces[oCFI];
|
||||
|
||||
if (!mesh.isInternalFace(faceI))
|
||||
{
|
||||
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
|
||||
// move reference point for wall
|
||||
if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
otherCellOnlyWallFaces.append(faceI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
thisCellWallFaces.append(otherCellOnlyWallFaces);
|
||||
|
||||
otherCellWallFaces.append(thisCellOnlyWallFaces);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::DirectInteractionList<ParticleType>::DirectInteractionList
|
||||
(
|
||||
const InteractionLists<ParticleType>& il,
|
||||
bool pointPointListBuild
|
||||
)
|
||||
:
|
||||
labelListList(il.mesh().nCells()),
|
||||
il_(il),
|
||||
wallFaces_(il.mesh().nCells()),
|
||||
referredCellsForInteraction_(il.mesh().nCells())
|
||||
{
|
||||
if ((*this).size() > 1)
|
||||
{
|
||||
buildDirectInteractionList(pointPointListBuild);
|
||||
}
|
||||
else if ((*this).size() == 1)
|
||||
{
|
||||
Info<< " Single cell mesh, no direct interaction lists required."
|
||||
<< endl;
|
||||
|
||||
(*this)[0].setSize(0);
|
||||
}
|
||||
|
||||
buildWallFaces();
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::DirectInteractionList<ParticleType>::DirectInteractionList
|
||||
(
|
||||
const InteractionLists<ParticleType>& il
|
||||
)
|
||||
:
|
||||
labelListList(il.mesh().nCells()),
|
||||
il_(il),
|
||||
wallFaces_(il.mesh().nCells()),
|
||||
referredCellsForInteraction_(il.mesh().nCells())
|
||||
{
|
||||
Info<< " Read DirectInteractionList from disk not implemented" << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::DirectInteractionList<ParticleType>::~DirectInteractionList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::buildInverseAddressing()
|
||||
{
|
||||
const ReferredCellList<ParticleType>& ril = il_.ril();
|
||||
|
||||
// Temporary Dynamic lists for accumulation
|
||||
List<DynamicList<label> > referredCellsForInteraction
|
||||
(
|
||||
referredCellsForInteraction_.size()
|
||||
);
|
||||
|
||||
// Loop over all referred cells
|
||||
forAll(ril, refCellI)
|
||||
{
|
||||
const ReferredCell<ParticleType>& refCell = ril[refCellI];
|
||||
|
||||
const labelList& realCells = refCell.realCellsForInteraction();
|
||||
|
||||
// Loop over all real cells in that the referred cell is to
|
||||
// supply interactions to and record the index of this
|
||||
// referred cell in the cells entry in
|
||||
// referredCellsForInteraction_
|
||||
|
||||
forAll(realCells, realCellI)
|
||||
{
|
||||
referredCellsForInteraction[realCells[realCellI]].append(refCellI);
|
||||
}
|
||||
}
|
||||
|
||||
forAll(referredCellsForInteraction_, cellI)
|
||||
{
|
||||
referredCellsForInteraction_[cellI].transfer
|
||||
(
|
||||
referredCellsForInteraction[cellI]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::
|
||||
writeReferredCellsForInteraction() const
|
||||
{
|
||||
const ReferredCellList<ParticleType>& ril = il_.ril();
|
||||
|
||||
forAll(*this, cellI)
|
||||
{
|
||||
const labelList& refCells = referredCellsForInteraction_[cellI];
|
||||
|
||||
if (!refCells.size())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
fileName fName =
|
||||
il_.mesh().time().path()
|
||||
/"referredCellsForInteraction_" + name(cellI) + ".obj";
|
||||
|
||||
Info<< " Writing " << fName.name() << endl;
|
||||
|
||||
OFstream referredCellsFile(fName);
|
||||
|
||||
label vertexOffset = 1;
|
||||
|
||||
forAll(refCells, refCellForInteractionI)
|
||||
{
|
||||
const ReferredCell<ParticleType>& refCell =
|
||||
ril[refCells[refCellForInteractionI]];
|
||||
|
||||
const pointField& refCellPts = refCell.points();
|
||||
|
||||
const faceList& refCellFaces = refCell.faces();
|
||||
|
||||
forAll(refCellPts, ptI)
|
||||
{
|
||||
referredCellsFile
|
||||
<< "v "
|
||||
<< refCellPts[ptI].x() << " "
|
||||
<< refCellPts[ptI].y() << " "
|
||||
<< refCellPts[ptI].z()
|
||||
<< nl;
|
||||
}
|
||||
|
||||
forAll(refCellFaces, faceI)
|
||||
{
|
||||
referredCellsFile << "f";
|
||||
|
||||
forAll(refCellFaces[faceI], fPtI)
|
||||
{
|
||||
referredCellsFile
|
||||
<< " " << refCellFaces[faceI][fPtI] + vertexOffset;
|
||||
}
|
||||
|
||||
referredCellsFile << nl;
|
||||
}
|
||||
|
||||
vertexOffset += refCellPts.size();
|
||||
}
|
||||
|
||||
referredCellsFile.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,158 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
Class
|
||||
Foam::DirectInteractionList
|
||||
|
||||
Description
|
||||
Data stored that specifies what a "real" cell (one on the current
|
||||
processor) interacts with.
|
||||
|
||||
SourceFiles
|
||||
DirectInteractionListI.H
|
||||
DirectInteractionList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef DirectInteractionList_H
|
||||
#define DirectInteractionList_H
|
||||
|
||||
#include "polyMesh.H"
|
||||
#include "List.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
template<class ParticleType>
|
||||
class InteractionLists;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class DirectInteractionList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ParticleType>
|
||||
class DirectInteractionList
|
||||
:
|
||||
public labelListList
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- A reference to the InteractionLists object holding this object
|
||||
const InteractionLists<ParticleType>& il_;
|
||||
|
||||
//- Data specifying which patch faces of type "wall" are in range
|
||||
// of each cell
|
||||
labelListList wallFaces_;
|
||||
|
||||
//- Data specifying which referred cells are in range of each
|
||||
// cell, Inverse data of ReferredCell's realCellsForInteraction
|
||||
labelListList referredCellsForInteraction_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
void buildDirectInteractionList
|
||||
(
|
||||
bool pointPointListBuild
|
||||
);
|
||||
|
||||
void buildWallFaces();
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
DirectInteractionList(const DirectInteractionList&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const DirectInteractionList&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct lists by searching the mesh
|
||||
DirectInteractionList
|
||||
(
|
||||
const InteractionLists<ParticleType>& il,
|
||||
bool pointPointListBuild
|
||||
);
|
||||
|
||||
//- Construct from file
|
||||
DirectInteractionList
|
||||
(
|
||||
const InteractionLists<ParticleType>& il
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~DirectInteractionList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Build referredCellsForInteraction by interrogating the
|
||||
//- ReferredCellList of the InteractionLists object that owns
|
||||
//- this object.
|
||||
void buildInverseAddressing();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
inline const labelListList& wallFaces() const;
|
||||
|
||||
inline const labelListList& referredCellsForInteraction() const;
|
||||
|
||||
inline const InteractionLists<ParticleType>& il() const;
|
||||
|
||||
|
||||
// Write
|
||||
|
||||
//- Write the referred cells in range of each real cell
|
||||
void writeReferredCellsForInteraction() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "DirectInteractionListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "DirectInteractionList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,53 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::labelListList&
|
||||
Foam::DirectInteractionList<ParticleType>::wallFaces() const
|
||||
{
|
||||
return wallFaces_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::labelListList&
|
||||
Foam::DirectInteractionList<ParticleType>::referredCellsForInteraction() const
|
||||
{
|
||||
return referredCellsForInteraction_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::InteractionLists<ParticleType>&
|
||||
Foam::DirectInteractionList<ParticleType>::il() const
|
||||
{
|
||||
return il_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,556 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ReferredCell.H"
|
||||
#include "InteractionLists.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::ReferredCell<ParticleType>::setConstructionData
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceCell
|
||||
)
|
||||
{
|
||||
// Points
|
||||
|
||||
const labelList& points = mesh.cellPoints()[sourceCell];
|
||||
|
||||
pointField sourceCellVertices(points.size());
|
||||
|
||||
forAll(sourceCellVertices, sCV)
|
||||
{
|
||||
sourceCellVertices[sCV] = mesh.points()[points[sCV]];
|
||||
}
|
||||
|
||||
vertexPositions_ = referPositions(sourceCellVertices);
|
||||
|
||||
|
||||
// Edges
|
||||
|
||||
const labelList& edges = mesh.cellEdges()[sourceCell];
|
||||
|
||||
edgeList sourceCellEdges(edges.size());
|
||||
|
||||
forAll(sourceCellEdges, sCE)
|
||||
{
|
||||
sourceCellEdges[sCE] = mesh.edges()[edges[sCE]];
|
||||
}
|
||||
|
||||
locallyMapEdgeList(points, sourceCellEdges);
|
||||
|
||||
|
||||
// Faces
|
||||
|
||||
labelList faces(mesh.cells()[sourceCell]);
|
||||
|
||||
pointField sourceCellFaceCentres(faces.size());
|
||||
|
||||
vectorField sourceCellFaceAreas(faces.size());
|
||||
|
||||
labelListList sourceCellFaces(faces.size());
|
||||
|
||||
DynamicList<label> wallFaces;
|
||||
|
||||
forAll(faces, f)
|
||||
{
|
||||
label faceI = faces[f];
|
||||
|
||||
sourceCellFaces[f] = mesh.faces()[faceI];
|
||||
|
||||
sourceCellFaceCentres[f] = mesh.faceCentres()[faceI];
|
||||
|
||||
sourceCellFaceAreas[f] = mesh.faceAreas()[faceI];
|
||||
|
||||
if (!mesh.isInternalFace(faceI))
|
||||
{
|
||||
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
|
||||
// move reference point for wall
|
||||
if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
wallFaces.append(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wallFaces_.transfer(wallFaces);
|
||||
|
||||
locallyMapFaceList(points, sourceCellFaces);
|
||||
|
||||
faceCentres_ = referPositions(sourceCellFaceCentres);
|
||||
|
||||
faceAreas_ = rotateVectors(sourceCellFaceAreas);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::ReferredCell<ParticleType>::locallyMapEdgeList
|
||||
(
|
||||
const labelList& points,
|
||||
const edgeList& sourceCellEdges
|
||||
)
|
||||
{
|
||||
edges_.setSize(sourceCellEdges.size());
|
||||
|
||||
forAll(sourceCellEdges, sCE)
|
||||
{
|
||||
const edge& e(sourceCellEdges[sCE]);
|
||||
|
||||
edges_[sCE].start() = findIndex(points, e.start());
|
||||
|
||||
edges_[sCE].end() = findIndex(points, e.end());
|
||||
|
||||
if
|
||||
(
|
||||
edges_[sCE].start() == -1
|
||||
|| edges_[sCE].end() == -1
|
||||
)
|
||||
{
|
||||
FatalErrorIn("Foam::ReferredCell::locallyMapEdgeList")
|
||||
<< "edgeList and points labelList for "
|
||||
<< "referred cell do not match: "
|
||||
<< nl << "points: " << points
|
||||
<< nl << "egdes: " << sourceCellEdges
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::ReferredCell<ParticleType>::locallyMapFaceList
|
||||
(
|
||||
const labelList& points,
|
||||
const labelListList& sourceCellFaces
|
||||
)
|
||||
{
|
||||
faces_.setSize(sourceCellFaces.size());
|
||||
|
||||
forAll(sourceCellFaces, sCF)
|
||||
{
|
||||
const labelList& sourceCellFace(sourceCellFaces[sCF]);
|
||||
|
||||
face& localFace(faces_[sCF]);
|
||||
|
||||
localFace.setSize(sourceCellFace.size());
|
||||
|
||||
forAll(sourceCellFace, p)
|
||||
{
|
||||
localFace[p] = findIndex(points, sourceCellFace[p]);
|
||||
|
||||
if (localFace[p] == -1)
|
||||
{
|
||||
FatalErrorIn("Foam::ReferredCell::locallyMapEdgeList")
|
||||
<< "edgeList and points labelList for "
|
||||
<< "referred cell do not match: "
|
||||
<< nl << "points: " << points
|
||||
<< nl << "faces: " << sourceCellFaces
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vector Foam::ReferredCell<ParticleType>::referPosition
|
||||
(
|
||||
const vector& positionToRefer
|
||||
)
|
||||
{
|
||||
return offset_ + (rotation_ & positionToRefer);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::pointField
|
||||
Foam::ReferredCell<ParticleType>::referPositions
|
||||
(
|
||||
const pointField& positionsToRefer
|
||||
)
|
||||
{
|
||||
return offset_ + (rotation_ & positionsToRefer);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vector
|
||||
Foam::ReferredCell<ParticleType>::rotateVector(const vector& vectorToRotate)
|
||||
{
|
||||
return rotation_ & vectorToRotate;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorField
|
||||
Foam::ReferredCell<ParticleType>::rotateVectors
|
||||
(
|
||||
const vectorField& vectorsToRotate
|
||||
)
|
||||
{
|
||||
return rotation_ & vectorsToRotate;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType>::ReferredCell()
|
||||
:
|
||||
IDLList<ParticleType>(),
|
||||
sourceProc_(-1),
|
||||
sourceCell_(-1),
|
||||
vertexPositions_(),
|
||||
edges_(),
|
||||
faces_(),
|
||||
wallFaces_(),
|
||||
faceCentres_(),
|
||||
faceAreas_(),
|
||||
realCellsForInteraction_(),
|
||||
offset_(vector::zero),
|
||||
rotation_(I)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType>::ReferredCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
)
|
||||
:
|
||||
IDLList<ParticleType>(),
|
||||
sourceProc_(sourceProc),
|
||||
sourceCell_(sourceCell),
|
||||
edges_(),
|
||||
faces_(),
|
||||
wallFaces_(),
|
||||
faceCentres_(),
|
||||
faceAreas_(),
|
||||
realCellsForInteraction_(),
|
||||
offset_(offset),
|
||||
rotation_(rotation)
|
||||
{
|
||||
setConstructionData(mesh, sourceCell);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType>::ReferredCell
|
||||
(
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const pointField& vertexPositions,
|
||||
const edgeList& localEdges,
|
||||
const faceList& localFaces,
|
||||
const labelList& wallFaces,
|
||||
const pointField& faceCentres,
|
||||
const vectorField& faceAreas,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
)
|
||||
:
|
||||
IDLList<ParticleType>(),
|
||||
sourceProc_(sourceProc),
|
||||
sourceCell_(sourceCell),
|
||||
edges_(localEdges),
|
||||
faces_(localFaces),
|
||||
wallFaces_(wallFaces),
|
||||
faceCentres_(),
|
||||
faceAreas_(),
|
||||
realCellsForInteraction_(),
|
||||
offset_(offset),
|
||||
rotation_(rotation)
|
||||
{
|
||||
// Supplied vertexPositions, faceCentres and faceAreas are of the
|
||||
// "original" cell, and need to be transformed to the referred
|
||||
// locations on construction
|
||||
|
||||
vertexPositions_ = referPositions(vertexPositions);
|
||||
|
||||
faceCentres_ = referPositions(faceCentres);
|
||||
|
||||
faceAreas_ = rotateVectors(faceAreas);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType>::ReferredCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vector& cS,
|
||||
const vector& cD,
|
||||
const vector& nS,
|
||||
const vector& nD
|
||||
)
|
||||
:
|
||||
IDLList<ParticleType>(),
|
||||
sourceProc_(sourceProc),
|
||||
sourceCell_(sourceCell)
|
||||
{
|
||||
// It is assumed that the vectors originating from the faces being referred
|
||||
// here are correct periodic faces - i.e. they have the same area etc.
|
||||
|
||||
vector nA = -nS/mag(nS);
|
||||
vector nB = nD/mag(nD);
|
||||
|
||||
rotation_ = rotationTensor(nA, nB);
|
||||
|
||||
offset_ = cD - (rotation_ & cS);
|
||||
|
||||
// Allow sourceCell = -1 to create a dummy ReferredCell
|
||||
// to obtain the transformation
|
||||
|
||||
if(sourceCell >= 0)
|
||||
{
|
||||
setConstructionData(mesh, sourceCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType>::~ReferredCell()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::ReferredCell<ParticleType> Foam::ReferredCell<ParticleType>::reRefer
|
||||
(
|
||||
const vector& cS,
|
||||
const vector& cD,
|
||||
const vector& nS,
|
||||
const vector& nD
|
||||
)
|
||||
{
|
||||
vector nA = -nS/mag(nS);
|
||||
vector nB = nD/mag(nD);
|
||||
|
||||
tensor newRotation = rotationTensor(nA, nB);
|
||||
|
||||
vector newOffset = cD - (newRotation & cS);
|
||||
|
||||
tensor reReferredRotation = newRotation & rotation_;
|
||||
|
||||
vector reReferredOffset = newOffset + (newRotation & offset_);
|
||||
|
||||
return ReferredCell
|
||||
(
|
||||
sourceProc_,
|
||||
sourceCell_,
|
||||
rotation_.T() & (vertexPositions_ - offset_),
|
||||
edges_,
|
||||
faces_,
|
||||
wallFaces_,
|
||||
rotation_.T() & (faceCentres_ - offset_),
|
||||
rotation_.T() & (faceAreas_),
|
||||
reReferredOffset,
|
||||
reReferredRotation
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vector Foam::ReferredCell<ParticleType>::referPosition
|
||||
(
|
||||
const vector& positionToRefer
|
||||
) const
|
||||
{
|
||||
return offset_ + (rotation_ & positionToRefer);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::pointField Foam::ReferredCell<ParticleType>::referPosition
|
||||
(
|
||||
const pointField& positionsToRefer
|
||||
) const
|
||||
{
|
||||
return offset_ + (rotation_ & positionsToRefer);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vector Foam::ReferredCell<ParticleType>::rotateVector
|
||||
(
|
||||
const vector& vectorToRotate
|
||||
) const
|
||||
{
|
||||
return rotation_ & vectorToRotate;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorField Foam::ReferredCell<ParticleType>::rotateVectors
|
||||
(
|
||||
const vectorField& vectorsToRotate
|
||||
) const
|
||||
{
|
||||
return rotation_ & vectorsToRotate;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
void Foam::ReferredCell<ParticleType>::referInParticle
|
||||
(
|
||||
ParticleType* incomingParticlePtr
|
||||
)
|
||||
{
|
||||
ParticleType& p = *incomingParticlePtr;
|
||||
|
||||
p.position() = referPosition
|
||||
(
|
||||
p.position()
|
||||
);
|
||||
|
||||
p.transformProperties(rotation_);
|
||||
|
||||
this->append(incomingParticlePtr);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
bool Foam::ReferredCell<ParticleType>::duplicate
|
||||
(
|
||||
const ReferredCell<ParticleType>& refCellDupl
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
sourceProc_ == refCellDupl.sourceProc()
|
||||
&& sourceCell_ == refCellDupl.sourceCell()
|
||||
&& mag(offset_ - refCellDupl.offset())
|
||||
< InteractionLists<ParticleType>::transTol
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
bool Foam::ReferredCell<ParticleType>::duplicate
|
||||
(
|
||||
const label procNo,
|
||||
const label nCells
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
sourceProc_ == procNo
|
||||
&& sourceCell_ < nCells
|
||||
&& mag(offset_)
|
||||
< InteractionLists<ParticleType>::transTol
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
bool Foam::operator==
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
)
|
||||
{
|
||||
return const_cast<ReferredCell<ParticleType>&>(a).duplicate
|
||||
(
|
||||
const_cast<const ReferredCell<ParticleType>&>(b)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
bool Foam::operator!=
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::Istream& Foam::operator>>(Istream& is, ReferredCell<ParticleType>& rC)
|
||||
{
|
||||
|
||||
is >> rC.sourceProc_
|
||||
>> rC.sourceCell_
|
||||
>> rC.vertexPositions_
|
||||
>> rC.edges_
|
||||
>> rC.faces_
|
||||
>> rC.wallFaces_
|
||||
>> rC.faceCentres_
|
||||
>> rC.faceAreas_
|
||||
>> rC.offset_
|
||||
>> rC.rotation_;
|
||||
|
||||
is.check("Istream& operator>>(Istream& f, ReferredCell<ParticleType>& rC");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const ReferredCell<ParticleType>& rC
|
||||
)
|
||||
{
|
||||
|
||||
os << rC.sourceProc()
|
||||
<< token::SPACE << rC.sourceCell()
|
||||
<< token::SPACE << rC.points()
|
||||
<< token::SPACE << rC.edges()
|
||||
<< token::SPACE << rC.faces()
|
||||
<< token::SPACE << rC.wallFaces()
|
||||
<< token::SPACE << rC.faceCentres()
|
||||
<< token::SPACE << rC.faceAreas()
|
||||
<< token::SPACE << rC.offset()
|
||||
<< token::SPACE << rC.rotation();
|
||||
|
||||
os.check
|
||||
(
|
||||
"Ostream& operator<<(Ostream& f, const ReferredCell<ParticleType>& rC"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,339 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
Class
|
||||
Foam::ReferredCell
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
ReferredCellI.H
|
||||
ReferredCell.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ReferredCell_H
|
||||
#define ReferredCell_H
|
||||
|
||||
#include "vector.H"
|
||||
#include "tensor.H"
|
||||
#include "transform.H"
|
||||
#include "IDLList.H"
|
||||
#include "labelList.H"
|
||||
#include "edgeList.H"
|
||||
#include "polyMesh.H"
|
||||
#include "faceList.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<class ParticleType>
|
||||
class ReferredCell;
|
||||
|
||||
template<class ParticleType>
|
||||
bool operator==
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
);
|
||||
|
||||
template<class ParticleType>
|
||||
bool operator!=
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
);
|
||||
|
||||
template<class ParticleType>
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
ReferredCell<ParticleType>&
|
||||
);
|
||||
|
||||
template<class ParticleType>
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const ReferredCell<ParticleType>&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ReferredCell Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ParticleType>
|
||||
class ReferredCell
|
||||
:
|
||||
public IDLList<ParticleType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- The source processor of this referred cell
|
||||
label sourceProc_;
|
||||
|
||||
//- The cell on the source processor that this cell is referring
|
||||
label sourceCell_;
|
||||
|
||||
//- Referred cell vertex positions
|
||||
pointField vertexPositions_;
|
||||
|
||||
//- The edge structure of this referred cell, indices of the
|
||||
// vertexPositions_ list
|
||||
edgeList edges_;
|
||||
|
||||
//- The face structure of this referred cell, indices of the
|
||||
// vertexPositions_ list
|
||||
faceList faces_;
|
||||
|
||||
// Which of the faces represent wall faces on their source processor
|
||||
labelList wallFaces_;
|
||||
|
||||
//- The face centre data for the cell in the referred position
|
||||
pointField faceCentres_;
|
||||
|
||||
//- The face area data for the cell in the referred position
|
||||
vectorField faceAreas_;
|
||||
|
||||
//- Which cells on the processor hosting this referred cell
|
||||
// require interactions from it
|
||||
labelList realCellsForInteraction_;
|
||||
|
||||
//- Vector (shift) part of the transformation from the original cell
|
||||
vector offset_;
|
||||
|
||||
//- Tensor (rotate) part of the transformation from the original cell
|
||||
tensor rotation_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
void setConstructionData
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceCell
|
||||
);
|
||||
|
||||
void locallyMapEdgeList
|
||||
(
|
||||
const labelList& points,
|
||||
const edgeList& sourceCellEdges
|
||||
);
|
||||
|
||||
void locallyMapFaceList
|
||||
(
|
||||
const labelList& points,
|
||||
const labelListList& sourceCellFaces
|
||||
);
|
||||
|
||||
vector referPosition(const vector& positionToRefer);
|
||||
|
||||
pointField referPositions(const pointField& positionsToRefer);
|
||||
|
||||
vector rotateVector(const vector& vectorToRotate);
|
||||
|
||||
vectorField rotateVectors(const vectorField& vectorsToRotate);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
|
||||
ReferredCell();
|
||||
|
||||
//- Construct from components with external edge information
|
||||
ReferredCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
);
|
||||
|
||||
//- Construct from components with existing local edge information
|
||||
ReferredCell
|
||||
(
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const pointField& vertexPositions,
|
||||
const edgeList& localEdges,
|
||||
const faceList& localFaces,
|
||||
const labelList& wallFaces,
|
||||
const pointField& faceCentres,
|
||||
const vectorField& faceAreas,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
);
|
||||
|
||||
//- Construct from pair of face centers (c) and plain
|
||||
// face normals (n) (no need to make unit vectors or
|
||||
// reverse one direction)
|
||||
// Order of vectors important (S = source, D = Destination).
|
||||
// External edge information.
|
||||
ReferredCell
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vector& cS,
|
||||
const vector& cD,
|
||||
const vector& nS,
|
||||
const vector& nD
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~ReferredCell();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Take this ReferredCell object that has already had it's transform
|
||||
// calculated and refer it on again, retaining same source info.
|
||||
ReferredCell reRefer
|
||||
(
|
||||
const vector& cS,
|
||||
const vector& cD,
|
||||
const vector& nS,
|
||||
const vector& nD
|
||||
);
|
||||
|
||||
//- Use internal transformatation values to transform the given
|
||||
// postion to its new location.
|
||||
vector referPosition(const vector& positionToRefer) const;
|
||||
|
||||
//- Use internal transformatation values to transform the given
|
||||
// list of postions to their new locations.
|
||||
pointField referPosition(const pointField& positionsToRefer) const;
|
||||
|
||||
//- Use internal transformatation values to rotate the given vector
|
||||
vector rotateVector(const vector& vectorToRotate) const;
|
||||
|
||||
//- Use internal transformatation values to rotate the given
|
||||
// list of vectors
|
||||
vectorField rotateVectors(const vectorField& vectorsToRotate) const;
|
||||
|
||||
//- referInParticle takes a referred particle from a source
|
||||
// processor, transforming its position and properties
|
||||
void referInParticle(ParticleType* incomingParticlePtr);
|
||||
|
||||
//- duplicate() function to test whether a referred or real cell
|
||||
// supplied by arguement is a duplicate of this ReferredCell.
|
||||
// Can be used bi-directionally - i.e. can be called on an existing
|
||||
// referred cell with a proposed ReferredCell as argument,
|
||||
// or vice versa. Can only be called by a proposed ReferredCell with
|
||||
// a real cell index as arguement to test to see if the proposed
|
||||
// ReferredCell is a duplicate.
|
||||
// A duplicate cell is defined as one which has the same source
|
||||
// processor, source cell, and an equal offset. Real cells have zero
|
||||
// offset by definition.
|
||||
bool duplicate(const ReferredCell& refCellDupl) const;
|
||||
|
||||
bool duplicate(const label procNo, const label nCells) const;
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
inline label sourceProc() const;
|
||||
|
||||
inline label sourceCell() const;
|
||||
|
||||
inline const vector& offset() const;
|
||||
|
||||
inline const tensor& rotation() const;
|
||||
|
||||
inline const pointField& points() const;
|
||||
|
||||
inline const edgeList& edges() const;
|
||||
|
||||
inline const faceList& faces() const;
|
||||
|
||||
inline const labelList& wallFaces() const;
|
||||
|
||||
inline const pointField& faceCentres() const;
|
||||
|
||||
inline const vectorField& faceAreas() const;
|
||||
|
||||
inline labelList& realCells();
|
||||
|
||||
inline const labelList& realCellsForInteraction() const;
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator== <ParticleType>
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
);
|
||||
|
||||
friend bool operator!= <ParticleType>
|
||||
(
|
||||
const ReferredCell<ParticleType>& a,
|
||||
const ReferredCell<ParticleType>& b
|
||||
);
|
||||
|
||||
friend Istream& operator>> <ParticleType>
|
||||
(
|
||||
Istream&,
|
||||
ReferredCell<ParticleType>&
|
||||
);
|
||||
|
||||
friend Ostream& operator<< <ParticleType>
|
||||
(
|
||||
Ostream&,
|
||||
const ReferredCell<ParticleType>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ReferredCellI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ReferredCell.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,119 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
inline Foam::label Foam::ReferredCell<ParticleType>::sourceProc() const
|
||||
{
|
||||
return sourceProc_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline Foam::label Foam::ReferredCell<ParticleType>::sourceCell() const
|
||||
{
|
||||
return sourceCell_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::vector& Foam::ReferredCell<ParticleType>::offset() const
|
||||
{
|
||||
return offset_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::tensor& Foam::ReferredCell<ParticleType>::rotation() const
|
||||
{
|
||||
return rotation_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::pointField&
|
||||
Foam::ReferredCell<ParticleType>::points() const
|
||||
{
|
||||
return vertexPositions_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::edgeList& Foam::ReferredCell<ParticleType>::edges() const
|
||||
{
|
||||
return edges_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::faceList&
|
||||
Foam::ReferredCell<ParticleType>::faces() const
|
||||
{
|
||||
return faces_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::labelList&
|
||||
Foam::ReferredCell<ParticleType>::wallFaces() const
|
||||
{
|
||||
return wallFaces_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::pointField&
|
||||
Foam::ReferredCell<ParticleType>::faceCentres() const
|
||||
{
|
||||
return faceCentres_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::vectorField&
|
||||
Foam::ReferredCell<ParticleType>::faceAreas() const
|
||||
{
|
||||
return faceAreas_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline Foam::labelList& Foam::ReferredCell<ParticleType>::realCells()
|
||||
{
|
||||
return realCellsForInteraction_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::labelList&
|
||||
Foam::ReferredCell<ParticleType>::realCellsForInteraction() const
|
||||
{
|
||||
return realCellsForInteraction_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,148 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
Class
|
||||
Foam::ReferredCellList
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
ReferredCellListI.H
|
||||
ReferredCellList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ReferredCellList_H
|
||||
#define ReferredCellList_H
|
||||
|
||||
#include "ReferredCell.H"
|
||||
#include "sendingReferralList.H"
|
||||
#include "receivingReferralList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
template<class ParticleType>
|
||||
class InteractionLists;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ReferredCellList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class ParticleType>
|
||||
class ReferredCellList
|
||||
:
|
||||
public List<ReferredCell<ParticleType> >
|
||||
{
|
||||
// Private data
|
||||
|
||||
const InteractionLists<ParticleType>& il_;
|
||||
|
||||
//- Dummy cloud to give to particles
|
||||
Cloud<ParticleType> cloud_;
|
||||
|
||||
List<sendingReferralList> cellSendingReferralLists_;
|
||||
|
||||
List<receivingReferralList> cellReceivingReferralLists_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Refer and rerefer cells to construct referred interactions
|
||||
void buildReferredCellList
|
||||
(
|
||||
bool pointPointListBuild
|
||||
);
|
||||
|
||||
//- Build referralLists which define how to send information
|
||||
// to ReferredCells to source cells
|
||||
void buildCellReferralLists();
|
||||
|
||||
//- Store the referred particles in the referred cells
|
||||
void storeParticles
|
||||
(
|
||||
const receivingReferralList& rRL,
|
||||
const labelList& destinationReferredCell,
|
||||
IDLList<ParticleType>& particlesToReferIn
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct lists by searching the mesh
|
||||
ReferredCellList
|
||||
(
|
||||
InteractionLists<ParticleType>& il,
|
||||
bool pointPointListBuild
|
||||
);
|
||||
|
||||
//- Construct from file
|
||||
ReferredCellList (InteractionLists<ParticleType>& il);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~ReferredCellList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
void referParticles
|
||||
(
|
||||
const List<DynamicList<ParticleType*> >& cellOccupancy
|
||||
);
|
||||
|
||||
inline const InteractionLists<ParticleType>& il() const;
|
||||
|
||||
inline label nInteractingProcs() const;
|
||||
|
||||
//- Write the referredCell structure to an obj file
|
||||
void writeReferredCells() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ReferredCellListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ReferredCellList.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,45 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::InteractionLists<ParticleType>&
|
||||
Foam::ReferredCellList<ParticleType>::il() const
|
||||
{
|
||||
return il_;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline Foam::label
|
||||
Foam::ReferredCellList<ParticleType>::nInteractingProcs() const
|
||||
{
|
||||
return cellReceivingReferralLists_.size();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,119 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "receivingReferralList.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::receivingReferralList::receivingReferralList()
|
||||
:
|
||||
labelListList(),
|
||||
sourceProc_(-1)
|
||||
{}
|
||||
|
||||
|
||||
Foam::receivingReferralList::receivingReferralList
|
||||
(
|
||||
const label sourceProc,
|
||||
const labelListList& refCellsToSendTo
|
||||
)
|
||||
:
|
||||
labelListList(refCellsToSendTo),
|
||||
sourceProc_(sourceProc)
|
||||
{}
|
||||
|
||||
|
||||
Foam::receivingReferralList::receivingReferralList
|
||||
(
|
||||
const receivingReferralList& rL
|
||||
)
|
||||
:
|
||||
labelListList(rL),
|
||||
sourceProc_(rL.sourceProc())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::receivingReferralList::~receivingReferralList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::receivingReferralList::operator=(const receivingReferralList& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::receivingReferralList::operator="
|
||||
"(const Foam::receivingReferralList&)"
|
||||
)
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
labelListList::operator=(rhs);
|
||||
|
||||
sourceProc_ = rhs.sourceProc();
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, receivingReferralList& rRL)
|
||||
{
|
||||
is >> rRL.sourceProc_ >> static_cast<labelListList&>(rRL);
|
||||
|
||||
is.check
|
||||
(
|
||||
"Istream& operator<<(Istream& f, const receivingReferralList& rRL"
|
||||
);
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const receivingReferralList& rRL
|
||||
)
|
||||
{
|
||||
os << rRL.sourceProc() << token::SPACE
|
||||
<< static_cast< const labelListList& >(rRL);
|
||||
|
||||
os.check
|
||||
(
|
||||
"Ostream& operator<<(Ostream& f, const receivingReferralList& rRL"
|
||||
);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,127 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::receivingReferralList
|
||||
|
||||
Description
|
||||
Contains an outer list which has entries corresponding to the
|
||||
incoming particles sent by the sendingReferralList on the source
|
||||
processor. The inner list has the indices of the referred cells
|
||||
on the current processor to refer the particles to, as a real cell
|
||||
may be referred multiple times.
|
||||
|
||||
SourceFiles
|
||||
receivingReferralListI.H
|
||||
receivingReferralList.C
|
||||
receivingReferralListIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef receivingReferralList_H
|
||||
#define receivingReferralList_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class receivingReferralList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class receivingReferralList
|
||||
:
|
||||
public labelListList
|
||||
{
|
||||
// Private data
|
||||
|
||||
label sourceProc_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
receivingReferralList();
|
||||
|
||||
//- Construct from components
|
||||
receivingReferralList
|
||||
(
|
||||
const label sourceProc,
|
||||
const labelListList& refCellsToSendTo
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
receivingReferralList(const receivingReferralList&);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~receivingReferralList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
inline label sourceProc() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const receivingReferralList&);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
receivingReferralList&
|
||||
);
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const receivingReferralList&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "receivingReferralListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,35 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::label Foam::receivingReferralList::sourceProc() const
|
||||
{
|
||||
return sourceProc_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,117 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "sendingReferralList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sendingReferralList::sendingReferralList()
|
||||
:
|
||||
labelList(),
|
||||
destinationProc_(-1)
|
||||
{}
|
||||
|
||||
|
||||
Foam::sendingReferralList::sendingReferralList
|
||||
(
|
||||
const label destinationProc,
|
||||
const labelList& cellsToSend
|
||||
)
|
||||
:
|
||||
labelList(cellsToSend),
|
||||
destinationProc_(destinationProc)
|
||||
{}
|
||||
|
||||
|
||||
Foam::sendingReferralList::sendingReferralList
|
||||
(
|
||||
const sendingReferralList& rL
|
||||
)
|
||||
:
|
||||
labelList(rL),
|
||||
destinationProc_(rL.destinationProc())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sendingReferralList::~sendingReferralList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::sendingReferralList::operator=(const sendingReferralList& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::sendingReferralList::" \
|
||||
"operator=(const Foam::sendingReferralList&)"
|
||||
)
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
labelList::operator=(rhs);
|
||||
|
||||
destinationProc_ = rhs.destinationProc();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
sendingReferralList& sRL
|
||||
)
|
||||
{
|
||||
is >> sRL.destinationProc_ >> static_cast<labelList&>(sRL);
|
||||
|
||||
is.check("Istream& operator<<(Istream& f, const sendingReferralList& sRL");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const sendingReferralList& rL
|
||||
)
|
||||
{
|
||||
os << rL.destinationProc() << token::SPACE
|
||||
<< static_cast< const labelList& >(rL);
|
||||
|
||||
os.check("Ostream& operator<<(Ostream& f, const sendingReferralList& rL");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,125 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
Class
|
||||
Foam::sendingReferralList
|
||||
|
||||
Description
|
||||
Contains the list of the real cells on the current processor to be
|
||||
referred to the destination processor
|
||||
|
||||
SourceFiles
|
||||
sendingReferralListI.H
|
||||
sendingReferralList.C
|
||||
sendingReferralListIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef sendingReferralList_H
|
||||
#define sendingReferralList_H
|
||||
|
||||
#include "labelList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class sendingReferralList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class sendingReferralList
|
||||
:
|
||||
public labelList
|
||||
{
|
||||
// Private data
|
||||
|
||||
label destinationProc_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
sendingReferralList();
|
||||
|
||||
//- Construct from components
|
||||
sendingReferralList
|
||||
(
|
||||
const label destinationProc,
|
||||
const labelList& cellsToSend
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
sendingReferralList(const sendingReferralList&);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~sendingReferralList();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
inline label destinationProc() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
void operator=(const sendingReferralList&);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
sendingReferralList&
|
||||
);
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const sendingReferralList&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "sendingReferralListI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,35 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::label Foam::sendingReferralList::destinationProc() const
|
||||
{
|
||||
return destinationProc_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user