Skip to content
Snippets Groups Projects
Commit 7d5a921e authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Starting refactorization of Verlet list

parent 4ae52add
No related branches found
No related tags found
No related merge requests found
......@@ -368,7 +368,7 @@ struct unpack_simple_cond<true, prp ...>
// destination object type
typedef encapc<1,prp_object,typename dtype::layout_type > encap_dst;
pack_with_iterator<!is_contiguos<prp...>::type::value || has_pack_gen<prp_object>::value,
pack_with_iterator<sizeof...(prp) != T::max_prop || has_pack_gen<prp_object>::value,
dims,
decltype(*this),
encap_src,
......
......@@ -199,31 +199,38 @@ public:
return box;
}
/*! \brief Reset the dimension of the grid
/*! \brief Return the box enclosing the grid
*
* \param dims store on each dimension the size of the grid
* While getBox return as P2 the size of the grid
* getBoxKey return the size - 1 equivalent to the maximum valid point
* that does not overflow the grid
*
* \return the box
*
*/
inline void setDimensions(const size_t (& dims)[N])
inline const Box<N,size_t> getBoxKey() const
{
Initialize(dims);
size_tot = totalSize(dims);
Box<N,size_t> bx;
for (size_t i = 0 ; i < N ; i++)
{
bx.setLow(i,box.getLow(i));
bx.setHigh(i,box.getHigh(i) - 1);
}
return bx;
}
/*! \brief Is linearize additive
*
* Is linearize a linear function, in this case for stride return true
* because linearize respect the property
*
* Linearize(key1 + key2) = Linearize(key1) + Linearize(key2)
*
/*! \brief Reset the dimension of the grid
*
* \param dims store on each dimension the size of the grid
*
*/
/* inline bool isLinearizeLinear()
inline void setDimensions(const size_t (& dims)[N])
{
return true;
}*/
Initialize(dims);
size_tot = totalSize(dims);
}
/*! \brief Default constructor
*
......
......@@ -27,15 +27,15 @@ typedef unsigned int local_index_;
* \see CellList<dim,T,FAST,transform,base>
*
*/
template<unsigned int dim,
/*template<unsigned int dim,
typename T,
unsigned int impl=FAST,
typename impl=Mem_fast,
typename transform = no_transform<dim,T>,
typename local_index=local_index_,
typename CellListImpl = CellList<dim,T,Mem_fast,transform> >
class VerletList
{
};
};*/
#include "VerletListFast.hpp"
......
......@@ -272,8 +272,13 @@ public:
* \snippet VerletList_test.hpp usage of verlet
*
*/
template<unsigned int dim, typename T, typename transform, typename local_index, typename CellListImpl>
class VerletList<dim,T,FAST,transform,local_index,CellListImpl>
template<unsigned int dim,
typename T,
typename Mem_type = Mem_fast,
typename transform = no_transform<dim,T>,
typename local_index = local_index_,
typename CellListImpl = CellList<dim,T,Mem_fast,transform> >
class VerletList/*: private Mem_type*/
{
protected:
......@@ -701,14 +706,14 @@ public:
{};
//! Copy constructor
VerletList(const VerletList<dim,T,FAST,transform,local_index,CellListImpl> & cell)
VerletList(const VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> & cell)
:slot(VERLET_STARTING_NSLOT)
{
this->operator=(cell);
}
//! Copy constructor
VerletList(VerletList<dim,T,FAST,transform,local_index,CellListImpl> && cell)
VerletList(VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> && cell)
:slot(VERLET_STARTING_NSLOT),n_dec(0)
{
this->operator=(cell);
......@@ -785,7 +790,8 @@ public:
* \return itself
*
*/
VerletList<dim,T,FAST,transform,local_index,CellListImpl> & operator=(VerletList<dim,T,FAST,transform,local_index,CellListImpl> && vl)
VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> &
operator=(VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> && vl)
{
slot = vl.slot;
......@@ -807,7 +813,7 @@ public:
* \return itself
*
*/
VerletList<dim,T,FAST,transform,local_index,CellListImpl> & operator=(const VerletList<dim,T,FAST,transform,local_index,CellListImpl> & vl)
VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> & operator=(const VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> & vl)
{
slot = vl.slot;
......@@ -852,7 +858,7 @@ public:
* \param vl Verlet list with witch you swap the memory
*
*/
inline void swap(VerletList<dim,T,FAST,transform,local_index,CellListImpl> & vl)
inline void swap(VerletList<dim,T,Mem_type,transform,local_index,CellListImpl> & vl)
{
cl_n.swap(vl.cl_n);
cl_base.swap(vl.cl_base);
......@@ -878,9 +884,10 @@ public:
* \return an interator across the neighborhood particles
*
*/
template<unsigned int impl=NO_CHECK> inline VerletNNIterator<dim,VerletList<dim,T,FAST,transform,local_index,CellListImpl>> getNNIterator(size_t part_id)
template<unsigned int impl=NO_CHECK>
inline VerletNNIterator<dim,VerletList<dim,T,Mem_type,transform,local_index,CellListImpl>> getNNIterator(size_t part_id)
{
VerletNNIterator<dim,VerletList<dim,T,FAST,transform,local_index,CellListImpl>> vln(part_id,*this);
VerletNNIterator<dim,VerletList<dim,T,Mem_type,transform,local_index,CellListImpl>> vln(part_id,*this);
return vln;
}
......
......@@ -132,7 +132,12 @@ struct NNTypeM<dim,T,CellListImpl,PartIt,VL_SYMMETRIC>
* \tparam CellListImpl Base structure that store the information
*
*/
template<unsigned int dim, typename T, unsigned int sh_byte , typename CellListImpl=CellListM<dim,T,sh_byte>, typename transform = shift<dim,T>, typename VerletBase=VerletList<dim,T,FAST,transform, size_t> >
template<unsigned int dim,
typename T,
unsigned int sh_byte ,
typename CellListImpl=CellListM<dim,T,sh_byte>,
typename transform = shift<dim,T>,
typename VerletBase=VerletList<dim,T,Mem_fast,transform, size_t> >
class VerletListM : public VerletBase
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment