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.

_images/python.png

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).

_images/faster-execution.png

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
_images/reg-edges.png

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

See Meshing a Tessellation (-T, -M).

_images/periodic-reg.png

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).

_images/multiscale-periodic.png

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

See Meshing a Tessellation (-T, -M).

_images/hex-mesh.png

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

See Meshing a Tessellation (-T, -M).

_images/mesh-size-map.png

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

See Defining the Domain and Cutting (-T).

_images/hourglass-mesh.png

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

See Meshing a Tessellation (-T, -M).

_images/custom-nset.png

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.

_images/orilib-terminal.png

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 labeled cyl or hourglass.

  • Improved cutting algorithm (direct cutting).

  • Periodic multiscale tessellations.

  • -transform rmseed, which removes seeds matching expressions and recomputes the tessellation, and the seed keys cell_<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 -stat options.

  • curpdf0 value 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 hex and quad).

  • 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, max and closest (-nset).

  • discontinuous and cohesive interfaces 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.1

  • Any 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.1

  • Node sets kept when a mesh is loaded without its tessellation, and updated by -order and -sortnode.

  • Expressions in all -stat options.

  • Reproducible parallel grid meshing of regularized tessellations (-elttype hexgrid).

  • Abaqus surfaces for hexahedral elements (-format inp).

Simulation Module (-S)#

  • <res>_eq element, 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 .sim file, and definitions are written to .def files. Input files are identified by their extensions and are not necessarily named simulation.*.

  • type= argument of file(), and steps of a simulation directory without results set from the .step* files of file().

  • 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, hl2 and hl3.

  • Node sets in the expressions of -shownode (nset==<label>).

  • -crysym for -space rodrigues.

  • Clear errors when POV-Ray or Asymptote is missing or does not generate a file.

General#

  • Python interface (neper package), 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.0

  • Failures of the morphology optimization for large numbers of cells and wide size distributions: -morphooptideltamax now defaults to the average domain size (domsize) and accepts expressions of avdiameq and domsize. 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.0

  • Failures 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 tess and tesr file 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 the w keys of -morphooptilogvar and -statcell / -statseed, now apply to \(w\), while -morphooptideltamax applies to \(\sqrt{w}\), the optimization variable.

  • -orioptiini now uses : instead of =, as -morphooptiini does (e.g., weight:file(<file>) instead of weight=<file>). The former syntax is now an error.

  • -regularization, -fmax, -[r]sel, -mloop and -maxedgedelqty are renamed -reg, -regfmax, -reg[r]sel, -regloop and -regedgedelmax (the former names are deprecated).

  • [r]sel is removed from -morpho.

  • The transformations of -loadtesr are removed (use -transform).

  • Only the built-in subplex optimization algorithm remains (praxis, neldermead, cobyla, bobyqa and newuoa are removed).

Meshing Module (-M)#

  • The Gmsh library is now mandatory (version 4.9 or higher), and the gmsh program is no longer used: -gmsh and -tmp are obsolete.

  • The 3D meshing algorithm netg is no longer available.

  • The element sizes change as a result of the mesh size map.

  • The node order of the $Fasets elements is now the Gmsh order (it was reversed), and the msh format 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).

  • -part now takes only a number of partitions, and -partmethod is removed (libscotch is always used). new<7.0.1

  • -partmethod is removed (libscotch is always used). new>=7.0.1

  • The transformations of the tesr input are removed (use neper -T -transform).

  • -elttype hex, quad and quad9, which provided non-conforming meshes into regular elements, are renamed hexgrid, quadgrid and quad9grid (quad9 is deprecated), and -elttype hex and quad now provide conformal meshes.

  • The msh4 format (Gmsh version 4 mesh file) is removed from -format, and unknown values of -format are now errors.

Simulation Module (-S)#

  • Simulation directories no longer use a .sim file (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.

  • -step is removed.

  • -orispace now only accepts rodrigues(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.