Norms#

Norms#

Module for calculating norms over a mesh. This module provides functions to calculate norms, including L2 and H1 semi-norm, over a given mesh.

phasefieldx.norms.norm_H1(field, msh, dx=Measure('cell', subdomain_id='everywhere'))[source]#

Compute the H1 norm of a field over a given mesh.

Parameters:
fielddolfinx.Function

The field for the H1 norm calculation.

mshdolfinx.Mesh

The mesh over which the H1 norm is computed.

dxufl.Measure, optional

The measure for integration over the mesh. Default is ufl.dx.

Returns:
norm_H1float

The H1 norm of the field over the mesh.

Notes

The H1 norm is computed using the formula: norm_H1 = sqrt( ∫ |field|^2 dx + ∫ |∇(field)|^2 dx )

where ‘∇’ represents the gradient operator, and ‘dx’ represents the integration over the entire mesh.

phasefieldx.norms.norm_L2(field, msh, dx=Measure('cell', subdomain_id='everywhere'))[source]#

Compute the L2 norm of a field over a given mesh.

Parameters:
fielddolfinx.Function

The field for the L2 norm calculation.

mshdolfinx.Mesh

The mesh over which the L2 norm is computed.

dxufl.Measure, optional

The measure for integration over the mesh. Default is ufl.dx.

Returns:
norm_L2float

The L2 norm of the field over the mesh.

Notes

The L2 norm is computed using the formula: norm_L2 = sqrt( ∫ |field|^2 dx )

where ‘dx’ represents the integration over the entire mesh.

phasefieldx.norms.norm_LP(field, msh, p=2, dx=Measure('cell', subdomain_id='everywhere'))[source]#

Compute the Lp norm of a field over a given mesh.

Parameters:
fielddolfinx.Function

The field for the Lp norm calculation.

mshdolfinx.Mesh

The mesh over which the Lp norm is computed.

pfloat, optional

The exponent for the Lp norm calculation. Default is 2.

dxufl.Measure, optional

The measure for integration over the mesh. Default is ufl.dx.

Returns:
norm_LPfloat

The Lp norm of the field over the mesh.

Notes

The Lp norm is computed using the formula: norm_LP = ( ∫ |field|^p dx )^(1/p)

where ‘dx’ represents the integration over the entire mesh.

phasefieldx.norms.norm_semiH1(field, msh, dx=Measure('cell', subdomain_id='everywhere'))[source]#

Compute the H1 semi-norm of a field over a given mesh.

Parameters:
fielddolfinx.Function

The field for the H1 semi-norm calculation.

mshdolfinx.Mesh

The mesh over which the H1 semi-norm is computed.

dxufl.Measure, optional

The measure for integration over the mesh. Default is ufl.dx.

Returns:
norm_semiH1float

The H1 semi-norm of the field over the mesh.

Notes

The H1 semi-norm is computed using the formula: norm_semiH1 = sqrt( ∫ |∇(field)|^2 dx )

where ‘∇’ represents the gradient operator, and ‘dx’ represents the integration over the entire mesh.