Commit db915729 authored by incardon's avatar incardon
Browse files

Fixed build script

parent c9fb5d55
#! /bin/bash
# Make a directory in /tmp/OpenFPM_data
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-6.5/lib64"
export PATH="$PATH:/usr/local/cuda-6.5/bin"
mkdir /tmp/openfpm_data
mv * .[^.]* /tmp/openfpm_data
mv /tmp/openfpm_data OpenFPM_data
git clone git@ppmcore.mpi-cbg.de:incardon/openfpm_devices.git OpenFPM_devices
cd $"OpenFPM_data"
sh ./autogen.sh
sh ./configure
make
......@@ -27,7 +27,7 @@
#include "Vector/map_vector.hpp"
// Stub implementation
template<unsigned int dim, typename T, unsigned int impl=FAST, typename base=openfpm::vector<T>>
template<unsigned int dim, typename T, unsigned int impl=FAST, typename base=openfpm::vector<size_t>>
class CellList
{
};
......
......@@ -115,6 +115,13 @@ public:
// Object type that the structure store
typedef T value_type;
/*! \brief Default constructor
*
*/
CellList()
{
}
/*! \brief Cell list
*
* \param box Domain where this cell list is living
......
......@@ -25,6 +25,8 @@ template<unsigned int dim ,typename T> class Point
{
public:
typedef T coord_type;
//! boost fusion that store the point
typedef boost::fusion::vector<T[dim]> type;
//! layout that interleave the properties
......
......@@ -89,6 +89,17 @@ public:
base.resize(base.size() + 1);
}
/*! \brief Erase the elements from start to end
*
* \param start element
* \param end element
*
*/
void erase(typename std::vector<T>::iterator start, typename std::vector<T>::iterator end)
{
base.erase(start,end);
}
/*! \brief Remove one entry from the vector
*
* \param keys element to remove
......@@ -99,6 +110,26 @@ public:
base.erase(base.begin() + key);
}
/*! \brief Return an std compatible iterator to the first element
*
* \return an iterator to the first element
*
*/
inline auto begin() -> decltype(base.begin())
{
return base.begin();
}
/*! \brief Return an std compatible iterator to the last element
*
* \return an iterator to the last element
*
*/
inline auto end() -> decltype(base.begin())
{
return base.end();
}
/*! \brief Get the last element
*
* \return the last element
......@@ -248,6 +279,16 @@ public:
{
return 1;
}
/*! \brief Return the pointer to the chunk of memory
*
* \return the pointer to the chunk of memory
*
*/
void * getPointer()
{
return &base[0];
}
};
......
......@@ -106,4 +106,57 @@ struct is_typedef_and_data_same<false,T>
};
};
/*! \brief this class is a functor for "for_each" algorithm
*
* This class is a functor for "for_each" algorithm. For each
* element the operator() is called. Used
* to calculate the size of the selected elements
*
* \tparam N number of properties
* \tparam v boost::fusion::vector
*
*/
template<unsigned int N, typename v>
struct el_size
{
//! total_size
size_t total_size;
//! List of properties
const size_t (& prp)[N];
/*! \brief constructor
*
* It define the copy parameters.
*
* \param key which element we are modifying
* \param grid_src grid we are updating
* \param obj object we have to set in grid_src
*
*/
el_size(const size_t (& prp)[N])
:total_size(0),prp(prp)
{};
//! It call the copy function for each property
template<typename T>
void operator()(T& t) const
{
total_size += boost::fusion::result_of::at< v,boost::mpl::int_<prp[T::value]> >::type;
}
size_t size()
{return total_size;}
};
template<unsigned int N,typename v> size_t ele_size(const size_t (& prp)[N])
{
el_size<N,v> sz(prp);
boost::mpl::for_each_ref< boost::mpl::range_c<int,0,N> >(sz);
return sz.size();
}
#endif
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