Skip to content

angelsolaorbaiceta/inkfem

Repository files navigation

inkFEM

2D structural analysis program using the Finite Element Method.

Usage

Structures are defined following the .inkfem input file format. To calculate a structure defined in a .inkfem file:

$ inkfem solve path/to/structure.inkfem

If the structural analysis process doesn't encounter any error, it'll produce a solution file inside the same directory as the input file with the same name but .inkfemsol extension. In the example above, this would be structure.inkfemsol.

To also write the sliced (preprocessed) structure to a file, you can provide the -p flag:

$ inkfem solve path/to/structure.inkfem -p

This will generate an additional file with the .inkfempre extension containing the information about how the structure has been sliced into finite elements.

Available Flags

Flag Type Description Required Default
verbose or -v bool use verbose output, including elapsed times no false
preprocess or -p bool save the preprocessed structure into a .inkfempre file no false
safe or -s bool perform some extra safety checks before proceeding with the resolution no false
error or -e float maximum displacement error allowed in the resolution no 1e-5
weight or -w bool include the own weight of the bars no false

Build & Test

To build the inkfem binary:

$ ./build.sh

or alternatively:

$ go build inkfem.go

This creates the inkfem binary at the project's top level. See the Usage section below to learn how to execute the binary program.

To run the tests:

$ ./test.sh

or alternatively:

$ go test ./...

Docs

Code Structure

The code is split into four main packages:

  • structure: defines the structure model
  • preprocess: implements the preprocessing or slicing of the structure
  • process: implements the processing of a sliced/preprocessed structure
  • io: reading from .inkfem files and writing to .inkfempreand .inkfemsol files
  • plot: drawing SVG files from the .inkfem, .inkfempreand .inkfemsol files
  • cmd: the commands available to the CLI