Physics Models
Physics models define material behavior and element-level computations for finite element analysis.
Available Physics Models
pyFANTOM.physics.LinearElasticity.LinearElasticity- Linear elasticity physics modelpyFANTOM.physics.NLElasticity.NLElasticity- Nonlinear elasticity physics modelpyFANTOM.physics.SteadyHeatTransfer.SteadyHeatTransfer- Steady-state heat transfer physics modelpyFANTOM.physics.LinearSymbolic.LinearSymbolic- Symbolic linear physics model
Base Class
- class pyFANTOM.physics._physx.Physx[source]
Bases:
objectBase class for physics models in pyFANTOM.
Abstract interface defining methods all physics implementations must provide. Physics models compute element-level quantities (stiffness matrices, areas/volumes, etc.).
Notes
All methods accept: - Single element: x0s shape (n_nodes_per_element, spatial_dim) - Batch: x0s shape (n_elements, n_nodes_per_element, spatial_dim)
Subclasses must implement all abstract methods.
Examples
>>> from pyFANTOM import LinearElasticity >>> physics = LinearElasticity(E=200e9, nu=0.3) >>> K = physics.K(element_nodes) # Shape: (dof, dof)
Detailed Documentation
- class pyFANTOM.physics.LinearElasticity.LinearElasticity(E=1.0, nu=0.3333333333333333, thickness=1.0, type='PlaneStress')[source]
Bases:
PhysxLinear isotropic elasticity physics model.
Implements small-deformation elasticity for 2D (plane stress/strain) and 3D solid mechanics. Computes element stiffness matrices, B-matrices, and D-matrices for triangles, quads, tets, and hexes.
- Parameters:
Notes
Supported Elements: - 2D: 3-node triangles, 4-node quads - 3D: 4-node tetrahedra, 8-node hexahedra
Plane Stress vs Plane Strain: - Plane Stress: σ_z = 0 (thin plates) - Plane Strain: ε_z = 0 (thick sections, extrusions)
Constitutive Matrix D: - Relates stress to strain: σ = D @ ε - Plane stress: D_11 = E/(1-ν²) - Plane strain: D_11 = E(1-ν)/[(1+ν)(1-2ν)]
B-Matrix: - Strain-displacement operator: ε = B @ u - Shape: (3, n_dof) for 2D, (6, n_dof) for 3D
Examples
>>> from pyFANTOM import LinearElasticity >>> # Aluminum properties >>> physics = LinearElasticity(E=70e9, nu=0.33, type='PlaneStress') >>> >>> # Steel 3D >>> physics_3d = LinearElasticity(E=200e9, nu=0.3) >>> >>> # Use with mesh >>> from pyFANTOM.CPU import StructuredMesh2D >>> mesh = StructuredMesh2D(nx=64, ny=32, lx=2.0, ly=1.0, physics=physics)
- class pyFANTOM.physics.NLElasticity.NLElasticity(E=1.0, nu=0.3333333333333333, thickness=1.0, type='PlaneStress')[source]
Bases:
PhysxGeometrically nonlinear elasticity for large deformations.
Implements finite strain elasticity with St. Venant-Kirchhoff material model. For large displacement problems where linear elasticity is insufficient.
- Parameters:
Notes
Use case: Large deformations, geometric nonlinearity
Solver: Requires NLFiniteElement with Newton-Raphson
Elements: Currently supports 4-node quads only
Material: St. Venant-Kirchhoff (simple hyperelastic)
Limitations: Not suitable for very large strains (>20%)
Examples
>>> from pyFANTOM import NLElasticity >>> physics = NLElasticity(E=1.0, nu=0.3) >>> # Use with NLFiniteElement and NLUniformStiffnessKernel
- class pyFANTOM.physics.SteadyHeatTransfer.SteadyHeatTransfer(k=1.0, thickness=1.0)[source]
Bases:
PhysxSteady-state heat conduction physics.
Implements Fourier heat conduction for thermal topology optimization. Governed by ∇·(k∇T) = Q where T is temperature, k is conductivity, Q is heat source.
- Parameters:
Notes
Use case: Heat sink design, thermal management
DOF: 1 per node (temperature)
BCs: Dirichlet (fixed temperature), Neumann (heat flux)
Elements: Triangles, quads, tets, hexes
FEA formulation: K @ T = Q (identical structure to elasticity)
Examples
>>> from pyFANTOM import SteadyHeatTransfer >>> physics = SteadyHeatTransfer(k=200, thickness=0.01) # Aluminum >>> mesh = StructuredMesh2D(nx=64, ny=64, lx=0.1, ly=0.1, physics=physics)