Hybrid precision is a scheme to ensure both accuracy and efficiency ,does pyfr support hybrid precision? Such like hybrid fp32/fp64?
No pyfr does not support hybrid precision.
If you wanted to acheive this in a static way there are maybe a couple of ways you could implement this.
- When generating a mesh and labeling the volume, rather than just using the name
fluid
you could name partsfluid-1
andfluid-2
and then add options to the ini file to set the precision differently. You would then need to add some intrastructure to then use those different options to generate different kernels and allocate different memory. - You could use the recent tools that will give the n elements next to a surface to tag elements and then perform the same infrastructure additions as above.
- You could flag different partitions as having different precisions and then perform the same infrastructure additions as above.
However, all this begs the question why? In what situation is double precision required where single precision isn’t enough? And if the question is actually, as I suspect, related to half precision, then when is half precision actually a good idea over just producing a better mesh?
There are also many questions related to how errors from lower precision regions impact the error in higher precison regions. To study this it might be better to write your own code for toy probelms. Some quesitons that would need answering are, what is the downstream effcet of an upstream region with lower precision? What is the effect of a lower precision region adjacent to a high precision region where the interface is parallel to the convective direction? What is the effect on precision on a structure convected through a lower precision region and back out again? How does all this then effect higher order turbulent statistics like u’u’ and u’u’u’. Basically all the questions that the hybrid RANS-LES/DES/ZLES asked and answered, but with the additional question of is all the hastle worth it?