felupe

finite element analysis for continuum mechanics of solid bodies

GPL-3.0 License

Downloads
5.7K
Stars
75
Committers
1
felupe - v9.0.0 Latest Release

Published by adtzlr about 2 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.8.0...v9.0.0

felupe - v8.8.0

Published by adtzlr 4 months ago

[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

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

felupe - v8.7.0

Published by adtzlr 5 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.6.0...v8.7.0

felupe - v8.6.0

Published by adtzlr 5 months ago

[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

New Contributors

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

felupe - v8.5.1

Published by adtzlr 6 months ago

[8.5.1] - 2024-05-08

Fixed

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

What's Changed

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

felupe - v8.5.0

Published by adtzlr 6 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.4.0...v8.5.0

felupe - v8.4.0

Published by adtzlr 7 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.3.1...v8.4.0

felupe - v8.3.1

Published by adtzlr 7 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.3.0...v8.3.1

felupe - v8.3.0

Published by adtzlr 7 months ago

[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

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.2.1...v8.3.0

felupe - v8.2.1

Published by adtzlr 7 months ago

[8.2.1] - 2024-03-30

Fixed

  • Fix FieldContainer.evaluate.strain(fun=lambda stretch: stretch) for custom strain-stretch callables. The fun-argument was previously ignored.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v8.2.0...v8.2.1

felupe - v8.2.0

Published by adtzlr 7 months ago

[8.2.0] - 2024-03-25

Added

  • Add methods to evaluate different strain measures of a field container, i.e. FieldContainer.evaluate.strain(tensor=True, asvoigt=False, k=0), FieldContainer.evaluate.log_strain(tensor=True, asvoigt=False) or FieldContainer.evaluate.green_lagrange_strain(tensor=True, asvoigt=False). These methods refer to math.strain(k=0) which uses math.strain_stretch_1d(k=0) by default with the strain exponent k of the Seth-Hill strain formulation.

Changed

  • Change the return type of math.eig() which returns a namedtuple with attributes eigenvalues and eigenvectors. Now consistent with NumPy. This also affects math.eigh().
  • Change the shape of the array of eigenvectors returned by math.eig() from (a, i, ...) to (i, a, ...). Now consistent with NumPy. This also affects math.eigh().
  • Switch from a hard-coded logarithmic strain evaluation to a more generalized Seth-Hill strain-stretch relation in math.strain(fun=math.strain_stretch_1d, k=0) with a default strain-exponent of k=0 which returns the logarithmic strain.

What's Changed

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

felupe - v8.1.0

Published by adtzlr 7 months ago

[8.1.0] - 2024-03-23

Added

  • Add an argument to disable the (default) expansion of the points-array of a mesh in mesh.expand(expand_dim=True) and mesh.revolve(expand_dim=True). E.g., this allows the expansion and / or revolution of a quad-mesh with points in 3d-space.
  • Add MultiPointContact.plot(offset=0, **kwargs) to plot the rigid contact plane(s) or line(s) at a given offset.
  • Add MultiPointConstraint.plot(**kwargs) to plot the lines of a multi-point constraint.

Changed

  • Don't raise an error if the total angle of revolution is greater than 360 degree in mesh.revolve(phi=361).

What's Changed

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

felupe - v8.0.0

Published by adtzlr 7 months ago

[8.0.0] - 2024-03-18

Added

  • Add axis of expansion in mesh.expand(axis=-1) (ignored for n=1).
  • Add an optional mask-argument to select points for rotation in mesh.rotate(mask=None).
  • Add Lagrange quad/hex cell-types in ViewMesh.
  • Add optional projection of stresses from quadrature-points to mesh.points in SolidBody.plot(project=None), where project has to be a callable like project(values, region).
  • Add optional projection of internel cell-data (Displacement, Logarithmic Strain and Deformation Gradient) from quadrature-points to mesh-points in FieldContainer.plot(project=None), where project has to be a callable like project(values, region).

Changed

  • The internal BasisField.basis is now a subclassed array BasisArray with a grad-attribute.
  • math.grad(x, **kwargs) is enhanced to return gradients of fields (like before) and the gradient-attribute of basis-arrays (added).
  • The grad_v and grad_u arguments are removed from the form-expression decorator Form. This changes the required function signature of the weakform-callable to weakform(v, u, **kwargs). The tuple of optional arguments is also removed. Gradients of v and u are now obtained by math.grad(v) or v.grad.
  • Enforce quadrature schemes with minimal order for projections in project() for Triangle, Tetra as well as their MINI- and Quadratic-variants.
  • Fall-back to extrapolate(mean=True) in project(mean=True).
  • Don't ravel the results of res = extrapolate(values, region), i.e. values.shape = (3, 3, 4, 100) will be returned as res.shape = (121, 3, 3) instead of res.shape = (121, 9).
  • Stack only a selection of meshes in MeshContainer.stack([idx]).
  • Enable list-based indexing in MeshContainer[idx].
  • Add the opacity=0.99 argument to MeshContainer.plot() and MeshContainer.screenshot().
  • Pass the dpi-argument to the matplotlib figure in imshow(dpi=None) for solids, field- and mesh-containers.
  • Permute GaussLegendre(order=2, dim=2) according to the points of the BiQuadraticQuad element by default.
  • Permute the 2- and 3-dimensional GaussLegendre quadrature schemes for order > 2 according to the VTK-Lagrange element formulations. That means for linear and quadratic quads and hexahedrons, the points of GaussLegendre are sorted according to the default VTK elements and for all higher-order elements according to the Lagrange-elements.
  • Enable default point-permutations in RegionLagrange(permute=True) by default.
  • Hide internal edges of higher-order cell-types in ViewScene.plot() by default.
  • Simplify tools.topoints(values, region, average=True, mean=False). Remove all other arguments. If values of single quadrature-point per cells is given, then the values are broadcasted to the number of points-per-cell. If values are provided on more quadrature points than the number of points-per-cell, then the values are trimmed. E.g., this is required for QuadraticHexahedron with 20 points and 27 quadrature-points.

Fixed

  • Fix mesh-expansion with one layer mesh.expand(n=1). This expands the dimension of the points-array.
  • Fix VTK-compatible cells in CubeArbitraryOrderHexahedron.
  • Fix Cauchy-stress evaluation of SolidBody and SolidBodyNearlyIncompressible on a 2d-Field (plane stress): Automatic fall-back to Kirchhoff-stress and print a warning.

Removed

  • Remove the deprecated old-style argument move in dof.biaxial().
  • Remove the deprecated old-style arguments move, axis_compression, axis_shear and compression in dof.shear().

What's Changed

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

felupe - v7.19.1

Published by adtzlr 8 months ago

[7.19.1] - 2024-03-08

Fixed

  • Fix tools.project() for meshes where some points are not connected to cells.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.19.0...v7.19.1

felupe - v7.19.0

Published by adtzlr 8 months ago

[7.19.0] - 2024-03-08

Added

  • Add FieldDual(disconnect=True) for a dual (secondary) field with an optionally disconnected mesh. This also enables FieldsMixed(disconnect=True) in mixed fields.
  • Add a quadrature scheme for integrating the surface of a unit hemisphere BazantOh(n=21).
  • Add NearlyIncompressible as a simplified version of ThreeFieldVariation. A constitutive material formulation on the distortional part of a strain energy function in terms of the deformation gradient has to be provided, e.g. by umat = NearlyIncompressible(NeoHooke(mu=1), bulk=5000).
  • Add optional kwargs to a job-callback Job(callback=lambda stepnumber, substepnumber, substep, **kwargs: None, **kwargs) and CharacteristicCurve(callback=lambda stepnumber, substepnumber, substep, **kwargs: None, **kwargs).
  • Add DiscreteGeometry properties x, y and z to access the columns of the points-array.
  • Add a new math-function math.equivalent_von_mises(A) for three-dimensional second-order tensors.
  • Add the evaluation of the equivalent von Mises Cauchy stress as cell-data in ViewSolid, available as Solid.plot("Equivalent of Cauchy Stress").
  • Add mesh.stack(meshes) as method to MeshContainer.stack(). Note that this only supports mesh containers with meshes of same cell-types.
  • Add NeoHooke.gradient(out=None) and NeoHooke.hessian(out=None) for a location to store the results. Also for NeoHookeCompressible.
  • Add out-keyword to gradient() and hessian of NearlyIncompressible and ThreeFieldVariation.
  • Add optional initial state variables in ViewMaterial(statevars=None) and ViewMaterialIncompressible(statevars=None).
  • Add the L2-projection as tools.project(values, region, average=True, mean=False, dV=None, solver=scipy.sparse.linalg.spsolve) to project given values at quadrature points to mesh-points. This replaces the old tools.project(values, region, average=True, mean=False) in a backward-compatible way. The new method is computationally more expensive but is also much more flexible.
  • Add fifth-order quadrature schemes quadrature.Triangle(order=5) and quadrature.Tetrahedron(order=5).
  • Add Region.copy(mesh=None, element=None, quadrature=None) to copy a region and re-evaluate this copy if necessary.

Changed

  • Rename Mesh.save() to Mesh.write() and add Mesh.save() as an alias to Mesh.write().
  • Enhance the performance of NeoHooke, NeoHookeCompressible, SolidBody and SolidBodyNearlyIncompressible.
  • Enhance the performance of math.inv(out=None) and math.det(out=None).
  • Use only the offical API of tensortrax. A workaround is used to ensure compatibility with tensortrax <= v0.17.1.
  • Pass optional keyword-arguments in the plot-methods ViewMaterial.plot(**kwargs) and ViewMaterialIncompressible.plot(**kwargs) to the matplotlib axes object ax.plot(**kwargs).
  • Only add off_screen and notebook keyword-arguments to pyvista.Plotter(**kwargs) if they are True. This is needed for not ignoring a global variable like pyvista.OFF_SCREEN = True.
  • Enforce verbose=0 if the environmental variable "FELUPE_VERBOSE" is "false". This is useful for running the examples when building the documentation.
  • Don't require a bilinearform in FormItem(bilinearform=None). An empty FormItem is now a valid item in a Step. For empty vectors/matrices, the shape is inferred from sum(FieldContainer.fieldsizes) instead of FieldContainer.fields[0].values.size.
  • Rename the old-project method to tools.extrapolate(values, region, average=True, mean=False) which extrapolates values at quadrature points to mesh-points.
  • Change the sorting of quadrature points for triangles and tetrahedrons (due to internal code simplifications).
  • The reload-method of a region does only re-evaluate it if at least one of the arguments are not None Region.reload(mesh, element, quadrature).

Fixed

  • Fix missing support for third-order- and second-order tensor combinations to math.dot(A, B, mode=(2,3)) and math.ddot(A, B, mode=(2,3)).
  • Fix error if FieldDual is in the fields of a FieldContainer for IntegralForm.
  • Fix math.inv(A) for arrays with shape A.shape = (1, 1, ...). Also raise an error if shape[:2] not in [(3, 3), (2, 2), (1, 1)].
  • Raise an error in math.det(A) if A.shape[:2] not in [(3, 3), (2, 2), (1, 1)].
  • Fix mutable keyword-arguments in SolidBody._vector(kwargs={}) by SolidBody._vector(kwargs=None). Also for ._matrix() and for SolidBodyNearlyIncompressible.
  • Fix wrong shape and the resulting error during assembly in fem.assembly.expression.Form for the integration of a linear form with different mesh- and field-dimensions.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.18.0...v7.19.0

felupe - v7.18.0

Published by adtzlr 8 months ago

[7.18.0] - 2024-02-16

Added

  • Create a FieldContainer by the &-operator between fields and field containers, i.e. field = displacement & pressure, where displacement = Field(region, dim=2) and pressure = Field(region). This also works for field & pressure as well as pressure & field.
  • Add a method to create a field container from a field, i.e. Field(region, dim=3).as_container() is equal to FieldContainer([Field(region, dim=3)]).
  • Add ViewMaterial(umat) to view force-stretch curves for uniaxial tension/compression, planar shear and equi-biaxial tension.
  • Add ViewMaterialIncompressible(umat) to view force-stretch curves for incompressible uniaxial tension/compression, planar shear and equi-biaxial tension.
  • Add a base class for constitutive materials with methods ConstitutiveMaterial.view(incompressible=False), ConstitutiveMaterial.plot(incompressible=False) and ConstitutiveMaterial.screenshot(incompressible=False).
  • Add a dict-attribute with material parameters to all built-in materials, e.g. NeoHooke.kwargs = {"mu": self.mu, "bulk": self.bulk}.
  • Add umat = CompositeMaterial(material, other_material).
  • Add &-operator to combine constitutive materials umat = material & other_material. Note that only the first material must contain state variables.

Changed

  • Don't disconnect the dual mesh by default for regions RegionQuadraticTriangle and RegionQuadraticTetra in FieldsMixed.

Fixed

  • Fix Mesh.flip(mask=None): Take care of the mask (it wasn't applied to the cells-array of the mesh).

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.17...v7.18.0

felupe - v7.17

Published by adtzlr 9 months ago

[7.17.0] - 2024-02-15

Added

  • Add a mesh for a single vertex point vertex = Point(a=0).
  • Add expansion of a vertex point to a line mesh vertex.expand(n=11, z=1).
  • Add revolution of a vertex point to a line mesh vertex.revolve(n=11, phi=180).

Changed

  • Assume that no state variables are used in an umat if it has no attribute umat.x. Set the shape of the state variables by default to (0, q, c) in SolidBody and SolidBodyNearlyIncompressible.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.16...v7.17

felupe - v7.16

Published by adtzlr 9 months ago

[7.16.0] - 2024-02-13

Added

  • Add MeshContainer.plot(), img = MeshContainer.screenshot() and ax = MeshContainer.imshow(). The default list of colors contains PyVista's default color as first item and then the list of matplotlib's named colors C1, C2, etc (excluding C0).
  • Add Mesh.merge_duplicate_points(decimals=None) and make Mesh.sweep(decimals=None) an alias of it.
  • Add Mesh.merge_duplicate_cells().

Fixed

  • Fix Mesh.imshow(ax=None), FieldContainer.imshow(ax=None) and SolidBody.imshow(ax=None) from v7.15.

What's Changed

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.15.0...v7.16

felupe - v7.15.0

Published by adtzlr 9 months ago

[7.15.0] - 2024-02-11

Added

  • Add optional ax-arguments to Mesh.imshow(ax=None), FieldContainer.imshow(ax=None) and SolidBody.imshow(ax=None).

Full Changelog: https://github.com/adtzlr/felupe/compare/v7.14.0...v7.15.0

felupe - v7.14.0

Published by adtzlr 9 months ago

[7.14.0] - 2024-02-11

Added

  • Add optional output location for FieldContainer.extract(out=None).
  • Add Mesh.update(callback=None). This is especially useful if the points array of a mesh is changed and an already existing instance of a region has to be reloaded: Mesh.update(points=new_points, callback=region.reload).
  • Add ax = FieldContainer.imshow() which acts as a wrapper on top of the img = FieldContainer.screenshot(filename=None) method. The image data is passed to a matplotlib figure and the ax object is returned.
  • Add ax = Mesh.imshow() which acts as a wrapper on top of the img = Mesh.screenshot(filename=None) method. The image data is passed to a matplotlib figure and the ax object is returned.
  • Add view-methods for SolidBody and SolidBodyNearlyIncompressible (same as already implemented for mesh and fields).
  • Add lists with norms of values and norms of the objective function in tools.NewtonResult(xnorms=None, fnorms=None).
  • Add lists of norms of the objective function as attribute to Job.fnorms.
  • Add new method to Mesh for getting point ids next to a given point coordinate Mesh.get_point_ids(value).
  • Add new method to Mesh for getting cells attached to a given point coordinate Mesh.get_cell_ids(point_ids).
  • Add new method to Mesh for getting neighbour cells Mesh.get_cell_ids_neighbours(cell_ids).
  • Add new method to Mesh for getting shared points between neighbour cells Mesh.get_point_ids_shared(cell_ids_neighbours).
  • Add new method to Mesh for getting points on regular grids which are located at corners Mesh.get_point_ids_corners().
  • Add new method to Mesh for modifying the cell connectivity at corners Mesh.modify_corners(point_ids=None), supported for regular quad and hexahedron meshes.

Changed

  • Pass optional keyword-arguments in math.dot(**kwargs) to the underlying einsum-calls.
  • Enhance the performance of math.cdya() by reducing the number of (intermediate) arrays to be created from 4 to 2.
  • Use fixed output locations for the extracted field-gradients and the integrated stiffness matrices in SolidBody and SolidBodyNearlyIncompressible. This enhances the performance.
  • Change default filename in Mesh.screenshot() from filename="field.png" to filename="mesh.png".
  • Change the return value on job-evaluation from None = Job.evaluate() to job = Job.evaluate().
  • Change implementation of LinearElasticLargeStrain from NeoHooke to NeoHookeCompressible.
  • Do not invoke pyvista.start_xvfb() on a posix-os. If required, run it manually.
  • Rename tools._newton.Result to tools._newton.NewtonResult and add it to the public API as tools.NewtonResult because this class is returned as a result of Newton's method.
  • Rename the r-arguments of tools.force() and tools.moment() to forces.
  • Rename the point-argument of tools.moment() to centerpoint.
  • Rename the r-argument in tools.save() to forces. Remove the unused argument converged.
  • Change the default file-extension from .vtk to .vtu in tools.save(filename="result.vtu").
  • Change the default values of the gravity vector to zeros if gravity=None in SolidBodyGravity(field, gravity=None, density=1.0).

Fixed

  • Fix tools.moment(). Use math.cross(). The old implementation was completely wrong!

What's Changed

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