Commit 5dfcba90 authored by incardon's avatar incardon

Improving documentation and fixing small bug for unsupported array in paraview

parent 4a5f8a2a
...@@ -16,7 +16,7 @@ parallel ( ...@@ -16,7 +16,7 @@ parallel (
catch (IOException e) catch (IOException e)
{ {
ntry-- ntry--
sleep(5000) sleep(50)
} }
} }
...@@ -49,7 +49,7 @@ parallel ( ...@@ -49,7 +49,7 @@ parallel (
catch (IOException e) catch (IOException e)
{ {
ntry-- ntry--
sleep(5000) sleep(50)
} }
} }
...@@ -80,7 +80,7 @@ parallel ( ...@@ -80,7 +80,7 @@ parallel (
catch (IOException e) catch (IOException e)
{ {
ntry-- ntry--
sleep(5000) sleep(50)
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_INIT(OpenFPM_io, 0.8.0, BUG-REPORT-ADDRESS)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_SRCDIR([src/main.cpp])
...@@ -79,6 +79,64 @@ else ...@@ -79,6 +79,64 @@ else
fi fi
###### Check for se-class1
AC_MSG_CHECKING(whether to build with security enhancement class1)
se_class1=no
AC_ARG_ENABLE(se-class1,
AC_HELP_STRING(
[--enable-se-class1],
[enable security enhancement class1]
),
se_class1="$enableval"
)
AC_MSG_RESULT($se_class1)
if test x"$se_class1" = x"yes"; then
AC_DEFINE([SE_CLASS1],[],[Security enhancement class 1])
fi
###### Check for se-class 2
AC_MSG_CHECKING(whether to build with security enhancement class 2)
se_class2=no
AC_ARG_ENABLE(se-class2,
AC_HELP_STRING(
[--enable-se-class2],
[enable security enhancement class 2]
),
se_class2="$enableval"
)
AC_MSG_RESULT($se_class2)
if test x"$se_class2" = x"yes"; then
AC_DEFINE([SE_CLASS2],[],[Security enhancement class 2])
fi
###### Check for se-class 3
AC_MSG_CHECKING(whether to build with security enhancement class 3)
se_class3=no
AC_ARG_ENABLE(se-class3,
AC_HELP_STRING(
[--enable-se-class3],
[enable security enhancement class 3]
),
se_class3="$enableval"
)
AC_MSG_RESULT($se_class3)
if test x"$se_class3" = x"yes"; then
AC_DEFINE([SE_CLASS3],[],[Security enhancement class 3])
fi
###### Checking for compiler flags -fext-numeric-literals ###### Checking for compiler flags -fext-numeric-literals
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
......
...@@ -50,16 +50,16 @@ void create_prop(std::string * str) ...@@ -50,16 +50,16 @@ void create_prop(std::string * str)
template<typename G> template<typename G>
struct vertex_prop struct vertex_prop
{ {
// Properties counter //! Properties counter
int cnt = 0; int cnt = 0;
// vertex properties //! vertex properties
std::string & v_prop; std::string & v_prop;
// Attribute names //! Attribute names
std::string * attributes_names; std::string * attributes_names;
// Number of attributes name defined into the vertex //! Number of attributes name defined into the vertex
int n_attr = 0; int n_attr = 0;
/*! \brief Constructor /*! \brief Constructor
...@@ -67,11 +67,9 @@ struct vertex_prop ...@@ -67,11 +67,9 @@ struct vertex_prop
* Create a vertex properties list * Create a vertex properties list
* *
* \param v_prop std::string that is filled with the graph properties in the GraphML format * \param v_prop std::string that is filled with the graph properties in the GraphML format
* \param stub SFINAE, it basically check if G has properties names defined, if yes this * \param a_name array with the names of the properties
* constructor is selected over the other one
* *
*/ */
vertex_prop(std::string & v_prop, typename G::V_type::attributes & a_name) vertex_prop(std::string & v_prop, typename G::V_type::attributes & a_name)
:v_prop(v_prop),attributes_names(a_name.name) :v_prop(v_prop),attributes_names(a_name.name)
{ {
...@@ -84,7 +82,6 @@ struct vertex_prop ...@@ -84,7 +82,6 @@ struct vertex_prop
* Create a vertex properties list * Create a vertex properties list
* *
* \param v_prop std::string that is filled with the graph properties in the GraphML format * \param v_prop std::string that is filled with the graph properties in the GraphML format
* \param n_prop number of properties
* *
*/ */
vertex_prop(std::string & v_prop) vertex_prop(std::string & v_prop)
...@@ -100,7 +97,11 @@ struct vertex_prop ...@@ -100,7 +97,11 @@ struct vertex_prop
create_prop<typename G::V_type>(attributes_names); create_prop<typename G::V_type>(attributes_names);
}; };
//! It call the functor for each member /*! It call the functor for each member
*
* \param t each member
*
*/
template<typename T> template<typename T>
void operator()(T& t) void operator()(T& t)
{ {
...@@ -143,19 +144,19 @@ struct vertex_prop ...@@ -143,19 +144,19 @@ struct vertex_prop
template<typename G> template<typename G>
struct vertex_node struct vertex_node
{ {
// Vertex object container //! Vertex object container
const typename G::V_container & vo; const typename G::V_container & vo;
// Properties counter //! Properties counter
int cnt = 0; int cnt = 0;
// vertex node string //! vertex node string
std::string & v_node; std::string & v_node;
// Attribute names //! Attribute names
std::string * attributes_names; std::string * attributes_names;
// Number of attributes name defined into the vertex //! Number of attributes name defined into the vertex
int n_attr = 0; int n_attr = 0;
/*! \brief Constructor /*! \brief Constructor
...@@ -164,7 +165,7 @@ struct vertex_node ...@@ -164,7 +165,7 @@ struct vertex_node
* *
* \param v_node std::string that is filled with the graph node definition in the GraphML format * \param v_node std::string that is filled with the graph node definition in the GraphML format
* \param n_obj object container to access its properties for example encapc<...> * \param n_obj object container to access its properties for example encapc<...>
* \param stub SFINAE, it basically check if G has properties names defined, if yes this * \param a_name stub SFINAE, it basically check if G has properties names defined, if yes this
* constructor is selected over the other one * constructor is selected over the other one
* *
*/ */
...@@ -227,7 +228,7 @@ struct vertex_node ...@@ -227,7 +228,7 @@ struct vertex_node
/*! \brief Create a new node /*! \brief Create a new node
* *
* Create a new node * \param v_c id of the node
* *
*/ */
void new_node(size_t v_c) void new_node(size_t v_c)
...@@ -250,7 +251,11 @@ struct vertex_node ...@@ -250,7 +251,11 @@ struct vertex_node
v_node += "</node>\n"; v_node += "</node>\n";
} }
//! It call the functor for each member /*! \brief It call the functor for each member
*
* \param t each member
*
*/
template<typename T> template<typename T>
void operator()(T& t) void operator()(T& t)
{ {
...@@ -288,16 +293,16 @@ struct vertex_node ...@@ -288,16 +293,16 @@ struct vertex_node
template<typename G> template<typename G>
struct edge_prop struct edge_prop
{ {
// Properties counter //! Properties counter
int cnt = 0; int cnt = 0;
// edge properties //! edge properties
std::string & e_prop; std::string & e_prop;
// Attribute names //! Attribute names
std::string * attributes_names; std::string * attributes_names;
// Number of attributes name defined into the vertex //! Number of attributes name defined into the vertex
int n_attr = 0; int n_attr = 0;
/*! \brief Constructor /*! \brief Constructor
...@@ -305,7 +310,7 @@ struct edge_prop ...@@ -305,7 +310,7 @@ struct edge_prop
* Create an edge properties list * Create an edge properties list
* *
* \param e_prop std::string that is filled with the graph properties in the GraphML format * \param e_prop std::string that is filled with the graph properties in the GraphML format
* \param stub SFINAE, it basically check if G::E_type has properties names defined, if yes this * \param a_name stub SFINAE, it basically check if G::E_type has properties names defined, if yes this
* constructor is selected over the other one * constructor is selected over the other one
* *
*/ */
...@@ -321,7 +326,6 @@ struct edge_prop ...@@ -321,7 +326,6 @@ struct edge_prop
* Create an edge properties list * Create an edge properties list
* *
* \param e_prop std::string that is filled with the graph properties in the GraphML format * \param e_prop std::string that is filled with the graph properties in the GraphML format
* \param n_prop number of properties
* *
*/ */
edge_prop(std::string & e_prop) edge_prop(std::string & e_prop)
...@@ -337,7 +341,11 @@ struct edge_prop ...@@ -337,7 +341,11 @@ struct edge_prop
create_prop<typename G::E_type>(attributes_names); create_prop<typename G::E_type>(attributes_names);
}; };
//! It call the functor for each member /*! \brief It call the functor for each member
*
* \param t each member
*
*/
template<typename T> template<typename T>
void operator()(T& t) void operator()(T& t)
{ {
...@@ -381,7 +389,7 @@ struct edge_node ...@@ -381,7 +389,7 @@ struct edge_node
//! Properties counter //! Properties counter
int cnt = 0; int cnt = 0;
// edge node string //! edge node string
std::string & e_node; std::string & e_node;
//! Attribute names //! Attribute names
...@@ -430,7 +438,9 @@ struct edge_node ...@@ -430,7 +438,9 @@ struct edge_node
/*! \brief Create a new node /*! \brief Create a new node
* *
* \param vc node number * \param v_c node number
* \param s source node id
* \param d destination node id
* *
*/ */
void new_node(size_t v_c, size_t s, size_t d) void new_node(size_t v_c, size_t s, size_t d)
...@@ -453,7 +463,11 @@ struct edge_node ...@@ -453,7 +463,11 @@ struct edge_node
e_node += "</edge>\n"; e_node += "</edge>\n";
} }
//! It call the functor for each member /*! It call the functor for each member
*
* \param t each member
*
*/
template<typename T> template<typename T>
void operator()(T& t) void operator()(T& t)
{ {
...@@ -488,6 +502,7 @@ struct edge_node ...@@ -488,6 +502,7 @@ struct edge_node
template <typename Graph> template <typename Graph>
class GraphMLWriter class GraphMLWriter
{ {
//! Graph to write
Graph & g; Graph & g;
/*! \brief It get the vertex properties list /*! \brief It get the vertex properties list
...@@ -499,7 +514,6 @@ class GraphMLWriter ...@@ -499,7 +514,6 @@ class GraphMLWriter
* \return a string that define the vertex properties in graphML format * \return a string that define the vertex properties in graphML format
* *
*/ */
std::string get_vertex_properties_list() std::string get_vertex_properties_list()
{ {
//! vertex property output string //! vertex property output string
...@@ -522,7 +536,6 @@ class GraphMLWriter ...@@ -522,7 +536,6 @@ class GraphMLWriter
* \return a string that define the edge properties in graphML format * \return a string that define the edge properties in graphML format
* *
*/ */
std::string get_edge_properties_list() std::string get_edge_properties_list()
{ {
//! edge property output string //! edge property output string
...@@ -538,6 +551,11 @@ class GraphMLWriter ...@@ -538,6 +551,11 @@ class GraphMLWriter
return e_out; return e_out;
} }
/*! \brief Get the string containing the set of vertices
*
* \return the set of vertices as string
*
*/
std::string get_vertex_list() std::string get_vertex_list()
{ {
// node counter // node counter
...@@ -575,6 +593,11 @@ class GraphMLWriter ...@@ -575,6 +593,11 @@ class GraphMLWriter
return v_out; return v_out;
} }
/*! \brief return the edge list as a string
*
* \return the edge list as string
*
*/
std::string get_edge_list() std::string get_edge_list()
{ {
// node counter // node counter
...@@ -632,7 +655,6 @@ public: ...@@ -632,7 +655,6 @@ public:
* \param name of the graph * \param name of the graph
* *
*/ */
bool write(std::string file, std::string graph_name="Graph") bool write(std::string file, std::string graph_name="Graph")
{ {
// Header for the GraphML // Header for the GraphML
......
...@@ -1115,7 +1115,7 @@ public: ...@@ -1115,7 +1115,7 @@ public:
* *
* \param file path where to write * \param file path where to write
* \param name of the graph * \param name of the graph
* \param file_type specify if it is a VTK BINARY or ASCII file [default = ASCII] * \param ft specify if it is a VTK BINARY or ASCII file [default = ASCII]
* *
*/ */
......
...@@ -1088,7 +1088,7 @@ public: ...@@ -1088,7 +1088,7 @@ public:
* *
* \param file path where to write * \param file path where to write
* \param name of the graph * \param name of the graph
* \param file_type specify if it is a VTK BINARY or ASCII file [default = ASCII] * \param ft specify if it is a VTK BINARY or ASCII file [default = ASCII]
* *
*/ */
......
...@@ -295,7 +295,7 @@ public: ...@@ -295,7 +295,7 @@ public:
* *
* \param file path where to write * \param file path where to write
* \param name of the graph * \param name of the graph
* \param file_type specify if it is a VTK BINARY or ASCII file [default = ASCII] * \param ft specify if it is a VTK BINARY or ASCII file [default = ASCII]
* *
*/ */
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
template <typename Grid> template <typename Grid>
struct cell_grid struct cell_grid
{ {
// vector of fused grids //! vector of fused grids
openfpm::vector<const Grid *> grids; openfpm::vector<const Grid *> grids;
// combination //! combination
//! (used to calculate the grid shift from the starting point of the cell)
comb<Grid::dims> cmb; comb<Grid::dims> cmb;
cell_grid() {} cell_grid() {}
...@@ -35,11 +36,13 @@ struct cell_grid ...@@ -35,11 +36,13 @@ struct cell_grid
:cmb(cmb) :cmb(cmb)
{} {}
//! copy contructor
cell_grid(const cell_grid<Grid> & cg) cell_grid(const cell_grid<Grid> & cg)
{ {
this->operator=(cg); this->operator=(cg);
} }
//! copy constructor
cell_grid(cell_grid<Grid> && cg) cell_grid(cell_grid<Grid> && cg)
{ {
this->operator=(cg); this->operator=(cg);
...@@ -76,27 +79,45 @@ struct cell_grid ...@@ -76,27 +79,45 @@ struct cell_grid
} }
}; };
/*! \brief convert a staggered element into a string for vtk write
*
* \tparam Grid type of the grid
* \tparam St space type
*
*/
template <typename Grid, typename St> template <typename Grid, typename St>
class ele_g_st class ele_g_st
{ {
public: public:
//! grid type
typedef Grid value_type; typedef Grid value_type;
//! constructor
ele_g_st(){}; ele_g_st(){};
ele_g_st(const Point<Grid::dims,St> & offset, const Point<Grid::dims,St> & spacing, const Box<Grid::dims,St> & dom) /*! \brief convert a staggered grid property into a string
*
* \param offset shift of the staggered element
* \param spacing of the grid
* \param Part of the grid that is real domain
*
*/
ele_g_st(const Point<Grid::dims,St> & offset,
const Point<Grid::dims,St> & spacing,
const Box<Grid::dims,St> & dom)
:offset(offset),spacing(spacing),dom(dom) :offset(offset),spacing(spacing),dom(dom)
{} {}
//! output string
std::string dataset; std::string dataset;
//! fused grids //! fused grids
openfpm::vector<cell_grid<Grid>> g; openfpm::vector<cell_grid<Grid>> g;
//! offset where it start //! offset where it start the grid
Point<Grid::dims,St> offset; Point<Grid::dims,St> offset;
// spacing of the grid //! spacing of the grid
Point<Grid::dims,St> spacing; Point<Grid::dims,St> spacing;
// Part of the grid that is real domain //! Part of the grid that is real domain
Box<Grid::dims,size_t> dom; Box<Grid::dims,size_t> dom;
//! Copy constructor //! Copy constructor
...@@ -113,7 +134,9 @@ public: ...@@ -113,7 +134,9 @@ public:
/*! \brief Copy the object /*! \brief Copy the object
* *
* \patam ele ele_g_st to copy * \param ele ele_g_st to copy
*
* \return itself
* *
*/ */
ele_g_st<Grid,St> & operator=(const ele_g_st & ele) ele_g_st<Grid,St> & operator=(const ele_g_st & ele)
...@@ -129,7 +152,9 @@ public: ...@@ -129,7 +152,9 @@ public:
/*! \brief Copy the object /*! \brief Copy the object
* *
* \patam ele ele_g_st to copy * \param ele ele_g_st to copy
*
* \return itself
* *
*/ */
ele_g_st<Grid,St> & operator=(ele_g_st && ele) ele_g_st<Grid,St> & operator=(ele_g_st && ele)
...@@ -221,6 +246,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS> ...@@ -221,6 +246,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
} }
/*! \brief Create the VTK point definition /*! \brief Create the VTK point definition
*
* \return the list of points
* *
*/ */
std::string get_point_list() std::string get_point_list()
...@@ -273,9 +300,11 @@ class VTKWriter<pair,VECTOR_ST_GRIDS> ...@@ -273,9 +300,11 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
return v_out.str(); return v_out.str();
} }
/* \brief Get the properties components /* \brief It generate a name for the property cell component
*
* \param k component in the cell
* *
* \return the components printed * \return property name
* *
*/ */
std::string get_prop_components(size_t k) std::string get_prop_components(size_t k)
...@@ -304,6 +333,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS> ...@@ -304,6 +333,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
* \param k component * \param k component
* \param prop property name * \param prop property name
* *
* \return the property output string for the grid
*
*/ */
std::string get_properties_output(size_t k, std::string prop_name) std::string get_properties_output(size_t k, std::string prop_name)
{ {
...@@ -462,6 +493,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS> ...@@ -462,6 +493,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
} }
/*! \brief Create the VTK vertex definition /*! \brief Create the VTK vertex definition
*
* \return the string with the vertices as string
* *
*/ */
std::string get_vertex_list() std::string get_vertex_list()
...@@ -515,7 +548,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS> ...@@ -515,7 +548,8 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
* fuse them, otherwise create a new combination and grid * fuse them, otherwise create a new combination and grid
* *
* \param id sub-domain id * \param id sub-domain id
* \param location in the cell of the grid * \param g grid to output
* \param cmb position of the grid
* *
* \return a valid slot, if does not exist it append the grid at the end with the new combination * \return a valid slot, if does not exist it append the grid at the end with the new combination
* *
...@@ -555,9 +589,15 @@ public: ...@@ -555,9 +589,15 @@ public:
* \param offset grid offset * \param offset grid offset
* \param spacing spacing of the grid * \param spacing spacing of the grid
* \param dom part of the spacethat is the domain * \param dom part of the spacethat is the domain
* \param cmb position of the grid
* *
*/ */
void add(size_t i, const typename pair::first & g, const Point<pair::first::dims,typename pair::second> & offset, const Point<pair::first::dims,typename pair::second> & spacing, const Box<pair::first::dims,typename pair::second> & dom, const comb<pair::first::dims> & cmb) void add(size_t i,
const typename pair::first & g,
const Point<pair::first::dims,typename pair::second> & offset,
const Point<pair::first::dims,typename pair::second> & spacing,
const Box<pair::first::dims,typename pair::second> & dom,
const comb<pair::first::dims> & cmb)
{ {
//! Increase the size //! Increase the size
if (i >= vg.size()) if (i >= vg.size())
...@@ -577,11 +617,15 @@ public: ...@@ -577,11 +617,15 @@ public:
* *
* \param file path where to write * \param file path where to write
* \param g_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] * \param ft specify if it is a VTK BINARY or ASCII file [default = ASCII]