Skip to content

Releases: adtzlr/felupe

v9.1.0

23 Nov 07:43
Compare
Choose a tag to compare

[9.1.0] - 2024-11-23

Tip

This release adds JAX as alternative backend to the default tensortrax-backend for automatic differentiation. Hyperelastic and Material classes are available at felupe.constutition.jax, but only some models are included for JAX. JAX is great for computationally expensive models. However, it runs on single-precision by default. Hence, either the the tolerance of the Newton-Rhapson method must be relaxed or JAX must be enforced to use 64bit floats.

Added

  • Add the hessian of the element shape functions for a quadratic quad element QuadraticQuad.hessian().
  • Add the order-argument to FieldContainer.extract(order="C") as well as for Field, FieldAxisymmetric, FieldPlaneStrain to return C-contiguous arrays by default.
  • Add an optional multiplier to Laplace(multiplier=1.0).
  • Add optional keyword-arguments to math.transpose(**kwargs) to support optional out and order-keywords.
  • Add the attribute RegionBoundary.tangents, which contains a list of tangent unit vectors. For quad cell-types the length of this list is one and for hexahedron cell-types it is of length two.
  • Add math.inplane(A, vectors) to return the in-plane components of a symmetric tensor A, where the plane is defined by its standard unit vectors.
  • Add constitution.jax.Hyperelastic as a feature-equivalent alternative to Hyperelastic with jax as backend.
  • Add constitution.jax.Material(..., jacobian=None) with JAX as backend. A custom jacobian-callable may be passed to switch between forward- and backward-mode automatic differentiation.
  • Add material models for JAX-based materials. Hyperelastic models available at constitution.jax.models.hyperelastic: extended_tube(), miehe_goektepe_lulei(), mooney_rivlin(), neo_hooke(), yeoh(), third_order_deformation(), van_der_waals(). Lagrange (stress-based) models available at constitution.jax.models.lagrange: morph(), morph_representative_directions().
  • Add constitution.jax.total_lagrange(), constitution.jax.updated_lagrange() and constitution.jax.isochoric_volumetric_split() function decorators for the JAX hyperelastic material class.
  • Add an optional keyword-argument Region.astype(copy=True) to modify the data types of the arrays of the region in-place if copy=False.
  • Add FieldContainer.evaluate.right_cauchy_green_deformation() and math.right_cauchy_green_deformation(field) to evaluate the right Cauchy-Green deformation tensor.
  • Add math.strain(field, C=None, ..., **kwargs) to use a given right Cauchy-Green deformation tensor for the evaluation of the strain tensor.
  • Add the hyperelastic foam models storakers() and blatz_ko() for both AD-backends.
  • Add the saint_venant_kirchhoff_orthotropic() hyperelastic model (tensortrax).

Changed

  • Change default np.einsum(..., order="K") to np.einsum(..., order="C") in the methods of Field, FieldAxisymmetric, FieldPlaneStrain and FieldContainer.
  • Change supported Python versions to 3.9 - 3.12.
  • Change the dtype-argument in Region.astype(dtype) from an optional to a required argument.
  • Make tensortrax an optional dependency (again). Now FElupe does only depend on NumPy and SciPy, all other extras are optional.

Fixed

  • Fix the number of points for non-disconnected dual meshes. This reduces the assembled (sparse) vector- and matrix-shapes, which are defined on mixed-fields.
  • Fix wrong results of ConstitutiveMaterial.plot() if any stretch is non-physical, i.e. lower or equal zero. This raises an error now.

Removed

  • Remove the unused, deprecated aliases UserMaterial, UserMaterialStrain and UserMaterialHyperelastic.

What's Changed

  • Add QuadraticQuad.hessian() by @adtzlr in #851
  • Update issue templates by @adtzlr in #855
  • Fix pyOpenSci basic checks by @adtzlr in #854
  • Extract C-contiguous arrays by default from fields by @adtzlr in #856
  • Add an optional multiplier in Laplace(multiplier=1.0) by @adtzlr in #864
  • Add optional kwargs in math.transpose(**kwargs) by @adtzlr in #865
  • Fix the number of points for non-disconnected dual-meshes by @adtzlr in #867
  • Fix wrong result of ConstitutiveMaterial.plot() if any stretch <= 0 by @adtzlr in #872
  • Add RegionBoundary.tangents and math.inplane() by @adtzlr in #873
  • Add constitution.jax.Hyperelastic by @adtzlr in #876
  • Group the constitution module by autodiff-backends by @adtzlr in #878
  • Add felupe.constitution.autodiff.jax.Material by @adtzlr in #879
  • Add morph() for JAX-based Material by @adtzlr in #880
  • Simplify the constitution module by @adtzlr in #881
  • Add Total-Lagrange and Updated-Lagrange decorators for JAX by @adtzlr in #883
  • Add more JAX-based models by @adtzlr in #884
  • Add isochoric_volumetric_split() for JAX-hyperelastic material by @adtzlr in #885
  • Move constitution.jax.isochoric_volumetric_split() by @adtzlr in #887
  • Add optional in-place cast Region.astype(dtype, copy=True) by @adtzlr in #888
  • Make the examples run faster on CI/CD by @adtzlr in #890
  • Add miehe_goektepe_lulei model for JAX by @adtzlr in #892
  • Make tensortrax optional by @adtzlr in #894
  • Test the import in an environment with no autodiff-backend present by @adtzlr in #895
  • Enable jax.Hyperelastic(..., parallel=True) with jax.pmap on quadrature-points axis by @adtzlr in #896
  • Update GitHub-Actions by @adtzlr in #897
  • Add math-function for the right Cauchy-Green deformation tensor by @adtzlr in #898
  • Add the Storåkers hyperelastic foam model by @adtzlr in #900
  • Add the Blatz-Ko hyperelastic foam model by @adtzlr in #901
  • Add the Van-der-Waals model for JAX by @adtzlr in #902
  • Add more hyperelastic models by @adtzlr in #903
  • Add constitution.lame_converter_orthotropic() by @adtzlr in #904
  • Add an optional strain exponent for the SVK-material by @adtzlr in #905

Full Changelog: v9.0.0...v9.1.0

v9.0.0

06 Sep 13:58
Compare
Choose a tag to compare

[9.0.0] - 2024-09-06

Added

  • Add Region.astype(dtype=None) to copy and cast the region arrays to a specified type.
  • Add Field(..., dtype=None) to cast the array with field values to a specified type.
  • Add Field.extract(dtype=None) to cast the extracted field gradient/interpolated values to a specified type.
  • Add hello_world() to print the lines of a minimal-working-example to the console.
  • Add mesh.interpolate_line(mesh, xi, axis) to interpolate a line mesh. The attribute points_derivative holds the derivatives of the independent variable w.r.t. the dependent variable(s). The column of the independent variable is filled with zeros.
  • Add optional keyword-argument SolidBody.assemble.matrix(block=True), also for SolidBody.assemble.vector(block=True) and the assemble-methods of SolidBodyNearlyIncompressible. If block=False, these methods will assemble a list of the upper-triangle sub block-vectors/-matrices instead of the combined block-vector/-matrix.
  • Add SolidBodyForce as a replacement for SolidBodyGravity with more general keyword arguments ("values" instead of "gravity", "scale" instead of "density").
  • Add Laplace to be used as user-material in a solid body. Works with scalar- and vector-valued fields.
  • Add an optional mechanics.Assemble(..., multiplier=None) argument which is used in external items like SolidBodyForce, SolidBodyGravity and PointLoad and is applied in newtonrhapson(items, ...).
  • Add a new submodule view which contains the View... classes like ViewSolid or ViewField, previously located at tools._plot.
  • Add the grad- and hess-arguments to the reload()- and copy()-methods of a Region, i.e. Region.reload(grad=None, hess=None).
  • Add LinearElasticOrthotropic.
  • Add SolidBodyCauchyStress in addition to SolidBodyPressure.
  • Add mesh.cell_types() which returns an object-array with cell-type mappings for FElupe and PyVista.
  • Add MeshContainer.from_unstructured_grid(grid, dim=None, **kwargs) to create a mesh-container from an unstructured grid (PyVista).

Changed

  • Change the internal initialization of field = Field(region, values=1, dtype=None) values from field.values = np.ones(shape) * values to field = np.full(shape, fill_value=values, dtype=dtype). This enforces field = Field(region, values=1) to return the gradient array with data-type int which was of type float before.
  • Initialize empty matrices of SolidBodyForce, SolidBodyGravity and PointLoad with dtype=float.
  • Don't multiply the assembled vectors of SolidBodyForce, SolidBodyGravity and PointLoad by -1.0. Instead, mechanics.Assemble(multiplier=-1.0) is used in the solid bodies.
  • Change the visibility of the internal helpers mechanics.Assemble, mechanics.Evaluate and mechanics.Results from private to public.
  • Import the assembly module to the global namespace.
  • Isolate the submodules, i.e. a submodule only uses the public API of another submodule. If necessary, this will help to change one or more modules to a future extension package.
  • Enforce contiguous arrays for the region shape-function and -gradient arrays h and dhdX. This recovers the integral-form assembly performance from v8.6.0.
  • Make the private basis classes public (assembly.expression.Basis, assembly.expression.BasisField and assembly.expression.BasisArray) as especially their docstrings are useful to understand how a Basis is created on a field.
  • Remove material parameter keyword-arguments in the function()-, gradient()- and hessian()-methods of the core constitutive material formulations. This removes the ability for temporary material parameters in LinearElastic(E=None, nu=0.3).gradient(x, E=1.0), use LinearElastic(E=1.0, nu=0.3).gradient(x) instead. This affects the material formulations LinearElastic, LinearElasticPlaneStrain, LinearElasticPlaneStress, LinearElasticLargeStrain, NeoHooke and NeoHookeCompressible. None is still supported for the material parameters of NeoHooke and NeoHookeCompressible.
  • Remove LinearElasticPlaneStrain from the top-level package namespace because this should only be used with Field(region, dim=2). The preferred method is to use FieldPlaneStrain(region, dim=2) and the default LinearElastic. LinearElasticPlaneStrain remains available in constitution.LinearElasticPlaneStrain.
  • Rename Mesh.as_pyvista() to Mesh.as_unstructured_grid() and add Mesh.as_pyvista() as alias.

Deprecated

  • Deprecate SolidBodyGravity, SolidBodyForce should be used instead.

What's Changed

  • Add Region.astype(dtype=None) and Field(..., dtype=None) by @adtzlr in #797
  • Add hello_world() by @adtzlr in #799
  • Add mesh.interpolate_line(mesh, xi, axis) by @adtzlr in #811
  • Change the derivative storage in mesh.interpolate_line() by @adtzlr in #812
  • Add optional SolidBody.assemble.matrix(block=False) by @adtzlr in #813
  • Add SolidBodyForce and Laplace by @adtzlr in #814
  • Add optional Assemble(multiplier=None) by @adtzlr in #817
  • Change the visibility of the helpers in the mechanics-module from private to public by @adtzlr in #818
  • Fix Ex.09: Take care of changed sign of external form items by @adtzlr in #820
  • Add submodule view by @adtzlr in #823
  • Enhance the imports of the quadrature submodule by @adtzlr in #824
  • Enhance the imports of the mechanics submodule by @adtzlr in #825
  • Enhance (isolate) the cross-imports between submodules by @adtzlr in #826
  • Fix the assembly performance by @adtzlr in #828
  • Test if region attribute arrays are C-contiguous by @adtzlr in #829
  • Add an example for the third medium contact method by @adtzlr in #834
  • Make the classes Basis, BasisField and BasisArray public by @adtzlr in #835
  • Add hess argument to Region(hess=False) by @adtzlr in #836
  • Add LinearElasticOrthotropic by @adtzlr in #840
  • Add SolidBodyCauchyStress by @adtzlr in #842
  • Remove temporary kwargs in core constitutive materials by @adtzlr in #843
  • Don't import LinearElasticPlaneStrain in top-level package namespace by @adtzlr in #844
  • Add felupe.mesh.cell_types() by @adtzlr in #846
  • Add MeshContainer.from_unstructured_grid() by @adtzlr in #847
  • Update README.md by @adtzlr in #850

Full Changelog: v8.8.0...v9.0.0

v8.8.0

16 Jun 08:58
Compare
Choose a tag to compare

[8.8.0] - 2024-06-16

Added

  • Add Region(uniform=False), a flag to invoke a reduced evaluation of the element shape functions and their gradients. If True, only the first cell is evaluated. This drastically speeds up linear-elasticity on uniform grid meshes (e.g. voxel-like quads and hexahedrons).
  • Add an update-method in FormItem(..., ramp_item=0).update(value). This enables a FormItem to be used as a ramped-item in a Step.

What's Changed

  • Add Region(uniform=False): A performance feature for uniform grid meshes by @adtzlr in #792
  • Add FormItem().update(values) by @adtzlr in #796

Full Changelog: v8.7.0...v8.8.0

v8.7.0

07 Jun 07:11
Compare
Choose a tag to compare

[8.7.0] - 2024-06-07

Note

This is the first release with support for NumPy 2.0.

Added

  • Add math.solve_nd(A, b, n=1) as a generalized function of math.solve_2d(A, b) with supported broadcasting on the elementwise-operating trailing axes.

Changed

  • Rebase math.solve_2d(A, b) on math.solve_nd(A, b, n=2) with a batched-rhs supported in NumPy 2.0.
  • Change ogden_roxburgh() and OgdenRoxburgh to use the Gauss error function erf instead of tanh as internal sigmoid function.
  • Flatten the returned inverse indices-array of np.unique(..., return_inverse=True) in mesh.merge_duplicate_points() to ensure compatibility with NumPy 2.0.

Fixes

  • Reset state variables in PlotMaterial.evaluate() after each completed load case.

What's Changed

  • Reset state variables in PlotMaterial.evaluate() after each completed load case by @adtzlr in #784
  • Add math.solve_nd(A, b, n=1) by @adtzlr in #785
  • Support broadcasting in matrix-axes of math.solve_nd() by @adtzlr in #787
  • Fix small typo focusses -> focuses by @tkoyama010 in #786
  • Change ogden_roxburgh() and OgdenRoxburgh to use erf instead of tanh by @adtzlr in #788
  • Add support for NumPy 2.0 by @adtzlr in #789

Full Changelog: v8.6.0...v8.7.0

v8.6.0

28 May 22:04
Compare
Choose a tag to compare

[8.6.0] - 2024-05-29

Added

  • Add the isotropic-hyperelastic alexander(C1, C2, C2, gamma, k) material model formulation to be used in Hyperelastic().
  • Add the isotropic-hyperelastic Micro-Sphere miehe_goektepe_lulei(mu, N, U, p, q) material model formulation to be used in Hyperelastic().
  • Add the pseudo-elastic ogden_roxburgh(r, m, beta, material, **kwargs) material model formulation to be used in Hyperelastic().
  • Add an optional relative-residuals argument to ConstitutiveMaterial.optimize(relative=False).
  • Add a class-decorator constitutive_material(Msterial, name=None).
  • Add the Total-Lagrange MORPH material formulation implemented by the concept of representative directions morph_representative_directions(p) to be used in MaterialAD().
  • Add the Total-Lagrange (original) MORPH material formulation morph(p) to be used in Hyperelastic().
  • Add decorators @total_lagrange and @updated_lagrange for Total / Updated Lagrange material formulations to be used in MaterialAD.
  • Add the isotropic-hyperelastic anssari_benam_bucchi(mu, N) material model formulation to be used in Hyperelastic().
  • Add the isotropic-hyperelastic lopez_pamies(mu, alpha) material model formulation to be used in Hyperelastic().

Changed

  • Recfactor the constitution module.

Fixed

  • Fix plotting the keyword-arguments of a constitutive material ConstitutiveMaterial.plot(show_kwargs=True). For list-based material parameters of length 1, the brackets aren't shown now. E.g., this affects optimized material parameters.
  • Don't update the material parameters in-place in ConstitutiveMaterial.optimize().
  • Don't convert material parameter scalars to arrays in ConstitutiveMaterial.optimize().

What's Changed

  • Add the isotropic-hyperelastic Alexander model by @adtzlr in #756
  • Re-organize the constitution module by @adtzlr in #758
  • Delete _models_hyperelasticity_ad.py by @adtzlr in #759
  • Fix the Alexander model by @adtzlr in #761
  • Add ogden_roxburgh using AD for Hyperelastic by @adtzlr in #762
  • Add ConstitutiveMaterial.optimize(relative=False) by @adtzlr in #764
  • Add the Micro-Sphere hyperelastic material model framework by @adtzlr in #766
  • Add constitutive_material(Material) decorator by @adtzlr in #768
  • Add the MORPH material model (by the method of representative directions) by @adtzlr in #770
  • Add the MORPH material model formulation by @adtzlr in #771
  • Add @total_lagrange and @updated_lagrange decorators for MaterialAD by @adtzlr in #773
  • Rebase morph_representative_directions() as Total-Lagrange material for MaterialAD by @adtzlr in #774
  • Add the Anssari-Benam Bucchi isotropic-hyperelastic material model formulation by @adtzlr in #775
  • Don't update the material parameters in-place and don't convert them to arrays in ConstitutiveMaterial.optimize() by @adtzlr in #778
  • Add the Lopez-Pamies hyperelastic model lopez_pamies(mu, alpha) by @adtzlr in #779
  • Fix small typo cartesion -> cartesian by @tkoyama010 in #781
  • add example for nonlinear viscoelasticity by @bhaveshshrimali in #780

New Contributors

Full Changelog: v8.5.1...v8.6.0

v8.5.1

08 May 14:41
Compare
Choose a tag to compare

[8.5.1] - 2024-05-08

Fixed

  • Fix the gradient evaluation in NeoHookeCompressible(mu=1, lmbda=None).
  • Fix MaterialStrain.plot().

What's Changed

  • Fix gradient-evaluation in NeoHookeCompressible(lmbda=None) by @adtzlr in #754
  • Fix MaterialStrain.plot() by @adtzlr in #755

Full Changelog: v8.5.0...v8.5.1

v8.5.0

27 Apr 14:13
Compare
Choose a tag to compare

[8.5.0] - 2024-04-27

Added

  • Add umat_new, res = ConstitutiveMaterial.optimize(ux=[stretches, stresses], ps=None, bx=None) to optimize the material parameters on given experimental data for incompressible uniaxial, biaxial and / or planar tension / compression data by scipy.optimize.least_squares().
  • Add initial default material parameters for the hyperelastic material model formulations.

What's Changed

  • Add ConstitutiveMaterial.optimize() by @adtzlr in #750

Full Changelog: v8.4.0...v8.5.0

v8.4.0

12 Apr 12:08
Compare
Choose a tag to compare

[8.4.0] - 2024-04-12

Added

  • Add math.solve_2d(A, b, solver=np.linalg.solve, **kwargs) to be used in newtonrhapson(solve=solve_2d, ...) for two-dimensional unknowns. This is useful for local Newton-iterations related to viscoelastic evolution equations inside constitutive material formulations.
  • Add x- and y-offsets in Job.plot(xoffset=0.0, yoffset=0.0).

Changed

  • Wrap the ax-title with the parameters of the material model in ConstitutiveMaterial.plot().

Fixed

  • Sort array of principal values in descending order before plotting in Scene.plot("Principal Values of ..."). This ensures that the labels are matching user-defined arrays of principal values.

What's Changed

  • Sort array of principal values in Scene.plot() by @adtzlr in #739
  • Add math.solve_2d(A, b) by @adtzlr in #742
  • Wrap the ax-title ConstitutiveMaterial.plot() by @adtzlr in #743

Full Changelog: v8.3.1...v8.4.0

v8.3.1

06 Apr 21:27
Compare
Choose a tag to compare

[8.3.1] - 2024-04-06

Fixed

  • Set the default verbosity level to None in newtonrhapson(verbose=None) and Job.evaluate(verbose=None). If None, this defaults to True (as before) but evaluates the environmental variable FELUPE_VERBOSE if present with FELUPE_VERBOSE == "true". This does not ignore custom verbosity levels.

What's Changed

  • Change default verbose=None in Job.evaluate() and newtonrhapson() by @adtzlr in #736

Full Changelog: v8.3.0...v8.3.1

v8.3.0

02 Apr 15:37
Compare
Choose a tag to compare

[8.3.0] - 2024-04-02

Added

  • Add a method to convert a mesh to a PyVista unstructured grid Mesh.as_pyvista(cell_type=None).

Changed

  • Change default line-width from 1.0 to 2.0 in ViewMesh.plot(line_width=2.0).
  • Enforce a 3d points-array in Mesh.as_meshio().

Fixed

  • Fix previously ignored line-width in the plot of a mesh ViewMesh.plot(line_width=1.0).
  • Fix math.tovoigt() for one-dimensional tensors.

What's Changed

  • Add Mesh.as_pyvista(), fix and change default ViewMesh.plot(line_width=1.0) by @adtzlr in #733

Full Changelog: v8.2.1...v8.3.0