making stitchMesh,mergePatchPairs work

This commit is contained in:
mattijs
2009-06-18 20:35:55 +01:00
parent 6427d61219
commit 0fd2a5f056
7 changed files with 202 additions and 124 deletions

View File

@ -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
{

View File

@ -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."