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
#include "pointFields.H"
#include "cellIOList.H"
#include "IOobjectList.H"
#include "IOPtrList.H"
#include "writeMeshObject.H"
#include "fieldDictionary.H"
......@@ -49,6 +50,14 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0);
}
// Main program:
int main(int argc, char *argv[])
{
timeSelector::addOptions();
......@@ -67,6 +76,9 @@ int main(int argc, char *argv[])
writeMeshObject<labelIOList>("neighbour", runTime);
writeMeshObject<faceIOList>("faces", 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
IOobjectList objects(runTime, runTime.timeName());
......
......@@ -61,8 +61,17 @@ inline bool writeMeshObject(const word& name, Time& runTime)
Info<< " Reading " << io.headerClassName()
<< " : " << 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);
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;
writeOk = meshObject.regIOobject::write();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment