<< Click to Display Table of Contents >> edge_distance |
{ EDGE_DISTANCE.PDE
This script demonstrates the EDGE_DISTANCE function by constructing a
gaussian curve based on the distance along the boundary path 'outer'.
}
Title 'Edge Distance'
Variables u
Definitions
wide=1
w = wide/2
! Define a Gaussian on the outer boundary, centered at half the perimeter
! (this depends on the boundary being defined in a single path!)
gausl = exp( -(edge_distance("outer")-4*wide)^2 / w^2 )
! form the integral of the Gaussian over the boundary
lint = surf_integral(gausl,"outer")
Equations
div(grad(u)) = 0
Boundaries
Region 1
start "outer" (-wide,-wide)
line to(wide,-wide) to(wide,wide) to(-wide,wide) to close
Plots
grid(x,y)
! display the Gaussian and compare the explicit integral to the automatic plot integral
elevation(gausl) on "outer" report lint
end