felupe

finite element analysis for continuum mechanics of solid bodies

GPL-3.0 License

Downloads
5.7K
Stars
75
Committers
1
felupe - v7.13.0

Published by adtzlr 10 months ago

[7.13.0] - 2023-12-22

Added

  • Add NeoHookeCompressible for compressible hyperelastic materials or even as a fast alternative for NeoHooke when used in SolidBodyIncompressible.

Changed

  • Vectorize mesh.expand() which enhances the performance of quad/hex mesh-generators like Rectangle() and Cube().

Fixed

  • Fix logarithmic strain tensor evaluation in Job.evaluate(filename="result.xdmf") and in field.plot("Logarithmic Strain", component=0).

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.12.0...v7.13.0

felupe - v7.12.0

Published by adtzlr 11 months ago

[7.12.0] - 2023-12-05

Added

  • Add plot- and screenshot-methods to Region and Scheme (base class for quadratures).
  • Add item = FormItem(bilinearform, linearform=None) to be used as an item in a Step(items=[item]).
  • Add a new method Boundary.apply_mask(mask). This simplifies re-definitions of boundary conditions with a custom mask.
  • Add support for two-dimensional dof-based masks in Boundary(mask) with mask.shape of (mesh.npoints, field.dim) in addition to point-based masks with mask.size of mesh.npoints.
  • Add a bubble-multiplier argument for RegionTriangleMINI(mesh, bubble_multiplier=0.1) and RegionTetraMINI(mesh, bubble_multiplier=0.1).
  • Add region.reload(mesh, element, quadrature) to re-evaluate a region, already linked to a field, with a modified mesh or element class or quadrature.

Changed

  • Refactor the assembly-submodule. Move the weak-form expression-related classes to the assembly.expression submodule.
  • Move Basis to the new assembly.expression submodule.
  • Make the field-submodule public.
  • Always import felupe as fem in docs and tests.
  • Change default optional (keyword) arguments of a weak-form expression decorator from Form(args=(), kwargs={}) to Form(args=None, kwargs=None).
  • Change default value of the skip-argument Boundary(skip=None). This will be set to (False, False, False) during initialization if mask=None.
  • Change the default bubble-multiplier in RegionTriangleMINI and RegionTetraMINI from 1.0 to 0.1. This affects only the template regions and not the element formulations TriangleMINI and TetraMINI, which still default to a bubble-multiplier of 1.0.
  • Pass optional keyword-arguments to math.einsum(**kwargs). This enables support for the out-argument.
  • Don't broadcast math.identity().
  • Rename quadrature/_base.py to quadrature/_scheme.py.

Fixed

  • Fix Boundary and subsequently also dof.symmetry() for different dimensions of the mesh and the field.
  • Fix negative cell-volumes error in RegionTriangleMINI for meshes like Rectangle(n=11).triangulate().add_midpoints_faces() by scaling down the (arbitrary) bubble-multiplier from 1.0 to 0.1.

Removed

  • Don't import Basis to the global namespace (not necessary as it is used only internally by the weak-Form expression decorator).
  • Remove unused internal assemble-methods from assembly.expression._linear.LinearForm and assembly.expression._bilinear.BilinearForm.
  • Remove extra-index-url https://wheels.vtk.org as they are now available on PyPI for Python 3.12.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.11.0...v7.12.0

felupe - v7.11.0

Published by adtzlr about 1 year ago

[7.11.0] - 2023-10-22

Added

  • Add cell-type argument to Mesh.add_midpoints_volumes(cell_type=None) and its variants for edges and faces.
  • Add element.Element.view(), element.Element.plot() and element.Element.screenshot(). This enables an interactive plot of the element in the reference configuration with its point ids, e.g. Hexahedron().plot().show().

Changed

  • Change function signature and enhance dof.biaxial(field, lefts=(None, None), rights=(None, None), moves=(0.2, 0.2), axes=(0, 1), clampes=(False, False), sym=True). Now with a full-featured docstring including an example. The old-style input move defaults to None, is deprecated and will be removed in the next major release.
  • Change function signature and enhance dof.shear(field, bottom=None, top=None, moves=(0.2, 0.0, 0.0), axes=(0, 1), sym=True). Now with a full-featured docstring including an example. The old-style move, axis_compression, axis_shear and compression all default to None, are deprecated and will be removed in the next major relase.
  • Merge keyword-arguments for the dual-regions with hard-coded arguments in FieldsMixed(region, **kwargs).
  • Replace np.product() (will be removed in NumPy 2.0) with the equivalent np.prod().

Fixed

  • Fix FieldsMixed() for regions with MINI-element formulations: Disable the disconnection of the dual mesh.
  • Fix dof.shear(sym=True) which was previously ignored due to a wrong setup of the symmetry boundaries.
  • Fix the install command on Python 3.12 by adding an extra-index-url for VTK wheels if they are not yet available on PyPI (the extra index is provided by Kitware).
  • Fix a warning because the timings of the Newton-Rhapson solver are printed from a one-dimensional array. Take the first item of the runtime-array to resolve this warning.

Removed

  • Remove the undocumented dof.planar() because this is a special case of the biaxial load case dof.biaxial(field, clampes=(True, False), moves=(0.2, 0), sym=False, axes=(0, 1)).

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.10.0...v7.11.0

felupe - v7.10.0

Published by adtzlr about 1 year ago

[7.10.0] - 2023-09-14

Added

  • Add ViewField as method to a field container FieldContainer.view(). Now a field container provides the view sub-methods directly, i.e. add FieldContainer.plot() and FieldContainer.screenshot(filename="mesh.png").

Changed

  • Hide the undeformed mesh in Mesh.plot() by default (also affects Mesh.screenshot()).

Fixed

  • Fix taking screenshots of a mesh.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.9.0...v7.10.0

felupe - v7.9.0

Published by adtzlr about 1 year ago

[7.9.0] - 2023-09-13

Added

  • Add ViewMesh as method to a mesh Mesh.view(). Now a mesh provides the view sub-methods directly, i.e. add Mesh.plot() and Mesh.screenshot(filename="mesh.png").

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.8.0...v7.9.0

felupe - v7.8.0

Published by adtzlr about 1 year ago

[7.8.0] - 2023-09-05

Added

  • Add mesh.Triangle(a, b, c, n=2) for the creation of a quad-meshed triangle.

Changed

  • Change mesh.Circle(n=6) to the minimum mesh.Circle(n=2).
  • Enhance dof.uniaxial(axis=0, sym=(False, True, False)) by a user-defined axis and selective symmetries.
  • Enhance dof.shear(axis_compression=1, axis_shear=0, sym=True) by user-defined axes of compression and shear.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.7.0...v7.8.0

felupe - v7.7.0

Published by adtzlr about 1 year ago

[7.7.0] - 2023-08-31

Added

  • Add optional normalization of mesh runouts (which are then indents) by mesh.runouts(normalize=False).
  • Add LinearElasticLargeStrain(E=None, nu=None, parallel=False), suitable for large-rotation analyses. This is based on NeoHooke() with converted Lamé-constants.
  • Add a simple boundary-based quad- or hex mesher: A mesh tool for filling the face or volume between two line- or quad-meshes mesh.fill_between(mesh, other_mesh, n=11).
  • Add Circle(radius, centerpoint, n) for the creation of a quad-meshed circle.

Changed

  • Update the mesh also with a new points array: this changes the Mesh-update function mesh.update(cells, cell_type=None) to mesh.update(points=None, cells=None, cell_type=None). Note that this could break old scripts which use mesh.update(new_cells) instead of mesh.update(cells=new_cells).
  • Move the copy-method of a Mesh Mesh.copy() to its base-class and extend it to optionally update the attributes DiscreteGeometry.copy(points=None, cells=None, cell_type=None).

Removed

  • Remove tests on Python 3.7 (end of life).

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.6.1...v7.7.0

felupe - v7.6.1

Published by adtzlr about 1 year ago

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.6.0...v7.6.1

felupe - v7.6.0

Published by adtzlr about 1 year ago

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.5.1...v7.6.0

felupe - v7.5.1

Published by adtzlr about 1 year ago

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.5.0...v7.5.1

felupe - v7.5.0

Published by adtzlr over 1 year ago

[7.5.0] - 2023-07-20

Added

  • Add ViewSolid, which enables view = ViewSolid(field, solid=None) the view of cauchy stresses, e.g. view.plot("Principal Values of Cauchy Stress").show().
  • Add constitutive models to top-level namespace, e.g. yeoh() from constitution.yeoh(). This makes typing hyperelastic material formulations shorter: Hyperelastic(yeoh, C10=0.5, C20=-0.1, C30=0.02).
  • Add CharacteristicCurve.plot(swapaxes=False).
  • Add MaterialAD: A user-defined material definition with Automatic Differentiation. Only the first Piola-Kirchhoff stress tensor must be provided.

