Skip to content

Feature a2d submodule - #83

Draft
timryanb wants to merge 8 commits into
masterfrom
feature-a2d-submodule
Draft

Feature a2d submodule#83
timryanb wants to merge 8 commits into
masterfrom
feature-a2d-submodule

Conversation

@timryanb

Copy link
Copy Markdown
Owner

No description provided.

timryanb and others added 8 commits July 28, 2026 17:56
Adds https://github.com/smdogroup/a2d as a submodule pinned to commit
76e8e7385bb26678475f5bbd81f6e336633e9c48 (main as of 2026-07-28; upstream
has no tags). This is the rewritten, templated, header-only A2D (C++17,
ADObj/MakeStack API) and coexists with the vendored 2022 snapshot at
src/elements/a2d, which newer element code will replace incrementally.

The extern/* gitignore rule needs a negation so the submodule gitlink
can be tracked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- TACS_Common.mk: add overridable A2D_DIR/A2D_INCLUDE defaults (?=) so
  existing hand-edited Makefile.in files keep working untouched, append
  A2D_INCLUDE to TACS_INCLUDE, and warn with remediation steps when the
  submodule is not initialized (skipped for 'make clean')
- Bump -std=c++11 to -std=c++17 in TACS_Common.mk and setup.py; upstream
  A2D requires C++17
- setup.py: add extern/a2d/include to the extension include dirs
- tacs/__init__.py: add extern/a2d/include to get_include(), and fix the
  pre-existing omission of src/elements/shell and src/elements/a2d (the
  shell headers include "a2d.h")
- Makefile.in.info: document the optional A2D_DIR/A2D_INCLUDE overrides

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- unit_tests.yml: check out submodules (a2d has no nested submodules,
  so 'true' rather than 'recursive')
- conda/build.sh: ship the A2D headers under $PREFIX/include/a2d,
  preserving the ad/ subtree that A2D's internal includes rely on
- conda/meta.yaml: test that the packaged A2D headers are present

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Covers cloning with --recurse-submodules / git submodule update --init,
the optional A2D_DIR/A2D_INCLUDE Makefile.in overrides, and a
troubleshooting entry for the missing-submodule warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The legacy vendored copy at src/elements/a2d and upstream extern/a2d
both live in namespace A2D and collided in two ways when a translation
unit reached both (which happens as soon as a2dcore.h is combined with
TACSShellElementDefs.h, since that pulls in the beam headers):

- Both defined A2D::ADScalar (plain class here, template upstream).
  Rename the vendored class to TacsADScalar; it is used only by the
  in-repo beam headers.
- The vendored a2dveccore.h shared the include guard A2D_VEC_CORE_H
  with upstream ad/core/a2dveccore.h, silently turning whichever was
  included second into a no-op. Prefix all vendored guards with TACS_.

Verified with smoke TUs combining TACSBeamElement.h/TACSShellElementDefs.h
with a2dcore.h MakeStack code in a single translation unit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrite the six beam headers against the upstream A2D API (extern/a2d):
templated Vec<TacsScalar, 3>/Mat<TacsScalar, 3, 3> and ADObj<> types with
MakeStack expression stacks in place of the legacy per-activity op classes
with hand-ordered forward()/reverse() calls. Composite legacy ops map to
compositions of upstream primitives (Mat3x3VecVecInnerProduct ->
MatVecMult + VecDot, MatTrans3x3VecMultScale -> MatVecMult<TRANSPOSE> +
VecScale, Vec3Axpy -> VecScale + VecSum). The one legacy op with no
upstream equivalent, assembling a matrix from three column vectors, is
added in upstream expression style as A2D::MatFromThreeVec in the new
TACSA2DUtilities.h.

TACSBeamTransform::getRefAxis() now returns A2D::Vec<TacsScalar, 3>&.

Verified: standalone FD checks of addTransformSens and
TacsBeamAddNodeNormalsSens (1e-9); all element/constitutive unit tests
(301 tests, 2653 subtests) and all beam integration tests (156 tests,
1439 subtests) pass against the rebuilt real-scalar extension.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The beam headers were its only consumers and now use the upstream A2D
submodule at extern/a2d, so delete src/elements/a2d and its include-path
entries in TACS_Common.mk, setup.py and tacs.get_include().

Verified with full clean rebuilds: real build passes all element and
constitutive unit tests (301 tests, 2653 subtests) and all beam
integration tests (156 tests, 1439 subtests); complex build passes the
beam element test suites under complex-step (19 tests, 60 subtests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Make and setup.py now run git submodule update --init when the A2D headers are missing, and make warns when the checkout drifts from the pinned commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant