This Dockerfile sets up a docker image that contains CalculiX based in the installation instructions for the CalculiX solver and Graphical Interface.
Calculix is a Finite-Element Analysis (FEA) Solver used for multiphysics field problems. It also has a Graphical interface for setting up the simulations.
The purpose of this image is twofold.
- Giving an exact set of instructions for a user to follow in order to correctly build the program. The existing installation instructions are very complicated, requiring the user to adapt to several ad-hoc system configurations and deprecated dependencies. A user cannot simply follow the documentation and build a working binary. This docker file creates an exact series of steps for new users to build CalculiX.
- A working container with CalculiX in it. Users can get a working copy of CalculiX for their FEA needs.
This image does not have any dependencies and can be run simply with Docker commands. There are only two steps:
- Go into the directory containing this file and build the docker image with
docker build -t calculix:latest .(Note the period to indicate you're running in the current directory). - Run the container with
docker run calculix:latest
- CGX (CalculiX Graphical Interface): The Dockerfile downloads and extracts CGX version 2.21. It then builds and installs CGX, moving the binary to /usr/local/bin/cgx.
- CalculiX Solver (CCX): The Dockerfile downloads and extracts CalculiX Solver version 2.21, moves the source code to /usr/local/CalculiX/ccx_2.21/, and builds CCX. The resulting CCX binary is then copied to /usr/local/bin/ccx.
- SPOOLES (Sparse Object Oriented Linear Equations Solver): The Dockerfile downloads and builds SPOOLES version 2.2. It addresses a couple of required configuration changes in the build files and sets up the library for use by CalculiX.
- ARPACK: The Dockerfile clones the ARPACK repository from GitHub, builds it with CMake, and installs it as a dependency for CalculiX.
- TetGen: The Dockerfile downloads and extracts TetGen version 1.5.1, builds it, and installs the TetGen binary to /usr/local/bin/tetgen.
- The provided Dockerfile is based on Debian.
- Make sure to replace the default
CMDinstruction with the desired command or test case. Or just comment that line out and run the container interactively. If you choose to do this, the command to run it would bedocker run -ti --rm calculix:latest. - I based this container on the official CalculiX Documentation. Check it out for further information.
To simplify the deployment and orchestration of the CalculiX Docker container along with its dependencies, you can use Docker Compose.
A docker compose file is included with this repository. The compose file allows you to run the Calculix Graphical interface from the container by forwarding graphical capability from the container to your enviroment. Here are the steps to use this file:
- In a terminal, run the command
docker compose -f calculix.yml up. This will launch a docker calculix container. - Start another terminal, and run
docker attach calculix_cgxto enter into the container. - Once inside the container, you can test the capability of cgx by running
cgx -b dummy.fbd.
- Make sure the
imagefield corresponds to the name of the Docker image you've built. In the instructions above, we had usedcalculix:latest. - You can also change the
container_namefield if you with to give your container a different name. - For more advanced configurations, refer to the Docker Compose documentation.