Commit 599c1c59 authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge commit 'OpenCFD/master' into olesenm

parents 533c4910 8f48c008
......@@ -1373,7 +1373,17 @@ Foam::isoSurface::isoSurface
{
const polyPatch& pp = patches[patchI];
if (!pp.coupled())
if (pp.coupled())
{
label faceI = pp.start();
forAll(pp, i)
{
boundaryRegion[faceI-mesh_.nInternalFaces()] = patchI;
faceI++;
}
}
else
{
label faceI = pp.start();
......@@ -1381,12 +1391,13 @@ Foam::isoSurface::isoSurface
{
boundaryRegion[faceI-mesh_.nInternalFaces()] = patchI;
const face& f = mesh_.faces()[faceI++];
const face& f = mesh_.faces()[faceI];
forAll(f, fp)
{
isBoundaryPoint.set(f[fp], 1);
}
faceI++;
}
}
}
......
......@@ -45,6 +45,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
{
const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
word pointFldName = "volPointInterpolate(" + isoField_ + ')';
// Get volField
// ~~~~~~~~~~~~
......@@ -64,28 +66,56 @@ void Foam::sampledIsoSurface::getIsoFields() const
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : reading "
<< isoField_ << " from time " << fvm.time().timeName()
Info<< "sampledIsoSurface::getIsoField() : checking "
<< isoField_ << " for same time " << fvm.time().timeName()
<< endl;
}
storedVolFieldPtr_.reset
if
(
new volScalarField
!storedVolFieldPtr_.valid()
|| (fvm.time().timeName() != storedVolFieldPtr_().instance())
)
{
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : reading "
<< isoField_ << " from time " << fvm.time().timeName()
<< endl;
}
storedVolFieldPtr_.reset
(
IOobject
new volScalarField
(
isoField_,
fvm.time().timeName(),
fvm,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),
fvm
)
);
volFieldPtr_ = storedVolFieldPtr_.operator->();
IOobject
(
isoField_,
fvm.time().timeName(),
fvm,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),
fvm
)
);
volFieldPtr_ = storedVolFieldPtr_.operator->();
// Interpolate to get pointField
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : interpolating "
<< pointFldName << endl;
}
storedPointFieldPtr_.reset
(
volPointInterpolation::New(fvm).interpolate(*volFieldPtr_).ptr()
);
pointFieldPtr_ = storedPointFieldPtr_.operator->();
}
}
......@@ -93,8 +123,6 @@ void Foam::sampledIsoSurface::getIsoFields() const
// Get pointField
// ~~~~~~~~~~~~~~
word pointFldName = "volPointInterpolate(" + isoField_ + ')';
if (fvm.foundObject<pointScalarField>(pointFldName))
{
if (debug)
......@@ -102,7 +130,6 @@ void Foam::sampledIsoSurface::getIsoFields() const
Info<< "sampledIsoSurface::getIsoField() : lookup "
<< pointFldName << endl;
}
storedPointFieldPtr_.clear();
pointFieldPtr_ = &fvm.lookupObject<pointScalarField>(pointFldName);
}
else
......@@ -111,15 +138,29 @@ void Foam::sampledIsoSurface::getIsoFields() const
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : interpolating "
<< pointFldName << endl;
Info<< "sampledIsoSurface::getIsoField() : checking interpolate "
<< isoField_ << " for same time " << fvm.time().timeName()
<< endl;
}
storedPointFieldPtr_.reset
if
(
volPointInterpolation::New(fvm).interpolate(*volFieldPtr_).ptr()
);
pointFieldPtr_ = storedPointFieldPtr_.operator->();
!storedPointFieldPtr_.valid()
|| (fvm.time().timeName() != storedPointFieldPtr_().instance())
)
{
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : interpolating "
<< pointFldName << endl;
}
storedPointFieldPtr_.reset
(
volPointInterpolation::New(fvm).interpolate(*volFieldPtr_).ptr()
);
pointFieldPtr_ = storedPointFieldPtr_.operator->();
}
}
if (debug)
......
Markdown is supported
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