Skip to content
GitLab
Menu
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
cc0dbb05
Commit
cc0dbb05
authored
Sep 30, 2008
by
Andrew Heather
Browse files
adding -fields option
parent
071b8ffe
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructor.H
View file @
cc0dbb05
...
...
@@ -151,18 +151,20 @@ public:
const
IOobject
&
fieldIoObject
);
//- Reconstruct and write all volume fields
//- Reconstruct and write all
/selected
volume fields
template
<
class
Type
>
void
reconstructFvVolumeFields
(
const
IOobjectList
&
objects
const
IOobjectList
&
objects
,
const
HashSet
<
word
>&
selectedFields
);
//- Reconstruct and write all volume fields
//- Reconstruct and write all
/selected
volume fields
template
<
class
Type
>
void
reconstructFvSurfaceFields
(
const
IOobjectList
&
objects
const
IOobjectList
&
objects
,
const
HashSet
<
word
>&
selectedFields
);
};
...
...
applications/utilities/parallelProcessing/reconstructPar/fvFieldReconstructorReconstructFields.C
View file @
cc0dbb05
...
...
@@ -131,7 +131,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll
(
cp
,
faceI
)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing
[
faceI
]
=
cp
[
faceI
]
-
1
-
curPatchStart
;
}
...
...
@@ -151,7 +151,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
forAll
(
cp
,
faceI
)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
label
curF
=
cp
[
faceI
]
-
1
;
// Is the face on the boundary?
...
...
@@ -282,7 +282,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// It is necessary to create a copy of the addressing array to
// take care of the face direction offset trick.
//
//
{
labelList
curAddr
(
faceProcAddressing_
[
procI
]);
...
...
@@ -342,7 +342,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
forAll
(
cp
,
faceI
)
{
// Subtract one to take into account offsets for
// face direction.
// face direction.
reverseAddressing
[
faceI
]
=
cp
[
faceI
]
-
1
-
curPatchStart
;
}
...
...
@@ -452,11 +452,12 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
}
// Reconstruct and write all volume fields
// Reconstruct and write all
/selected
volume fields
template
<
class
Type
>
void
Foam
::
fvFieldReconstructor
::
reconstructFvVolumeFields
(
const
IOobjectList
&
objects
const
IOobjectList
&
objects
,
const
HashSet
<
word
>&
selectedFields
)
{
const
word
&
fieldClassName
=
...
...
@@ -468,27 +469,29 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeFields
{
Info
<<
" Reconstructing "
<<
fieldClassName
<<
"s
\n
"
<<
endl
;
for
(
IOobjectList
::
const_iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllConstIter
(
IOobjectList
,
fields
,
fieldIter
)
{
Info
<<
" "
<<
fieldIter
()
->
name
()
<<
endl
;
if
(
!
selectedFields
.
size
()
||
selectedFields
.
found
(
fieldIter
()
->
name
())
)
{
Info
<<
" "
<<
fieldIter
()
->
name
()
<<
endl
;
reconstructFvVolumeField
<
Type
>
(
*
fieldIter
())().
write
();
reconstructFvVolumeField
<
Type
>
(
*
fieldIter
())().
write
();
}
}
Info
<<
endl
;
}
}
// Reconstruct and write all surface fields
// Reconstruct and write all
/selected
surface fields
template
<
class
Type
>
void
Foam
::
fvFieldReconstructor
::
reconstructFvSurfaceFields
(
const
IOobjectList
&
objects
const
IOobjectList
&
objects
,
const
HashSet
<
word
>&
selectedFields
)
{
const
word
&
fieldClassName
=
...
...
@@ -500,18 +503,19 @@ void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
{
Info
<<
" Reconstructing "
<<
fieldClassName
<<
"s
\n
"
<<
endl
;
for
(
IOobjectList
::
const_iterator
fieldIter
=
fields
.
begin
();
fieldIter
!=
fields
.
end
();
++
fieldIter
)
forAllConstIter
(
IOobjectList
,
fields
,
fieldIter
)
{
Info
<<
" "
<<
fieldIter
()
->
name
()
<<
endl
;
if
(
!
selectedFields
.
size
()
||
selectedFields
.
found
(
fieldIter
()
->
name
())
)
{
Info
<<
" "
<<
fieldIter
()
->
name
()
<<
endl
;
reconstructFvSurfaceField
<
Type
>
(
*
fieldIter
())().
write
();
reconstructFvSurfaceField
<
Type
>
(
*
fieldIter
())().
write
();
}
}
Info
<<
endl
;
}
}
...
...
applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
View file @
cc0dbb05
...
...
@@ -48,9 +48,17 @@ int main(int argc, char *argv[])
argList
::
noParallel
();
timeSelector
::
addOptions
();
# include "addRegionOption.H"
argList
::
validOptions
.
insert
(
"fields"
,
"
\"
(list of fields)
\"
"
);
# include "setRootCase.H"
# include "createTime.H"
HashSet
<
word
>
selectedFields
;
if
(
args
.
options
().
found
(
"fields"
))
{
IStringStream
(
args
.
options
()[
"fields"
])()
>>
selectedFields
;
}
// determine the processor count directly
label
nProcs
=
0
;
while
(
dir
(
args
.
path
()
/
(
word
(
"processor"
)
+
name
(
nProcs
))))
...
...
@@ -184,13 +192,37 @@ int main(int argc, char *argv[])
procMeshes
.
boundaryProcAddressing
()
);
fvReconstructor
.
reconstructFvVolumeFields
<
scalar
>
(
objects
);
fvReconstructor
.
reconstructFvVolumeFields
<
vector
>
(
objects
);
fvReconstructor
.
reconstructFvVolumeFields
<
sphericalTensor
>
(
objects
);
fvReconstructor
.
reconstructFvVolumeFields
<
symmTensor
>
(
objects
);
fvReconstructor
.
reconstructFvVolumeFields
<
tensor
>
(
objects
);
fvReconstructor
.
reconstructFvVolumeFields
<
scalar
>
(
objects
,
selectedFields
);
fvReconstructor
.
reconstructFvVolumeFields
<
vector
>
(
objects
,
selectedFields
);
fvReconstructor
.
reconstructFvVolumeFields
<
sphericalTensor
>
(
objects
,
selectedFields
);
fvReconstructor
.
reconstructFvVolumeFields
<
symmTensor
>
(
objects
,
selectedFields
);
fvReconstructor
.
reconstructFvVolumeFields
<
tensor
>
(
objects
,
selectedFields
);
fvReconstructor
.
reconstructFvSurfaceFields
<
scalar
>
(
objects
);
fvReconstructor
.
reconstructFvSurfaceFields
<
scalar
>
(
objects
,
selectedFields
);
}
else
{
...
...
Write
Preview
Supports
Markdown
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