Repository navigation
v7.0.0
7.0.0 breaks the API in many places, and no aliases are kept. Read the breaking
items before upgrading.
Package layout and import time
- Front-ends leave
Utilities(breaking, no alias): the viewersMatplotliband
PyVistamove toEasyFEA.Viz, file formats toEasyFEA.IO, one module per format
family (Gmsh,Medit,Ensight,PyVista,Paraview,Vizir,USD,GLTF).
from EasyFEA import Matplotlib, PyVista, IOkeeps working;Paraview,Vizir,
USDandGLTFare read asIO.Paraview, ... and no longer imported from the root
orEasyFEA.Utilities.import EasyFEAloads neither pyplot nor pyvista (issue #67). MeshIOis removed:Gmsh_to_EasyFEA/EasyFEA_to_Gmshbecome
IO.Gmsh.Load_mesh/Save_mesh, likewise for Medit and Ensight; the PyVista
conversions andSurface_reconstructionmove toIO.PyVista. The node-order tables
are renamed_GMSH_to_EASYFEA_(DICT_EASYFEA_TO_VTK_INDEXES, ...) (issue #67).- Meshes and geometries no longer draw:
Geom.PlotandGeom.Plot_Geomsbecome
Matplotlib.Plot_Geoms,Mesh.Get_Paired_Nodeslosesplot(the drawing is
Plot_Paired_Nodesin theHomog1example),Mesher.Save_simubecomes
IO.Gmsh.Save_simu(with its ownopenGmsh) andTic.Plot_Historybecomes
Matplotlib.Plot_Tic_History(issue #67). Matplotlib.Plot_GeomsandPyVista.Plot_Geomstake*geoms, each a geom or a list
of geoms, so their options are keyword-only (breaking for a positionalax)
(issue #67).- A failed meshing no longer opens a window: the
MeshErrorcarries the geometries in
.geoms, to draw withPyVista.Plot_Geoms(error.geoms)(issue #67). EasyFEA.BUILDING_GALLERYis replaced by theEASYFEA_BUILDING_GALLERYenvironment
variable, read at call time: the flag set bydocs/conf.pyused to be read too early
to take effect (issue #67).- IO formats share one signature per capability (breaking), checked by mypy against
theMeshSaver,MeshLoaderandSimuSaverprotocols:
Save_mesh(mesh, folder, name, *, useBinary=None),Load_mesh(path)and
Save_simu(simu, folder, N, *, results=()), which returns what it wrote (the.pvd,
simu.pos, the folder of.glb/.usdzfiles, or thevizir4command). Paraview's
nodeFieldsbecomesresults; USD and GLTFSave_meshtakenameinstead of
filename;Gmsh.Save_simurequiresfolder, samplesNiterations and spells
edgecolor.useBinary=Nonekeeps each format's default, an unsupported value raises
ValueError(Ensight is text only, USD and GLTF binary only) (issue #68). MatplotlibandPyVistashare one signature per function (breaking), checked by
mypy against theViewerprotocol:Plot,Plot_Mesh,Plot_Nodes,
Plot_Elements,Plot_BoundaryConditions,Plot_Tags,Plot_Geoms,Movie_simu,
Movie_func. One spelling per option, grouped as object (deformFactor), field
(result,coef,nodeValues), colorbar (cmap,nColors,clim,
colorbarTitle,plotColorbar,verticalColorbar), style (color,edgecolor,
linewidth,alpha,plotMesh,plotNodes,nodeSize) and annotation (title,
label,showId,showGrid,plotLegend,bounds). Renamed: Matplotliblw,
ncolors,colorbarLabel,facecolors,Movie_Simu,Plot_Geoms(name=); PyVista
verticalColobar,show_grid,point_size,useLegend(nowshowId, inverted),
Plot_Geoms(line_width=). After the leading arguments, options are keyword-only;ax
andplotterstay backend options.Matplotlib.Movie_func(func, N, folder, ...)
takesfigas an optional keyword; bothMovie_simuandMovie_functakefps, by
default 10 for a gif and 24 for a movie (Matplotlib used 30) (issue #68).- The view covers everything drawn in a figure: a second
Plot_*on the sameaxor
plotterno longer shrinks a 3D Matplotlib view to its own object, and PyVista refits
its camera.bounds=(xmin, xmax, ymin, ymax, zmin, zmax)fixes the view; a PyVista
movie keeps the view of its first frame (issue #68). Plot's extra keywords reach the backend's draw call, but its own spelling of a
shared option (lw,line_width,n_colors, ...) raisesValueError(issue #68).import EasyFEAtakes about 0.2 s instead of 0.9 s: pyplot, pyvista, pxr, petsc4py,
meshio and scipy.optimize load on first use. Optional dependencies are detected with
importlib.util.find_spec, without importing them (issue #66).
Constitutive laws
FEM.Kinematics(groupElem, displacement, matrixType)replacesHyperElasticState
(breaking). Every law reads the strain measures it needs from it, computed once
and cached: elasticCompute_Sigma(kinematics)andCompute_Psi(kinematics)replace
Calc_Epsilon_e_pg,Calc_Sigma_e_pgandCalc_Psi_e_pg; phase field
Compute_Sigma(kinematics, d),Compute_C(kinematics, d)and
Compute_psi(kinematics)replaceCalc_Sigma_e_pg,Calc_CandCalc_psi_e_pg;
hyperelasticCompute_W,Compute_dWdeandCompute_d2Wdetake aKinematics;
inelastic behaviorsIntegrate(kinematics, z, dt); beamsCompute_Epsilon,
Compute_InternalForcesandCompute_Sigma(kinematics). A simulation's strain or
stress is anFeArrayon a single element group,{groupElem: FeArray}on several
(issue #63).- Elastic laws write only their 3D material-frame Kelvin
C(breaking):_Elastic
rotates it, reads Voigt input, applies the 2D hypotheses, inverts and caches.Cand
Sare read-only,Set_Closesupdate_S,Anisotropiclosesaxis1/axis2, and
the transversely isotropic and orthotropic axes are settable parameters. 3D
AnisotropichonoursuseVoigtNotation, and a 2DAnisotropicwith out-of-plane
axes no longer gives a silently wrongC;Anisotropic.Walpole_Decompositionraises
(issue #65). - The Kelvin–Mandel helpers live in one module (breaking):
Modelskeeps only
Get_PmatandApply_Pmat.KelvinMandel_Matrix,Project_vector_to_matrix,
Project_matrix_to_vector,Project_Kelvin,Result_strain_or_stress_field_eand
Reshape_variableare removed (issue #65). - Heterogeneous parameters on meshes with several element groups: one model per group,
each in its ownTerm(..., groupElem=g)(see the how-to Create models) (issue #62). print(model)lists the declared parameters, including heterogeneous ones.
HyperElastic.Available_LawslistsCiarletGeymonatandHolzapfelOgden. BeamE
andv, and the per-branch parameters ofMaxwellandChaboche, reject arrays.
Finite element arrays
- One lift,
FeArray.broadcast(value, Ne, nPg, tensor_shape)(breaking):
tensor_shapeis required, and a shape that does not fit raises instead of being
guessed.asfearray(x, True),FeArray(x, broadcastFeArrays=True)and
Models.Reshape_variableare removed (issue #64). - A plain array in
@orTensorProdwith anFeArrayis a constant tensor at every
point (it used to raise, or silently sum over Gauss points whennPg == n). Integer
indexing on the element or Gauss axis returns a plainndarray;Norm()without
axisreduces over the tensor axes only (issue #64).
Fixes
Get_Elements_TagandGet_Nodes_TagraiseKeyErroron an unknown tag instead of
returning an empty array (breaking).- Newton solves the
problemTypeit was given, tolerates a zero first residual, raises
on a NaN or infinite residual (superlu_dist used to crash) and on non-convergence
underpython -O. - MPI partition: nodes are owned through main-dimension elements only, and ghosts come
from every element touching an owned node. - Phase field: the psi+ history is stored per element group on mixed meshes;
lsq_linearis chosen in the damage solve; the unlistedWdef_eresult that crashed
is dropped. Mesh.Mergekeeps element and node tags; theMesh.coordsetter notifies observers;
Get_Nodes_Pointfalls back on a distance tolerance;Get_normalsrejects node index
Nn.- Paraview reads
Nefrom each iteration's mesh; GLTF and USDSave_simucheck they
were given a simulation; PyVista rotation arrows are drawn and normalised; the time
unit is right at exact boundaries (60 s, 1 h). - Type annotations across the package, and mypy now sees through the
requires_*and
rank0_onlydecorators.
Development
make lintruns import-linter (pinned in thelintextra): alayerscontract in
pyproject.tomlfails on a new upward import between
Viz > IO > Simulations > Models > FEM > Geoms > Utilities; itsignore_imports(3
left) may only shrink (issue #66).- Tests run in parallel by default (
pytest -n auto); thedevextra adds
pytest-xdist.
Full Changelog: v6.0.0...v7.0.0