Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_io
Commits
1cd82555
Commit
1cd82555
authored
May 19, 2021
by
absingh
Browse files
Fixing pvtp writer after merge from FD_solver
parent
7cd835c3
Pipeline
#3068
failed with stages
in 23 minutes and 8 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
src/VTKWriter/VTKWriter_grids_util.hpp
View file @
1cd82555
...
...
@@ -135,6 +135,85 @@ template<unsigned int i, typename ele_g, bool has_attributes> std::string get_po
}
/*! \brief Get the vtp properties header appending a prefix at the end
*
* \tparam has_attributes indicate if the properties have attributes name
* \param oprp prefix
*
*/
template
<
unsigned
int
i
,
typename
ele_g
,
bool
has_attributes
>
std
::
string
get_point_property_header_impl_new_pvtp
(
const
std
::
string
&
oprp
,
const
openfpm
::
vector
<
std
::
string
>
&
prop_names
)
{
//! vertex node output string
std
::
string
v_out
;
typedef
typename
boost
::
mpl
::
at
<
typename
ele_g
::
value_type
::
value_type
::
type
,
boost
::
mpl
::
int_
<
i
>>::
type
ctype
;
// Check if T is a supported format
// for now we support only scalar of native type
if
(
std
::
rank
<
ctype
>::
value
==
1
)
{
if
(
std
::
extent
<
ctype
>::
value
<=
3
)
{
//Get type of the property
std
::
string
type
=
getTypeNew
<
typename
std
::
remove_all_extents
<
ctype
>::
type
>
();
// if the type is not supported skip-it
if
(
type
.
size
()
==
0
)
{
#ifndef DISABLE_ALL_RTTI
std
::
cerr
<<
"Error "
<<
__FILE__
<<
":"
<<
__LINE__
<<
" the type "
<<
demangle
(
typeid
(
ctype
).
name
())
<<
" is not supported by vtp
\n
"
;
#endif
return
""
;
}
// Create point data properties
v_out
+=
" <PDataArray type=
\"
"
+
type
+
"
\"
Name=
\"
"
+
getAttrName
<
ele_g
,
has_attributes
>::
get
(
i
,
prop_names
,
oprp
)
+
"
\"
"
+
" NumberOfComponents=
\"
3
\"
/>
\n
"
;
//v_out += "VECTORS " + getAttrName<ele_g,has_attributes>::get(i,prop_names,oprp) + " " + type + "\n";
}
}
else
{
std
::
string
type
=
getTypeNew
<
typename
std
::
remove_all_extents
<
ctype
>::
type
>
();
// if the type is not supported return
if
(
type
.
size
()
==
0
)
{
// We check if is a custom vtk writable object
if
(
is_vtk_writable
<
ctype
>::
value
==
true
)
{
type
=
getTypeNew
<
typename
vtk_type
<
ctype
,
is_custom_vtk_writable
<
ctype
>::
value
>::
type
>
();
// We check if it is a vector or scalar like type
if
(
vtk_dims
<
ctype
>::
value
==
1
)
{
v_out
+=
" <PDataArray type=
\"
"
+
type
+
"
\"
Name=
\"
"
+
getAttrName
<
ele_g
,
has_attributes
>::
get
(
i
,
prop_names
,
oprp
)
+
"
\"
/>
\n
"
;
//v_out += "SCALARS " + getAttrName<ele_g,has_attributes>::get(i,prop_names,oprp) + " " + type + "\n";
}
else
{
v_out
+=
" <PDataArray type=
\"
"
+
type
+
"
\"
Name=
\"
"
+
getAttrName
<
ele_g
,
has_attributes
>::
get
(
i
,
prop_names
,
oprp
)
+
"
\"
"
+
" NumberOfComponents=
\"
3
\"
/>
\n
"
;
//v_out += "VECTORS " + getAttrName<ele_g,has_attributes>::get(i,prop_names,oprp) + " " + type + "\n";
}
}
return
v_out
;
}
// Create point data properties
v_out
+=
" <PDataArray type=
\"
"
+
type
+
"
\"
Name=
\"
"
+
getAttrName
<
ele_g
,
has_attributes
>::
get
(
i
,
prop_names
,
oprp
)
+
"
\"
/>
\n
"
;
//v_out += "SCALARS " + getAttrName<ele_g,has_attributes>::get(i,prop_names,oprp) + " " + type + "\n";
// Default lookup table
//v_out += "LOOKUP_TABLE default\n";
}
// return the vertex list
return
v_out
;
}
/*! \brief Get the vtk properties header appending a prefix at the end
*
* \tparam has_attributes indicate if the properties have attributes name
...
...
@@ -713,6 +792,11 @@ struct meta_prop_new
}
}
static
inline
void
get_pvtp_out
(
std
::
string
&
v_out
,
const
openfpm
::
vector
<
std
::
string
>
&
prop_names
){
v_out
+=
get_point_property_header_impl_new_pvtp
<
I
::
value
,
ele_g
,
has_attributes
<
typename
ele_g
::
value_type
::
value_type
>::
value
>
(
""
,
prop_names
);
}
};
//! Partial specialization for N=1 1D-Array
...
...
@@ -808,6 +892,12 @@ struct meta_prop_new<I, ele_g,St,T[N1],is_writable>
v_out
+=
" </DataArray>
\n
"
;
}
}
static
inline
void
get_pvtp_out
(
std
::
string
&
v_out
,
const
openfpm
::
vector
<
std
::
string
>
&
prop_names
){
v_out
+=
get_point_property_header_impl_new_pvtp
<
I
::
value
,
ele_g
,
has_attributes
<
typename
ele_g
::
value_type
::
value_type
>::
value
>
(
""
,
prop_names
);
}
};
//! Partial specialization for N=2 2D-Array
...
...
@@ -889,6 +979,12 @@ struct meta_prop_new<I, ele_g,St, T[N1][N2],is_writable>
}
}
}
static
inline
void
get_pvtp_out
(
std
::
string
&
v_out
,
const
openfpm
::
vector
<
std
::
string
>
&
prop_names
){
v_out
+=
get_point_property_header_impl_new_pvtp
<
I
::
value
,
ele_g
,
has_attributes
<
typename
ele_g
::
value_type
::
value_type
>::
value
>
(
""
,
prop_names
);
}
};
...
...
src/VTKWriter/VTKWriter_point_set.hpp
View file @
1cd82555
This diff is collapsed.
Click to expand it.
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