Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
5969f162
Commit
5969f162
authored
16 years ago
by
Andrew Heather
Browse files
Options
Downloads
Patches
Plain Diff
updates
parent
eb94b1c7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C
+24
-18
24 additions, 18 deletions
...postProcessing/lagrangian/particleTracks/particleTracks.C
with
24 additions
and
18 deletions
applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C
+
24
−
18
View file @
5969f162
...
@@ -26,6 +26,8 @@ Application
...
@@ -26,6 +26,8 @@ Application
particleTracks
particleTracks
Description
Description
Generates a VTK file of particle tracks for cases that were computed using
a tracked-parcel-type cloud
\*---------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
...
@@ -54,6 +56,8 @@ int main(int argc, char *argv[])
...
@@ -54,6 +56,8 @@ int main(int argc, char *argv[])
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"Scanning times to determine track data"
<<
nl
<<
endl
;
labelList
maxIds
(
Pstream
::
nProcs
(),
-
1
);
labelList
maxIds
(
Pstream
::
nProcs
(),
-
1
);
forAll
(
timeDirs
,
timeI
)
forAll
(
timeDirs
,
timeI
)
{
{
...
@@ -90,8 +94,6 @@ int main(int argc, char *argv[])
...
@@ -90,8 +94,6 @@ int main(int argc, char *argv[])
Pstream
::
listCombineScatter
(
maxIds
);
Pstream
::
listCombineScatter
(
maxIds
);
labelList
numIds
=
maxIds
+
1
;
labelList
numIds
=
maxIds
+
1
;
Info
<<
"numIds = "
<<
numIds
<<
endl
;
// calc starting ids for particles on each processor
// calc starting ids for particles on each processor
List
<
label
>
startIds
(
numIds
.
size
(),
0
);
List
<
label
>
startIds
(
numIds
.
size
(),
0
);
for
(
label
i
=
0
;
i
<
numIds
.
size
()
-
1
;
i
++
)
for
(
label
i
=
0
;
i
<
numIds
.
size
()
-
1
;
i
++
)
...
@@ -155,17 +157,20 @@ int main(int argc, char *argv[])
...
@@ -155,17 +157,20 @@ int main(int argc, char *argv[])
Info
<<
" Reading particle positions"
<<
endl
;
Info
<<
" Reading particle positions"
<<
endl
;
Cloud
<
passiveParticle
>
myCloud
(
mesh
,
cloudName
,
false
);
Cloud
<
passiveParticle
>
myCloud
(
mesh
,
cloudName
,
false
);
pointField
positions
(
myCloud
.
size
(),
vector
::
zero
);
Info
<<
" Reading particle id"
<<
endl
;
label
i
=
0
;
forAllConstIter
(
Cloud
<
passiveParticle
>
,
myCloud
,
iter
)
{
positions
[
i
++
]
=
iter
().
position
();
}
IOField
<
label
>
id
(
idHeader
);
IOField
<
label
>
id
(
idHeader
);
Info
<<
" Reading particle origProc"
<<
endl
;
IOField
<
label
>
origProc
(
origProcHeader
);
IOField
<
label
>
origProc
(
origProcHeader
);
// collect the track data on the master processor
label
i
=
0
;
List
<
pointField
>
allPositions
(
Pstream
::
nProcs
());
List
<
pointField
>
allPositions
(
Pstream
::
nProcs
());
allPositions
[
Pstream
::
myProcNo
()]
=
positions
;
allPositions
[
Pstream
::
myProcNo
()].
setSize
(
myCloud
.
size
());
forAllConstIter
(
Cloud
<
passiveParticle
>
,
myCloud
,
iter
)
{
allPositions
[
Pstream
::
myProcNo
()][
i
++
]
=
iter
().
position
();
}
Pstream
::
gatherList
(
allPositions
);
Pstream
::
gatherList
(
allPositions
);
List
<
labelList
>
allIds
(
Pstream
::
nProcs
());
List
<
labelList
>
allIds
(
Pstream
::
nProcs
());
...
@@ -176,6 +181,7 @@ int main(int argc, char *argv[])
...
@@ -176,6 +181,7 @@ int main(int argc, char *argv[])
allOrigProcs
[
Pstream
::
myProcNo
()]
=
origProc
;
allOrigProcs
[
Pstream
::
myProcNo
()]
=
origProc
;
Pstream
::
gatherList
(
allOrigProcs
);
Pstream
::
gatherList
(
allOrigProcs
);
Info
<<
" Constructing tracks"
<<
nl
<<
endl
;
if
(
Pstream
::
master
())
if
(
Pstream
::
master
())
{
{
forAll
(
allPositions
,
procI
)
forAll
(
allPositions
,
procI
)
...
@@ -200,16 +206,16 @@ int main(int argc, char *argv[])
...
@@ -200,16 +206,16 @@ int main(int argc, char *argv[])
}
}
}
}
}
}
else
}
{
else
Info
<<
" No particles read"
<<
nl
<<
endl
;
{
}
Info
<<
" No particles read"
<<
nl
<<
endl
;
}
}
}
}
if
(
Pstream
::
master
())
if
(
Pstream
::
master
())
{
{
Info
<<
"Writing particle tracks"
<<
nl
<<
endl
;
Info
<<
"
\n
Writing particle tracks"
<<
nl
<<
endl
;
OFstream
vtkTracks
(
"particleTracks.vtk"
);
OFstream
vtkTracks
(
"particleTracks.vtk"
);
...
@@ -221,11 +227,11 @@ int main(int argc, char *argv[])
...
@@ -221,11 +227,11 @@ int main(int argc, char *argv[])
}
}
vtkTracks
vtkTracks
<<
"# vtk DataFile Version 2.0
\n
"
<<
"# vtk DataFile Version 2.0
"
<<
nl
<<
"particleTracks"
<<
nl
<<
"particleTracks"
<<
nl
<<
"ASCII
\n
"
<<
"ASCII
"
<<
nl
<<
"DATASET POLYDATA
\n
"
<<
"DATASET POLYDATA
"
<<
nl
<<
"POINTS "
<<
nPoints
<<
" float
\n
"
;
<<
"POINTS "
<<
nPoints
<<
" float
"
<<
nl
;
// Write track points to file
// Write track points to file
forAll
(
allTracks
,
trackI
)
forAll
(
allTracks
,
trackI
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment