integrating problem

Asked by eagle

i wrote defenitions , variational problem and error shown . what does this error mean and how can be solved .

(sigma, u) = TrialFunctions(W)
(sigmas, us) = TrialFunctions(W)
(tau, v) = TestFunctions(W)
e = Function (BDM)

# Forward problem
a = C*(dot(sigma, tau) + div(tau)*u + div(sigma)*v)*dx
L = 0.0
e = sigma

# Adjoint problem
aa = C*(dot(sigmas, tau) + div(tau)*us + div(sigmas)*v)*dx
La = D*v*(sigma)*dx

Trying to integrate expression of rank 1 with free indices ().
Traceback (most recent call last):
  File "3.py", line 64, in <module>
    La = D*v*(sigma)*dx
  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/integral.py", line 94, in __rmul__
    % (integrand.rank(), integrand.free_indices()))
  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/assertions.py", line 20, in ufl_assert
    if not condition: error(*message)
  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/log.py", line 124, in error
    raise UFLException(self._format_raw(*message))
ufl.log.UFLException: Trying to integrate expression of rank 1 with free indices ().

regards .

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Martin Sandve Alnæs (martinal) said :
#1

You try to integrate a vector expression, you must figure out what's
wrong with this equation:
La = D*v*(sigma)*dx

Martin

On 19 August 2011 10:25, eagle <email address hidden> wrote:
> New question #168506 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/168506
>
> i wrote defenitions , variational problem and error shown . what does this error mean and how can be solved .
>
>
> (sigma, u) = TrialFunctions(W)
> (sigmas, us) = TrialFunctions(W)
> (tau, v) = TestFunctions(W)
> e = Function (BDM)
>
>
> # Forward problem
> a = C*(dot(sigma, tau) + div(tau)*u + div(sigma)*v)*dx
> L = 0.0
> e = sigma
>
> # Adjoint problem
> aa = C*(dot(sigmas, tau) + div(tau)*us + div(sigmas)*v)*dx
> La = D*v*(sigma)*dx
>
>
> Trying to integrate expression of rank 1 with free indices ().
> Traceback (most recent call last):
>  File "3.py", line 64, in <module>
>    La = D*v*(sigma)*dx
>  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/integral.py", line 94, in __rmul__
>    % (integrand.rank(), integrand.free_indices()))
>  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/assertions.py", line 20, in ufl_assert
>    if not condition: error(*message)
>  File "/home/Mohseni/Work/FEniCS/lib/python2.6/site-packages/ufl/log.py", line 124, in error
>    raise UFLException(self._format_raw(*message))
> ufl.log.UFLException: Trying to integrate expression of rank 1 with free indices ().
>
> regards .
>
>
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Revision history for this message
eagle (m-mohsenie-deactivatedaccount) said :
#2

i know that but i can't treat sigma as scalar because div in :
aa = C*(dot(sigmas, tau) + div(tau)*us + div(sigmas)*v)*dx
any idea ?

Can you help with this problem?

Provide an answer of your own, or ask eagle for more information if necessary.

To post a message you must log in.