Skip to content

Provide links to metric-based docs sections #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions animate/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ def normalise(
"""
Apply :math:`L^p` normalisation to the metric.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#metric-normalisation
for more details.

:kwarg global_factor: pre-computed global normalisation factor
:type global_factor: :class:`float`
:kwarg boundary: is the normalisation to be done over the boundary?
Expand Down Expand Up @@ -580,6 +584,10 @@ def intersect(self, *metrics):
Metric intersection means taking the minimal ellipsoid in the direction of each
eigenvector at each point in the domain.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#combining-metrics
for more details.

:arg metrics: the metrics to be intersected with
:type metrics: :class:`tuple` of :class:`~.RiemannianMetric`\s
:return: the intersected metric, modified in-place
Expand Down Expand Up @@ -651,6 +659,10 @@ def combine(self, *metrics, average=True, **kwargs):
r"""
Combine metrics using either averaging or intersection.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#combining-metrics
for more details.

:arg metrics: the list of metrics to combine with
:type metrics: :class:`tuple` of :class:`~.RiemannianMetric`\s
:kwarg average: toggle between averaging and intersection
Expand All @@ -668,6 +680,10 @@ def complexity(self, boundary=False):
Compute the metric complexity - the continuous analogue
of the (inherently discrete) mesh vertex count.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#continuous-mesh-analogy
for more details.

:kwarg boundary: should the complexity be computed over the domain boundary?
:type boundary: :class:`bool`
:return: the complexity of the metric
Expand All @@ -683,6 +699,10 @@ def compute_eigendecomposition(self, reorder=False):
r"""
Compute the eigenvectors and eigenvalues of a matrix-valued function.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#geometric-interpretation
for more information.

:kwarg reorder: should the eigendecomposition be reordered in order of
*descending* eigenvalue magnitude?
:type reorder: :class:`bool`
Expand Down Expand Up @@ -715,6 +735,10 @@ def assemble_eigendecomposition(self, evectors, evalues):
"""
Assemble a matrix from its eigenvectors and eigenvalues.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#geometric-interpretation
for more information.

:arg evectors: eigenvectors represented as a matrix-valued function
:type evectors: :class:`firedrake.function.Function`
:arg evalues: eigenvalues represented as a vector-valued function
Expand Down Expand Up @@ -791,6 +815,10 @@ def density_and_quotients(self, reorder=False):

where :math:`h_i := \frac1{\sqrt{\lambda_i}}`.

See
https://mesh-adaptation.github.io/docs/animate/1-metric-based.html#geometric-interpretation
for more details.

:kwarg reorder: should the eigendecomposition be reordered?
:type reorder: :class:`bool`
:return: metric density, anisotropy quotients and eigenvector matrix represented
Expand Down