1 -- Glasow Haskell 0.403 : FINITE ELEMENT PROGRAM V2
    2 -- **********************************************************************
    3 -- *                                                                    *
    4 -- * FILE NAME : displacement.hs              DATE : 13-3-1991          *
    5 -- *                                                                    *
    6 -- * CONTENTS : Compute nodal displacement of the structure.            *
    7 -- *                                                                    *
    8 -- **********************************************************************
    9 
   10 module Displacement ( uvw, getnuvw ) where
   11 
   12 import Basics
   13 import Vector
   14 import Matrix
   15 import VBmatrix
   16 import VBlldecomp
   17 import DB_interface
   18 import Degrees
   19 import Pre_assemble
   20 import Assemble_stiffness
   21 import Assemble_loadvec
   22 
   23 uvw     :: (Array Int Int, Array Int Float) -> Vec Float
   24 
   25 getnuvw :: (Array Int Int, Array Int Float) -> Int -> 
   26                Vec Float -> (Float, Float, Float)
   27 
   28 t_Ub s = vbllsolution (kdd s) (loadvec s)
   29 
   30 uvw s =
   31         incrvec initial_value index_value_assoc
   32         where
   33         initial_value = makevec ( 3 * (nnode s) ) ( \ i -> 0.0 )
   34         index_value_assoc = concat (map f_s [1..(nnode s)])
   35         f_s = f s tUb
   36         tUb = t_Ub s
   37 
   38 f s tUb node =
   39         azip [l,l+1,l+2] (map ff dgrs)
   40         where
   41         l = 3 * (node - 1) + 1
   42         dgrs = getndgr s node
   43         ff i = if ( i == 0 ) then 0.0 else vecsub tUb i
   44 
   45 getnuvw s node uvw =
   46         (u,v,theta)
   47         where
   48         u = vecsub uvw index
   49         v = vecsub uvw (index+1)
   50         theta = vecsub uvw (index+2)
   51         index = 3 * (node - 1) + 1 
   52