Metadata-Version: 2.4
Name: skfem-native
Version: 0.2.0
Summary: A small native assembly engine for nonlinear finite elements
Keywords: finite-element,assembly,scientific-computing
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Project-URL: Repository, https://github.com/kevin-tofu/skfem-native
Project-URL: Issues, https://github.com/kevin-tofu/skfem-native/issues
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: scikit-fem>=10; extra == "test"
Requires-Dist: shapely>=2; extra == "test"
Requires-Dist: matplotlib>=3.8; extra == "test"
Provides-Extra: benchmark
Requires-Dist: scikit-fem>=10; extra == "benchmark"
Requires-Dist: shapely>=2; extra == "benchmark"
Requires-Dist: matplotlib>=3.8; extra == "benchmark"
Description-Content-Type: text/markdown

# skfem-native 0.2

`skfemntv` is a native numerical assembly backend for finite-element
applications.  Version 0.2 deliberately does not own application formulations,
material models, contact laws, or nonlinear solution policies.

## Ownership boundary

The calling application owns:

- weak forms and coefficient fields
- constitutive updates and state histories
- contact and interface formulations
- multiplier spaces and algebraic reduction
- stabilization, solver, and load-step policies

`skfemntv` owns:

- meshes, elements, bases, and tabulation
- quadrature and geometry diagnostics
- generic functional, linear, bilinear, and cross-bilinear assembly
- caller-supplied tensor coefficient assembly
- cut-cell and implicit-interface quadrature
- interface supermesh construction and contact-facet search
- sparse scatter and threaded native kernels

## Assembly API

Forms use the same call shape as scikit-fem:

```python
import skfemntv
from skfemntv.helpers import dot, grad

mesh = skfemntv.MeshTet()
basis = skfemntv.Basis(mesh, skfemntv.ElementTetP1())

@skfemntv.BilinearForm
def diffusion(u, v, w):
    return dot(grad(u), grad(v))

matrix = skfemntv.asm(diffusion, basis)
```

Applications with pretabulated coefficient tensors can use
`NativeLinearForm`, `NativeBilinearForm`, `NativeCrossBilinearForm`, and
`NativeCrossBilinearForm.assemble_tensor()`.

Nonmatching interfaces use `TriangleSupermesh` or `InterfaceSupermesh` for
geometry and shared quadrature.  The application supplies its own test-space
shape values through `CrossTabulation`; skfemntv does not select Mortar, dual,
Nitsche, or contact formulations.

## Removed in 0.2

The following 0.1 APIs were removed rather than deprecated:

- `NativeAssembler`
- `MaterialAssembler`
- `J2Plasticity` and J2 state/history APIs
- `StandardLinearSolid`
- `LinearElasticity` and element-specific aliases
- `NeoHookean` and element-specific aliases
- `TriangleSupermesh.assemble_mortar()`
- Mortar result, metadata, reduction, and KKT types
- `assemble_symmetric_nitsche()`

These belong in the application layer.  kktkit, for example, defines one J2
return mapping and sends the resulting stress and tangent tensors to either the
scikit-fem or skfemntv assembly backend.

## Development

```bash
python -m pip install -e .
pytest -q
```

The project version is `0.2.0`.