Changed

  • Add optional point- and cell-data args for ViewMesh(mesh, point_data=None, cell_data=None) like already implemented in ViewField.
  • Enforce contiguous arrays in UserMaterialHyperelastic (enhance performance).
  • View: Switch from ViewField to ViewSolid.
  • View: Always plot the undeformed mesh with opacity=0.2 and show_edges=False.
  • Rename UserMaterial to Material, UserMaterialStrain to MaterialStrain, UserMaterialHyperelastic to Hyperelastic (keep old alias names until next major release).
  • Use consistent indices in einsum() for (elementwise operating) trailing axes: q for quadrature point and c for cell.
  • Rename internal IntegralFormMixed to IntegralForm, which is now consistent internally and in the top-level namespace. The previous internal base-class for a single-field IntegralForm is renamed to WeakForm.
  • Don't plot x- and y-labels in CharacteristicCurve.plot(xlabel=None, ylabel=None) if they are not specified.

Fixed

  • Don't warp the mesh in ViewMesh.plot().
  • Warp the mesh in case no name is passed in View.plot(name=None).
  • Don't modify a given label in Scene.plot(label=None).
  • Fix the second invariant of the distortional part of the right Cauchy-Green deformation tensor in hyperelastic material formulations using tensortrax, i.e. fix the implementations of mooney_rivlin(), third_order_deformation() and van_der_waals().

Removed

  • Remove internal (unused) imports of the assembly submodule.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.4.1...v7.5.0

felupe - v7.4.1

Published by adtzlr over 1 year ago

[7.4.1] - 2023-05-02

Changed

  • Change the logo.

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.4.0...v7.4.1

felupe - v7.4.0

Published by adtzlr over 1 year ago

[7.4.0] - 2023-04-29

Added

  • Add ViewMesh(mesh) and rebase View (internally renamed to ViewField) on ViewMesh with additional point- and cell-data.

Changed

  • Change math.linsteps(axis=None, axes=None) to create optional multi-column arrays, where the steps are inserted at the given axis.
  • Make last gravity and density arguments of SolidBodyGravity(field, gravity=None, density=1.0) optional.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.3.0...v7.4.0

felupe - v7.3.0

Published by adtzlr over 1 year ago

[7.3.0] - 2023-04-28

Changed

  • Show a progress bar during Job.evaluate(verbose=True) (new optional dependency tqdm). The legacy detailed output is available with Job.evaluate(verbose=2).

Removed

  • Remove config files for MyBinder. They are now located in a different repository adtzlr/felupe-web.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.2.0...v7.3.0

felupe - v7.2.0

Published by adtzlr over 1 year ago

[7.2.0] - 2023-04-26

Added

  • Add environment.yml config file for MyBinder.
  • Add a timetrack-list as Job.timetrack which is updated incrementally on Job.evaluate().
  • Add View(field, point_data=None, cell_data=None), a result plotter powered by pyvista.
  • Add ViewXdmf(filename, time=0), a result plotter powered by pyvista.

Changed

  • Make everything in /src compliant with flake8.
  • Generalize the math-module so that all functions handle an arbitrary number of elementwise-operating trailing axes.
  • The special contraction modes of math.dot(mode=(2,2)) and math.ddot(mode=(2,2)) have to be specified by the mode-argument and are not detected by the shapes of the operands.
  • Enhance the overall performance by enforcing the identity matrix to a C-contiguous array.
  • Change point- and cell-data functions used in Job.evaluate(point_data=None, cell_data=None) from fun(substep) to fun(field, substep).

Fixed

  • Fix timings shown in newtonrhapson(verbose=True): The solve time was only related to one call of the solver while the assembly time referred to the whole runtime subtracted by the single-call solve time.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.1.0...v7.2.0

felupe - v7.1.0

Published by adtzlr over 1 year ago

[7.1.0] - 2023-04-15

Added

  • Add string representations for Region and FieldContainer.
  • Add Job.evaluate(parallel=True) in addition to Job.evaluate(kwargs={"parallel": True}). If both are given, the key in the dict is overwritten by the user-defined value.
  • Add mesh.stack(meshes) for joining meshes with identical points-arrays and cell-types. Contrary to mesh.concatenate(meshes), the points are not stacked and no offsets are inserted into the cells-arrays.
  • Add mesh.translate(move, axis) for the translation of mesh-points.

Changed

  • Pass optional keyword-arguments in CharacteristicCurve.plot(**kwargs) to the figure.
  • Don't invoke CharacteristicCurve.evaluate() from CharacteristicCurve.plot(), raise an error if the current job is not evaluated instead.
  • Make the endpoint of math.linsteps(endpoint=True) optional.
  • Don't modify the mesh for the dual regions RegionConstantQuad() and RegionConstantHexahedron(). Instead, it is required to pass a dual (disconnected) mesh with one point per cell RegionConstantQuad(mesh.dual(points_per_cell=1)).
  • Make requirement einsumt optional again due to issues with JupyterLite.
  • Add matplotlib to optional requirements.

