hermit.loads
Loads – distributed, edge and point loads; a + b composes them.
Each builder returns a Loads carrying one term. pressure / traction
/ moment are distributed over the shell surface; edge_pressure /
edge_traction / edge_moment act on selected exterior facets; point_load
is a consistent (weak Dirac) point load; load_vector is a direct generalised RHS
in domain.W dof ordering.
Every term reaches hermit.solve() as its own residual and compliance
contribution, on its own space, with no interpolation between terms. pressure
follows the live, shape-differentiable ufl.CellNormal.
combined_traction / combined_moment reduce several terms onto one shared
space. They are not part of the solve path – they exist for callers that drive the
raw FEniCSx operations directly.
Classes
A composable bundle of load terms. |
Functions
|
Moment per unit length on selected exterior facets. |
|
Pressure per unit length along the shell normal, on selected exterior facets. |
|
Force per unit length on selected exterior facets. |
|
A generalised right-hand side given directly in state-space dof order. |
|
Distributed moment per unit area, in global components. |
|
A consistent point force and/or moment at a physical coordinate. |
|
Scalar pressure acting along the shell normal. |
|
Distributed force per unit area, in global components. |
Module Contents
- class hermit.loads.Loads(domain, *, traction_terms=(), moment_terms=(), pressure_terms=(), edge_traction_terms=(), edge_moment_terms=(), edge_pressure_terms=(), direct=None)
A composable bundle of load terms.
Build one with
pressure(),traction(),moment(),edge_pressure(),edge_traction(),edge_moment(),point_load()orload_vector()rather than calling this constructor directly.a + bmerges twoLoadson the same domain, concatenating the term lists and summing the direct right-hand sides.- Parameters:
- domainShellDomain
- traction_terms, moment_termssequence of Field, optional
Distributed
(3,)vector fields.- pressure_termssequence of Field, optional
Distributed scalar fields, acting along the shell normal.
- edge_traction_terms, edge_moment_terms, edge_pressure_termssequence, optional
Edge terms, each pairing a field with the exterior-facet measure it acts on.
- directcsdl.Variable, optional
A generalised right-hand side in
domain.Wdof ordering.
Examples
>>> loads = hm.pressure(domain, 2.0) + hm.point_load(domain, at=tip, force=[0, 0, -1])
- combined_moment(space=('Lagrange', 1, (3,))) hermit._field.Field | None
Sum the distributed moment terms onto one space.
- Parameters:
- spacetuple, optional
Target space. Exact when every term is already on it.
- Returns:
- Field or None
Nonewhen there are no moment terms.
- combined_traction(space=('Lagrange', 1, (3,))) hermit._field.Field | None
Sum the traction and pressure terms onto one space.
Pressure is converted to a traction with a numpy snapshot of the reference normal.
solve()does not use this – it takes each term directly, with the live normal.- Parameters:
- spacetuple, optional
Target space. Exact when every term is already on it.
- Returns:
- Field or None
Nonewhen there are no such terms.
- direct_vector(ndof=None) csdl_alpha.Variable
The combined point-load and load-vector right-hand side.
- Parameters:
- ndofint, optional
Length to use when there is no direct term. Defaults to the number of
domain.Wdofs.
- Returns:
- csdl.Variable
Shape
(ndof,)indomain.Wdof order; zeros when there is no point load or load vector.
- direct = None
- domain
- edge_moment_terms = []
- edge_pressure_terms = []
- edge_traction_terms = []
- moment_terms = []
- pressure_terms = []
- traction_terms = []
- hermit.loads.edge_moment(domain, m, *, where, space=('Lagrange', 1)) Loads
Moment per unit length on selected exterior facets.
- Parameters:
- domainShellDomain
- mField or array_like
A
(3,)global vector, or aFieldof(3,)vectors.- wherecallable
Coordinate predicate selecting the loaded edge; see
edge_traction().- spacetuple, optional
Space for a non-
Fieldvalue. Default("Lagrange", 1).
- Returns:
- Loads
- Raises:
- ValueError
If
mdoes not resolve to a(3,)vector field.
- hermit.loads.edge_pressure(domain, p, *, where, space=('DG', 0)) Loads
Pressure per unit length along the shell normal, on selected exterior facets.
- Parameters:
- domainShellDomain
- pField, float or array_like
Scalar pressure; positive acts along
+n.- wherecallable
Coordinate predicate selecting the loaded edge; see
edge_traction().- spacetuple, optional
Space for a non-
Fieldvalue. Default("DG", 0).
- Returns:
- Loads
- Raises:
- ValueError
If
spaceis not scalar, or if the domain’s cell normals are not consistently oriented.
- hermit.loads.edge_traction(domain, t, *, where, space=('Lagrange', 1)) Loads
Force per unit length on selected exterior facets.
- Parameters:
- domainShellDomain
- tField or array_like
A
(3,)global vector, or aFieldof(3,)vectors.- wherecallable
Coordinate predicate selecting the loaded edge, with the same contract as
clamp(): it receives a(3, N)coordinate array and returns an(N,)boolean mask. Only exterior facets are selected.- spacetuple, optional
Space for a non-
Fieldvalue. Default("Lagrange", 1).
- Returns:
- Loads
- Raises:
- ValueError
If
tdoes not resolve to a(3,)vector field.
Examples
>>> tip = hm.edge_traction(domain, [0.0, 0.0, -1.0], where=hm.near("x", 10.0))
- hermit.loads.load_vector(domain, vec) Loads
A generalised right-hand side given directly in state-space dof order.
- Parameters:
- domainShellDomain
- veccsdl.Variable or array_like
One entry per
domain.Wdof, in that space’s dof ordering.
- Returns:
- Loads
- Raises:
- ValueError
If
vecdoes not have exactlydomain.W’s dof count.
- hermit.loads.moment(domain, m, *, space=('Lagrange', 1)) Loads
Distributed moment per unit area, in global components.
Contributes
int m . dtheta dxto the residual.- Parameters:
- domainShellDomain
- mField or array_like
A
(3,)global vector, or aFieldof(3,)vectors.- spacetuple, optional
Space for a non-
Fieldvalue. Default("Lagrange", 1).
- Returns:
- Loads
- Raises:
- ValueError
If
mdoes not resolve to a(3,)vector field.
- hermit.loads.point_load(domain, *, at, force=None, moment=None) Loads
A consistent point force and/or moment at a physical coordinate.
The cell containing
atis located, the state-space basis is evaluated there, and the result is scattered into the direct right-hand side – the weak form of a Dirac delta,int F . delta(x - at) . du dx = F . du(at). The point need not be a mesh vertex.- Parameters:
- domainShellDomain
- atarray_like
Physical coordinate, shape
(3,).- forcecsdl.Variable or array_like, optional
(3,)point force.- momentcsdl.Variable or array_like, optional
(3,)point moment.
- Returns:
- Loads
- Raises:
- ValueError
If neither
forcenormomentis given, or ifatlies in no cell.
Notes
Differentiable in
forceandmoment, but not inator the mesh coordinates: the containing cell is fixed at construction.
- hermit.loads.pressure(domain, p, *, space=('DG', 0)) Loads
Scalar pressure acting along the shell normal.
Positive
pacts along+n. The residual uses the liveufl.CellNormal, so the load is differentiable with respect to the mesh coordinates.- Parameters:
- domainShellDomain
- pField, float or array_like
Scalar pressure.
- spacetuple, optional
Space for a non-
Fieldvalue. Default("DG", 0).
- Returns:
- Loads
- Raises:
- ValueError
If
spaceis not scalar, or if the domain’s cell normals are not consistently oriented. On a badly-wound imported mesh a uniform pressure would otherwise become a sign-alternating load with no other symptom.
See also
tractionan explicit global vector, independent of the normal.
- hermit.loads.traction(domain, t, *, space=('Lagrange', 1)) Loads
Distributed force per unit area, in global components.
Contributes
int t . du dxto the residual. Unlikepressure()this never touches the shell normal, so it is the right choice for a body force such as self weight on a curved surface.- Parameters:
- domainShellDomain
- tField or array_like
A
(3,)global vector, or aFieldof(3,)vectors.- spacetuple, optional
Space for a non-
Fieldvalue. Default("Lagrange", 1).
- Returns:
- Loads
- Raises:
- ValueError
If
tdoes not resolve to a(3,)vector field.
See also
pressurea scalar load following the shell normal.
edge_tractionthe same load on selected exterior facets.