Commit 7857bce3 authored by incardon's avatar incardon

Release 0.9.0

parent 6aed688c
...@@ -20,8 +20,10 @@ All notable changes to this project will be documented in this file. ...@@ -20,8 +20,10 @@ All notable changes to this project will be documented in this file.
- In case of miss compilation ignore system wide installation - In case of miss compilation ignore system wide installation
- Bug in VTK writer binary in case of vectors - Bug in VTK writer binary in case of vectors
- Bug in VTK writer binary: long int are not supported removing output - Bug in VTK writer binary: long int are not supported removing output
- Bug in the constructor with stencil bigger than one
### Changed
- CellList types has changed
## [0.8.0] 28 February 2016 ## [0.8.0] 28 February 2016
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* This example show the usage of periodic grid with ghost part given in grid units to solve * This example show the usage of periodic grid with ghost part given in grid units to solve
* the following system of equations * the following system of equations
* *
* \f$\frac{\partial u}{\partial t} = D_u \nabla u -uv^2 + F(1-u)\f$ * \f$\frac{\partial u}{\partial t} = D_u \nabla u - uv^2 + F(1-u)\f$
* *
* *
* \f$\frac{\partial v}{\partial t} = D_v \nabla v -uv^2 - (F + k)v\f$ * \f$\frac{\partial v}{\partial t} = D_v \nabla v + uv^2 - (F + k)v\f$
* *
* ## Constants and functions ## * ## Constants and functions ##
* *
...@@ -201,7 +201,7 @@ int main(int argc, char* argv[]) ...@@ -201,7 +201,7 @@ int main(int argc, char* argv[])
grid_dist_id<2, double, aggregate<double,double>> Old(sz,domain,g,bc); grid_dist_id<2, double, aggregate<double,double>> Old(sz,domain,g,bc);
// New grid with the decomposition of the old grid // New grid with the decomposition of the old grid
grid_dist_id<2, double, aggregate<double,double>> New(Old.getDecomposition(),sz,domain,g); grid_dist_id<2, double, aggregate<double,double>> New(Old.getDecomposition(),sz,g);
// spacing of the grid on x and y // spacing of the grid on x and y
......
...@@ -46,8 +46,16 @@ void init(grid_dist_id<3,double,aggregate<double,double> > & Old, grid_dist_id<3 ...@@ -46,8 +46,16 @@ void init(grid_dist_id<3,double,aggregate<double,double> > & Old, grid_dist_id<3
++it; ++it;
} }
grid_key_dx<3> start({(long int)std::floor(Old.size(0)*1.55f/domain.getHigh(0)),(long int)std::floor(Old.size(1)*1.55f/domain.getHigh(1)),(long int)std::floor(Old.size(1)*1.55f/domain.getHigh(2))}); long int x_start = Old.size(0)*1.55f/domain.getHigh(0);
grid_key_dx<3> stop ({(long int)std::ceil (Old.size(0)*1.85f/domain.getHigh(0)),(long int)std::ceil (Old.size(1)*1.85f/domain.getHigh(1)),(long int)std::floor(Old.size(1)*1.85f/domain.getHigh(1))}); long int y_start = Old.size(1)*1.55f/domain.getHigh(1);
long int z_start = Old.size(1)*1.55f/domain.getHigh(2);
long int x_stop = Old.size(0)*1.85f/domain.getHigh(0);
long int y_stop = Old.size(1)*1.85f/domain.getHigh(1);
long int z_stop = Old.size(1)*1.85f/domain.getHigh(2);
grid_key_dx<3> start({x_start,y_start,z_start});
grid_key_dx<3> stop ({x_stop,y_stop,z_stop});
auto it_init = Old.getSubDomainIterator(start,stop); auto it_init = Old.getSubDomainIterator(start,stop);
while (it_init.isNext()) while (it_init.isNext())
...@@ -72,7 +80,7 @@ int main(int argc, char* argv[]) ...@@ -72,7 +80,7 @@ int main(int argc, char* argv[])
Box<3,double> domain({0.0,0.0},{2.5,2.5,2.5}); Box<3,double> domain({0.0,0.0},{2.5,2.5,2.5});
// grid size // grid size
size_t sz[3] = {128,128,128}; size_t sz[3] = {128,128,128};
// Define periodicity of the grid // Define periodicity of the grid
periodicity<3> bc = {PERIODIC,PERIODIC,PERIODIC}; periodicity<3> bc = {PERIODIC,PERIODIC,PERIODIC};
...@@ -90,11 +98,11 @@ int main(int argc, char* argv[]) ...@@ -90,11 +98,11 @@ int main(int argc, char* argv[])
double dv = 1*1e-5; double dv = 1*1e-5;
// Number of timesteps // Number of timesteps
size_t timeSteps = 17000; size_t timeSteps = 5000;
// K and F (Physical constant in the equation) // K and F (Physical constant in the equation)
double K = 0.065; double K = 0.014;
double F = 0.034; double F = 0.053;
//! \cond [init lib] \endcond //! \cond [init lib] \endcond
...@@ -186,7 +194,7 @@ int main(int argc, char* argv[]) ...@@ -186,7 +194,7 @@ int main(int argc, char* argv[])
// visualization // visualization
if (i % 60 == 0) if (i % 60 == 0)
{ {
Old.write("output",count,VTK_WRITER | FORMAT_BINARY); Old.write_frame("output",count,VTK_WRITER | FORMAT_BINARY);
count++; count++;
} }
} }
......
...@@ -404,7 +404,7 @@ int main(int argc, char* argv[]) ...@@ -404,7 +404,7 @@ int main(int argc, char* argv[])
* *
* Once we have the solution we copy it on the grid * Once we have the solution we copy it on the grid
* *
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp copy write * \snippet Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp copy write
* *
*/ */
...@@ -424,7 +424,7 @@ int main(int argc, char* argv[]) ...@@ -424,7 +424,7 @@ int main(int argc, char* argv[])
* *
* At the very end of the program we have always to de-initialize the library * At the very end of the program we have always to de-initialize the library
* *
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp fin lib * \snippet Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp fin lib
* *
*/ */
...@@ -440,7 +440,7 @@ int main(int argc, char* argv[]) ...@@ -440,7 +440,7 @@ int main(int argc, char* argv[])
* *
* # Full code # {#num_sk_inc_2D_ps_code} * # Full code # {#num_sk_inc_2D_ps_code}
* *
* \include Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp * \include Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp
* *
*/ */
} }
......
...@@ -247,7 +247,7 @@ int main(int argc, char* argv[]) ...@@ -247,7 +247,7 @@ int main(int argc, char* argv[])
Point<3,float> xp = vd.getPos(p); Point<3,float> xp = vd.getPos(p);
// Get an iterator of all the particles neighborhood of p // Get an iterator of all the particles neighborhood of p
auto Np = NN.getIterator(NN.getCell(vd.getPos(p))); auto Np = NN.getNNIterator(NN.getCell(vd.getPos(p)));
// For each particle near p // For each particle near p
while (Np.isNext()) while (Np.isNext())
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
*/ */
#include "Vector/vector_dist.hpp" #include "Vector/vector_dist.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "data_type/aggregate.hpp"
#include "Plot/GoogleChart.hpp" #include "Plot/GoogleChart.hpp"
#include "Plot/util.hpp" #include "Plot/util.hpp"
#include "timer.hpp" #include "timer.hpp"
...@@ -19,7 +17,10 @@ ...@@ -19,7 +17,10 @@
* *
* # Molecular Dynamic with Lennard-Jones potential # {#e3_md} * # Molecular Dynamic with Lennard-Jones potential # {#e3_md}
* *
* This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime * This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime.
* Particle feel each other by the potential.
*
* \f$ V(x_p,x_q) = 4( (\frac{\sigma}{r})^{12} - (\frac{\sigma}{r})^6 ) \f$
* *
* ## Constants ## * ## Constants ##
* *
...@@ -55,7 +56,7 @@ constexpr int force = 1; ...@@ -55,7 +56,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond //! \cond [calc forces] \endcond
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6, double r_cut2) template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6, double r_cut2)
{ {
//! \cond [calc forces] \endcond //! \cond [calc forces] \endcond
...@@ -81,12 +82,12 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce ...@@ -81,12 +82,12 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
/*! /*!
* *
* \page Vector_3_md Vector 3 molecular dynamic with cell-list * \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
* *
* Get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q * Get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the force based on the Lennard-Jhones potential given by * and calculate the force based on the Lennard-Jhones potential given by
* *
* \f$ F(x_p,x_q) = 24(\frac{2}{r^{13}} - \frac{1}{r^{7}}) r \f$ * \f$ F(x_p,x_q) = 24( \frac{2 \sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^{7}}) \hat{r} \f$
* *
* \see \ref e0_s_assign_pos * \see \ref e0_s_assign_pos
* *
...@@ -108,7 +109,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce ...@@ -108,7 +109,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
// Get the position xp of the particle // Get the position xp of the particle
Point<3,double> xp = vd.getPos(p); Point<3,double> xp = vd.getPos(p);
// Reset the forice counter // Reset the force counter
vd.template getProp<force>(p)[0] = 0.0; vd.template getProp<force>(p)[0] = 0.0;
vd.template getProp<force>(p)[1] = 0.0; vd.template getProp<force>(p)[1] = 0.0;
vd.template getProp<force>(p)[2] = 0.0; vd.template getProp<force>(p)[2] = 0.0;
...@@ -175,7 +176,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce ...@@ -175,7 +176,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy] \endcond //! \cond [calc energy] \endcond
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6, double r_cut2) template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6, double r_cut2)
{ {
double rc = r_cut2; double rc = r_cut2;
double shift = 2.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) ); double shift = 2.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) );
...@@ -208,7 +209,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, ...@@ -208,7 +209,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
* First we get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q * First we get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the energy based on the Lennard-Jhones potential given by * and calculate the energy based on the Lennard-Jhones potential given by
* *
* \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}}) r \f$ * \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}}) \f$
* *
* \see \ref e0_s_assign_pos * \see \ref e0_s_assign_pos
* *
...@@ -284,43 +285,24 @@ int main(int argc, char* argv[]) ...@@ -284,43 +285,24 @@ int main(int argc, char* argv[])
* *
* ## Initialization ## {#e3_md_init} * ## Initialization ## {#e3_md_init}
* *
* After we defined the two main function calc forces and calc energy, we define * After we defined the two main function calc forces and calc energy, we Initialize
* important parameters of the simulation, time step integration, * the library, we create a Box that define our domain, boundary conditions and ghost.
* Than we define important parameters of the simulation, time step integration,
* size of the box, and cut-off radius of the interaction. We also define 2 vectors * size of the box, and cut-off radius of the interaction. We also define 2 vectors
* x and y (they are like std::vector) used for statistic * x and y (they are like std::vector) used for statistic
* *
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp constants run * \snippet Vector/3_molecular_dynamic/main.cpp constants run
* *
*/ */
//! \cond [constants run] \endcond //! \cond [constants run] \endcond
double dt = 0.0005; openfpm_init(&argc,&argv);
double sigma = 0.1; double sigma = 0.1;
double r_cut = 3.0*sigma; double r_cut = 3.0*sigma;
double sigma12 = pow(sigma,12);
double sigma6 = pow(sigma,6);
openfpm::vector<double> x;
openfpm::vector<openfpm::vector<double>> y;
//! \cond [constants run] \endcond
/*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
*
* Here we Initialize the library, we create a Box that define our domain, boundary conditions and ghost
*
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp init
*
*/
//! \cond [init] \endcond
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
// we will use it do place particles on a 10x10x10 Grid like // we will use it do place particles on a 10x10x10 Grid like
size_t sz[3] = {10,10,10}; size_t sz[3] = {10,10,10};
...@@ -334,7 +316,14 @@ int main(int argc, char* argv[]) ...@@ -334,7 +316,14 @@ int main(int argc, char* argv[])
// ghost, big enough to contain the interaction radius // ghost, big enough to contain the interaction radius
Ghost<3,float> ghost(r_cut); Ghost<3,float> ghost(r_cut);
//! \cond [init] \endcond double dt = 0.0005;
double sigma12 = pow(sigma,12);
double sigma6 = pow(sigma,6);
openfpm::vector<double> x;
openfpm::vector<openfpm::vector<double>> y;
//! \cond [constants run] \endcond
/*! /*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list * \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
...@@ -370,18 +359,24 @@ int main(int argc, char* argv[]) ...@@ -370,18 +359,24 @@ int main(int argc, char* argv[])
//! \cond [vect grid] \endcond //! \cond [vect grid] \endcond
// We create the grid iterator
auto it = vd.getGridIterator(sz); auto it = vd.getGridIterator(sz);
while (it.isNext()) while (it.isNext())
{ {
// Create a new particle
vd.add(); vd.add();
// key contain (i,j,k) index of the grid
auto key = it.get(); auto key = it.get();
// The index of the grid can be accessed with key.get(0) == i, key.get(1) == j ...
// We use getLastPos to set the position of the last particle added
vd.getLastPos()[0] = key.get(0) * it.getSpacing(0); vd.getLastPos()[0] = key.get(0) * it.getSpacing(0);
vd.getLastPos()[1] = key.get(1) * it.getSpacing(1); vd.getLastPos()[1] = key.get(1) * it.getSpacing(1);
vd.getLastPos()[2] = key.get(2) * it.getSpacing(2); vd.getLastPos()[2] = key.get(2) * it.getSpacing(2);
// We use getLastProp to set the property value of the last particle we added
vd.template getLastProp<velocity>()[0] = 0.0; vd.template getLastProp<velocity>()[0] = 0.0;
vd.template getLastProp<velocity>()[1] = 0.0; vd.template getLastProp<velocity>()[1] = 0.0;
vd.template getLastProp<velocity>()[2] = 0.0; vd.template getLastProp<velocity>()[2] = 0.0;
...@@ -404,8 +399,8 @@ int main(int argc, char* argv[]) ...@@ -404,8 +399,8 @@ int main(int argc, char* argv[])
* *
* The verlet integration stepping look like this * The verlet integration stepping look like this
* *
* \f[ \vec{v}(t_{n+1/2}) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f] * \f[ \vec{v}(t_{n}+1/2) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f]
* \f[ \vec{x}(t_{n}) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f] * \f[ \vec{x}(t_{n}+1) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f]
* *
* calculate the forces from \f$ \vec{a} (t_{n}) \f$ finally * calculate the forces from \f$ \vec{a} (t_{n}) \f$ finally
* *
...@@ -465,7 +460,7 @@ int main(int argc, char* argv[]) ...@@ -465,7 +460,7 @@ int main(int argc, char* argv[])
++it3; ++it3;
} }
// Because we mooved the particles in space we have to map them and re-sync the ghost // Because we moved the particles in space we have to map them and re-sync the ghost
vd.map(); vd.map();
vd.template ghost_get<>(); vd.template ghost_get<>();
...@@ -488,7 +483,7 @@ int main(int argc, char* argv[]) ...@@ -488,7 +483,7 @@ int main(int argc, char* argv[])
++it4; ++it4;
} }
// After every iteration collect some statistic about the confoguration // After every iteration collect some statistic about the configuration
if (i % 100 == 0) if (i % 100 == 0)
{ {
// We write the particle position for visualization (Without ghost) // We write the particle position for visualization (Without ghost)
...@@ -554,6 +549,15 @@ int main(int argc, char* argv[]) ...@@ -554,6 +549,15 @@ int main(int argc, char* argv[])
// width of the line // width of the line
options.lineWidth = 1.0; options.lineWidth = 1.0;
// Resolution in x
options.width = 1280;
// Resolution in y
options.heigh = 720;
// Add zoom capability
options.more = GC_ZOOM;
// Object that draw the X Y graph // Object that draw the X Y graph
GoogleChart cg; GoogleChart cg;
......
...@@ -149,6 +149,8 @@ int main(int argc, char* argv[]) ...@@ -149,6 +149,8 @@ int main(int argc, char* argv[])
//! \cond [create multi-phase verlet] \endcond //! \cond [create multi-phase verlet] \endcond
{
// Get the cell list of the phase1 // Get the cell list of the phase1
auto CL_phase1 = phases.get(1).getCellList(r_cut); auto CL_phase1 = phases.get(1).getCellList(r_cut);
...@@ -204,6 +206,8 @@ int main(int argc, char* argv[]) ...@@ -204,6 +206,8 @@ int main(int argc, char* argv[])
++it; ++it;
} }
}
//! \cond [count part from phase0 to 1] \endcond //! \cond [count part from phase0 to 1] \endcond
/*! /*!
...@@ -311,13 +315,14 @@ int main(int argc, char* argv[]) ...@@ -311,13 +315,14 @@ int main(int argc, char* argv[])
* *
*/ */
{
//! \cond [compute sym multi-phase two phase] \endcond //! \cond [compute sym multi-phase two phase] \endcond
// Get the cell list of the phase1 // Get the cell list of the phase1
CL_phase1 = phases.get(1).getCellListSym(r_cut); auto CL_phase1 = phases.get(1).getCellListSym(r_cut);
// This function create a Verlet-list between phases 0 and 1 // This function create a Verlet-list between phases 0 and 1
NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut); auto NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut);
// Get an iterator over the real and ghost particles // Get an iterator over the real and ghost particles
it = phases.get(0).getDomainAndGhostIterator(); it = phases.get(0).getDomainAndGhostIterator();
...@@ -371,6 +376,8 @@ int main(int argc, char* argv[]) ...@@ -371,6 +376,8 @@ int main(int argc, char* argv[])
phases.get(0).ghost_put<add_,0>(); phases.get(0).ghost_put<add_,0>();
phases.get(1).ghost_put<add_,0>(); phases.get(1).ghost_put<add_,0>();
}
//! \cond [compute sym multi-phase two phase] \endcond //! \cond [compute sym multi-phase two phase] \endcond
/*! /*!
......
...@@ -12,7 +12,7 @@ constexpr int velocity = 0; ...@@ -12,7 +12,7 @@ constexpr int velocity = 0;
constexpr int force = 1; constexpr int force = 1;
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6) template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{ {
// update the Cell-list // update the Cell-list
vd.updateCellList(NN); vd.updateCellList(NN);
...@@ -73,7 +73,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce ...@@ -73,7 +73,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
} }
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6) template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{ {
double E = 0.0; double E = 0.0;
......
...@@ -45,7 +45,7 @@ constexpr int force = 1; ...@@ -45,7 +45,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond //! \cond [calc forces] \endcond
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList_hilb<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6) template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{ {
//! \cond [calc forces] \endcond //! \cond [calc forces] \endcond
...@@ -140,7 +140,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce ...@@ -140,7 +140,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy all] \endcond //! \cond [calc energy all] \endcond
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList_hilb<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6) template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{ {
double E = 0.0; double E = 0.0;
......
...@@ -148,7 +148,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ve ...@@ -148,7 +148,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ve
//! \cond [real and ghost] \endcond //! \cond [real and ghost] \endcond
// Get an iterator over particles // Get an iterator over particles
auto it2 = vd.getParticleIteratorCRS(NN.getInternalCellList()); auto it2 = vd.getParticleIteratorCRS(NN);
//! \cond [real and ghost] \endcond //! \cond [real and ghost] \endcond
...@@ -250,7 +250,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, ...@@ -250,7 +250,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
double shift = 4.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) ); double shift = 4.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) );
// Get an iterator over particles // Get an iterator over particles
auto it2 = vd.getParticleIteratorCRS(NN.getInternalCellList()); auto it2 = vd.getParticleIteratorCRS(NN);
// For each particle ... // For each particle ...
while (it2.isNext()) while (it2.isNext())
......
...@@ -912,7 +912,7 @@ int main(int argc, char* argv[]) ...@@ -912,7 +912,7 @@ int main(int argc, char* argv[])
cbar = coeff_sound * sqrt(gravity * h_swl); cbar = coeff_sound * sqrt(gravity * h_swl);
// for each particle inside the fluid box ... // for each particle inside the fluid box ...
/* while (fluid_it.isNext()) while (fluid_it.isNext())
{ {
// ... add a particle ... // ... add a particle ...
vd.add(); vd.add();
...@@ -946,8 +946,7 @@ int main(int argc, char* argv[]) ...@@ -946,8 +946,7 @@ int main(int argc, char* argv[])
// next fluid particle // next fluid particle
++fluid_it; ++fluid_it;
}*/ }
// Recipient // Recipient
Box<3,double> recipient1({0.0,0.0,0.0},{1.6+dp/2.0,0.67+dp/2.0,0.4+dp/2.0}); Box<3,double> recipient1({0.0,0.0,0.0},{1.6+dp/2.0,0.67+dp/2.0,0.4+dp/2.0});
...@@ -1010,10 +1009,6 @@ int main(int argc, char* argv[]) ...@@ -1010,10 +1009,6 @@ int main(int argc, char* argv[])
vd.map(); vd.map();
vd.write("Recipient");
return 0;
// Now that we fill the vector with particles // Now that we fill the vector with particles
ModelCustom md; ModelCustom md;
......
openfpm_data @ 2c313203
Subproject commit 3a732c98d6404fd81529c25af4fbf33f8ca3de9c Subproject commit 2c31320305af04b0621d2a10818354d064ec1bbf
openfpm_devices @ 9817279e
Subproject commit add2acfe9623e6045da1e41adbab6dc57ef50e5f Subproject commit 9817279ee3ac36b435d2178e994ab314a01aab30
openfpm_io @ 9b0500dd
Subproject commit a6bd0b797704f6faba662a10f5b101c218257490 Subproject commit 9b0500dd1347d9f3d2898f2a9206220eea7907d5
openfpm_vcluster @ 7030e7f7
Subproject commit 1856e665949ecca8dbcf68e08984aace853aad8d Subproject commit 7030e7f76e5d80a297e4cc9b2d4f3ad98beb8d0f
...@@ -135,7 +135,7 @@ protected: ...@@ -135,7 +135,7 @@ protected:
//! Structure that store the cartesian grid information //! Structure that store the cartesian grid information
grid_sm<dim, void> gr_dist; grid_sm<dim, void> gr_dist;
//! Structure that decompose your structure into cell without creating them //! Structure that decompose the space into cells without creating them
//! useful to convert positions to CellId or sub-domain id in this case //! useful to convert positions to CellId or sub-domain id in this case
CellDecomposer_sm<dim, T, shift<dim,T>> cd; CellDecomposer_sm<dim, T, shift<dim,T>> cd;
...@@ -1724,6 +1724,16 @@ public: ...@@ -1724,6 +1724,16 @@ public:
return dist.get_ndec(); return dist.get_ndec();
} }
/*! \brief Get the cell decomposer of the decomposition
*
* \return the cell decomposer
*
*/
const CellDecomposer_sm<dim, T, shift<dim,T>> & getCellDecomposer()
{
return cd;
}
//! friend classes //! friend classes
friend extended_type; friend extended_type;
......