diff --git a/configure.ac b/configure.ac index 66268f9e5c0a2f55f931659d16eff76ed2cee921..692988fb65e7dae465eb5e0a3a692a4cfe3b4fb0 100755 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,27 @@ else NVCCFLAGS+="$NVCCFLAGS -O3 " fi + +###### Checking for compiler flags -fext-numeric-literals + +AC_LANG_PUSH([C++]) + +my_save_cflags="$CXXFLAGS" +CXXFLAGS=-fext-numeric-literals +AC_MSG_CHECKING([whether CXX supports -fext-numeric-literals]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes]) + AM_CXXFLAGS="-fext-numeric-literals" + ], + [ + AC_MSG_RESULT([no]) + ] +) +AC_LANG_POP([C++]) +CXXFLAGS="$my_save_cflags" +AC_SUBST([AM_CXXFLAGS]) + + ####### Set location of openfpm_pdata AC_ARG_WITH([pdata], diff --git a/gc_out2_test.html b/gc_out2_test.html index 402954693c2cc9548d35ef5bc20260095293cf30..319e97c1073dc24c7157aa3fb3bafc079bb04826 100644 --- a/gc_out2_test.html +++ b/gc_out2_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_out3_test.html b/gc_out3_test.html index eb1d07d2d27d1831fc52b2ffbbad2ec02d499b6f..10eb9edf701d0be9d38a031bd44d82fb86325125 100644 --- a/gc_out3_test.html +++ b/gc_out3_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_out4_test.html b/gc_out4_test.html index 98b4c1746893bd07cf42a89b4b91123965563352..6c00c1528bd98a9e230b67e500d473a0e35e77f7 100644 --- a/gc_out4_test.html +++ b/gc_out4_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_out5_test.html b/gc_out5_test.html index 6605e48ffcdacff16e8637567367578620611fa7..d579b983fd6d526304e4da5d47013efe38fd1629 100644 --- a/gc_out5_test.html +++ b/gc_out5_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_out6_test.html b/gc_out6_test.html index a62ebd0f160664eb3fae07d52953ed854c5c9451..2f1de14b260a6846797d77efb8e7918819be2a4e 100644 --- a/gc_out6_test.html +++ b/gc_out6_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_out7_test.html b/gc_out7_test.html index be6bc85a00511d5af6e4d4b1c324de5fc02b723d..81d5a5e1310b0ba1fccd09719610b6de48cc88da 100644 --- a/gc_out7_test.html +++ b/gc_out7_test.html @@ -1,10 +1,21 @@ + -

Before first graph

-

Before second graph

-

Before third graph

+

Before first graph

+

Before second graph

+

Before third graph

At the end

diff --git a/gc_out_test.html b/gc_out_test.html index 244a681ac4d06fa6819080cf37ff11e507c10960..60c941aefd4bea476acfda2414a5267a20092f5f 100644 --- a/gc_out_test.html +++ b/gc_out_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_plot2_out_test.html b/gc_plot2_out_test.html index 3cf03222c8acd8058dadb3e00a6af2b38a8d252b..7cf93912e963e4e7fae09443a93d12a72f8a8184 100644 --- a/gc_plot2_out_test.html +++ b/gc_plot2_out_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/gc_plot_out_test.html b/gc_plot_out_test.html index 4baf5abdf68f3ac00b9dba44479eb6dc6c73d6f5..4a105cd7a115d370f2058780ad75f2951154c370 100644 --- a/gc_plot_out_test.html +++ b/gc_plot_out_test.html @@ -1,10 +1,21 @@ + -
+
diff --git a/src/CSVWriter/CSVWriter.hpp b/src/CSVWriter/CSVWriter.hpp index db86f3c911e8571d72fac9c73ef8d372cdbfef5c..974818ac64d0fa9586d5cd449e3b75d7603f50b2 100644 --- a/src/CSVWriter/CSVWriter.hpp +++ b/src/CSVWriter/CSVWriter.hpp @@ -33,10 +33,10 @@ template struct csv_prp { - // String + //! String containing the csv line constructed from an object std::stringstream & str; - // Object to write + //! Object to write Tobj & obj; /*! \brief Constructor @@ -79,8 +79,14 @@ struct csv_prp template struct csv_col { + //! String containing the colums list as string std::stringstream & str; + /*! \brief Constructor + * + * \str String where to put the colum list + * + */ csv_col(std::stringstream & str) :str(str) { @@ -113,8 +119,14 @@ struct csv_col template struct csv_col { + //! String containing the colums list as string std::stringstream & str; + /*! \brief Constructor + * + * \str String where to put the colum list + * + */ csv_col(std::stringstream & str) :str(str) { @@ -180,8 +192,8 @@ class CSVWriter /*! \brief Get the csv data section * - * \param v_pos vector that contain the positional information - * \param v_prp vector that contain the property information + * \param vp vector that contain the positional information + * \param vpr vector that contain the property information * \param offset from where to start * */ @@ -228,12 +240,11 @@ public: * \tparam prp which properties to output [default = -1 (all)] * * \param file path where to write - * \param v_pos positional vector - * \param v_prp properties vector + * \param v positional vector + * \param prp properties vector * \param offset from where to start to write * */ - bool write(std::string file, v_pos & v , v_prp & prp, size_t offset=0) { // Header for csv (colums name) diff --git a/src/GraphMLWriter/GraphMLWriter.hpp b/src/GraphMLWriter/GraphMLWriter.hpp index b96b8bb65c5f9436d61427a019c33b46326ae1de..0df9d5810439dee64d5964a5aa3212a1d2fedc64 100644 --- a/src/GraphMLWriter/GraphMLWriter.hpp +++ b/src/GraphMLWriter/GraphMLWriter.hpp @@ -375,19 +375,19 @@ struct edge_prop template struct edge_node { - // Vertex object container + //! Vertex object container typename G::E_container & vo; - // Properties counter + //! Properties counter int cnt = 0; // edge node string std::string & e_node; - // Attribute names + //! Attribute 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; /*! \brief Constructor @@ -396,8 +396,7 @@ struct edge_node * * \param e_node std::string that is filled with the graph node definition in the GraphML format * \param n_obj object container to access the object properties for example encapc<...> - * \param stub SFINAE, it basically check if G has properties names defined, if yes this - * constructor is selected over the other one + * \param a_name attributes names * */ edge_node(std::string & e_node, typename G::E_container & n_obj, typename G::E_type::attributes & a_name) @@ -413,7 +412,6 @@ struct edge_node * * \param e_node std::string that is filled with the graph properties in the GraphML format * \param n_obj object container to access the object properties for example encapc<...> - * \param n_prop number of properties * */ edge_node(std::string & e_node, typename G::E_container & n_obj) diff --git a/src/HDF5_XdmfWriter/HDF5_XdmfWriter_point_set.hpp b/src/HDF5_XdmfWriter/HDF5_XdmfWriter_point_set.hpp index e88efc8b91be5481fe6a09cfb9c424185123da10..161acfaaa9089d177e9d017a34d816469b12c14f 100644 --- a/src/HDF5_XdmfWriter/HDF5_XdmfWriter_point_set.hpp +++ b/src/HDF5_XdmfWriter/HDF5_XdmfWriter_point_set.hpp @@ -102,9 +102,6 @@ struct H5_prop_out template <> class HDF5_XdmfWriter { - // Time step - int t; - //! HDF5 file hid_t file_id; @@ -116,7 +113,6 @@ public: * */ HDF5_XdmfWriter() - :t(0) {} diff --git a/src/Makefile.am b/src/Makefile.am index e27999701a7b148461013bf10f71aeffad19001b..8426acdc84ac648f79df2157639ee1b0b3f3b44d 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,7 @@ LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_IOSTREAMS_LIB) $(BOOST_LDFLAGS) noinst_PROGRAMS = io io_SOURCES = main.cpp ../../openfpm_vcluster/src/VCluster.cpp ../../openfpm_devices/src/memory/HeapMemory.cpp ../../openfpm_devices/src/Memleak_check.cpp -io_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include $(HDF5_CPPFLAGS) +io_CXXFLAGS = $(AM_CXXFLAGS) $(CUDA_CFLAGS) $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include $(HDF5_CPPFLAGS) io_CFLAGS = $(CUDA_CFLAGS) io_LDADD = $(LINKLIBS) diff --git a/src/Plot/GoogleChart.hpp b/src/Plot/GoogleChart.hpp index 2f45b1176c55f5d694ff8e0efa5b138c12cdc0e9..3e6d774cfce171f681cc3fffc4b7c12357fd956d 100644 --- a/src/Plot/GoogleChart.hpp +++ b/src/Plot/GoogleChart.hpp @@ -41,7 +41,10 @@ struct GCoptions //! with a line std::string stypeext; + //! width of the graph in pixels size_t width=900; + + //! height of the graph in pixels size_t heigh=500; //! Flag that specify if the colums are stacked @@ -65,6 +68,7 @@ struct GCoptions //! curve type std::string curveType = "function"; + //! copy operator GCoptions & operator=(const GCoptions & opt) { title = opt.title; @@ -85,16 +89,16 @@ struct GCoptions struct GGraph { - // TypeOfGraph + //! TypeOfGraph size_t type; - // data + //! data std::string data; - // option + //! option std::string option; - // Google chart option + //! Google chart option GCoptions opt; }; @@ -103,10 +107,21 @@ struct GGraph const std::string begin_data ="\n\ \n\ \n\ + \n\ \n\ const std::string div_end = "\n\ \n"; +const std::string saving_javascript = "function save(i)\n\ + var e = document.getElementById('chart_')\n\ + e.getElementsByTagName('svg')[0].parentNode.innerHTML"; + ///////////////////////////////////////////////////////////////////// /*! \brief Small class to produce graph with Google chart in HTML @@ -152,17 +171,22 @@ const std::string div_end = "\n\ */ class GoogleChart { - // set of graphs + //! set of graphs openfpm::vector set_of_graphs; - // set inject HTML; + //! set inject HTML; openfpm::vector injectHTML; /*! \brief Given X and Y vector return the string representing the data section of the Google Chart * - * \param X vector - * \param Y vector - * \param i counter + * \tparam X type for the X coordinates + * \tparam Y type for the Y coordinates + * + * \param x vector of points on x + * \param y vector of points on y + * \param yn vector containing the name of each graph + * \param opt options to draw the graph + * \param i index of the graph we are drawing * * \return string with the data section * @@ -295,6 +319,7 @@ class GoogleChart */ void addDrawDiv(std::ofstream & of, size_t i) { + of << "$(\"#export_svg" << i << "\").on(\"click\", function (event) {exportToSVG.apply(this,[" << i << "]);});\n"; of << "var chart = new google.visualization.ComboChart(document.getElementById('chart_div"; of << i; of << "'));chart.draw(data"; @@ -306,12 +331,14 @@ class GoogleChart /*! \brief Add a div section * - * \param i id + * \param of file ofstream + * \param i id of the graph * \param gc GoogleChart option * */ void addDiv(std::ofstream & of, size_t i, const GCoptions & gc) { + of << ""; of << "
template struct vtk_dist_vertex_node { - // Vertex spatial type information + //! Vertex spatial type information typedef typename G::V_type::s_type s_type; + //! indicate if the z coordinate has been set bool z_set; + //! coordinate of the vertex node s_type (&x)[3]; - // Vertex object container + //! Vertex object container typename G::V_container & vo; - // vertex node string + //! vertex position converted to string std::string & v_node; /*! \brief Constructor @@ -109,6 +111,7 @@ struct vtk_dist_vertex_node * * \param v_node std::string that is filled with the graph properties in the GraphML format * \param n_obj object container to access its properties for example encapc<...> + * \param x position of the vertex * */ vtk_dist_vertex_node(std::string & v_node, typename G::V_container & n_obj, s_type (&x)[3]) @@ -151,10 +154,10 @@ struct vtk_dist_vertex_node template struct vtk_dist_vertex_node { - // Vertex object container + //! Vertex object container typename G::V_container & vo; - // vertex node string + //! vertex position string std::string & v_node; /*! \brief Constructor @@ -169,7 +172,6 @@ struct vtk_dist_vertex_node vo(n_obj), v_node(v_node) { } - ; //! It call the functor for each member template @@ -191,10 +193,10 @@ struct vtk_dist_vertex_node template struct vtk_dist_edge_node { - // Vertex object container + //! Vertex object container typename G::E_container & vo; - // edge node string + //! edge node string std::string & e_node; /*! \brief Constructor @@ -203,21 +205,21 @@ struct vtk_dist_edge_node * * \param e_node std::string that is filled with the graph properties in the GraphML format * \param n_obj object container to access the object properties for example encapc<...> - * \param n_prop number of properties * */ - vtk_dist_edge_node(std::string & e_node, typename G::E_container & n_obj) : - vo(n_obj), e_node(e_node) + vtk_dist_edge_node(std::string & e_node, typename G::E_container & n_obj) + :vo(n_obj), e_node(e_node) { } - ; - /*! \brief Create a new node + /*! \brief Create an edge * - * \param vc node number + * \param vc node id + * \param s source node + * \param d destination node * */ - void new_node(size_t v_c, size_t s, size_t d) + void new_node(size_t vc, size_t s, size_t d) { // start a new node e_node += "2 " + std::to_string(s) + " " + std::to_string(d) + "\n"; @@ -290,11 +292,11 @@ struct dist_prop_output_array_scalar_selector_edge * * \tparam ele_v Property element * \tparam Graph Graph of reference - * \tparam i Property id + * \tparam i Property id for the edge * * \param v_out Buffer to write into * \param g Graph - * \param p Property id + * \param edge edge object */ template static inline void write(std::string &v_out, const Graph &g, const typename Graph::E_container &edge) @@ -317,7 +319,7 @@ struct dist_prop_output_array_scalar_selector_edge * * \param v_out Buffer to write into * \param g Graph - * \param p Property id + * \param edge edge object */ template static inline void write(std::string &v_out, const Graph &g, const typename Graph::E_container &edge) @@ -391,8 +393,9 @@ public: * * \tparam i vertex property to print * + * \param g graph to output + * */ - static std::string get_point_data(const Graph & g) { //! vertex node output string @@ -418,6 +421,8 @@ public: * * \tparam i edge property to print * + * \param g graph to output + * */ static std::string get_cell_data(const Graph & g) @@ -457,11 +462,9 @@ public: /*! \brief Given a Graph return the point data header for a typename T * - * \tparam T type to write - * \param n_node number of the node + * \param prop property id * */ - static std::string get_point_property_header(size_t prop) { //! vertex node output string @@ -508,11 +511,11 @@ public: /*! \brief Given a Graph return the cell data header for a typename T * - * \tparam T type to write - * \param n_node number of the node + * \param prop property number + * + * \return the cell string header * */ - static std::string get_cell_property_header(size_t prop) { //! edge node output string @@ -558,18 +561,20 @@ public: } /*! \brief Get the attributes name for vertex + * + * \return string with the attribute name * */ - static std::string get_attributes_vertex() { return Graph::V_type::attributes::name[i]; } /*! \brief Get the attributes name for edge + * + * \return the attribute name for the edge * */ - static std::string get_attributes_edge() { return Graph::E_type::attributes::name[i]; @@ -592,12 +597,11 @@ public: template class dist_prop_output { - /*! \brief For each vertex set the value + /*! \brief For each vertex output the property string * - * \tparam i vertex property to print + * \param g graph to print * */ - static std::string get_point_data(Graph & g) { //! vertex node output string @@ -619,9 +623,9 @@ class dist_prop_output return v_out; } - /*! \brief For each edge set the value + /*! \brief For each edge output the property string * - * \tparam i edge property to print + * \param graph to print * */ @@ -661,13 +665,11 @@ class dist_prop_output /*! \brief Given a Graph return the point data header for a typename T * - * \tparam T type to write - * - * \param n_node number of the node * \param prop id of the property * + * \return the string containing the header + * */ - static std::string get_point_property_header(size_t prop) { //! vertex node output string @@ -696,10 +698,11 @@ class dist_prop_output /*! \brief Given a Graph return the cell data header for a typename T * - * \param n_node number of the node + * \param prop property id + * + * \return the string containing the header * */ - static std::string get_cell_property_header(size_t prop) { //! edge node output string @@ -745,18 +748,20 @@ class dist_prop_output } /*! \brief Get the attributes name for vertex + * + * \return the string containing the vertex attribute name * */ - static std::string get_attributes_vertex() { return Graph::V_type::attributes::name[i]; } /*! \brief Get the attributes name for edge + * + * \return the edge attribute name * */ - static std::string get_attributes_edge() { return Graph::E_type::attributes::name[i]; @@ -779,22 +784,22 @@ class dist_prop_output template struct dist_prop_out_vertex { - // property output string + //! property output string std::string & v_out; - // Graph that we are processing + //! Graph that we are processing const Graph & g; /*! \brief constructor * * \param v_out string to fill with the vertex properties + * \param g graph to process * */ - dist_prop_out_vertex(std::string & v_out, const Graph & g) : - v_out(v_out), g(g) + dist_prop_out_vertex(std::string & v_out, const Graph & g) + :v_out(v_out), g(g) { } - ; //! It produce an output for each property template @@ -833,10 +838,10 @@ struct dist_prop_out_vertex template struct dist_prop_out_edge { - // property output string + //! property output string std::string & e_out; - // Graph that we are processing + //! Graph that we are processing const Graph & g; /*! \brief constructor @@ -882,6 +887,7 @@ struct dist_prop_out_edge template class VTKWriter { + //! Graph to output Graph & g; /*! \brief It get the vertex properties list diff --git a/src/util.hpp b/src/util.hpp index 33032a7f8f5eaed27bfc1f13a4ea076e86c44257..baead985bbad97c438fb6f4beb0b3d160456bd45 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -145,7 +145,7 @@ static inline struct RGB getColor(int group, SimpleRNG & d) col.G = 0.0; col.B = s/2 + 0.5; } - else if (group == 11) + else { col.R = s/2 + 0.5; col.G = 0.0;