diff --git a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/Make/options b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/Make/options index 518432cbd9ef33a2e7edcffd1e7ea19f429406a6..0d74d0b44ca05ad8d253ab552452c486c057d5bf 100644 --- a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/Make/options +++ b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/Make/options @@ -1,9 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/postProcessing/functionObjects/jobControl/lnInclude EXE_LIBS = \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ -lfiniteVolume \ - -lmeshTools + -ljobControl diff --git a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometry.C b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometry.C index 3b9ed64abb35d0f1ba4dd798e315c9736addef0e..51818b378741ee10d3cf18fa4dac9dc0d0f8a9bf 100644 --- a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometry.C +++ b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,15 +26,19 @@ Application Description Application to generate the patch geometry (points and faces) for use - with the externalCoupled boundary condition. + with the externalCoupled functionObject. - Usage: +Usage + - createExternalCoupledPatchGeometry \<patchGroup\> [OPTION] - createExternalCoupledPatchGeometry \<fieldName\> + \param -commsDir \<commsDir\> \n + Specify an alternative communications directory (default is comms + in the case directory) - On execution, the field \<fieldName\> is read, and its boundary conditions - interrogated for the presence of an \c externalCoupled type. If found, - the patch geometry (points and faces) for the coupled patches are output + \param -region \<name\> \n + Specify an alternative mesh region. + + On execution, the combined patch geometry (points and faces) are output to the communications directory. Note: @@ -42,12 +46,12 @@ Note: used for face addressing starts at index 0. SeeAlso - externalCoupledMixedFvPatchField + externalCoupledFunctionObject \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "createExternalCoupledPatchGeometryTemplates.H" +#include "externalCoupledFunctionObject.H" #include "IOobjectList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,28 +59,25 @@ SeeAlso int main(int argc, char *argv[]) { #include "addRegionOption.H" - argList::validArgs.append("fieldName"); + argList::validArgs.append("patchGroup"); + argList::addOption + ( + "commsDir", + "dir", + "specify alternate communications directory. default is 'comms'" + ); #include "setRootCase.H" #include "createTime.H" #include "createNamedMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - const word fieldName = args[1]; - - IOobjectList objects(IOobjectList(mesh, mesh.time().timeName())); + const wordRe patchGroup(args[1]); - label processed = -1; - processField<scalar>(mesh, objects, fieldName, processed); - processField<vector>(mesh, objects, fieldName, processed); - processField<sphericalTensor>(mesh, objects, fieldName, processed); - processField<symmTensor>(mesh, objects, fieldName, processed); - processField<tensor>(mesh, objects, fieldName, processed); + fileName commsDir(runTime.path()/"comms"); + args.optionReadIfPresent("commsDir", commsDir); - if (processed == -1) - { - Info<< "Field " << fieldName << " not found" << endl; - } + externalCoupledFunctionObject::writeGeometry(mesh, commsDir, patchGroup); Info<< "\nEnd\n" << endl; diff --git a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C deleted file mode 100644 index c5d842237e157e1208c779215e883fd05129df00..0000000000000000000000000000000000000000 --- a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.C +++ /dev/null @@ -1,90 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "createExternalCoupledPatchGeometryTemplates.H" -#include "externalCoupledMixedFvPatchField.H" -#include "IOobjectList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class Type> -void processField -( - const fvMesh& mesh, - const IOobjectList& objects, - const word& fieldName, - label& processed -) -{ - if (processed != -1) - { - return; - } - - typedef GeometricField<Type, fvPatchField, volMesh> fieldType; - - const word timeName(mesh.time().timeName()); - - IOobjectList fieldObjbjects(objects.lookupClass(fieldType::typeName)); - - if (fieldObjbjects.lookup(fieldName) != NULL) - { - fieldType vtf(*fieldObjbjects.lookup(fieldName), mesh); - const typename fieldType::GeometricBoundaryField& bf = - vtf.boundaryField(); - - forAll(bf, patchI) - { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - Info<< "Generating external coupled geometry for field " - << fieldName << endl; - - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); - - pf.writeGeometry(); - processed = 1; - - break; - } - } - - if (processed != 1) - { - processed = 0; - - Info<< "Field " << fieldName << " found, but does not have any " - << externalCoupledMixedFvPatchField<Type>::typeName - << " boundary conditions" << endl; - } - } -} - - -// ************************************************************************* // diff --git a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.H b/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.H deleted file mode 100644 index 0c1391f80a13b78181c78a65ea01ee8ab3194c8a..0000000000000000000000000000000000000000 --- a/applications/utilities/preProcessing/createExternalCoupledPatchGeometry/createExternalCoupledPatchGeometryTemplates.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef createExternalCoupledPatchGeometryTemplates_H -#define createExternalCoupledPatchGeometryTemplates_H - -#include "word.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - template<class Type> - void processField(bool& processed, const word& fieldName); -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "createExternalCoupledPatchGeometryTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //