On running cmake with cmake $IDEFIX_DIR -DIdefix_HDF5=ON -DCMAKE_CXX_FLAGS="-DXDMF_DOUBLE", the following compilation error is generated:
idefix/src/output/xdmf.cpp:168:18: error: incompatible pointer types assigning to 'double *' from 'float *'
this->vect3D = new float[nx1loc*nx2loc*nx3loc];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
This is because it works well for the default option float but when the dumping datatype is changed to double, the code complains as the right hand side of this expression is still float which must be changed to double. Therefore, to make this dump datatype agnostic, one needs to change float on the right hand side of this expression to DUMP_DATATYPE macro.
On running
cmake
withcmake $IDEFIX_DIR -DIdefix_HDF5=ON -DCMAKE_CXX_FLAGS="-DXDMF_DOUBLE"
, the following compilation error is generated:This is because it works well for the default option
float
but when the dumping datatype is changed todouble
, the code complains as the right hand side of this expression is stillfloat
which must be changed todouble
. Therefore, to make this dump datatype agnostic, one needs to changefloat
on the right hand side of this expression toDUMP_DATATYPE
macro.