Hi Maxi,
The AffineConstraints class does not support using mixed precision and I am not aware of any alternatives that can solve this problem directly.
There may be a better solution, but one way to solve this problem would be to set up two different AffineConstraints objects (one for each floating point type) and then call distribute_local_to_global with a (copied from the single precision) double precision cell matrix and double precision cell RHS and (for single precision) do the opposite. This will update both the global matrix and global RHS correctly.
AffineConstraints objects will do Gaussian elimination with values taken from the single precision cell matrix to determine the correct values for the global RHS, so you will lose some accuracy in the RHS due to truncation. It might be better to either set up both the matrix and RHS in double precision and then copy the matrix over to single precision to avoid this problem, or compute the cell matrix in double precision and copy it to a single precision matrix (instead of the opposite approach given in the previous paragraph).
Does this make sense?
Thanks,
David