add TSC and PCS rad form factor shapes#1671
Conversation
| */ | ||
| HDINLINE float_X operator()(const float_X N, const float_X omega, const vector_X observer_unit_vec) const | ||
| { | ||
| //util::Pow<float_X, 1> pow; |
There was a problem hiding this comment.
please remove this comment or dead code
| math::sinc( observer_unit_vec.y() * CELL_HEIGHT / ( SPEED_OF_LIGHT * float_X( 2.0 ) ) * omega ) * | ||
| math::sinc( observer_unit_vec.z() * CELL_DEPTH / ( SPEED_OF_LIGHT * float_X( 2.0 ) ) * omega ) | ||
| ) // util::square | ||
| N + ( N * N - N ) * util::square( sincX * sincY * sincZ ) |
There was a problem hiding this comment.
only a note: util::square == util::pow
There was a problem hiding this comment.
note: squares (^2) can be implemented more efficiently than the more general pow (^N)
note2: but with the pow implementation right now you are right
| HDINLINE float_X operator()(const float_X N, const float_X omega, const vector_X observer_unit_vec) const | ||
| { | ||
| //util::Pow<float_X, 1> pow; | ||
| const float_X sincX = util::pow( math::sinc( observer_unit_vec.x() * CELL_WIDTH / ( SPEED_OF_LIGHT * float_X( 2.0 ) ) * omega ), 1 ); |
There was a problem hiding this comment.
Why do you use pow(X,1) here?
There was a problem hiding this comment.
If the shapes only differ in the used pow function than please show it in your code:
template< uint32_t T_order >
struct BaseShape
{
HDINLINE float_X operator()(const float_X N, const float_X omega, const vector_X observer_unit_vec) const
{
//....
// pow(T_order);
}
};
struct radFormFactor_TSC_3D : public BaseShape< 2 >
{
};Maybe a function parameter with the power factor is also possible.
| HDINLINE float_X operator()(const float_X N, const float_X omega, const vector_X observer_unit_vec) const | ||
| { | ||
| //util::Pow<float_X, 2> pow; | ||
| const float_X sincX = util::pow( math::sinc( observer_unit_vec.x() * CELL_WIDTH / ( SPEED_OF_LIGHT * float_X( 2.0 ) ) * omega ), 2 ); |
There was a problem hiding this comment.
also possible to write it like this:
float3_X sincValue;
for( uint32_t d = 0; d < DIM3; ++d)
sincValue[d] = util::pow(
math::sinc( observer_unit_vec.y() * cellSize[d] /
( SPEED_OF_LIGHT * float_X( 2.0 ) ) * omega ),
2
);
return math::sqrt(
N + ( N * N - N ) * util::square( sincValue::productOfComponents()
)
01a5f36 to
2561d61
Compare
|
@psychocoderHPC let me know when I can squash the last two commits |
e9d75fa to
a84161b
Compare
|
@psychocoderHPC - rebased after white space travis check inclusion |
|
@psychocoderHPC Any more changes needed? May a squash the commits? |
|
Looks good from my side |
This pull request extends the currently existing CIC particle shape (for radiation) for the TSC and PCS shape.
Requires:
radiationConfig.param