Skip to content
Snippets Groups Projects
Commit 0dcd3735 authored by mattijs's avatar mattijs
Browse files

converting zones without reading mesh

parent 0fd2a5f0
Branches
Tags
No related merge requests found
...@@ -41,6 +41,7 @@ Description ...@@ -41,6 +41,7 @@ Description
#include "pointFields.H" #include "pointFields.H"
#include "cellIOList.H" #include "cellIOList.H"
#include "IOobjectList.H" #include "IOobjectList.H"
#include "IOPtrList.H"
#include "writeMeshObject.H" #include "writeMeshObject.H"
#include "fieldDictionary.H" #include "fieldDictionary.H"
...@@ -49,6 +50,14 @@ using namespace Foam; ...@@ -49,6 +50,14 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0);
}
// Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
timeSelector::addOptions(); timeSelector::addOptions();
...@@ -67,6 +76,9 @@ int main(int argc, char *argv[]) ...@@ -67,6 +76,9 @@ int main(int argc, char *argv[])
writeMeshObject<labelIOList>("neighbour", runTime); writeMeshObject<labelIOList>("neighbour", runTime);
writeMeshObject<faceIOList>("faces", runTime); writeMeshObject<faceIOList>("faces", runTime);
writeMeshObject<pointIOField>("points", runTime); writeMeshObject<pointIOField>("points", runTime);
writeMeshObject<IOPtrList<entry> >("cellZones", runTime);
writeMeshObject<IOPtrList<entry> >("faceZones", runTime);
writeMeshObject<IOPtrList<entry> >("pointZones", runTime);
// Get list of objects from the database // Get list of objects from the database
IOobjectList objects(runTime, runTime.timeName()); IOobjectList objects(runTime, runTime.timeName());
......
...@@ -61,8 +61,17 @@ inline bool writeMeshObject(const word& name, Time& runTime) ...@@ -61,8 +61,17 @@ inline bool writeMeshObject(const word& name, Time& runTime)
Info<< " Reading " << io.headerClassName() Info<< " Reading " << io.headerClassName()
<< " : " << name << endl; << " : " << name << endl;
// Switch off type checking (for reading e.g. faceZones as
// generic list of dictionaries).
const word oldTypeName = T::typeName;
const_cast<word&>(T::typeName) = word::null;
T meshObject(io); T meshObject(io);
const_cast<word&>(T::typeName) = oldTypeName;
// Fake type back to what was in field
const_cast<word&>(meshObject.type()) = io.headerClassName();
Info<< " Writing " << name << endl; Info<< " Writing " << name << endl;
writeOk = meshObject.regIOobject::write(); writeOk = meshObject.regIOobject::write();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment