Skip to content

Scalar Field Restrictions #28554

@DeRhamSource

Description

@DeRhamSource

How is a scalar field implemented which is piecewisely defined with different expressions in one particular chart?

Take for instance a scalar field f on the real line with standard "top" chart x, defined via f(x)=0 for x<-1, f(x)=x+1 for -1<=x<0, f(x)=1-x for 0<=x<1 and f(x)=0 for x>=1. Currently, this is solved by using

f = M.scalar_field( unit_step(x + 1)*unit_step(1 - x)*(1 - abs(x)) )

(see #28519 comment:46).

This solution is quite unhandy and becomes even more so for more complicated scalar fields.

This ticket is part of the metaticket #28519.

This ticket includes:

  • display method modified in such a way that all distinct expressions are shown (a small slowdown in computation time)
  • set_restriction method added smilar to tensor fields

CC: @tscrim @egourgoulhon

Component: geometry

Keywords: scalar fields

Author: Michael Jung

Branch/Commit: a126d91

Reviewer: Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/28554

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions