evalf / nutils

The nutils project
http://www.nutils.org/
MIT License
88 stars 48 forks source link

use affine root coords as geom if possible #855

Closed joostvanzwieten closed 7 months ago

joostvanzwieten commented 7 months ago

Before 5034398d3 the geometry of a rectilinear mesh was an affine transformation of the root coordinates. In patch 5034398d3 this special case was removed due to a pending change in the transform chains for structured topologies: the replacement of the transformation that places an element in the root space with an index, thereby giving every element unit square root coordinates.

The effect of this change is a suboptimal gradient of the geometry to the root coordinates. Since the geometry is now always the inner product of a linear basis with vertices, the gradient of the geometry does not simplify to a constant if the vertices are evenly spaced.

This patch restores the special cased geometry by creating a reference geometry out of the (unit square) root coordinates and the element index and applying an affine transformation.