[Dune] Multilinear interpolation in Dune?

Oliver Sander sander at igpm.rwth-aachen.de
Tue Jun 2 15:01:28 CEST 2015


Am 02.06.2015 um 14:52 schrieb Atgeirr Rasmussen:
> 
> 2. juni 2015 kl. 14:32 skrev Martin Nolte <nolte at mathematik.uni-freiburg.de>:
> 
>> if regularly structured means a_i = h_a * i + c_a, b_j = h_b * j + c_b, ... for some constant values h_a, h_b, ..., and c_a, c_b, ... the task should easily be doable using SPGrid. 
> 
> Unfortunately that is not what I meant, I guess I should have said tensor-product structure or something like that.
> The a_i (and b_j) etc. must be strictly monotonic but are otherwise arbitrary.

If I was you I'd simply implement the search for the correct element by hand.
std::lower_bound does the binary search for you; you simply call it once for
each coordinate direction to get the correct element.  Then compute local
coordinates from that and use MultilinearGeometry from dune-geometry for the
actual interpolation. That should be only about 10-15 lines of code, and it has
optimal complexity.

Best,
Oliver

> 
> Atgeirr
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150602/53a2e1b1/attachment.sig>


More information about the Dune mailing list