Merge branch 'master' of ssh://hunt/home/hunt2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry 2008-10-16 21:40:14 +01:00
commit c7968294f0
8 changed files with 128 additions and 122 deletions

View File

@ -112,7 +112,7 @@ case OpenFOAM:
endif
set compilerBin=$WM_COMPILER_DIR/bin
set compilerLib=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
set compilerLib=$WM_COMPILER_DIR/lib${WM_COMPILER_LIB_ARCH}:$WM_COMPILER_DIR/lib
breaksw
endsw

View File

@ -1914,27 +1914,28 @@ void Foam::meshRefinement::baffleAndSplitMesh
if (debug)
{
// Dump all these faces to a faceSet.
faceSet problemGeom(mesh_, "problemFacesGeom", 100);
const labelList facePatchGeom
(
markFacesOnProblemCellsGeometric
(
motionDict,
globalToPatch
)
);
forAll(facePatchGeom, faceI)
{
if (facePatchGeom[faceI] != -1)
{
problemGeom.insert(faceI);
}
}
Pout<< "Dumping " << problemGeom.size()
<< " problem faces to " << problemGeom.objectPath() << endl;
problemGeom.write();
//- Note: commented out since not properly parallel yet.
//// Dump all these faces to a faceSet.
//faceSet problemGeom(mesh_, "problemFacesGeom", 100);
//
//const labelList facePatchGeom
//(
// markFacesOnProblemCellsGeometric
// (
// motionDict,
// globalToPatch
// )
//);
//forAll(facePatchGeom, faceI)
//{
// if (facePatchGeom[faceI] != -1)
// {
// problemGeom.insert(faceI);
// }
//}
//Pout<< "Dumping " << problemGeom.size()
// << " problem faces to " << problemGeom.objectPath() << endl;
//problemGeom.write();
faceSet problemTopo(mesh_, "problemFacesTopo", 100);

View File

@ -539,27 +539,6 @@ void Foam::refinementSurfaces::findHigherIntersection
return;
}
// Precalculate per surface whether it has a minlevelfield
UPtrList<triSurfaceLabelField> minLevelFields(surfaces_.size());
forAll(surfaces_, surfI)
{
const searchableSurface& geom = allGeometry_[surfaces_[surfI]];
if (isA<triSurfaceMesh>(geom))
{
const triSurfaceMesh& triMesh = refCast<const triSurfaceMesh>(geom);
minLevelFields.set
(
surfI,
&const_cast<triSurfaceLabelField&>
(
triMesh.lookupObject<triSurfaceLabelField>("minLevel")
)
);
}
}
// Work arrays
labelList hitMap(identity(start.size()));
pointField p0(start);
@ -568,7 +547,21 @@ void Foam::refinementSurfaces::findHigherIntersection
forAll(surfaces_, surfI)
{
allGeometry_[surfaces_[surfI]].findLineAny(p0, p1, hitInfo);
const searchableSurface& geom = allGeometry_[surfaces_[surfI]];
geom.findLineAny(p0, p1, hitInfo);
labelList minLevelField;
if (isA<triSurfaceMesh>(geom))
{
const triSurfaceMesh& triMesh = refCast<const triSurfaceMesh>(geom);
triMesh.getField
(
"minLevel",
hitInfo,
minLevelField
);
}
// Copy all hits into arguments, continue with misses
@ -581,14 +574,9 @@ void Foam::refinementSurfaces::findHigherIntersection
if (hitInfo[hitI].hit())
{
// Check if minLevelField for this surface.
if
(
minLevelFields.set(surfI)
&& minLevelFields[surfI].size() > 0
)
if (minLevelField.size() > 0)
{
minLocalLevel =
minLevelFields[surfI][hitInfo[hitI].index()];
minLocalLevel = minLevelField[hitI];
}
else
{
@ -618,7 +606,7 @@ void Foam::refinementSurfaces::findHigherIntersection
}
// All done? Note that this decision should be synchronised
if (newI == 0)
if (returnReduce(newI, sumOp<label>()) == 0)
{
break;
}

View File

@ -1280,8 +1280,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
domainMesh.boundaryMesh()
).ptr();
}
domainMesh.addFvPatches(patches);
// Add patches; no parallel comms
domainMesh.addFvPatches(patches, false);
// Construct zones
List<pointZone*> pZonePtrs(pointZoneNames.size());

View File

