OneSimulation docs Website Free books Plans on Gumroad

Docs › Numerical API reference › onesim.numerics.fdm

B.4 onesim.numerics.fdm

BoundaryFluxDifference class

BoundaryFluxDifference(*, derivative: object, boundary_flux: object = None, factory: object = None) -> None

Wrap a first derivative and its optional boundary flux to use physical exterior traces in conservative transport.

Methods and properties.

validate_geometry(geometry)

Check whether the supplied mesh geometry is compatible with the method.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

bind(*, coordinates, periodic, law, boundaries, geometry=None)

Bind this declaration to the supplied execution context and collaborators.

bind_conservation(*, coordinates, periodic, law, boundaries, geometry=None)

Bind the conservative operator using the physical flux and geometry supplied by the model.

CentralDifference class

CentralDifference(kernel: str = 'numpy', factory: object | None = None) -> None

Use as gradient for a second-order centered first derivative on supported uniform samples.

Methods and properties.

validate_geometry(geometry)

Check whether the supplied mesh geometry is compatible with the method.

bind(*, coordinates, periodic)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

CentralLaplacian class

CentralLaplacian(kernel: str = 'numpy', factory: object | None = None) -> None

Use as diffusion for a second-order scalar Laplacian on a uniform sample axis.

Methods and properties.

bind(*, coordinates, periodic)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

FiniteDifference class

FiniteDifference(*, gradient: object | None = None, diffusion: object | None = None, reaction_sources: object | None = None, curl: object | None = None, cell_quadrature_order: int | None = None, face_quadrature_order: int | None = None, boundary_enforcement: object | None = None, stabilization: object | None = None, provider: object | None = None, stability: object | None = None) -> None

Select the named stencil, flux, boundary, curl or source collaborators required by the model's FD binding.

Methods and properties.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

GlobalLaxFriedrichsSplit class

GlobalLaxFriedrichsSplit(factory: object = None) -> None

Supply a flux splitting based on a global wave-speed bound to WENOFluxDifference.

Methods and properties.

bind(*, law)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

HydrostaticFluxDifference class

HydrostaticFluxDifference(*, flux: object, invariant_domain: object, dry_linearization: object = None) -> None

Select shallow-water hydrostatic flux differences with a matching Riemann flux, invariant domain and optional dry linearization.

Methods and properties.

validate(*, numerics, **unused)

Validate the supplied numerical context or input.

bind_operator(*, model, mesh, numerics, boundary_conditions, initial_conditions, inputs=None, **unused)

Construct the selected operator on the supplied geometry and context.

PolynomialDifference class

PolynomialDifference(*, accuracy_order: int = 2, factory: object | None = None) -> None

Use as gradient for a polynomial stencil at the requested accuracy order on a supported mesh.

Methods and properties. stencil_width. Read the number of stencil samples required by the selected order.

validate_geometry(geometry)

Check whether the supplied mesh geometry is compatible with the method.

bind(*, coordinates, periodic, geometry=None)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

PolynomialLaplacian class

PolynomialLaplacian(*, accuracy_order: int = 2, factory: object | None = None) -> None

Use as diffusion for a polynomial second-derivative stencil on supported coordinates.

Methods and properties.

bind(*, coordinates, periodic, geometry=None)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

SummationByPartsDifference class

SummationByPartsDifference(*, accuracy_order: int = 2, factory: object = None) -> None

Select a first derivative with a summation-by-parts boundary structure for a compatible line binding.

Methods and properties.

bind(*, coordinates, periodic, length=None, **unused)

Bind this declaration to the supplied execution context and collaborators.

WENO5Flux class

WENO5Flux(factory: object = None) -> None

Supply fifth-order WENO flux reconstruction for the supported split-flux stencil.

Methods and properties.

bind()

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

WENOFluxDifference class

WENOFluxDifference(flux_splitting: object, reconstruction: object, factory: object = None, diagnostic_gradient: object = None) -> None

Combine a flux splitter and a reconstruction in the conservative gradient port. A diagnostic gradient may supply a separate derivative for output.

Methods and properties.

bind_conservation(*, coordinates, periodic, law, boundaries, geometry=None)

Bind the conservative operator using the physical flux and geometry supplied by the model.

validate_geometry(geometry)

Check whether the supplied mesh geometry is compatible with the method.

bind(*, coordinates, periodic, law, boundaries)

Bind this declaration to the supplied execution context and collaborators.

to_mapping()

Return the mapping representation used for configuration and diagnostics.