Repository navigation
[12.1.1] - 2026-11-18
Changed
- Import
scipy.interpolate,scipy.specialandscipy.constantson demand, inside the functions which use them (#1297), i.e.import felupeimports onlyscipy.sparseandscipy.sparse.linalgof SciPy. Before, these modules (andscipy.optimize,scipy.spatialandscipy.fft, which are imported byscipy.interpolate) were about two thirds of the import time of FElupe, e.g. 0.18 s instead of 0.05 s afterimport numpy, scipy.sparse.linalg(CPython 3.13), and in Pyodide they also loaded their WebAssembly modules.griddata()is imported bymesh.fill_between(),interp1d()bytools.curve(),erf()byOgdenRoxburghand the Stefan-Boltzmann constant bySolidBodySurfaceRadiation. The Lagrange polynomials ofArbitraryOrderLagrangeElementusemath.factorial()instead ofscipy.special.factorial()(the values are identical up to order 24, above,math.factorial()is exact). A test checks thatimport felupedoesn't import these modules.
Fixed
- Fix the precision of a region after a reload, e.g. by
field.merge()(#1293).Region.astype(dtype)stores the data type in the new attributeRegion.dtype(default is None, i.e. the arrays are not casted) andRegion.reload()casts the re-evaluated arrays to this data type, i.e. a region keeps its precision. Before,Region.reload()evaluated the arrays in double precision again, i.e.field.merge()(which reloads the regions of the first fields with the merged meshes),Region.copy()andmesh.update(callback=region.reload)promoted a single-precision region tofloat64, while the fields keptfloat32, and the items assembled in double precision. The arrays are still evaluated from the undeformed coordinates in double precision and rounded once, also the quantities of the cells of aRegionBoundary, which are evaluated by the private methodRegionBoundary._evaluate()now (before, byRegionBoundary.reload()). A copy byRegion.astype(dtype)is reloaded with the given data type, i.e. a single-precision region is casted back to double precision without a loss of precision. - Fix the default absolute tolerance of
newtonraphson(..., atol=None)(#1294), which is an estimate of the round-off errors of the objective functionatol = ||(ε_x sqrt((K ∘ K) (x ∘ x)) + ε_K |K (X - X̄)|)_1||now. Before, it was10 ||(ε_x |K| |x| + ε_K |K (X - X̄)|)_1||, i.e. about 30 to 170 times the round-off errors of the objective function at the converged solution, e.g. of single-precision models of nearly incompressible rubber and steel. Hence, a single-precision model stopped before it converged, e.g. the forces of a uniaxial material test (u-p-J, bulk modulus 5000,tol=1e-6, five substeps) had a relative error of1e-3instead of4e-7(with one more iteration per substep). Now, the estimate is about 3 to 13 times the round-off errors: the round-off errors of the unknowns are random, i.e. the root-sum-square of the products of the Jacobian and the unknowns of each row replaces the sums of their absolute values, and the safety factor is 1 (before, 10). The squares of the Jacobian are evaluated in double precision, i.e. they don't overflow in single precision. The machine epsilons are the ones of the lowest instead of the common precision of the Jacobian and of the objective function, e.g. forLinearElasticPlasticIsotropicHardening, which returns its Jacobian in double precision for a single-precision model. Before, the round-off errors of the deformation gradient of such a model were estimated in double precision, i.e. the default absolute tolerance was too small and the model didn't converge for a small tolerance, e.g.tol=1.49e-8.
What's Changed
- Split changelog files by @adtzlr in #1292
- Keep the precision of a region after a reload (
field.merge()) by @adtzlr in #1295 - Fix the default absolute tolerance in single precision by @adtzlr in #1296
- Import
scipy.interpolateandscipy.specialon demand by @adtzlr in #1298 - Release 12.1.1 by @adtzlr in #1299
Full Changelog: v12.1.0...v12.1.1