@ -4765,69 +4765,70 @@ void Foam::hexRef8::checkRefinementLevels
}
// Hanging points
{
// Any patches with points having only two edges.
boolList isHangingPoint(mesh_.nPoints(), false);
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, i)
{
label pointI = meshPoints[i];
const labelList& pEdges = mesh_.pointEdges()[pointI];
if (pEdges.size() == 2)
{
isHangingPoint[pointI] = true;
}
}
}
syncTools::syncPointList
(
mesh_,
isHangingPoint,
andEqOp<bool>(), // only if all decide it is hanging point
true, // null
false // no separation
);
//OFstream str(mesh_.time().path()/"hangingPoints.obj");
label nHanging = 0;
forAll(isHangingPoint, pointI)
{
if (isHangingPoint[pointI])
{
nHanging++;
Pout<< "Hanging boundary point " << pointI
<< " at " << mesh_.points()[pointI]
<< endl;
//meshTools::writeOBJ(str, mesh_.points()[pointI]);
}
}
if (returnReduce(nHanging, sumOp<label>()) > 0)
{
FatalErrorIn
(
"hexRef8::checkRefinementLevels(const label)"
) << "Detected a point used by two edges only (hanging point)"
<< nl << "This is not allowed"
<< abort(FatalError);
}
}
//- Gives problems after first splitting off inside mesher.
//// Hanging points
//{
// // Any patches with points having only two edges.
//
// boolList isHangingPoint(mesh_.nPoints(), false);
//
// const polyBoundaryMesh& patches = mesh_.boundaryMesh();
//
// forAll(patches, patchI)
// {
// const polyPatch& pp = patches[patchI];
//
// const labelList& meshPoints = pp.meshPoints();
//
// forAll(meshPoints, i)
// {
// label pointI = meshPoints[i];
//
// const labelList& pEdges = mesh_.pointEdges()[pointI];
//
// if (pEdges.size() == 2)
// {
// isHangingPoint[pointI] = true;
// }
// }
// }
//
// syncTools::syncPointList
// (
// mesh_,
// isHangingPoint,
// andEqOp<bool>(), // only if all decide it is hanging point
// true, // null
// false // no separation
// );
//
// //OFstream str(mesh_.time().path()/"hangingPoints.obj");
//
// label nHanging = 0;
//
// forAll(isHangingPoint, pointI)
// {
// if (isHangingPoint[pointI])
// {
// nHanging++;
//
// Pout<< "Hanging boundary point " << pointI
// << " at " << mesh_.points()[pointI]
// << endl;
// //meshTools::writeOBJ(str, mesh_.points()[pointI]);
// }
// }
//
// if (returnReduce(nHanging, sumOp<label>()) > 0)
// {
// FatalErrorIn
// (
// "hexRef8::checkRefinementLevels(const label)"
// ) << "Detected a point used by two edges only (hanging point)"
// << nl << "This is not allowed"
// << abort(FatalError);
// }
//}
}

View File

@ -1330,7 +1330,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
// Add the fvPatches
fvMeshSubsetPtr_().addFvPatches(newBoundary);
fvMeshSubsetPtr_().addFvPatches(newBoundary, syncPar);
// Subset and add any zones
subsetZones();

View File

@ -232,9 +232,9 @@ void Foam::searchableSurfaceWithGaps::findLine
// do we accept the hit.
List<pointIndexHit> plusInfo;
surface().findLine(start+offset0, end+offset0, plusInfo);
surface().findLine(compactStart+offset0, compactEnd+offset0, plusInfo);
List<pointIndexHit> minInfo;
surface().findLine(start-offset0, end-offset0, minInfo);
surface().findLine(compactStart-offset0, compactEnd-offset0, minInfo);
// Extract any hits
forAll(plusInfo, i)
@ -257,14 +257,28 @@ void Foam::searchableSurfaceWithGaps::findLine
compactStart[i] = compactStart[mapI];
compactEnd[i] = compactEnd[mapI];
compactMap[i] = compactMap[mapI];
offset0[i] = offset0[mapI];
offset1[i] = offset1[mapI];
}
compactStart.setSize(plusMissMap.size());
compactEnd.setSize(plusMissMap.size());
compactMap.setSize(plusMissMap.size());
offset0.setSize(plusMissMap.size());
offset1.setSize(plusMissMap.size());
surface().findLine(start+offset1, end+offset1, plusInfo);
surface().findLine(start-offset1, end-offset1, minInfo);
surface().findLine
(
compactStart+offset1,
compactEnd+offset1,
plusInfo
);
surface().findLine
(
compactStart-offset1,
compactEnd-offset1,
minInfo
);
// Extract any hits
forAll(plusInfo, i)

View File

@ -148,6 +148,8 @@ public:
// Multiple point queries.
//- Find nearest on original surface. Note:does not use perturbation
// and hence might be inconsistent with intersections.
virtual void findNearest
(
const pointField& sample,