• sparselizard

    FAST FINITE ELEMENT C++ LIBRARY

  • sparselizard

    GENERAL NONLINEAR MULTI-PHYSICS

  • sparselizard

    USER FRIENDLY

  • sparselizard

    OPEN SOURCE

  • sparselizard

    NONLINEAR HARMONIC ANALYSIS

OVERVIEW

Sparselizard (Copyright (C) 2017-2019 Alexandre Halbach, University of Liege, Belgium) is a general, multiphysics, open source C++ finite element library running on Linux, Mac and Windows. It is user friendly, robust, fast and multithreaded. It is used to design next generation microdevices and it is validated against analytical solutions, third party software and measurements of the fabricated devices. It can handle a rather general set of problems in 3D, 2D and 1D such as mechanical, fluid flow (laminar, creeping), acoustic, thermal, electric, magnetic, electromagnetic, piezoelectric, superconductor, buckling, contact,... problems (provided in form of a weak formulation as detailed in this wikipedia page ). Problems with several millions of unknowns in 3D and several tens of millions of unknowns in 2D have been solved within minutes on up to 16 cores/32 threads. Some built-in geometry definition and meshing tools are also provided. A working example that solves an electrostatic problem on a grounded 3D disk with electric volume charges can be found below:

int vol = 1, sur = 2;             // Disk volume and boundary as set in ’disk.geo’
mesh mymesh("disk.msh");

field v("h1");                    // Nodal shape functions for the electric potential
v.setorder(vol, 2);               // Interpolation order 2 on the whole domain
v.setconstraint(sur, 0);          // Force 0 V on the disk boundary

formulation elec;                 // Electrostatics with 1 nC/m^3 charge density
elec += integral(vol, -8.85e-12 * grad(dof(v)) * grad(tf(v)) + 1e-9 * tf(v));

solve(elec);                      // Generate, solve and save solution to field v

(-grad(v)).write(vol, "E.vtk");   // Write the electric field to ParaView format

The built-in geometry definition and mesher can be used for now for rather simple 2D or extruded 3D geometries. Meshes of complex geometries can be imported from the widely-used open-source GMSH meshing software or from various other supported mesh formats (see the mesh object in the documentation). Points, lines, triangles, quadrangles, tetrahedra, hexahedra, prisms or any combination thereof are accepted in the mesh. Element curvature for an accurate representation of the geometry is supported. The result files output by sparselizard are in .vtk (ParaView) or .pos (GMSH) format.

The problems can be readily solved in time with a time-stepping resolution or with the natively supported multiharmonic resolution method. In the latter case the steady-state solution of a time-periodic problem can be obtained in a single step, for linear as well as for nonlinear problems.
The library comes with hierarchical high order shape functions so that high order interpolations can be used with an interpolation order adapted to every unknown field and geometrical region.

EXAMPLES

VON KARMAN VORTEX STREET


Von Karman vortex street

The laminar air flow around a cylinder is simulated in time for an increasing air velocity. A von Karman vortex street appears at a high enough air velocity. The flow can be visualized in time here.

SEE EXAMPLE

MAGNETIC INDUCTION, SKIN EFFECT


Fluid flow in a microvalve

An AC voltage is applied to a coil surrounding an aluminium tube in which currents are induced. In the current density image displayed the skin effect in the thick copper wire of the coil is also visible.

SEE EXAMPLE

MECHANICAL RESONANCE MODES


Mechanical disk eigenmodes

The eigenmodes and eigenfrequencies are obtained for a 3D disk clamped at its boundary.

SEE EXAMPLE

ELECTROMAGNETIC WAVEGUIDE


Electromagnetic waveguide

A cross shaped perfectly conducting 3D waveguide is excited with an imposed electric field at one end. Follow this link for a transient time resolution video.

SEE EXAMPLE

TOPOLOGY OPTIMIZATION


Topology optimisation

This mechanical steel structure is automatically optimized to withstand a given force with the minimum possible steel volume. This was obtained with a third-party C++ topology optimization code developed using the sparselizard library for all finite element calculations.

PIEZOELECTRIC MICRO-BILAYER


Piezoelectric micro-bilayer

A micro-sized bilayer is made up of a piezoelectric PZT layer and a polysilicon layer. The piezo is sandwiched between two electrically actuated electrodes. The harmonic actuation creates a harmonic deflection of the bilayer. Follow this link for a time visualisation video.

SEE EXAMPLE

BUCKLING, GEOMETRIC NONLINEARITY


MEMS with fluid coupling

A prestressed 3D bilayer micromembrane is pushed downwards by the atmospheric pressure. The static deflection and resonance frequency shift is simulated thanks to a small-strain geometric nonlinearity formulation. With little effort this example can be adapted to simulate buckling in time, as shown in this video.

SEE EXAMPLE

FLUID COUPLED PIEZO ACTUATED MEMS


MEMS with fluid coupling

A piezoelectric actuated micromembrane (PMUT) outputs ultrasound pressure waves in air. The simulation is performed in 2D using axisymmetry. Follow this link for a time visualisation video of a smilar device (CMUT).

SEE EXAMPLE

CONDUCTOR HEATING DUE TO DC CURRENT


Conductor heating due to DC current

A voltage is applied across a 3D tungsten conductor in vacuum. The (strong) DC current flow as well as the induced thermal heating (displayed) is simulated. The influence of the temperature on the material properties is taken into account with a nonlinear loop.

SEE EXAMPLE

PERMANENT MAGNETS, MAGNETIC FORCE


Permanent magnets

The static magnetic field created by an array of permanent magnets is simulated using the scalar magnetic potential formulation. The Halbach configuration shows as expected a magnetic field strength increase. The potential and the magnetic field lines are illustrated.

SEE EXAMPLE

HALF-WAVE DIPOLE ANTENNA


Half-wave dipole antenna

The 1 GHz electromagnetic wave radiation of a half-wave dipole antenna is simulated. The electric field, magnetic field and Poynting vector are computed and can be visualized in time. The electric field can be visualized here.

SEE EXAMPLE

CONTACT MECHANICS, COLLAPSED CMUT


Collapsed CMUT

The collapse mode of a CMUT ultrasonic transducer is simulated (in collapse mode the membrane touches the bottom of the cavity). The static deflection as well as the small signal vibration are simulated and illustrated on the image. The collapse mode of a CMUT can be visualized here (vibration in a fluid) and here (static collapse).

SEE EXAMPLE

MAGNETIC SHIELDING OF A DC CURRENT


Magnetic shielding of a DC current

A 3D steel cylinder is placed nearby a wire with a given static current density. The magnetic vector potential formulation is used. A gauge condition is added in combination with a spanning tree to remove the singular matrix problem associated with the formulation.

SEE EXAMPLE

GEOMETRY DEFINITION AND MESHING


Geometry definition and meshing

The sparselizard geometry builder and mesher are used to create and mesh this simple 3D mechanical structure (top view above). The deformation of the structure subject to a torsion force is then simulated.

SEE EXAMPLE

POTENTIAL AIR FLOW AROUND AN AIRFOIL


Potential air flow around an airfoil

A NACA0012 airfoil is put in a subsonic air flow. The problem is nonlinear because the air density is a function of the air speed. The picture shows the Mach number everywhere around the airfoil.

SEE EXAMPLE

HIGH TEMPERATURE SUPERCONDUCTOR


High temperature superconductor

A thin superconducting tube is subject to an applied magnetic field that increases over time. As the magnetic field is increased it progressively penetrates in the tube until the tube is not able to perfectly shield its interior volume anymore. The time-solution can be visualized here.

SEE 2D EXAMPLE SEE 3D EXAMPLE

RESISTANCE AND CAPACITANCE


RC simulation

The resistance and capacitance is computed for a 3D geometry made of a conducting trace connected to a circular-shaped, parallel-plate air capacitor. The simulated capacitance matches the parallel plate formula. The quadrature electric potential field is displayed on the picture above.

SEE EXAMPLE

INCOMPRESSIBLE LAMINAR FLOW


Laminar flow

The nonlinear Navier-Stokes equations for incompressible laminar flow are solved with a Newton iteration to simulate the water flow past a step in a 1 mm pipe. The top image shows the flow velocity, the bottom image shows the pressure field.

SEE EXAMPLE

FLUID FLOW IN A MICROVALVE


Fluid flow in a microvalve

The flow speed magnitude (top) and the pressure field (bottom, 100 Pa at left inlet and 0 Pa at right outlet) are computed for a low Reynolds (Stokes) flow in a microvalve.

SEE EXAMPLE

DOWNLOAD

The easiest way to get the sparselizard C++ finite element library running on Linux and Windows 10 is to use its static library, even though better performances will be obtained when compiled on your computer.
Get sparselizard running with one of the following options:

Windows 10, Mac, Linux - Compiling the source code
  • This option gives the best performance
  • Download the source code here
  • Follow the instructions in the documentation
  • On Windows 10 get first an Ubuntu Linux subsystem as detailed here
  • (more info on how to access files from each side here)
Linux - Static library (TUTORIAL VIDEO)
  • Watch the tutorial video
  • Download the static library here (or here if no AVX support) and open the folder in a terminal.
  • Run 'g++ -O3 -fopenmp -std=c++11 main.cpp -L ./ -l sparselizard -pthread -l dl -I headers -o slexe;'
  • Run './slexe'
  • Visualise the output .vtk file with ParaView
Windows 10 - Static library with Linux subsystem
  • Watch the tutorial video for Linux
  • Install an Ubuntu subsystem on Windows 10 as detailed here
  • (more info on how to access files from each side here)
  • Download the static library here using 'wget' to the Ubuntu subsystem
  • Run 'sudo apt-get install unzip' then unzip the file
  • Run 'sudo apt-get install g++' to install the C++ compiler
  • In the unzipped file run 'g++ -O3 -fopenmp -std=c++11 main.cpp -L ./ -l sparselizard -pthread -l dl -I headers -o slexe;'
  • Run './slexe'
  • Visualise the output .vtk file with ParaView. This has to be done on Windows unless graphics are supported in your subsystem
Windows (others), Mac - Virtual Linux machine
  • A virtual Ubuntu Linux can be easily installed using VirtualBox.

Take a look at the examples in the 'examples' folder and at the documentation for a smooth introduction.

CITE US

If you like this library do not hesitate to cite the following reference:
"Sparselizard - the user friendly finite element C++ library"
Alexandre Halbach, University of Liege, Belgium

CONTACT

It would be a pleasure to answer any of your questions or to get your bug reports.
In the latter case please provide a minimal code including the bug.

ALEXANDRE HALBACH


PhD - Electrical Engineering

alexandre.halbach at gmail.com