mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: indexedCell and tet output improvements.
This commit is contained in:
@ -957,7 +957,8 @@ public:
|
|||||||
void drawDelaunayCell
|
void drawDelaunayCell
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const Delaunay::Finite_cells_iterator& cit
|
const Delaunay::Finite_cells_iterator& cit,
|
||||||
|
label offset = 0
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Write Delaunay points to .obj file
|
//- Write Delaunay points to .obj file
|
||||||
|
|||||||
@ -115,9 +115,19 @@ void Foam::conformalVoronoiMesh::timeCheck
|
|||||||
void Foam::conformalVoronoiMesh::drawDelaunayCell
|
void Foam::conformalVoronoiMesh::drawDelaunayCell
|
||||||
(
|
(
|
||||||
Ostream& os,
|
Ostream& os,
|
||||||
const Delaunay::Finite_cells_iterator& cit
|
const Delaunay::Finite_cells_iterator& cit,
|
||||||
|
label offset
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// Supply offset as tet number
|
||||||
|
offset *= 5;
|
||||||
|
|
||||||
|
os << "# cell index: " << label(cit->cellIndex()) << endl;
|
||||||
|
|
||||||
|
os << "# circumradius "
|
||||||
|
<< mag(topoint(dual(cit)) - topoint(cit->vertex(0)->point()))
|
||||||
|
<< endl;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
os << "# index type: "
|
os << "# index type: "
|
||||||
@ -127,14 +137,16 @@ void Foam::conformalVoronoiMesh::drawDelaunayCell
|
|||||||
meshTools::writeOBJ(os, topoint(cit->vertex(i)->point()));
|
meshTools::writeOBJ(os, topoint(cit->vertex(i)->point()));
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "f 1 3 2" << nl
|
os << "f " << 1 + offset << " " << 3 + offset << " " << 2 + offset << nl
|
||||||
<< "f 2 3 4" << nl
|
<< "f " << 2 + offset << " " << 3 + offset << " " << 4 + offset << nl
|
||||||
<< "f 1 4 3" << nl
|
<< "f " << 1 + offset << " " << 4 + offset << " " << 3 + offset << nl
|
||||||
<< "f 1 2 4" << endl;
|
<< "f " << 1 + offset << " " << 2 + offset << " " << 4 + offset << endl;
|
||||||
|
|
||||||
|
os << "# cicumcentre " << endl;
|
||||||
|
|
||||||
meshTools::writeOBJ(os, topoint(dual(cit)));
|
meshTools::writeOBJ(os, topoint(dual(cit)));
|
||||||
|
|
||||||
os << "l 1 5" << endl;
|
os << "l " << 1 + offset << " " << 5 + offset << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Description
|
|||||||
#include <CGAL/Triangulation_3.h>
|
#include <CGAL/Triangulation_3.h>
|
||||||
#include <CGAL/Triangulation_cell_base_with_circumcenter_3.h>
|
#include <CGAL/Triangulation_cell_base_with_circumcenter_3.h>
|
||||||
#include "indexedVertex.H"
|
#include "indexedVertex.H"
|
||||||
|
#include "Pstream.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -157,8 +158,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Is the Delaunay cell real, i.e. any real vertex
|
//- Is the Delaunay cell real, i.e. any real vertex
|
||||||
inline int real() const
|
inline bool real() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
@ -170,9 +171,50 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Does the Dual vertex form part of a processor patch
|
||||||
|
inline int parallelDualVertex() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
this->vertex(0)->referred()
|
||||||
|
|| this->vertex(1)->referred()
|
||||||
|
|| this->vertex(2)->referred()
|
||||||
|
|| this->vertex(3)->referred()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Does the Dual vertex form part of a processor patch
|
||||||
|
inline Foam::label dualVertexMasterProc() const
|
||||||
|
{
|
||||||
|
if (!parallelDualVertex)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The master processor is the lowest numbered of the four on this tet.
|
||||||
|
|
||||||
|
int masterProc = Foam::Pstream::nProcs() + 1;
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
if (this->vertex(i)->referred())
|
||||||
|
{
|
||||||
|
masterProc = min(masterProc, this->vertex(i)->procIndex());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
masterProc = min(masterProc, Foam::Pstream::myProcNo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return masterProc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Is the Delaunay cell part of the final dual mesj, i.e. any vertex form
|
// Is the Delaunay cell part of the final dual mesj, i.e. any vertex form
|
||||||
// part of the internal or boundary definition
|
// part of the internal or boundary definition
|
||||||
inline int internalOrBoundaryDualVertex() const
|
inline bool internalOrBoundaryDualVertex() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
@ -186,7 +228,7 @@ public:
|
|||||||
|
|
||||||
// Is the Delaunay cell real or referred (or mixed), i.e. all vertices form
|
// Is the Delaunay cell real or referred (or mixed), i.e. all vertices form
|
||||||
// part of the real or referred internal or boundary definition
|
// part of the real or referred internal or boundary definition
|
||||||
inline int anyInternalOrBoundaryDualVertex() const
|
inline bool anyInternalOrBoundaryDualVertex() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user