forked from 1b-agent/fieldcraft-upstream
fem: finite-strain material point, total Lagrangian elements and follower pressure
The material point interface returns the Kirchhoff stress and the spatial tangent of its Lie derivative from the deformation gradient, with per-point history committed by the solver: St Venant–Kirchhoff (pushed forward from S = D E) and the decoupled compressible neo-Hookean with its isochoric and volumetric parts. Total Lagrangian solids (tet4, tet10, wedge6, hex8, hex20 full and reduced) and plane strain and axisymmetric elements give internal forces and the consistent tangent with its geometric stiffness; hybrid solids use the Simo–Taylor–Pister three-field formulation on the existing pressure fields. Incompatible modes and plane stress are refused by name. Follower pressure on faces and 2D edges with its load stiffness. Every tangent is checked against central differences of its forces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm
This commit is contained in:
1 parent
bc9fe2191a
commit
2321d75cc6
8 files changed
+1217
-16
No files matched your search
+13
-13
@@ -189,18 +189,18 @@ pub fn formulation(kind: ElementKind, f: &fieldcraft_model::Formulation) -> Resu
|
||||
}
|
||||
|
||||
/// One column of the strain operator: (∂N/∂x, ∂N/∂y, hoop N/r), for a node or an internal mode.
|
||||
type Column = [f64; 3];
|
||||
pub(crate) type Column = [f64; 3];
|
||||
|
||||
/// What the kernels need at one integration point.
|
||||
struct At {
|
||||
shape: Shape,
|
||||
pub(crate) struct At {
|
||||
pub(crate) shape: Shape,
|
||||
/// Strain columns of the nodes.
|
||||
g: [Column; MAX_NODES],
|
||||
det: f64,
|
||||
x: [f64; 3],
|
||||
pub(crate) g: [Column; MAX_NODES],
|
||||
pub(crate) det: f64,
|
||||
pub(crate) x: [f64; 3],
|
||||
/// det J times the point's weight times the out-of-plane extent: the point's share of the
|
||||
/// volume.
|
||||
dv: f64,
|
||||
pub(crate) dv: f64,
|
||||
}
|
||||
|
||||
/// The incompatible modes' count of internal degrees of freedom: two modes, two directions.
|
||||
@@ -210,14 +210,14 @@ const INCOMPATIBLE_DOFS: usize = 4;
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Plane<'a> {
|
||||
pub ty: &'static ElementType,
|
||||
xyz: &'a [[f64; 3]],
|
||||
formulation: Formulation,
|
||||
theory: Theory,
|
||||
pub(crate) xyz: &'a [[f64; 3]],
|
||||
pub(crate) formulation: Formulation,
|
||||
pub(crate) theory: Theory,
|
||||
}
|
||||
|
||||
/// out[2i + r][2j + c] += w (Bᵢᵀ D Bⱼ)[r][c] over every pair of columns (row-major, `cols` wide),
|
||||
/// computed for j ≥ i and mirrored, so the result is exactly symmetric.
|
||||
fn accumulate(out: &mut [f64], columns: &[Column], d: &Elasticity2, w: f64) {
|
||||
pub(crate) fn accumulate(out: &mut [f64], columns: &[Column], d: &Elasticity2, w: f64) {
|
||||
let cols = 2 * columns.len();
|
||||
let block = |g: &Column| -> [[f64; 2]; 4] { [[g[0], 0.0], [0.0, g[1]], [g[2], 0.0], [g[1], g[0]]] };
|
||||
for (j, gj) in columns.iter().enumerate() {
|
||||
@@ -293,7 +293,7 @@ impl<'a> Plane<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn degenerate(&self) -> Error {
|
||||
pub(crate) fn degenerate(&self) -> Error {
|
||||
Error::Degenerate(format!("a 2D {} element is inverted, clockwise or degenerate (its Jacobian is not positive)", self.ty.kind.name()))
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ impl<'a> Plane<'a> {
|
||||
(j, j[0][0] * j[1][1] - j[0][1] * j[1][0])
|
||||
}
|
||||
|
||||
fn at(&self, p: &Point) -> Result<At> {
|
||||
pub(crate) fn at(&self, p: &Point) -> Result<At> {
|
||||
let basis = Basis::of(self.ty.kind);
|
||||
let shape = basis.eval(p.xi);
|
||||
let grads = basis.gradients(&shape, self.xyz).map_err(|_| self.degenerate())?;
|
||||
|
||||
Reference in new issue
Block a user