ENH: Reinstating parallel addPatches. Using addFvPatches for fvMesh.

Reinstating writing out cell size field.
This commit is contained in:
graham
2011-06-16 16:44:34 +01:00
parent e3d94e55e4
commit e1d9372431
2 changed files with 65 additions and 67 deletions

View File

@ -1457,65 +1457,65 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
List<polyPatch*> patches(patchStarts.size());
// label nValidPatches = 0;
// forAll(patches, p)
// {
// if (patchTypes[p] == processorPolyPatch::typeName)
// {
// // Do not create empty processor patches
// if (patchSizes[p] > 0)
// {
// patches[nValidPatches] = new processorPolyPatch
// (
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// nValidPatches,
// pMesh.boundaryMesh(),
// Pstream::myProcNo(),
// procNeighbours[p]
// );
// nValidPatches++;
// }
// }
// else
// {
// patches[nValidPatches] = polyPatch::New
// (
// patchTypes[p],
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// nValidPatches,
// pMesh.boundaryMesh()
// ).ptr();
// nValidPatches++;
// }
// }
// patches.setSize(nValidPatches);
// pMesh.addPatches(patches);
Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
label nValidPatches = 0;
forAll(patches, p)
{
patches[p] = new polyPatch
(
patchNames[p],
patchSizes[p],
patchStarts[p],
p,
pMesh.boundaryMesh()
);
if (patchTypes[p] == processorPolyPatch::typeName)
{
// Do not create empty processor patches
if (patchSizes[p] > 0)
{
patches[nValidPatches] = new processorPolyPatch
(
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
pMesh.boundaryMesh(),
Pstream::myProcNo(),
procNeighbours[p]
);
nValidPatches++;
}
}
else
{
patches[nValidPatches] = polyPatch::New
(
patchTypes[p],
patchNames[p],
patchSizes[p],
patchStarts[p],
nValidPatches,
pMesh.boundaryMesh()
).ptr();
nValidPatches++;
}
}
pMesh.addPatches(patches, false);
patches.setSize(nValidPatches);
pMesh.addPatches(patches);
// Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
// forAll(patches, p)
// {
// patches[p] = new polyPatch
// (
// patchNames[p],
// patchSizes[p],
// patchStarts[p],
// p,
// pMesh.boundaryMesh()
// );
// }
// pMesh.addPatches(patches, false);
// pMesh.overrideCellCentres(cellCentres);

View File

@ -26,7 +26,6 @@ License
#include "conformalVoronoiMesh.H"
#include "IOstreams.H"
#include "OFstream.H"
#include "zeroGradientPointPatchField.H"
#include "pointMesh.H"
#include "pointFields.H"
@ -312,7 +311,7 @@ void Foam::conformalVoronoiMesh::writeMesh
writeObjMesh(points, faces, word(meshName + ".obj"));
}
polyMesh mesh
fvMesh mesh
(
IOobject
(
@ -372,9 +371,10 @@ void Foam::conformalVoronoiMesh::writeMesh
patches.setSize(nValidPatches);
Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
// mesh.addPatches(patches);
mesh.addPatches(patches, false);
mesh.addFvPatches(patches);
// Info<< "ADDPATCHES NOT IN PARALLEL" << endl;
// mesh.addPatches(patches, false);
if (!mesh.write())
{
@ -404,11 +404,9 @@ void Foam::conformalVoronoiMesh::writeMesh
// cellCs.write();
Info<< "DISABLED WRITING OF CELL SIZE AND PROTRUSION SET" << endl;
writeCellSizes(mesh);
// writeCellSizes(mesh);
// findRemainingProtrusionSet(mesh);
findRemainingProtrusionSet(mesh);
}
@ -466,7 +464,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
),
mesh,
dimensionedScalar("cellSize", dimLength, 0),
zeroGradientPointPatchField<scalar>::typeName
zeroGradientFvPatchScalarField::typeName
);
scalarField& cellSize = targetCellSize.internalField();
@ -492,7 +490,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// ),
// mesh,
// dimensionedScalar("cellVolume", dimLength, 0),
// zeroGradientPointPatchField<scalar>::typeName
// zeroGradientFvPatchScalarField::typeName
// );
// targetCellVolume.internalField() = pow3(cellSize);
@ -511,7 +509,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// ),
// mesh,
// dimensionedScalar("cellVolume", dimVolume, 0),
// zeroGradientPointPatchField<scalar>::typeName
// zeroGradientFvPatchScalarField::typeName
// );
// actualCellVolume.internalField() = mesh.cellVolumes();
@ -530,7 +528,7 @@ void Foam::conformalVoronoiMesh::writeCellSizes
// ),
// mesh,
// dimensionedScalar("cellSize", dimLength, 0),
// zeroGradientPointPatchField<scalar>::typeName
// zeroGradientFvPatchScalarField::typeName
// );
// equivalentCellSize.internalField() = pow