Thank you for your quick response.
Do you mean in Featool, I have to call external function as
fea.expr = { 'a', 'myfun(c)'; 'b', 'myfun(c)'}
to get a and b?
The limitation of this call is that, if it takes long time to run
myfun, I still need to run myfun two times to obtain a and b.
Do you have any better solutions?
Thanks.
On 2020-07-29 11:25 p.m., Precise
Simulation [via FEATool Multiphysics Forum] wrote:
James
wrote
my external
function is in the form of
function [a, b] = myfun(c)
May I set a and b as output from myfun in fea.expr?
fea.expr = { 'a,b', 'myfun(c)'};
By this way both a and b values can be obtained by just
running myfun once.
No, basically the output must be a *single* array of the same size
as the input. For example if you have 'x' as a coefficient but
switch to 'myfun(x)', the output must have the same size as input
x (all inputs will be arrays of the same size or scalars).
See the example here: https://www.featool.com/doc/physics.html#phys_coef_user