SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
The subroutine init_temperature

It is used to initialize the temperature.

Inputs and outputs

The inputs of this function are the following:

  1. mesh is the finite element mesh used to approximate the temperature.
  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 the 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. tempn_m1 is the temperature at the time time-dt.
  3. tempn is the temperature at the time time.

We note that the temperature is a real valued scalar so its format is real value a tabular of three columns of dimension (mesh%np,2,SIZE(list_mode)). We remind that mesh%np is the number of nodes of the finite element mesh.


Here is an exemple where we use the function temperature_exact (so initial conditions satisfy the boundary conditions).

time = 0.d0
DO i= 1, SIZE(list_mode)
mode = list_mode(i)
DO j = 1, 2
tempn_m1(:,j,i) = temperature_exact(j, mesh%rr, mode, time-dt)
tempn (:,j,i) = temperature_exact(j, mesh%rr, mode, time)

We note that the integer mode, i and j 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.