Skip to content

Commit

Permalink
Fixed problem with evaluating multi-variable functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMaas1978 committed Aug 22, 2024
1 parent 3e5cdf9 commit b8d05bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion FECore/MathObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,17 @@ double MSimpleExpression::value(const MItem* pi, const std::vector<double>& var)
case MSFNC:
{
return value(msfncnd(pi)->Value(), var);
};
};
break;
case MFND:
{
const MFuncND* f = mfncnd(pi);
int n = f->Params();
vector<double> d(n, 0.0);
for (int i = 0; i < n; ++i) d[i] = value(f->Param(i), var);
return (f->funcptr())(d.data(), n);
}
break;
default:
assert(false);
return 0;
Expand Down

0 comments on commit b8d05bf

Please sign in to comment.