Open GoogleCodeExporter opened 9 years ago
Instead of the "hackish" way of giving the function by its name (string) let's
put in
the proper function instance:
---
def f( standard_args ):
pass
material_1 = {
...
'function' = f,
...
}
---
in case one needs some extra arguments:
---
some_extra_args = ...
def f( standard_args, **some_extra_args ):
pass
material_1 = {
...
'function' = lambda standard_args: f( standard_args, **some_extra_args ),
...
}
---
The only exception would be when defining the regions:
region_1 = {
'name' : 'Inlet',
'select' : 'nodes by cinc( x, y, z, 0 )',
}
could be replaced by:
functions = {
'cinc_0' : lambda x, y, z: cinc( x, y, z, 0 ),
}
region_1 = {
'name' : 'Inlet',
'select' : 'nodes by cinc_0',
}
Note that having the new keyword 'functions' works for all the other cases (BC,
materials, ...) too.
Original comment by robert.c...@gmail.com
on 17 Dec 2008 at 3:32
Implemented using the 'functions' keyword. See tests/test_functions.py for
syntax.
Original comment by robert.c...@gmail.com
on 3 Sep 2009 at 2:53
Migrated to http://github.com/sfepy/sfepy/issues/40
Original comment by robert.c...@gmail.com
on 30 Jan 2012 at 10:24
Original issue reported on code.google.com by
robert.c...@gmail.com
on 7 May 2008 at 10:07