Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
8b4dfe24
Commit
8b4dfe24
authored
Nov 19, 2016
by
Mark Olesen
Browse files
Merge remote-tracking branch 'origin/decomposeParDict' into develop
parents
c659d993
52d0289e
Changes
16
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/generation/blockMesh/blockMesh.C
View file @
8b4dfe24
...
...
@@ -128,16 +128,12 @@ int main(int argc, char *argv[])
fileName
dictPath
;
// Check if the dictionary is specified on the command-line
if
(
args
.
option
Found
(
"dict"
))
if
(
args
.
option
ReadIfPresent
(
"dict"
,
dictPath
))
{
dictPath
=
args
[
"dict"
];
dictPath
=
(
isDir
(
dictPath
)
?
dictPath
/
dictName
:
dictPath
);
if
(
isDir
(
dictPath
))
{
dictPath
=
dictPath
/
dictName
;
}
}
// Check if dictionary is present in the constant directory
else
if
...
...
applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/foamyHexMesh.C
View file @
8b4dfe24
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -67,14 +67,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName
decompDictFile
;
if
(
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
))
{
if
(
isDir
(
decompDictFile
))
{
decompDictFile
=
decompDictFile
/
"decomposeParDict"
;
}
}
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
IOdictionary
foamyHexMeshDict
(
...
...
applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/foamyHexMeshBackgroundMesh.C
View file @
8b4dfe24
...
...
@@ -524,13 +524,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName
decompDictFile
;
if
(
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
))
{
if
(
isDir
(
decompDictFile
))
{
decompDictFile
=
decompDictFile
/
"decomposeParDict"
;
}
}
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
labelList
decomp
=
decompositionModel
::
New
(
...
...
applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
View file @
8b4dfe24
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright
(C)
2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -905,13 +905,7 @@ int main(int argc, char *argv[])
if
(
Pstream
::
parRun
())
{
fileName
decompDictFile
;
if
(
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
))
{
if
(
isDir
(
decompDictFile
))
{
decompDictFile
=
decompDictFile
/
"decomposeParDict"
;
}
}
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
decomposeDict
=
IOdictionary
(
...
...
applications/utilities/parallelProcessing/decomposePar/decomposePar.C
View file @
8b4dfe24
...
...
@@ -270,14 +270,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName
decompDictFile
;
if
(
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
))
{
if
(
isDir
(
decompDictFile
))
{
decompDictFile
=
decompDictFile
/
"decomposeParDict"
;
}
}
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
wordList
regionNames
;
wordList
regionDirs
;
...
...
@@ -360,7 +353,6 @@ int main(int argc, char *argv[])
),
decompDictFile
)
).
lookup
(
"numberOfSubdomains"
)
);
...
...
applications/utilities/parallelProcessing/redistributePar/redistributePar.C
View file @
8b4dfe24
...
...
@@ -64,6 +64,7 @@ Usage
#include "fvMeshTools.H"
#include "fvMeshDistribute.H"
#include "decompositionMethod.H"
#include "decompositionModel.H"
#include "timeSelector.H"
#include "PstreamReduceOps.H"
#include "volFields.H"
...
...
@@ -74,7 +75,6 @@ Usage
#include "loadOrCreateMesh.H"
#include "processorFvPatchField.H"
#include "zeroGradientFvPatchFields.H"
#include "decompositionModel.H"
#include "parFvFieldReconstructor.H"
#include "parLagrangianRedistributor.H"
...
...
@@ -2152,7 +2152,6 @@ int main(int argc, char *argv[])
bool
newTimes
=
args
.
optionFound
(
"newTimes"
);
if
(
env
(
"FOAM_SIGFPE"
))
{
WarningInFunction
...
...
@@ -2245,8 +2244,6 @@ int main(int argc, char *argv[])
Pstream
::
scatter
(
decompose
);
// If running distributed we have problem of new processors not finding
// a system/controlDict. However if we switch on the master-only reading
// the problem becomes that the time directories are differing sizes and
...
...
@@ -2330,7 +2327,6 @@ int main(int argc, char *argv[])
// Determine any region
word
regionName
=
polyMesh
::
defaultRegion
;
fileName
meshSubDir
;
if
(
args
.
optionReadIfPresent
(
"region"
,
regionName
))
{
meshSubDir
=
regionName
/
polyMesh
::
meshSubDir
;
...
...
@@ -2774,13 +2770,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location
fileName
decompDictFile
;
if
(
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
))
{
if
(
isDir
(
decompDictFile
))
{
decompDictFile
=
decompDictFile
/
"decomposeParDict"
;
}
}
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
// Determine decomposition
...
...
applications/utilities/preProcessing/mapFields/mapFields.C
View file @
8b4dfe24
...
...
@@ -51,13 +51,11 @@ int readNumProcs
const
Time
&
runTime
)
{
const
word
dictName
=
"decomposeParDict"
;
fileName
dictFile
;
if
(
args
.
optionReadIfPresent
(
optionName
,
dictFile
))
if
(
args
.
optionReadIfPresent
(
optionName
,
dictFile
)
&&
isDir
(
dictFile
)
)
{
if
(
isDir
(
dictFile
))
{
dictFile
=
dictFile
/
"decomposeParDict"
;
}
dictFile
=
dictFile
/
dictName
;
}
return
readInt
...
...
@@ -68,7 +66,7 @@ int readNumProcs
(
IOobject
(
"decomposeParDict"
,
dictName
,
runTime
.
system
(),
runTime
,
IOobject
::
MUST_READ_IF_MODIFIED
,
...
...
@@ -376,7 +374,7 @@ int main(int argc, char *argv[])
if
(
parallelSource
&&
!
parallelTarget
)
{
int
nProcs
=
readNumProcs
const
int
nProcs
=
readNumProcs
(
args
,
"sourceDecomposeParDict"
,
...
...
@@ -448,7 +446,7 @@ int main(int argc, char *argv[])
}
else
if
(
!
parallelSource
&&
parallelTarget
)
{
int
nProcs
=
readNumProcs
const
int
nProcs
=
readNumProcs
(
args
,
"targetDecomposeParDict"
,
...
...
@@ -521,13 +519,13 @@ int main(int argc, char *argv[])
}
else
if
(
parallelSource
&&
parallelTarget
)
{
int
nProcsSource
=
readNumProcs
const
int
nProcsSource
=
readNumProcs
(
args
,
"sourceDecomposeParDict"
,
runTimeSource
);
int
nProcsTarget
=
readNumProcs
const
int
nProcsTarget
=
readNumProcs
(
args
,
"targetDecomposeParDict"
,
...
...
applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
View file @
8b4dfe24
...
...
@@ -157,14 +157,10 @@ int main(int argc, char *argv[])
// Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary
// is in constant
fileName
dictPath
=
""
;
if
(
args
.
option
Found
(
"dict"
))
fileName
dictPath
;
if
(
args
.
option
ReadIfPresent
(
"dict"
,
dictPath
)
&&
isDir
(
dictPath
))
{
dictPath
=
args
[
"dict"
];
if
(
isDir
(
dictPath
))
{
dictPath
=
dictPath
/
dictName
;
}
dictPath
=
dictPath
/
dictName
;
}
if
(
dictPath
.
size
())
...
...
applications/utilities/surface/surfaceRedistributePar/Make/options
View file @
8b4dfe24
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/distributed/lnInclude
EXE_LIBS = \
-ldistributed \
-lmeshTools \
-ltriSurface
-ltriSurface \
-ldecompose
applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C
View file @
8b4dfe24
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2016
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -46,6 +46,7 @@ Note
#include "distributedTriSurfaceMesh.H"
#include "mapDistribute.H"
#include "localIOdictionary.H"
#include "decompositionModel.H"
using
namespace
Foam
;
...
...
@@ -103,7 +104,8 @@ int main(int argc, char *argv[])
{
argList
::
addNote
(
"redistribute a triSurface"
"Redistribute a triSurface. "
"The specified surface must be located in the constant/triSurface directory"
);
argList
::
validArgs
.
append
(
"triSurfaceMesh"
);
...
...
@@ -127,7 +129,7 @@ int main(int argc, char *argv[])
<<
"Using distribution method "
<<
distTypeName
<<
nl
<<
endl
;
const
bool
keepNonMapped
=
args
.
option
s
().
f
ound
(
"keepNonMapped"
);
const
bool
keepNonMapped
=
args
.
option
F
ound
(
"keepNonMapped"
);
if
(
keepNonMapped
)
{
...
...
@@ -151,6 +153,37 @@ int main(int argc, char *argv[])
Random
rndGen
(
653213
);
// For independent decomposition, ensure that distributedTriSurfaceMesh
// can find the alternative decomposeParDict specified via the
// -decomposeParDict option.
if
(
distType
==
distributedTriSurfaceMesh
::
INDEPENDENT
)
{
fileName
decompDictFile
;
args
.
optionReadIfPresent
(
"decomposeParDict"
,
decompDictFile
);
IOdictionary
*
dict
=
new
IOdictionary
(
decompositionModel
::
selectIO
(
IOobject
(
"decomposeParDict"
,
runTime
.
system
(),
runTime
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
),
decompDictFile
)
);
// The object must have the expected "decomposeParDict" name.
// This also implies that it cannot be changed during the run.
dict
->
rename
(
"decomposeParDict"
);
runTime
.
store
(
dict
);
}
// Determine mesh bounding boxes:
List
<
List
<
treeBoundBox
>>
meshBb
(
Pstream
::
nProcs
());
if
(
distType
==
distributedTriSurfaceMesh
::
FOLLOW
)
...
...
src/OpenFOAM/global/argList/argList.C
View file @
8b4dfe24
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015
-2016
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -614,10 +614,29 @@ void Foam::argList::parse
// Establish rootPath_/globalCase_/case_ for master
getRootCase
();
// See if running distributed (different roots for different procs)
label
dictNProcs
=
-
1
;
fileName
source
;
// Establish location of decomposeParDict, allow override with
// the -decomposeParDict option.
fileName
source
=
rootPath_
/
globalCase_
/
"system"
/
"decomposeParDict"
;
if
(
options_
.
found
(
"decomposeParDict"
))
{
bool
adjustOpt
=
false
;
source
=
options_
[
"decomposeParDict"
];
if
(
isDir
(
source
))
{
adjustOpt
=
true
;
source
=
source
/
"decomposeParDict"
;
}
// Could also check for absolute path, but shouldn't be needed
if
(
adjustOpt
)
{
source
.
clean
();
options_
.
set
(
"decomposeParDict"
,
source
);
}
}
// If running distributed (different roots for different procs)
label
dictNProcs
=
-
1
;
if
(
options_
.
found
(
"roots"
))
{
source
=
"-roots"
;
...
...
@@ -631,16 +650,8 @@ void Foam::argList::parse
}
else
{
source
=
rootPath_
/
globalCase_
/
"system"
/
"decomposeParDict"
;
// Override with -decomposeParDict
if
(
options_
.
found
(
"decomposeParDict"
))
{
source
=
options_
[
"decomposeParDict"
];
if
(
isDir
(
source
))
{
source
=
source
/
"decomposeParDict"
;
}
}
// Use values from decomposeParDict, the location was already
// established above.
IFstream
decompDictStream
(
source
);
...
...
src/OpenFOAM/include/setConstantMeshDictionaryIO.H
View file @
8b4dfe24
fileName
dictPath
=
""
;
if
(
args
.
option
Found
(
"dict"
))
fileName
dictPath
;
if
(
args
.
option
ReadIfPresent
(
"dict"
,
dictPath
))
{
dictPath
=
args
[
"dict"
];
if
(
isDir
(
dictPath
))
{
dictPath
=
dictPath
/
dictName
;
...
...
src/OpenFOAM/include/setSystemMeshDictionaryIO.H
View file @
8b4dfe24
fileName
dictPath
=
""
;
if
(
args
.
option
Found
(
"dict"
))
fileName
dictPath
;
if
(
args
.
option
ReadIfPresent
(
"dict"
,
dictPath
))
{
dictPath
=
args
[
"dict"
];
if
(
isDir
(
dictPath
))
{
dictPath
=
dictPath
/
dictName
;
...
...
src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H
View file @
8b4dfe24
fileName
dictPath
=
""
;
if
(
args
.
option
Found
(
"dict"
))
fileName
dictPath
;
if
(
args
.
option
ReadIfPresent
(
"dict"
,
dictPath
))
{
dictPath
=
args
[
"dict"
];
if
(
isDir
(
dictPath
))
{
dictPath
=
dictPath
/
dictName
;
...
...
tutorials/incompressible/simpleFoam/motorBike/Allrun
View file @
8b4dfe24
...
...
@@ -4,14 +4,16 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
.
$WM_PROJECT_DIR
/bin/tools/RunFunctions
decompDict
=
"-decomposeParDict system/decomposeParDict.6"
# copy motorbike surface from resources directory
\c
p
$FOAM_TUTORIALS
/resources/geometry/motorBike.obj.gz constant/triSurface/
runApplication surfaceFeatureExtract
runApplication blockMesh
runApplication decomposePar
runParallel snappyHexMesh
-overwrite
runApplication decomposePar
$decompDict
runParallel
$decompDict
snappyHexMesh
-overwrite
#- For non-parallel running: - set the initial fields
# restore0Dir
...
...
@@ -19,9 +21,9 @@ runParallel snappyHexMesh -overwrite
#- For parallel running: set the initial fields
restore0Dir
-processor
runParallel patchSummary
runParallel potentialFoam
runParallel
$(
getApplication
)
runParallel
$decompDict
patchSummary
runParallel
$decompDict
potentialFoam
runParallel
$decompDict
$(
getApplication
)
runApplication reconstructParMesh
-constant
runApplication reconstructPar
-latestTime
...
...
tutorials/incompressible/simpleFoam/motorBike/system/decomposeParDict
→
tutorials/incompressible/simpleFoam/motorBike/system/decomposeParDict
.6
View file @
8b4dfe24
...
...
@@ -28,7 +28,7 @@ simpleCoeffs
hierarchicalCoeffs
{
n (
3
2 1);
n (
2
2 1);
delta 0.001;
order xyz;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment