Skip to content

[IGA] Nonlinear isogeometric spatial Bernoulli beam element - #15015

Merged
juancamarotti merged 34 commits into
masterfrom
iga/3d_beam_implementation
Nov 26, 2026
Merged

juancamarotti merged 34 commits into
masterfrom
iga/3d_beam_implementation

Conversation

@juancamarotti

@juancamarotti juancamarotti commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds a geometrically nonlinear isogeometric spatial Bernoulli beam with torsion, following Bauer et al., Nonlinear isogeometric spatial Bernoulli beam, CMAME 303 (2016) 101–127. Four DOFs per control point: DISPLACEMENT_X/Y/Z and the twist about the centre line (ROTATION_X).

What's added

  • BeamBaseElement3D: base class with the NURBS-curve kinematics used by the formulation: the rotation matrix R̄ and mapping matrix Λ (Eqs. 23, 26), with their derivatives and first/second variations, and tangent variations. It also contains helpers (e.g. second derivatives along the curve) kept for future beam formulations.
  • NonLinearBernoulliBeamElement3D: Total Lagrangian element with GL strains for the axial, two bending and two torsional components (Eqs. 41–51) and a consistent tangent (material + geometric stiffness).
  • BernoulliBeamElasticConstitutiveLaw: section law with EA, EI_n, EI_v and G·I_T.
  • ComputeBeamVectorsProcess (C++ and Python): computes the initial frame T₀/N₀ of each beam from its parent curve.
  • New variables (T_0, N_0, I_N, I_V, I_T, LOCAL_AXIS_ORIENTATION, …), registrations and Python bindings.

Tests (test_isogeometric_non_linear_bernoulli_beam_element.py, added to the small suite)

  • Linear cantilever: axial, both bending directions, torsion, rotated cross section; exact to 1e-8.
  • Several beams with different directions in one model part.
  • Curved quadrant bending–torsion benchmark (paper §5.2): matches Eqs. (81)–(82) to better than 1e-6.
  • Constitutive law stress/tangent consistency.
  • Tangent vs. finite differences (relative error ~1e-10), quadratic Newton convergence, mesh independence.
  • Large-deflection elastica, Euler buckling (both axes), lateral–torsional buckling.

Known limitations / follow-ups

  • Λ(T₀,T) is singular when a curve turns ≥ 180° from its start tangent (as in the paper).

🤖 Generated with Claude Code

juancamarotti and others added 23 commits March 31, 2026 12:02
…rocess

- T_0/N_0 were written to the shared Properties of every element in the
  model part, and the model-part-only constructor used the parent curve of
  the first element for all of them. With several beams in one model part,
  each beam got another beam's frame. For a beam opposite to the first one
  (T0.T = -1), Lambda(T0,T) divides by zero and the solution is NaN.
- Each element now gets the frame of its own parent curve
  (GetGeometryParent(0)), cached per curve and stored on the element. If a
  curve is given to the constructor, only its elements are processed.
- The tangent was evaluated at local coordinate 0 instead of the start of
  the curve's parameter domain. It is now evaluated at DomainInterval().GetT0().
…ulli beam

- NonLinearBernoulliBeamElement3D: LOCAL_AXIS_ORIENTATION was ignored for
  straight beams. CalculateDeltaPhi measured the twist Psi as the angle
  between Lambda(T0,T)*n_requested and n_requested instead of between
  Lambda(T0,T)*N0 and n_requested (Bauer et al. 2016, Eq. 15). For a straight
  beam Lambda = I, so Psi was always 0 and the cross section always followed
  the default N0. N0/V0 are now computed before the twist angle, which
  depends on them.
- Read T_0/N_0 from the element data, falling back to the properties.
  Check() now requires them instead of dividing by zero when missing.
- BernoulliBeamElasticConstitutiveLaw: the torsional stresses were G*I_T*kappa
  while the tangent was 0.5*G*I_T, so the stress was twice the energetically
  consistent value. The tangent is now also computed when only
  COMPUTE_CONSTITUTIVE_TENSOR is requested.
- The element now uses the stress returned by the constitutive law instead
  of recomputing D*strain, which hid the law's bug and discarded initial
  strain/stress contributions.
- Remove the K_geo(0,5) debug accumulators and std::cout output from
  CalculateAll.
Remove trailing whitespace and add the missing final newlines in the files
added or modified by the beam implementation. Whitespace-only changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juancamarotti
juancamarotti requested a review from a team as a code owner November 19, 2026 15:20
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-19T15:20:59.460048Z
We couldn’t complete this review. Comment @codex review to try again.
3955b59 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

juancamarotti and others added 2 commits November 19, 2026 20:07
- Use the core I22/I33 instead of the IGA I_N/I_V (I22 about the normal n,
  I33 about v = t x n). Remove the unused IGA HEIGHT, WIDTH and
  VON_MISES_STRESS, which duplicate variables of other applications.
