← Back to team overview

dolfin team mailing list archive

[Question #147330]: What is the preferred way to access data stored in the Data class now that it has been removed.

 

New question #147330 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/147330

>From the changelog of Dolfin 0.9.10

 - Make GenericFunction::eval thread-safe (Data class removed)

But I have code that access the Data class as described by the docstring help of Expression i.e.

class MyFunc : public Expression
{
public:

    MyFunc() : Expression(3)
    {
    }

    void eval(Array<double>& values, const Data& data) const
    {
Point n = data.normal();
values[0] = -n.x()*n.y()*sin(13.34256380792608*data.x[0]);
values[1] = pow(n.x(), 2)*sin(13.34256380792608*data.x[0]) + pow(n.z(), 2)*sin(13.34256380792608*data.x[0]);
values[2] = -n.y()*n.z()*sin(13.34256380792608*data.x[0]);
    }

};

This leads to the compile.log error:
...
dolfin_compile_code_2c2c0d2515ec19610942d91a460c7b2d_wrap.cxx:2858: error: ISO C++ forbids declaration of ‘Data’ with no type
...

I assume this is because of the change mentioned above.

If so, how should data such as normals etc. be accessed?

If not, what else have change that might cause this new error?

I am running Lucid on a 64-bit platform.

Thanks

Renier

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.