|
1D_StretchX |
Top Previous Next |
|
{ This example demonstrates moving meshes in 1D. A Gaussian distribution is defined on a 1D mesh. The mesh is then stretched to twice its initial size, while the Gaussian remains fixed in space.
Mesh motion is imposed by explicit positions of the endpoints.
} TITLE "stretching line"
COORDINATES cartesian1
VARIABLES u vx xm = move(x)
DEFINITIONS Hl = 1/2 gwid = 0.15 u0= exp(-x^2/gwid^2) lmove = Hl + t
INITIAL VALUES u= u0 vx=x/Hl
EQUATIONS U: dt(u)=0 Vx: div(grad(vx))=0 Xm: dt(xm) = vx
BOUNDARIES REGION 1 START(-Hl) point value(u)=0 point value(vx)= -1 point value(xm)= -lmove Line to (Hl) point value(u)=0 point value(vx)=1 point value(xm)= lmove
TIME 0 TO 0.5 by 0.01! 10
MONITORS for cycle=1 elevation(u,u0) from(-10*Hl) to (10*Hl) range (0,1) elevation(dt(xm)) from(-10*Hl) to (10*Hl) range (0,1)
PLOTS for cycle=1 !for time=0.1 by 0.1 to endtime elevation(u,u0) from(-10*Hl) to (10*Hl) range (0,1) elevation(vx) from(-10*Hl) to (10*Hl) range (0,1) elevation(dt(xm)) from(-10*Hl) to (10*Hl) range (0,1) END
|