mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
converting zones without reading mesh
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user