Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

pymrm.operators

Back to modules overview

Sparse gradient and divergence operators for finite-volume discretisation.

View module source on GitHub

Public API

SymbolTypeSummary
construct_divfunctionConstruct a divergence matrix that maps face fluxes to cell balances.
construct_gradfunctionConstruct the full gradient operator including boundary contributions.
construct_grad_bcfunctionConstruct boundary-face gradient corrections and source terms.
construct_grad_intfunctionConstruct the interior-face gradient operator.

construct_div(shape, x_f, nu = 0, axis = 0, format = 'csc')

Open dedicated reference page

Construct a divergence matrix that maps face fluxes to cell balances.

Parameters

Returns

View source on GitHub

construct_grad(shape, x_f, x_c = None, bc = (None, None), axis = 0, shapes_d = (None, None), format = 'csc')

Open dedicated reference page

Construct the full gradient operator including boundary contributions.

Parameters

Returns

View source on GitHub

construct_grad_bc(shape, x_f, x_c = None, bc = (None, None), axis = 0, shapes_d = (None, None), format = 'csc')

Open dedicated reference page

Construct boundary-face gradient corrections and source terms.

Parameters

Returns

View source on GitHub

construct_grad_int(shape, x_f, x_c = None, axis = 0, format = 'csc')

Open dedicated reference page

Construct the interior-face gradient operator.

Parameters

Returns

View source on GitHub