I wrote up a C language pseudocode description. I've never used time like this in C, by the way.
I would like 100 seconds of a heat source. And then the heat source to be 0, because I want to see how the object cools down.
note I use "++" (integer incrementation notation), yet I need more precision.
for example time_ON will be 1.2345
Code: Select all
double Period = 10;
double time = 0;
double time_ON = 4.567
while (time < 100)
{
double tpulse = 0;
for ( ; tpulse < time_ON && time < 100; tpulse++, time++)
{
Heat Source = (...)
}
for ( ; tpulse < Period && time < 100; tpulse++, time++)
{
Heat Source = (...)
}
}
Heat Source = 0
Heat Source = Variable coordinate 1, coordinate 2, coordinate 3, time
Procedure "mymodule" "myprocedure"
where "mymodule" is a .f90 file and "myprocedure" is a FUNCTION in fortran90
Compile with
$ elmerf90 -o mymodule.so mymodule.f90 or
> elmerf90 -o mymodule.dll mymodule.f90