diff --git a/CHANGELOG.md b/CHANGELOG.md index a7c64dd8d614791a26373e5639d545886e1a184c..5042a8a437cbc7c7bf9707b0faf4714c0871d0a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,15 @@ All notable changes to this project will be documented in this file. ### Added - ghost_put support for particles -- Full-Support for complex property on vector-dist (Serialization) + example +- Full-Support for complex property on vector_dist (Serialization) +- Added examples for serialization of complex properties 4_Vector ### Fixed - Installation PETSC installation fail in case of preinstalled MPI - Miss-compilation of SUITESPARSE on gcc-6.2 - vector_dist with negative domain (Now supported) - Grid 1D has been fixed +- One constructor of Box had arguments inverted. ### Changed diff --git a/example/Vector/0_simple/main.cpp b/example/Vector/0_simple/main.cpp index 8a19b9e1d19614a02e0d2d4e86997b80696f433a..54b4fccc64e8b3cb1f00dae622b9f67ac3d363d9 100644 --- a/example/Vector/0_simple/main.cpp +++ b/example/Vector/0_simple/main.cpp @@ -4,9 +4,8 @@ * \subpage Vector_1_celllist * \subpage Vector_2_expression * \subpage Vector_3_md - * \subpage Vector_4_reo - * \subpage Vector_4_comp_reo - * \subpage Vector_4_complex_prop + * \subpage Vector_4_reo_root + * \subpage Vector_4_cp * \subpage Vector_4_mp_cl * */ diff --git a/example/Vector/4_complex_prop/main.cpp b/example/Vector/4_complex_prop/main.cpp index 028b2b33f514ea4febaaa8624da754b988c15b12..8cbae93738629279706cf69e347e5f186f002238 100644 --- a/example/Vector/4_complex_prop/main.cpp +++ b/example/Vector/4_complex_prop/main.cpp @@ -31,6 +31,16 @@ int main(int argc, char* argv[]) * * ## Initialization and vector creation ## * + * We first initialize the library and define useful constants + * + * \see \ref e0_s_init + * + * \snippet Vector/4_complex_prop/main.cpp lib init + * + * We also define a custom structure + * + * \snippet Vector/4_complex_prop/main.cpp struct A + * * After we initialize the library we can create a vector with complex properties * with the following line * @@ -66,8 +76,12 @@ int main(int argc, char* argv[]) * \warning custom data structure are allowed only if they does not have pointer. * In case they have pointer we have to define how to serialize our data-structure * + * \see \ref vector_example_cp_ser + * */ + //! \cond [lib init] \endcond + // initialize the library openfpm_init(&argc,&argv); @@ -80,23 +94,6 @@ int main(int argc, char* argv[]) // extended boundary around the domain, and the processor domain Ghost<2,float> g(0.01); - //! \cond [struct A] \endcond - - // The a custom structure - struct A - { - float p1; - int p2; - - A() {}; - - A(float p1, int p2) - :p1(p1),p2(p2) - {} - }; - - //! \cond [struct A] \endcond - // the scalar is the element at position 0 in the aggregate constexpr int scalar = 0; @@ -115,6 +112,25 @@ int main(int argc, char* argv[]) // A list of list constexpr int listlist = 5; + //! \cond [lib init] \endcond + + //! \cond [struct A] \endcond + + // The custom structure + struct A + { + float p1; + int p2; + + A() {}; + + A(float p1, int p2) + :p1(p1),p2(p2) + {} + }; + + //! \cond [struct A] \endcond + //! \cond [vect create] \endcond vector_dist<2,float, aggregate<float, @@ -137,8 +153,8 @@ int main(int argc, char* argv[]) * Assign values to properties does not changes, from the simple case. Consider * now that each particle has a list, so when we can get the property listA for particle p * and resize such list with **vd.getProp<listA>(p).resize(...)**. We can add new elements at the - * end with **vd.getProp<listA>(p).add(...)** and get some element with **vd.getProp<listA>(p).get(i)**. - * More in general from vd.getProp<listA>(p) we can use the full openfpm::vector interface. + * end with **vd.getProp<listA>(p).add(...)** and get some element of this list with **vd.getProp<listA>(p).get(i)**. + * More in general vd.getProp<listA>(p) return a reference to the openfpm::vector contained by the particle. * * \snippet Vector/4_complex_prop/main.cpp vect assign * @@ -205,11 +221,15 @@ int main(int argc, char* argv[]) * ## Mapping and ghost_get ## * * Particles are redistributed across processors all properties are communicated but instead of - * using map we use map_list that we can use to select properties. + * using map we use **map_list** that we can use to select properties. * A lot of time complex properties can be recomputed and communicate them is not a good idea. * The same concept also apply for ghost_get. In general we choose which properties to communicate * * + * \see \ref e0_s_map + * + * \see \ref e1_part_ghost + * * \snippet Vector/4_complex_prop/main.cpp vect map ghost * */ @@ -235,6 +255,8 @@ int main(int argc, char* argv[]) * Vector with complex properties can be still be visualized, because unknown properties are * automatically excluded * + * \see \ref e0_s_vis_vtk + * * \snippet Vector/4_complex_prop/main.cpp vtk * */ diff --git a/example/Vector/4_reorder/main_comp_ord.cpp b/example/Vector/4_reorder/main_comp_ord.cpp index a5bc7d48fdcdb4965e9f5977c742038384a8845d..9a9a1abf48e2597408482e2c1c1abb56cb17b851 100644 --- a/example/Vector/4_reorder/main_comp_ord.cpp +++ b/example/Vector/4_reorder/main_comp_ord.cpp @@ -6,6 +6,13 @@ #include "Plot/util.hpp" #include "timer.hpp" +/*! + * \page Vector_4_reo_root Vector 4 reordering + * \subpage Vector_4_reo + * \subpage Vector_4_comp_reo + * + */ + /*! * \page Vector_4_comp_reo Vector 4 computational reordering and cache friendliness *