Analysis
These utilities plug into Trixi's analysis callback machinery for monitoring steady-state convergence and boundary currents.
Steady-State Diagnostics
FermiSea.SteadyStateResidual — Type
SteadyStateResidual()This way analysis callback can compute the steady-state residual that Trixi is using to determine stop-condition (convergence)
Contact Currents
FermiSea.ContactCurrent — Type
ContactCurrent(boundary_symbol)
ContactCurrent(boundary_symbol, boundary_symbols...)Analysis integral for the total current through one or more named boundaries.
The boundary symbols are the same symbols used in the semidiscretization's boundary-condition dictionary. This is intended to be passed as an analysis_integral, for example
AnalysisCallback(semi;
analysis_integrals=(ContactCurrent(:contact_bottom),))If multiple boundaries are supplied, their currents are added together.
FermiSea.ContactCurrentAverage — Type
ContactCurrentAverage(boundary_symbol)
ContactCurrentAverage(boundary_symbol, boundary_symbols...)Analysis integral for the boundary-averaged normal current.
This computes ContactCurrent(...) / contact_boundary_length(...), which is often the more convenient quantity when comparing contacts of different lengths or looking at a current density-like diagnostic in the terminal output.
FermiSea.contact_current_normal — Function
contact_current_normal(u, normal_direction, equations)Return the normal charge-current flux for a single state u.
The incoming normal_direction may be scaled by the mesh geometry. We normalize it before calling the physical flux so this helper reports the current per unit boundary length; Trixi's surface integration supplies the geometric surface factor separately.
FermiSea.contact_boundary_length — Function
contact_boundary_length(semi, boundary_symbol)
contact_boundary_length(semi, boundary_symbols)Return the total geometric length of one or more named P4est boundaries.
This uses the same face quadrature weights and normal vectors that Trixi uses for surface integrals, so the result is consistent with ContactCurrent.