# xcfem/xc architecture

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

- Interactive diagram: https://gitdiagram.com/xcfem/xc
- Repository: https://github.com/xcfem/xc

## Overview

XC is an open-source finite-element program for structural analysis and design. Its principal workflow is to define a structural model, generate a mesh and assign materials and loads, run an analysis, then inspect results; the README also highlights code-based design, geotechnical tools, and steel-connection design. The graph reflects documented capabilities and sampled/indexed implementation evidence. Several feature branches are represented at the directory level because their implementation files were not sampled.

Main entry points: [`src/domain/domain/Domain.h`](https://github.com/xcfem/xc/blob/master/src/domain/domain/Domain.h) (Model domain), [`src/preprocessor/prep_handlers/MaterialHandler.cc`](https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/MaterialHandler.cc) (Materials and sections), [`python_modules/solution/predefined_solutions.py`](https://github.com/xcfem/xc/blob/master/python_modules/solution/predefined_solutions.py) (Analysis solutions), [`src/preprocessor/prep_handlers/ProtoElementHandler.cc`](https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/ProtoElementHandler.cc) (Mesh and elements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Model definition"]
  node_geometry["Geometry and spaces"]
  node_mesh["Mesh and elements"]
  node_materials["Materials and sections<br/>[MaterialHandler.cc]"]
  node_domain["Model domain<br/>[Domain.h]"]
  node_loads["Actions and loads"]
end

subgraph group_engine["Analysis engine"]
  node_constraints["Constraints"]
  node_analysis["Analysis solutions"]
  node_state["Analysis state"]
  node_shell["Shell formulation<br/>[ShellMITC9.cpp]"]
  node_storage[("Tagged object storage")]
end

subgraph group_engineering["Engineering tools"]
  node_codes["Structural code checks"]
  node_connections["Steel connections"]
  node_geotech["Geotechnical analysis"]
  node_reliability["Reliability analysis"]
end

subgraph group_results["Results and exchange"]
  node_output["Result visualization<br/>[output_handler.py]"]
  node_exchange["Model exchange"]
end

node_engineer(("Structural engineer"))

node_engineer -.->|"defines geometry"| node_geometry
node_geometry -.->|"generates mesh"| node_mesh
node_engineer -.->|"assigns materials"| node_materials
node_engineer -.->|"defines loads"| node_loads
node_mesh -.->|"populates model"| node_domain
node_materials -.->|"supplies sections"| node_mesh
node_loads -.->|"applies actions"| node_domain
node_domain -->|"provides model"| node_constraints
node_constraints -.->|"prepares equations"| node_analysis
node_analysis -.->|"assembles state"| node_state
node_shell -.->|"forms element"| node_domain
node_engineer -.->|"checks design"| node_codes
node_engineer -.->|"designs connections"| node_connections
node_engineer -.->|"uses geotechnics"| node_geotech
node_engineer -.->|"assesses reliability"| node_reliability
node_engineer -.->|"imports models"| node_exchange
node_analysis -.->|"provides results"| node_output
node_output -->|"displays results"| node_engineer
node_domain -.->|"stores components"| node_storage
node_materials -.->|"supports checks"| node_codes

click node_geometry "https://github.com/xcfem/xc/tree/master/python_modules/model"
click node_mesh "https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/ProtoElementHandler.cc"
click node_materials "https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/MaterialHandler.cc"
click node_domain "https://github.com/xcfem/xc/blob/master/src/domain/domain/Domain.h"
click node_loads "https://github.com/xcfem/xc/tree/master/python_modules/actions"
click node_constraints "https://github.com/xcfem/xc/blob/master/src/solution/analysis/handler/AutoConstraintHandler.cpp"
click node_analysis "https://github.com/xcfem/xc/blob/master/python_modules/solution/predefined_solutions.py"
click node_state "https://github.com/xcfem/xc/blob/master/src/solution/analysis/model/UnbalAndTangentStorage.cc"
click node_shell "https://github.com/xcfem/xc/blob/master/src/domain/mesh/element/plane/shell/ShellMITC9.cpp"
click node_codes "https://github.com/xcfem/xc/tree/master/python_modules/materials"
click node_connections "https://github.com/xcfem/xc/tree/master/python_modules/connections/steel_connections"
click node_geotech "https://github.com/xcfem/xc/tree/master/python_modules/geotechnics"
click node_reliability "https://github.com/xcfem/xc/blob/master/src/reliability/analysis/analysis/FragilityAnalysis.cpp"
click node_output "https://github.com/xcfem/xc/blob/master/python_modules/postprocess/output_handler.py"
click node_exchange "https://github.com/xcfem/xc/tree/master/python_modules/import_export"
click node_storage "https://github.com/xcfem/xc/blob/master/src/utility/tagged/storage/TaggedObjectStorage.cc"

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_geometry,node_mesh,node_materials,node_domain,node_loads toneBlue
class node_constraints,node_analysis,node_state,node_shell,node_storage toneAmber
class node_codes,node_connections,node_geotech,node_reliability toneMint
class node_output,node_exchange toneRose
class node_engineer toneIndigo
```

## Components

### Model definition

- [Geometry and spaces](https://github.com/xcfem/xc/tree/master/python_modules/model): `python_modules/model`
- [Mesh and elements](https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/ProtoElementHandler.cc): `src/preprocessor/prep_handlers/ProtoElementHandler.cc`
- [Materials and sections](https://github.com/xcfem/xc/blob/master/src/preprocessor/prep_handlers/MaterialHandler.cc): `src/preprocessor/prep_handlers/MaterialHandler.cc`
- [Model domain](https://github.com/xcfem/xc/blob/master/src/domain/domain/Domain.h): `src/domain/domain/Domain.h`
- [Actions and loads](https://github.com/xcfem/xc/tree/master/python_modules/actions): `python_modules/actions`

### Analysis engine

- [Constraints](https://github.com/xcfem/xc/blob/master/src/solution/analysis/handler/AutoConstraintHandler.cpp): `src/solution/analysis/handler/AutoConstraintHandler.cpp`
- [Analysis solutions](https://github.com/xcfem/xc/blob/master/python_modules/solution/predefined_solutions.py): `python_modules/solution/predefined_solutions.py`
- [Analysis state](https://github.com/xcfem/xc/blob/master/src/solution/analysis/model/UnbalAndTangentStorage.cc): `src/solution/analysis/model/UnbalAndTangentStorage.cc`
- [Shell formulation](https://github.com/xcfem/xc/blob/master/src/domain/mesh/element/plane/shell/ShellMITC9.cpp): `src/domain/mesh/element/plane/shell/ShellMITC9.cpp`
- [Tagged object storage](https://github.com/xcfem/xc/blob/master/src/utility/tagged/storage/TaggedObjectStorage.cc): `src/utility/tagged/storage/TaggedObjectStorage.cc`

### Engineering tools

- [Structural code checks](https://github.com/xcfem/xc/tree/master/python_modules/materials): `python_modules/materials`
- [Steel connections](https://github.com/xcfem/xc/tree/master/python_modules/connections/steel_connections): `python_modules/connections/steel_connections`
- [Geotechnical analysis](https://github.com/xcfem/xc/tree/master/python_modules/geotechnics): `python_modules/geotechnics`
- [Reliability analysis](https://github.com/xcfem/xc/blob/master/src/reliability/analysis/analysis/FragilityAnalysis.cpp): `src/reliability/analysis/analysis/FragilityAnalysis.cpp`

### Results and exchange

- [Result visualization](https://github.com/xcfem/xc/blob/master/python_modules/postprocess/output_handler.py): `python_modules/postprocess/output_handler.py`
- [Model exchange](https://github.com/xcfem/xc/tree/master/python_modules/import_export): `python_modules/import_export`

### Other components

- **Structural engineer**

## Connections

- Structural engineer → Geometry and spaces: defines geometry
- Geometry and spaces → Mesh and elements: generates mesh
- Structural engineer → Materials and sections: assigns materials
- Structural engineer → Actions and loads: defines loads
- Mesh and elements → Model domain: populates model
- Materials and sections → Mesh and elements: supplies sections
- Actions and loads → Model domain: applies actions
- Model domain → Constraints: provides model (evidence: `src/solution/analysis/handler/AutoConstraintHandler.cpp`)
- Constraints → Analysis solutions: prepares equations
- Analysis solutions → Analysis state: assembles state
- Shell formulation → Model domain: forms element
- Structural engineer → Structural code checks: checks design
- Structural engineer → Steel connections: designs connections
- Structural engineer → Geotechnical analysis: uses geotechnics
- Structural engineer → Reliability analysis: assesses reliability
- Structural engineer → Model exchange: imports models
- Analysis solutions → Result visualization: provides results
- Result visualization → Structural engineer: displays results (evidence: `python_modules/postprocess/output_handler.py`)
- Model domain → Tagged object storage: stores components (evidence: `src/domain/domain/Domain.h`)
- Materials and sections → Structural code checks: supports checks
