Point load in Escript

Asked by ArashM

Hi,
I just liked to know how I can define a point load using Escript.I have got a spherical geometry and I want the a point load to exert only on the top point of the sphere.Is it better to give the load to a node on the top or to an element on the top?tnx.

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
Lutz Gross (l-gross) said :
#1

The easiest way to do this is using a Gaussian distribution:

    xc=[0,0,0] # where the load applies
    ALPHA=100 # width of the Gaussian
    LOAD =1. # Load to apply
    x=domain.getX()
    phi=exp(-length(x-xc)**2/ALPHA**2)
    phi/=integrate(phi)*LOAD

    myPDE=LinearPDE(...)
    myPDE.setValue(Y=phi)

ALPHA is controlling the width of the Gaussian. Make sure that about the width is not too narrow so you leave a few elements (5-10) to resolve the profile. Notice also that we set Y and not y in the PDE

Revision history for this message
ArashM (arash-mohajeri) said :
#2

Hi Lutz,

I defined the point loading as you said.Now when I run the code, I get this error message:
" mypde.setValue(A=c,X=sigma0,q=msk,Y=phi)
  File "escript\py_src\linearPDEs.py", line 2736, in setValue
  File "escript\py_src\linearPDEs.py", line 2141, in setValue
IllegalCoefficientValue: Coefficient Y:Expected shape of coefficient is (3,) but actual shape is ()."

These lines below are supposed to solve PDEs in my code:

xc=[0,0,r] # where the load applies
AL=100
LOAD =1.
x=mydomain.getX() # Note:The domian is 3D
phi=exp(-length(x-xc)**2/AL**2)
phi/=integrate(phi)*LOAD
sigma0=alpha*p*kronecker(mydomain)
mypde.setValue(A=c,X=sigma0,q=msk,Y=phi)

Can you help me with this error?tnx.

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

My answer was obviously not complete: LOAD needs to be a vector in your case.

Revision history for this message
ArashM (arash-mohajeri) said :
#4

I wrote:

xc=[0,0,r] # where the load applies
AL=100 # width of the Gaussian
LOAD =(0,0,-1) # Load to apply
x=mydomain.getX()
phi=exp(-length(x-xc)**2/AL**2)
phi/=integrate(phi)*LOAD

Now it syas:
"phi/=integrate(phi)*LOAD
TypeError: can't multiply sequence by non-int of type 'float'"

Did I define the vector incorrectly?

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

(I am a bit slow today, sorry). You cannot update the scalar phi by multiplication with a vector. The correct way would be

phi/=integrate(phi)
...
mypde.setValue(A=c,X=sigma0,q=msk,Y=phi*LOAD)

Revision history for this message
ArashM (arash-mohajeri) said :
#6

Thanks Lutz Gross, that solved my question.