Expression with C-Code, pass array TypeMap
Hello,
I want to create an expression using C code which needs a two dimensional array as a parameter. Therefore I wanted to include a setter method, which handles this parameter array. Is there a way to achieve this?
My C code looks as follows now:
code = '''
class MyFunc : public Expression {
public:
int _nDomains;
int _nCoeffs;
void setCoeffs(int nDomains, int nCoeffs, double** coeffs) {
}
void eval(Array<double>& values, const Array<double>& x,
if (x[1] <= 1./3.)
}
};
'''
What I need is a way to call the setCoeffs method with a numpy array. The eval function is dummy for now.
Thanks for the help,
Johannes
edit: nDomains and nCoeffs represent the dimensions of the array.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply: