Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

🌐 English | Deutsch

Adaptive, Lightweight Finite Element Tool (ALF)

ALF is a lightweight, adaptive FEM program that was developed as part of a Thesis for the Institute of Continuum Mechanics (IKM) at Leibniz University Hannover (LUH). The focus is on testing various probability density functions for the uncertainty quantification of linear FEM and simple, nonlinear material models for nonlinear FEM.


🧬 Development

  • Language standard: C++23
  • Compiler: gcc/g++
  • Platform: Windows 11
  • Subsystem: Msys MinGw64
  • Buildsystem: Make

🔧 Features

  • Performing linear finite element analyses (FEAs)
  • Performing linear FEAs with uncertainty quantification
  • Performing nonlinear FEAs for simple nonlinear material models
  • Visualize results using 2D/3D Rendering
  • Vary and test probability densities over the user interface
  • Control result visualization over the user interface

🛠️ Implementation

The program works with a purely file-driven model definition (mesh, material model, boundary conditions, etc.) and information provision (isoparametric element, templates for probability densities, etc.). The information is provided using files in easily understandable file formats (mostly JSON). This allows models to be implemented quickly, program functions to be expanded dynamicly, and simulations to be performed without the need for lengthy preparation.

🧩 Usage

ALF can be used in three different ways.

  • via UI (most mature)
  • via API
  • as a C++ library

🚀 Download

  • Program (UI): Download precompiled binaries from the latest release
  • API: Download precompiled binaries from the latest release
  • Library: Download precompiled binaries from the latest release
  • Source code: Clone the project with git, set up the environment with make prefab, and compile and run the program with make launch

🖥️ User interface

The user interface allows you to load and manage models and control the visualization of results. It is divided into a menu bar (top of the window) and an expandable/collapsible tab view (right half of the window). The menu bar offers import, settings, and management options. The tab view can be used to accelerate the testing of probability densities and control the visualization. Rendering takes place in the main compartment.

Übersicht über Benutzeroberfläche

🗂️ Model import

Selecting File->Open->Model opens a file selection dialog that allows you to select the model folder. When the model is imported, the files are read, parsed, translated into internal program structures, and the simulation is performed. The Results are rendered in the central compartment of the window. The Navigation within this view is not possible for two-dimensional systems. For three-dimensional systems, the view can be changed using several camera movements. An overview over the camera movements and controls is listed in Shortcuts. The tab view in the right side of the window allows you to set the mesh on which the visualization is performed, the visualized magnitude, and more. Under Rendering->Animation a playback dialog can be found, wich allows you to navigating within the simulation results for the nonlinear FEA (animation).

📊 Example model

The following shows an example of the model definition for a linear FEM. Further example models that can be imported directly are located in the Import folder. The definition of the isoparametric element is already stored for several standard cases such as simple triangular/quadrangular and cube elements. If the mesh uses an isoparametric element that has not been implemented, it must be implemented in the [Recc/Cells] folder. Information on this can be found in the implementation files of the existing elements under Recc/Cells and the Thesis.

🏗️ Structure

A model is defined by a set of files. The individual files of the definition are placed in a folder with the extension .model. All necessary files are automatically read from this folder.

Workdirectory of the pogram/
|__ build/
|__ Recc/
| |__ Cells/
| | |__ CPS4R.ISOPARAM // JSON file
| | |__ CPS3.ISOPARAM // JSON file
| | |__ für Modell relevantes Element // JSON file
| | |__ ...
| |__ ...
||__ Import/
| |__ ModelName.model/
| | |__ .Mesh // INP file create and manage with Abaqus or by hand
| | |__ .Material // JSON file create and manage by hand
| | |__ .Constraints // JSON file create and manage by hand
| | |__ .RESULTCACHE // Bytecode file gets created and managed by the program
| |__ ...
|__ ...

There are also other optional files that can be generated or included.

  • .RESULTS file: contains all simulation results in JSON format
  • .VertexShader file: vertex shader in GLSL format
  • .FragmentShader file: fragment shader in GLSL format

The .RESULTS file can be generated using the UI with File->Export->*.RESULTS or via the API with simulate and contains all result values (displacements, stresses, strains, etc.) of the simulation performed. Shaders can be added for improved rendering. The examples in Import show the uniforms, inputs, and outputs passed and expected by the program.

🕸️ Mesh definition

The .Mesh file defines the geometry and meshing of the model. It is in INP format.

*Heading
...
*Node // Definition of the Nodes
1, 0., 0.
...
121, 0.12, 0.12
*Element, type=CPS4R // Definition of the Cells
1, 1, 2, 13, 12 // The name of the isoparametric element appearing here must be stated when defining
// the isoparametric element
... // >> Definition by CPS4R.ISOPARAM (already available as a standard type)
100, 109, 110, 121, 120
*End Part
...
*End Assembly

📐 Definition of boundary conditions

The .Constraints file defines the boundary conditions, i.e., the fixed degrees of freedom and the applied forces.

{//"Constraints" : [{"1" : [0,1]},{"11" : [1]}],"Loads" : [{"11" : [{"0": 1000}]}]}

🧱 Definition Material

The .Material file defines the material model and controls the simulation process.

{"isLinear": true,// For uncertainty quantification or nonlinear Materials// "nonLinearApproach": {...},// "pdf" : {...}"stdParams": {"E": 20000.0,"t": 0.1,"v": 0.3}}

The following variables can be used for the nonlinear material equations under the labels mentioned.

variablesubstitution
u_nDisplacement of the element in the previous frame
u_n_plus_1Displacement of the element in the current frame
epsilon_nStrain at the quadrature point in the previous frame
epsilon_n_plus_1Strain at the quadrature point in the current frame
sigma_nStress at the quadrature point in the previous frame
sigma_n_plus_1Stress at the quadrature point in the current frame
{innerVariable}_nValue of the self-named inner variable at the quadrature point in the previous frame
{innerVariable}_n_plus_1Value of the self-named internal variable at the quadrature point in the current frame
ElastTensorElasticity tensor
SDeviator matrix
IIdentity matrix with as many rows as B
BB matrix
jDetJacoby determinant
tThickness
wWeight of the quadrature point
Identity(scalar)Returns the unit matrix of the transferred size
frobenius(tensor)Returns the Frobenius norm of the transferred size
macaulay(scalar)Returns the Macaulay norm of the transferred size
abs(scalar)Returns the absolute value of the transferred size

Further information on the definition of probability densities and the nonlinear material model is provided via various example models in Import and the accompanying student Thesis.

🔌 API

The API can be used to simulate models without a user interface. The API automatically generates the .RESULTS file in JSON format. This allows the program to be called from other projects, programs, or scripts. FEM simulations can be performed in the background and the results can be loaded into the external project/program using a JSON parser. To do this, the API must be called with the simulate argument and the path to the FEM model. If the path is absolute rather than relative to the current working directory, this is specified using the --absolute flag.

# Simulation via release (ALFAPI) without logging or debugging (ALFAPI_d) with logging
.\path\to\build\ALFAPI simulate Import/2DLinearExample.model # Path specification relative path
.\path\to\build\ALFAPI simulate C:/.../Import/2DLinearExample.model --absolute # Path specification absolute path

⌨️ Shortcuts

The following shortcuts are used to speed up

ShortcutFunction
l holdNormal Planar Camera
r holdOrbital Camera
l+r holdFPS Camera
w/a/s/d/shift/spaceMovement in fps Camera
arrowKeys/shift/spaceMovement in fps Camera
F11toggle Fullscreen
Ctoggle cursor
Spaceresample pdf
Ctrl + Cclear calculation cache of loaded model
Ctrl + Rload last opened model or reload current model
Ctrl + Uunload model
Ctrl + Oopen file selection dialog for models
(Ctrl + Space) / left / rightToggle tab view
NOpen Mesh tab
MOpen Material tab
ROpen Rendering tab
up/downNavigation in subtabs
F1Screenshot FEM system
F2Screenshot FEM system + UI
F3Screenrecord FEM system
F4Screenrecord FEM system + UI

🤝 Many thanks

I would like to express my special thanks to my supervisor Dr. Hendrik Geisler, who made this Thesis possible spontaneously and through his support and was a great help during its development.

Hendrik Geisler was funded by the European Union (ERC, Gen-TSM, project number 101124463) during the supervision period. However, the views and opinions expressed are solely those of the author(s) and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the funding authority can be held responsible for them.

📚 Libraries used

I would also like to thank the respective developers and maintainers of the open-source libraries used in the project. These are listed below. The corresponding license texts are stored in the thirdPartyLicenses folder.

LibraryLicense
raylibzlib/libpng
EigenMPL2 (Mozilla Public License 2.0)
SymEngineBSD 2-Clause
magic_enumMIT
nlohmann/jsonMIT
Boost.PFRBoost Software License 1.0
Dear ImGuiMIT
rlImGuiMIT
ImPlotMIT
ImGuiFileBrowserMIT

About

Adaptive Lightweight Finite Element Tool

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages