Skip to content

Precision Cast: Conversion CONST_VECTOR to PMacc::math::Vector #978

@ax3l

Description

@ax3l

When converting PIConGPUs cellSize to a floatD_64 via a precision cast, one gets:

error: no suitable user-defined conversion from
  "const PMacc::math::Vector<picongpu::float_X, 2, PMacc::math::StandardAccessor,
    PMacc::math::StandardNavigator,
    picongpu::pmacc_static_const_storage39::ConstArrayStorage>"
  to "picongpu::floatD_64" exists

code:

CONST_VECTOR(float_X,simDim,cellSize,CELL_WIDTH,CELL_HEIGHT,CELL_DEPTH)
// ... (might not work)
floatD_64 cellSize_SI = precisionCast<float_64>(cellSize);
cellSize_SI *= UNIT_LENGTHS;
// or (might work)
const floatD_64 cellSize_SI = precisionCast<float_64>(cellSize) * UNIT_LENGTHS;

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions