2190 Commits

Author SHA1 Message Date
Jukka Aho 8c35970050 chore(test): register the io topic in the top-level test runner
Mirror the new test/io tree in TOPICS so Pkg.test and topic filtering pick up
WriteVTK coverage after mesh and before quadrature.

- Insert "io" after "mesh" in the TOPICS constant ordering
2026-05-11 03:06:10 +03:00
Jukka Aho d25405b712 test(io): exercise WriteVTK VTU export for structured meshes
Add io tests that load WriteVTK with JuliaFEM and cover stub misuse, Hex8 and
Quad4 VTU output with nodal and cell data, suffix handling, and bad topologies.

- Add test/io/runtests.jl wrapper around the VTK-focused cases
- Implement test_writevtk.jl with structured mesh grids and negative cases
2026-05-11 03:02:26 +03:00
Jukka Aho 30a975ec9d test(mesh): cover Gmsh stub errors without the Gmsh extension
Add a focused test file asserting read_gmsh_msh raises ErrorException and
mesh_from_current_gmsh_model stays undefined until JuliaFEMGmshExt loads.

- Add test_gmsh_stub.jl with two throws checks for the weakdep path
- Include the new file from test/mesh/runtests.jl next to existing mesh tests
2026-05-11 03:02:14 +03:00
Jukka Aho c0701b0524 docs(src): align module map with extension-first mesh I/O
Add SPDX to src/README, trim mesh/io blurbs for extension-based formats, and
extend thermo-poroelastic notes with Val-split THM helpers and a test pointer.

- SPDX HTML banner on src/README plus refreshed mesh and io table descriptions
- Document `_thm_stiff_K_*` / `_thm_mass_M_*` helpers and microkernel alloc test
2026-05-11 03:01:32 +03:00
Jukka Aho 194b0bb058 refactor(matrix_free): share triangle Gauss data for Darcy boundary flux
MixedDarcyTet4BoundaryNormalFluxLoad faces now reuse REF_GAUSS_TRIANGLE_ORDER2
and map reference points through Tri3 Lagrange shape functions instead of local
quadrature tuples duplicated in loads.jl.

- Drop private _MIXED_DARCY_TRI3_* constants from the mixed Darcy flux section
- Point the docstring at reference_gauss_tuples.jl and the isoparametric map
2026-05-11 03:00:13 +03:00
Jukka Aho 20e3977fcb feat(fields): add PorePressure vertex field for poroelastic DOF sets
Normalize SPDX header and define PorePressure as a scalar vertex field with the
same numeric layout as Temperature so poroelastic kernels can tag pressure DOFs.

- Document pairing with BiotPoroelasticKernel and HydraulicConductivity
- Implement dofs_per_node and quantity_type for the new field tag
2026-05-11 03:00:03 +03:00
Jukka Aho 42eb9d94dd feat(exports): widen public API for poroelastic and matrix-free hooks
Surface weakdep mesh I/O symbols, FE discretization exports, DOF-based and
matrix-free assembler entry points, and poroelastic kernel and field exports.

- Add Gmsh/VTU IO exports plus Cook membrane and structured line mesh helpers
- Replace FullThreeD with ThreeDimensional; export PorePressure and poro kernels
- Export kernel columns, internal-force and equilibrium APIs, KA operators, MPC
- Drop dof_types export; add flux loads, eliminated Dirichlet helpers, MPI f_int
2026-05-11 02:59:42 +03:00
Jukka Aho 6e252d6a11 docs(io,mesh): describe Gmsh and VTK extension workflows
Align module READMEs with the weakdep extension pattern: WriteVTK VTU export,
Gmsh MSH import, and thin stubs in the unconditional load path.

- Expand src/io/README with SPDX banner, VTK section, and stub policy note
- Mesh README import blurb cites Gmsh stubs and JuliaFEMGmshExt activation
2026-05-11 02:59:02 +03:00
Jukka Aho 9a0c9d4f14 chore(JuliaFEM): include gmsh_stub and write_vtu in module load
The optional Gmsh and WriteVTK entry points are defined as stubs until their
extensions load; mesh includes now sit with structured mesh generation.

- Pull in gmsh_stub.jl and write_vtu.jl right after structured mesh includes
- IO banner comment now points at Gmsh and VTK export extensions
2026-05-11 02:58:37 +03:00
Jukka Aho 40350b2da1 feat(mesh,io): stub Gmsh reader and VTU writer without optional deps
Without Gmsh or WriteVTK loaded, read_gmsh_msh and write_vtu_mesh raise clear
ErrorException messages pointing users at the weak extension packages.

- Add gmsh_stub.jl docstrings, read_gmsh_msh stub, mesh_from_current_gmsh_model
- Add write_vtu.jl docstring and write_vtu_mesh stub for WriteVTK extension
2026-05-11 02:58:08 +03:00
Jukka Aho 6657ec8419 feat(ext): add Gmsh and WriteVTK package extensions
Gmsh and WriteVTK remain optional weakdeps; these extensions implement the
typed mesh import and VTU export entry points used by examples and tests.

- Import linear Tris, Quads, Tets, Hexes from GMSH MSH with physical groups
- Export Mesh to VTU with optional point and cell named tuples
2026-05-11 02:57:38 +03:00
Jukka Aho 4a9f020e13 chore(deps): add Gmsh and WriteVTK extensions to Project.toml
Optional mesh and VTK stacks load only via weakdeps so the default install
stays slim while readers remain available for examples and tests.

- Add weakdeps Gmsh and WriteVTK with JuliaFEMGmshExt and JuliaFEMWriteVTKExt
- Pin Gmsh compat 0.3 and WriteVTK 1.21.2; add WriteVTK to extras and tests
- Refresh Manifest project_hash and JuliaFEM extension entries
2026-05-11 02:57:19 +03:00
Jukka Aho f663fda6f7 fix(githooks): shorten commit-msg hook diagnostics
Long echo strings broke the same eighty-column rule the hook enforces on log
messages. Error output is split so the hook file itself stays readable.

- Wrap rejection messages to eighty columns or fewer
- Keep wording aligned with subject, summary, and bullet layout rules
2026-05-11 02:53:11 +03:00
Jukka Aho cded31c388 docs: align README and CONTRIBUTING with commit-msg rules
Top-level and contributor README text now mention layout as well as width when
hooks gate commits.

- Note subject and bullet structure in README.md contributing blurb
- Mirror the same requirement in docs/CONTRIBUTING.md Git subsection
2026-05-11 02:46:20 +03:00
Jukka Aho 2bfc78a37c docs: describe commit-msg summary and bullet requirements
Contributor guides now match what the hook enforces so failures are obvious
before push when core.hooksPath points at .githooks.

- Refresh commit.prompt.md hook bullets and the canonical message checklist
- Update AGENTS.md workflow paragraph for commit-msg structure plus line cap
2026-05-11 02:46:14 +03:00
Jukka Aho e7862ed538 fix(githooks): enforce subject, summary, and bullet layout
The commit-msg hook parses messages in bash only so contributors get the same
shape every time without Python or other helpers in the hook path.

- Enforce eighty-column lines plus subject, blank, summary, blank, then bullets
- Reject bullet-looking lines inside the summary block and blanks among bullets
- Skip all checks while .git/MERGE_HEAD exists for merge commits
2026-05-11 02:46:06 +03:00
Jukka Aho 212ffb0d66 feat(core): reorder includes and add FEDiscretization plus Gauss tuples
Partition metadata loads before DOF-based caches, new kernels and column
helpers wire into the load order, Gmsh leaves the default include graph, and
MPI docstrings describe kernel-less overloads plus internal-force hook.

- Add reference_gauss_tuples.jl and dof_based_pass1; include poroelastic and
  thermo_poroelastic kernels after thermo_elastic
- Hoist partitioning, halo_exchange, packed_layout, redundant_kernel_depwarn,
  ka_column_homogeneity, kernel_column ahead of dof_based_coo.jl
- Add physics/discretization.jl (FEDiscretization); drop gmsh_reader include
- Extend MPI matvec docstrings; declare mpi_partitioned_internal_force_owned!
2026-05-11 02:40:28 +03:00
Jukka Aho 3ac8484ed4 feat(mpi): kernel-free partitioned matvec and internal-force hooks
MPI extension matvec routes now mirror the core kernel-in-cache API,
thread optional configuration and caches through packed paths, and keep
legacy kernel positional arguments behind depwarn overloads.

- SPDX header cleanup in JuliaFEMMPIExt.jl
- Rework mpi_partitioned_operator_matvec_owned! / …_matvec! to call apply_K
  helpers without redundant kernel arguments; add depwarn shims
- Add mpi_partitioned_internal_force_owned! calling
  apply_f_int_owned_rows_from_packed! plus kernel-arg depwarn overload
- Add test/mpi/partitioned_internal_force_smoke.jl vs serial internal force
2026-05-11 02:39:48 +03:00
Jukka Aho bdfda3f123 ci: shard poroelastic/physics jobs and run internal-force MPI smoke
CI gains focused Ubuntu jobs for new domain topics and physics/fields so
failures surface without waiting for the full matrix, and the MPI loop now
drives partitioned_internal_force_smoke alongside matvec drivers.

- Add test-domains-multiphysics (poroelastic + thermo_poroelastic test_args)
- Add test-physics-fields (physics + fields test_args), each with layer check
- Include partitioned_internal_force_smoke.jl in mpiexec driver loop
2026-05-11 02:39:12 +03:00
Jukka Aho fa762a11ec test: wire suite helpers, topics, and drop cantilever Gmsh mesh
The default harness loads shared helpers and smoke checks before topic
includes, registers poroelastic and thermo_poroelastic, drops the retired IO
topic, and removes the orphaned ASCII fixture.

- Add zero_alloc_helpers.jl, test_api_contract.jl, test_pkg_hygiene.jl, and
  test_inference_smoke.jl included once from runtests.jl
- Extend TOPICS; remove io; clarify test_args accepts topic names only
- Delete test/testdata/cantilever_beam.msh
2026-05-11 02:38:59 +03:00
Jukka Aho 77766d6ee4 chore(githooks): add commit-msg hook for 80-column messages
Long commit subjects and bullets are hard to read in narrow terminals and
mailed logs. Contributors using `.githooks` via core.hooksPath now get an
automatic guard in addition to the two-file pre-commit cap.

- Add `.githooks/commit-msg` to fail when any message line exceeds 80 chars
- Skip length checks while `.git/MERGE_HEAD` exists for merge commits
- Sync AGENTS.md, README.md, CONTRIBUTING.md, and commit.prompt.md
2026-05-11 02:37:38 +03:00
Jukka Aho 6f3629784e test(io): drop Gmsh reader smoke tests
The in-tree `GmshReader` module is gone, so the dedicated IO test driver and
Tet4 fixture assertions are removed to keep the default suite aligned with
core dependencies.

- Delete `test/io/runtests.jl`, which only included `test_gmsh_reader.jl`
- Delete `test/io/test_gmsh_reader.jl`, which exercised `read_gmsh_mesh` and `get_surface_nodes` against bundled `.msh` data
2026-05-11 02:29:37 +03:00
Jukka Aho cb2514451e refactor(io): remove bundled Gmsh reader and document I/O policy
The core package keeps the mesh and assembly stack type-stable without
shipping a Gmsh dependency or an always-loaded ASCII parser, and the IO
README now states where format readers should live going forward.

- Delete `src/io/gmsh_reader.jl` (`GmshReader`, `read_gmsh_mesh`, `GmshMesh`) including its Dict-heavy parsing path
- Rewrite `src/io/README.md` to describe policy-only `src/io/` (weakdeps/extensions or separate packages), point legacy `.inp`/`.med` readers at `src/legacy/io/` behind `JULIAFEM_ENABLE_LEGACY=1`, and warn against unconditional `include` growth for heavy I/O
2026-05-11 02:29:24 +03:00
Jukka Aho 4fc007547c chore(deps): slim runtime deps, add CSV, and register Aqua for tests
Runtime `[deps]` no longer pull in mesh tooling or dev-formatting stacks,
while CSV is available for lightweight tabular I/O and Aqua can run as part
of the standard test target.

- `Project.toml`: drop `BenchmarkTools`, `Gmsh`, and `JuliaFormatter` from `[deps]`; add `CSV` with `[compat]` entries `CSV = "0.10"` and `Aqua = "0.8"`; remove `Gmsh`/`JuliaFormatter` compat pins while keeping `BenchmarkTools` for extras-only use
- `Project.toml`: trim `[extras]` to packages still referenced by tests (add `Aqua`, drop unused entries such as `Documenter`, `ForwardDiff`, `HDF5`, `LightXML`, duplicate stdlib listings) and extend `[targets].test` with `Aqua` while removing `Gmsh`
- `Manifest.toml`: refresh `project_hash` and JuliaFEM stanza so the resolved tree matches the slimmer direct deps, pruning the `gmsh_jll`/`JuliaFormatter`/`BenchmarkTools` transitive closure and recording the CSV dependency subgraph (e.g. `Tables`, `Parsers`, `TranscodingStreams`)
2026-05-11 02:28:51 +03:00
Jukka Aho 47e77c2f37 docs(agents): align agent guide with IO policy, MPI smokes, and commit hygiene
The agent entry point now matches current mesh I/O packaging, the expanded
partitioned matvec smoke set, and stricter guidance on reading staged diffs
before every commit.

- Table row for `src/io/` now points at policy README and weakdeps/extensions instead of implying a default Gmsh reader in core
- MPI reference list includes `partitioned_internal_force_smoke.jl` and states CI runs all three under mpiexec
- Zero-alloc invariant bullet cites `test_dof_based_internal_force.jl` for `assemble_internal_force!` / `apply_f_int_owned_rows!`
- New bullet forbids scripted placeholder commits and points to `reset --soft` / `rebase -i` for repair
- Testing section documents `Pkg.test(; test_args=[...])` topic filtering and warns that unknown args fall back to full suite
- Quickstart snippet uses `ContinuumFormulation{ThreeDimensional}()` instead of removed `FullThreeD` alias
2026-05-11 02:28:12 +03:00
Jukka Aho 85900fe680 feat(mesh): add structured Quad4/Seg2/Cook meshes and face-aware extract_surface
Structured mesh helpers now cover 2D quads in the xy plane, a 1D Seg2 chain
embedded in R^3, and Cook’s membrane on a bilinear Quad4 map, so plane tests
and benchmarks can build reference geometry without ad hoc connectivity.
extract_surface gains an explicit volume-local face index and uses faces(T)
when the face vertex count matches the surface topology, which avoids picking
the wrong face by default for low-order hex meshes that list true face corners.

- structured.jl: SPDX header; add create_structured_line_mesh(Seg2; x0,x1,nx,y,z)
- structured.jl: add create_structured_box_mesh(Quad4; xmin,xmax,…,z) with :xmin/:xmax/:ymin/:ymax node sets
- structured.jl: add create_cook_membrane_mesh(Quad4, nx, ny; scale) with classical Cook corner map and same node-set convention
- mesh.jl: extract_surface(mesh, set; local_face=1) selects vol_faces[local_face]; build face_conn from face vertex indices when length matches n_face_nodes, else keep first-n legacy fallback for high-order volume/surface mismatch
- README.md: document Quad4/Seg2/Cook entry points; clarify mesh I/O is not in core load path (see src/io/README.md)
2026-05-11 02:26:23 +03:00
Jukka Aho cbdc9d2f82 refactor(materials): diffusion and hydraulic conductivity traits
Support domain kernels and Pass~1 material field typing.
2026-05-11 02:23:06 +03:00
Jukka Aho 03330a1d6a feat(thermo-poroelastic): add THM coupled volume kernel
ThermoPoroelasticKernel with multi-field stiffness blocks and domain README.
2026-05-11 02:23:06 +03:00
Jukka Aho d646aa9d9e feat(poroelastic): add Biot coupled u–p volume kernel
New BiotPoroelasticKernel with README for steady/transient coupled displacement and pore pressure.
2026-05-11 02:23:06 +03:00
Jukka Aho eac97e0b19 refactor(domains): Darcy, heat, and thermo-elastic kernels
Align primal Darcy and heat kernels with Pass~1 updates; extend thermo_elastic kernel; document new poroelastic/THM folders in domains README.
2026-05-11 02:23:05 +03:00
Jukka Aho 799c4d6a0f feat(continuum): DOF-based Pass~1 hooks and mixed kernel updates
Add dof_based_pass1.jl prepare_dof_based_material_workspace! overrides; dim-2 geometry cache branch; update Hu–Washizu, Hellinger–Reissner, Stokes, mixed-up kernels and material cache wiring.
2026-05-11 02:23:05 +03:00
Jukka Aho 12f7f8c0bd refactor(matrix-free): Dirichlet integration and surface load basis reuse
Use get_basis_functions on Quad4/Tri3/Seg2; reference Gauss tuples for face rules; depwarn symmetric apply_load! overloads that carry an unused kernel argument.
2026-05-11 02:23:05 +03:00
Jukka Aho 1ebc795f69 refactor(matrix-free): preconditioners and eigensolve without redundant kernel
Primary signatures use (cache, asm, mesh; …); kernel-ful overloads delegate with one-shot depwarn.
2026-05-11 02:23:05 +03:00
Jukka Aho df2a1eb4f0 refactor(matrix-free): kernelless operators and README
MatrixFreeOperator stores cache/asm/mesh only; forward Pass~1 keywords; deprecate redundant-kernel overloads via shared depwarn helper.
2026-05-11 02:23:05 +03:00
Jukka Aho 6968cbf9b3 refactor(assemblers): abstract cache, element cache, microkernel, partitioned matvec
Tighten assembler/kernel contracts, material workspace hooks, and redundant-kernel depwarns on partitioned halo helpers.
2026-05-11 02:23:05 +03:00
Jukka Aho c430babf85 refactor(dof-based-ka): align KA matvec with kernel column
Keep CPU/GPU KA stiffness and mass matvec paths consistent with kernel_at(cache, eid) and precision guards.
2026-05-11 02:23:04 +03:00
Jukka Aho 35b99ca48e refactor(dof-based): kernel column, depwarns, and Pass~1 assembly
Route volume physics through cache.kernel_column; add redundant-kernel delegating overload depwarns; extend apply_K!/apply_M!/internal force/partitioned helpers and prepare_dof_based_material_workspace hooks.
2026-05-11 02:23:04 +03:00
Jukka Aho a0d67cdb59 feat(assemblers): add kernel column and KA scalar homogeneity
Add PerElementKernelColumn accessors, ka_column_homogeneity guard, and README documenting cache.kernel_column and Pass~1 separation from assemblers.
2026-05-11 02:23:04 +03:00
Jukka Aho a54c36ff5e chore(assemblers): add shared redundant-kernel depwarn helper
Introduce _depwarn_redundant_kernel_arg! and a session Ref so legacy overloads that ignore a volume kernel emit a single Base.depwarn toward kernel-column-only APIs.
2026-05-11 02:23:03 +03:00
Jukka Aho bc2cd71f5d test(quadrature): delegate runner to consolidated quadrature rule suite
Replace the retired per-shape modules with the single `test_quadrature_rules.jl`
entry point that mirrors the current quadrature implementation layout.

- SPDX header; trim imports to `Test`, `JuliaFEM`, and `Tensors`.
2026-05-09 18:46:29 +03:00
Jukka Aho b981c8301b test(physics): narrow runner to strain helpers while layer stabilizes
Legacy physics API tests were retired with the module reset; keep only the strain
smoke file until higher-level physics coverage returns.

- Import `JuliaFEM` explicitly for includes under `Pkg.test`.
2026-05-09 18:46:27 +03:00
Jukka Aho 9dfc27bc68 test(mesh): slim Hex8 refinement smoke + brick volume helper check
Drive refinement through `create_structured_box_mesh` so tests stay aligned with
the dimensioned `Mesh{8,Hex8}` constructors, and keep a cheap analytic volume
sanity check for `compute_element_volume`.

- SPDX header; replace bespoke manual meshes with structured coupons + bisection counts.
2026-05-09 18:46:26 +03:00
Jukka Aho 2502707f10 test(materials): snapshot material_behavior inventory across model families
Add one representative model per `material_behavior` kind so refactors to traits
cannot silently orphan newly added constitutive laws.

- Cover constant tangents (elastic/thermal/hydraulic/moisture/diffusion/orthotropic).
- Cover hyperelastic, plasticity, damage, Chaboche, creep, and eigenstrain-augmented elasticity.
2026-05-09 18:46:20 +03:00
Jukka Aho 84fc4ece56 test(materials): extend state-variable trait coverage for new physics hooks
Register the recently introduced damage/creep/eigenstrain/Chaboche markers so the
generated registry cannot drift from their storage types and default symbols.

- SPDX header refresh.
2026-05-09 18:46:17 +03:00
Jukka Aho c631eb6d1c test(materials): assert J2 yield after radial return for PerfectPlasticity
Add a focused regression that `compute_stress` lands on the von Mises surface when
the trial state lies outside yield, using the returned backstress state.

- SPDX header refresh for the file.
2026-05-09 18:46:11 +03:00
Jukka Aho aabca484a3 test(materials): cover buffered stress/tangent vectors in assembly workspace
The refactor exposes in-place `get_*_vector(workspace, buf)` overloads; exercise them
beside the allocating helpers and keep allocation probes on pre-filled buffers.

- Assert buffer aliases and equality against freshly extracted vectors.
- Replace generic `get_field` probes with direct NamedTuple field access.
2026-05-09 18:46:05 +03:00
Jukka Aho 00e69548b9 test(geometry): slim Jacobian suite to Triangle{3} Lagrange{1} smoke tests
The previous file duplicated a long narrative and many scenarios that better live
in basis/quadrature coverage; keep the Jacobian helpers exercised with tuple vs
vector coordinates and physical derivative consistency.

- SPDX header; drop unused `LinearAlgebra` import.
- Fix basis calls to `Triangle{3}` / `Lagrange{1}` and verify scaling + PoU gradient sum.
2026-05-09 18:46:03 +03:00
Jukka Aho cc71c10033 test(elements): smoke multifield extract_element_dofs on structured Hex8
Replace the hand-built toy elements with a single coupon produced by
`create_elements!`, matching how assembly pulls DOFs from handlers.

- SPDX header + one regression comparing flat vs structured extraction for T+u on Hex8.
2026-05-09 18:46:02 +03:00
Jukka Aho dffdf01af2 test(continuum): scrub Hex8 validation copy of deprecated \"NEW API\" wording
The stiffness check already targets the shipped COO assembler; drop marketing-style
labels from comments and console banners so failures read like ordinary regressions.
2026-05-09 18:45:53 +03:00
Jukka Aho 0f6924f62f test(continuum): reset tests use GlobalMaterialCache + geometry arity
Material-cache reset coverage should populate stresses through the global cache
API rather than the removed `create_material_state` helper.

- Mirror production signatures for `update_geometry_cache!` / `update_material_cache!`.
2026-05-09 18:45:48 +03:00