mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into molecularDynamics
This commit is contained in:
@ -243,14 +243,7 @@ int main(int argc, char *argv[])
|
||||
meshDict.lookup("mergePatchPairs")
|
||||
);
|
||||
|
||||
if (mergePatchPairs.size())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "mergePatchPairs not currently supported."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
//// #include "mergePatchPairs.H"
|
||||
# include "mergePatchPairs.H"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -63,6 +63,7 @@ Description
|
||||
#include "slidingInterface.H"
|
||||
#include "perfectInterface.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "ReadFields.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -90,34 +91,6 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
|
||||
}
|
||||
|
||||
|
||||
// Read field
|
||||
template<class GeoField>
|
||||
void readFields
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const IOobjectList& objects,
|
||||
PtrList<GeoField>& fields
|
||||
)
|
||||
{
|
||||
// Search list of objects for volScalarFields
|
||||
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
|
||||
|
||||
// Construct the vol scalar fields
|
||||
fields.setSize(fieldObjects.size());
|
||||
|
||||
label fieldi = 0;
|
||||
for
|
||||
(
|
||||
IOobjectList::iterator iter = fieldObjects.begin();
|
||||
iter != fieldObjects.end();
|
||||
++iter
|
||||
)
|
||||
{
|
||||
fields.set(fieldi++, new GeoField(*iter(), mesh));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -343,7 +316,8 @@ int main(int argc, char *argv[])
|
||||
cutZoneName,
|
||||
masterPatchName,
|
||||
slavePatchName,
|
||||
tom // integral or partial
|
||||
tom, // integral or partial
|
||||
true // couple/decouple mode
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -355,30 +329,30 @@ int main(int argc, char *argv[])
|
||||
// Read all current fvFields so they will get mapped
|
||||
Info<< "Reading all current volfields" << endl;
|
||||
PtrList<volScalarField> volScalarFields;
|
||||
readFields(mesh, objects, volScalarFields);
|
||||
ReadFields(mesh, objects, volScalarFields);
|
||||
|
||||
PtrList<volVectorField> volVectorFields;
|
||||
readFields(mesh, objects, volVectorFields);
|
||||
ReadFields(mesh, objects, volVectorFields);
|
||||
|
||||
PtrList<volSphericalTensorField> volSphericalTensorFields;
|
||||
readFields(mesh, objects, volSphericalTensorFields);
|
||||
ReadFields(mesh, objects, volSphericalTensorFields);
|
||||
|
||||
PtrList<volSymmTensorField> volSymmTensorFields;
|
||||
readFields(mesh, objects, volSymmTensorFields);
|
||||
ReadFields(mesh, objects, volSymmTensorFields);
|
||||
|
||||
PtrList<volTensorField> volTensorFields;
|
||||
readFields(mesh, objects, volTensorFields);
|
||||
ReadFields(mesh, objects, volTensorFields);
|
||||
|
||||
//- uncomment if you want to interpolate surface fields (usually bad idea)
|
||||
//Info<< "Reading all current surfaceFields" << endl;
|
||||
//PtrList<surfaceScalarField> surfaceScalarFields;
|
||||
//readFields(mesh, objects, surfaceScalarFields);
|
||||
//ReadFields(mesh, objects, surfaceScalarFields);
|
||||
//
|
||||
//PtrList<surfaceVectorField> surfaceVectorFields;
|
||||
//readFields(mesh, objects, surfaceVectorFields);
|
||||
//ReadFields(mesh, objects, surfaceVectorFields);
|
||||
//
|
||||
//PtrList<surfaceTensorField> surfaceTensorFields;
|
||||
//readFields(mesh, objects, surfaceTensorFields);
|
||||
//ReadFields(mesh, objects, surfaceTensorFields);
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
@ -394,11 +368,22 @@ int main(int argc, char *argv[])
|
||||
if (overwrite)
|
||||
{
|
||||
mesh.setInstance(oldInstance);
|
||||
stitcher.instance() = oldInstance;
|
||||
}
|
||||
Info << nl << "Writing polyMesh to time " << runTime.timeName() << endl;
|
||||
|
||||
IOstream::defaultPrecision(10);
|
||||
if (!mesh.write())
|
||||
|
||||
// Bypass runTime write (since only writes at outputTime)
|
||||
if
|
||||
(
|
||||
!runTime.objectRegistry::writeObject
|
||||
(
|
||||
runTime.writeFormat(),
|
||||
IOstream::currentVersion,
|
||||
runTime.writeCompression()
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Failed writing polyMesh."
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
Reference in New Issue
Block a user