What’s New#
This page lists the main changes of Neper version since version .
Several of them change existing behavior or remove options, see Incompatible Changes. old<7.0.0
Highlights#
Python Interface#
Neper can now be used from Python, using the neper Python package: the modules are run as Python functions, whose arguments are the command-line options, Neper’s files (tessellations, meshes, simulation directories, statistics, etc.) are read into NumPy arrays, NumPy arrays are passed to Neper as data, and simulation results computed in Python can be written back for the Simulation Module (-S) and the Visualization Module (-V). The functions of Neper’s orientation library, Orilib, also apply to NumPy arrays. Here, the rotations of the grains during a simulation are computed and plotted in Python.
import neper
sim = neper.read("n20.sim")
ori = sim.read("elsets", "ori") # (steps, grains, 3)
rotation = neper.ori_angle(ori, ori[0], sim.orides)
See Python Interface and Using Neper from Python.
Faster Execution#
All modules run faster, with results of the same quality. For a 1000-cell grain-growth tessellation (-n 1000 -morpho gg), on 12 threads, tessellation (-T) is about 3 times faster (about 1 min instead of 3 min), meshing (-M) about 35 times faster (a few seconds instead of more than 1 min), and visualization (-V) of a cut through the mesh, at 2400 × 2400 pixels, about 1.3 times faster (about 4 s instead of 5 s).
Improved 3D Regularization#
The 3D regularization (-reg) has been improved: for a 1000-cell grain-growth tessellation, it leaves about 9 times fewer edges below the length threshold (53 instead of 475, out of about 1500 before regularization, shown in red). new<7.0.1
$ neper -T -n 1000 -morpho gg -reg 1
Regularization of Periodic Tessellations#
Periodic tessellations can now be regularized, which removes their small edges and so the local mesh overrefinements.
$ neper -T -n 300 -morpho gg -periodicity all -o d -reg 1
$ neper -M d.tess -rcl 0.8 -pl 10
Multiscale Periodic Tessellations#
Multiscale tessellations can now be periodic, and they can also be regularized. Here, grain-growth primary cells are divided into Voronoi secondary cells, whose number is proportional to the volume of the primary cell.
$ neper -T -n "300::vol*300*3" -morpho "gg::voronoi" -periodicity all -o d -reg 1
$ neper -M d.tess -rcl 0.8 -pl 10
See Generating a Multiscale Tessellation (-T) and Generating a Periodic Tessellation (-T).
Conformal Hexahedral Meshing#
Tessellations can now be meshed into hexahedral elements that conform to the cell boundaries (-elttype hex), as done by Gmsh: the cells are meshed into tetrahedral elements, each of which is then split into 4 hexahedral elements. The mesh is conformal between the cells and follows curved domains, and it can be periodic. The element quality is lower than for tetrahedral elements. In 2D, -elttype quad recombines the triangular elements into quadrangular elements before splitting them, which provides a better quality. The former, non-conforming meshes into regular elements are now obtained using -elttype hexgrid and quadgrid. Here, the mesh is shown with half of the elements removed.
$ neper -T -n 100 -morpho gg -reg 1 -o d
$ neper -M d.tess -elttype hex
$ neper -V d.tess,d.msh -showelt3d "y>0.5" -dataelt3dedgerad 0.0015 -cameraangle 12 -print img
Mesh Size Map#
The element sizes inside the faces and cells are now set by a mesh size map: they increase from the boundaries at a rate set by -pl, up to the specified value, so that, for a given value of -rcl, the mesh generally contains fewer elements. The edges follow the same map. Sizes can be set for the vertices, edges, faces and polyhedra, using -[r]clpoly in particular, and progression factors for the edges, faces and polyhedra, using -pl{edge,face,poly}. Here, the mesh of a grain of a grain-growth polycrystal, cut at its centroid, is finer at the edges than at the faces, and at the faces than in the volume.
$ neper -T -n 50 -morpho gg -reg 1 -o d
$ neper -M d.tess -meshpoly "id==2" -faset none -rcl 1.5 -rclface 0.2 -rcledge 0.04 -pl 1.4
$ neper -V d.tess,d.msh -showelt3d "y>0.38" -showelt1d "elset1d>=13&&elset1d<=48" -print img
Exact Curved Domains#
Cylindrical and spherical domains are now exact (curved) instead of faceted, unless a number of facets is requested, and they remain exact when translated or rotated. An hourglass domain has been added. Meshes follow the curved surfaces, including their second-order nodes, and large faces are meshed more accurately.
$ neper -T -n 1000 -morpho gg -morphooptistop val=1e-2 -reg 1 -domain "hourglass(1.5,1,0.95)"
$ neper -M n1000-id1.tess
Discontinuous and Cohesive Elements for Periodic and Multiscale Tessellations#
Option -interface can now produce discontinuous and cohesive interfaces for periodic tessellations, where an interface between a cell and the periodic image of another cell is described at its master location, and for multiscale tessellations, with a different value for each scale (e.g., cohesive elements between the primary cells only).
$ neper -M per.tess -interface cohesive
$ neper -M n10x10.tess -interface "cohesive::continuous"
Custom Node Sets#
Option -nset can now define node sets from expressions, as <label>:<expr>, and from min, max and closest. A node set can then be shown using -shownode nset==<label>. Here, a node set is defined at the center of the top face of the hourglass sample of Exact Curved Domains.
$ neper -T -n 1000 -morpho gg -morphooptistop val=1e-2 -reg 1 -domain "hourglass(1.5,1,0.95)"
$ neper -M n1000-id1.tess -nset "faces,edges,vertices,topcenter:closest(0.5,0.5,1.5)"
$ neper -V n1000-id1.tess,n1000-id1.msh -shownode nset==topcenter -datanodecol red -datanoderad 0.04
Orilib Program#
The orilib program can run most of the functions of the Orilib library from the command line, interactively or in scripts, for example to convert orientations between descriptors or to compute disorientations:
$ echo 0 30 0 | orilib ol_e_q
0.965925826 0.258819045 0.000000000 0.000000000
It is installed together with neper, and its functions are also available in Python (see Orilib). See Orilib Program.
Tutorials#
The tutorials have been extended and rewritten, and they now cover most capabilities of Neper, from tessellation generation to meshing, visualization and post-processing of simulation results. Each tutorial is a step-by-step guide whose commands can be run directly, and they are part of the documentation:
New Capabilities by Module#
Tessellation Module (-T)#
Exact cylinder and sphere domains, also for a cylinder periodic along its axis, and hourglass domain (
-domain). The curved domain faces are labeledcylorhourglass.Improved cutting algorithm (direct cutting).
Periodic multiscale tessellations.
-transform rmseed, which removes seeds matching expressions and recomputes the tessellation, and the seed keyscell_<key>, which give access to the keys of the cell of a seed.-transform renamedomface, which renames a domain face.-regdelcell, which allows regularization to delete cells.Improved 3D regularization. new<7.0.1
Expressions in all
-statoptions.curpdf0value of-morphooptilogdis, for the current, not smoothed PDF.Faster morphology optimization: about 25% faster computation of the cells, and faster neighbor search.
Deterministic morphology optimization, and results of regularization that do not depend on the build.
Meshing Module (-M)#
Conformal hexahedral and quadrangular meshing, by splitting tetrahedral and triangular elements, as Gmsh does, and, in 2D, recombining triangular elements first (
-elttype hexandquad).Mesh size map, for the edges, faces and cells (
-pl), with-[r]clpoly,-pl{edge,face,poly}and-mesh2dclreps.Custom node sets, as
<label>:<expr>,min,maxandclosest(-nset).discontinuousandcohesiveinterfaces for periodic tessellations (-interface).Second-order nodes projected onto the curved faces and edges.
Improved meshing of the curved faces: conformal projection for the sphere, and conformal unrolling for the hourglass and torus cuts.
Any number of partitions, not necessarily a power of 2 (
-part). new<7.0.1Any number of partitions, not necessarily a power of 2, also as partitions and subpartitions (
<part_number>:<subpart_number>, e.g., for computer nodes and their cores) (-part). new>=7.0.1Node sets kept when a mesh is loaded without its tessellation, and updated by
-orderand-sortnode.Expressions in all
-statoptions.Reproducible parallel grid meshing of regularized tessellations (
-elttype hexgrid).Abaqus surfaces for hexahedral elements (
-format inp).
Simulation Module (-S)#
<res>_eqelement, elset and mesh results, which give the equivalent value of a symmetric tensor result, as computed by FEPX (e.g.,stress_eq).Simplified simulation directories: the directory content is read directly, without a
.simfile, and definitions are written to.deffiles. Input files are identified by their extensions and are not necessarily namedsimulation.*.type=argument offile(), and steps of a simulation directory without results set from the.step*files offile().Case-insensitive keywords and values in
simulation.cfg.Steps without result files skipped during post-processing.
Clear error messages for invalid simulation directories, configuration files and results.
Visualization Module (-V)#
Sample symmetry in orientation space (
-orisym).Highlighting colors
hl1,hl2andhl3.Node sets in the expressions of
-shownode(nset==<label>).-crysymfor-space rodrigues.Clear errors when POV-Ray or Asymptote is missing or does not generate a file.
General#
Python interface (
neperpackage), which runs the modules from Python, reads Neper’s files into NumPy arrays, passes NumPy arrays to Neper and writes simulation results, see Python Interface.orilib program, which can run most of the functions of the Orilib library from the command line (installed together with neper) and from Python, see Orilib Program.
Fewer dependencies: NLopt is no longer needed.
macOS compatibility fixes, and Bash completion for all options.
Numerous bug fixes in all modules, including memory errors found with AddressSanitizer.
Bug Fixes#
Tessellation Module (-T)#
Regularization (
-reg). 7.0.1 old>=7.0.0Failures of the morphology optimization for large numbers of cells and wide size distributions:
-morphooptideltamaxnow defaults to the average domain size (domsize) and accepts expressions ofavdiameqanddomsize. 7.0.1 old>=7.0.0
Meshing Module (-M)#
Partitions and subpartitions restored (
-part <part_number>:<subpart_number>), and no longer limited to powers of 2. 7.0.1 old>=7.0.0Failures and hangs of the Gmsh workers on macOS. 7.0.1 old>=7.0.0
Simulation Module (-S)#
Grain orientation spread of raster tessellations (
-rescell gos), which was computed relative to the identity instead of the average orientation of the cell. 7.0.1 old>=7.0.0
Visualization Module (-V)#
Default radii of the 1D elements and of the element edges of 2D meshes, which appeared about twice as thick as for 3D meshes. 7.0.1 old>=7.0.0
General#
Other bug fixes, mostly crashes and missing error messages on invalid input (see VERSIONS). 7.0.1 old>=7.0.0
Incompatible Changes#
Tessellation Module (-T)#
Warning
Seed weights are now the actual Laguerre weights, \(w\) (power distance \(d^2 - w\)), instead of their square roots. Tessellations are unchanged, but the weight values are not. In particular, -morphooptiini weight:radeq (and avradeq, etc.) must be replaced by weight:radeq^2 (and avradeq^2, etc.): the former syntax still runs, with no warning, but sets a different initial solution. Custom weight values (real values, data files, multiscale cell files) must be squared too.
The
tessandtesrfile format versions are now 3.6 and 2.3. Older files can still be read, and their weights are converted; new files cannot be read by former versions.-morphooptiboundlower/upper w:, and thewkeys of-morphooptilogvarand-statcell/-statseed, now apply to \(w\), while-morphooptideltamaxapplies to \(\sqrt{w}\), the optimization variable.-orioptiininow uses:instead of=, as-morphooptiinidoes (e.g.,weight:file(<file>)instead ofweight=<file>). The former syntax is now an error.-regularization,-fmax,-[r]sel,-mloopand-maxedgedelqtyare renamed-reg,-regfmax,-reg[r]sel,-regloopand-regedgedelmax(the former names are deprecated).[r]selis removed from-morpho.The transformations of
-loadtesrare removed (use-transform).Only the built-in
subplexoptimization algorithm remains (praxis,neldermead,cobyla,bobyqaandnewuoaare removed).
Meshing Module (-M)#
The Gmsh library is now mandatory (version 4.9 or higher), and the gmsh program is no longer used:
-gmshand-tmpare obsolete.The 3D meshing algorithm
netgis no longer available.The element sizes change as a result of the mesh size map.
The node order of the
$Fasetselements is now the Gmsh order (it was reversed), and themshformat version is now 2.4 (version 2.3 can still be read).Nodes and elements are no longer renumbered by partition after partitioning (left to FEPX).
-partnow takes only a number of partitions, and-partmethodis removed (libscotch is always used). new<7.0.1-partmethodis removed (libscotch is always used). new>=7.0.1The transformations of the tesr input are removed (use
neper -T -transform).-elttype hex,quadandquad9, which provided non-conforming meshes into regular elements, are renamedhexgrid,quadgridandquad9grid(quad9is deprecated), and-elttype hexandquadnow provide conformal meshes.The
msh4format (Gmsh version 4 mesh file) is removed from-format, and unknown values of-formatare now errors.
Simulation Module (-S)#
Simulation directories no longer use a
.simfile (the definitions of a legacy file are migrated).The old simulation directory format (report file) can no longer be read.
The conversion of FEPX raw result directories (
post.report) is removed.-stepis removed.-orispacenow only acceptsrodrigues(fr<N>).ODF-based results are not available for the triclinic crystal symmetry.
Visualization Module (-V)#
-colormode(dark color mode),-povrayantialiasing(antialiasing is always used) and-outdir(images are written relative to the current directory) are removed.