OpenFPM  5.2.0
Project that contain the implementation of distributed structures
DcpseInterpolation.hpp
1 //
2 // Created by Abhinav Singh on 03.11.21.
3 // Surface interpolation: Lennt Schulze and Ale Foggia on 06.03.24
4 //
5 
6 #ifndef OPENFPM_PDATA_DCPSEINTERPOLATION_HPP
7 #define OPENFPM_PDATA_DCPSEINTERPOLATION_HPP
8 #include "DCPSE/Dcpse.hpp"
9 
30 template<typename particlesSupport_type, typename particlesDomain_type, typename VerletList_type, size_t NORMAL_ID = INT_MAX>
32 {
33 
34  void *dcpse;
35 
36  particlesSupport_type & particlesSupport;
37  particlesDomain_type & particlesDomain;
38 
39 
40 public:
53  particlesSupport_type &particlesSupport,
54  particlesDomain_type &particlesDomain,
55  VerletList_type& verletList,
56  unsigned int ord,
57  typename particlesSupport_type::stype rCut,
58  support_options opt = support_options::RADIUS
59  ):
60  particlesSupport(particlesSupport),
61  particlesDomain(particlesDomain)
62  {
64 
65  dcpse = new Dcpse<
66  particlesSupport_type::dims,
67  VerletList_type,
68  particlesSupport_type,
69  particlesDomain_type>
70  (
71  particlesSupport,
72  particlesDomain,
73  verletList,
74  p,
75  ord,
76  rCut,
77  opt
78  );
79  }
80 
96  particlesSupport_type &particlesSupport,
97  particlesDomain_type &particlesDomain,
98  VerletList_type& verletList,
99  unsigned int ord,
100  typename particlesSupport_type::stype rCut,
101  typename particlesSupport_type::stype nSpacing,
102  bool isSurfaceInterpolation,
103  support_options opt = support_options::RADIUS
104  ):
105  particlesSupport(particlesSupport),
106  particlesDomain(particlesDomain)
107  {
109  p.zero();
110  dcpse = new SurfaceDcpse<particlesSupport_type::dims,VerletList_type,particlesSupport_type,particlesDomain_type>(particlesSupport, particlesDomain, verletList, p, ord, rCut, nSpacing, static_cast<unsigned int>(rCut/nSpacing), value_t<NORMAL_ID>(), opt);
111  }
112 
113  void deallocate() {
114  delete (Dcpse<particlesSupport_type::dims, VerletList_type, particlesSupport_type, particlesDomain_type> *) dcpse;
115  }
116 
117  /* template<typename operand_type>
118  vector_dist_expression_op<operand_type, Dcpse_type<operand_type::vtype::dims, typename operand_type::vtype>, VECT_DCPSE>
119  operator()(operand_type arg) {
120  typedef Dcpse_type<operand_type::vtype::dims, typename operand_type::vtype> dcpse_type;
121  return vector_dist_expression_op<operand_type, dcpse_type, VECT_DCPSE>(arg, *(dcpse_type *) dcpse);
122  }*/
123 
132  template<unsigned int propSupport,unsigned int propDomain>
133  void p2p() {
134  auto dcpse_temp = (Dcpse<particlesSupport_type::dims, VerletList_type, particlesSupport_type, particlesDomain_type>*) dcpse;
135  dcpse_temp->template p2p<propSupport,propDomain>();
136  }
137 
138  // foggia 16.09.24
148  template<unsigned int propSupport,unsigned int propDomain, size_t N1>
149  void p2p() {
150  auto dcpse_temp = (Dcpse<particlesSupport_type::dims, VerletList_type, particlesSupport_type, particlesDomain_type>*) dcpse;
151  dcpse_temp->template p2p<propSupport,propDomain,N1>();
152  }
153 
154  // template<unsigned int prp, typename particles_type>
155  // void DrawKernel(particles_type &particles, int k) {
156  // auto dcpse_temp = (Dcpse_type<particlesSupport_type::dims, VerletList_type, particlesSupport_type, particlesDomain_type> *) dcpse;
157  // dcpse_temp->template DrawKernel<prp>(particles, k);
158 
159  // }
160 
161  // template<unsigned int prp, typename particles_type>
162  // void DrawKernelNN(particles_type &particles, int k) {
163  // auto dcpse_temp = (Dcpse_type<particlesSupport_type::dims, particlesSupport_type,particlesDomain_type> *) dcpse;
164  // dcpse_temp->template DrawKernelNN<prp>(particles, k);
165 
166  // }
167 
168  // template<typename particles_type>
169  // void checkMomenta(particles_type &particles) {
170  // auto dcpse_temp = (Dcpse_type<particles_type::dims, particlesSupport_type, particlesDomain_type> *) dcpse;
171  // dcpse_temp->checkMomenta(particles);
172 
173  // }
174 
178  void update() {
179  auto dcpse_temp = (Dcpse<particlesSupport_type::dims, VerletList_type, particlesSupport_type, particlesDomain_type> *) dcpse;
180  dcpse_temp->initializeUpdate(particlesSupport,particlesDomain);
181  }
182 };
183 
184 
185 
186 #endif //OPENFPM_PDATA_DCPSEINTERPOLATION_HPP
Class to perform particle to particle interpolation using DC-PSE kernels.
void p2p()
Method to perform the particle to particle interpolation of SCALAR fields using DC-PSE kernels.
void update()
Method for Updating the DCPSE Operator by recomputing DCPSE Kernels.
PPInterpolation(particlesSupport_type &particlesSupport, particlesDomain_type &particlesDomain, VerletList_type &verletList, unsigned int ord, typename particlesSupport_type::stype rCut, support_options opt=support_options::RADIUS)
Constructor for Creating the DCPSE Operator Dx and objects and computes DCPSE Kernels.
This class implement the point shape in an N-dimensional space.
Definition: Point.hpp:28