SFEMaNS  version 4.1 (work in progress) Reference documentation for SFEMaNS
The subroutine init_level_set

It is used to initialize the level set involved for multiphase problem with variable density or dynamical viscosity.

### Inputs and outputs

The inputs of this function are the following:

1. pp_mesh is the finite element mesh used to approximate the level set.
2. dt is the time step.
3. list_mode is a list of integers which contains the Fourier modes approximated.

As the mesh can be subdivised, we note that pp_mesh depends of the processor considered when doing parallel computing. Same goes for the list of Fourier mode list_mode.

The outputs of this function are the following:

1. time is the time when the computations starts.
2. level_set_m1 is the level set at the time time-dt.
3. level_set is the level set at the time time.

We note that the level set is a list of real valued scalar functions (one scalar per interface between fluids). So its format is a real valued tabular of four columns of dimension (inputs%nb_fluid -1,pp_mesh%np,2,SIZE(list_mode)). We remind that pp_mesh%np is the number of nodes of the finite element mesh. The integer inputs%nb_fluid is the number of immiscible fluids (only used for multiphase problem).

### Exemple

Here is an exemple where we use the function level_set_exact to initialize the level set.

time = 0.d0
DO i= 1, SIZE(list_mode)
mode = list_mode(i)
DO j = 1, 2
!===level_set
DO n = 1, inputs%nb_fluid -1
level_set_m1(n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time-dt)
level_set (n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time)
END DO
END DO
END DO
RETURN

We note that the integer mode, i, j and n need to be declared. It is done by adding the following line in the declaration of the function init_temperature:

INTEGER :: mode, i, j

We refer to the sections Examples with manufactured solutions and Examples on physical problems for more examples.