26 |
|
|
27 |
# Import the necessary modules. |
# Import the necessary modules. |
28 |
from esys.escript import * |
from esys.escript import * |
|
from esys.escript.pdetools import Locator |
|
29 |
from esys.escript.linearPDEs import LinearPDE |
from esys.escript.linearPDEs import LinearPDE |
30 |
from esys.finley import Brick |
from esys.finley import Brick |
31 |
from numarray import identity,zeros,ones |
from numarray import identity,zeros,ones |
72 |
u_last=U0*whereNegative(length(x-xc)-src_radius)*dunit |
u_last=U0*whereNegative(length(x-xc)-src_radius)*dunit |
73 |
t=0 |
t=0 |
74 |
|
|
|
# define the location of the point source |
|
|
L=Locator(domain,numarray.array(xc)) |
|
|
# find potential at point source |
|
|
u_pc=L.getValue(u) |
|
|
|
|
|
u_pc_x = u_pc[0] |
|
|
u_pc_y = u_pc[1] |
|
|
u_pc_z = u_pc[2] |
|
|
|
|
|
# open file to save displacement at point source |
|
|
#u_pc_data=open('./data/U_pc.out','w') |
|
|
#u_pc_data.write("%f %f %f %f\n"%(t,u_pc_x,u_pc_y,u_pc_z)) |
|
|
|
|
75 |
# Create a Scene. |
# Create a Scene. |
76 |
s = Scene(renderer = JPG_RENDERER, x_size = X_SIZE, y_size = Y_SIZE) |
s = Scene(renderer = JPG_RENDERER, x_size = X_SIZE, y_size = Y_SIZE) |
77 |
|
|
104 |
u=u_new |
u=u_new |
105 |
t+=h |
t+=h |
106 |
n+=1 |
n+=1 |
|
u_pc=L.getValue(u) |
|
|
|
|
|
u_pc_x=u_pc[0] |
|
|
u_pc_y=u_pc[1] |
|
|
u_pc_z=u_pc[2] |
|
|
|
|
107 |
# ... save current acceleration in units of gravity and displacements |
# ... save current acceleration in units of gravity and displacements |
108 |
if n==1 or n%10==0: |
if n==1 or n%10==0: |
109 |
|
|