﻿ Sample Problems > Usage > Moving_Mesh > 1d_stretch_x

# 1d_stretch_x

Navigation:  Sample Problems > Usage > Moving_Mesh >

# 1d_stretch_x   { 1D_STRETCH_X.PDE

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

xm = move(x)

DEFINITIONS

Hl = 1

gwid = 0.15

u0 = exp(-x^2/gwid^2)

lmove = Hl + t

vx = dt(xm)

INITIAL VALUES

u = u0

dt(xm) = x/Hl

EULERIAN EQUATIONS

U:   dt(u)=0

BOUNDARIES

REGION 1

{ In 1D, "point" boundary conditions must FOLLOW the point at which

they are to be applied: }

START(-Hl)   point value(u)=0 point value(xm)= -lmove

Line to (Hl) point value(u)=0 point value(xm)= lmove

TIME 0 TO 0.5 by 0.01

MONITORS

for cycle=1

elevation(u,u0) from(-10*Hl) to (10*Hl) range (0,1)

elevation(vx) from(-10*Hl) to (10*Hl) range (0,1)

PLOTS

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)

END