Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_io
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_io
Commits
dc3096b2
Commit
dc3096b2
authored
9 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Adding properties name
parent
13e4a081
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/VTKWriter_grids_st.hpp
+35
-6
35 additions, 6 deletions
src/VTKWriter_grids_st.hpp
with
35 additions
and
6 deletions
src/VTKWriter_grids_st.hpp
+
35
−
6
View file @
dc3096b2
...
...
@@ -188,12 +188,39 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
return
v_out
.
str
();
}
/* \brief Get the properties components
*
* \return the components printed
*
*/
std
::
string
get_prop_components
(
size_t
k
)
{
std
::
stringstream
v_out
;
//! For each sub-domain
for
(
size_t
i
=
0
;
i
<
vg
.
size
()
;
i
++
)
{
// For each position in the cell
for
(
size_t
j
=
0
;
j
<
vg
.
get
(
i
).
g
.
size
()
;
j
++
)
{
if
(
k
<
vg
.
get
(
i
).
g
.
get
(
j
).
grids
.
size
())
{
// get the combination string
v_out
<<
vg
.
get
(
i
).
g
.
get
(
j
).
cmb
.
to_string
();
}
}
}
return
v_out
.
str
();
}
/*! \brief Create the VTK properties output
*
* \param k component
* \param prop property name
*
*/
std
::
string
get_properties_output
(
size_t
k
)
std
::
string
get_properties_output
(
size_t
k
,
std
::
string
prop_name
)
{
//! vertex node output string
std
::
stringstream
v_out
;
...
...
@@ -212,8 +239,10 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
return
""
;
}
std
::
string
prp_cp
=
get_prop_components
(
k
);
// Create point data properties
v_out
<<
"SCALARS "
<<
"attr"
<<
k
<<
" "
<<
type
+
"
\n
"
;
v_out
<<
"SCALARS "
<<
prop_name
<<
"_"
<<
prp_cp
<<
" "
<<
type
+
"
\n
"
;
// Default lookup table
v_out
<<
"LOOKUP_TABLE default
\n
"
;
...
...
@@ -462,12 +491,12 @@ public:
* \tparam prp_out which properties to output [default = -1 (all)]
*
* \param file path where to write
* \param name of the set of grids
* \param
g_
name of the set of grids
* \param file_type specify if it is a VTK BINARY or ASCII file [default = ASCII]
*
*/
template
<
int
prp
=
-
1
>
bool
write
(
std
::
string
file
,
std
::
string
f
_name
=
"grids"
,
file_type
ft
=
file_type
::
ASCII
)
template
<
int
prp
=
-
1
>
bool
write
(
std
::
string
file
,
std
::
string
g
_name
=
"grids"
,
file_type
ft
=
file_type
::
ASCII
)
{
// Header for the vtk
std
::
string
vtk_header
;
...
...
@@ -488,7 +517,7 @@ public:
// VTK header
vtk_header
=
"# vtk DataFile Version 3.0
\n
"
+
f
_name
+
"
\n
"
;
+
g
_name
+
"
\n
"
;
// Choose if binary or ASCII
if
(
ft
==
file_type
::
ASCII
)
...
...
@@ -519,7 +548,7 @@ public:
// For each property in the vertex type produce a point data
for
(
size_t
i
=
0
;
i
<
mf
;
i
++
)
point_data
+=
get_properties_output
(
i
);
point_data
+=
get_properties_output
(
i
,
g_name
);
lastProp
();
...
...
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