3D_Meshout

Top  Previous  Next

{

This example shows the use of the TRANSFER command to export problem data

and mesh structure in 3D problems.

The accompanying test 3d_Meshin.pde reads the transfer file produced here.

(The framework of the problem is a version of 3d_Antiperiodic.pde.)

}

 

title '3D MESH TRANSFER  TEST'

 

coordinates cartesian3

 

Variables

    u

 

definitions

    k = 1

    an = pi/4          { this is the angular size of the repeated segment }

    crot = cos(an)     { the sine and cosine needed in the transformation }

    srot = sin(an)

    H = 0

    xc = 1.5

    yc = 0.2

    rc = 0.1

 

equations

    div(K*grad(u)) + H = 0

 

extrusion z=0,0.4,0.6,1

 

boundaries

    Region 1

 

      start(1,0) line to (2,0)

 

      value(u) = 0  arc(center=0,0) to (2*crot,2*srot)

 

      antiperiodic(x*crot+y*srot, -x*srot+y*crot)

      line to (crot,srot)

 

      value(u)=0

      arc(center= 0,0)  to close

 

    Limited Region 2

       layer 2 H = 1

       start(xc-rc,0) line to (xc+rc,0) to (xc+rc,rc) to (xc-rc,rc) to close

 

    Limited Region 3

       layer 2 H = -1

       start((xc-rc)*crot,(xc-rc)*srot)

       line to ((xc+rc)*crot,(xc+rc)*srot)

               to ((xc+rc)*crot+rc*srot,(xc+rc)*srot-rc*crot)

               to ((xc-rc)*crot+rc*srot,(xc-rc)*srot-rc*crot) to close

 

plots

    contour(u) on z=0.5 paint

    grid(x,y,z)

 

    transfer(u)  file="mesh3u.xfr"        ! Export mesh and data

    transfer() file="mesh3.xfr"      ! Expor mesh only

 

end