-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from FluidNumerics/bugfix/fpm_tests
Fix fpm tests program and add fpm tests to ci
- Loading branch information
Showing
7 changed files
with
138 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
program array_with_array_eval | ||
|
||
use FEQParse | ||
|
||
implicit none | ||
integer,parameter :: N = 10000000 | ||
type(EquationParser) :: f | ||
character(LEN=1),dimension(1) :: independentVars | ||
character(LEN=30) :: eqChar | ||
real :: x(1:N,1) | ||
real :: feval(1:N) | ||
integer :: i | ||
real :: t1,t2 | ||
|
||
! Specify the independent variables | ||
independentVars = (/'x'/) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \exp( -(x^2) )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar,independentVars) | ||
|
||
! Evaluate the equation | ||
call cpu_time(t1) | ||
do i = 1,N | ||
x(i,1) = -1.0_real32 + (2.0_real32)/real(N,real32)*real(i - 1,real32) | ||
end do | ||
feval = f % evaluate(x) | ||
call cpu_time(t2) | ||
print *, "runtime :", (t2 - t1)," s" | ||
|
||
! Clean up memory | ||
call f % Destruct() | ||
|
||
end program array_with_array_eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
program array_with_scalar_eval | ||
|
||
use FEQParse | ||
|
||
implicit none | ||
integer,parameter :: N = 100000 | ||
type(EquationParser) :: f | ||
character(LEN=1),dimension(1) :: independentVars | ||
character(LEN=30) :: eqChar | ||
real :: x(1) | ||
real :: feval(1:N) | ||
integer :: i | ||
real :: t1,t2 | ||
|
||
! Specify the independent variables | ||
independentVars = (/'x'/) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \exp( -(x^2) )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar,independentVars) | ||
|
||
! Evaluate the equation | ||
call cpu_time(t1) | ||
do i = 1,N | ||
x(1) = -1.0_real32 + (2.0_real32)/real(N,real32)*real(i - 1,real32) | ||
feval(i) = f % evaluate(x) | ||
end do | ||
call cpu_time(t2) | ||
print *, "runtime :", (t2 - t1)," s" | ||
|
||
! Clean up memory | ||
call f % Destruct() | ||
|
||
end program array_with_scalar_eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
program scalar_with_scalar_eval | ||
|
||
use FEQParse | ||
|
||
implicit none | ||
type(EquationParser) :: f | ||
character(LEN=1),dimension(1) :: independentVars | ||
character(LEN=30) :: eqChar | ||
real :: x(1) | ||
|
||
! Specify the independent variables | ||
independentVars = (/'x'/) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \exp( -(x^2) )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar,independentVars) | ||
|
||
! Evaluate the equation | ||
x(1) = 0.0 | ||
print*, f % evaluate(x) | ||
|
||
! Clean up memory | ||
call f % Destruct() | ||
|
||
end program scalar_with_scalar_eval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters