← Back to team overview

dolfin team mailing list archive

[Question #152702]: indices in an expression?

 

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

May be a non-needed trial for some, but I try to define an expression (permutation symbol)

def e(i,j,k):
	if (i,j,k) == (1.0,2.0,3.0): return 1.0
	elif (i,j,k) == (2.0,3.0,1.0): return 1.0
	elif (i,j,k) == (3.0,1.0,2.0): return 1.0
	elif (i,j,k) == (3.0,2.0,1.0): return -1.0
	elif (i,j,k) == (2.0,1.0,3.0): return -1.0
	elif (i,j,k) == (1.0,3.0,2.0): return -1.0
	else: return 0.0

and use (with summation over indices, it is a curl operator contracted with w) in the form like

f=v[j]*w[i]*e(i,j,l)*v[l]*dx

which raises:
ufl.log.UFLException: Trying to integrate expression of rank 0 with free indices

Do I have to use as_vector(...) type definition to sum with indices or is there a nice possibility to let it sum over the arguments of e(...) expression?

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



Follow ups