Sha256: 395b2986b2d34f66f98adcd287b231dce724af2c239f9331e691df9ecbd4bf96

Contents?: true

Size: 583 Bytes

Versions: 2

Compression:

Stored size: 583 Bytes

Contents

require 'symath/value'
require 'symath/definition/operator'

module SyMath
  class Definition::Curl < Definition::Operator
    def initialize()
      # Curl is defined as (*(d(Fb)))#
      super(:curl, args: [:f], exp: '#(hodge(xd(b(f))))')
    end

    def description()
      return 'curl(f) - curl of vector field f'
    end

    def evaluate_call(c)
      if SyMath.get_variable(:basis.to_m).row(0).length != 3
        raise 'Curl is only defined for 3 dimensions'
      end

      return super(c)
    end

    def latex_format()
      return '\nabla\times %s'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
symath-0.1.1 lib/symath/definition/curl.rb
symath-0.1.0 lib/symath/definition/curl.rb