FeenoX for Academics

Get PDF version

2024-01-20

Table of contents

1 What

FeenoX is a cloud-first Unix stand-alone program (i.e. something your run, not something you have to link existing code against) that reads an engineering-related problem in a plain-text file containing definitions and instructions. That is to say, it reads the problem to be solved at run time and does not require the user (most of the time these will be industry engineersa> and not hackers nor PhDs) to compile and link custom code in order to solve a problem because it is not a library. It does not require the users to write a weak form of the PDE they want to solve, because most of them will not even know what a weak form is (and they certainly do not need to know that). The user chooses from a set of built-in PDEs using the PROBLEM definition which internally resolves (at run time) a set of function pointers to the appropriate locations which will build the elemental objects which correspond the to chosen PDE. The list of available PDEs can be peeked by executing the feenox binary with the --pdes option:

$ feenox --pdes
laplace
mechanical
modal
neutron_diffusion
neutron_sn
thermal
$ 

During the compilation procedure (based on Autotools), the source tree in src/pdes is parsed. For each subdirectory, a new PDE is embedded into the compiled binary. See below for further details about this extensibility mechanism.

This program then solves the problem and, eventually, writes the outputs which the input file requests with explicit instructions (and nothing if nothing is asked for) and returns back to the Unix shell:

# NAFEMS Benchmark LE-10: thick plate pressure
PROBLEM mechanical DIMENSIONS 3
READ_MESH nafems-le10.msh   # mesh in millimeters

# LOADING: uniform normal pressure on the upper surface
BC upper    p=1      # 1 Mpa

# BOUNDARY CONDITIONS:
BC DCD'C'   v=0      # Face DCD'C' zero y-displacement
BC ABA'B'   u=0      # Face ABA'B' zero x-displacement
BC BCB'C'   u=0 v=0  # Face BCB'C' x and y displ. fixed
BC midplane w=0      #  z displacements fixed along mid-plane

# MATERIAL PROPERTIES: isotropic single-material properties
E = 210e3   # Young modulus in MPa
nu = 0.3    # Poisson's ratio

SOLVE_PROBLEM   # solve!

# print the direct stress y at D (and nothing more)
PRINT "σ_y @ D = " sigmay(2000,0,300) "MPa"

It can be seen as a Unix filter (or as a transfer function)

                             +------------+
 mesh (*.msh)  }             |            |             { terminal
 data (*.dat)  } input ----> |   FeenoX   |----> output { data files
 input (*.fee) }             |            |             { post (vtk/msh)
                             +------------+

which, when zoomed in, acts as a “glue layer” between a mesher (Gmsh) and a library for solving large sparse problems (PETSc) which for linear elastic looks as follows:

 

Further discussion can be found in the tensile test tutorial. Check out the section about invocation in the FeenoX manual.

The design responds to a Software Requirement Specifications document that acts as a “request for quotations” of a computational engineering tool that should satisfy some fictitious (but plausible) requirements. The Software Design Specifications document explains how FeenoX addresses each requirement of the SRS.

In principle, even though FeenoX can solve generic numerical problems and systems of ordinary differential/algebraic equations, its main objective is to solve partial differential equations using the finite element method—eventually in parallel using the MPI standard. The current version can solve

Heads up! The background of FeenoX’s main author is Nuclear Engineering. Hence,

As mentioned in the previous section, FeenoX provides a mechanism to add new types of PDEs by adding a new subdirectory to the src/pdes directory of the source tree and then re-bootstrapping, re-configuring and re-compiling the code.

Since in FeenoX’s input file everything is an expression, the code is especially suited for verification using the method of manufactured solutions.

2 How

FeenoX tries to achieve its goals by…

In effect, FeenoX provides a general mathematical framework to solve PDEs with a bunch of entry points (as C functions) where new types of PDEs (e.g. electromagnetism, fluid mechanics, etc.) can be added to the set of what FeenoX can solve. This general framework provides means to

The particular functions that implement each problem type are located in subdirectories src/pdes, namely

Researchers with both knowledge of mathematical theory of finite elements and programming skills might, with the aid of the community, add support for other PDES. They might do that by using one of these directories (say laplace) as a template and

  1. replace every occurrence of laplace in symbol names with the name of the new PDE
  2. modify the initialization functions in init.c and set
    • the names of the unknowns
    • the names of the materials
    • the mathematical type and properties of problem
    • etc.
  3. modify the contents of the elemental matrices in bulk.c in the FEM formulation of the problem being added
  4. modify the contents of how the boundary conditions are parsed and set in bc.c
  5. re-run autogen.sh, ./configure and make to get a FeenoX executable with support for the new PDE.

As we mentioned in FeenoX for hackers, Alan Kay’s says: “simple things should be simple and complex things should be possible.” Of course, the addition of non-trivial PDEs is not straightforward, but possible (at that time we were discussing the first half of the quote, now we refer to the second part). The programming guide contains further details about how to contribute to the code base.

3 Why

The world is already full of finite-element programs, and every day a grad student creates a new one from scratch. So why adding FeenoX to the already-crowded space of FEA tools? Because there are either

  1. libraries which need code to use them such as
    • Sparselizard
    • MoFEM
    • FEniCS
    • MFEM
  2. end-user programs which need a GUI such as
    • CalculiX
    • CodeAster

FeenoX sits in the middle. It is the only free and open-source tool that satisfies the Software Requirement Specifications, including that…

See FeenoX for hackers for another explanation about why FeenoX is different from other computational tools.