Hi, can you please give me an idea what does the following error mean? Thanks for your support!
Traceback (most recent call last):
File "pf2dtest.py", line 206, in ?
S20+=s[k]*((.5*epsilon[counti,k]**2-.5*epsilon[j,k]**2)*(phases[k].getFaceGrad()).getDivergence \
TypeError: unsupported operand type(s) for *: 'float' and 'instancemethod'
The complete codes at lines 206 & 207 are:-
S20+=s[k]*((.5*epsilon[counti,k]**2-.5*epsilon[j,k]**2)*(phases[k].getFaceGrad()).getDivergence \
+(omega[counti,k]-omega[j,k])*phases[k])
where s was defined as:-
s=[
CellVariable(mesh=mesh, name='s0', value=(phases[0]>0)),
CellVariable(mesh=mesh, name='s1', value=(phases[1]>0)),
CellVariable(mesh=mesh, name='s2', value=(phases[2]>0)),
CellVariable(mesh=mesh, name='s3', value=(phases[3]>0))
]
and phases was defined as:-
phases=[
CellVariable(mesh=mesh, name='phi0', value=0),
CellVariable(mesh=mesh, name='phi1', value=0),
CellVariable(mesh=mesh, name='phi2', value=0),
CellVariable(mesh=mesh, name='phi3', value=0)
]
epsilon and omega are constant matrices.
Thanks and regards,
hzhatlboro
Traceback (most recent call last):
File "pf2dtest.py", line 206, in ?
S20+=s[k]*((.5*epsilon[counti,k]**2-.5*epsilon[j,k]**2)*(phases[k].getFaceGrad()).getDivergence \
TypeError: unsupported operand type(s) for *: 'float' and 'instancemethod'
The complete codes at lines 206 & 207 are:-
S20+=s[k]*((.5*epsilon[counti,k]**2-.5*epsilon[j,k]**2)*(phases[k].getFaceGrad()).getDivergence \
+(omega[counti,k]-omega[j,k])*phases[k])
where s was defined as:-
s=[
CellVariable(mesh=mesh, name='s0', value=(phases[0]>0)),
CellVariable(mesh=mesh, name='s1', value=(phases[1]>0)),
CellVariable(mesh=mesh, name='s2', value=(phases[2]>0)),
CellVariable(mesh=mesh, name='s3', value=(phases[3]>0))
]
and phases was defined as:-
phases=[
CellVariable(mesh=mesh, name='phi0', value=0),
CellVariable(mesh=mesh, name='phi1', value=0),
CellVariable(mesh=mesh, name='phi2', value=0),
CellVariable(mesh=mesh, name='phi3', value=0)
]
epsilon and omega are constant matrices.
Thanks and regards,
hzhatlboro
Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail.
