sfepy.discrete.functions module

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

Function with constant values.

class sfepy.discrete.functions.ConstantFunctionByRegion(values)[source]

Function with constant values in regions.

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

Base class for user-defined functions.

set_extra_args(**extra_args)[source]
set_function(function, is_constant=False)[source]
class sfepy.discrete.functions.Functions(objs=None, **kwargs)[source]

Container to hold all user-defined functions.

static from_conf(conf)[source]
sfepy.discrete.functions.make_sfepy_function(fun_or_name=None)[source]

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_namestring, optional

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

Returns:
new_funsfepy.discrete.functions.Function

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