Cauchy Continuum Model#

The solid material model in SGIO is implemented by sgio.model.CauchyContinuumModel. The legacy dataclass-based CauchyContinuumModel has been removed; the Pydantic implementation that was previously exposed as CauchyContinuumModelNew now owns the canonical name. A temporary import alias CauchyContinuumModelNew is still provided to ease migration, but it will be deprecated in a future release.

The model captures the standard Cauchy continuum kinematics with three displacements (\(u_1\), \(u_2\), \(u_3\)) and six strain components (\(\varepsilon_{11}\), \(\varepsilon_{22}\), \(\varepsilon_{33}\), \(\varepsilon_{23}\), \(\varepsilon_{13}\), \(\varepsilon_{12}\)).

Key Features#

  • Pydantic validation on construction and assignment (validate_assignment=True)

  • Explicit support for isotropic, orthotropic, and fully anisotropic materials

  • Typed material queries via get_matrix_component() and get_thermal_expansion()

  • Explicit setters set_isotropy(), set_elastic(), and set_strength_constants()

  • First-class JSON serialization via model_dump() and model_dump_json()

Creating a Material#

The constructor accepts keyword arguments for all engineering constants. Pydantic validators enforce units and admissible ranges, for example Poisson ratios.

from sgio.model.solid import CauchyContinuumModel

carbon_ud = CauchyContinuumModel(
    name="UD Carbon/Epoxy",
    isotropy=1,
    density=1570.0,
    e1=138e9,
    e2=9e9,
    e3=9e9,
    g12=5.2e9,
    g13=5.2e9,
    g23=3.5e9,
    nu12=0.32,
    nu13=0.32,
    nu23=0.45,
    strength_constants=[
        1500.0, 1200.0, 800.0,
        900.0, 700.0, 600.0,
        120.0, 110.0, 95.0,
    ],
    cte=[2.5e-6, 2.5e-6, 2.4e-5, 0.0, 0.0, 0.0],
)

The preferred mutation path uses explicit typed setters:

from sgio.model import ElasticInputType, MatrixKind, TensorComponent

carbon_ud.set_isotropy('orthotropic')
carbon_ud.set_elastic([210e9, 0.29], input_type=ElasticInputType.ISOTROPIC)

c11 = carbon_ud.get_matrix_component(MatrixKind.STIFFNESS, TensorComponent(1, 1))

Legacy get() / set() helpers remain only as migration shims. New examples should not depend on them; see Model Compatibility Migration Guide for the compatibility mapping and removal roadmap.

Loading from JSON#

The example at examples/load_cauchy_material_from_json/ demonstrates a complete JSON round-trip. The core logic is straightforward:

import json
from pathlib import Path

from sgio.model.solid import CauchyContinuumModel

payload = json.loads(Path('material.json').read_text())
material = CauchyContinuumModel(**payload)
print(material.model_dump_json(indent=2))

This pattern works equally well when the JSON document comes from a database or an API response, making it easy to integrate SGIO materials into external pipelines.