problem using Locator

Asked by Louise Olsen-Kettle

When I use locator to output the von Mises stress in code below:

xc1=[R00,0.,lzh/2.]

L1 = Locator(FunctionOnBoundary(mydomain), xc1)

sigma_mises=sqrt(((stress[0,0]-stress[1,1])**2 +(stress[1,1]-stress[2,2])**2 + (stress[2,2]-stress[0,0])**2)/2.+ 3.*(stress[0,1]**2 +
stress[1,2]**2 + stress[2,0]**2))

sigma_mises_impact = L1.getValue(sigma_mises)

I get this error message:

Traceback (most recent call last):
  File "H3Fill6.6.19.py", line 821, in <module>
    sigma_mises_impact = L1.getValue(sigma_mises)
  File "escriptcore/py_src/pdetools.py", line 417, in getValue
  File "escriptcore/py_src/util.py", line 2695, in interpolate
ValueError: No interpolation with data on elements possible.

Is this the right solution:

proj = Projector(mydomain)

 sigma_mises_impact = L1.getValue(proj(sigma_mises))

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Lutz Gross
Solved:
Last query:
Last reply:
Revision history for this message
Adam Ellery (aellery) said :
#1

Hi Louise,

How did you generate mydomain and the stress tensor that you are using?

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#2

mydomain=ReadGmsh('meshselfsimilar_H3.msh',3)

      u=mypde.getSolution()
      displacement=u
      g=grad(displacement)

      sigma=mu_damage*(g+transpose(g))+lam_damage*trace(g)*kronecker(mydomain)

      stress=symmetric(sigma)

Revision history for this message
Adam Ellery (aellery) said :
#3

How did you define mypde?

Revision history for this message
Best Lutz Gross (l-gross) said :
#4

Yes one solution is

proj = Projector(mydomain)
sigma_mises_impact = L1.getValue(proj(sigma_mises))

alternatively you can use

L1 = Locator(Function(mydomain), xc1)
sigma_mises_impact = L1.getValue(sigma_mises)

This would pick the von misses stress at the nearest integration point.
If the projection is a better solution is a question of taste.

Revision history for this message
Louise Olsen-Kettle (lokettle) said :
#5

Thanks Lutz Gross, that solved my question.