Commit 8e39f240 authored by incardon's avatar incardon

Starting refactorization of Verlet list

parent 162d7401
......@@ -1159,13 +1159,13 @@ public:
* \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
se3.getNN();
#endif
VerletList<dim,St,FAST,shift<dim,St>> ver;
VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// Processor bounding box
Box<dim, St> pbox = getDecomposition().getProcessorBounds();
......@@ -1184,7 +1184,7 @@ public:
* \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
if (!(opt & BIND_DEC_TO_GHOST))
......@@ -1198,7 +1198,7 @@ public:
se3.getNN();
#endif
VerletList<dim,St,FAST,shift<dim,St>> ver;
VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// Processor bounding box
Box<dim, St> pbox = getDecomposition().getProcessorBounds();
......@@ -1236,13 +1236,13 @@ public:
* \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
se3.getNN();
#endif
VerletList<dim,St,FAST,shift<dim,St>> ver;
VerletList<dim,St,Mem_fast,shift<dim,St>> ver;
// get the processor bounding box
Box<dim, St> bt = getDecomposition().getProcessorBounds();
......@@ -1269,7 +1269,7 @@ public:
* \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
se3.getNN();
......@@ -1287,7 +1287,7 @@ public:
ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt);
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.swap(ver);
......@@ -1328,7 +1328,7 @@ public:
}
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.swap(ver_tmp);
......@@ -1346,7 +1346,7 @@ public:
ver.update(getDecomposition().getDomain(),r_cut,v_pos,g_m, opt);
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.swap(ver_tmp);
......
......@@ -11,9 +11,11 @@
#include "NN/CellList/CellListM.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());
......@@ -72,9 +74,11 @@ template<unsigned int nbit, typename Vector, typename T> CellListM<Vector::dims,
/////// 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());
......@@ -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;
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);
......
......@@ -1298,7 +1298,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
// 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;
......
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