Mantevo / miniFE

MiniFE Finite Element Mini-Application
http://www.mantevo.org
GNU Lesser General Public License v3.0
29 stars 32 forks source link

How to change the definition of Scalar, universally, from a `double` to a third-party implementation of floating point math? #7

Closed eirhardt closed 6 years ago

eirhardt commented 6 years ago

I'm trying to merge the posit implementation found here into the ref/src implementation of the miniFE application. I'm kind of new to editing makefiles and was hoping for some tips.

maherou commented 6 years ago

miniFE uses a traits mechanism to support introducing new new scalar types. You would need to add posit versions of the traits. This file contains traits for existing types:

https://github.com/Mantevo/miniFE/blob/master/ref/utils/TypeTraits.hpp

You should be able to add definitions here and then define MINIFE_SCALAR to by posit when executing make:

make -DMINIFE_SCALAR=posit

I hope this helps.