# sfepy.discrete.functions module

class sfepy.discrete.functions.ConstantFunction(values, no_tile=False)

  Function with constant values.

class sfepy.discrete.functions.ConstantFunctionByRegion(values)

  Function with constant values in regions.

class sfepy.discrete.functions.Function(name, function, is_constant=False, extra_args=None)

  Base class for user-defined functions.

  set_extra_args(**extra_args)
  set_function(function, is_constant=False)

class sfepy.discrete.functions.Functions(objs=None, **kwargs)

  Container to hold all user-defined functions.

  static from_conf(conf)

sfepy.discrete.functions.make_sfepy_function(fun_or_name=None)

  Convenience decorator to quickly create `sfepy.discrete.functions.Function` objects.

  Has two modes of use either without parameter:

      @make_sfepy_function
      def my_function(...):
          ...

  or with name:

      @make_sfepy_function("new_name_for_my_function")
      def my_function(...):
          ...

  Parameters:
    fun_or_name string, optional

      Name to be saved within Function instance, if None name of decorated function is used.

  Returns:
    new_fun sfepy.discrete.functions.Function

      With attribute name set to provided name or original function name.