- Add body forces (VOLUME_ACCELERATION, dead load) to the residual, with a
  self-weight test.
- Assemble the internal forces from the single non-zero row of each B matrix
  instead of building temporary 5-vectors.
- Turn the 28 scratch member matrices into locals of ComputeBMatrices and
  ComputeGMatrices. They were recomputed at every integration point anyway.
- Document the formulation and reference paper in the element header, and
  explain the structure and data layout of ComputeGMatrices.
- Use std:: math functions, IGA headers and authors in the constitutive law
  and its Python bindings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@maxfriedrichs maxfriedrichs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, thank you!!

- NonLinearBernoulliBeamElement3D: consistent mass matrix (rho A for the
  displacements, rho (I22 + I33) for the rotation about the center line),
  GetFirstDerivativesVector (VELOCITY, ANGULAR_VELOCITY_X) and
  GetSecondDerivativesVector (ACCELERATION, ANGULAR_ACCELERATION_X).
- BeamBaseElement3D: Rayleigh damping alpha * M + beta * K, sized from the
  element's equation ids so that it can be reused by other beam elements.
- Check the shape of LOCAL_AXIS_ORIENTATION ([parameter, nx, ny, nz], at
  least two rows), strictly increasing parameters and non-zero normals.
- Compute the second variations only when the geometric stiffness is
  assembled.
- Remove the declared but never defined ComputeB*/ComputeG* functions.
- Tests: mass matrix, Rayleigh damping, derivatives vectors, natural
  frequencies against beam theory, free vibration in bending and torsion
  with the BDF scheme, LOCAL_AXIS_ORIENTATION checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juancamarotti

Copy link
Copy Markdown
Contributor Author

Looks really good, thank you!!

Thanks for the review!I took care of your comments, could you please check again?

The free vibration tests used an absolute residual tolerance of 1e-14,
below the round-off level of the residual, so every time step ran into the
maximum of 10 Newton iterations and the IGA tests exceeded the 15 minute CI
limit in the FullDebug and Custom builds. The vibration is linear, so a
tolerance of 1e-6/1e-9 converges in one iteration per step with the same
accuracy. Only half a period is integrated, which is all the checks need.

The elastica Newton loop hit its 40 iteration cap in some load steps for
the same reason; its tolerance is relaxed to 1e-8, still well below the
5e-4 accuracy that is checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maxfriedrichs
maxfriedrichs previously approved these changes Nov 20, 2026
LOCAL_CS_N, LOCAL_CS_n, LOCAL_CS_V, LOCAL_CS_v and ROTATIONAL_DOF_ACTIVE were
defined and registered but never used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juancamarotti

Copy link
Copy Markdown
Contributor Author

@rickyaristio any comment?

juancamarotti and others added 3 commits November 23, 2026 10:04
- I_T defaults to the polar moment I22 + I33 when it is not provided, with a
  one-time warning since this is only exact for circular cross sections.
  Tested with a cantilever under torque without I_T.
- Use the boolean flags directly instead of comparing them with true/false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The products of 3x3 matrices and of the variation containers were written
as nested loops of up to five levels. They are now prod() calls, plus four
documented helpers for the products that are not plain matrix products
because of the storage layout of the variations: 24 of the loop nests are
replaced and the element goes from 129 to 55 for-loops.

The refactor only reorders the same algebra. The stiffness (full, material
and geometric), residual and mass of a straight, a curved and a curved and
twisted beam at undeformed and deformed states match the previous
implementation to 4e-18 relative to their physical scale.

A new finite-difference tangent test on a curved and twisted beam at a
deformed state exercises the reference curvature, mapping and twist terms
that vanish for the straight beam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The helpers for products with variation containers looped over all dofs
explicitly, with up to five nested loops. They now operate on n x n (or
n x 3) blocks with uBLAS, so the only remaining loops run over the 3x3
block indices and read like the formulas, e.g. W_ij += A(i, k) * W_kj.

Stiffness, residual and mass still match the original implementation to
4e-18 relative to their physical scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juancamarotti

Copy link
Copy Markdown
Contributor Author

@maxfriedrichs I think it's ready now. What do you think?

@rickyaristio rickyaristio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments from my side. Nice works, @juancamarotti

juancamarotti and others added 2 commits November 26, 2026 13:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@rickyaristio rickyaristio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more comments from my side. Fingers crossed, @juancamarotti.

@juancamarotti

Copy link
Copy Markdown
Contributor Author

All ready! I will merge it

@juancamarotti
juancamarotti merged commit c8482c1 into master Nov 26, 2026
10 checks passed
@juancamarotti
juancamarotti deleted the iga/3d_beam_implementation branch November 26, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants