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.20.tar.gz (153.9 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.20-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfiberc-0.0.20.tar.gz
  • Upload date:
  • Size: 153.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.20.tar.gz
Algorithm Hash digest
SHA256 2c7b708233fcb2ae5dedbfa4d68bfa7afe05ad21a0ad536964b3482891a0bf0a
MD5 7738534225bed81ac616d7bd32cf0b1f
BLAKE2b-256 1259074a4c2c1b4754a0cc1b4a450fd77820902b14f84fb1e8e7166c9183e641

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfiberc-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.20-py3-none-any.whl
Algorithm Hash digest
SHA256 23efa9dd4eb18bfdec22b2d69e49f0ec68900d0a39a8002082c66db9cae4e0c4
MD5 11fee9529b82ce69603e3f3aaafc4c66
BLAKE2b-256 1f8f5b3a4f941390627b3b916d850f25ff9f9dd28148e3300cbbf38dd30f94c1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

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