Commit 8e39f240 authored by incardon's avatar incardon

Starting refactorization of Verlet list

parent 162d7401
...@@ -1159,13 +1159,13 @@ public: ...@@ -1159,13 +1159,13 @@ public:
* \return the verlet list * \return the verlet list
* *
*/ */
VerletList<dim,St,FAST,shift<dim,St> > getVerletSym(St r_cut) VerletList<dim,St,Mem_fast,shift<dim,St> > getVerletSym(St r_cut)
{ {
#ifdef SE_CLASS3 #ifdef SE_CLASS3
se3.getNN(); se3.getNN();
#endif #endif
VerletList<dim,St,FAST,shift<dim,St>> ver; VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// Processor bounding box // Processor bounding box
Box<dim, St> pbox = getDecomposition().getProcessorBounds(); Box<dim, St> pbox = getDecomposition().getProcessorBounds();
...@@ -1184,7 +1184,7 @@ public: ...@@ -1184,7 +1184,7 @@ public:
* \return the verlet list * \return the verlet list
* *
*/ */
VerletList<dim,St,FAST,shift<dim,St> > getVerletCrs(St r_cut) VerletList<dim,St,Mem_fast,shift<dim,St> > getVerletCrs(St r_cut)
{ {
#ifdef SE_CLASS1 #ifdef SE_CLASS1
if (!(opt & BIND_DEC_TO_GHOST)) if (!(opt & BIND_DEC_TO_GHOST))
...@@ -1198,7 +1198,7 @@ public: ...@@ -1198,7 +1198,7 @@ public:
se3.getNN(); se3.getNN();
#endif #endif
VerletList<dim,St,FAST,shift<dim,St>> ver; VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// Processor bounding box // Processor bounding box
Box<dim, St> pbox = getDecomposition().getProcessorBounds(); Box<dim, St> pbox = getDecomposition().getProcessorBounds();
...@@ -1236,13 +1236,13 @@ public: ...@@ -1236,13 +1236,13 @@ public:
* \return a VerletList object * \return a VerletList object
* *
*/ */
VerletList<dim,St,FAST,shift<dim,St> > getVerlet(St r_cut) VerletList<dim,St,Mem_fast,shift<dim,St> > getVerlet(St r_cut)
{ {
#ifdef SE_CLASS3 #ifdef SE_CLASS3
se3.getNN(); se3.getNN();
#endif #endif
VerletList<dim,St,FAST,shift<dim,St>> ver; VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// get the processor bounding box // get the processor bounding box
Box<dim, St> bt = getDecomposition().getProcessorBounds(); Box<dim, St> bt = getDecomposition().getProcessorBounds();
...@@ -1269,7 +1269,7 @@ public: ...@@ -1269,7 +1269,7 @@ public:
* \param opt option like VL_SYMMETRIC and VL_NON_SYMMETRIC or VL_CRS_SYMMETRIC * \param opt option like VL_SYMMETRIC and VL_NON_SYMMETRIC or VL_CRS_SYMMETRIC
* *
*/ */
void updateVerlet(VerletList<dim,St,FAST,shift<dim,St> > & ver, St r_cut, size_t opt = VL_NON_SYMMETRIC) void updateVerlet(VerletList<dim,St,Mem_fast,shift<dim,St> > & ver, St r_cut, size_t opt = VL_NON_SYMMETRIC)
{ {
#ifdef SE_CLASS3 #ifdef SE_CLASS3
se3.getNN(); se3.getNN();
...@@ -1287,7 +1287,7 @@ public: ...@@ -1287,7 +1287,7 @@ public:
ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt); ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt);
else else
{ {
VerletList<dim,St,FAST,shift<dim,St> > ver_tmp; VerletList<dim,St,Mem_fast,shift<dim,St> > ver_tmp;
ver_tmp = getVerlet(r_cut); ver_tmp = getVerlet(r_cut);
ver.swap(ver); ver.swap(ver);
...@@ -1328,7 +1328,7 @@ public: ...@@ -1328,7 +1328,7 @@ public:
} }
else else
{ {
VerletList<dim,St,FAST,shift<dim,St> > ver_tmp; VerletList<dim,St,Mem_fast,shift<dim,St> > ver_tmp;
ver_tmp = getVerletCrs(r_cut); ver_tmp = getVerletCrs(r_cut);
ver.swap(ver_tmp); ver.swap(ver_tmp);
...@@ -1346,7 +1346,7 @@ public: ...@@ -1346,7 +1346,7 @@ public:
ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt); ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt);
else else
{ {
VerletList<dim,St,FAST,shift<dim,St> > ver_tmp; VerletList<dim,St,Mem_fast,shift<dim,St> > ver_tmp;
ver_tmp = getVerlet(r_cut); ver_tmp = getVerlet(r_cut);
ver.swap(ver_tmp); ver.swap(ver_tmp);
......
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
#include "NN/CellList/CellListM.hpp" #include "NN/CellList/CellListM.hpp"
#include "NN/VerletList/VerletListM.hpp" #include "NN/VerletList/VerletListM.hpp"
template<typename Vector, typename CL, typename T> VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> createVerlet(Vector & v, Vector & v1, CL & cl, T r_cut) template<typename Vector, typename CL, typename T>
VerletList<Vector::dims,typename Vector::stype,Mem_fast,shift<Vector::dims,typename Vector::stype>>
createVerlet(Vector & v, Vector & v1, CL & cl, T r_cut)
{ {
VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> ver; VerletList<Vector::dims,typename Vector::stype,Mem_fast,shift<Vector::dims,typename Vector::stype>> ver;
ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local()); ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local());
...@@ -72,9 +74,11 @@ template<unsigned int nbit, typename Vector, typename T> CellListM<Vector::dims, ...@@ -72,9 +74,11 @@ template<unsigned int nbit, typename Vector, typename T> CellListM<Vector::dims,
/////// Symmetric version /////// Symmetric version
template<typename Vector,typename CL, typename T> VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> createVerletSym(Vector & v, Vector & v1, CL & cl, T r_cut) template<typename Vector,typename CL, typename T>
VerletList<Vector::dims,typename Vector::stype,Mem_fast,shift<Vector::dims,typename Vector::stype>>
createVerletSym(Vector & v, Vector & v1, CL & cl, T r_cut)
{ {
VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> ver; VerletList<Vector::dims,typename Vector::stype,Mem_fast,shift<Vector::dims,typename Vector::stype>> ver;
ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local()); ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local());
...@@ -88,7 +92,7 @@ template<unsigned int sh_byte, typename Vector, typename Vector1 ,typename CL, t ...@@ -88,7 +92,7 @@ template<unsigned int sh_byte, typename Vector, typename Vector1 ,typename CL, t
openfpm::vector<pos_v<Vector::dims,typename Vector::stype>> v_phases; openfpm::vector<pos_v<Vector::dims,typename Vector::stype>> v_phases;
for (size_t i = 0 ; i < phases.size() ; i++) for (size_t i = 0 ; i < phases.size() ; i++)
v_phases.add(pos_v<Vector::dims,typename Vector::stype>(phases.get(i).getPosVector())); {v_phases.add(pos_v<Vector::dims,typename Vector::stype>(phases.get(i).getPosVector()));}
ver.Initialize(cl,pp,r_cut,v.getPosVector(),v_phases,v.size_local(),VL_SYMMETRIC); ver.Initialize(cl,pp,r_cut,v.getPosVector(),v_phases,v.size_local(),VL_SYMMETRIC);
......
...@@ -1298,7 +1298,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test ) ...@@ -1298,7 +1298,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
// Create a verlet list for each particle // Create a verlet list for each particle
VerletList<3,float,FAST,shift<3,float>> verlet = vd.getVerlet(third_dist); VerletList<3,float,Mem_fast,shift<3,float>> verlet = vd.getVerlet(third_dist);
bool correct = true; bool correct = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment