Merge branch 'master' of ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2008-07-27 10:14:45 +01:00
6 changed files with 121 additions and 44 deletions

View File

@ -140,6 +140,7 @@ buildParaView ()
{ {
# set general options # set general options
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON" addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON"
addCMakeVariable "VTK_USE_RPATH:BOOL=OFF"
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release"
# set paraview environment # set paraview environment

View File

@ -44,6 +44,7 @@ void Foam::Time::readDict()
); );
} }
scalar oldWriteInterval = writeInterval_;
if (controlDict_.readIfPresent("writeInterval", writeInterval_)) if (controlDict_.readIfPresent("writeInterval", writeInterval_))
{ {
if (writeControl_ == wcTimeStep && label(writeInterval_) < 1) if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
@ -58,6 +59,22 @@ void Foam::Time::readDict()
controlDict_.lookup("writeFrequency") >> writeInterval_; controlDict_.lookup("writeFrequency") >> writeInterval_;
} }
if (oldWriteInterval != writeInterval_)
{
switch(writeControl_)
{
case wcRunTime:
case wcAdjustableRunTime:
// Recalculate outputTimeIndex_ to be in units of current
// writeInterval.
outputTimeIndex_ *= oldWriteInterval/writeInterval_;
break;
default:
break;
}
}
if (controlDict_.readIfPresent("purgeWrite", purgeWrite_)) if (controlDict_.readIfPresent("purgeWrite", purgeWrite_))
{ {
if (purgeWrite_ < 0) if (purgeWrite_ < 0)

View File

@ -248,7 +248,7 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
refineParams.keepPoints()[0], refineParams.keepPoints()[0],
refineParams.curvature(), refineParams.curvature(),
PtrList<featureEdgeMesh>(0), // dummy featureMeshes; PtrList<featureEdgeMesh>(), // dummy featureMeshes;
labelList(0), // dummy featureLevels; labelList(0), // dummy featureLevels;
false, // featureRefinement false, // featureRefinement
@ -389,7 +389,7 @@ Foam::label Foam::autoRefineDriver::shellRefine
refineParams.keepPoints()[0], refineParams.keepPoints()[0],
refineParams.curvature(), refineParams.curvature(),
PtrList<featureEdgeMesh>(0), // dummy featureMeshes; PtrList<featureEdgeMesh>(), // dummy featureMeshes;
labelList(0), // dummy featureLevels; labelList(0), // dummy featureLevels;
false, // featureRefinement false, // featureRefinement

View File

@ -155,17 +155,35 @@ void Foam::duplicatePoints::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)]; zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
} }
meshMod.modifyFace
( if (mesh_.isInternalFace(faceI))
newFace, // modified face {
faceI, // label of face being modified meshMod.modifyFace
mesh_.faceOwner()[faceI], // owner (
-1, // neighbour newFace, // modified face
false, // face flip faceI, // label of face being modified
patches.whichPatch(faceI), // patch for face mesh_.faceOwner()[faceI], // owner
zoneID, // zone for face mesh_.faceNeighbour()[faceI], // neighbour
zoneFlip // face flip in zone false, // face flip
); -1, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
else
{
meshMod.modifyFace
(
newFace, // modified face
faceI, // label of face being modified
mesh_.faceOwner()[faceI], // owner
-1, // neighbour
false, // face flip
patches.whichPatch(faceI), // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);
}
} }

View File

@ -43,15 +43,22 @@ class minEqOpFace
{ {
public: public:
void operator()( face& x, const face& y ) const void operator()(face& x, const face& y) const
{ {
forAll(x, i) if (x.size() > 0)
{ {
x[i] = min(x[i], y[i]); label j = 0;
forAll(x, i)
{
x[i] = min(x[i], y[j]);
j = y.rcIndex(j);
}
} }
}; };
}; };
// Dummy transform for faces. Used in synchronisation // Dummy transform for faces. Used in synchronisation
void transformList void transformList
( (
@ -103,6 +110,7 @@ bool Foam::localPointRegion::isDuplicate
void Foam::localPointRegion::countPointRegions void Foam::localPointRegion::countPointRegions
( (
const polyMesh& mesh, const polyMesh& mesh,
const boolList& candidatePoint,
const Map<label>& candidateFace, const Map<label>& candidateFace,
faceList& minRegion faceList& minRegion
) )
@ -120,7 +128,7 @@ void Foam::localPointRegion::countPointRegions
forAllConstIter(Map<label>, candidateFace, iter) forAllConstIter(Map<label>, candidateFace, iter)
{ {
label faceI = iter(); label faceI = iter.key();
if (!mesh.isInternalFace(faceI)) if (!mesh.isInternalFace(faceI))
{ {
@ -137,43 +145,75 @@ void Foam::localPointRegion::countPointRegions
forAll(f, fp) forAll(f, fp)
{ {
label pointI = f[fp]; label pointI = f[fp];
label region = minRegion[faceI][fp];
if (minPointRegion[pointI] == -1) // Even points which were not candidates for splitting might
// be on multiple baffles that are being split so check.
if (candidatePoint[pointI])
{ {
minPointRegion[pointI] = region; label region = minRegion[faceI][fp];
}
else if (minPointRegion[pointI] != region) if (minPointRegion[pointI] == -1)
{
// Multiple regions for this point. Add.
Map<label>::iterator iter = meshPointMap_.find(pointI);
if (iter != meshPointMap_.end())
{ {
labelList& regions = pointRegions[iter()]; minPointRegion[pointI] = region;
if (findIndex(regions, region) == -1) }
else if (minPointRegion[pointI] != region)
{
// Multiple regions for this point. Add.
Map<label>::iterator iter = meshPointMap_.find(pointI);
if (iter != meshPointMap_.end())
{ {
label sz = regions.size(); labelList& regions = pointRegions[iter()];
regions.setSize(sz+1); if (findIndex(regions, region) == -1)
regions[sz] = region; {
label sz = regions.size();
regions.setSize(sz+1);
regions[sz] = region;
}
}
else
{
label localPointI = meshPointMap_.size();
meshPointMap_.insert(pointI, localPointI);
labelList regions(2);
regions[0] = minPointRegion[pointI];
regions[1] = region;
pointRegions.append(regions);
} }
}
else
{
label localPointI = meshPointMap_.size();
meshPointMap_.insert(pointI, localPointI);
labelList regions(2);
regions[0] = minPointRegion[pointI];
regions[1] = region;
pointRegions.append(regions);
}
label meshFaceMapI = meshFaceMap_.size();
meshFaceMap_.insert(faceI, meshFaceMapI);
}
}
}
}
}
minPointRegion.clear();
// Add internal faces that use any duplicated point. Can only have one
// region!
forAllConstIter(Map<label>, candidateFace, iter)
{
label faceI = iter.key();
if (mesh.isInternalFace(faceI))
{
const face& f = mesh.faces()[faceI];
forAll(f, fp)
{
// Note: candidatePoint test not really necessary but
// speeds up rejection.
if (candidatePoint[f[fp]] && meshPointMap_.found(f[fp]))
{
label meshFaceMapI = meshFaceMap_.size(); label meshFaceMapI = meshFaceMap_.size();
meshFaceMap_.insert(faceI, meshFaceMapI); meshFaceMap_.insert(faceI, meshFaceMapI);
} }
} }
} }
} }
minPointRegion.clear();
// Transfer to member data // Transfer to member data
pointRegions.shrink(); pointRegions.shrink();
pointRegions_.setSize(pointRegions.size()); pointRegions_.setSize(pointRegions.size());
@ -285,7 +325,7 @@ void Foam::localPointRegion::calcPointRegions
faceList minRegion(mesh.nFaces()); faceList minRegion(mesh.nFaces());
forAllConstIter(Map<label>, candidateFace, iter) forAllConstIter(Map<label>, candidateFace, iter)
{ {
label faceI = iter(); label faceI = iter.key();
const face& f = mesh.faces()[faceI]; const face& f = mesh.faces()[faceI];
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(faceI))
@ -391,7 +431,7 @@ void Foam::localPointRegion::calcPointRegions
// Count regions per point // Count regions per point
countPointRegions(mesh, candidateFace, minRegion); countPointRegions(mesh, candidatePoint, candidateFace, minRegion);
minRegion.clear(); minRegion.clear();

View File

@ -92,6 +92,7 @@ class localPointRegion
void countPointRegions void countPointRegions
( (
const polyMesh& mesh, const polyMesh& mesh,
const boolList& candidatePoint,
const Map<label>& candidateFace, const Map<label>& candidateFace,
faceList& minRegion faceList& minRegion
); );