Skip to content

Commit

Permalink
Merge branch 'kernel_efficiencies_fix' of https://github.com/pdziekan…
Browse files Browse the repository at this point in the history
…/libcloudphxx into kernel_efficiencies_fix
  • Loading branch information
pdziekan committed Jun 30, 2017
2 parents 8bb3ce1 + a45939f commit 6ccf6d4
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 8,289 deletions.
88 changes: 23 additions & 65 deletions src/detail/kernel_definitions/hall_efficiencies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace libcloudphxx
return 300.e-6; // not used?
}

const int hall_n_rad = 15;
const int hall_n_rad = 11;
const int hall_n_rat = 21;

template<class real_t>
Expand All @@ -20,69 +20,27 @@ namespace libcloudphxx
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_n_rat][hall_n_rad] =
{
{0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0},
{0, 0, 0.0001, 0.0001, 0.0001,
0, 0.000733, 0.001, 0.084, 0.05,
0.2543, 0.5, 0.7807, 0.87, 0.97},
{0, 0, 0.0001, 0.001733, 0.0001,
0.00563, 0.002, 0.07, 0.4, 0.43,
0.58, 0.79, 0.93, 0.96, 1},
{0, 0, 0.014, 0.001733, 0.005,
0.0156, 0.02667, 0.28, 0.62, 0.64,
0.7629, 0.91, 0.9687, 0.98, 1},
{0, 0, 0.014, 0.015, 0.016,
0.028, 0.04, 0.5, 0.7, 0.77,
0.84, 0.95, 0.95, 1, 1},
{0, 0, 0.019, 0.02117, 0.022,
0.0484, 0.1133, 0.62, 0.79, 0.84,
0.8829, 0.95, 1, 1, 1},
{0, 0, 0.019, 0.02983, 0.03,
0.1226, 0.17, 0.68, 0.83, 0.87,
0.9, 1, 1, 1, 1},
{0, 0, 0.027, 0.02983, 0.043,
0.1704, 0.3133, 0.74, 0.864, 0.89,
0.9229, 1, 1, 1, 1},
{0, 0, 0.027, 0.0395, 0.052,
0.226, 0.4, 0.78, 0.88, 0.9,
0.94, 1, 1, 1, 1},
{0, 0, 0.033, 0.04883, 0.064,
0.2708, 0.5167, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.033, 0.0555, 0.072,
0.3184, 0.55, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.037, 0.0555, 0.079,
0.3308, 0.5833, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.037, 0.0595, 0.082,
0.336, 0.59, 0.78, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.038, 0.05833, 0.08,
0.3312, 0.5667, 0.77, 0.888, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.038, 0.05367, 0.076,
0.3002, 0.54, 0.76, 0.88, 0.92,
0.95, 1, 1, 1, 1},
{0, 0, 0.036, 0.05367, 0.067,
0.2855, 0.5033, 0.77, 0.882, 0.93,
0.9743, 1, 1, 1, 1},
{0, 0, 0.036, 0.0465, 0.057,
0.2735, 0.49, 0.77, 0.89, 0.95,
1, 1, 1, 1, 1},
{0, 0, 0.032, 0.03967, 0.048,
0.2619, 0.4633, 0.78, 0.938, 1,
1.023, 1, 1, 1, 1},
{0, 0, 0.032, 0.03267, 0.04,
0.2476, 0.45, 0.79, 1.01, 1.03,
1.04, 1, 1, 1, 1},
{0, 0, 0.027, 0.03267, 0.033,
0.2559, 0.4867, 0.95, 1.5, 1.7,
2.543, 1, 1, 1, 1},
{0, 0, 0.027, 0.027, 0.027,
0.2735, 0.52, 1.4, 2.3, 3,
4, 1, 1, 1, 1}
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{.0001, .0001, .0001, .001, .005, .05, .2, .5, .77, .87, .97},
{.0001, .0001, .002, .07, .4, .43, .58, .79, .93, .96, 1.},
{.0001, .005, .02, .28, .6, .64, .75, .91, .97, .98, 1.},
{.014, .016, .04, .5, .7, .77, .84, .95, .97, 1., 1.},
{.017, .022, .085, .62, .78, .84, .88, .95, 1., 1., 1.},
{.019, .03, .17, .68, .83, .87, .9, 1., 1., 1, 1},
{.022, .043, .27, .74, .86, .89, .92, 1, 1, 1, 1},
{.027, .05, .4, .78, .88, .9, .94, 1, 1, 1, 1},
{.03, .064, .5, .8, .9, .91, .95, 1, 1, 1, 1},
{.033, .072, .55, .8, .9, .91, .95, 1, 1, 1, 1},
{.035, .079, .58, .8, .9, .91, .95, 1, 1, 1, 1},
{.037, .082, .59, .78, .9, .91, .95, 1, 1, 1, 1},
{.038, .08, .58, .77, .89, .91, .95, 1, 1, 1, 1},
{.038, .076, .54, .76, .88, .92, .95, 1, 1, 1, 1},
{.037, .067, .51, .77, .88, .93, .97, 1, 1, 1, 1},
{.036, .057, .49, .77, .89, .95, 1, 1, 1, 1, 1},
{.035, .048, .47, .78, .92, 1, 1.02, 1, 1, 1, 1},
{.032, .04, .45, .79, 1.01, 1.03, 1.04, 1., 1., 1. ,1.},
{.029, .033, .47, .95, 1.3, 1.7, 2.3, 1., 1., 1, 1},
{.027, .027, .52, 1.4, 2.3, 3, 4, 1, 1, 1, 1}
};

