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
191cc9a8
Commit
191cc9a8
authored
Nov 25, 2010
by
mattijs
Browse files
ENH: mapDistribute : optional initial value
parent
ae1e1cc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H
View file @
191cc9a8
...
...
@@ -319,6 +319,62 @@ public:
}
}
//- Reverse distribute data using default commsType.
// Since constructSize might be larger than supplied size supply
// a nullValue
template
<
class
T
>
void
reverseDistribute
(
const
label
constructSize
,
const
T
&
nullValue
,
List
<
T
>&
fld
)
const
{
if
(
Pstream
::
defaultCommsType
==
Pstream
::
nonBlocking
)
{
distribute
(
Pstream
::
nonBlocking
,
List
<
labelPair
>
(),
constructSize
,
constructMap_
,
subMap_
,
fld
,
eqOp
<
T
>
(),
nullValue
);
}
else
if
(
Pstream
::
defaultCommsType
==
Pstream
::
scheduled
)
{
distribute
(
Pstream
::
scheduled
,
schedule
(),
constructSize
,
constructMap_
,
subMap_
,
fld
,
eqOp
<
T
>
(),
nullValue
);
}
else
{
distribute
(
Pstream
::
blocking
,
List
<
labelPair
>
(),
constructSize
,
constructMap_
,
subMap_
,
fld
,
eqOp
<
T
>
(),
nullValue
);
}
}
//- Do all sends using PstreamBuffers
template
<
class
T
>
void
send
(
PstreamBuffers
&
,
const
List
<
T
>&
)
const
;
...
...
src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C
View file @
191cc9a8
...
...
@@ -446,10 +446,11 @@ void Foam::mapDistribute::distribute
const
labelList
&
map
=
constructMap
[
Pstream
::
myProcNo
()];
field
.
setSize
(
constructSize
);
field
=
nullValue
;
forAll
(
map
,
i
)
{
field
[
map
[
i
]]
=
subField
[
i
];
cop
(
field
[
map
[
i
]]
,
subField
[
i
]
)
;
}
return
;
}
...
...
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