Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
02ffb9d8
Commit
02ffb9d8
authored
Jun 25, 2008
by
Andrew Heather
Browse files
Merge branch 'olesenm'
parents
0178d726
d611ba8a
Changes
7
Hide whitespace changes
Inline
Side-by-side
applications/utilities/parallelProcessing/decomposePar/decomposePar.C
View file @
02ffb9d8
...
...
@@ -29,6 +29,27 @@ Description
Automatically decomposes a mesh and fields of a case for parallel
execution of OpenFOAM.
Usage
- decomposePar [OPTION]
@param -cellDist \n
Write the cell distribution as a labelList for use with 'manual'
decomposition method and as a volScalarField for post-processing.
@param -copyUniform \n
Copy any @a uniform directories too.
@param -fields \n
Use existing geometry decomposition and convert fields only.
@param -filterPatches \n
Remove empty patches when decomposing the geometry.
@param -force \n
Remove any existing @a processor subdirectories before decomposing the
geometry.
\*---------------------------------------------------------------------------*/
#include
"OSspecific.H"
...
...
@@ -54,23 +75,76 @@ Description
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noParallel
();
argList
::
validOptions
.
insert
(
"fields"
,
""
);
argList
::
validOptions
.
insert
(
"cellDist"
,
""
);
argList
::
validOptions
.
insert
(
"filterPatches"
,
""
);
argList
::
validOptions
.
insert
(
"copyUniform"
,
""
);
argList
::
validOptions
.
insert
(
"fields"
,
""
);
argList
::
validOptions
.
insert
(
"filterPatches"
,
""
);
argList
::
validOptions
.
insert
(
"force"
,
""
);
# include "setRootCase.H"
bool
decomposeFieldsOnly
(
args
.
options
().
found
(
"fields"
));
bool
writeCellDist
(
args
.
options
().
found
(
"cellDist"
));
bool
filterPatches
(
args
.
options
().
found
(
"filterPatches"
));
bool
copyUniform
(
args
.
options
().
found
(
"copyUniform"
));
bool
decomposeFieldsOnly
(
args
.
options
().
found
(
"fields"
));
bool
filterPatches
(
args
.
options
().
found
(
"filterPatches"
));
bool
forceOverwrite
(
args
.
options
().
found
(
"force"
));
# include "createTime.H"
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
endl
;
Info
<<
"Create mesh
\n
"
<<
endl
;
// determine the existing processor count directly
label
nProcs
=
0
;
while
(
dir
(
runTime
.
path
()
/
(
word
(
"processor"
)
+
name
(
nProcs
))))
{
++
nProcs
;
}
// Check for previously decomposed case first
if
(
decomposeFieldsOnly
)
{
if
(
!
nProcs
)
{
FatalErrorIn
(
args
.
executable
())
<<
"Specifying -fields requires a decomposed geometry!"
<<
nl
<<
exit
(
FatalError
);
}
}
else
{
if
(
nProcs
)
{
if
(
forceOverwrite
)
{
Info
<<
"Removing "
<<
nProcs
<<
" existing processor directories"
<<
endl
;
// remove existing processor dirs
for
(
label
procI
=
nProcs
-
1
;
procI
>=
0
;
--
procI
)
{
fileName
procDir
(
runTime
.
path
()
/
(
word
(
"processor"
)
+
name
(
procI
))
);
rmDir
(
procDir
);
}
}
else
{
FatalErrorIn
(
args
.
executable
())
<<
"Case is already decomposed, "
"use the -force option or manually remove"
<<
nl
<<
"processor directories before decomposing. e.g.,"
<<
nl
<<
" rm -rf "
<<
runTime
.
path
().
c_str
()
<<
"/processor*"
<<
nl
<<
exit
(
FatalError
);
}
}
}
Info
<<
"Create mesh"
<<
endl
;
domainDecomposition
mesh
(
IOobject
...
...
@@ -84,16 +158,6 @@ int main(int argc, char *argv[])
// Decompose the mesh
if
(
!
decomposeFieldsOnly
)
{
if
(
dir
(
runTime
.
path
()
/
"processor1"
))
{
FatalErrorIn
(
args
.
executable
())
<<
"Case is already decomposed."
<<
endl
<<
" Please remove processor directories before "
"decomposing e.g. using:"
<<
nl
<<
" rm -rf "
<<
runTime
.
path
().
c_str
()
<<
"/processor*"
<<
exit
(
FatalError
);
}
mesh
.
decomposeMesh
(
filterPatches
);
mesh
.
writeDecomposition
();
...
...
@@ -102,7 +166,9 @@ int main(int argc, char *argv[])
{
// Write the decomposition as labelList for use with 'manual'
// decomposition method.
OFstream
str
// FIXME: may attempt to write to a non-existent "region0/"
OFstream
os
(
runTime
.
path
()
/
mesh
.
facesInstance
()
...
...
@@ -110,11 +176,11 @@ int main(int argc, char *argv[])
/
"cellDecomposition"
);
s
tr
<<
mesh
.
cellToProc
();
o
s
<<
mesh
.
cellToProc
();
Info
<<
nl
<<
"Wr
it
te
n
decomposition to "
<<
s
tr
.
name
()
<<
" for use in manual decomposition."
<<
nl
<<
endl
;
Info
<<
nl
<<
"Wr
o
te decomposition to "
<<
o
s
.
name
()
<<
" for use in manual decomposition."
<<
endl
;
// Write as volScalarField for postprocessing.
volScalarField
cellDist
...
...
@@ -140,9 +206,9 @@ int main(int argc, char *argv[])
cellDist
.
write
();
Info
<<
nl
<<
"Wr
it
te
n
decomposition as volScalarField to "
Info
<<
nl
<<
"Wr
o
te decomposition as volScalarField to "
<<
cellDist
.
name
()
<<
" for use in postprocessing."
<<
nl
<<
endl
;
<<
endl
;
}
}
...
...
doc/Doxygen/tools/find-longlines
View file @
02ffb9d8
...
...
@@ -31,7 +31,7 @@ sub wanted {
if
(
$maxlen
<
length
)
{
$count
++
;
substr
(
$_
,
$maxlen
,
0
)
=
"
||->>
";
# show truncation point
print
"
$
ARGV
$.
$_
\n
";
print
"
$
File
::Find::name
$.
$_
\n
";
}
}
close
ARGV
;
...
...
src/OpenFOAM/db/IOstreams/IOstreams/IOmanip.H
View file @
02ffb9d8
...
...
@@ -170,19 +170,28 @@ inline Smanip<ios_base::fmtflags> setf
}
inline
Omanip
<
IOstream
::
streamFormat
>
setformat
(
const
IOstream
::
streamFormat
fmt
)
inline
Omanip
<
IOstream
::
streamFormat
>
setformat
(
const
IOstream
::
streamFormat
fmt
)
{
return
Omanip
<
IOstream
::
streamFormat
>
(
&
IOstream
::
format
,
fmt
);
}
inline
Omanip
<
IOstream
::
versionNumber
>
setversion
(
const
IOstream
::
versionNumber
ver
)
inline
Omanip
<
IOstream
::
versionNumber
>
setversion
(
const
IOstream
::
versionNumber
ver
)
{
return
Omanip
<
IOstream
::
versionNumber
>
(
&
IOstream
::
version
,
ver
);
}
inline
Omanip
<
IOstream
::
compressionType
>
setcompression
(
const
IOstream
::
compressionType
cmp
)
inline
Omanip
<
IOstream
::
compressionType
>
setcompression
(
const
IOstream
::
compressionType
cmp
)
{
return
Omanip
<
IOstream
::
compressionType
>
(
&
IOstream
::
compression
,
cmp
);
}
...
...
src/OpenFOAM/db/Time/timeSelector.H
View file @
02ffb9d8
...
...
@@ -117,7 +117,7 @@ public:
//- Select a list of Time values that are within the ranges
void
inplaceSelect
(
List
<
instant
>&
)
const
;
//- Add the
set of
options handled by timeSelector to argList::validOptions
//- Add the options handled by timeSelector to argList::validOptions
//
// @param constant
// Add the @b -constant option to include the @c constant/ directory
...
...
src/OpenFOAM/global/argList/argList.H
View file @
02ffb9d8
...
...
@@ -198,7 +198,7 @@ public:
return
globalCase_
;
}
//- Return case name
for
parallel run or
the
global case
for a
serial run
//- Return case name
(
parallel run
)
or global case
(
serial run
)
const
fileName
&
caseName
()
const
{
return
case_
;
...
...
src/OpenFOAM/meshes/ProcessorTopology/commSchedule.H
View file @
02ffb9d8
...
...
@@ -36,7 +36,7 @@ Description
Does a very simple scheduling which assumes same time for all operations.
After construction:
- schedule() gives the order in which the input communication should
happen
- schedule() gives the order in which the input communication should
occur
- procSchedule()[procI] gives per procI
Does not care whether 'talking' is first send, second receive or maybe
...
...
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H
View file @
02ffb9d8
...
...
@@ -90,7 +90,7 @@ inline const labelList& objectMap::masterObjects() const
}
// * * * * * * * * * * * * * * * * Fri
master
Operators * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Fri
end
Operators * * * * * * * * * * * * //
inline
bool
operator
==
(
const
objectMap
&
a
,
const
objectMap
&
b
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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