tetIndices: Removed duplicate logic
The logic for generating tetrahedra from a face base point and an offset was duplicated in a few places. It is now confined to the tetIndices class.
This commit is contained in:
@ -1357,16 +1357,7 @@ bool Foam::polyMesh::pointInCell
|
|||||||
for (label tetPti = 1; tetPti < f.size() - 1; tetPti++)
|
for (label tetPti = 1; tetPti < f.size() - 1; tetPti++)
|
||||||
{
|
{
|
||||||
// Get tetIndices of face triangle
|
// Get tetIndices of face triangle
|
||||||
tetIndices faceTetIs
|
tetIndices faceTetIs(celli, facei, tetPti);
|
||||||
(
|
|
||||||
polyMeshTetDecomposition::triangleTetIndices
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
facei,
|
|
||||||
celli,
|
|
||||||
tetPti
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
triPointRef faceTri = faceTetIs.faceTri(*this);
|
triPointRef faceTri = faceTetIs.faceTri(*this);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -530,11 +530,7 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
|
|||||||
label cI
|
label cI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
static label nWarnings = 0;
|
|
||||||
static const label maxWarnings = 100;
|
|
||||||
|
|
||||||
const faceList& pFaces = mesh.faces();
|
const faceList& pFaces = mesh.faces();
|
||||||
const labelList& pOwner = mesh.faceOwner();
|
|
||||||
|
|
||||||
const face& f = pFaces[fI];
|
const face& f = pFaces[fI];
|
||||||
|
|
||||||
@ -542,121 +538,15 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
|
|||||||
|
|
||||||
List<tetIndices> faceTets(nTets);
|
List<tetIndices> faceTets(nTets);
|
||||||
|
|
||||||
bool own = (pOwner[fI] == cI);
|
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI ++)
|
||||||
|
|
||||||
label tetBasePtI = mesh.tetBasePtIs()[fI];
|
|
||||||
|
|
||||||
if (tetBasePtI == -1)
|
|
||||||
{
|
{
|
||||||
if (nWarnings < maxWarnings)
|
faceTets[tetPtI - 1] = tetIndices(cI, fI, tetPtI);
|
||||||
{
|
|
||||||
WarningInFunction
|
|
||||||
<< "No base point for face " << fI << ", " << f
|
|
||||||
<< ", produces a valid tet decomposition."
|
|
||||||
<< endl;
|
|
||||||
nWarnings++;
|
|
||||||
}
|
|
||||||
if (nWarnings == maxWarnings)
|
|
||||||
{
|
|
||||||
Warning<< "Suppressing any further warnings." << endl;
|
|
||||||
nWarnings++;
|
|
||||||
}
|
|
||||||
|
|
||||||
tetBasePtI = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI++)
|
|
||||||
{
|
|
||||||
tetIndices& faceTetIs = faceTets[tetPtI - 1];
|
|
||||||
|
|
||||||
label facePtI = (tetPtI + tetBasePtI) % f.size();
|
|
||||||
label otherFacePtI = f.fcIndex(facePtI);
|
|
||||||
|
|
||||||
faceTetIs.cell() = cI;
|
|
||||||
|
|
||||||
faceTetIs.face() = fI;
|
|
||||||
|
|
||||||
faceTetIs.faceBasePt() = tetBasePtI;
|
|
||||||
|
|
||||||
if (own)
|
|
||||||
{
|
|
||||||
faceTetIs.facePtA() = facePtI;
|
|
||||||
faceTetIs.facePtB() = otherFacePtI;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
faceTetIs.facePtA() = otherFacePtI;
|
|
||||||
faceTetIs.facePtB() = facePtI;
|
|
||||||
}
|
|
||||||
|
|
||||||
faceTetIs.tetPt() = tetPtI;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return faceTets;
|
return faceTets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tetIndices Foam::polyMeshTetDecomposition::triangleTetIndices
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const label fI,
|
|
||||||
const label cI,
|
|
||||||
const label tetPtI
|
|
||||||
)
|
|
||||||
{
|
|
||||||
static label nWarnings = 0;
|
|
||||||
static const label maxWarnings = 100;
|
|
||||||
|
|
||||||
const face& f = mesh.faces()[fI];
|
|
||||||
bool own = (mesh.faceOwner()[fI] == cI);
|
|
||||||
label tetBasePtI = mesh.tetBasePtIs()[fI];
|
|
||||||
if (tetBasePtI == -1)
|
|
||||||
{
|
|
||||||
if (nWarnings < maxWarnings)
|
|
||||||
{
|
|
||||||
WarningInFunction
|
|
||||||
<< "No base point for face " << fI << ", " << f
|
|
||||||
<< ", produces a valid tet decomposition."
|
|
||||||
<< endl;
|
|
||||||
nWarnings++;
|
|
||||||
}
|
|
||||||
if (nWarnings == maxWarnings)
|
|
||||||
{
|
|
||||||
Warning<< "Suppressing any further warnings." << endl;
|
|
||||||
nWarnings++;
|
|
||||||
}
|
|
||||||
|
|
||||||
tetBasePtI = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tetIndices faceTetIs;
|
|
||||||
|
|
||||||
label facePtI = (tetPtI + tetBasePtI) % f.size();
|
|
||||||
label otherFacePtI = f.fcIndex(facePtI);
|
|
||||||
|
|
||||||
faceTetIs.cell() = cI;
|
|
||||||
|
|
||||||
faceTetIs.face() = fI;
|
|
||||||
|
|
||||||
faceTetIs.faceBasePt() = tetBasePtI;
|
|
||||||
|
|
||||||
if (own)
|
|
||||||
{
|
|
||||||
faceTetIs.facePtA() = facePtI;
|
|
||||||
faceTetIs.facePtB() = otherFacePtI;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
faceTetIs.facePtA() = otherFacePtI;
|
|
||||||
faceTetIs.facePtB() = facePtI;
|
|
||||||
}
|
|
||||||
|
|
||||||
faceTetIs.tetPt() = tetPtI;
|
|
||||||
|
|
||||||
return faceTetIs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::cellTetIndices
|
Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::cellTetIndices
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
@ -711,16 +601,7 @@ Foam::tetIndices Foam::polyMeshTetDecomposition::findTet
|
|||||||
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI++)
|
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI++)
|
||||||
{
|
{
|
||||||
// Get tetIndices of face triangle
|
// Get tetIndices of face triangle
|
||||||
tetIndices faceTetIs
|
tetIndices faceTetIs(cI, fI, tetPtI);
|
||||||
(
|
|
||||||
triangleTetIndices
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
fI,
|
|
||||||
cI,
|
|
||||||
tetPtI
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check if inside
|
// Check if inside
|
||||||
if (faceTetIs.tet(mesh).inside(pt))
|
if (faceTetIs.tet(mesh).inside(pt))
|
||||||
|
|||||||
@ -130,15 +130,6 @@ public:
|
|||||||
label cI
|
label cI
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Return the tet decomposition of the given triangle of the given face
|
|
||||||
static tetIndices triangleTetIndices
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
label fI,
|
|
||||||
label cI,
|
|
||||||
const label tetPtI // offset in face
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Return the tet decomposition of the given cell, see
|
//- Return the tet decomposition of the given cell, see
|
||||||
// findFacePt for the meaning of the indices
|
// findFacePt for the meaning of the indices
|
||||||
static List<tetIndices> cellTetIndices
|
static List<tetIndices> cellTetIndices
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,15 +25,19 @@ License
|
|||||||
|
|
||||||
#include "tetIndices.H"
|
#include "tetIndices.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::label Foam::tetIndices::maxNWarnings = 100;
|
||||||
|
|
||||||
|
Foam::label Foam::tetIndices::nWarnings = 0;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tetIndices::tetIndices()
|
Foam::tetIndices::tetIndices()
|
||||||
:
|
:
|
||||||
celli_(-1),
|
celli_(-1),
|
||||||
facei_(-1),
|
facei_(-1),
|
||||||
faceBasePtI_(-1),
|
|
||||||
facePtAI_(-1),
|
|
||||||
facePtBI_(-1),
|
|
||||||
tetPti_(-1)
|
tetPti_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -42,61 +46,15 @@ Foam::tetIndices::tetIndices
|
|||||||
(
|
(
|
||||||
label celli,
|
label celli,
|
||||||
label facei,
|
label facei,
|
||||||
label faceBasePtI,
|
|
||||||
label facePtAI,
|
|
||||||
label facePtBI,
|
|
||||||
label tetPtI
|
label tetPtI
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
celli_(celli),
|
celli_(celli),
|
||||||
facei_(facei),
|
facei_(facei),
|
||||||
faceBasePtI_(faceBasePtI),
|
|
||||||
facePtAI_(facePtAI),
|
|
||||||
facePtBI_(facePtBI),
|
|
||||||
tetPti_(tetPtI)
|
tetPti_(tetPtI)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::tetIndices::tetIndices
|
|
||||||
(
|
|
||||||
label celli,
|
|
||||||
label facei,
|
|
||||||
label tetPtI,
|
|
||||||
const polyMesh& mesh
|
|
||||||
)
|
|
||||||
:
|
|
||||||
celli_(celli),
|
|
||||||
facei_(facei),
|
|
||||||
faceBasePtI_(-1),
|
|
||||||
facePtAI_(-1),
|
|
||||||
facePtBI_(-1),
|
|
||||||
tetPti_(tetPtI)
|
|
||||||
{
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
const labelList& pOwner = mesh.faceOwner();
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
bool own = (pOwner[facei_] == celli_);
|
|
||||||
|
|
||||||
faceBasePtI_ = mesh.tetBasePtIs()[facei_];
|
|
||||||
|
|
||||||
label facePtI = (tetPti_ + faceBasePtI_) % f.size();
|
|
||||||
label otherFacePtI = f.fcIndex(facePtI);
|
|
||||||
|
|
||||||
if (own)
|
|
||||||
{
|
|
||||||
facePtAI_ = facePtI;
|
|
||||||
facePtBI_ = otherFacePtI;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
facePtAI_ = otherFacePtI;
|
|
||||||
facePtBI_ = facePtI;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tetIndices::~tetIndices()
|
Foam::tetIndices::~tetIndices()
|
||||||
@ -107,12 +65,7 @@ Foam::tetIndices::~tetIndices()
|
|||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, tetIndices& tI)
|
Foam::Istream& Foam::operator>>(Istream& is, tetIndices& tI)
|
||||||
{
|
{
|
||||||
is >> tI.cell()
|
is >> tI.cell() >> tI.face() >> tI.tetPt();
|
||||||
>> tI.face()
|
|
||||||
>> tI.faceBasePt()
|
|
||||||
>> tI.facePtA()
|
|
||||||
>> tI.facePtB()
|
|
||||||
>> tI.tetPt();
|
|
||||||
|
|
||||||
// Check state of Istream
|
// Check state of Istream
|
||||||
is.check
|
is.check
|
||||||
@ -128,9 +81,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const tetIndices& tI)
|
|||||||
{
|
{
|
||||||
os << tI.cell() << token::SPACE
|
os << tI.cell() << token::SPACE
|
||||||
<< tI.face() << token::SPACE
|
<< tI.face() << token::SPACE
|
||||||
<< tI.faceBasePt() << token::SPACE
|
|
||||||
<< tI.facePtA() << token::SPACE
|
|
||||||
<< tI.facePtB() << token::SPACE
|
|
||||||
<< tI.tetPt() << token::SPACE
|
<< tI.tetPt() << token::SPACE
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|||||||
@ -89,24 +89,21 @@ class tetIndices
|
|||||||
//- Face that holds this decomposed tet
|
//- Face that holds this decomposed tet
|
||||||
label facei_;
|
label facei_;
|
||||||
|
|
||||||
//- Base point on the face
|
|
||||||
label faceBasePtI_;
|
|
||||||
|
|
||||||
//- Point on the face such that the right-hand circulation
|
|
||||||
// {faceBasePtI_, facePtAI_, facePtBI_}
|
|
||||||
// forms a triangle that points out of the tet
|
|
||||||
label facePtAI_;
|
|
||||||
|
|
||||||
//- Point on the face such that the right-hand circulation
|
|
||||||
// {faceBasePtI_, facePtAI_, facePtBI_}
|
|
||||||
// forms a triangle that points out of the tet
|
|
||||||
label facePtBI_;
|
|
||||||
|
|
||||||
//- Point on the face, *relative to the base point*, which
|
//- Point on the face, *relative to the base point*, which
|
||||||
// characterises this tet on the face.
|
// characterises this tet on the face.
|
||||||
label tetPti_;
|
label tetPti_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private static data
|
||||||
|
|
||||||
|
//- Maximum number of bad tet warnings
|
||||||
|
static const label maxNWarnings;
|
||||||
|
|
||||||
|
//- Current number of bad tet warnings. Warnings stop when this reaches
|
||||||
|
// the maximum number.
|
||||||
|
static label nWarnings;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -115,24 +112,7 @@ public:
|
|||||||
tetIndices();
|
tetIndices();
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
tetIndices
|
tetIndices(label celli, label facei, label tetPtI);
|
||||||
(
|
|
||||||
label celli,
|
|
||||||
label facei,
|
|
||||||
label faceBasePtI,
|
|
||||||
label facePtAI,
|
|
||||||
label facePtBI,
|
|
||||||
label tetPtI
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from cell, face, pt description of tet
|
|
||||||
tetIndices
|
|
||||||
(
|
|
||||||
label celli,
|
|
||||||
label facei,
|
|
||||||
label tetPtI,
|
|
||||||
const polyMesh& mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -146,65 +126,36 @@ public:
|
|||||||
//- Return the cell
|
//- Return the cell
|
||||||
inline label cell() const;
|
inline label cell() const;
|
||||||
|
|
||||||
//- Return the face
|
|
||||||
inline label face() const;
|
|
||||||
|
|
||||||
//- Return the face base point
|
|
||||||
inline label faceBasePt() const;
|
|
||||||
|
|
||||||
//- Return face point A
|
|
||||||
inline label facePtA() const;
|
|
||||||
|
|
||||||
//- Return face point B
|
|
||||||
inline label facePtB() const;
|
|
||||||
|
|
||||||
//- Return the characterising tetPtI
|
|
||||||
inline label tetPt() const;
|
|
||||||
|
|
||||||
//- Return the geometry corresponding to this tet from the
|
|
||||||
// supplied mesh
|
|
||||||
inline tetPointRef tet(const polyMesh& mesh) const;
|
|
||||||
|
|
||||||
//- Return the geometry corresponding to this tet from the
|
|
||||||
// supplied mesh using the old positions
|
|
||||||
inline tetPointRef oldTet(const polyMesh& mesh) const;
|
|
||||||
|
|
||||||
//- Return the geometry corresponding to the tri on the
|
|
||||||
// mesh face for this tet from the supplied mesh. Normal of
|
|
||||||
// the tri points out of the cell.
|
|
||||||
inline triPointRef faceTri(const polyMesh& mesh) const;
|
|
||||||
|
|
||||||
//- Return the point indices corresponding to the tri on the mesh
|
|
||||||
// face for this tet from the supplied mesh. Normal of
|
|
||||||
// the tri points out of the cell.
|
|
||||||
inline triFace faceTriIs(const polyMesh& mesh) const;
|
|
||||||
|
|
||||||
//- Return the geometry corresponding to the tri on the
|
|
||||||
// mesh face for this tet from the supplied mesh using
|
|
||||||
// the old position
|
|
||||||
inline triPointRef oldFaceTri(const polyMesh& mesh) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
|
||||||
|
|
||||||
//- Return non-const access to the cell
|
//- Return non-const access to the cell
|
||||||
inline label& cell();
|
inline label& cell();
|
||||||
|
|
||||||
|
//- Return the face
|
||||||
|
inline label face() const;
|
||||||
|
|
||||||
//- Return non-const access to the face
|
//- Return non-const access to the face
|
||||||
inline label& face();
|
inline label& face();
|
||||||
|
|
||||||
//- Return non-const access to the face base point
|
//- Return the characterising tetPtI
|
||||||
inline label& faceBasePt();
|
inline label tetPt() const;
|
||||||
|
|
||||||
//- Return non-const access to face point A
|
|
||||||
inline label& facePtA();
|
|
||||||
|
|
||||||
//- Return non-const access to face point B
|
|
||||||
inline label& facePtB();
|
|
||||||
|
|
||||||
//- Return non-const access to the characterising tetPtI
|
//- Return non-const access to the characterising tetPtI
|
||||||
inline label& tetPt();
|
inline label& tetPt();
|
||||||
|
|
||||||
|
//- Return the indices corresponding to the tri on the face for
|
||||||
|
// this tet. The normal of the tri points out of the cell.
|
||||||
|
inline triFace faceTriIs(const polyMesh& mesh) const;
|
||||||
|
|
||||||
|
//- Return the geometry corresponding to this tet
|
||||||
|
inline tetPointRef tet(const polyMesh& mesh) const;
|
||||||
|
|
||||||
|
//- Return the geometry corresponding to the tri on the face for
|
||||||
|
// this tet. The normal of the tri points out of the cell.
|
||||||
|
inline triPointRef faceTri(const polyMesh& mesh) const;
|
||||||
|
|
||||||
|
//- Return the geometry corresponding to the tri on the face for
|
||||||
|
// this tet using the old positions.
|
||||||
|
inline triPointRef oldFaceTri(const polyMesh& mesh) const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,181 +25,132 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::cell() const
|
inline Foam::label Foam::tetIndices::cell() const
|
||||||
{
|
{
|
||||||
return celli_;
|
return celli_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::face() const
|
inline Foam::label& Foam::tetIndices::cell()
|
||||||
{
|
|
||||||
return facei_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::faceBasePt() const
|
|
||||||
{
|
|
||||||
return faceBasePtI_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::facePtA() const
|
|
||||||
{
|
|
||||||
return facePtAI_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::facePtB() const
|
|
||||||
{
|
|
||||||
return facePtBI_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::tetIndices::tetPt() const
|
|
||||||
{
|
|
||||||
return tetPti_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tetPointRef Foam::tetIndices::tet(const polyMesh& mesh) const
|
|
||||||
{
|
|
||||||
const pointField& pPts = mesh.points();
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
const vectorField& pC = mesh.cellCentres();
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
return tetPointRef
|
|
||||||
(
|
|
||||||
pC[celli_],
|
|
||||||
pPts[f[faceBasePtI_]],
|
|
||||||
pPts[f[facePtAI_]],
|
|
||||||
pPts[f[facePtBI_]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tetPointRef Foam::tetIndices::oldTet(const polyMesh& mesh) const
|
|
||||||
{
|
|
||||||
const pointField& oldPPts = mesh.oldPoints();
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
|
|
||||||
// We need to reconstruct the old Cc from oldPoints (it isn't
|
|
||||||
// stored)
|
|
||||||
point oldC = mesh.cells()[celli_].centre
|
|
||||||
(
|
|
||||||
oldPPts,
|
|
||||||
pFaces
|
|
||||||
);
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
return tetPointRef
|
|
||||||
(
|
|
||||||
oldC,
|
|
||||||
oldPPts[f[faceBasePtI_]],
|
|
||||||
oldPPts[f[facePtAI_]],
|
|
||||||
oldPPts[f[facePtBI_]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::triPointRef Foam::tetIndices::faceTri(const polyMesh& mesh) const
|
|
||||||
{
|
|
||||||
const pointField& pPts = mesh.points();
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
return triPointRef
|
|
||||||
(
|
|
||||||
pPts[f[faceBasePtI_]],
|
|
||||||
pPts[f[facePtAI_]],
|
|
||||||
pPts[f[facePtBI_]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::triFace Foam::tetIndices::faceTriIs(const polyMesh& mesh) const
|
|
||||||
{
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
return triFace
|
|
||||||
(
|
|
||||||
f[faceBasePtI_],
|
|
||||||
f[facePtAI_],
|
|
||||||
f[facePtBI_]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::triPointRef Foam::tetIndices::oldFaceTri(const polyMesh& mesh) const
|
|
||||||
{
|
|
||||||
const pointField& oldPPts = mesh.oldPoints();
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
|
|
||||||
const Foam::face& f = pFaces[facei_];
|
|
||||||
|
|
||||||
return triPointRef
|
|
||||||
(
|
|
||||||
oldPPts[f[faceBasePtI_]],
|
|
||||||
oldPPts[f[facePtAI_]],
|
|
||||||
oldPPts[f[facePtBI_]]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::cell()
|
|
||||||
{
|
{
|
||||||
return celli_;
|
return celli_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::face()
|
inline Foam::label Foam::tetIndices::face() const
|
||||||
{
|
{
|
||||||
return facei_;
|
return facei_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::faceBasePt()
|
inline Foam::label& Foam::tetIndices::face()
|
||||||
{
|
{
|
||||||
return faceBasePtI_;
|
return facei_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::facePtA()
|
inline Foam::label Foam::tetIndices::tetPt() const
|
||||||
{
|
|
||||||
return facePtAI_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::facePtB()
|
|
||||||
{
|
|
||||||
return facePtBI_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::label& Foam::tetIndices::tetPt()
|
|
||||||
{
|
{
|
||||||
return tetPti_;
|
return tetPti_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label& Foam::tetIndices::tetPt()
|
||||||
|
{
|
||||||
|
return tetPti_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::triFace Foam::tetIndices::faceTriIs(const polyMesh& mesh) const
|
||||||
|
{
|
||||||
|
const Foam::face& f = mesh.faces()[face()];
|
||||||
|
|
||||||
|
label faceBasePtI = mesh.tetBasePtIs()[face()];
|
||||||
|
|
||||||
|
if (faceBasePtI < 0)
|
||||||
|
{
|
||||||
|
faceBasePtI = 0;
|
||||||
|
if (nWarnings < maxNWarnings)
|
||||||
|
{
|
||||||
|
WarningInFunction
|
||||||
|
<< "No base point for face " << face() << ", " << f
|
||||||
|
<< ", produces a valid tet decomposition." << endl;
|
||||||
|
++ nWarnings;
|
||||||
|
}
|
||||||
|
if (nWarnings == maxNWarnings)
|
||||||
|
{
|
||||||
|
Warning
|
||||||
|
<< "Suppressing any further warnings." << endl;
|
||||||
|
++ nWarnings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label facePtI = (tetPt() + faceBasePtI) % f.size();
|
||||||
|
label faceOtherPtI = f.fcIndex(facePtI);
|
||||||
|
|
||||||
|
if (mesh.faceOwner()[face()] != cell())
|
||||||
|
{
|
||||||
|
Swap(facePtI, faceOtherPtI);
|
||||||
|
}
|
||||||
|
|
||||||
|
return triFace(f[faceBasePtI], f[facePtI], f[faceOtherPtI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::tetPointRef Foam::tetIndices::tet(const polyMesh& mesh) const
|
||||||
|
{
|
||||||
|
const pointField& meshPoints = mesh.points();
|
||||||
|
const triFace tri = faceTriIs(mesh);
|
||||||
|
|
||||||
|
return tetPointRef
|
||||||
|
(
|
||||||
|
mesh.cellCentres()[cell()],
|
||||||
|
meshPoints[tri[0]],
|
||||||
|
meshPoints[tri[1]],
|
||||||
|
meshPoints[tri[2]]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::triPointRef Foam::tetIndices::faceTri(const polyMesh& mesh) const
|
||||||
|
{
|
||||||
|
const pointField& meshPoints = mesh.points();
|
||||||
|
const triFace tri = faceTriIs(mesh);
|
||||||
|
|
||||||
|
return triPointRef
|
||||||
|
(
|
||||||
|
meshPoints[tri[0]],
|
||||||
|
meshPoints[tri[1]],
|
||||||
|
meshPoints[tri[2]]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::triPointRef Foam::tetIndices::oldFaceTri
|
||||||
|
(
|
||||||
|
const polyMesh& mesh
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const pointField& meshOldPoints = mesh.oldPoints();
|
||||||
|
const triFace tri = faceTriIs(mesh);
|
||||||
|
|
||||||
|
return triPointRef
|
||||||
|
(
|
||||||
|
meshOldPoints[tri[0]],
|
||||||
|
meshOldPoints[tri[1]],
|
||||||
|
meshOldPoints[tri[2]]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline bool Foam::tetIndices::operator==(const Foam::tetIndices& rhs) const
|
inline bool Foam::tetIndices::operator==(const Foam::tetIndices& rhs) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(
|
|
||||||
cell() == rhs.cell()
|
cell() == rhs.cell()
|
||||||
&& face() == rhs.face()
|
&& face() == rhs.face()
|
||||||
&& faceBasePt() == rhs.faceBasePt()
|
&& tetPt() == rhs.tetPt();
|
||||||
&& facePtA() == rhs.facePtA()
|
|
||||||
&& facePtB() == rhs.facePtB()
|
|
||||||
&& tetPt() == rhs.tetPt()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -209,7 +160,4 @@ inline bool Foam::tetIndices::operator!=(const Foam::tetIndices& rhs) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -64,28 +64,23 @@ Foam::levelSetFraction
|
|||||||
|
|
||||||
forAll(cellTetIs, cellTetI)
|
forAll(cellTetIs, cellTetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTetIs[cellTetI];
|
const triFace triIs = cellTetIs[cellTetI].faceTriIs(mesh);
|
||||||
const face& f = mesh.faces()[tetIs.face()];
|
|
||||||
|
|
||||||
const label pI0 = f[tetIs.faceBasePt()];
|
|
||||||
const label pIA = f[tetIs.facePtA()];
|
|
||||||
const label pIB = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
const FixedList<point, 4>
|
const FixedList<point, 4>
|
||||||
tet =
|
tet =
|
||||||
{
|
{
|
||||||
mesh.cellCentres()[cI],
|
mesh.cellCentres()[cI],
|
||||||
mesh.points()[pI0],
|
mesh.points()[triIs[0]],
|
||||||
mesh.points()[pIA],
|
mesh.points()[triIs[1]],
|
||||||
mesh.points()[pIB]
|
mesh.points()[triIs[2]]
|
||||||
};
|
};
|
||||||
const FixedList<scalar, 4>
|
const FixedList<scalar, 4>
|
||||||
level =
|
level =
|
||||||
{
|
{
|
||||||
levelC[cI],
|
levelC[cI],
|
||||||
levelP[pI0],
|
levelP[triIs[0]],
|
||||||
levelP[pIA],
|
levelP[triIs[1]],
|
||||||
levelP[pIB]
|
levelP[triIs[2]]
|
||||||
};
|
};
|
||||||
|
|
||||||
v += cut::volumeOp()(tet);
|
v += cut::volumeOp()(tet);
|
||||||
|
|||||||
@ -68,44 +68,39 @@ Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh>> Foam::levelSetAverage
|
|||||||
|
|
||||||
forAll(cellTetIs, cellTetI)
|
forAll(cellTetIs, cellTetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTetIs[cellTetI];
|
const triFace triIs = cellTetIs[cellTetI].faceTriIs(mesh);
|
||||||
const face& f = mesh.faces()[tetIs.face()];
|
|
||||||
|
|
||||||
const label pI0 = f[tetIs.faceBasePt()];
|
|
||||||
const label pIA = f[tetIs.facePtA()];
|
|
||||||
const label pIB = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
const FixedList<point, 4>
|
const FixedList<point, 4>
|
||||||
tet =
|
tet =
|
||||||
{
|
{
|
||||||
mesh.cellCentres()[cI],
|
mesh.cellCentres()[cI],
|
||||||
mesh.points()[pI0],
|
mesh.points()[triIs[0]],
|
||||||
mesh.points()[pIA],
|
mesh.points()[triIs[1]],
|
||||||
mesh.points()[pIB]
|
mesh.points()[triIs[2]]
|
||||||
};
|
};
|
||||||
const FixedList<scalar, 4>
|
const FixedList<scalar, 4>
|
||||||
level =
|
level =
|
||||||
{
|
{
|
||||||
levelC[cI],
|
levelC[cI],
|
||||||
levelP[pI0],
|
levelP[triIs[0]],
|
||||||
levelP[pIA],
|
levelP[triIs[1]],
|
||||||
levelP[pIB]
|
levelP[triIs[2]]
|
||||||
};
|
};
|
||||||
const cut::volumeIntegrateOp<Type>
|
const cut::volumeIntegrateOp<Type>
|
||||||
positive = FixedList<Type, 4>
|
positive = FixedList<Type, 4>
|
||||||
({
|
({
|
||||||
positiveC[cI],
|
positiveC[cI],
|
||||||
positiveP[pI0],
|
positiveP[triIs[0]],
|
||||||
positiveP[pIA],
|
positiveP[triIs[1]],
|
||||||
positiveP[pIB]
|
positiveP[triIs[2]]
|
||||||
});
|
});
|
||||||
const cut::volumeIntegrateOp<Type>
|
const cut::volumeIntegrateOp<Type>
|
||||||
negative = FixedList<Type, 4>
|
negative = FixedList<Type, 4>
|
||||||
({
|
({
|
||||||
negativeC[cI],
|
negativeC[cI],
|
||||||
negativeP[pI0],
|
negativeP[triIs[0]],
|
||||||
negativeP[pIA],
|
negativeP[triIs[1]],
|
||||||
negativeP[pIB]
|
negativeP[triIs[2]]
|
||||||
});
|
});
|
||||||
|
|
||||||
v += cut::volumeOp()(tet);
|
v += cut::volumeOp()(tet);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -55,15 +55,12 @@ void Foam::cellPointWeight::findTetrahedron
|
|||||||
celli
|
celli
|
||||||
);
|
);
|
||||||
|
|
||||||
const faceList& pFaces = mesh.faces();
|
|
||||||
const scalar cellVolume = mesh.cellVolumes()[celli];
|
const scalar cellVolume = mesh.cellVolumes()[celli];
|
||||||
|
|
||||||
forAll(cellTets, tetI)
|
forAll(cellTets, tetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTets[tetI];
|
const tetIndices& tetIs = cellTets[tetI];
|
||||||
|
|
||||||
const face& f = pFaces[tetIs.face()];
|
|
||||||
|
|
||||||
// Barycentric coordinates of the position
|
// Barycentric coordinates of the position
|
||||||
scalar det = tetIs.tet(mesh).barycentric(position, weights_);
|
scalar det = tetIs.tet(mesh).barycentric(position, weights_);
|
||||||
|
|
||||||
@ -81,9 +78,8 @@ void Foam::cellPointWeight::findTetrahedron
|
|||||||
&& (u + v + w < 1 + tol)
|
&& (u + v + w < 1 + tol)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
faceVertices_[0] = f[tetIs.faceBasePt()];
|
|
||||||
faceVertices_[1] = f[tetIs.facePtA()];
|
faceVertices_ = tetIs.faceTriIs(mesh);
|
||||||
faceVertices_[2] = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -124,16 +120,12 @@ void Foam::cellPointWeight::findTetrahedron
|
|||||||
|
|
||||||
const tetIndices& tetIs = cellTets[nearestTetI];
|
const tetIndices& tetIs = cellTets[nearestTetI];
|
||||||
|
|
||||||
const face& f = pFaces[tetIs.face()];
|
|
||||||
|
|
||||||
// Barycentric coordinates of the position, ignoring if the
|
// Barycentric coordinates of the position, ignoring if the
|
||||||
// determinant is suitable. If not, the return from barycentric
|
// determinant is suitable. If not, the return from barycentric
|
||||||
// to weights_ is safe.
|
// to weights_ is safe.
|
||||||
tetIs.tet(mesh).barycentric(position, weights_);
|
tetIs.tet(mesh).barycentric(position, weights_);
|
||||||
|
|
||||||
faceVertices_[0] = f[tetIs.faceBasePt()];
|
faceVertices_ = tetIs.faceTriIs(mesh);
|
||||||
faceVertices_[1] = f[tetIs.facePtA()];
|
|
||||||
faceVertices_[2] = f[tetIs.facePtB()];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,8 +152,6 @@ void Foam::cellPointWeight::findTriangle
|
|||||||
|
|
||||||
const scalar faceAreaSqr = magSqr(mesh.faceAreas()[facei]);
|
const scalar faceAreaSqr = magSqr(mesh.faceAreas()[facei]);
|
||||||
|
|
||||||
const face& f = mesh.faces()[facei];
|
|
||||||
|
|
||||||
forAll(faceTets, tetI)
|
forAll(faceTets, tetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = faceTets[tetI];
|
const tetIndices& tetIs = faceTets[tetI];
|
||||||
@ -189,9 +179,7 @@ void Foam::cellPointWeight::findTriangle
|
|||||||
weights_[2] = triWeights[1];
|
weights_[2] = triWeights[1];
|
||||||
weights_[3] = triWeights[2];
|
weights_[3] = triWeights[2];
|
||||||
|
|
||||||
faceVertices_[0] = f[tetIs.faceBasePt()];
|
faceVertices_ = tetIs.faceTriIs(mesh);
|
||||||
faceVertices_[1] = f[tetIs.facePtA()];
|
|
||||||
faceVertices_[2] = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -244,9 +232,7 @@ void Foam::cellPointWeight::findTriangle
|
|||||||
weights_[2] = triWeights[1];
|
weights_[2] = triWeights[1];
|
||||||
weights_[3] = triWeights[2];
|
weights_[3] = triWeights[2];
|
||||||
|
|
||||||
faceVertices_[0] = f[tetIs.faceBasePt()];
|
faceVertices_ = tetIs.faceTriIs(mesh);
|
||||||
faceVertices_[1] = f[tetIs.facePtA()];
|
|
||||||
faceVertices_[2] = f[tetIs.facePtB()];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -83,20 +83,15 @@ inline Type Foam::interpolationCellPoint<Type>::interpolate
|
|||||||
|
|
||||||
tetIs.tet(this->pMesh_).barycentric(position, weights);
|
tetIs.tet(this->pMesh_).barycentric(position, weights);
|
||||||
|
|
||||||
const faceList& pFaces = this->pMesh_.faces();
|
|
||||||
|
|
||||||
const face& f = pFaces[tetIs.face()];
|
|
||||||
|
|
||||||
// Order of weights is the same as that of the vertices of the tet, i.e.
|
// Order of weights is the same as that of the vertices of the tet, i.e.
|
||||||
// cellCentre, faceBasePt, facePtA, facePtB.
|
// cellCentre, faceBasePt, facePtA, facePtB.
|
||||||
|
|
||||||
Type t = this->psi_[tetIs.cell()]*weights[0];
|
Type t = this->psi_[tetIs.cell()]*weights[0];
|
||||||
|
|
||||||
t += psip_[f[tetIs.faceBasePt()]]*weights[1];
|
const triFace triIs = tetIs.faceTriIs(this->pMesh_);
|
||||||
|
t += psip_[triIs[0]]*weights[1];
|
||||||
t += psip_[f[tetIs.facePtA()]]*weights[2];
|
t += psip_[triIs[1]]*weights[2];
|
||||||
|
t += psip_[triIs[2]]*weights[3];
|
||||||
t += psip_[f[tetIs.facePtB()]]*weights[3];
|
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,45 +40,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::particle::tetFaceIndices
|
|
||||||
(
|
|
||||||
label& baseI,
|
|
||||||
label& vertex1I,
|
|
||||||
label& vertex2I
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const Foam::face& f = mesh_.faces()[tetFacei_];
|
|
||||||
|
|
||||||
baseI = max(0, mesh_.tetBasePtIs()[tetFacei_]);
|
|
||||||
|
|
||||||
vertex1I = (baseI + tetPti_) % f.size();
|
|
||||||
|
|
||||||
vertex2I = f.fcIndex(vertex1I);
|
|
||||||
|
|
||||||
if (mesh_.faceOwner()[tetFacei_] != celli_)
|
|
||||||
{
|
|
||||||
Swap(vertex1I, vertex2I);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::particle::tetMeshIndices
|
|
||||||
(
|
|
||||||
label& basei,
|
|
||||||
label& vertex1i,
|
|
||||||
label& vertex2i
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const Foam::face& f = mesh_.faces()[tetFacei_];
|
|
||||||
|
|
||||||
tetFaceIndices(basei, vertex1i, vertex2i);
|
|
||||||
|
|
||||||
basei = f[basei];
|
|
||||||
vertex1i = f[vertex1i];
|
|
||||||
vertex2i = f[vertex2i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::particle::tetGeometry
|
void Foam::particle::tetGeometry
|
||||||
(
|
(
|
||||||
vector& centre,
|
vector& centre,
|
||||||
@ -87,13 +48,14 @@ void Foam::particle::tetGeometry
|
|||||||
vector& vertex2
|
vector& vertex2
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label basei, vertex1i, vertex2i;
|
const triFace triIs(currentTetIndices().faceTriIs(mesh_));
|
||||||
tetMeshIndices(basei, vertex1i, vertex2i);
|
const vectorField& ccs = mesh_.cellCentres();
|
||||||
|
const pointField& pts = mesh_.points();
|
||||||
|
|
||||||
centre = mesh_.cellCentres()[celli_];
|
centre = ccs[celli_];
|
||||||
base = mesh_.points()[basei];
|
base = pts[triIs[0]];
|
||||||
vertex1 = mesh_.points()[vertex1i];
|
vertex1 = pts[triIs[1]];
|
||||||
vertex2 = mesh_.points()[vertex2i];
|
vertex2 = pts[triIs[2]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,9 +106,7 @@ void Foam::particle::movingTetGeometry
|
|||||||
Pair<vector>& vertex2
|
Pair<vector>& vertex2
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label basei, vertex1i, vertex2i;
|
const triFace triIs(currentTetIndices().faceTriIs(mesh_));
|
||||||
tetMeshIndices(basei, vertex1i, vertex2i);
|
|
||||||
|
|
||||||
const pointField& ptsOld = mesh_.oldPoints();
|
const pointField& ptsOld = mesh_.oldPoints();
|
||||||
const pointField& ptsNew = mesh_.points();
|
const pointField& ptsNew = mesh_.points();
|
||||||
|
|
||||||
@ -180,14 +140,14 @@ void Foam::particle::movingTetGeometry
|
|||||||
}
|
}
|
||||||
|
|
||||||
centre[0] = ccOld + f0*(ccNew - ccOld);
|
centre[0] = ccOld + f0*(ccNew - ccOld);
|
||||||
base[0] = ptsOld[basei] + f0*(ptsNew[basei] - ptsOld[basei]);
|
base[0] = ptsOld[triIs[0]] + f0*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
|
||||||
vertex1[0] = ptsOld[vertex1i] + f0*(ptsNew[vertex1i] - ptsOld[vertex1i]);
|
vertex1[0] = ptsOld[triIs[1]] + f0*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
|
||||||
vertex2[0] = ptsOld[vertex2i] + f0*(ptsNew[vertex2i] - ptsOld[vertex2i]);
|
vertex2[0] = ptsOld[triIs[2]] + f0*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
|
||||||
|
|
||||||
centre[1] = f1*(ccNew - ccOld);
|
centre[1] = f1*(ccNew - ccOld);
|
||||||
base[1] = f1*(ptsNew[basei] - ptsOld[basei]);
|
base[1] = f1*(ptsNew[triIs[0]] - ptsOld[triIs[0]]);
|
||||||
vertex1[1] = f1*(ptsNew[vertex1i] - ptsOld[vertex1i]);
|
vertex1[1] = f1*(ptsNew[triIs[1]] - ptsOld[triIs[1]]);
|
||||||
vertex2[1] = f1*(ptsNew[vertex2i] - ptsOld[vertex2i]);
|
vertex2[1] = f1*(ptsNew[triIs[2]] - ptsOld[triIs[2]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -364,23 +324,22 @@ void Foam::particle::changeTet(const label tetTriI)
|
|||||||
|
|
||||||
void Foam::particle::changeFace(const label tetTriI)
|
void Foam::particle::changeFace(const label tetTriI)
|
||||||
{
|
{
|
||||||
// Get the tet topology
|
// Get the old topology
|
||||||
label basei, vertex1i, vertex2i;
|
const triFace triOldIs(currentTetIndices().faceTriIs(mesh_));
|
||||||
tetMeshIndices(basei, vertex1i, vertex2i);
|
|
||||||
|
|
||||||
// Get the shared edge and the pre-rotation
|
// Get the shared edge and the pre-rotation
|
||||||
edge sharedEdge;
|
edge sharedEdge;
|
||||||
if (tetTriI == 1)
|
if (tetTriI == 1)
|
||||||
{
|
{
|
||||||
sharedEdge = edge(vertex1i, vertex2i);
|
sharedEdge = edge(triOldIs[1], triOldIs[2]);
|
||||||
}
|
}
|
||||||
else if (tetTriI == 2)
|
else if (tetTriI == 2)
|
||||||
{
|
{
|
||||||
sharedEdge = edge(vertex2i, basei);
|
sharedEdge = edge(triOldIs[2], triOldIs[0]);
|
||||||
}
|
}
|
||||||
else if (tetTriI == 3)
|
else if (tetTriI == 3)
|
||||||
{
|
{
|
||||||
sharedEdge = edge(basei, vertex1i);
|
sharedEdge = edge(triOldIs[0], triOldIs[1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -450,27 +409,27 @@ void Foam::particle::changeFace(const label tetTriI)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pre-rotation puts the shared edge opposite the base of the tetrahedron
|
// Pre-rotation puts the shared edge opposite the base of the tetrahedron
|
||||||
if (sharedEdge.otherVertex(vertex1i) == -1)
|
if (sharedEdge.otherVertex(triOldIs[1]) == -1)
|
||||||
{
|
{
|
||||||
rotate(false);
|
rotate(false);
|
||||||
}
|
}
|
||||||
else if (sharedEdge.otherVertex(vertex2i) == -1)
|
else if (sharedEdge.otherVertex(triOldIs[2]) == -1)
|
||||||
{
|
{
|
||||||
rotate(true);
|
rotate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the new tet topology
|
// Get the new topology
|
||||||
tetMeshIndices(basei, vertex1i, vertex2i);
|
const triFace triNewIs = currentTetIndices().faceTriIs(mesh_);
|
||||||
|
|
||||||
// Reflect to account for the change of triangle orientation on the new face
|
// Reflect to account for the change of triangle orientation on the new face
|
||||||
reflect();
|
reflect();
|
||||||
|
|
||||||
// Post rotation puts the shared edge back in the correct location
|
// Post rotation puts the shared edge back in the correct location
|
||||||
if (sharedEdge.otherVertex(vertex1i) == -1)
|
if (sharedEdge.otherVertex(triNewIs[1]) == -1)
|
||||||
{
|
{
|
||||||
rotate(true);
|
rotate(true);
|
||||||
}
|
}
|
||||||
else if (sharedEdge.otherVertex(vertex2i) == -1)
|
else if (sharedEdge.otherVertex(triNewIs[2]) == -1)
|
||||||
{
|
{
|
||||||
rotate(false);
|
rotate(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,24 +174,6 @@ private:
|
|||||||
|
|
||||||
// Tetrahedra functions
|
// Tetrahedra functions
|
||||||
|
|
||||||
//- Get indices into the current face for the face-bound vertices of
|
|
||||||
// the current tet.
|
|
||||||
void tetFaceIndices
|
|
||||||
(
|
|
||||||
label& baseI,
|
|
||||||
label& vertex1I,
|
|
||||||
label& vertex2I
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Get indices into the mesh points for the face-bound vertices of
|
|
||||||
// the current tet.
|
|
||||||
void tetMeshIndices
|
|
||||||
(
|
|
||||||
label& baseI,
|
|
||||||
label& vertex1I,
|
|
||||||
label& vertex2I
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Get the vertices of the current tet
|
//- Get the vertices of the current tet
|
||||||
void tetGeometry
|
void tetGeometry
|
||||||
(
|
(
|
||||||
@ -476,10 +458,6 @@ public:
|
|||||||
// particle occupies.
|
// particle occupies.
|
||||||
inline tetIndices currentTetIndices() const;
|
inline tetIndices currentTetIndices() const;
|
||||||
|
|
||||||
//- Return the geometry of the current tet that the
|
|
||||||
// particle occupies.
|
|
||||||
inline tetPointRef currentTet() const;
|
|
||||||
|
|
||||||
//- Return the normal of the tri on tetFacei_ for the
|
//- Return the normal of the tri on tetFacei_ for the
|
||||||
// current tet.
|
// current tet.
|
||||||
inline vector normal() const;
|
inline vector normal() const;
|
||||||
|
|||||||
@ -74,13 +74,7 @@ inline Foam::label Foam::particle::tetPt() const
|
|||||||
|
|
||||||
inline Foam::tetIndices Foam::particle::currentTetIndices() const
|
inline Foam::tetIndices Foam::particle::currentTetIndices() const
|
||||||
{
|
{
|
||||||
return tetIndices(celli_, tetFacei_, tetPti_, mesh_);
|
return tetIndices(celli_, tetFacei_, tetPti_);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline Foam::tetPointRef Foam::particle::currentTet() const
|
|
||||||
{
|
|
||||||
return currentTetIndices().tet(mesh_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -194,14 +194,7 @@ void Foam::particle::trackToFace
|
|||||||
// No action is taken for tetPti_ for tetFacei_ here. These are handled
|
// No action is taken for tetPti_ for tetFacei_ here. These are handled
|
||||||
// by the patch interaction call or later during processor transfer.
|
// by the patch interaction call or later during processor transfer.
|
||||||
|
|
||||||
const tetIndices faceHitTetIs =
|
const tetIndices faceHitTetIs(celli_, tetFacei_, tetPti_);
|
||||||
polyMeshTetDecomposition::triangleTetIndices
|
|
||||||
(
|
|
||||||
mesh_,
|
|
||||||
tetFacei_,
|
|
||||||
celli_,
|
|
||||||
tetPti_
|
|
||||||
);
|
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -176,7 +176,7 @@ Foam::MPPICParcel<ParcelType>::TrackingData<CloudType>::updateAverages
|
|||||||
forAllConstIter(typename CloudType, cloud, iter)
|
forAllConstIter(typename CloudType, cloud, iter)
|
||||||
{
|
{
|
||||||
const typename CloudType::parcelType& p = iter();
|
const typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), cloud.mesh());
|
const tetIndices tetIs = p.currentTetIndices();
|
||||||
|
|
||||||
const scalar m = p.nParticle()*p.mass();
|
const scalar m = p.nParticle()*p.mass();
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ Foam::MPPICParcel<ParcelType>::TrackingData<CloudType>::updateAverages
|
|||||||
forAllConstIter(typename CloudType, cloud, iter)
|
forAllConstIter(typename CloudType, cloud, iter)
|
||||||
{
|
{
|
||||||
const typename CloudType::parcelType& p = iter();
|
const typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), cloud.mesh());
|
const tetIndices tetIs = p.currentTetIndices();
|
||||||
|
|
||||||
const vector u = uAverage_->interpolate(p.position(), tetIs);
|
const vector u = uAverage_->interpolate(p.position(), tetIs);
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ Foam::MPPICParcel<ParcelType>::TrackingData<CloudType>::updateAverages
|
|||||||
forAllConstIter(typename CloudType, cloud, iter)
|
forAllConstIter(typename CloudType, cloud, iter)
|
||||||
{
|
{
|
||||||
const typename CloudType::parcelType& p = iter();
|
const typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), cloud.mesh());
|
const tetIndices tetIs = p.currentTetIndices();
|
||||||
|
|
||||||
weightAverage.add
|
weightAverage.add
|
||||||
(
|
(
|
||||||
@ -230,7 +230,7 @@ Foam::MPPICParcel<ParcelType>::TrackingData<CloudType>::updateAverages
|
|||||||
forAllConstIter(typename CloudType, cloud, iter)
|
forAllConstIter(typename CloudType, cloud, iter)
|
||||||
{
|
{
|
||||||
const typename CloudType::parcelType& p = iter();
|
const typename CloudType::parcelType& p = iter();
|
||||||
tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), cloud.mesh());
|
const tetIndices tetIs = p.currentTetIndices();
|
||||||
|
|
||||||
const scalar a = volumeAverage_->interpolate(p.position(), tetIs);
|
const scalar a = volumeAverage_->interpolate(p.position(), tetIs);
|
||||||
const scalar r = radiusAverage_->interpolate(p.position(), tetIs);
|
const scalar r = radiusAverage_->interpolate(p.position(), tetIs);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -204,20 +204,15 @@ bool Foam::AveragingMethod<Type>::write() const
|
|||||||
forAll(cellTets, tetI)
|
forAll(cellTets, tetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTets[tetI];
|
const tetIndices& tetIs = cellTets[tetI];
|
||||||
|
const triFace triIs = tetIs.faceTriIs(mesh_);
|
||||||
const scalar v = tetIs.tet(mesh_).mag();
|
const scalar v = tetIs.tet(mesh_).mag();
|
||||||
|
|
||||||
cellValue[celli] += v*interpolate(mesh_.C()[celli], tetIs);
|
cellValue[celli] += v*interpolate(mesh_.C()[celli], tetIs);
|
||||||
cellGrad[celli] += v*interpolateGrad(mesh_.C()[celli], tetIs);
|
cellGrad[celli] += v*interpolateGrad(mesh_.C()[celli], tetIs);
|
||||||
|
|
||||||
const face& f = mesh_.faces()[tetIs.face()];
|
forAll(triIs, vertexI)
|
||||||
labelList vertices(3);
|
|
||||||
vertices[0] = f[tetIs.faceBasePt()];
|
|
||||||
vertices[1] = f[tetIs.facePtA()];
|
|
||||||
vertices[2] = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
forAll(vertices, vertexI)
|
|
||||||
{
|
{
|
||||||
const label pointi = vertices[vertexI];
|
const label pointi = triIs[vertexI];
|
||||||
|
|
||||||
pointVolume[pointi] += v;
|
pointVolume[pointi] += v;
|
||||||
pointValue[pointi] +=
|
pointValue[pointi] +=
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -64,11 +64,11 @@ Foam::AveragingMethods::Dual<Type>::Dual
|
|||||||
forAll(cellTets, tetI)
|
forAll(cellTets, tetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTets[tetI];
|
const tetIndices& tetIs = cellTets[tetI];
|
||||||
const face& f = this->mesh_.faces()[tetIs.face()];
|
const triFace triIs = tetIs.faceTriIs(this->mesh_);
|
||||||
const scalar v = tetIs.tet(this->mesh_).mag();
|
const scalar v = tetIs.tet(this->mesh_).mag();
|
||||||
volumeDual_[f[tetIs.faceBasePt()]] += v;
|
volumeDual_[triIs[0]] += v;
|
||||||
volumeDual_[f[tetIs.facePtA()]] += v;
|
volumeDual_[triIs[1]] += v;
|
||||||
volumeDual_[f[tetIs.facePtB()]] += v;
|
volumeDual_[triIs[2]] += v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,11 +113,7 @@ void Foam::AveragingMethods::Dual<Type>::tetGeometry
|
|||||||
const tetIndices& tetIs
|
const tetIndices& tetIs
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const face& f = this->mesh_.faces()[tetIs.face()];
|
tetVertices_ = tetIs.faceTriIs(this->mesh_);
|
||||||
|
|
||||||
tetVertices_[0] = f[tetIs.faceBasePt()];
|
|
||||||
tetVertices_[1] = f[tetIs.facePtA()];
|
|
||||||
tetVertices_[2] = f[tetIs.facePtB()];
|
|
||||||
|
|
||||||
tetIs.tet(this->mesh_).barycentric(position, tetCoordinates_);
|
tetIs.tet(this->mesh_).barycentric(position, tetCoordinates_);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,16 +70,15 @@ Foam::AveragingMethods::Moment<Type>::Moment
|
|||||||
forAll(cellTets, tetI)
|
forAll(cellTets, tetI)
|
||||||
{
|
{
|
||||||
const tetIndices& tetIs = cellTets[tetI];
|
const tetIndices& tetIs = cellTets[tetI];
|
||||||
const label facei = tetIs.face();
|
const triFace triIs = tetIs.faceTriIs(mesh);
|
||||||
const face& f = mesh.faces()[facei];
|
|
||||||
|
|
||||||
const tensor T
|
const tensor T
|
||||||
(
|
(
|
||||||
tensor
|
tensor
|
||||||
(
|
(
|
||||||
mesh.points()[f[tetIs.faceBasePt()]] - mesh.C()[celli],
|
mesh.points()[triIs[0]] - mesh.C()[celli],
|
||||||
mesh.points()[f[tetIs.facePtA()]] - mesh.C()[celli],
|
mesh.points()[triIs[1]] - mesh.C()[celli],
|
||||||
mesh.points()[f[tetIs.facePtB()]] - mesh.C()[celli]
|
mesh.points()[triIs[2]] - mesh.C()[celli]
|
||||||
).T()
|
).T()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -139,8 +139,7 @@ Foam::vector Foam::DampingModels::Relaxation<CloudType>::velocityCorrection
|
|||||||
const scalar deltaT
|
const scalar deltaT
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const tetIndices
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
tetIs(p.cell(), p.tetFace(), p.tetPt(), this->owner().mesh());
|
|
||||||
|
|
||||||
const scalar x =
|
const scalar x =
|
||||||
deltaT*oneByTimeScaleAverage_->interpolate(p.position(), tetIs);
|
deltaT*oneByTimeScaleAverage_->interpolate(p.position(), tetIs);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -166,7 +166,7 @@ void Foam::IsotropyModels::Stochastic<CloudType>::calculate()
|
|||||||
forAllIter(typename CloudType, this->owner(), iter)
|
forAllIter(typename CloudType, this->owner(), iter)
|
||||||
{
|
{
|
||||||
typename CloudType::parcelType& p = iter();
|
typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), mesh);
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
|
|
||||||
const scalar x = exponentAverage.interpolate(p.position(), tetIs);
|
const scalar x = exponentAverage.interpolate(p.position(), tetIs);
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ void Foam::IsotropyModels::Stochastic<CloudType>::calculate()
|
|||||||
forAllIter(typename CloudType, this->owner(), iter)
|
forAllIter(typename CloudType, this->owner(), iter)
|
||||||
{
|
{
|
||||||
typename CloudType::parcelType& p = iter();
|
typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), mesh);
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
uTildeAverage.add(p.position(), tetIs, p.nParticle()*p.mass()*p.U());
|
uTildeAverage.add(p.position(), tetIs, p.nParticle()*p.mass()*p.U());
|
||||||
}
|
}
|
||||||
uTildeAverage.average(massAverage);
|
uTildeAverage.average(massAverage);
|
||||||
@ -224,7 +224,7 @@ void Foam::IsotropyModels::Stochastic<CloudType>::calculate()
|
|||||||
forAllIter(typename CloudType, this->owner(), iter)
|
forAllIter(typename CloudType, this->owner(), iter)
|
||||||
{
|
{
|
||||||
typename CloudType::parcelType& p = iter();
|
typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), mesh);
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
const vector uTilde = uTildeAverage.interpolate(p.position(), tetIs);
|
const vector uTilde = uTildeAverage.interpolate(p.position(), tetIs);
|
||||||
uTildeSqrAverage.add
|
uTildeSqrAverage.add
|
||||||
(
|
(
|
||||||
@ -239,7 +239,7 @@ void Foam::IsotropyModels::Stochastic<CloudType>::calculate()
|
|||||||
forAllIter(typename CloudType, this->owner(), iter)
|
forAllIter(typename CloudType, this->owner(), iter)
|
||||||
{
|
{
|
||||||
typename CloudType::parcelType& p = iter();
|
typename CloudType::parcelType& p = iter();
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), mesh);
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
|
|
||||||
const vector u = uAverage.interpolate(p.position(), tetIs);
|
const vector u = uAverage.interpolate(p.position(), tetIs);
|
||||||
const scalar uRms =
|
const scalar uRms =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -143,8 +143,7 @@ Foam::vector Foam::PackingModels::Explicit<CloudType>::velocityCorrection
|
|||||||
const scalar deltaT
|
const scalar deltaT
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = this->owner().mesh();
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
const tetIndices tetIs(p.cell(), p.tetFace(), p.tetPt(), mesh);
|
|
||||||
|
|
||||||
// interpolated quantities
|
// interpolated quantities
|
||||||
const scalar alpha =
|
const scalar alpha =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -339,7 +339,7 @@ Foam::vector Foam::PackingModels::Implicit<CloudType>::velocityCorrection
|
|||||||
// containing tetrahedron and parcel coordinates within
|
// containing tetrahedron and parcel coordinates within
|
||||||
const label celli = p.cell();
|
const label celli = p.cell();
|
||||||
const label facei = p.tetFace();
|
const label facei = p.tetFace();
|
||||||
const tetIndices tetIs(celli, facei, p.tetPt(), mesh);
|
const tetIndices tetIs(p.currentTetIndices());
|
||||||
FixedList<scalar, 4> tetCoordinates;
|
FixedList<scalar, 4> tetCoordinates;
|
||||||
tetIs.tet(mesh).barycentric(p.position(), tetCoordinates);
|
tetIs.tet(mesh).barycentric(p.position(), tetCoordinates);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user