Skip to content
Snippets Groups Projects
Commit c4b0f3c6 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

STYLE: direct inclusion of region options

parent 2797a8be
No related branches found
No related tags found
No related merge requests found
...@@ -5,4 +5,5 @@ EXE_INC = \ ...@@ -5,4 +5,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \
-lfieldFunctionObjects -lfieldFunctionObjects
//
// addRegionOption.H
// ~~~~~~~~~~~~~~~~~
Foam::argList::addOption
(
"regions",
"(name1 .. nameN)",
"Specify alternative mesh regions"
);
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2015 OpenFOAM Foundation Copyright (C) 2013-2015 OpenFOAM Foundation
Copyright (C) 2016 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -46,7 +46,7 @@ Usage ...@@ -46,7 +46,7 @@ Usage
\param -region \<name\> \n \param -region \<name\> \n
Specify an alternative mesh region. Specify an alternative mesh region.
\param -regions (\<name1\> \<name2\> .. \<namen\>) \n \param -regions (\<name1\> .. \<nameN\>) \n
Specify alternative mesh regions. The region names will be sorted Specify alternative mesh regions. The region names will be sorted
alphabetically and a single composite name will be created alphabetically and a single composite name will be created
\<nameX\>_\<nameY\>.._\<nameZ\> \<nameX\>_\<nameY\>.._\<nameZ\>
...@@ -65,6 +65,7 @@ See also ...@@ -65,6 +65,7 @@ See also
#include "fvCFD.H" #include "fvCFD.H"
#include "externalCoupled.H" #include "externalCoupled.H"
#include "regionProperties.H"
#include "IOobjectList.H" #include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -77,8 +78,19 @@ int main(int argc, char *argv[]) ...@@ -77,8 +78,19 @@ int main(int argc, char *argv[])
" with the externalCoupled functionObject." " with the externalCoupled functionObject."
); );
#include "addRegionOption.H" argList::addOption
#include "addRegionsOption.H" (
"region",
"name",
"Specify alternative mesh region"
);
argList::addOption
(
"regions",
"(name1 .. nameN)",
"Specify alternative mesh regions"
);
argList::addArgument("patchGroup"); argList::addArgument("patchGroup");
argList::addOption argList::addOption
( (
...@@ -106,19 +118,22 @@ int main(int argc, char *argv[]) ...@@ -106,19 +118,22 @@ int main(int argc, char *argv[])
PtrList<const fvMesh> meshes(regionNames.size()); PtrList<const fvMesh> meshes(regionNames.size());
forAll(regionNames, i) forAll(regionNames, regioni)
{ {
Info<< "Create mesh " << regionNames[i] << " for time = " const word& regionName = regionNames[regioni];
Info<< "Create mesh " << regionName
<< " for time = "
<< runTime.timeName() << nl << endl; << runTime.timeName() << nl << endl;
meshes.set meshes.set
( (
i, regioni,
new fvMesh new fvMesh
( (
Foam::IOobject Foam::IOobject
( (
regionNames[i], regionName,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
Foam::IOobject::MUST_READ Foam::IOobject::MUST_READ
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment