# siggedev/basicfem architecture

> Architecture diagram of the GitHub repository siggedev/basicfem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siggedev/basicfem
- Repository: https://github.com/siggedev/basicfem

## Overview

BasicFEM is a MATLAB finite-element-method package for a structural-engineering course. Users add `src` and its subfolders to the MATLAB path, then use its functions; the repository also contains separate homework and assignment work, which is not part of the package runtime map. The source tree shows mesh handling, element formulations, material models, quadrature, shape functions, and tensor utilities. No source excerpts were provided, so the graph preserves these components but does not infer calls or a computational sequence between them.

Main entry points: [`src/mesh/read_mesh.m`](https://github.com/siggedev/basicfem/blob/main/src/mesh/read_mesh.m) (Read Mesh)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mesh["Mesh"]
  node_mesh_read["Read Mesh<br/>[read_mesh.m]"]
  node_mesh_generate["Generate Mesh<br/>[generate_mesh.m]"]
  node_mesh_facets["Facet Sets"]
  node_mesh_access["Element Data"]
  node_mesh_plot["Mesh Plotting<br/>[plot_fe_mesh.m]"]
end

subgraph group_formulations["Element Formulations"]
  node_quad_elastic["Elastic Elements"]
  node_quad_heat["Heat Elements"]
  node_quad_neumann["Neumann Elements"]
  node_quad_stress_flux["Stress and Flux"]
end

subgraph group_numerics["Numerical Foundations"]
  node_quad_rules["Quadrature Rules"]
  node_shape_functions["Shape Functions"]
  node_jacobian["Jacobian"]
end

subgraph group_materials["Materials and Tensors"]
  node_elastic_models["Elastic Stiffness"]
  node_vonmises["Von Mises<br/>[vonmises.m]"]
  node_tensor_conversion["Tensor Conversion"]
end

node_user(("MATLAB User"))

node_user -->|"uses"| node_mesh_read

click node_mesh_read "https://github.com/siggedev/basicfem/blob/main/src/mesh/read_mesh.m"
click node_mesh_generate "https://github.com/siggedev/basicfem/blob/main/src/mesh/generate_mesh.m"
click node_mesh_facets "https://github.com/siggedev/basicfem/blob/main/src/mesh/create_facet_sets.m"
click node_mesh_access "https://github.com/siggedev/basicfem/tree/main/src/mesh"
click node_mesh_plot "https://github.com/siggedev/basicfem/blob/main/src/mesh/plot_fe_mesh.m"
click node_quad_elastic "https://github.com/siggedev/basicfem/tree/main/src/elements"
click node_quad_heat "https://github.com/siggedev/basicfem/tree/main/src/elements"
click node_quad_neumann "https://github.com/siggedev/basicfem/tree/main/src/elements"
click node_quad_stress_flux "https://github.com/siggedev/basicfem/tree/main/src/elements"
click node_quad_rules "https://github.com/siggedev/basicfem/tree/main/src/quadrature"
click node_shape_functions "https://github.com/siggedev/basicfem/tree/main/src/shape_functions"
click node_jacobian "https://github.com/siggedev/basicfem/blob/main/src/calculate_jacobian.m"
click node_elastic_models "https://github.com/siggedev/basicfem/tree/main/src/material_models"
click node_vonmises "https://github.com/siggedev/basicfem/blob/main/src/material_models/vonmises.m"
click node_tensor_conversion "https://github.com/siggedev/basicfem/tree/main/src/tensors"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mesh_read,node_mesh_generate,node_mesh_facets,node_mesh_access,node_mesh_plot,node_user toneBlue
class node_quad_elastic,node_quad_heat,node_quad_neumann,node_quad_stress_flux toneAmber
class node_quad_rules,node_shape_functions,node_jacobian toneMint
class node_elastic_models,node_vonmises,node_tensor_conversion toneRose
```

## Components

### Mesh

- [Read Mesh](https://github.com/siggedev/basicfem/blob/main/src/mesh/read_mesh.m): `src/mesh/read_mesh.m`
- [Generate Mesh](https://github.com/siggedev/basicfem/blob/main/src/mesh/generate_mesh.m): `src/mesh/generate_mesh.m`
- [Facet Sets](https://github.com/siggedev/basicfem/blob/main/src/mesh/create_facet_sets.m): `src/mesh/create_facet_sets.m`
- [Element Data](https://github.com/siggedev/basicfem/tree/main/src/mesh): `src/mesh`
- [Mesh Plotting](https://github.com/siggedev/basicfem/blob/main/src/mesh/plot_fe_mesh.m): `src/mesh/plot_fe_mesh.m`

### Element Formulations

- [Elastic Elements](https://github.com/siggedev/basicfem/tree/main/src/elements): `src/elements`
- [Heat Elements](https://github.com/siggedev/basicfem/tree/main/src/elements): `src/elements`
- [Neumann Elements](https://github.com/siggedev/basicfem/tree/main/src/elements): `src/elements`
- [Stress and Flux](https://github.com/siggedev/basicfem/tree/main/src/elements): `src/elements`

### Numerical Foundations

- [Quadrature Rules](https://github.com/siggedev/basicfem/tree/main/src/quadrature): `src/quadrature`
- [Shape Functions](https://github.com/siggedev/basicfem/tree/main/src/shape_functions): `src/shape_functions`
- [Jacobian](https://github.com/siggedev/basicfem/blob/main/src/calculate_jacobian.m): `src/calculate_jacobian.m`

### Materials and Tensors

- [Elastic Stiffness](https://github.com/siggedev/basicfem/tree/main/src/material_models): `src/material_models`
- [Von Mises](https://github.com/siggedev/basicfem/blob/main/src/material_models/vonmises.m): `src/material_models/vonmises.m`
- [Tensor Conversion](https://github.com/siggedev/basicfem/tree/main/src/tensors): `src/tensors`

### Other components

- **MATLAB User**

## Connections

- MATLAB User → Read Mesh: uses (evidence: `readme.md`)
