boundary_density

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Mesh_Control >

boundary_density

Previous pageReturn to chapter overviewNext page

{  BOUNDARY_DENSITY.PDE  

 

  This problem demonstrates the use of the MESH_DENSITY parameter to

  control mesh density along a boundary.

 

  The boundary of the inner region is forced to a grid spacing of 0.02

 

}  

 

title 'Cell Size Control'  

 

variables  

    u  

 

definitions  

    k = 1  

    u0 = 1-x^2-y^2  

    s = 2*3/4+5*2/4  

    b = 0.1  

    c = 0.02  

 

equations  

   U: div(K*grad(u)) +s = 0  

 

boundaries  

    Region 1  

      start(-1,-1)  

      value(u)=u0  

      line to (1,-1) to (1,1) to (-1,1) to close  

    Region 2  

      start(-b,-b)  

      mesh_density = 1/c   { command inside the boundary path }  

      line to (b,-b) to (b,b) to (-b,b) to close  

 

plots  

    grid(x,y)  

    contour(u) on region 2  

 

end