mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'olesenm'
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
polyDualMesh.C
|
|
||||||
polyDualMeshApp.C
|
polyDualMeshApp.C
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/polyDualMesh
|
EXE = $(FOAM_APPBIN)/polyDualMesh
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/conversion/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lmeshTools
|
-lmeshTools -lconversion
|
||||||
|
|||||||
@ -50,6 +50,14 @@ Usage
|
|||||||
Remove any existing @a processor subdirectories before decomposing the
|
Remove any existing @a processor subdirectories before decomposing the
|
||||||
geometry.
|
geometry.
|
||||||
|
|
||||||
|
@param -lazy \n
|
||||||
|
Only decompose the geometry if the number of domains has changed from a
|
||||||
|
previous decomposition. No @a processor subdirectories will be removed
|
||||||
|
unless the @a -force option is also specified. This option can be used
|
||||||
|
to avoid redundant geometry decomposition (eg, in scripts), but should
|
||||||
|
be used with caution when the underlying (serial) geometry or the
|
||||||
|
decomposition method etc. have been changed between decompositions.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
@ -80,6 +88,7 @@ int main(int argc, char *argv[])
|
|||||||
argList::validOptions.insert("fields", "");
|
argList::validOptions.insert("fields", "");
|
||||||
argList::validOptions.insert("filterPatches", "");
|
argList::validOptions.insert("filterPatches", "");
|
||||||
argList::validOptions.insert("force", "");
|
argList::validOptions.insert("force", "");
|
||||||
|
argList::validOptions.insert("lazy", "");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
@ -88,6 +97,7 @@ int main(int argc, char *argv[])
|
|||||||
bool decomposeFieldsOnly(args.options().found("fields"));
|
bool decomposeFieldsOnly(args.options().found("fields"));
|
||||||
bool filterPatches(args.options().found("filterPatches"));
|
bool filterPatches(args.options().found("filterPatches"));
|
||||||
bool forceOverwrite(args.options().found("force"));
|
bool forceOverwrite(args.options().found("force"));
|
||||||
|
bool lazyDecomposition(args.options().found("lazy"));
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
@ -100,47 +110,84 @@ int main(int argc, char *argv[])
|
|||||||
++nProcs;
|
++nProcs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for previously decomposed case first
|
// get requested numberOfSubdomains
|
||||||
|
label nDomains = 0;
|
||||||
|
{
|
||||||
|
IOdictionary decompDict
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"decomposeParDict",
|
||||||
|
runTime.time().system(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
decompDict.lookup("numberOfSubdomains") >> nDomains;
|
||||||
|
}
|
||||||
|
|
||||||
if (decomposeFieldsOnly)
|
if (decomposeFieldsOnly)
|
||||||
{
|
{
|
||||||
if (!nProcs)
|
// Sanity check on previously decomposed case
|
||||||
|
if (nProcs != nDomains)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Specifying -fields requires a decomposed geometry!"
|
<< "Specified -fields, but the case was decomposed with "
|
||||||
|
<< nProcs << " domains"
|
||||||
|
<< nl
|
||||||
|
<< "instead of " << nDomains
|
||||||
|
<< " domains as specified in decomposeParDict"
|
||||||
<< nl
|
<< nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (nProcs)
|
||||||
{
|
{
|
||||||
if (nProcs)
|
bool procDirsProblem = true;
|
||||||
|
|
||||||
|
if (lazyDecomposition && nProcs == nDomains)
|
||||||
{
|
{
|
||||||
if (forceOverwrite)
|
// we can reuse the decomposition
|
||||||
{
|
decomposeFieldsOnly = true;
|
||||||
Info<< "Removing " << nProcs
|
procDirsProblem = false;
|
||||||
<< " existing processor directories" << endl;
|
forceOverwrite = false;
|
||||||
|
|
||||||
// remove existing processor dirs
|
Info<< "Using existing processor directories" << nl;
|
||||||
for (label procI = nProcs-1; procI >= 0; --procI)
|
}
|
||||||
{
|
|
||||||
fileName procDir
|
|
||||||
(
|
|
||||||
runTime.path()/(word("processor") + name(procI))
|
|
||||||
);
|
|
||||||
|
|
||||||
rmDir(procDir);
|
if (forceOverwrite)
|
||||||
}
|
{
|
||||||
}
|
Info<< "Removing " << nProcs
|
||||||
else
|
<< " existing processor directories" << endl;
|
||||||
|
|
||||||
|
// remove existing processor dirs
|
||||||
|
// reverse order to avoid gaps if someone interrupts the process
|
||||||
|
for (label procI = nProcs-1; procI >= 0; --procI)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
fileName procDir
|
||||||
<< "Case is already decomposed, "
|
(
|
||||||
"use the -force option or manually remove" << nl
|
runTime.path()/(word("processor") + name(procI))
|
||||||
<< "processor directories before decomposing. e.g.," << nl
|
);
|
||||||
<< " rm -rf " << runTime.path().c_str() << "/processor*"
|
|
||||||
<< nl
|
rmDir(procDir);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
procDirsProblem = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (procDirsProblem)
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Case is already decomposed with " << nProcs
|
||||||
|
<< " domains, use the -force option or manually" << nl
|
||||||
|
<< "remove processor directories before decomposing. e.g.,"
|
||||||
|
<< nl
|
||||||
|
<< " rm -rf " << runTime.path().c_str() << "/processor*"
|
||||||
|
<< nl
|
||||||
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,61 +1,61 @@
|
|||||||
// Mesh decomposition control dictionary
|
/*-------------------------------*- C++ -*---------------------------------*\
|
||||||
|
| ========= |
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
| \\ / OpenFOAM |
|
||||||
|
| \\ / |
|
||||||
|
| \\ / The Open Source CFD Toolbox |
|
||||||
|
| \\/ http://www.OpenFOAM.org |
|
||||||
|
\*-------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 0.5;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
root "ROOT";
|
note "mesh decomposition control dictionary";
|
||||||
case "CASE";
|
location "system";
|
||||||
instance "system";
|
object decomposeParDict;
|
||||||
local "";
|
|
||||||
|
|
||||||
class dictionary;
|
|
||||||
|
|
||||||
object decompositionDict;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
numberOfSubdomains 4;
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
//preservePatches (inlet);
|
// preservePatches (inlet);
|
||||||
//preserveFaceZones (heater solid1 solid3);
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
method simple;
|
method simple;
|
||||||
//method hierarchical;
|
// method hierarchical;
|
||||||
//method metis;
|
// method metis;
|
||||||
//method manual;
|
// method manual;
|
||||||
|
|
||||||
simpleCoeffs
|
simpleCoeffs
|
||||||
{
|
{
|
||||||
n (2 2 1);
|
n (2 2 1);
|
||||||
delta 0.001;
|
delta 0.001;
|
||||||
}
|
}
|
||||||
|
|
||||||
hierarchicalCoeffs
|
hierarchicalCoeffs
|
||||||
{
|
{
|
||||||
n (2 2 1);
|
n (2 2 1);
|
||||||
delta 0.001;
|
delta 0.001;
|
||||||
order xyz;
|
order xyz;
|
||||||
}
|
}
|
||||||
|
|
||||||
metisCoeffs
|
metisCoeffs
|
||||||
{
|
{
|
||||||
//processorWeights
|
/*
|
||||||
//(
|
processorWeights
|
||||||
// 1
|
(
|
||||||
// 1
|
1
|
||||||
// 1
|
1
|
||||||
// 1
|
1
|
||||||
//);
|
1
|
||||||
|
);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
manualCoeffs
|
manualCoeffs
|
||||||
{
|
{
|
||||||
dataFile "decompositionData";
|
dataFile "decompositionData";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -31,6 +31,7 @@ wmake libso randomProcesses
|
|||||||
( cd turbulenceModels && ./Allwmake )
|
( cd turbulenceModels && ./Allwmake )
|
||||||
( cd lagrangian && ./Allwmake )
|
( cd lagrangian && ./Allwmake )
|
||||||
( cd postProcessing && ./Allwmake )
|
( cd postProcessing && ./Allwmake )
|
||||||
|
( cd conversion && ./Allwmake )
|
||||||
|
|
||||||
wmake libso autoMesh
|
wmake libso autoMesh
|
||||||
wmake libso errorEstimation
|
wmake libso errorEstimation
|
||||||
|
|||||||
4
src/conversion/Allwmake
Executable file
4
src/conversion/Allwmake
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -x
|
||||||
|
|
||||||
|
wmake libso
|
||||||
3
src/conversion/Make/files
Normal file
3
src/conversion/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
polyDualMesh/polyDualMesh.C
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libconversion
|
||||||
5
src/conversion/Make/options
Normal file
5
src/conversion/Make/options
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
LIB_LIBS = \
|
||||||
|
-lmeshTools
|
||||||
Reference in New Issue
Block a user