OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
DrawParticles.hpp
1 /*
2  * DrawParticles.hpp
3  *
4  * Created on: Jan 5, 2017
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_NUMERICS_SRC_DRAW_DRAWPARTICLES_HPP_
9 #define OPENFPM_NUMERICS_SRC_DRAW_DRAWPARTICLES_HPP_
10 
11 #include "PointIterator.hpp"
12 #include "PointIteratorSkin.hpp"
13 #include "Vector/vector_dist.hpp"
14 
23 {
24 public:
25 
46  template<unsigned int dim, typename T, typename aggr, typename layout, template<typename> class layout_base ,typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
48  size_t (& sz)[dim],
49  Box<dim,T> & domain,
50  Box<dim,T> & sub_A,
51  Box<dim,T> & sub_B)
52  {
53  size_t bc[dim];
54 
55  for (size_t i = 0 ; i < dim ; i++)
56  bc[i] = NON_PERIODIC;
57 
58  return PointIteratorSkin<dim,T,Decomposition>(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A, sub_B, bc);
59  }
60 
61 
82  template<unsigned int dim, typename T, typename aggr, typename layout, template <typename> class layout_base, typename Decomposition> static PointIteratorSkin<dim,T,Decomposition>
84  size_t (& sz)[dim],
85  Box<dim,T> & domain,
86  openfpm::vector<Box<dim,T>> & sub_A,
87  Box<dim,T> & sub_B)
88  {
89  size_t bc[dim];
90 
91  for (size_t i = 0 ; i < dim ; i++)
92  bc[i] = NON_PERIODIC;
93 
94  PointIteratorSkin<dim,T,Decomposition> it(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A.get(0), sub_B, bc);
95 
96  for (size_t i = 1 ; i < sub_A.size() ; i++)
97  it.addBoxA(Box<dim,T>(sub_A.get(i)));
98 
99  return it;
100  }
101 
120  template<unsigned int dim, typename T, typename aggr, typename layout, template <typename> class layout_base, typename Decomposition> static PointIterator<dim,T,Decomposition>
122  size_t (& sz)[dim],
123  Box<dim,T> & domain,
124  Box<dim,T> & sub)
125  {
126  return PointIterator<dim,T,Decomposition>(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub);
127  }
128 
129 };
130 
131 
132 #endif /* OPENFPM_NUMERICS_SRC_DRAW_DRAWPARTICLES_HPP_ */
static PointIteratorSkin< dim, T, Decomposition > DrawSkin(vector_dist< dim, T, aggr, layout, layout_base, Decomposition > &vd, size_t(&sz)[dim], Box< dim, T > &domain, Box< dim, T > &sub_A, Box< dim, T > &sub_B)
Draw particles in a box B excluding the area of a second box A (B - A)
static PointIteratorSkin< dim, T, Decomposition > DrawSkin(vector_dist< dim, T, aggr, layout, layout_base, Decomposition > &vd, size_t(&sz)[dim], Box< dim, T > &domain, openfpm::vector< Box< dim, T >> &sub_A, Box< dim, T > &sub_B)
Draw particles in a box B excluding the areas of an array of boxes A_n.
this class draw particles on subset of grid-like position
A class to draw/create particles based on simple shaped.
this class draw particles on subset of grid-like position
Decomposition & getDecomposition()
Get the decomposition.
This class define the domain decomposition interface.
This class represent an N-dimensional box.
Definition: Box.hpp:56
Distributed vector.
Implementation of 1-D std::vector like structure.
Definition: map_vector.hpp:61
static PointIterator< dim, T, Decomposition > DrawBox(vector_dist< dim, T, aggr, layout, layout_base, Decomposition > &vd, size_t(&sz)[dim], Box< dim, T > &domain, Box< dim, T > &sub)
Draw particles in a box.