Fixed

  • Catch ModuleNotFoundError if from einsumt import einsumt fails (in JupyterLite) and fall back to from numpy import einsum as einsumt.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.0.0...v7.1.0

felupe - v7.0.0

Published by adtzlr over 1 year ago

[7.0.0] - 2023-04-07

Added

  • Add boundary regions RegionQuadraticQuadBoundary and RegionBiQuadraticQuadBoundary for quadratic quads.
  • Add boundary regions RegionQuadraticHexahedronBoundary and RegionTriQuadraticHexahedronBoundary for quadratic hexahedrons.
  • Add mesh.flip(mask=None) to flip a mirrored or wrong indexed cells array, applied on a given boolean mask of cells.

Changed

  • Change einsumt from an optional to a required dependency.
  • Vectorize implementations of MultiPointConstraint and MultiPointContact and re-implement both as scipy.sparse.lil_matrix().
  • Rename old Mesh to DiscreteGeometry and rebase new Mesh on DiscreteGeometry.
  • Simplify the usage of explicit mesh-related tools by adding them as methods to Mesh, i.e. mesh.tools.expand(Rectangle()) is equivalent to Rectangle().expand().
  • Print runtimes for time spent on Assembly and Solve in newtonrhapson(verbose=True).
  • Check for negative cell-volumes at quadrature points and print a warning along with a possible fix.

Fixed

  • Fix tools.project() for higher-order quad- and hexahedron elements.
  • Fix transposed output of tools.project().
  • Fix failed scalar-value checks by using np.isscalar() in mesh.expand(z=1) and mesh.revolve(phi=180) where z or phi are of type np.int32.
  • Fix read a Mesh with no cells in mesh.read().

Removed

  • Remove jit-compilation of forms (parallel is the preferred method).
  • Remove unused tools.check().
  • Remove optional dependency sparse.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v6.4.0...v7.0.0

felupe - v6.4.0

Published by adtzlr over 1 year ago

[6.4.0] - 2023-04-01

Added

  • Add a new argument to pass a mesh for the dual regions in FieldsMixed(mesh=None).
  • Add quadrature and grad arguments to RegionLagrange.
  • Add order attribute to RegionLagrange.
  • Add items-argument for custom slicing of characteristic curve plots in CharacteristicCurve.plot(items=None).

Changed

  • Enhance Domain integration in IntegralForm: Ensure C-contiguous arrays as fun-argument.
  • Enhance performance of hyperelastic material model formulations using automatic differentiation.
  • Perform reshape and broadcasting if user-defined Field-values with correct size are given.
  • Make symmetry-related boundary conditions in uniaxial loadcase optional dof.uniaxial(sym=True).
  • Merge custom point- and cell-data dicts with default dicts in Job instead of replacing them, also add Job(point_data_default=True, cell_data_default=True).
  • Allow to change cell-type in Mesh.update(cells, cell_type=None).
  • Enhance the creation of a disconnected mesh for mixed-field formulations by Mesh.disconnect(points_per_cell=None, calc_points=True).
  • Change required to optional arguments in Step(items, ramp=None, boundaries=None).

Fixed

  • Fix broadcast arrays for the geometric stiffness contribution of hyperelastic material model formulations using automatic differentiation.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v6.3.0...v6.4.0

felupe - v6.3.0

Published by adtzlr over 1 year ago

[6.3.0] - 2023-02-06

Added

  • Add more hyperelastic material formulations: Saint Venant-Kirchhoff, Mooney-Rivlin, Arruda-Boyce, Extended Tube and Van der Waals.
  • Add BiQuadraticQuad element (as a permuted version of ArbitraryOrderLagrangeElement).
  • Add Quadratic element.
  • Add new arguments for more flexible region templates, e.g. RegionQuad(mesh, quadrature=GaussLegendre(order=1, dim=2), grad=True).
  • Add support for triangle/tetra in FieldsMixed().
  • Add optional state variables to UserMaterialHyperelastic(model, nstatevars=0).
  • Add finite-strain viscoelastic material formulation.

Changed

  • Switch to a src/-layout.
  • Import base-element class as element.Element().
  • Auto-detect min/max-coordinates of mesh-points for loadcases if dof.uniaxial(right=None).
  • Ensure compatibility with tensortrax>0.6.0 (Van-der-Waals and Viscoelastic models).

Fixed

  • Fix rotation matrix for a rotation around the y-axis.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v6.2.5...v6.3.0

felupe - v6.2.5

Published by adtzlr almost 2 years ago

[6.2.5] - 2023-01-02

Fixed

  • Once again fix init if tensortrax is not installed.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v6.2.4...v6.2.5