Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove CONST_VECTOR from OnePositionParameter #4875

Conversation

BrianMarre
Copy link
Member

@BrianMarre BrianMarre commented Apr 22, 2024

change from old CONST_VECTOR for specifying the initial particle position in the template parameter for the OnePosition startPosition functor to the new constexpr float3_X compile time specification.

This breaks old setups, trying to compile a setup using CONST_VECTOR will give the following error:

... picongpu/include/picongpu/../picongpu/particles/startPosition/OnePositionImpl.hpp(45): error: a nonstatic member reference must be relative to a specific object
              constexpr auto initialPosition = T_ParamClass::inCellOffset;

To update a setup, replace in particle.param your definition of the OnePositionParam, something like the following,

CONST_VECTOR(
    float_X,
    3,
    InCellOffset,
    /* each x, y, z in-cell position component in range [0.0, 1.0) */
    0.0,
    0.0,
    0.0);
struct OnePositionParam
{
    static constexpr uint32_t numParticlesPerCell = TYPICAL_PARTICLES_PER_CELL;

    const InCellOffset_t inCellOffset;
};

with an updated version along the lines of this

struct OnePositionParam
{
    static constexpr uint32_t numParticlesPerCell = TYPICAL_PARTICLES_PER_CELL;

    static constexpr auto inCellOffset = float3_X(0., 0., 0.);
};

@BrianMarre BrianMarre force-pushed the topic-RemoveConstVectorFromOnePositionParam branch 2 times, most recently from 64c8c47 to 4b44b58 Compare April 23, 2024 11:50
@BrianMarre
Copy link
Member Author

@psychocoderHPC please, restart CI, CI job failed due docker daemon not answering

@psychocoderHPC psychocoderHPC added refactoring code change to improve performance or to unify a concept but does not change public API component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog! labels Apr 23, 2024
@BrianMarre BrianMarre force-pushed the topic-RemoveConstVectorFromOnePositionParam branch from 4b44b58 to da2c7db Compare April 23, 2024 14:55
@psychocoderHPC psychocoderHPC added this to the 0.8.0 / Next stable milestone Apr 23, 2024
@psychocoderHPC psychocoderHPC merged commit cf6a197 into ComputationalRadiationPhysics:dev Apr 24, 2024
9 checks passed
@BrianMarre BrianMarre deleted the topic-RemoveConstVectorFromOnePositionParam branch April 24, 2024 07:47
@psychocoderHPC psychocoderHPC added the changelog PR's marked with this label will be added to the changelog label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog PR's marked with this label will be added to the changelog component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog! refactoring code change to improve performance or to unify a concept but does not change public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants