#### FORMULs of SUBROUTINE MATRIX

##### MATMAS

FORMUL = 'MATMAS '

Mass-matrix. ##### MATDIF

FORMUL = 'MATDIF '

Diffusion matrix with different coefficients according to the directions x, y and z.

In 2 dimensions – isotropic: The case of an isotropic viscosity is given above. But the viscosity may also be tensorial. In this case U (a BIEF_OBJ structure) must have a second dimension, for example 3- in 2-dimensional applications. U will have the general form: but the tensor is symmetric and .

Elements of the tensor must be stored in U as follows:

• in U(*,1)
• in U(*,2)
• in U(*,3)

In a 2 dimensions – non isotropic: When a transversal K_t and longitudinal K_l dispersion are used (case of Elder's turbulence model), the formula giving the tensor U is:

• • • In 3 dimensions (beware, F, G and H are used in this case, unlike in 2D where U, V and W are used): ##### MATDIF2

FORMUL = 'MATDIF2 '

In 3D only, formula MATDIF2 is like MATDIF, but the hydrostatic inconsistencies are dealt with.

##### MATDIF3

FORMUL = 'MATDIF3 '

In 2D only so far, diffusion matrix with diffusion coefficients which are piece-wise linear or constant, but may be discontinuous between elements (this is used in groundwater flows). Here one must have :

• U%ELM=10, U%DIM2=3, U%DIMDISC=11
• V%ELM=10, V%DIM2=3, V%DIMDISC=11
##### MASUPG

FORMUL = 'MASUPG '

Matrix used for the convection term with method SUPG option 1. • here is a vector with the components F, G and H.
• is a vector with the components U, V and W.
##### MAUGUG

FORMUL = 'MAUGUG '

Matrix used for the convection term with method SUPG option 2. • is a vector with the components U, V and W.
##### MATVGR

FORMUL = 'MATVGR '

Matrix used for the convection term with centred discretisation. • is a vector with the components U, V and W.
##### FMATMA

FORMUL = 'FMATMA '

Matrix used for conservative smoothing. ##### MSLUMP

FORMUL = 'MSLUMP '

Mass matrix with local mass-lumping. Here, F must be a P0 function, that is, constant for each element. If the value of F is locally 0, the mass-matrix will be locally lumped into a diagonal.

##### MATFGR

FORMUL = 'MATFGR X' Beware the minus sign !!!!

If FORMUL(16:16) is equal to 'Y' or 'Z' instead of 'X' , the derivatives will be obtained according to y or z.

##### MATQGR

FORMUL = 'MATQGR ' (not programmed yet) ##### MATGRF

FORMUL = 'MATGRF X' Beware the minus sign !!!!

If FORMUL(16:16) is equal to 'Y' or 'Z' instead of 'X' , the derivatives will be obtained according to y or z.

##### MATUGH

FORMUL = 'MATUGH X'

Matrix used for the method SUPG, options 1 and 2. If FORMUL(16:16) is equal to 'Y' or 'Z' instead of 'X' , the derivatives will be obtained according to y or z.

• is a vector with the components U, V and W.
##### MATGRA

FORMUL = 'MATGRA X' If FORMUL(16:16) is equal to 'Y' or 'Z' instead of 'X' , the derivatives will be obtained according to y or z.

##### MAMURD PSI and MAMURD2 PSI

FORMUL = 'MAMURD PSI'</u> or <u>FORMUL = 'MAMURD2 PSI'

Distribution matrix in case of use of the Multidimensional Upwind Residual Distribution scheme in 3D. See reference  for more details.

If FORMUL(14:16) is equal to ' N' instead of 'PSI' the matrix will be assembled.

##### FFBT

FORMUL = 'FFBT '

This is in fact a series of different matrices and the string FORMUL(8:16) is also used for defining the formula. For example if FORMUL(8:16)=' 0XX0' , the matrix will be: Explanation: the term in the integral is a product of 4 terms based, for the first 2, on the vector F, and then on the Basis function called here B and the test function called T.

• If the first character is 0, the first term will be F.
• If the first character is X, the first term will be • * If the first character is Y, the first term will be Then we proceed to second character and again function F, to third character and function , to fourth character and function The combinations 0XX0, 0YY0, XX00, 0X0Y, XY00, YY00, 0Y0X have so far been implemented. The formula FORMUL(8:16)='00XX+00YY' is also available. Note that missing combinations can be obtained because the first two characters can be exchanged. Moreover exchanging the last two characters gives the transposed matrix of the previous formula.

#### SUBROUTINE by names

The existing subroutines building matrices in version 6.+ are the following, their function can be deduced from the explanations above:

mt01aa.f mt01bb.f mt01cc.f mt01oo.f mt01pp.f
mt01tt.f mt02aa.f mt02aa_2.f mt02bb.f mt02cc.f
mt02pp.f mt02pt.f mt02tt.f mt03aa.f mt03bb.f
mt03cc.f mt04aa.f mt04bb.f mt04cc.f mt04pp.f
mt04tt.f mt05aa.f mt05bb.f mt05cc.f mt05pp.f
mt05tt.f mt06aa.f mt06bb.f mt06cc.f mt06ff.f
mt06ft.f mt06ft2.f mt06oo.f mt06oc.f mt06pp.f
mt06tt.f mt07aa.f mt07bb.f mt07cc.f mt08aa.f
mt08ab.f mt08ac.f mt08ba.f mt08bb.f mt08pp.f
mt08tt.f mt11aa.f mt11ab.f mt11ac.f mt11ba.f
mt11bb.f mt12aa.f mt12ab.f mt12ac.f mt12ba.f
mt12bb.f mt13aa.f mt13ab.f mt13ba.f mt13bb.f
mt13cc.f mt13ca.f mt14pp.f mt99aa.f