TALK=T;RUN(1,2) 855

    GROUP 1. Run title and other preliminaries                      
TEXT(Transfer objects; 1d diffusion; 1st run.                       
LIBREF=855                                                          
TITLE                                                               
  DISPLAY                                                           
                                                                    
  This example illustrates th use of In-Form transfer objects        
  for a one-dimensional diffusion problem.                                         
                                                                    
  It concerns heat conduction in the z direction. The low wall
  is held at zero while a fixed heat flux is applied at the right-
  hand end. The grid is uniform; and the heat flux, dimensions and 
  conductivity are chosen so that, when the z-direction grid is
  uniform with NZ=5, the exact solution is:
         T=1,0 3.0, 5.0 etc.    at successive cells.
  This facilitates checking the accuracy of the result.
                                                                    
  The domain is divided into two parts, as shown below                             
                         !                          
        /----------------+-----------------/        
   low  /                !                 / high   
   wall /    1st part    !    2nd part     / wall   
        /                !                 /        
        / ---------------+-----------------/        
              ^ y        !                          
              |-------> z-direction                                 
                                                                    
                                                                    
  The run(1,2) at the top of the Q1 file ensures that two runs are
  made in succession, for the two sets of data in the file, 
  separated by the first STOP.      
  The TROB1 transfer object at the high boundary is formed at the   
  end of the first run by means of an '(export' In-Form statement.  
                                                                    
  The second run reads the information at the low boundary from the 
  TROB1 object by means of an '(import' In-Form statement.
  
  The y-direction grid intervals in the two parts can differ, as 
  shown by the differing NY and YPOWER below; and NZ and ZPOWER can
  also be varied.
                                                                    
  ENDDIS                                                            
                                                                    
    First run                                                       
    ---------                                                       
                                                                    
  Problem data                                                      
REAL(TCOLD,HEATIN,YPOWER,ZPOWER) 
NY=5;YPOWER=1.5;ZPOWER=2.0 
TCOLD=0.0     ! Temperature of cold wall   
HEATIN=1.0    !Heat input                       
  GROUP 4. Y-direction grid specification                           
GRDPWR(Y,NY,1.0,YPOWER)                                               
  GROUP 5. Z-direction grid specification                           
GRDPWR(Z,5,1.0,ZPOWER)                                              
    GROUP 7. Variables stored, solved & named                       
SOLVE(TEM1)                                                         
    GROUP 9. Properties of the medium (or media)                    
PRNDTL(TEM1) = - 1.0   ! i.e.conductivity                                  
    GROUP 13. Boundary conditions and special sources               
  Cold wall                                                         
PATCH(LW,LWALL,1,NX,1,NY,1,1,1,1)                                   
COVAL(LW,TEM1,1.0,TCOLD)                                              
  Heated end                                    
PATCH(HW,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                 
COVAL(HW,TEM1,FIXFLU,HEATIN)                                              
                                                                    
  INFORM13BEGIN
                                                       
PATCH(PAT2,HIGH,1,NX,1,NY,NZ,NZ,1,1) ! transfer object at high end                              
(EXPORT in TROB1 at PAT2)                                          
  INFORM13END                                                       
                                                                    
    GROUP 15. Termination of sweeps                                 
LSWEEP=1 ; LITER(TEM1)=100;ENDIT(TEM1)=0.0;RESREF(TEM1)=0.0
RELAX(TEM1,LINRLX,1.0) ! settings allowing single-sweep solution                                                   
STOP                                                                
                                                                    
    Second run                                                      
    ----------                                                      
                                                                    
TEXT(Transfer objects; 1d diffusion; 2nd run.                       
  Problem data                                                      
REAL(HEATIN,YPOWER)                                                     
NY=2;YPOWER=0.5                                                    
HEATIN=1.0    ! Heat input                       
GRDPWR(Y,NY,1.0,YPOWER)                                               
  GROUP 5. Z-direction grid specification                           
GRDPWR(Z,5,1.0,10.0)                                              
    GROUP 7. Variables stored, solved & named                       
SOLVE(TEM1)                                                         
    GROUP 9. Properties of the medium (or media)                    
PRNDTL(TEM1) = - 1.0   ! i.e. conductivity                                  
    GROUP 13. Boundary conditions and special sources               
  INFORM13BEGIN                                                     
                                                       
PATCH(PAT1,LOW,1,NX,1,NY,1,1,1,1) ! transfer object at low end                                  
(IMPORT from TROB1 at PAT1)                                         
  INFORM13END                                                       
  Heated end                                                          
PATCH(HW,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                 
COVAL(HW,TEM1,FIXFLU,HEATIN)                                              
LSWEEP=1 ; LITER(TEM1)=100;ENDIT(TEM1)=0.0;RESREF(TEM1)=0.0
RELAX(TEM1,LINRLX,1.0) ! settings allowing single-sweep solution                                                   
STOP