Skip to content

add TSC and PCS rad form factor shapes#1671

Merged
psychocoderHPC merged 3 commits into
ComputationalRadiationPhysics:devfrom
PrometheusPi:updateRadFormFactor
Dec 13, 2016
Merged

add TSC and PCS rad form factor shapes#1671
psychocoderHPC merged 3 commits into
ComputationalRadiationPhysics:devfrom
PrometheusPi:updateRadFormFactor

Conversation

@PrometheusPi
Copy link
Copy Markdown
Member

@PrometheusPi PrometheusPi commented Dec 5, 2016

This pull request extends the currently existing CIC particle shape (for radiation) for the TSC and PCS shape.

Requires:

@PrometheusPi PrometheusPi added the component: plugin in PIConGPU plugin label Dec 5, 2016
@PrometheusPi PrometheusPi added this to the Next Stable: 0.3.0 / 1.0.0 milestone Dec 5, 2016
*/
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 )
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a note: util::square == util::pow

Copy link
Copy Markdown
Member

@ax3l ax3l Dec 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use pow(X,1) here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@psychocoderHPC psychocoderHPC self-assigned this Dec 6, 2016
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 );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()  
)

@PrometheusPi PrometheusPi force-pushed the updateRadFormFactor branch 3 times, most recently from 01a5f36 to 2561d61 Compare December 8, 2016 17:50
@PrometheusPi
Copy link
Copy Markdown
Member Author

@psychocoderHPC let me know when I can squash the last two commits

@PrometheusPi
Copy link
Copy Markdown
Member Author

@psychocoderHPC - rebased after white space travis check inclusion

@PrometheusPi
Copy link
Copy Markdown
Member Author

@psychocoderHPC Any more changes needed? May a squash the commits?

@psychocoderHPC
Copy link
Copy Markdown
Member

Looks good from my side

Copy link
Copy Markdown
Member

@psychocoderHPC psychocoderHPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:+1

@psychocoderHPC psychocoderHPC merged commit 22716f2 into ComputationalRadiationPhysics:dev Dec 13, 2016
@PrometheusPi PrometheusPi deleted the updateRadFormFactor branch December 13, 2016 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: plugin in PIConGPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants