Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_pdata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_pdata
Commits
45748b8b
Commit
45748b8b
authored
2 years ago
by
Abhinav Singh
Browse files
Options
Downloads
Patches
Plain Diff
Adding time to pvtp
parent
dc403a86
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Vector/vector_dist.hpp
+48
-0
48 additions, 0 deletions
src/Vector/vector_dist.hpp
with
48 additions
and
0 deletions
src/Vector/vector_dist.hpp
+
48
−
0
View file @
45748b8b
...
...
@@ -2924,6 +2924,54 @@ public:
}
}
/*! \brief Output particle position and properties and add a time stamp to pvtp
*
* \param out output
* \param iteration (we can append the number at the end of the file_name)
* \param time = 1.234 to add to the information time to the PVTP file)
* \param opt VTK_WRITER, CSV_WRITER, it is also possible to choose the format for VTK
* FORMAT_BINARY. (the default is ASCII format)
*
* \return if the file has been written correctly
*
*/
inline
bool
write_frame
(
std
::
string
out
,
size_t
iteration
,
double
time
,
int
opt
=
VTK_WRITER
)
{
Vcluster
<
Memory
>
&
v_cl
=
create_vcluster
<
Memory
>
();
if
((
opt
&
0x0FFF0000
)
==
CSV_WRITER
)
{
// CSVWriter test
CSVWriter
<
vector_dist_pos
,
vector_dist_prop
>
csv_writer
;
std
::
string
output
=
std
::
to_string
(
out
+
"_"
+
std
::
to_string
(
v_cl
.
getProcessUnitID
())
+
"_"
+
std
::
to_string
(
iteration
)
+
std
::
to_string
(
".csv"
));
// Write the CSV
return
csv_writer
.
write
(
output
,
v_pos
,
v_prp
);
}
else
{
file_type
ft
=
file_type
::
ASCII
;
if
(
opt
&
FORMAT_BINARY
)
ft
=
file_type
::
BINARY
;
// VTKWriter for a set of points
VTKWriter
<
boost
::
mpl
::
pair
<
vector_dist_pos
,
vector_dist_prop
>
,
VECTOR_POINTS
>
vtk_writer
;
vtk_writer
.
add
(
v_pos
,
v_prp
,
g_m
);
std
::
string
output
=
std
::
to_string
(
out
+
"_"
+
std
::
to_string
(
v_cl
.
getProcessUnitID
())
+
"_"
+
std
::
to_string
(
iteration
)
+
std
::
to_string
(
".vtp"
));
// Write the VTK file
bool
ret
=
vtk_writer
.
write
(
output
,
prp_names
,
"particles"
,
""
,
ft
);
if
(
v_cl
.
rank
()
==
0
)
{
vtk_writer
.
write_pvtp
(
out
,
prp_names
,
v_cl
.
size
(),
iteration
,
time
);}
return
ret
;
}
}
/*! \brief Get the Celllist parameters
*
* \param r_cut spacing of the cell-list
...
...
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