Skip to main content

pyfiberc

pyfiberc is an analysis tool for Fiber-Reinforced Concrete (FRC) rectangular sections. It checks sections under axial force and bending at the Ultimate (ULS/SLU) and Serviceability (SLS/SLE) limit states, generates N‑M interaction domains, and produces a LaTeX/PDF calculation report.

It is built on top of pycivil, which provides the structural core: section and rebar modelling, loads and limit states, the solver framework, and the LaTeX report toolchain.

Features

  • ULS (SLU) N‑M check — interaction domain for the fibered section, with optional shear-driven reduction of the residual tensile strength.
  • SLS (SLE) N‑M check — domain checks for characteristic and quasi-permanent load combinations, with constitutive tension-law support.
  • FRC material laws per CNR DT 204 / Linee Guida C.S.LL.PP. 2022, fib Model Code 2010, and EN 1992‑1‑1:2023 — residual design strengths (fFtud, fFtld) and the piecewise tension constitutive law are computed automatically from fR1k/fR3k and the selected code.
  • PDF report — section geometry plot, interaction domains, and check results rendered through pycivil's LaTeX engine.

Installation

The package targets Python 3.11–3.13 and is managed with uv.

1. Install uv

Windows (Terminal on Win11, PowerShell on Win10):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
setx UV_NATIVE_TLS true

Restart the terminal so uv is on PATH and the TLS setting takes effect.

Linux / macOS:

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Install pyfiberc

From the directory where you want the environment to live:

uv init --python 3.12
uv add pyfiberc

SYSTRA users: to pull packages from the internal index, point UV_INDEX_URL at the group endpoint with your personal access token:

setx UV_INDEX_URL https://__token__:<YOUR_TOKEN_HERE>@gitlab.com/api/v4/groups/9596324/-/packages/pypi/simple

Usage example

Running the solver on a section model

The typical workflow is: build the input model (a FrcRecSectionInput) by hand, save it as JSON, then run the solver from Python. The criteria field of the input selects which checks run ("SLU-NM", "SLE-NM", ...). Sample inputs live in tests/input_benchmarks/.

import json
from pathlib import Path

from pyfiberc.solver import FRCSolver
from pyfiberc.tools.models import FrcRecSectionInput, UUIDEncoder

# Load a section model from JSON
data = json.loads(Path("section.json").read_text())
model = FrcRecSectionInput(**data)

# Run the checks; plots and the report are written into the job path
job = Path("job-001")
job.mkdir(exist_ok=True)

solver = FRCSolver(model)
solver.setJobPath(job)
solver.run()

# Inspect or persist the results
output = solver.getModelOutput()
(job / "results.json").write_text(
    json.dumps(output.model_dump(), indent=4, cls=UUIDEncoder)
)

# Build the LaTeX/PDF calculation report
solver.buildReport()

After run(), the job directory contains the section geometry plot and the interaction-domain plots; buildReport() adds the compiled PDF.

Defining an FRC material

FiberConcrete is a pydantic model: pick a design code (normativa), give the residual flexural strengths fR1k/fR3k and the code parameters, and the design values come out as computed fields.

from pyfiberc.tools.models import FiberConcrete
from pyfiberc.materials import LawCode

frc = FiberConcrete(
    description="C25/30 + steel fibers",
    normativa=LawCode.CODE_ITA_LG2022,  # Linee Guida C.S.LL.PP. 2022
    fR1k=8.0,        # residual strength at CMOD = 0.5 mm [MPa]
    fR3k=8.8,        # residual strength at CMOD = 2.5 mm [MPa]
    k0=0.5, kg=1.0,  # LG 2022 parameters
    efu=0.01,        # ultimate tensile strain [-]
    lcs=300.0,       # sectional characteristic length [mm]
    d1=300.0, d2=300.0, d3=300.0,  # FEM analysis parameters [mm]
)

print(frc.fFtud, frc.fFtld)   # design residual tensile strengths [MPa]
print(frc.tensionConstLaw)    # piecewise eps-sigma tension law

The input/output schemas live in pyfiberc.tools.models; the material law tables and code mappings live in pyfiberc.materials.

Development

Set up

git clone https://gitlab.com/luigi_paone/pyfrc.git
cd pyfrc
uv sync

uv sync creates .venv/ from uv.lock, installs the package in editable mode, and pulls in the dev dependency group.

Project layout

src/pyfiberc/
├── materials.py            # LawCode, FiberConcrete material, ductility tables
├── solver.py               # FRCSolver: run(), buildReport()
├── solver_lib.py           # FRC_SLU_solver, FRC_SLE_solver, shear reduction
├── tools/models.py         # Pydantic models: FrcRecSectionInput/Output, FiberConcrete
└── templates/latex/        # LaTeX fragments for the FRC material report
tests/
├── input_benchmarks/       # JSON input examples (SLU and SLE)
├── test_materials.py
└── test_solver.py

Tests and type checking

uv run pytest
uv run pytest --cov       # coverage (configured under [tool.coverage.run])
uv run mypy src/pyfiberc

Releasing

  1. Bump version in pyproject.toml.
  2. uv lock to refresh the lockfile.
  3. Add an entry to CHANGELOG.md.
  4. Commit (chore: bump version to <version>) and tag.

Credits

pyfiberc stands on pycivil, which supplies the concrete section model, rebar disposers, loads and limit-state definitions, the N‑M checking solvers for RC rectangular sections, the plotting helpers, and the LaTeX report engine used for the PDF output. pyfiberc adds the FRC material laws and the fibered ULS/SLE solvers on top of that foundation.

Authors

  • Marco Melcarne (SYSTRA)
  • Luigi Luis Paone
  • Claudia Orrico (SYSTRA)

Release notes

See CHANGELOG.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfiberc-0.0.15.tar.gz (147.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfiberc-0.0.15-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file pyfiberc-0.0.15.tar.gz.

File metadata

  • Download URL: pyfiberc-0.0.15.tar.gz
  • Upload date:
  • Size: 147.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyfiberc-0.0.15.tar.gz
Algorithm Hash digest
SHA256 510eb53be04033e7fb1241c4cccaf41a95e5fec07ee70bc82583d4271f0478db
MD5 8b297e982a56cd88c2de5722dca9be3b
BLAKE2b-256 4fca61bc81e1a4b15628573bca76463237662ac18b68ee5c8f79067b6ebf60a2

See more details on using hashes here.

File details

Details for the file pyfiberc-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: pyfiberc-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyfiberc-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7a9bf5f7ed9ac4713625667446ff2d16548f9229655120f280f34708af1b89
MD5 24b06923c9e06dfc1619cab4281671a8
BLAKE2b-256 f906412a67a9247cb3a050a9e07ba5fac5b83e0b236d9658090767e484c86ea0

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

This release

0.0.15 This release

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page