Commit 7ab4e5da authored by incardon's avatar incardon

Fixing Multiphase verlet and Cell-list

parent 6c3c41c0
openfpm_data @ 8deb38db
Subproject commit cdd40c06fc9e90f9cc0875d888436ee8a903179a
Subproject commit 8deb38dbbfc01236406144fdb68b04f08231f66f
openfpm_devices @ a0b02db5
Subproject commit 90076f0c7ea6ac954d2b09fc8e84caa64024e8a6
Subproject commit a0b02db5938003755b85c86fded64b107ac4e55d
openfpm_numerics @ 2a805e31
Subproject commit dd0e4d4ddd6ff1de9ab9c54ddfe4f5657caf67a0
Subproject commit 2a805e31cd0bc1e5fe89c8f6a03ba22b1691ad2d
......@@ -85,7 +85,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_multiphase_cell_list_test )
auto CL_phase1 = phases.get(1).getCellList(r_cut);
// This function create a Verlet-list between phases 0 and 1
auto NN_ver01 = createVerlet(phases.get(0),CL_phase1,r_cut);
auto NN_ver01 = createVerlet(phases.get(0),phases.get(1),CL_phase1,r_cut);
// Check NNver0_1
......@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_multiphase_cell_list_test )
auto CL_all = createCellListM<2>(phases,r_cut);
// This create a Verlet-list between phase 0 and all the other phases
auto NNver0_all = createVerletM<2>(phases.get(0),CL_all,r_cut);
auto NNver0_all = createVerletM<2>(phases.get(0),phases,CL_all,r_cut);
it = phases.get(0).getDomainIterator();
......@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_multiphase_cell_list_sym_test )
auto CL_phase1 = phases.get(1).getCellListSym(r_cut);
// This function create a Verlet-list between phases 0 and 1
auto NN_ver01 = createVerletSym(phases.get(0),CL_phase1,r_cut);
auto NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut);
// Check NNver0_1
......@@ -305,15 +305,15 @@ BOOST_AUTO_TEST_CASE( vector_dist_multiphase_cell_list_sym_test )
// This function create an "Empty" Multiphase Cell List
auto CL_all = createCellListSymM<2>(phases,r_cut);
typedef decltype(createVerletSymM<2>(phases.get(0),CL_all,r_cut)) verlet_type;
typedef decltype(createVerletSymM<2>(phases.get(0),phases,CL_all,r_cut)) verlet_type;
verlet_type NNver_all[4];
// This create a Verlet-list between phase all phases to all the other phases
NNver_all[0] = createVerletSymM<2>(phases.get(0),CL_all,r_cut);
NNver_all[1] = createVerletSymM<2>(phases.get(1),CL_all,r_cut);
NNver_all[2] = createVerletSymM<2>(phases.get(2),CL_all,r_cut);
NNver_all[3] = createVerletSymM<2>(phases.get(3),CL_all,r_cut);
NNver_all[0] = createVerletSymM<2>(phases.get(0),phases,CL_all,r_cut);
NNver_all[1] = createVerletSymM<2>(phases.get(1),phases,CL_all,r_cut);
NNver_all[2] = createVerletSymM<2>(phases.get(2),phases,CL_all,r_cut);
NNver_all[3] = createVerletSymM<2>(phases.get(3),phases,CL_all,r_cut);
// all phases to all phases
......
......@@ -11,20 +11,25 @@
#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, CL & cl, T r_cut)
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)
{
VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> ver;
ver.Initialize(cl,r_cut,v.getPosVector(),v.size_local());
ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local());
return ver;
}
template<unsigned int sh_byte, typename Vector,typename CL, typename T> VerletListM<Vector::dims,typename Vector::stype,sh_byte,shift<Vector::dims,typename Vector::stype>> createVerletM(Vector & v, CL & cl, T r_cut)
template<unsigned int sh_byte, typename Vector , typename Vector1,typename CL, typename T> VerletListM<Vector::dims,typename Vector::stype,sh_byte,CL,shift<Vector::dims,typename Vector::stype>> createVerletM(Vector & v, Vector1 & phases, CL & cl, T r_cut)
{
VerletListM<Vector::dims,typename Vector::stype,sh_byte,shift<Vector::dims,typename Vector::stype>> ver;
VerletListM<Vector::dims,typename Vector::stype,sh_byte,CL,shift<Vector::dims,typename Vector::stype>> ver;
ver.Initialize(cl,r_cut,v.getPosVector(),v.size_local());
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()));
ver.Initialize(cl,r_cut,v.getPosVector(),v_phases,v.size_local());
return ver;
}
......@@ -65,20 +70,25 @@ 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, CL & cl, T r_cut)
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)
{
VerletList<Vector::dims,typename Vector::stype,FAST,shift<Vector::dims,typename Vector::stype>> ver;
ver.Initialize(cl,r_cut,v.getPosVector(),v.size_local());
ver.Initialize(cl,r_cut,v.getPosVector(),v1.getPosVector(),v.size_local());
return ver;
}
template<unsigned int sh_byte, typename Vector,typename CL, typename T> VerletListM<Vector::dims,typename Vector::stype,sh_byte,shift<Vector::dims,typename Vector::stype>> createVerletSymM(Vector & v, CL & cl, T r_cut)
template<unsigned int sh_byte, typename Vector, typename Vector1 ,typename CL, typename T> VerletListM<Vector::dims,typename Vector::stype,sh_byte,CL,shift<Vector::dims,typename Vector::stype>> createVerletSymM(Vector & v, Vector1 & phases, CL & cl, T r_cut)
{
VerletListM<Vector::dims,typename Vector::stype,sh_byte,shift<Vector::dims,typename Vector::stype>> ver;
VerletListM<Vector::dims,typename Vector::stype,sh_byte,CL,shift<Vector::dims,typename Vector::stype>> ver;
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()));
ver.Initialize(cl,r_cut,v.getPosVector(),v.size_local(),VL_SYMMETRIC);
ver.Initialize(cl,r_cut,v.getPosVector(),v_phases,v.size_local(),VL_SYMMETRIC);
return ver;
}
......
......@@ -7,6 +7,8 @@
#include "config.h"
#undef VERSION
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
......
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