vec = std::vector<real_t>(&(arr[0][0]), &(arr[hall_n_rat][hall_n_rad]));
Expand All @@ -92,7 +50,7 @@ namespace libcloudphxx
void hall_radii(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_n_rad] = {6.e-6,8.e-6,10.e-6,15.e-6,20.e-6,25.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};
const real_t arr[hall_n_rad] = {10.e-6,20.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};

vec = std::vector<real_t>(arr, arr + hall_n_rad );
}
Expand Down
110 changes: 110 additions & 0 deletions src/detail/kernel_definitions/hall_efficiencies_like_in_EFM.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#pragma once
namespace libcloudphxx
{
namespace lgrngn
{
namespace detail
{
template<class real_t>
real_t hall_r_max()
{
return 300.e-6; // not used?
}

const int hall_n_rad = 15;
const int hall_n_rat = 21;

template<class real_t>
void hall_efficiencies(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_n_rat][hall_n_rad] =
{
{0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0},
{0, 0, 0.0001, 0.0001, 0.0001,
0, 0.000733, 0.001, 0.084, 0.05,
0.2543, 0.5, 0.7807, 0.87, 0.97},
{0, 0, 0.0001, 0.001733, 0.0001,
0.00563, 0.002, 0.07, 0.4, 0.43,
0.58, 0.79, 0.93, 0.96, 1},
{0, 0, 0.014, 0.001733, 0.005,
0.0156, 0.02667, 0.28, 0.62, 0.64,
0.7629, 0.91, 0.9687, 0.98, 1},
{0, 0, 0.014, 0.015, 0.016,
0.028, 0.04, 0.5, 0.7, 0.77,
0.84, 0.95, 0.95, 1, 1},
{0, 0, 0.019, 0.02117, 0.022,
0.0484, 0.1133, 0.62, 0.79, 0.84,
0.8829, 0.95, 1, 1, 1},
{0, 0, 0.019, 0.02983, 0.03,
0.1226, 0.17, 0.68, 0.83, 0.87,
0.9, 1, 1, 1, 1},
{0, 0, 0.027, 0.02983, 0.043,
0.1704, 0.3133, 0.74, 0.864, 0.89,
0.9229, 1, 1, 1, 1},
{0, 0, 0.027, 0.0395, 0.052,
0.226, 0.4, 0.78, 0.88, 0.9,
0.94, 1, 1, 1, 1},
{0, 0, 0.033, 0.04883, 0.064,
0.2708, 0.5167, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.033, 0.0555, 0.072,
0.3184, 0.55, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.037, 0.0555, 0.079,
0.3308, 0.5833, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.037, 0.0595, 0.082,
0.336, 0.59, 0.78, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.038, 0.05833, 0.08,
0.3312, 0.5667, 0.77, 0.888, 0.91,
0.95, 1, 1, 1, 1},
{0, 0, 0.038, 0.05367, 0.076,
0.3002, 0.54, 0.76, 0.88, 0.92,
0.95, 1, 1, 1, 1},
{0, 0, 0.036, 0.05367, 0.067,
0.2855, 0.5033, 0.77, 0.882, 0.93,
0.9743, 1, 1, 1, 1},
{0, 0, 0.036, 0.0465, 0.057,
0.2735, 0.49, 0.77, 0.89, 0.95,
1, 1, 1, 1, 1},
{0, 0, 0.032, 0.03967, 0.048,
0.2619, 0.4633, 0.78, 0.938, 1,
1.023, 1, 1, 1, 1},
{0, 0, 0.032, 0.03267, 0.04,
0.2476, 0.45, 0.79, 1.01, 1.03,
1.04, 1, 1, 1, 1},
{0, 0, 0.027, 0.03267, 0.033,
0.2559, 0.4867, 0.95, 1.5, 1.7,
2.543, 1, 1, 1, 1},
{0, 0, 0.027, 0.027, 0.027,
0.2735, 0.52, 1.4, 2.3, 3,
4, 1, 1, 1, 1}
};

vec = std::vector<real_t>(&(arr[0][0]), &(arr[hall_n_rat][hall_n_rad]));
}

template<class real_t>
void hall_radii(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_n_rad] = {6.e-6,8.e-6,10.e-6,15.e-6,20.e-6,25.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};

vec = std::vector<real_t>(arr, arr + hall_n_rad );
}

template<class real_t>
void hall_ratios(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_n_rat] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5, 0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0};

vec = std::vector<real_t>(arr, arr + hall_n_rat );
}
}
}
}
Loading

0 comments on commit 6ccf6d4

Please sign in to comment.