gensec.materials

Constitutive material laws and property tables.

The abstract base class Material defines the interface that all materials must implement. Three concrete implementations are provided — Concrete, Steel, and TabulatedMaterial — plus bridge modules for automatic property lookup from European standards.

Abstract base

Abstract base class for constitutive material laws.

All concrete material implementations must inherit from Material and provide scalar/vectorized stress evaluation as well as tangent modulus evaluation for the analytical Jacobian.

class Material

Bases: ABC

Abstract base class for all constitutive material laws.

Every material must expose:

  • stress(eps) — scalar stress evaluation.

  • stress_array(eps) — vectorized evaluation over an array of arbitrary shape (1-D, 2-D, …).

  • tangent(eps) — scalar tangent modulus \(E_t = \mathrm{d}\sigma/\mathrm{d}\varepsilon\).

  • tangent_array(eps) — vectorized tangent modulus over an array of arbitrary shape.

  • eps_min / eps_max — admissible strain range.

The tangent modulus is used by integrate_with_tangent() to assemble the analytical tangent stiffness matrix, avoiding the cost of finite-difference Jacobians in Newton-Raphson solvers.

The strain limits are consumed by the N-M diagram generator to automatically determine the scan range for ultimate configurations.

Variables:
  • eps_min (float) – Most compressive admissible strain (typically negative).

  • eps_max (float) – Most tensile admissible strain (typically positive).

abstract property eps_max

Most tensile admissible strain.

abstract property eps_min

Most compressive admissible strain.

abstractmethod stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized stress computation.

Default implementation loops over stress(). Subclasses should override for performance. The input may have any shape (1-D, 2-D, …); the output must have the same shape.

Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma / d\varepsilon\).

Default implementation uses a central finite difference with step \(h = 10^{-8}\). Subclasses should override with the closed-form derivative for best accuracy and speed.

Parameters:

eps (float)

Returns:

Tangent modulus [MPa].

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus.

Default implementation uses a central finite difference. Subclasses should override with the closed-form derivative. Input may have any shape.

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

Concrete — parabola-rectangle

Concrete constitutive law — parabola-rectangle with optional tension.

The compression branch follows EC2 §3.1.7 (parabola-rectangle). An optional linear-elastic tension branch can be activated for serviceability checks (SLS) or nonlinear analyses by providing the tensile strength \(f_{ct}\) and the elastic modulus \(E_c\).

When numba is installed, the element-wise stress and tangent kernels are JIT-compiled to native code, giving a ~2–3× speed-up on large fiber arrays. If numba is not available the pure-NumPy path is used transparently.

class Concrete(
fck: float = 25.0,
gamma_c: float = 1.5,
alpha_cc: float = 0.85,
n_parabola: float = 2.0,
eps_c2: float = -0.002,
eps_cu2: float = -0.0035,
fct: float = 0.0,
Ec: float = 0.0,
)

Bases: Material

Parabola-rectangle concrete (EC2 3.1.7 / NTC 2018) with optional linear tension branch.

Compression (\(\varepsilon \le 0\)):

\[\begin{split}\sigma_c(\varepsilon) = \begin{cases} -f_{cd}\!\left[1 - \left(1 - \dfrac{\varepsilon} {\varepsilon_{c2}}\right)^{\!n}\right] & \varepsilon_{c2} \le \varepsilon \le 0 \\[6pt] -f_{cd} & \varepsilon_{cu2} \le \varepsilon < \varepsilon_{c2} \\[6pt] 0 & \varepsilon < \varepsilon_{cu2} \end{cases}\end{split}\]

Tension (\(\varepsilon > 0\)), activated when \(f_{ct} > 0\) and \(E_c > 0\):

\[\begin{split}\sigma_c(\varepsilon) = \begin{cases} E_c \, \varepsilon & 0 < \varepsilon \le \varepsilon_{ct} \\[6pt] 0 & \varepsilon > \varepsilon_{ct} \end{cases}\end{split}\]

where \(\varepsilon_{ct} = f_{ct} / E_c\) is the cracking strain. When \(f_{ct} = 0\) (default), the tension branch is suppressed and \(\sigma = 0\) for all \(\varepsilon > 0\).

Parameters:
  • fck (float) – Characteristic cylinder strength [MPa].

  • gamma_c (float, optional) – Partial safety factor. Default 1.5.

  • alpha_cc (float, optional) – Long-term coefficient. Default 0.85.

  • n_parabola (float, optional) – Parabolic exponent. Default 2.0.

  • eps_c2 (float, optional) – Peak-stress strain (negative). Default -0.002.

  • eps_cu2 (float, optional) – Ultimate compressive strain (negative). Default -0.0035.

  • fct (float, optional) – Tensile strength [MPa] for the linear tension branch. Use \(f_{ctd}\) (design) or \(f_{ctm}\) (mean) depending on the verification context. Default 0.0 (no tension).

  • Ec (float, optional) – Elastic modulus [MPa] for the tension branch. Typically \(E_{cm}\) from EC2 Table 3.1. Default 0.0.

Variables:
  • fcd (float) – Design compressive strength [MPa].

  • eps_ct (float) – Cracking strain \(f_{ct}/E_c\). Zero when the tension branch is disabled.

  • tension_enabled (bool) – True when both fct > 0 and Ec > 0.

property eps_max

Most tensile admissible strain.

Returns \(\varepsilon_{ct}\) when the tension branch is active, 0.0 otherwise.

property eps_min

Most compressive admissible strain.

stress(
eps,
)

Evaluate stress for a single strain value.

Parameters:

eps (float) – Strain (positive = tension, negative = compression).

Returns:

Stress [MPa]. Positive = tension, negative = compression.

Return type:

float

stress_array(
eps,
)

Vectorized stress evaluation.

Accepts arrays of any shape (1-D, 2-D, …). When numba is installed, the inner loop is JIT-compiled.

Parameters:

eps (numpy.ndarray) – Strain array.

Returns:

Stress array [MPa], same shape as eps.

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma_c / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_c & 0 < \varepsilon \le \varepsilon_{ct} \;\text{(tension enabled)} \\ -\dfrac{f_{cd}\,n}{\varepsilon_{c2}} \left(1 - \dfrac{\varepsilon}{\varepsilon_{c2}} \right)^{n-1} & \varepsilon_{c2} < \varepsilon \le 0 \\ 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (float)

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus \(E_t = d\sigma_c / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_c & 0 < \varepsilon \le \varepsilon_{ct} \;\text{(tension enabled)} \\[4pt] -\dfrac{f_{cd} \, n}{\varepsilon_{c2}} \left(1 - \dfrac{\varepsilon}{\varepsilon_{c2}} \right)^{n-1} & \varepsilon_{c2} < \varepsilon \le 0 \\[4pt] 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

njit(
*args,
**kwargs,
)

No-op decorator when Numba is absent.

Reinforcing steel — elastic-plastic

Reinforcing steel constitutive law — elastic-plastic with optional hardening.

When numba is installed, the element-wise stress and tangent kernels are JIT-compiled to native code. If numba is not available the pure-NumPy path is used transparently.

class Steel(
fyk: float = 450.0,
gamma_s: float = 1.15,
Es: float = 200000.0,
k_hardening: float = 1.0,
eps_su: float = 0.01,
works_in_compression: bool = True,
)

Bases: Material

Elastic-plastic steel with optional linear hardening.

\[\begin{split}\sigma_s(\varepsilon) = \begin{cases} E_s\,\varepsilon & |\varepsilon| \le \varepsilon_{yd} \\ \mathrm{sign}(\varepsilon)\!\left[f_{yd} + (f_{td}-f_{yd}) \dfrac{|\varepsilon|-\varepsilon_{yd}} {\varepsilon_{su}-\varepsilon_{yd}}\right] & \varepsilon_{yd} < |\varepsilon| \le \varepsilon_{su} \\ 0 & |\varepsilon| > \varepsilon_{su} \end{cases}\end{split}\]
Parameters:
  • fyk (float) – Characteristic yield strength [MPa].

  • gamma_s (float, optional) – Partial safety factor. Default 1.15.

  • Es (float, optional) – Young’s modulus [MPa]. Default 200000.

  • k_hardening (float, optional) – \(f_t/f_y\) ratio. Default 1.0 (perfectly plastic).

  • eps_su (float, optional) – Ultimate strain. Default 0.01.

  • works_in_compression (bool, optional) – If False, compressive stress is zero. Default True.

Variables:
  • fyd (float) – Design yield strength [MPa].

  • ftd (float) – Design ultimate strength [MPa].

  • eps_yd (float) – Yield strain.

property eps_max

Most tensile admissible strain.

property eps_min

Most compressive admissible strain.

stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized stress computation.

Accepts arrays of any shape. When numba is installed, the inner loop is JIT-compiled.

Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma_s / d\varepsilon\).

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus \(E_t = d\sigma_s / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_s & |\varepsilon| \le \varepsilon_{yd} \\ \dfrac{f_{td} - f_{yd}} {\varepsilon_{su} - \varepsilon_{yd}} & \varepsilon_{yd} < |\varepsilon| \le \varepsilon_{su} \\ 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

njit(
*args,
**kwargs,
)

No-op decorator when Numba is absent.

Tabulated material

Tabulated material — arbitrary stress-strain curve from data points.

Piecewise-linear interpolation between tabulated \((\varepsilon, \sigma)\) pairs. The tangent modulus is the slope of each linear segment.

class TabulatedMaterial(
strains,
stresses,
name='Tabulated',
)

Bases: Material

Material defined by a tabulated \((\varepsilon, \sigma)\) curve.

Piecewise-linear interpolation between data points. Strains outside the table range return zero stress (material failure).

Parameters:
  • strains (array_like) – Strictly increasing strain values.

  • stresses (array_like) – Corresponding stress values [MPa].

  • name (str, optional) – Label. Default "Tabulated".

Raises:

ValueError – Bad dimensions or non-monotonic strains.

Examples

>>> mat = TabulatedMaterial([-0.01, -0.002, 0, 0.002, 0.01],
...                        [-400, -400, 0, 400, 400], "EPP")
>>> mat.stress(0.001)
200.0
property eps_max

Most tensile admissible strain.

property eps_min

Most compressive admissible strain.

property name

Material label.

stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized piecewise-linear interpolation.

Accepts arrays of any shape (1-D, 2-D, …).

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus from the piecewise-linear table.

Returns the slope of the linear segment containing eps, or 0 outside the table range.

Parameters:

eps (float)

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus from the piecewise-linear table.

For each strain value, returns the slope of the containing linear segment, or 0 outside the table range.

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

EC2 property tables

Full implementation of EN 1992-1-1 Table 3.1 parameters, including high-strength concrete (\(f_{ck} > 50\;\text{MPa}\)) and the French National Annex.

“””Concrete properties as per EN 1992-1-1.

Implements the fben2 class that computes all mechanical properties of concrete from the characteristic compressive strength \(f_{ck}\), following EN 1992-1-1 Table 3.1 and the French National Annex (NF EN 1992-1-1/NA).

Also provides the Sargin and Parabola-Rectangle constitutive laws (currently used only for completeness — the main verification modules use the discrete property values).

Note

Only the French National Annex is implemented at this time.

“””

en2pr(
strain: float,
en2class: fben2,
) float

This function gives for a given strain and a concrete class (from fben2()) the correspondent stress from the constitutive law ‘Parabola-Rectangle’.

en2sargin(
strain: float,
en2class: fben2,
) float

This function gives for a given strain and a concrete class (from fben2()) the correspondent stress from the constitutive law of Sargin. This constitutive law should be used only for non-linear applications.

class fben2(
fck: float,
ls: str,
loadtype: str,
TypeConc: str,
NA='French',
time=28,
)

Bases: object

This class creates an object that describes as per the Eurocode 1992-1-1 the concrete characteristics for design. The French National Annex is used. It doesn’t include any limits or checks on the concrete classes, but it just applies the formulas that describes all the mechanical characteristics, at a given time.

Parameters:
  • fck (float) – Characteristic resistance in compression of concrete. Usually is considered at 28 days, but we’re not limited to. This value is the nominal value of concrete.

  • ls (str) – Limit state which we consider (‘F’, ‘A’ or anything else).

  • loadtype (str) – Speed of load application. Usually is ‘slow’.

  • TypeConc (str) – Ciment type (‘R’, ‘S’ or ‘N’) as per EN 1992-1-1 §3.1.2. The complete classification of cimentrs can be found in EN 197. See also the Notes section below.

  • NA (str) – is the choosen National Annex. At the moment, only the French one (default value) is supported.

  • time (float) – Concrete age. The default value is 28.

Variables:
  • gamma_c (float) – Safety coefficient \(\gamma_{c}\) (Table 2.1N EN 1992-1-1) associated to concrete for the input limit state

  • alpha_cc (float) – Coefficient \({\\alpha}_{cc}\) (§3.1.6 EN 1992-1-1) that accounts for long-term effects on concrete resistance in compression (see also \(k_{t}\) coefficient at §3.1.2)

  • alpha_ct (float) – Coefficient \({\\alpha}_{ct}\) (§3.1.6 EN 1992-1-1) that accounts for long-term effects on concrete resistance in tension (see also \(k_{t}\) coefficient at §3.1.2)

  • ecm (float) – Young’s module \(E_{cm}\) at the specified concrete age as per the EN 1992-1-1, Table 3.1. Please pay attention to the fact that RCC-CW may introduce specific concrete Young’s modules for different situations

  • fcd (float) – Design resistance of concrete \(f_{cd}\) in compression at the specificied concrete age

  • fctd_005 (float) – Design resistance of concrete \(f_{ctd,0.05}\) in tension at the specificied concrete age (fractile 5%)

  • ecm_28 (float) – Young module \(E_{cm}\) at the 28 days as per the EN 1992-1-1, Table 3.1. Please pay attention to the fact that RCC-CW may introduce specific concrete Young’s modules for different situations

  • fcd_28 (float) – Design resistance of concrete in compression at 28 days

  • fctd_005_28 (float) – Design resistance of concrete in compression at 28 days (fractile 5%)

  • fck (float) – Characteristic resistance of concrete in compression at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fcm (float) – Medium design resistance of concrete in compression at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fctk_005 (float) – Characteristic resistance of concrete in tension at the specificied concrete age (fractile 5%)

  • fctk_095 (float) – Characteristic resistance of concrete in tension at the specificied concrete age (fractile 95%)

  • fctm (float) – Medium design resistance of concrete in tension at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fck_28 (float) – Characteristic resistance of concrete in compression at 28 days

  • fcm_28 (float) – Medium design resistance of concrete in compression at 28 days

  • fctk_005_28 (float) – Characteristic resistance of concrete in tension at 28 days (fractile 5%)

  • fctk_095_28 (float) – Characteristic resistance of concrete in tension at 28 days (fractile 95%)

  • fctm_28 (float) – Medium design resistance of concrete in tension at 28 days

  • eps_c1 (float)

  • eps_cu1 (float)

  • eps_c2 (float)

  • eps_cu2 (float)

  • n (float)

  • eps_c3 (float)

  • eps_cu3 (float)

  • eps_c1_28 (float)

  • eps_cu1_28 (float)

  • eps_c2_28 (float)

  • eps_cu2_28 (float)

  • n_28 (float)

  • eps_c3_28 (float)

  • eps_cu3_28 (float)

  • dilat (float)

  • s (float)

  • beta_cc (float)

  • eps_ct (float) – Mean cracking strain at time t: \(\varepsilon_{ct} = f_{ctm} / E_{cm}\).

  • eps_ctd (float) – Design cracking strain at time t: \(\varepsilon_{ctd} = f_{ctd,0.05} / E_{cm}\).

  • eps_ct_28 (float) – Mean cracking strain at 28 days.

  • eps_ctd_28 (float) – Design cracking strain at 28 days.

References

  • EN 1992-1-1 (1st generation)

  • EN 197

  • RCC-CW 2021

    Here below we show the correspondence between EN 197 composition and ciment class as per EN 1992-1-1:

    Ciment class

    Admissible composition

    R

    CEM 42.5 R, CEM 52.5 N, CEM 52.5 R

    N

    CEM 32.5 R, CEM 42.5 N

    S

    CEM 32.5 N

EN 10025-2 structural steel

Thickness-dependent yield and ultimate strength for carbon structural steels (S235, S275, S355).

“””Steel properties as per NF EN 10025-2.

Implements thickness-dependent yield and ultimate strength for carbon structural steels (grades S235, S275, S355) according to NF EN 10025-2 Table 7.

Classes

Steel_plate

Base class providing the common interface.

Steel_EN10025_2

Derived class with EN 10025-2 thickness-dependent properties.

“””

class Steel_EN10025_2(
grade,
t=0,
young=200000,
)

Bases: Steel_plate

Represents a carbon steel as per the NF EN 10025-2 standard. Yield and ultimate resistance are evaluated from steel grade and thickness.

class Steel_plate(
grade,
t=0,
young=200000,
)

Bases: object

Base class for steels.

Parameters:
  • grade (-) – The steel grade.

  • t (-) – Thickness of the steel plate [mm].

  • young (-) – Young modulus [MPa].

Bridge / factory functions

Factory functions that create Concrete and Steel objects from the EC2 and EN 10025 property classes, extracting all constitutive parameters automatically.

Bridge between EC2 property classes and GenSec materials.

Provides factory functions that create Concrete and Steel GenSec material objects from the EC2 / EN 10025 property classes, automatically extracting all constitutive parameters.

This avoids hard-coding EC2 Table 3.1 values in GenSec — they are computed once by the EC2 property classes and passed through.

Examples

Create a C30/37 concrete for fundamental ULS, slow loading, at 28 days:

>>> from gensec.materials.ec2_bridge import concrete_from_ec2
>>> c = concrete_from_ec2(fck=30, ls='F', loadtype='slow', TypeConc='R')
>>> c.fcd
17.0
>>> c.eps_cu2
-0.0035

Create an S355 structural steel plate, 20 mm thick:

>>> from gensec.materials.ec2_bridge import steel_from_en10025
>>> s = steel_from_en10025(grade='S355', t=20)
>>> s.fyk
345
concrete_from_class(
conc_class,
ls='F',
loadtype='slow',
TypeConc='R',
NA='French',
time=28,
enable_tension=False,
tension_fct='fctd',
)

Create a GenSec Concrete from an EC2 class name.

Parameters:
  • conc_class (str) – EC2 class name, e.g. 'C25/30', 'C30/37', etc.

  • ls – Passed through to concrete_from_ec2().

  • loadtype – Passed through to concrete_from_ec2().

  • TypeConc – Passed through to concrete_from_ec2().

  • NA – Passed through to concrete_from_ec2().

  • time – Passed through to concrete_from_ec2().

  • enable_tension (bool, optional) – Activate the linear tension branch. Default False.

  • tension_fct (str, optional) – Tensile strength source ('fctd', 'fctm', or 'fctk'). Default 'fctd'.

Return type:

Concrete

Raises:

ValueError – If the class name is not recognized.

concrete_from_ec2(
fck,
ls='F',
loadtype='slow',
TypeConc='R',
NA='French',
time=28,
enable_tension=False,
tension_fct='fctd',
)

Create a GenSec Concrete from EC2 Table 3.1 properties.

This function instantiates the EC2 fben2 class to compute all EC2 properties (including the correct \(\varepsilon_{c2}\), \(\varepsilon_{cu2}\), \(n\), \(\alpha_{cc}\), \(\gamma_c\) for the chosen National Annex and limit state), then builds a GenSec Concrete with those values.

Parameters:
  • fck (float) – Characteristic cylinder strength [MPa].

  • ls (str, optional) – Limit state: 'F' (fundamental), 'A' (accidental), or 'S' (service). Default 'F'.

  • loadtype (str, optional) – 'slow' or 'fast'. Default 'slow'.

  • TypeConc (str, optional) – Cement type: 'R', 'N', or 'S'. Default 'R'.

  • NA (str, optional) – National Annex. Default 'French'.

  • time (float, optional) – Concrete age [days]. Default 28.

  • enable_tension (bool, optional) – If True, the returned Concrete includes a linear tension branch. The tensile strength and elastic modulus are taken from the EC2 property object. Default False.

  • tension_fct (str, optional) – Which tensile strength to use when enable_tension=True: 'fctd' for design value \(f_{ctd,0.05}\) (default), 'fctm' for mean value \(f_{ctm}\), or 'fctk' for characteristic value \(f_{ctk,0.05}\).

Returns:

GenSec material with all parameters from EC2.

Return type:

Concrete

Notes

The returned Concrete object also carries an ec2 attribute holding the full fben2 instance for access to all EN 1992-1-1 properties (fcm, fctm, Ecm, etc.).

steel_from_en10025(
grade='S355',
t=0,
young=200000,
gamma_s=1.0,
eps_su=0.05,
)

Create a GenSec Steel from EN 10025-2 properties.

This is for structural steel (plates, profiles), not reinforcing bars. The yield strength depends on thickness.

Parameters:
  • grade (str) – Steel grade: 'S235', 'S275', or 'S355'.

  • t (float, optional) – Thickness [mm]. Default 0.

  • young (float, optional) – Young’s modulus [MPa]. Default 200000.

  • gamma_s (float, optional) – Partial safety factor. Default 1.0 (no reduction for structural steel at ULS; use 1.0 or as per code).

  • eps_su (float, optional) – Ultimate strain. Default 0.05 (5%).

Returns:

GenSec material. works_in_compression=True always for structural steel.

Return type:

Steel

Notes

The returned Steel object also carries an en10025 attribute with the full Steel_EN10025_2 instance.

Package-level exports

Materials subpackage.

Core constitutive laws:

EC2 / EN 10025 property classes:

class Concrete(
fck: float = 25.0,
gamma_c: float = 1.5,
alpha_cc: float = 0.85,
n_parabola: float = 2.0,
eps_c2: float = -0.002,
eps_cu2: float = -0.0035,
fct: float = 0.0,
Ec: float = 0.0,
)

Bases: Material

Parabola-rectangle concrete (EC2 3.1.7 / NTC 2018) with optional linear tension branch.

Compression (\(\varepsilon \le 0\)):

\[\begin{split}\sigma_c(\varepsilon) = \begin{cases} -f_{cd}\!\left[1 - \left(1 - \dfrac{\varepsilon} {\varepsilon_{c2}}\right)^{\!n}\right] & \varepsilon_{c2} \le \varepsilon \le 0 \\[6pt] -f_{cd} & \varepsilon_{cu2} \le \varepsilon < \varepsilon_{c2} \\[6pt] 0 & \varepsilon < \varepsilon_{cu2} \end{cases}\end{split}\]

Tension (\(\varepsilon > 0\)), activated when \(f_{ct} > 0\) and \(E_c > 0\):

\[\begin{split}\sigma_c(\varepsilon) = \begin{cases} E_c \, \varepsilon & 0 < \varepsilon \le \varepsilon_{ct} \\[6pt] 0 & \varepsilon > \varepsilon_{ct} \end{cases}\end{split}\]

where \(\varepsilon_{ct} = f_{ct} / E_c\) is the cracking strain. When \(f_{ct} = 0\) (default), the tension branch is suppressed and \(\sigma = 0\) for all \(\varepsilon > 0\).

Parameters:
  • fck (float) – Characteristic cylinder strength [MPa].

  • gamma_c (float, optional) – Partial safety factor. Default 1.5.

  • alpha_cc (float, optional) – Long-term coefficient. Default 0.85.

  • n_parabola (float, optional) – Parabolic exponent. Default 2.0.

  • eps_c2 (float, optional) – Peak-stress strain (negative). Default -0.002.

  • eps_cu2 (float, optional) – Ultimate compressive strain (negative). Default -0.0035.

  • fct (float, optional) – Tensile strength [MPa] for the linear tension branch. Use \(f_{ctd}\) (design) or \(f_{ctm}\) (mean) depending on the verification context. Default 0.0 (no tension).

  • Ec (float, optional) – Elastic modulus [MPa] for the tension branch. Typically \(E_{cm}\) from EC2 Table 3.1. Default 0.0.

Variables:
  • fcd (float) – Design compressive strength [MPa].

  • eps_ct (float) – Cracking strain \(f_{ct}/E_c\). Zero when the tension branch is disabled.

  • tension_enabled (bool) – True when both fct > 0 and Ec > 0.

property eps_max

Most tensile admissible strain.

Returns \(\varepsilon_{ct}\) when the tension branch is active, 0.0 otherwise.

property eps_min

Most compressive admissible strain.

stress(
eps,
)

Evaluate stress for a single strain value.

Parameters:

eps (float) – Strain (positive = tension, negative = compression).

Returns:

Stress [MPa]. Positive = tension, negative = compression.

Return type:

float

stress_array(
eps,
)

Vectorized stress evaluation.

Accepts arrays of any shape (1-D, 2-D, …). When numba is installed, the inner loop is JIT-compiled.

Parameters:

eps (numpy.ndarray) – Strain array.

Returns:

Stress array [MPa], same shape as eps.

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma_c / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_c & 0 < \varepsilon \le \varepsilon_{ct} \;\text{(tension enabled)} \\ -\dfrac{f_{cd}\,n}{\varepsilon_{c2}} \left(1 - \dfrac{\varepsilon}{\varepsilon_{c2}} \right)^{n-1} & \varepsilon_{c2} < \varepsilon \le 0 \\ 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (float)

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus \(E_t = d\sigma_c / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_c & 0 < \varepsilon \le \varepsilon_{ct} \;\text{(tension enabled)} \\[4pt] -\dfrac{f_{cd} \, n}{\varepsilon_{c2}} \left(1 - \dfrac{\varepsilon}{\varepsilon_{c2}} \right)^{n-1} & \varepsilon_{c2} < \varepsilon \le 0 \\[4pt] 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

class Material

Bases: ABC

Abstract base class for all constitutive material laws.

Every material must expose:

  • stress(eps) — scalar stress evaluation.

  • stress_array(eps) — vectorized evaluation over an array of arbitrary shape (1-D, 2-D, …).

  • tangent(eps) — scalar tangent modulus \(E_t = \mathrm{d}\sigma/\mathrm{d}\varepsilon\).

  • tangent_array(eps) — vectorized tangent modulus over an array of arbitrary shape.

  • eps_min / eps_max — admissible strain range.

The tangent modulus is used by integrate_with_tangent() to assemble the analytical tangent stiffness matrix, avoiding the cost of finite-difference Jacobians in Newton-Raphson solvers.

The strain limits are consumed by the N-M diagram generator to automatically determine the scan range for ultimate configurations.

Variables:
  • eps_min (float) – Most compressive admissible strain (typically negative).

  • eps_max (float) – Most tensile admissible strain (typically positive).

abstract property eps_max

Most tensile admissible strain.

abstract property eps_min

Most compressive admissible strain.

abstractmethod stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized stress computation.

Default implementation loops over stress(). Subclasses should override for performance. The input may have any shape (1-D, 2-D, …); the output must have the same shape.

Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma / d\varepsilon\).

Default implementation uses a central finite difference with step \(h = 10^{-8}\). Subclasses should override with the closed-form derivative for best accuracy and speed.

Parameters:

eps (float)

Returns:

Tangent modulus [MPa].

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus.

Default implementation uses a central finite difference. Subclasses should override with the closed-form derivative. Input may have any shape.

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

class Steel(
fyk: float = 450.0,
gamma_s: float = 1.15,
Es: float = 200000.0,
k_hardening: float = 1.0,
eps_su: float = 0.01,
works_in_compression: bool = True,
)

Bases: Material

Elastic-plastic steel with optional linear hardening.

\[\begin{split}\sigma_s(\varepsilon) = \begin{cases} E_s\,\varepsilon & |\varepsilon| \le \varepsilon_{yd} \\ \mathrm{sign}(\varepsilon)\!\left[f_{yd} + (f_{td}-f_{yd}) \dfrac{|\varepsilon|-\varepsilon_{yd}} {\varepsilon_{su}-\varepsilon_{yd}}\right] & \varepsilon_{yd} < |\varepsilon| \le \varepsilon_{su} \\ 0 & |\varepsilon| > \varepsilon_{su} \end{cases}\end{split}\]
Parameters:
  • fyk (float) – Characteristic yield strength [MPa].

  • gamma_s (float, optional) – Partial safety factor. Default 1.15.

  • Es (float, optional) – Young’s modulus [MPa]. Default 200000.

  • k_hardening (float, optional) – \(f_t/f_y\) ratio. Default 1.0 (perfectly plastic).

  • eps_su (float, optional) – Ultimate strain. Default 0.01.

  • works_in_compression (bool, optional) – If False, compressive stress is zero. Default True.

Variables:
  • fyd (float) – Design yield strength [MPa].

  • ftd (float) – Design ultimate strength [MPa].

  • eps_yd (float) – Yield strain.

property eps_max

Most tensile admissible strain.

property eps_min

Most compressive admissible strain.

stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized stress computation.

Accepts arrays of any shape. When numba is installed, the inner loop is JIT-compiled.

Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus \(E_t = d\sigma_s / d\varepsilon\).

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus \(E_t = d\sigma_s / d\varepsilon\).

\[\begin{split}E_t(\varepsilon) = \begin{cases} E_s & |\varepsilon| \le \varepsilon_{yd} \\ \dfrac{f_{td} - f_{yd}} {\varepsilon_{su} - \varepsilon_{yd}} & \varepsilon_{yd} < |\varepsilon| \le \varepsilon_{su} \\ 0 & \text{otherwise} \end{cases}\end{split}\]
Parameters:

eps (numpy.ndarray)

Return type:

numpy.ndarray

class Steel_EN10025_2(
grade,
t=0,
young=200000,
)

Bases: Steel_plate

Represents a carbon steel as per the NF EN 10025-2 standard. Yield and ultimate resistance are evaluated from steel grade and thickness.

class Steel_plate(
grade,
t=0,
young=200000,
)

Bases: object

Base class for steels.

Parameters:
  • grade (-) – The steel grade.

  • t (-) – Thickness of the steel plate [mm].

  • young (-) – Young modulus [MPa].

class TabulatedMaterial(
strains,
stresses,
name='Tabulated',
)

Bases: Material

Material defined by a tabulated \((\varepsilon, \sigma)\) curve.

Piecewise-linear interpolation between data points. Strains outside the table range return zero stress (material failure).

Parameters:
  • strains (array_like) – Strictly increasing strain values.

  • stresses (array_like) – Corresponding stress values [MPa].

  • name (str, optional) – Label. Default "Tabulated".

Raises:

ValueError – Bad dimensions or non-monotonic strains.

Examples

>>> mat = TabulatedMaterial([-0.01, -0.002, 0, 0.002, 0.01],
...                        [-400, -400, 0, 400, 400], "EPP")
>>> mat.stress(0.001)
200.0
property eps_max

Most tensile admissible strain.

property eps_min

Most compressive admissible strain.

property name

Material label.

stress(
eps,
)

Compute stress for a single strain value.

Parameters:

eps (float) – Strain.

Returns:

Stress [MPa].

Return type:

float

stress_array(
eps,
)

Vectorized piecewise-linear interpolation.

Accepts arrays of any shape (1-D, 2-D, …).

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

tangent(
eps,
)

Scalar tangent modulus from the piecewise-linear table.

Returns the slope of the linear segment containing eps, or 0 outside the table range.

Parameters:

eps (float)

Return type:

float

tangent_array(
eps,
)

Vectorized tangent modulus from the piecewise-linear table.

For each strain value, returns the slope of the containing linear segment, or 0 outside the table range.

Parameters:

eps (numpy.ndarray)

Returns:

Same shape as eps.

Return type:

numpy.ndarray

concrete_from_class(
conc_class,
ls='F',
loadtype='slow',
TypeConc='R',
NA='French',
time=28,
enable_tension=False,
tension_fct='fctd',
)

Create a GenSec Concrete from an EC2 class name.

Parameters:
  • conc_class (str) – EC2 class name, e.g. 'C25/30', 'C30/37', etc.

  • ls – Passed through to concrete_from_ec2().

  • loadtype – Passed through to concrete_from_ec2().

  • TypeConc – Passed through to concrete_from_ec2().

  • NA – Passed through to concrete_from_ec2().

  • time – Passed through to concrete_from_ec2().

  • enable_tension (bool, optional) – Activate the linear tension branch. Default False.

  • tension_fct (str, optional) – Tensile strength source ('fctd', 'fctm', or 'fctk'). Default 'fctd'.

Return type:

Concrete

Raises:

ValueError – If the class name is not recognized.

concrete_from_ec2(
fck,
ls='F',
loadtype='slow',
TypeConc='R',
NA='French',
time=28,
enable_tension=False,
tension_fct='fctd',
)

Create a GenSec Concrete from EC2 Table 3.1 properties.

This function instantiates the EC2 fben2 class to compute all EC2 properties (including the correct \(\varepsilon_{c2}\), \(\varepsilon_{cu2}\), \(n\), \(\alpha_{cc}\), \(\gamma_c\) for the chosen National Annex and limit state), then builds a GenSec Concrete with those values.

Parameters:
  • fck (float) – Characteristic cylinder strength [MPa].

  • ls (str, optional) – Limit state: 'F' (fundamental), 'A' (accidental), or 'S' (service). Default 'F'.

  • loadtype (str, optional) – 'slow' or 'fast'. Default 'slow'.

  • TypeConc (str, optional) – Cement type: 'R', 'N', or 'S'. Default 'R'.

  • NA (str, optional) – National Annex. Default 'French'.

  • time (float, optional) – Concrete age [days]. Default 28.

  • enable_tension (bool, optional) – If True, the returned Concrete includes a linear tension branch. The tensile strength and elastic modulus are taken from the EC2 property object. Default False.

  • tension_fct (str, optional) – Which tensile strength to use when enable_tension=True: 'fctd' for design value \(f_{ctd,0.05}\) (default), 'fctm' for mean value \(f_{ctm}\), or 'fctk' for characteristic value \(f_{ctk,0.05}\).

Returns:

GenSec material with all parameters from EC2.

Return type:

Concrete

Notes

The returned Concrete object also carries an ec2 attribute holding the full fben2 instance for access to all EN 1992-1-1 properties (fcm, fctm, Ecm, etc.).

class fben2(
fck: float,
ls: str,
loadtype: str,
TypeConc: str,
NA='French',
time=28,
)

Bases: object

This class creates an object that describes as per the Eurocode 1992-1-1 the concrete characteristics for design. The French National Annex is used. It doesn’t include any limits or checks on the concrete classes, but it just applies the formulas that describes all the mechanical characteristics, at a given time.

Parameters:
  • fck (float) – Characteristic resistance in compression of concrete. Usually is considered at 28 days, but we’re not limited to. This value is the nominal value of concrete.

  • ls (str) – Limit state which we consider (‘F’, ‘A’ or anything else).

  • loadtype (str) – Speed of load application. Usually is ‘slow’.

  • TypeConc (str) – Ciment type (‘R’, ‘S’ or ‘N’) as per EN 1992-1-1 §3.1.2. The complete classification of cimentrs can be found in EN 197. See also the Notes section below.

  • NA (str) – is the choosen National Annex. At the moment, only the French one (default value) is supported.

  • time (float) – Concrete age. The default value is 28.

Variables:
  • gamma_c (float) – Safety coefficient \(\gamma_{c}\) (Table 2.1N EN 1992-1-1) associated to concrete for the input limit state

  • alpha_cc (float) – Coefficient \({\\alpha}_{cc}\) (§3.1.6 EN 1992-1-1) that accounts for long-term effects on concrete resistance in compression (see also \(k_{t}\) coefficient at §3.1.2)

  • alpha_ct (float) – Coefficient \({\\alpha}_{ct}\) (§3.1.6 EN 1992-1-1) that accounts for long-term effects on concrete resistance in tension (see also \(k_{t}\) coefficient at §3.1.2)

  • ecm (float) – Young’s module \(E_{cm}\) at the specified concrete age as per the EN 1992-1-1, Table 3.1. Please pay attention to the fact that RCC-CW may introduce specific concrete Young’s modules for different situations

  • fcd (float) – Design resistance of concrete \(f_{cd}\) in compression at the specificied concrete age

  • fctd_005 (float) – Design resistance of concrete \(f_{ctd,0.05}\) in tension at the specificied concrete age (fractile 5%)

  • ecm_28 (float) – Young module \(E_{cm}\) at the 28 days as per the EN 1992-1-1, Table 3.1. Please pay attention to the fact that RCC-CW may introduce specific concrete Young’s modules for different situations

  • fcd_28 (float) – Design resistance of concrete in compression at 28 days

  • fctd_005_28 (float) – Design resistance of concrete in compression at 28 days (fractile 5%)

  • fck (float) – Characteristic resistance of concrete in compression at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fcm (float) – Medium design resistance of concrete in compression at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fctk_005 (float) – Characteristic resistance of concrete in tension at the specificied concrete age (fractile 5%)

  • fctk_095 (float) – Characteristic resistance of concrete in tension at the specificied concrete age (fractile 95%)

  • fctm (float) – Medium design resistance of concrete in tension at the specified concrete age. Usually is considered at 28 days, but we’re not limited to

  • fck_28 (float) – Characteristic resistance of concrete in compression at 28 days

  • fcm_28 (float) – Medium design resistance of concrete in compression at 28 days

  • fctk_005_28 (float) – Characteristic resistance of concrete in tension at 28 days (fractile 5%)

  • fctk_095_28 (float) – Characteristic resistance of concrete in tension at 28 days (fractile 95%)

  • fctm_28 (float) – Medium design resistance of concrete in tension at 28 days

  • eps_c1 (float)

  • eps_cu1 (float)

  • eps_c2 (float)

  • eps_cu2 (float)

  • n (float)

  • eps_c3 (float)

  • eps_cu3 (float)

  • eps_c1_28 (float)

  • eps_cu1_28 (float)

  • eps_c2_28 (float)

  • eps_cu2_28 (float)

  • n_28 (float)

  • eps_c3_28 (float)

  • eps_cu3_28 (float)

  • dilat (float)

  • s (float)

  • beta_cc (float)

  • eps_ct (float) – Mean cracking strain at time t: \(\varepsilon_{ct} = f_{ctm} / E_{cm}\).

  • eps_ctd (float) – Design cracking strain at time t: \(\varepsilon_{ctd} = f_{ctd,0.05} / E_{cm}\).

  • eps_ct_28 (float) – Mean cracking strain at 28 days.

  • eps_ctd_28 (float) – Design cracking strain at 28 days.

References

  • EN 1992-1-1 (1st generation)

  • EN 197

  • RCC-CW 2021

    Here below we show the correspondence between EN 197 composition and ciment class as per EN 1992-1-1:

    Ciment class

    Admissible composition

    R

    CEM 42.5 R, CEM 52.5 N, CEM 52.5 R

    N

    CEM 32.5 R, CEM 42.5 N

    S

    CEM 32.5 N

steel_from_en10025(
grade='S355',
t=0,
young=200000,
gamma_s=1.0,
eps_su=0.05,
)

Create a GenSec Steel from EN 10025-2 properties.

This is for structural steel (plates, profiles), not reinforcing bars. The yield strength depends on thickness.

Parameters:
  • grade (str) – Steel grade: 'S235', 'S275', or 'S355'.

  • t (float, optional) – Thickness [mm]. Default 0.

  • young (float, optional) – Young’s modulus [MPa]. Default 200000.

  • gamma_s (float, optional) – Partial safety factor. Default 1.0 (no reduction for structural steel at ULS; use 1.0 or as per code).

  • eps_su (float, optional) – Ultimate strain. Default 0.05 (5%).

Returns:

GenSec material. works_in_compression=True always for structural steel.

Return type:

Steel

Notes

The returned Steel object also carries an en10025 attribute with the full Steel_EN10025_2 instance.