vector_variables

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Variable_Types >

vector_variables

Previous pageReturn to chapter overviewNext page

{ VECTOR_VARIABLES.PDE  

     

   This example demonstrates the use of vector-valued variables.

   The equations are not intended to represent any real application,

   but merely to show some vector constructs.

 

}  

 

title 'Vector Variables'  

 

variables  

   U = vector(Ux,Uy)   { declares component variables Ux and Uy }  

   V                   { a scalar variable to validate Uy }  

   

definitions  

   u0 = 1-x^2-y^2  

   u1 = 1+y+x^3  

   s = vector(4,-6*x)  

 

equations  

   U: div(grad(U)) +s = 0  

   V: del2(v) +ycomp(s) = 0  

 

boundaries  

  Region 1  

    start(-1,-1)  

      value(U)=vector(u0,u1)  

      value(v)=u1  

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

 

plots  

  contour(Ux)  

  contour(Uy,u1)  

  contour(v,u1)  

  contour(Ux,Uy)  

  vector(U)  

  elevation(u) from(-1,0) to (1,0)  

  vtk(u,s)  

  transfer(u,s)  

  table(u,s)  

 

end