iso surfaces on separated cyclics
This commit is contained in:
parent
5ecf891b28
commit
71a6424c60
@ -32,6 +32,8 @@ License
|
|||||||
#include "slicedVolFields.H"
|
#include "slicedVolFields.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "meshTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -963,20 +965,8 @@ void Foam::isoSurface::calcSnappedPoint
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Pout<< "**hack" << endl;
|
// Synchronise snap location
|
||||||
//pointField oldCollaped(collapsedPoint);
|
|
||||||
syncUnseparatedPoints(collapsedPoint, greatPoint);
|
syncUnseparatedPoints(collapsedPoint, greatPoint);
|
||||||
//forAll(collapsedPoint, pointI)
|
|
||||||
//{
|
|
||||||
// if (collapsedPoint[pointI] != oldCollaped[pointI])
|
|
||||||
// {
|
|
||||||
// Pout<< "**Synced point " << pointI
|
|
||||||
// << " coord:" << mesh_.points()[pointI]
|
|
||||||
// << " from " << oldCollaped[pointI]
|
|
||||||
// << " to " << collapsedPoint[pointI]
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
snappedPoint.setSize(mesh_.nPoints());
|
snappedPoint.setSize(mesh_.nPoints());
|
||||||
@ -1759,6 +1749,7 @@ Foam::isoSurface::isoSurface
|
|||||||
mesh_(cVals.mesh()),
|
mesh_(cVals.mesh()),
|
||||||
pVals_(pVals),
|
pVals_(pVals),
|
||||||
iso_(iso),
|
iso_(iso),
|
||||||
|
regularise_(regularise),
|
||||||
mergeDistance_(mergeTol*mesh_.bounds().mag())
|
mergeDistance_(mergeTol*mesh_.bounds().mag())
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -1772,7 +1763,7 @@ Foam::isoSurface::isoSurface
|
|||||||
<< min(pVals_) << " / "
|
<< min(pVals_) << " / "
|
||||||
<< max(pVals_) << nl
|
<< max(pVals_) << nl
|
||||||
<< " isoValue : " << iso << nl
|
<< " isoValue : " << iso << nl
|
||||||
<< " regularise : " << regularise << nl
|
<< " regularise : " << regularise_ << nl
|
||||||
<< " mergeTol : " << mergeTol << nl
|
<< " mergeTol : " << mergeTol << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -1888,7 +1879,7 @@ Foam::isoSurface::isoSurface
|
|||||||
|
|
||||||
// Per cc -1 or a point inside snappedPoints.
|
// Per cc -1 or a point inside snappedPoints.
|
||||||
labelList snappedCc;
|
labelList snappedCc;
|
||||||
if (regularise)
|
if (regularise_)
|
||||||
{
|
{
|
||||||
calcSnappedCc
|
calcSnappedCc
|
||||||
(
|
(
|
||||||
@ -1920,7 +1911,7 @@ Foam::isoSurface::isoSurface
|
|||||||
|
|
||||||
// Per point -1 or a point inside snappedPoints.
|
// Per point -1 or a point inside snappedPoints.
|
||||||
labelList snappedPoint;
|
labelList snappedPoint;
|
||||||
if (regularise)
|
if (regularise_)
|
||||||
{
|
{
|
||||||
// Determine if point is on boundary.
|
// Determine if point is on boundary.
|
||||||
PackedBoolList isBoundaryPoint(mesh_.nPoints());
|
PackedBoolList isBoundaryPoint(mesh_.nPoints());
|
||||||
|
@ -31,17 +31,30 @@ Description
|
|||||||
G.M. Treece, R.W. Prager and A.H. Gee.
|
G.M. Treece, R.W. Prager and A.H. Gee.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
- in parallel the regularisation (coarsening) always takes place
|
|
||||||
and slightly different surfaces will be created compared to non-parallel.
|
|
||||||
The surface will still be continuous though!
|
|
||||||
- does tets without using cell centres/cell values. Not tested.
|
- does tets without using cell centres/cell values. Not tested.
|
||||||
- regularisation can create duplicate triangles/non-manifold surfaces.
|
- regularisation can create duplicate triangles/non-manifold surfaces.
|
||||||
Current handling of those is bit ad-hoc for now and not perfect.
|
Current handling of those is bit ad-hoc for now and not perfect.
|
||||||
|
- regularisation does not do boundary points so as to preserve the
|
||||||
|
boundary perfectly.
|
||||||
- uses geometric merge with fraction of bounding box as distance.
|
- uses geometric merge with fraction of bounding box as distance.
|
||||||
- triangles can be between two cell centres so constant sampling
|
- triangles can be between two cell centres so constant sampling
|
||||||
does not make sense.
|
does not make sense.
|
||||||
- on empty patches behaves like zero gradient.
|
- on empty patches behaves like zero gradient.
|
||||||
- does not do 2D correctly, creates non-flat iso surface.
|
- does not do 2D correctly, creates non-flat iso surface.
|
||||||
|
- on processor boundaries might two overlapping (identical) triangles
|
||||||
|
(one from either side)
|
||||||
|
|
||||||
|
The handling on coupled patches is a bit complex. All fields
|
||||||
|
(values and coordinates) get rewritten so
|
||||||
|
- empty patches get zerogradient (value) and facecentre (coordinates)
|
||||||
|
- separated processor patch faces get interpolate (value) and facecentre
|
||||||
|
(coordinates). (this is already the default for cyclics)
|
||||||
|
- non-separated processor patch faces keep opposite value and cell centre
|
||||||
|
|
||||||
|
Now the triangle generation on non-separated processor patch faces
|
||||||
|
can use the neighbouring value. Any separated processor face or cyclic
|
||||||
|
face gets handled just like any boundary face.
|
||||||
|
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
isoSurface.C
|
isoSurface.C
|
||||||
@ -101,6 +114,9 @@ class isoSurface
|
|||||||
//- Isosurface value
|
//- Isosurface value
|
||||||
const scalar iso_;
|
const scalar iso_;
|
||||||
|
|
||||||
|
//- Regularise?
|
||||||
|
const Switch regularise_;
|
||||||
|
|
||||||
//- When to merge points
|
//- When to merge points
|
||||||
const scalar mergeDistance_;
|
const scalar mergeDistance_;
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "meshTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -565,18 +567,20 @@ void Foam::isoSurface::generateTriPoints
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(pp) && collocatedPatch(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
// Coincident processor patches. Boundary field of
|
const processorPolyPatch& cpp =
|
||||||
// cVals and cCoords is opposite cell.
|
refCast<const processorPolyPatch>(pp);
|
||||||
|
|
||||||
//if (refCast<const processorPolyPatch>(pp).owner())
|
PackedBoolList isCollocated(collocatedFaces(cpp));
|
||||||
{
|
|
||||||
label faceI = pp.start();
|
|
||||||
|
|
||||||
forAll(pp, i)
|
forAll(isCollocated, i)
|
||||||
{
|
{
|
||||||
|
label faceI = pp.start()+i;
|
||||||
|
|
||||||
if (faceCutType_[faceI] != NOTCUT)
|
if (faceCutType_[faceI] != NOTCUT)
|
||||||
|
{
|
||||||
|
if (isCollocated[i])
|
||||||
{
|
{
|
||||||
generateFaceTriPoints
|
generateFaceTriPoints
|
||||||
(
|
(
|
||||||
@ -600,7 +604,30 @@ void Foam::isoSurface::generateTriPoints
|
|||||||
triMeshCells
|
triMeshCells
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
faceI++;
|
else
|
||||||
|
{
|
||||||
|
generateFaceTriPoints
|
||||||
|
(
|
||||||
|
cVals,
|
||||||
|
pVals,
|
||||||
|
|
||||||
|
cCoords,
|
||||||
|
pCoords,
|
||||||
|
|
||||||
|
snappedPoints,
|
||||||
|
snappedCc,
|
||||||
|
snappedPoint,
|
||||||
|
faceI,
|
||||||
|
|
||||||
|
cVals.boundaryField()[patchI][i],
|
||||||
|
cCoords.boundaryField()[patchI][i],
|
||||||
|
false,
|
||||||
|
pTraits<Type>::zero,
|
||||||
|
|
||||||
|
triPoints,
|
||||||
|
triMeshCells
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user