Commit 71a6424c authored by mattijs's avatar mattijs
Browse files

iso surfaces on separated cyclics

parent 5ecf891b
......@@ -32,6 +32,8 @@ License
#include "slicedVolFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "OFstream.H"
#include "meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -963,20 +965,8 @@ void Foam::isoSurface::calcSnappedPoint
}
//Pout<< "**hack" << endl;
//pointField oldCollaped(collapsedPoint);
// Synchronise snap location
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());
......@@ -1759,6 +1749,7 @@ Foam::isoSurface::isoSurface
mesh_(cVals.mesh()),
pVals_(pVals),
iso_(iso),
regularise_(regularise),
mergeDistance_(mergeTol*mesh_.bounds().mag())
{
if (debug)
......@@ -1772,7 +1763,7 @@ Foam::isoSurface::isoSurface
<< min(pVals_) << " / "
<< max(pVals_) << nl
<< " isoValue : " << iso << nl
<< " regularise : " << regularise << nl
<< " regularise : " << regularise_ << nl
<< " mergeTol : " << mergeTol << nl
<< endl;
}
......@@ -1888,7 +1879,7 @@ Foam::isoSurface::isoSurface
// Per cc -1 or a point inside snappedPoints.
labelList snappedCc;
if (regularise)
if (regularise_)
{
calcSnappedCc
(
......@@ -1920,7 +1911,7 @@ Foam::isoSurface::isoSurface
// Per point -1 or a point inside snappedPoints.
labelList snappedPoint;
if (regularise)
if (regularise_)
{
// Determine if point is on boundary.
PackedBoolList isBoundaryPoint(mesh_.nPoints());
......
......@@ -31,17 +31,30 @@ Description
G.M. Treece, R.W. Prager and A.H. Gee.
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.
- regularisation can create duplicate triangles/non-manifold surfaces.
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.
- triangles can be between two cell centres so constant sampling
does not make sense.
- on empty patches behaves like zero gradient.
- 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
isoSurface.C
......@@ -101,6 +114,9 @@ class isoSurface
//- Isosurface value
const scalar iso_;
//- Regularise?
const Switch regularise_;
//- When to merge points
const scalar mergeDistance_;
......
......@@ -28,6 +28,8 @@ License
#include "polyMesh.H"
#include "syncTools.H"
#include "surfaceFields.H"
#include "OFstream.H"
#include "meshTools.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
......@@ -565,18 +567,20 @@ void Foam::isoSurface::generateTriPoints
{
const polyPatch& pp = patches[patchI];
if (isA<processorPolyPatch>(pp) && collocatedPatch(pp))
if (isA<processorPolyPatch>(pp))
{
// Coincident processor patches. Boundary field of
// cVals and cCoords is opposite cell.
const processorPolyPatch& cpp =
refCast<const processorPolyPatch>(pp);
//if (refCast<const processorPolyPatch>(pp).owner())
PackedBoolList isCollocated(collocatedFaces(cpp));
forAll(isCollocated, i)
{
label faceI = pp.start();
label faceI = pp.start()+i;
forAll(pp, i)
if (faceCutType_[faceI] != NOTCUT)
{
if (faceCutType_[faceI] != NOTCUT)
if (isCollocated[i])
{
generateFaceTriPoints
(
......@@ -600,7 +604,30 @@ void Foam::isoSurface::generateTriPoints
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
);
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment