# fmurge.F90

Example that generate A Laplacian with multiple degrees of freedom and solves it.

That example only works with the -DDISTRIBUTED option.

The laplacian looks like :

   1       0                      ... 0
-2(n-1)  (n-1)  -2(n-1)   0       ... 0
0    -2(n-1)  (n-1)  -2(n-1) 0 ... 0
....
....
0 ...              -2(n-1)  n-1  -2(n-1)
0 ...                        0     1

The Right-hand-side member is defined by $$RHS_i = - 4\pi^2 sin(2\pi x)$$

The solution should be $$X_i = sin(2\pi x)$$

The solution is stored in the file “result.plot” that can be ploted using

gnuplot> plot "./result.plot" u 2:3 t "reference", "./result.plot" u 2:4 t "Result, first degree of freedom"

#### Usage

./fmurge <size> <DofNbr>

#### Authors

 Pascal JACQ ja.nosp@m.cq@labr.nosp@m.i.fr Xavier LACOSTE lac.nosp@m.oste@labr.nosp@m.i.fr
Summary
 fmurge.F90 Example that generate A Laplacian with multiple degrees of freedom and solves it. GetCoef Computes the value for a given coefficient. GetRhs computes the value of a coefficient of the Right-hand-side member. store Write the solution into a file result.plot.

## GetCoef

 SUBROUTINE GetCoef( val, i, j, xmin, xmax, n )

Computes the value for a given coefficient.

#### Parameters

 val Value to set i Row of the coefficient. j Column of the coefficient. xmin Minimum value of the interval. xmax Maximum value of the interval. n Number of points in the interval.

## GetRhs

 SUBROUTINE GetRhs( val, i, xmin, xmax, n )

computes the value of a coefficient of the Right-hand-side member.

#### Parameters

 val Value to set. i Index of the value. xmin Minimum value of the interval. xmax Maximum value of the interval. n Number of points in the interval.

## store

 SUBROUTINE store( sol, xmin, xmax, dof )

Write the solution into a file result.plot.

The file contains :

k x sin(2 \pi x) sol(k:k+dofnbr-1)

Where k goes from 1 to n*dofnbr, dofnbr by dofnbr and x goes from xmin to xmax, with a step of (xmax - xmin) / (n-1).

#### Parameters

 sol The solution of the problem xmin The minimum value of the interval. xmax The maximum value of the interval. dof The Number of degree of freedom.
 SUBROUTINE GetCoef( val, i, j, xmin, xmax, n )
Computes the value for a given coefficient.
 SUBROUTINE GetRhs( val, i, xmin, xmax, n )
computes the value of a coefficient of the Right-hand-side member.
 SUBROUTINE store( sol, xmin, xmax, dof )
Write the solution into a file result.plot.