Skip to content

Bug when computing the curl of the curl of an expression #397

@romainhild

Description

@romainhild

When I want to compute the curl of the curl of an expression like in myexpression.cpp, I have en error during the execution :

./GiNaCypSUks: In function ‘compiled_ex’:
./GiNaCypSUks:11:8: error: expected expression before ‘[’ token
 f[0] = [[-(a[0]*a[0])*sin(a[0]*a[1])],[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[cos(a[1])]];
        ^
./GiNaCypSUks:11:39: error: expected expression before ‘[’ token
 f[0] = [[-(a[0]*a[0])*sin(a[0]*a[1])],[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[cos(a[1])]];
                                       ^
./GiNaCypSUks:11:82: error: expected expression before ‘[’ token
 f[0] = [[-(a[0]*a[0])*sin(a[0]*a[1])],[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[cos(a[1])]];
                                                                                  ^
./GiNaCypSUks:12:9: error: expected expression before ‘[’ token
 f[1] = -[[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[-sin(a[0]*a[1])*(a[1]*a[1])],[-cos(a[0])]];
         ^
./GiNaCypSUks:12:53: error: expected expression before ‘[’ token
 f[1] = -[[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[-sin(a[0]*a[1])*(a[1]*a[1])],[-cos(a[0])]];
                                                     ^
./GiNaCypSUks:12:83: error: expected expression before ‘[’ token
 f[1] = -[[ cos(a[0]*a[1])-a[0]*sin(a[0]*a[1])*a[1]],[-sin(a[0]*a[1])*(a[1]*a[1])],[-cos(a[0])]];
                                                                                   ^
terminate called after throwing an instance of 'std::runtime_error'
  what():  contrib/ginac::compile_src_file ./GiNaCypSUks fails (1)

*** Aborted at 1404906881 (unix time) try "date -d @1404906881" if you are using GNU date ***
PC: @     0x7f17fa3b7407 (unknown)
*** SIGABRT (@0x3e800002a20) received by PID 10784 (TID 0x7f180673b7c0) from PID 10784; stack trace: ***
    @     0x7f17fd6f78f0 (unknown)
    @     0x7f17fa3b7407 (unknown)
    @     0x7f17fa3b87e8 (unknown)
    @     0x7f17fe14c5e5 (unknown)
    @     0x7f17fe14a746 (unknown)
    @     0x7f17fe14a773 (unknown)
    @     0x7f17fe14a9b2 (unknown)
    @     0x7f17fc5d9c60 GiNaC::excompiler::compile_src_file()
    @     0x7f17fc5d4ce4 GiNaC::compile_ex()
    @          0x176372b Feel::vf::GinacMatrix<>::GinacMatrix()
    @          0x1763c0f Feel::vf::curl<>()
    @          0x175e5fe TestCurl::run()
    @          0x11f1513 main
    @     0x7f17fa3a3b45 (unknown)
    @          0x11ee6f9 (unknown)

The expression is : t={sin(z)+cos(y),sin(z)+cos(x),sin(x*y)}:x:y:z
Then I do :

    auto t = expr<3,1>( soption("t") );
    auto curl_t = curl(t);
    auto curl2_t = curl(curl_t);

The error occurs at this moment. Is it possible to do that ?
It was my understanding that the type of the second line was an expression, like the first line, but it seems that there is a difference.
Is there a way to do that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions