Skip to content

obiwac/bfm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

382 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BFM

Big F'ing Matrix. FEM/FEA C library (libbfm) with Python bindings (pybfm) for use as an educational tool.

Originally our final assignment for LEPL1110.

Results

Classical bridge desgin "Beehive" bridge design
naive alveole

Building

This repo is composed of two components; the backend libbfm, which implements all the routines BFM defines, and the frontend pybfm, which includes a thin Python wrapper above libbfm and visualisation facilities.

libbfm

This uses CMake:

mkdir -p libbfm/build
cd libbfm/build
cmake ..

To install the library and its headers, run this (as a superuser):

make install

pybfm

First, the FFI bindings to libbfm must be generated:

python pybfm/bfm/gen_libbfm.py

Then, you may install the bfm Python module itself:

pip install --user ./pybfm

On Ubuntu 22.04, set the DEB_PYTHON_INSTALL_LAYOUT environment variable to deb_system when running the above command:

DEB_PYTHON_INSTALL_LAYOUT=deb_system pip install --user ./pybfm

(See this issue.)

Running

Assuming everything is built, you can run a simple example as such:

python3 examples/deformation.py

That's it ;)

To execute a specific LEPL1110 problem:

python3 lepl1110.py path/to/mesh path/to/problem

This will output U.txt and V.txt in the data directory.

About

FEM/FEA C library with Python bindings for use as an educational tool.

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors