Getting started
Installation
Hermit, FEniCSx (DOLFINx 0.9 or 0.11),
CSDL Alpha, and caddee_materials are
available from the HgXe and conda-forge channels. CSDL Alpha is currently
promoted through the HgXe/label/test label:
conda create -n hermit -c HgXe/label/test -c HgXe -c conda-forge hermit
conda activate hermit
Hermit’s forms are real-valued, so its package selects the real-scalar PETSc
build. The HgXe channel supplies the CSDL lab packages and conda-forge supplies
FEniCSx and its compiled dependencies.
For editable development, create the base environment explicitly and install the lab packages from their repositories:
conda create -n hermit-dev -c conda-forge python=3.12 fenics-dolfinx=0.11 \
mpich 'petsc=*=real*' petsc4py numpy scipy sympy h5py rustworkx networkx pydot
conda activate hermit-dev
pip install git+https://github.com/LSDOlab/caddee_materials.git
pip install --force-reinstall --no-deps \
git+https://github.com/LSDOlab/CSDL_alpha.git@main
pip install -e .
Optional extras: .[examples] for the plotting examples and .[docs] for the
documentation toolchain.
The optimizer stack — needed by ex_thickness_opt.py and
ex_optimal_thickness_taper.py — is LSDOlab’s modopt, which shares a name with an
unrelated package on PyPI. Install it from git:
pip install git+https://github.com/LSDOlab/modopt.git pyslsqp
Hermit runs serially: ShellDomain requires a mesh whose vertex numbering is a
permutation of the file order, which an MPI-partitioned mesh is not.
A minimal example
import csdl_alpha as csdl
import hermit as hm
mesh = hm.read_mesh("plate.xdmf")
domain = hm.ShellDomain(mesh, element="CG2CG1")
bcs = hm.clamp(domain, where=hm.near("x", 0.0))
recorder = csdl.Recorder(inline=True); recorder.start()
material = hm.isotropic(domain, E=4.32e8, nu=0.0, thickness=0.2, density=1.0)
state = hm.solve(domain, material, hm.pressure(domain, 2.0), bcs)
print(hm.compliance(state).value, hm.mass(state).value)
recorder.stop()
Arrays passed to simple builders are converted to fields by length; use
hm.from_nodal, hm.from_cells, or hm.from_function when the intended input space
matters. See Tutorials and Examples for complete scripts.
Running the tests
python -m pytest
The suite checks the forward quantities and thickness adjoints Hermit shares with
femo_alpha against a captured RMShell reference, and runs each of the
Verification benchmarks benchmarks at a cheap refinement level.
Any individual benchmark also runs on its own, and prints its convergence table:
python examples/verification/ex_scordelis_lo.py