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
1cd82555
Commit
1cd82555
authored
3 years ago
by
Abhinav Singh
Browse files
Options
Downloads
Patches
Plain Diff
Fixing pvtp writer after merge from FD_solver
parent
7cd835c3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3068
failed
3 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/VTKWriter/VTKWriter_grids_util.hpp
+96
-0
96 additions, 0 deletions
src/VTKWriter/VTKWriter_grids_util.hpp
src/VTKWriter/VTKWriter_point_set.hpp
+359
-359
359 additions, 359 deletions
src/VTKWriter/VTKWriter_point_set.hpp
with
455 additions
and
359 deletions
src/VTKWriter/VTKWriter_grids_util.hpp
+
96
−
0
View file @
1cd82555
...
@@ -135,6 +135,85 @@ template<unsigned int i, typename ele_g, bool has_attributes> std::string get_po
...
@@ -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
/*! \brief Get the vtk properties header appending a prefix at the end
*
*
* \tparam has_attributes indicate if the properties have attributes name
* \tparam has_attributes indicate if the properties have attributes name
...
@@ -713,6 +792,11 @@ struct meta_prop_new
...
@@ -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
//! Partial specialization for N=1 1D-Array
...
@@ -808,6 +892,12 @@ struct meta_prop_new<I, ele_g,St,T[N1],is_writable>
...
@@ -808,6 +892,12 @@ struct meta_prop_new<I, ele_g,St,T[N1],is_writable>
v_out
+=
" </DataArray>
\n
"
;
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
//! Partial specialization for N=2 2D-Array
...
@@ -889,6 +979,12 @@ struct meta_prop_new<I, ele_g,St, T[N1][N2],is_writable>
...
@@ -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
);
}
};
};
...
...
This diff is collapsed.
Click to expand it.
src/VTKWriter/VTKWriter_point_set.hpp
+
359
−
359
View file @
1cd82555
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