OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
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 vd_type>
48  DrawSkin(vd_type & vd,
49  size_t (& sz)[dim],
50  Box<dim,T> & domain,
51  Box<dim,T> & sub_A,
52  Box<dim,T> & sub_B)
53  {
54  size_t bc[dim];
55 
56  for (size_t i = 0 ; i < dim ; i++)
57  bc[i] = NON_PERIODIC;
58 
59  return PointIteratorSkin<dim,T,typename vd_type::Decomposition_type>(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A, sub_B, bc);
60  }
61 
62 
83  template<unsigned int dim, typename T, typename vd_type>
85  DrawSkin(vd_type & vd,
86  size_t (& sz)[dim],
87  Box<dim,T> & domain,
88  openfpm::vector<Box<dim,T>> & sub_A,
89  Box<dim,T> & sub_B)
90  {
91  size_t bc[dim];
92 
93  for (size_t i = 0 ; i < dim ; i++)
94  bc[i] = NON_PERIODIC;
95 
96  PointIteratorSkin<dim,T,typename vd_type::Decomposition_type> it(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub_A.get(0), sub_B, bc);
97 
98  for (size_t i = 1 ; i < sub_A.size() ; i++)
99  it.addBoxA(Box<dim,T>(sub_A.get(i)));
100 
101  return it;
102  }
103 
122  template<unsigned int dim, typename T, typename vd_type> static PointIterator<dim,T,typename vd_type::Decomposition_type>
123  DrawBox(vd_type & vd,
124  size_t (& sz)[dim],
125  Box<dim,T> & domain,
126  Box<dim,T> & sub)
127  {
128  return PointIterator<dim,T,typename vd_type::Decomposition_type>(vd.getDecomposition(),sz,vd.getDecomposition().getDomain(),sub);
129  }
130 
131 };
132 
133 
134 #endif /* OPENFPM_NUMERICS_SRC_DRAW_DRAWPARTICLES_HPP_ */
static PointIteratorSkin< dim, T, typename vd_type::Decomposition_type > DrawSkin(vd_type &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
static PointIteratorSkin< dim, T, typename vd_type::Decomposition_type > DrawSkin(vd_type &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)
This class represent an N-dimensional box.
Definition: Box.hpp:60
static PointIterator< dim, T, typename vd_type::Decomposition_type > DrawBox(vd_type &vd, size_t(&sz)[dim], Box< dim, T > &domain, Box< dim, T > &sub)
Draw particles in a box.
Implementation of 1-D std::vector like structure.
Definition: map_vector.hpp:202