Skip to content
Snippets Groups Projects
Commit 8633d177 authored by Abhinav Singh's avatar Abhinav Singh
Browse files

Some updates and fixes

parent ab5e15b8
No related branches found
No related tags found
1 merge request!15FD_solver to develop Upstream
......@@ -2547,6 +2547,76 @@ public:
}
};
template<template<unsigned int, typename, typename...> class Dcpse_type = Dcpse>
class Derivative_G_T {
void *dcpse;
public:
template<typename particles_type>
Derivative_G_T(particles_type &parts, unsigned int ord, typename particles_type::stype rCut,
const Point<particles_type::dims, unsigned int> &p,double oversampling_factor = dcpse_oversampling_factor,
support_options opt = support_options::RADIUS) {
dcpse = new Dcpse_type<particles_type::dims, particles_type>(parts, p, ord, rCut, oversampling_factor, opt);
}
template<typename operand_type>
vector_dist_expression_op<operand_type, Dcpse_type<operand_type::vtype::dims, typename operand_type::vtype>, VECT_DCPSE>
operator()(operand_type arg) {
typedef Dcpse_type<operand_type::vtype::dims, typename operand_type::vtype> dcpse_type;
return vector_dist_expression_op<operand_type, dcpse_type, VECT_DCPSE>(arg, *(dcpse_type *) dcpse);
}
template<typename particles_type>
void checkMomenta(particles_type &particles) {
auto dcpse_temp = (Dcpse_type<particles_type::dims, particles_type> *) dcpse;
dcpse_temp->checkMomenta(particles);
}
template<unsigned int prp, typename particles_type>
void DrawKernel(particles_type &particles, int k) {
auto dcpse_temp = (Dcpse_type<particles_type::dims, particles_type> *) dcpse;
dcpse_temp->template DrawKernel<prp>(particles, k);
}
/*! \brief Method for Saving the DCPSE Operator.
*
* \param parts particle set
* \param file name for data to be saved.
*/
template<typename particles_type>
void save(particles_type &particles, const std::string &file) {
auto dcpse_temp = (Dcpse_type<particles_type::dims, particles_type> *) dcpse;
dcpse_temp->save(file);
}
/*! \brief Method for Loading the DCPSE Operator.
*
* \param parts particle set
* \param file name for data to be loaded from.
*/
template<typename particles_type>
void load(particles_type &particles, const std::string &file) {
auto dcpse_temp = (Dcpse_type<particles_type::dims, particles_type> *) dcpse;
dcpse_temp->load(file);
}
/*! \brief Method for Updating the DCPSE Operator by recomputing DCPSE Kernels.
*
*
* \param parts particle set
*/
template<typename particles_type>
void update(particles_type &particles) {
auto dcpse_temp = (Dcpse_type<particles_type::dims, particles_type> *) dcpse;
dcpse_temp->initializeUpdate(particles);
}
};
//typedef PPInterpolation_T<Dcpse> PPInterpolation;
typedef Derivative_x_T<Dcpse> Derivative_x;
typedef Derivative_y_T<Dcpse> Derivative_y;
......@@ -2569,6 +2639,8 @@ typedef Derivative_yyy_T<Dcpse> Derivative_yyy;
typedef Derivative_xxxx_T<Dcpse> Derivative_xxxx;
typedef Derivative_yyyy_T<Dcpse> Derivative_yyyy;
typedef Derivative_xxyy_T<Dcpse> Derivative_xxyy;
typedef Derivative_G_T<Dcpse> Derivative_G;
#if defined(__NVCC__)
typedef Derivative_x_T<Dcpse_gpu> Derivative_x_gpu;
......@@ -2589,6 +2661,7 @@ typedef Derivative_xxx_T<Dcpse_gpu> Derivative_xxx_gpu;
typedef Derivative_xxy_T<Dcpse_gpu> Derivative_xxy_gpu;
typedef Derivative_yyx_T<Dcpse_gpu> Derivative_yyx_gpu;
typedef Derivative_yyy_T<Dcpse_gpu> Derivative_yyy_gpu;
typedef Derivative_G_T<Dcpse_gpu> Derivative_G_gpu;
#endif
......
......@@ -75,7 +75,7 @@ private:
vector_type & particlesFrom;
vector_type2 & particlesTo;
double rCut,supportSizeFactor,nSpacing;
double rCut,supportSizeFactor=1,nSpacing;
unsigned int convergenceOrder,nCount;
bool isSurfaceDerivative=false;
......
......@@ -26,11 +26,11 @@ struct SubsetSelector_impl<true>
{
template<typename particle_type,typename subset_type>
static void check(particle_type &particles,subset_type &particle_subset){
if(particles.getMapCtr()!=particle_subset.getUpdateCtr())
//This getMapCtr needs to be created or fixed for cuda!
/* if(particles.getMapCtr()!=particle_subset.getUpdateCtr())
{
std::cerr<<__FILE__<<":"<<__LINE__<<" Error: You forgot a subset update after map."<<std::endl;
}
}*/
}
};
#endif
......
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