Interface ScalarField<V>

All Superinterfaces:
Function<V,Real>, Function<V,Real>, Relation<V,Real>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ScalarField<V> extends Function<V,Real>
Represents a scalar field: f: ℝⁿ → ℝ

A scalar field assigns a scalar value to each point in space.

Examples in physics: - Temperature distribution: T(x,y,z) - Potential energy: U(x,y,z) - Pressure: P(x,y,z) - Density: ρ(x,y,z) - Electric potential: φ(x,y,z)

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • evaluate

      Real evaluate(V point)
      Evaluates the scalar field at a given point.
      Specified by:
      evaluate in interface Function<V,Real>
      Parameters:
      point - the point at which to evaluate
      Returns:
      the scalar value at that point
    • dimension

      default int dimension()
      Returns the dimension of the domain.

      Default implementation returns -1 (unknown). Implementations should override this if dimension is known.

      Returns:
      the dimension, or -1 if unknown
    • of

      static <V> ScalarField<V> of(Function<V,Real> evaluator)
      Creates a scalar field from a lambda expression.
      Type Parameters:
      V - the point type
      Parameters:
      evaluator - the evaluation function
      Returns:
      the scalar field
    • of

      static <V> ScalarField<V> of(Function<V,Real> evaluator, int dimension)
      Creates a scalar field with known dimension.
      Type Parameters:
      V - the point type
      Parameters:
      evaluator - the evaluation function
      dimension - the dimension
      Returns:
      the scalar field