parallel fix

This commit is contained in:
mattijs
2008-12-09 15:59:00 +00:00
parent f5b23d5065
commit 8f48c008d7
2 changed files with 79 additions and 27 deletions

View File

@ -1373,7 +1373,17 @@ Foam::isoSurface::isoSurface
{ {
const polyPatch& pp = patches[patchI]; 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(); label faceI = pp.start();
@ -1381,12 +1391,13 @@ Foam::isoSurface::isoSurface
{ {
boundaryRegion[faceI-mesh_.nInternalFaces()] = patchI; boundaryRegion[faceI-mesh_.nInternalFaces()] = patchI;
const face& f = mesh_.faces()[faceI++]; const face& f = mesh_.faces()[faceI];
forAll(f, fp) forAll(f, fp)
{ {
isBoundaryPoint.set(f[fp], 1); isBoundaryPoint.set(f[fp], 1);
} }
faceI++;
} }
} }
} }

View File

@ -45,6 +45,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
{ {
const fvMesh& fvm = static_cast<const fvMesh&>(mesh()); const fvMesh& fvm = static_cast<const fvMesh&>(mesh());
word pointFldName = "volPointInterpolate(" + isoField_ + ')';
// Get volField // Get volField
// ~~~~~~~~~~~~ // ~~~~~~~~~~~~
@ -62,6 +64,19 @@ void Foam::sampledIsoSurface::getIsoFields() const
{ {
// Bit of a hack. Read field and store. // Bit of a hack. Read field and store.
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : checking "
<< isoField_ << " for same time " << fvm.time().timeName()
<< endl;
}
if
(
!storedVolFieldPtr_.valid()
|| (fvm.time().timeName() != storedVolFieldPtr_().instance())
)
{
if (debug) if (debug)
{ {
Info<< "sampledIsoSurface::getIsoField() : reading " Info<< "sampledIsoSurface::getIsoField() : reading "
@ -86,28 +101,8 @@ void Foam::sampledIsoSurface::getIsoFields() const
) )
); );
volFieldPtr_ = storedVolFieldPtr_.operator->(); volFieldPtr_ = storedVolFieldPtr_.operator->();
}
// Interpolate to get pointField
// Get pointField
// ~~~~~~~~~~~~~~
word pointFldName = "volPointInterpolate(" + isoField_ + ')';
if (fvm.foundObject<pointScalarField>(pointFldName))
{
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : lookup "
<< pointFldName << endl;
}
storedPointFieldPtr_.clear();
pointFieldPtr_ = &fvm.lookupObject<pointScalarField>(pointFldName);
}
else
{
// Not in registry. Interpolate.
if (debug) if (debug)
{ {
@ -121,6 +116,52 @@ void Foam::sampledIsoSurface::getIsoFields() const
); );
pointFieldPtr_ = storedPointFieldPtr_.operator->(); pointFieldPtr_ = storedPointFieldPtr_.operator->();
} }
}
// Get pointField
// ~~~~~~~~~~~~~~
if (fvm.foundObject<pointScalarField>(pointFldName))
{
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : lookup "
<< pointFldName << endl;
}
pointFieldPtr_ = &fvm.lookupObject<pointScalarField>(pointFldName);
}
else
{
// Not in registry. Interpolate.
if (debug)
{
Info<< "sampledIsoSurface::getIsoField() : checking interpolate "
<< isoField_ << " for same time " << fvm.time().timeName()
<< endl;
}
if
(
!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) if (debug)
{ {