TABLE OF CONTENTS

1. /elements [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: elements

SYNOPSIS

    Usage:      USE elements

FUNCTION

    Contains subroutines used for computing element level matrices
    
    Subroutine             Purpose

    SHAPE_FUN              Computes the shape functions
    SHAPE_DER              Compute the derivatives of the shape functions
    BEEMAT                 Compute the B matrix
    SAMPLE                 Returns local coords of the integrating points
    ECMAT                  Returns the consistent mass matrix
    DEEMAT                 Compute the D matrix

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

1.1. elements/beemat [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: beemat

SYNOPSIS

    Usage:      CALL beemat(deriv,bee)

FUNCTION

    Build B-array for 3D elasticity or elastoplasticity (ih=3 or 4
    respectively) or for 3D (ih=6)

INPUTS

    The following arguments have the INTENT(IN) attribute:

    deriv(ndim,nod)     : Real
                        : Shape function derivatives in the undeformed
                          mesh at a Gauss point

    The following arguments have the INTENT(OUT) attribute:

    bee(nst,ndof)       : Real
                        : Shape function derivatives in the undeformed
                          element arranged in B array

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

1.2. elements/deemat [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: deemat

SYNOPSIS

    Usage:      CALL deemat(e,v,dee)

FUNCTION

    Compute the material matrix (D-matrix) for a linear elastic material.
    It's valid for plane strain (ih=3), axisymmetry or plane strain
    elastoplasticity (ih=4) or 3D problems (ih=6)

INPUTS

    The following arguments have the INTENT(IN) attribute:

    e                         : Real
                              : Young's modulus

    v                         : Real
                              : Poisson's ratio

    The following argument has the INTENT(OUT) attribute:

    dee(nst,nst)              : Real
                              : Material matrix for linear elasticity

AUTHOR

    Smith and Griffiths 4th Edition

COPYRIGHT

    (c) University of Manchester 2004-2010

1.3. elements/ecmat [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: ecmat

SYNOPSIS

    Usage:      CALL ecmat(ecm,fun,ndof,nodof)

FUNCTION

    Returns the consistent mass matrix ECM for an element with shape
    functions FUN, NDOF freedoms and NODOF freedoms per node 
    Source: "Programming the Finite Element Method"

INPUTS

    The following arguments have the INTENT(IN) attribute:

    fun(:)              : Real
                        : Element shape functions

    nodof               : Integer
                        : Freedoms per node

    ndof                : Integer
                        : Number of degrees of freedom per element
                          
  OUTPUTS
    The following arguments have the INTENT(OUT) attribute:

    ecm(:,:)            : Real
                        : Element consistent mass matrix

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

1.4. elements/sample [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: sample

SYNOPSIS

    Usage:      CALL sample(element,s,wt)

FUNCTION

    Returns the local coordinates of the integrating points. 
    Source: "Programming the Finite Element Method"

INPUTS

    The following arguments have the INTENT(IN) attribute:

    element             : Character
                        : Element type
                          
  OUTPUTS
    The following arguments have the INTENT(OUT) attribute:

    s(:,:)              : Real
                        : Local coordinates of the integrating points

    wt(:)               : Real
                        : Weighting function

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

1.5. elements/shape_der [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: shape_der

SYNOPSIS

    Usage:      CALL shape_der(der,points,i)

FUNCTION

    Compute the derivatives of the shape functions at a Gauss point.
    Source: "Programming the Finite Element Method"

INPUTS

    The following arguments have the INTENT(IN) attribute:

    i                  : Integer
                       : Gauss point number

    points(nip,ndim)   : Real
                       : Gauss points coordinates at the reference 
                         element

  OUTPUTS
    The following arguments have the INTENT(OUT) attribute:

    der(ndim,nod)      : Real
                       : Derivatives of the shape functions at a 
                         Gauss point

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

1.6. elements/shape_fun [ Functions ]

[ Top ] [ elements ] [ Functions ]

NAME

    SUBROUTINE: shape_fun

SYNOPSIS

    Usage:      CALL shape_fun(fun,points,i)

FUNCTION

    Compute the value of the shape functions at a Gauss point.
    Source: "Programming the Finite Element Method"

INPUTS

    The following arguments have the INTENT(IN) attribute:

    i                  : Integer
                       : Gauss point number

    points(ndim,nip)   : Real
                       : Gauss points coordinates at the reference 
                         element

    The following arguments have the INTENT(OUT) attribute:

    fun(nod)           : Real
                       : Value of the shape functions at a 
                         Gauss point

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

2. /gather_scatter [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: gather_scatter

SYNOPSIS

    Usage:      USE gather_scatter

FUNCTION

    Subroutine                 Purpose

    MY_BARRIER                 Synchronises all processors
    MPERROR                    Returns an error code
    CALC_NELS_PP               Computes number of elements per processor
    CALC_NEQ_PP                Computes number of equations per processor
    CALC_NPES_PP               Computes size of arrays for data exchange
    ALLOCATE_GATHER_SCATTER    Allocates arrays used in GATHER & SCATTER
    DEALLOCATE_GATHER_SCATTER  Deallocates arrays used in GATHER & SCATTER
    GATHER                     Performs the gather operation: pmul = p(g)
    SCATTER                    Performs the operation: u(g) = u(g) + utemp
    SCATTER_NOADD              Performs the operation: u(g) = utemp
    MAKE_GGL                   Relates equations to elements and processors
    SCATTER_NODES                         

AUTHOR

    M.A. Pettipher
    L. Margetts
    V. Szeremi
    F. Calvo

COPYRIGHT

    (c) University of Manchester 1996-2010

2.1. gather_scatter/allocate_gather_scatter [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: allocate_gather_scatter

SYNOPSIS

    Usage:      CALL allocate_gather_scatter(npes_pp,npes)

FUNCTION

    Allocates the arrays used in the subroutines GATHER and SCATTER.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    npes_pp               : Integer
                          : Number of processors each processor needs to 
                          : communicate with.

    npes                  : Integer
                          : Total number of processors used by the program.

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.2. gather_scatter/calc_nels_pp [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: calc_nels_pp

SYNOPSIS

    Usage:      CALL calc_nels_pp(nels)

FUNCTION

    Calculates the number of elements, NELS_PP, assigned to each processor.
    It is effectively a very naive method of mesh partitioning. The 
    subroutine also computes, IEL_START, the first element number on each 
    processor. IEL_START and NELS_PP are the external variables modified by
    this subroutine. Note that they are global variables that are not
    passed through the list of arguments.

    An example follows which explains how this subroutine works: 

    If we have:   nels = 103 (number of elements)     
                  npes = 5  (number of processors)

    The output will be:

    nels_pp2     = 20 (103/5=20, so 20 elements for each processor and the 
                       remaining 3 elements will be assigned to the first 
                       3 processors)

    num_nels_pp1 = 3  (103 - 20*5 = 3, these are the 3 remaining elements)

    nels_pp2     = 21 (number of elements assigned to the first 3 processors)

    So the result is:

    On processor 1 (numpe = 1) -----> nels_pp=21  iel_start=1
    On processor 2 (numpe = 2) -----> nels_pp=21  iel_start=22
    On processor 3 (numpe = 3) -----> nels_pp=21  iel_start=43
    On processor 4 (numpe = 4) -----> nels_pp=20  iel_start=64
    On processor 5 (numpe = 5) -----> nels_pp=20  iel_start=84

INPUTS

    The following argument has the INTENT(IN) attribute:

    nels                  : Integer
                          : Total number of elements in the mesh

AUTHOR

    M.A. Pettipher
    L. Margetts

COPYRIGHT

    (c) University of Manchester 1996-2010

2.3. gather_scatter/calc_neq_pp [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: calc_neq_pp

SYNOPSIS

    Usage:      CALL calc_neq_pp(nels)

FUNCTION

    Calculates the number of equations, NEQ_PP, assigned to each processor.
    It is effectively a very naive method of mesh partitioning. The 
    subroutine also computes, IEQ_START, the first equation number on each 
    processor. IEQ_START and NEQ_PP are external variables modified by this
    subroutine. Note that they are global variables that are not passed
    through the list of arguments.

    An example follows which explains how this subroutine works: 

    If we have:   nels = 103 (number of equations)     
                  npes = 5   (number of processors)

    The output will be:

    neq_pp2      = 20 (103/5=20, so 20 equations for each processor and the 
                       remaining 3 equations will be assigned to the first 
                       3 processors)

    num_neq_pp1  = 3  (103 - 20*5 = 3, these are the 3 remaining equations)

    nels_pp2     = 21 (number of elements assigned to the first 3 processors)

    So the result is:

    On processor 1 (numpe = 1) -----> neq_pp=21    ieq_start=1
    On processor 2 (numpe = 2) -----> neq_pp=21    ieq_start=22
    On processor 3 (numpe = 3) -----> neq_pp=21    ieq_start=43
    On processor 4 (numpe = 4) -----> neq_pp=20    ieq_start=64
    On processor 5 (numpe = 5) -----> neq_pp=20    ieq_start=84

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.4. gather_scatter/calc_npes_pp [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: calc_npes_pp

SYNOPSIS

    Usage:      CALL calc_npes_pp(npes,npes_pp)

FUNCTION

    Sets value to be used in initial dimensions of toget and toput. We do
    not know the exact number of processors needed by each processor until
    MAKE_GGL is called, but we must declare these arrays (or at least
    temporary versions of them) before the exact number is known. NPES
    is definitely enough, but wasteful of memory, so make rough
    overestimate based on number of processors, NPES.

AUTHOR

    M.A. Pettipher
    L. Margetts

COPYRIGHT

    (c) University of Manchester 1996-2010

2.5. gather_scatter/deallocate_gather_scatter [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: deallocate_gather_scatter

SYNOPSIS

    Usage:      CALL deallocate_gather_scatter(npes_pp,npes)

FUNCTION

    Deallocates the arrays used in the subroutines GATHER and SCATTER.

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.6. gather_scatter/gather [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: gather

SYNOPSIS

    Usage:      CALL gather(p_pp,pmul_pp)

FUNCTION

    Performs the gather operation: pmul = p(g).

INPUTS

    The following arguments have the INTENT(IN) attribute:

    p_pp(:)               : Real
                          : Distributed vector of dimension NEQ_PP

    pmul_pp(:,:)          : Real
                          : Distributed array(NTOT,NELS_PP) that is 
                          : to be populated with the values in P_PP, 
                          : arranged in an element-by-element form.

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.7. gather_scatter/make_ggl [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: make_ggl

SYNOPSIS

    Usage:      CALL make_ggl(npes_pp,npes,gg_pp)

FUNCTION

    Generates ggl_pp and associated arrays.

INPUTS

    The following arguments have the INTENT(IN) attribute:

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.8. gather_scatter/mperror [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: mperror

SYNOPSIS

    Usage:      CALL mperror(cherror,errcode)

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.9. gather_scatter/my_barrier [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: my_barrier

SYNOPSIS

    Usage:      CALL my_barrier(numpe,ibar,channel,chstr)

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.10. gather_scatter/scatter [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: scatter

SYNOPSIS

    Usage:      CALL scatter(u_pp,utemp_pp)

FUNCTION

    Performs the scatter operation: u(g) = u(g) + utemp.

INPUTS

    The following argument has the INTENT(IN) attribute:

    utemp_pp(:)           : Real
                          : Distributed array(NTOT,NELS_PP) that contains
                          : data in an element-by-element form that is to 
                          : be scattered to a vector of dimension NEQ_PP

    The following argument has the INTENT(INOUT) attribute:

    u_pp(:,:)             : Real
                          : Distributed vector of dimension NEQ_PP.

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

2.11. gather_scatter/scatter_noadd [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: scatter_noadd

SYNOPSIS

    Usage:      CALL scatter_noadd(utemp_pp,u_pp)

FUNCTION

    Performs the scatter operation: u(g) = utemp.

INPUTS

    The following argument has the INTENT(IN) attribute:

    utemp_pp(:)           : Real
                          : Distributed array(NTOT,NELS_PP) that contains
                          : data in an element-by-element form that is to 
                          : be scattered to a vector of dimension NEQ_PP

    The following argument has the INTENT(INOUT) attribute:

    u_pp(:,:)             : Real
                          : Distributed vector of dimension NEQ_PP.

AUTHOR

    M.A. Pettipher
    V. Szeremi

COPYRIGHT

    (c) University of Manchester 1996-2010

2.12. gather_scatter/scatter_nodes [ Functions ]

[ Top ] [ gather_scatter ] [ Functions ]

NAME

    SUBROUTINE: scatter_nodes

SYNOPSIS

    Usage:      CALL scatter_nodes(npes,nn,nels_pp,g_num_pp,nod,        &
                            numvar,nodes_pp,node_start,node_end,        &
                            element_contribution,nodal_value,flag)

FUNCTION

    Assembly element contributions of a nodal value

INPUTS

    The following arguments have the INTENT(IN) attribute:

    flag                  : Integer
                          : Indicator (1 average sum, 0 total sum)

    nels_pp               : Integer
                          : Number of elements per processor

    nn                    : Integer
                          : Total number of nodes

    nod                   : Integer
                          : Number of nodes per element

    node_end              : Integer
                          : Last node stored in the process

    node_start            : Integer
                          : First node stored in the process

    nodes_pp              : Integer
                          : Number of nodes stored in the process

    npes                  : Integer
                          : Number of processes

    numvar                : Integer
                          : Number of components of the variable
                            (1-scalar, 3-vector, 6-tensor)

    g_num_pp(nod,nels_pp) : Integer
                          : Elements connectivity

    element_contribution(ntot,nels_pp) : Real
                                       : Elements contribution to the 
                                         nodal variable

    The following arguments have the INTENT(OUT) attribute:

    nodal_value(nodes_pp*nodof)        : Real
                                       : Value after assembling elements
                                         contribution

AUTHOR

    F. Calvo

COPYRIGHT

    (c) University of Manchester 2007-2010

3. /global_variables [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: global_variables

SYNOPSIS

    Usage:      USE global_variables

FUNCTION

    Contains variables used in other modules and the main programs

AUTHOR

    M. Pettipher   
    L. Margetts

COPYRIGHT

    (c) University of Manchester 1996-2010 

4. /input [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: input

SYNOPSIS

    Usage:      USE input

FUNCTION

    Contains subroutines that handle input data. These subroutines are 
    parallel and require MPI.
    
    Subroutine             Purpose

    READ_G_COORD_PP        Reads the global coordinates
    READ_NUM               Reads the element nodal steering array
    READ_REST              Reads the restraints
    READ_P121              Reads the control data for program p121
    READ_P129              Reads the control data for program p129

AUTHOR

    L. Margetts

COPYRIGHT

    2004-2010 University of Manchester

4.1. input/read_g_coord_pp [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_g_coord_pp

SYNOPSIS

    Usage:      CALL read_g_coord_pp(job_name,g_num_pp,nn,npes,numpe,     &
                                     g_coord_pp)

FUNCTION

INPUTS

AUTHOR

    Lee Margetts

CREATION DATE

    21 May 2008

COPYRIGHT

    (c) University of Manchester 2007-2010
        Available under commercial licence

4.2. input/read_g_num_pp [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_g_num_pp

SYNOPSIS

    Usage:      CALL read_g_num_pp(job_name,iel_start,nels,nn,numpe,      &
                                   g_num_pp)

FUNCTION

    Master process reads the global array of elements and broadcasts
    to slave processes.
    Processes record only its local part of elements.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    job_name              : Character
                          : Used to create file name to read

    iel_start             : Integer
                          : First element number in a process

    nels                  : Integer
                          : Total number of elements

    nn                    : Integer
                          : Total number of nodes 

    numpe                 : Integer
                          : Process number

    The following arguments have the INTENT(OUT) attribute:

    g_num_pp(nod,nels_pp) : Integer
                          : Elements connectivity

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2007-2010

4.3. input/read_loads [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_loads

SYNOPSIS

    Usage:      CALL read_loads(job_name,numpe,node,value)

FUNCTION

    Master processor reads the global array of nodal forces 
    and broadcasts them to the slave processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    job_name                 : Character
                             : Used to generate file name to read

    numpe                    : Integer
                             : Processor number used for I/O

    The following arguments have the INTENT(OUT) attribute:

    node(loaded_nodes)       : Integer
                             : Nodes that have an applied load 

    value(ndim,loaded_nodes) : Real
                             : Force applied on each node

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2007-2010

4.4. input/read_p121 [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_p121

SYNOPSIS

    Usage:      CALL read_p121(job_name,numpe,e,element,limit,             &
                               loaded_nodesmesh,nels,nip,nn,nod,nr,tol,v

FUNCTION

    Master processor reads the general data for the problem and broadcasts 
    it to the slave processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    job_name               : Character
                           : File name that contains the data to be read

    numpe                  : Integer
                           : Processor number

    The following arguments have the INTENT(INOUT) attribute:

    e                      : Real
                           : Young's modulus

    element                : Character
                           : Element type
                           : Values: 'hexahedron' or 'tetrahedron'

    limit                  : Integer
                           : Maximum number of PCG iterations allowed

    loaded_nodes           : Integer
                           : Number of nodes with applied forces

    mesh                   : Integer
                           : 1 = Smith and Griffiths numbering scheme
                           : 2 = Abaqus numbering scheme

    nels                   : Integer
                           : Total number of elements

    nip                    : Integer
                           : Number of Gauss integration points

    nn                     : Integer
                           : Total number of nodes in the mesh

    nod                    : Integer
                           : Number of nodes per element

    nr                     : Integer
                           : Number of nodes with restrained degrees of
                             freedom 

    tol                    : Real
                           : Tolerance for PCG

    v                      : Real
                           : Poisson coefficient

AUTHOR

    Lee Margetts

CREATION DATE

    03.03.2010

COPYRIGHT

    (c) University of Manchester 2010

4.5. input/read_p129 [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_p129

SYNOPSIS

    Usage:      CALL read_p129(job_name,numpe,alpha1,beta1,e,element,     &
                               limit,loaded_nodes,mesh,nels,nip,nn,nod,   &
                               npri,nr,nstep,omega,rho,theta,tol,v)

FUNCTION

    Master processor reads the general data for the problem and broadcasts 
    it to the slave processors.

INPUTS

    The following scalar character argument has the INTENT(IN) attribute:

    job_name               : File name that contains the data to be read

    The following scalar integer argument has the INTENT(IN) attribute:

    numpe                  : Processor ID of calling processor

    The following scalar real arguments have the INTENT(INOUT) attribute:

    alpha1                 : Rayleigh damping parameter
    beta1                  : Rayleigh damping parameter
    e                      : Young's modulus
    omega                  : Intermediate value
    rho                    : Density
    theta                  : Parameter in "theta" integrator
    tol                    : Convergence tolerance for PCG
    v                      : Poisson's ratio

    The following scalar integer arguments have an INTENT(INOUT) attribute:

    limit                  : Maximum number of PCG iterations allowed
    loaded_nodes           : Number of nodes with applied forces
    mesh                   : Mesh numbering scheme
                           : 1 = Smith and Griffiths numbering scheme
                           : 2 = Abaqus numbering scheme
    nels                   : Total number of elements
    nip                    : Number of integration points
    nn                     : Number of nodes in the mesh
    nod                    : Number of nodes per element
    npri                   : Print interval
    nr                     : Number of restrained nodes
    nstep                  : Number of time steps in analysis

    The following scalar character argument has an INTENT(INOUT) attribute:

    element                : Element type
                           : Values: 'hexahedron' or 'tetrahedron'

AUTHOR

    Lee Margetts

CREATION DATE

    25.02.2010

COPYRIGHT

    (c) University of Manchester 2010

4.6. input/read_rest [ Functions ]

[ Top ] [ input ] [ Functions ]

NAME

    SUBROUTINE: read_rest

SYNOPSIS

    Usage:      CALL read_rest(job_name,numpe,rest)

FUNCTION

    Master process reads the global array of nodes with restrained 
    degrees of freedom.
    Master process broadcasts to slave processes.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    job_name               : Character
                           : Used to create file name to read

    numpe                  : Integer
                           : Process number

    The following arguments have the INTENT(OUT) attribute:

    rest(nr,nodof+1)       : Integer
                           : Nodes (column 1) and degrees of freedom
                             restrained (columns 2,3,4). 
                             The criterion is:  0 fixed, ! free

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

5. /loading [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: loading

SYNOPSIS

    Usage:      USE loading

FUNCTION

    Contains subroutines used for loading. These subroutines are parallel 
    and require MPI.
    
    Subroutine             Purpose

    LOAD                   Creates the distributed applied loads vector

AUTHOR

    L. Margetts
    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

5.1. loading/load [ Functions ]

[ Top ] [ loading ] [ Functions ]

NAME

    SUBROUTINE: load

SYNOPSIS

    Usage:      CALL load(g_g_pp,g_num_pp,load_node,load_value,fext_pp)

FUNCTION

    Build the distributed vector containing the natural boundary
    conditions (forces in mechanics, fluxes in thermal problems)

INPUTS

    The following arguments have the INTENT(IN) attribute:

    g_g_pp(ntot,nels_pp)    : Integer
                            : Array linking equations to elements

    g_num_pp(nod,nels_pp)   : Integer
                            : Elements connectivity

    load_node(loaded_nodes) : Integer
                            : Node numbers that have a load imposed
                          
    load_value(ndim,loaded_nodes)
                            : Real
                            : Value of the force at each loaded node

    The following arguments have the INTENT(OUT) attribute:
                          
    fext_pp(neq_pp)         : Real
                            : Natural boundary conditions vector

AUTHOR

    Lee Margetts

CREATION DATE

    26.05.2008

COPYRIGHT

    (c) University of Manchester 2008-2010

6. /maths [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: maths

SYNOPSIS

    Usage:      USE maths

FUNCTION

    Contains subroutines required for standard mathematical operations on
    matrices and vectors. These subroutines are parallel and require MPI.
    
    Subroutine             Purpose

AUTHOR

    L. Margetts
    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

6.1. maths/determinant [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION: determinant

SYNOPSIS

    Usage:    determinant

FUNCTION

    Returns the determinant of a 1x1 2x2 3x3 jacobian matrix
    Source: "Programming the Finite Element Method"

INPUTS

    The following argument has the INTENT(IN) attribute:

    jac(:,:)       : Real
                   : Matrix whose determinant is to be computed

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

6.2. maths/dot_product_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   DOT_PRODUCT_P

SYNOPSIS

    Usage:      dot_product_p(r_pp)

FUNCTION

    Parallel version of the serial fortran intrinsic function dot_product.
    Each processor computes the local dot_product. A global sum is then
    performed across processors with the result being returned to all 
    processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    vectora(:)     : Real
                   : Chunk of vector a on each processor

    vectorb(:)     : Real
                   : Chunk of vector b on each processor

    The following arguments have the INTENT(OUT) attribute:

    dot_product_p  : Real
                   : Dot product of the distributed vectors a and b

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

6.3. maths/invert [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    SUBROUTINE: invert(matrix)

SYNOPSIS

    Usage:      CALL invert(matrix)

FUNCTION

    Invert a small square matrix onto itself.

AUTHOR

    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    (c) University of Manchester 2004-2010

6.4. maths/max_integer_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   MAX_INTEGER_P

SYNOPSIS

    Usage:      max_integer_p(n_pp)

FUNCTION

    Maximum value of an integer across processors
    Every process keeps the result

INPUTS

    The following arguments have the INTENT(IN) attribute:

    n_pp:          : Integer
                   : Integer on each processor

    The following arguments have the INTENT(OUT) attribute:

    n:             : Integer
                   : Maximum value across processors

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

6.5. maths/max_real_r [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   MAX_REAL_P

SYNOPSIS

    Usage:      max_real_p(r_pp)

FUNCTION

    Maximum value of a real across processors
    Every process keeps the result

INPUTS

    The following arguments have the INTENT(IN) attribute:

    r_pp:          : Real
                   : Real on each processor

    The following arguments have the INTENT(OUT) attribute:

    r:             : Real
                   : Maximum value across processors

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

6.6. maths/maxabsval_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   MAXABSVAL_P

SYNOPSIS

    Usage:      maxabsval_p(vectora)

FUNCTION

    Computes the maximum absolute value of the components of a distributed
    vector and then computes the maximum value across all vectors. 
    The result is returned to all processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    vectora(:)     : Real
                   : Chunk of vector a on each processor

    The following arguments have the INTENT(OUT) attribute:

    maxabsval_p    : Real
                   : Maximum absolute value of the components of the
                     vector

AUTHOR

    F. Calvo
    L. Margetts

COPYRIGHT

    (c) University of Manchester 2008-2010

6.7. maths/maxval_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   MAXVAL_P

SYNOPSIS

    Usage:      maxval_p(vectora)

FUNCTION

    Parallel version of the serial intrinsic fortran function MAXVAL.
    Computes the maximum value of the components of a distributed vector, 
    and then computes the maximum value across all vectors. The result
    is returned to all processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    vectora(:)     : Real
                   : Chunk of vector a on each processor

    The following arguments have the INTENT(OUT) attribute:

    maxval_p       : Real
                   : Maximum value of the components of the vector

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

6.8. maths/norm_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   NORM_P

SYNOPSIS

    Usage:      norm_p(vectora)

FUNCTION

    Calculates L2-norm of a distrubited vector
    Every process keeps the result

INPUTS

    The following arguments have the INTENT(IN) attribute:

    vectora(:)     : Real
                   : Chunk of vector a on each processor

    The following arguments have the INTENT(OUT) attribute:

    norm_p         : Real
                   : Norm of the vector

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

6.9. maths/sum_p [ Functions ]

[ Top ] [ maths ] [ Functions ]

NAME

    FUNCTION:   SUM_P

SYNOPSIS

    Usage:      sum_p(vectora)

FUNCTION

    Parallel version of the serial fortran instrinsic SUM. The function
    sums all the components of a distributed vector. The result of SUM_P
    is returned to all processors. This function requires MPI.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    vectora(:)     : Real
                   : Local part of vector stored on calling processor

    The following arguments have the INTENT(OUT) attribute:

    sum_p          : Real
                   : Sum of all the components of the vector

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2002-2010

7. /mp_interface [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: mp_interface

SYNOPSIS

    Usage:      USE mp_interface

FUNCTION

    Contains subroutines required to initialize MPI at the beginning
    of the calling program and finalize MPI at the end of the calling 
    program
    
    Subroutine             Purpose

    FIND_PE_PROCS          Find number of processors and own rank
    SHUTDOWN               Terminate MPI and STOP the program

AUTHOR

    L. Margetts
    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

7.1. mp_interface/find_pe_procs [ Functions ]

[ Top ] [ mp_interface ] [ Functions ]

NAME

    SUBROUTINE: find_pe_procs

SYNOPSIS

    Usage:      CALL find_pe_procs(num,numprocs)

FUNCTION

    Initialise MPI
    Get the rank of the processes and the total number of processes

INPUTS

    The following arguments have the INTENT(OUT) attribute:

    num                    : Integer
                           : Process number

    numprocs               : Integer
                           : Number of processes

AUTHOR

    M. Pettipher
    L. Margetts

COPYRIGHT

    (c) University of Manchester 2007-2010

8. /output [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: output

SYNOPSIS

    Usage:      USE output

FUNCTION

    Contains subroutines that write out the results. These subroutines are 
    parallel and require MPI.
    
    Subroutine             Purpose
    WRITE_P121             Writes out basic program data and timing info
    WRITE_P129             Writes out basic program data and timing info
    WRITE_NODAL_VARIABLE   Writes out results computed at the nodes
    JOB_NAME_ERROR         Writes error message if job_name is missing

AUTHOR

    L. Margetts

COPYRIGHT

    2004-2010 University of Manchester

8.1. output/job_name_error [ Functions ]

[ Top ] [ output ] [ Functions ]

NAME

    SUBROUTINE: job_name_error

SYNOPSIS

    Usage:      CALL job_name_error(numpe,program_name)

FUNCTION

    Generates error message if commandline argument is missing.

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2007-2010

8.2. output/write_nodal_variable [ Functions ]

[ Top ] [ output ] [ Functions ]

NAME

    SUBROUTINE: write_nodal_variable

SYNOPSIS

    Usage:      CALL write_nodal_variable(text,filnum,iload,nodes_pp, &
                                          numpe,numvar,stress) 

FUNCTION

    Write the values of a nodal variable to a file. This subroutine is 
    parallel and requires MPI. The master processor collects all the data
    from the slave processors.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    text                    : Character
                            : Text indicating the variable to write

    filnum                  : Integer
                            : File number to write

    iload                   : Integer
                            : Load step number

    nodes_pp                : Integer
                            : Number of nodes assigned to a process

    npes                    : Integer
                            : Number of processes

    numpe                   : Integer
                            : Process number

    numvar                  : Integer
                            : Number of components of the variable
                              (1-scalar, 3-vector, 6-tensor)

    stress(nodes_pp*numvar) : Real
                            : Nodal variables to print
                             

    The following arguments have the INTENT(OUT) attribute:

AUTHOR

    F. Calvo
    L. Margetts

CREATION DATE

    04.10.2007

COPYRIGHT

    (c) University of Manchester 2007-2010

8.3. output/write_p121 [ Functions ]

[ Top ] [ output ] [ Functions ]

NAME

    SUBROUTINE: write_p121

SYNOPSIS

    Usage:      CALL write_p121(iters,job_name,neq,nn,npes,nr,numpe,      &
                                timest,tload)

FUNCTION

    Master processor writes out brief details about the problem and 
    some performance data

INPUTS

    The following arguments have the INTENT(IN) attribute:

    iters                  : Integer
                           : Number of PCG iterations taken to solve problem

    job_name               : Character
                           : Job name used to name output file

    neq                    : Integer
                           : Total number of equations in the mesh

    nn                     : Integer
                           : Number of nodes in the mesh

    npes                   : Integer
                           : Number of processors used in the simulations

    nr                     : Integer
                           : Number of restrained nodes in the mesh

    numpe                  : Integer
                           : Processor number

    timest(:)              : Real array
                           : Holds timing information

    tload                  : Real
                           : Total applied load

AUTHOR

    Lee Margetts
    Based on Smith I.M. and Griffiths D.V. "Programming the Finite Element
    Method", Edition 4, Wiley, 2004.

CREATION DATE

    02.03.2010

COPYRIGHT

    (c) University of Manchester 2010

8.4. output/write_p129 [ Functions ]

[ Top ] [ output ] [ Functions ]

NAME

    SUBROUTINE: write_p129

SYNOPSIS

    Usage:      CALL write_p129(ans,job_name,neq,nn,npes,nr,numpe,        &
                                timest,tload,ttliters))

FUNCTION

    Master processor writes out brief details about the problem and 
    some performance data

INPUTS

    The following scalar character argument has the INTENT(IN) attribute:

    job_name               : Job name used to name output file

    The following scalar integer arguments have the INTENT(IN) attribute:

    neq                    : Number of equations
    nn                     : Number of nodes in the mesh
    npes                   : Number of processors used in the simulations
    nr                     : Number of restrained nodes
    numpe                  : Processor ID number

    The following scalar real argument has the INTENT(IN) attribute:

    tload                  : Total applied load

    The following real array arguments have the INTENT(IN) attribute:

    ans(:)                 : Holds a single displacement value at the 
                           : equation number "it" for each time step
    timest(:)              : Holds timing information
    ttliters(:)            : Records the number of iterations required by
                           : PCG for each time step

AUTHOR

    Lee Margetts

CREATION DATE

    26.02.2010

COPYRIGHT

    (c) University of Manchester 2010

9. /partition [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: partition

SYNOPSIS

    Usage:      USE partition

FUNCTION

    Contains subroutines required for subdividing a finite element problem
    over multiple processors.
    
    Subroutine             Purpose
    
    CALC_NODES_PP          Subdivide the nodes across processors

AUTHOR

    F. Calvo
    L. Margetts

COPYRIGHT

    2004-2010 University of Manchester

9.1. partition/calc_nodes_pp [ Functions ]

[ Top ] [ partition ] [ Functions ]

NAME

    SUBROUTINE: calc_nodes_pp

SYNOPSIS

    Usage:      CALL calc_nodes_pp(node_end,node_start,nn,npes,numpe, &
                                   nodes_pp)

FUNCTION

    Subdivide the nodes across the processors. Strategy similar to that
    found in CALC_NELS_PP and CALC_NEQ_PP.

INPUTS

    The following arguments have the INTENT(IN) attribute:

    nn                    : Integer
                          : Total number of nodes

    npes                  : Integer
                          : Number of processes

    numpe                 : Integer
                          : Processor number

    The following arguments have the INTENT(OUT) attribute:

    node_end              : Integer
                          : Last node stored in the process

    node_start            : Integer
                          : First node stored in the process

    nodes_pp              : Integer
                          : Number of nodes assigned to the process

AUTHOR

    F. Calvo

COPYRIGHT

    (c) University of Manchester 2007-2010

10. /pcg [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: pcg

SYNOPSIS

    Usage:      USE pcg

FUNCTION

    Contains subroutines required by the preconditioned conjugate gradient
    method. These subroutines are parallel and require MPI.
    
    Subroutine             Purpose

    CHECON_PAR             Convergence test

AUTHOR

    L. Margetts
    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

10.1. pcg/checon_par [ Functions ]

[ Top ] [ pcg ] [ Functions ]

NAME

    SUBROUTINE: checon_par

SYNOPSIS

    Usage:      CALL checon_par(loads,tol,converged,oldlds)

FUNCTION

    Parallel version of checon
    Sets converged to .false. if relative change in loads and
    oldlds is greater than tol and updates oldlds

INPUTS

    The following arguments have the INTENT(IN) attribute:

    loads(:)                 : Real
                             : Solution vector

    tol                      : Real
                             : Solution tolerance

    The following argument has the INTENT(INOUT) attribute:

    oldlds(:)                : Real
                             : The old solution vector

    The following argument has the INTENT(OUT) attribute:

    converged                : Logical
                             : Solution has converged if 
                               converged = .true.

    The following arguments have the INTENT(OUT) attribute:

    iters                    : Integer
                             : Number of PCG iterations

AUTHOR

    I.M. Smith and D.V. Griffiths
    Modified by L. Margetts

COPYRIGHT

    2004-2010 University of Manchester

11. /precision [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: precision

SYNOPSIS

    Usage:      USE precision

FUNCTION

    Sets IWP 

AUTHOR

    M.A. Pettipher

COPYRIGHT

    (c) University of Manchester 1996-2010

12. /steering [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: steering

SYNOPSIS

    Usage:      USE steering

FUNCTION

    Contains subroutines that relate equations or nodes to elements

    Subroutine             Purpose
    
    REARRANGE              Modifies REST array
    FIND_G                 Finds g from node numbers and restraints "rest"
    ABAQUS2SG              Swaps node order from Abaqus to S&G convention

AUTHOR

    F. Calvo
    L. Margetts

COPYRIGHT

    2004-2010 University of Manchester

12.1. steering/abaqus2sg [ Functions ]

[ Top ] [ steering ] [ Functions ]

NAME

    SUBROUTINE: abaqus2sg

SYNOPSIS

    Usage:      CALL abaqus2sg(element,g_num)

FUNCTION

    Converts the node steering array from the ABAQUS node ordering to 
    the ordering in Smith and Griffiths "Programming the Finite Element
    Method", 4th Edition. Works with both serial and parallel programs.

    For 20-node hexahedra, the conversion is:

    S&G   :   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
    Abaqus:   1  7 19 13  3  5 17 15  8 12 20  9  4 11 16 10  2  6 18 14 

INPUTS

AUTHOR

    L. Margetts

COPYRIGHT

    (c) University of Manchester 2009-2010

12.2. steering/find_g [ Functions ]

[ Top ] [ steering ] [ Functions ]

NAME

    SUBROUTINE: find_g

SYNOPSIS

    Usage:      CALL find_g(num,g,rest)

FUNCTION

    Finds g from node numbers and restraints "rest"

INPUTS

    The following argument has the INTENT(INOUT) attribute:

    rest                : Integer
                        : Array of restrained nodes
                        : Possible input values are 1 or 0
                        : 1 - unrestrained
                        : 0 - restrained

AUTHOR

    I.M Smith

COPYRIGHT

    (c) University of Manchester 2004-2010

12.3. steering/rearrange [ Functions ]

[ Top ] [ steering ] [ Functions ]

NAME

    SUBROUTINE: rearrange

SYNOPSIS

    Usage:      CALL rearrange(rest)

FUNCTION

    Modifies REST array, converting restrained flags into restrained
    equation numbers.   

INPUTS

    The following argument has the INTENT(INOUT) attribute:

    rest                : Integer
                        : Array of restrained nodes
                        : Possible input values are 1 or 0
                        : 1 - unrestrained
                        : 0 - restrained

AUTHOR

    I.M Smith

COPYRIGHT

    (c) University of Manchester 2004-2010

13. /timing [ Modules ]

[ Top ] [ Modules ]

NAME

    MODULE: timing

SYNOPSIS

    Usage:      USE timing

FUNCTION

    Contains subroutines used for timing purposes. These require MPI.
    
    Subroutine             Purpose

    ELAP_TIME              Computes wall clock time

AUTHOR

    L. Margetts
    M. Pettipher
    I.M. Smith
    D.V. Griffiths

COPYRIGHT

    2004-2010 University of Manchester

13.1. timing/elap_time [ Functions ]

[ Top ] [ timing ] [ Functions ]

NAME

    SUBROUTINE: elap_time

SYNOPSIS

    Usage:      CALL elap_time()

FUNCTION

    Returns the wall clock time

AUTHOR

    M. Pettipher
    L. Margetts

COPYRIGHT

    2004-2010 University of Manchester