← Back to team overview

dolfin team mailing list archive

[Bug 778622] Re: Lacking check of input for function evaluation

 

** Changed in: dolfin
   Importance: Undecided => High

** Changed in: dolfin
    Milestone: None => 0.9.12

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/778622

Title:
  Lacking check of input for function evaluation

Status in DOLFIN:
  Confirmed

Bug description:
  When calling f(...) on a Function f, the input arguments seem poorly
  checked. This is error-prone. It would be good to check that the
  coordinates input match the geometrical dimension of the mesh

  Example:

  from dolfin import *

  mesh = UnitSquare(4, 4)
  V = FunctionSpace(mesh, "CG", 1)
  f = Function(V)
  for i in range(len(f.vector())):
      f.vector()[i] = i + 1

  print f(1.0)
  print f(1.0, 1.0)
  print f(1.0, 1.0, 1.0)
  print f(1.0, 1.0, 1.0, 1.0)
  print
  print f((1.0,))
  print f((1.0, 1.0))
  print f((1.0, 1.0, 1.0))



References