So
I learned some fortran.
I tried to understand the user defined functions that are compiled with elmer
I have some question. I'll use this example file and code
fortranfile.f90
Code: Select all
function heatfunction(Model, n, time) result(heat) //
use DefUtils
use Types
type(Model_t) :: Model
integer :: n
real(kind = dp) :: time, heat
heat = ...
end function heatfunction
Within case.sif
Code: Select all
Heat Source = Variable time
Procedure "HeatSourceFile" "heatfunction"
2. Can I use multiple variables: Heat Source = Variable coordinate 1, coordinate 2, time. Correspondingly: function heatfunction(Model, n, xcoor, ycoor, time), or is that incorrect.
Bonus/Extra
3. I'm interested; In general, can you give a super simplified brief explanation of why these files may be included, DefUtils and Types. All I know is that these are where Model_t may come from.
4. I wonder how the code in case.sif
Code: Select all
Heat Source = Variable time
Procedure "HeatSourceFile" "heatfunction"
Code: Select all
function heatfunction(Model, n, time) result(heat)
Thanks for helping!
Have a great day!