mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: polyMesh removeFiles side-effect for blockMesh viewer (issue #346)
- polyMesh constructor from cell shapes invoked 'removeFiles'.
This may or may not be what the caller wants or expects.
With the ParaView blockMesh viewer, this behaviour causes deletion of
all mesh data (points, faces, etc) when the viewer is refreshed.
Triggered even when just building the blockMesh topology.
- only a few places that construct a polyMesh from cell shapes
(mostly mesh conversion utilities).
Ensure that the file removal (if any) occurs in the application
and *not* as a side-effect of calling the polyMesh constructor.
--
blockMesh (application)
- The placement of the removeFiles seems to also remove freshly
generated sets (Bug or feature to remove sets?)
+-----------------------+---------------+------------------+
| Application | Constructor | removeFiles |
| | (patch info) | new / existing |
+-----------------------+---------------+------------------+
| blockMesh | dictionary | existing |
| ansysToFoam | names | new |
| cfx4ToFoam | dictionary | new |
| fluentMeshToFoam | names | new |
| gambitToFoam | dictionary | new |
| gmshToFoam | names | new |
| ideasUnvToFoam | names | new |
| kivaToFoam | dictionary | new |
| mshToFoam | names | new |
| netgenNeutralToFoam | names | new |
| plot3dToFoam | names | new |
| tetgenToFoam | names | new |
| vtkUnstructuredToFoam | names | new |
+-----------------------+---------------+------------------+
This commit is contained in:
@ -702,6 +702,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< nl << "end" << endl;
|
||||
|
||||
@ -753,6 +753,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -1177,6 +1177,9 @@ int main(int argc, char *argv[])
|
||||
patchPhysicalTypes
|
||||
);
|
||||
|
||||
// Remove files now, to ensure all mesh files written are consistent.
|
||||
pShapeMesh.removeFiles();
|
||||
|
||||
//dont write mesh yet, otherwise preservePatchTypes will be broken
|
||||
//and zones wont be written
|
||||
//checkmesh done after patch addition as well
|
||||
|
||||
@ -865,6 +865,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
@ -942,6 +942,9 @@ int main(int argc, char *argv[])
|
||||
boundaryPatchPhysicalTypes
|
||||
);
|
||||
|
||||
// Remove files now, to ensure all mesh files written are consistent.
|
||||
mesh.removeFiles();
|
||||
|
||||
repatchPolyTopoChanger repatcher(mesh);
|
||||
|
||||
// Now use the patchFaces to patch up the outside faces of the mesh.
|
||||
|
||||
@ -1158,8 +1158,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< endl;
|
||||
|
||||
|
||||
|
||||
// Construct mesh
|
||||
polyMesh mesh
|
||||
(
|
||||
@ -1179,8 +1177,10 @@ int main(int argc, char *argv[])
|
||||
wordList(0) // boundaryPatchPhysicalTypes
|
||||
);
|
||||
|
||||
// Remove files now, to ensure all mesh files written are consistent.
|
||||
mesh.removeFiles();
|
||||
|
||||
if (faceZones.size() > 0 || cellZones.size() > 0)
|
||||
if (faceZones.size() || cellZones.size())
|
||||
{
|
||||
Info << "Adding cell and face zones" << endl;
|
||||
|
||||
@ -1188,7 +1188,7 @@ int main(int argc, char *argv[])
|
||||
List<faceZone*> fZones(faceZones.size());
|
||||
List<cellZone*> cZones(cellZones.size());
|
||||
|
||||
if (cellZones.size() > 0)
|
||||
if (cellZones.size())
|
||||
{
|
||||
forAll(cellZones.toc(), cnt)
|
||||
{
|
||||
@ -1205,7 +1205,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
}
|
||||
if (faceZones.size() > 0)
|
||||
if (faceZones.size())
|
||||
{
|
||||
const labelList& own = mesh.faceOwner();
|
||||
const labelList& nei = mesh.faceNeighbour();
|
||||
|
||||
@ -575,6 +575,7 @@ polyMesh pShapeMesh
|
||||
);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
pShapeMesh.write();
|
||||
|
||||
fileName czPath
|
||||
|
||||
@ -156,9 +156,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
|
||||
mesh.removeFiles();
|
||||
mesh.write();
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -313,11 +313,10 @@ int main(int argc, char *argv[])
|
||||
patchPhysicalTypes
|
||||
);
|
||||
|
||||
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
||||
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
mesh.removeFiles();
|
||||
mesh.write();
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -262,6 +262,7 @@ int main(int argc, char *argv[])
|
||||
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.removeFiles();
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -342,7 +342,6 @@ int main(int argc, char *argv[])
|
||||
const polyMesh& mesh = meshPtr;
|
||||
|
||||
|
||||
|
||||
if (readFaceFile)
|
||||
{
|
||||
label nPatches = 0;
|
||||
@ -474,7 +473,7 @@ int main(int argc, char *argv[])
|
||||
boundaryPatch.setSize(facei);
|
||||
|
||||
|
||||
// Print region to patch mapping
|
||||
// Print region to patch mapping
|
||||
Info<< "Regions:" << endl;
|
||||
|
||||
forAllConstIter(Map<label>, regionToPatch, iter)
|
||||
@ -548,6 +547,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Writing mesh to " << runTime.constant() << endl << endl;
|
||||
|
||||
meshPtr().removeFiles();
|
||||
meshPtr().write();
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -80,9 +80,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Writing mesh ..." << endl;
|
||||
|
||||
mesh.removeFiles();
|
||||
mesh.write();
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -530,9 +530,6 @@ Foam::polyMesh::polyMesh
|
||||
Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
|
||||
}
|
||||
|
||||
// Remove all of the old mesh files if they exist
|
||||
removeFiles(instance());
|
||||
|
||||
// Calculate faces and cells
|
||||
labelList patchSizes;
|
||||
labelList patchStarts;
|
||||
@ -814,9 +811,6 @@ Foam::polyMesh::polyMesh
|
||||
Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
|
||||
}
|
||||
|
||||
// Remove all of the old mesh files if they exist
|
||||
removeFiles(instance());
|
||||
|
||||
// Calculate faces and cells
|
||||
labelList patchSizes;
|
||||
labelList patchStarts;
|
||||
|
||||
Reference in New Issue
Block a user