user-defined functions reimplemented
Hi,
addressing the issues 36 and 93, see [1], I have created an experimental branch at [2].
The purpose of those changes is:
to unify passing extra arguments to boundary condition, material, and region functions
to unify/improve handling of material parameters in terms
There is now a new input file keyword for registering the functions:
functions = { <function_name> : (<function instance>,), ... }
All functions have the same first two arguments:
ts : the time-stepping information coor : the coordinates to evaluate the function in
Then, depending on the function type (region selection, material parameters, boundary condition values, ...) there are additional keyword arguments. For examples, see tests/test_functions.py and the input files in input/ (find them with "git grep 'functions ='").
The most important change in the functions branch is the following: all the material parameters (e.g. the elastic constants passed to the linear elastic term, the permeability passed to the diffusion term, ...) are evaluated directly in the quadrature points of the physical domain - the evaluation function gets a bunch of quadrature points, and returns its values in those points - that's all sweet and simple. Thus all terms should accept material parameters given by a general function of time and space.
Not all the terms are updated to this new approach, only those that are covered by the tests - all tests pass. The examples in the 'examples' directory work too.
What to do next:
- all terms should be used in some test - more tests are needed.
- it would be great if you try the branch [2] and report any problems here or at [1].
cheers, r.
[1] http://code.google.com/p/sfepy/issues/list [2] http://github.com/rc/sfepy/tree/functions
participants (1)
-
Robert Cimrman