Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
szaghi committed Apr 10, 2017
2 parents 4cee9ce + abc9742 commit ad2d202
Show file tree
Hide file tree
Showing 32 changed files with 1,223 additions and 1,266 deletions.
16 changes: 8 additions & 8 deletions fobos
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ $EXDIRS = FACE/src/tests FACE/src/third_party/
# GNU
[shared-gnu]
template = template-shared-gnu
target = wenoof.f90
target = wenoof.F90
build_dir = ./shared/
output = libwenoof.so
mklib = shared

[static-gnu]
template = template-static-gnu
target = wenoof.f90
target = wenoof.F90
build_dir = ./static/
output = libwenoof.a
mklib = static

[shared-gnu-debug]
template = template-shared-gnu-debug
target = wenoof.f90
target = wenoof.F90
build_dir = ./shared/
output = libwenoof.so
mklib = shared

[static-gnu-debug]
template = template-static-gnu-debug
target = wenoof.f90
target = wenoof.F90
build_dir = ./static/
output = libwenoof.a
mklib = static
Expand All @@ -63,28 +63,28 @@ build_dir = ./exe/
# Intel
[shared-intel]
template = template-shared-intel
target = wenoof.f90
target = wenoof.F90
build_dir = ./shared/
output = libwenoof.so
mklib = shared

[static-intel]
template = template-static-intel
target = wenoof.f90
target = wenoof.F90
build_dir = ./static/
output = libwenoof.a
mklib = static

[shared-intel-debug]
template = template-shared-intel-debug
target = wenoof.f90
target = wenoof.F90
build_dir = ./shared/
output = libwenoof.so
mklib = shared

[static-intel-debug]
template = template-static-intel-debug
target = wenoof.f90
target = wenoof.F90
build_dir = ./static/
output = libwenoof.a
mklib = static
Expand Down
38 changes: 22 additions & 16 deletions src/lib/abstract_objects/wenoof_alpha_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ module wenoof_alpha_object
#else
use penf, only: RPP=>R8P
#endif
use wenoof_base_object
use wenoof_beta_object
use wenoof_kappa_object
use wenoof_base_object, only : base_object, base_object_constructor

implicit none
private
Expand All @@ -23,24 +21,32 @@ module wenoof_alpha_object

type, extends(base_object), abstract :: alpha_object
!< Abstract alpha (non linear weights) object.
real(RPP), allocatable :: values_rank_1(:) !< Alpha values [0:S-1].
real(RPP) :: values_sum_rank_1 !< Sum of alpha coefficients.
real(RPP), allocatable :: values_rank_2(:,:) !< Alpha values [1:2,0:S-1].
real(RPP), allocatable :: values_sum_rank_2(:) !< Sum of alpha coefficients [1:2].
contains
! public methods
generic :: compute => compute_int, compute_rec !< Compute alpha.
! public deferred methods
procedure(compute_interface), pass(self), deferred :: compute !< Compute alpha.
procedure(compute_int_interface), pass(self), deferred :: compute_int !< Compute alpha (interpolate).
procedure(compute_rec_interface), pass(self), deferred :: compute_rec !< Compute alpha (reconstruct).
endtype alpha_object

abstract interface
!< Abstract interfaces of [[alpha_object]].
pure subroutine compute_interface(self, beta, kappa)
!< Compute alpha.
import :: alpha_object, beta_object, kappa_object
class(alpha_object), intent(inout) :: self !< Alpha.
class(beta_object), intent(in) :: beta !< Beta.
class(kappa_object), intent(in) :: kappa !< Kappa.
endsubroutine compute_interface
endinterface
pure subroutine compute_int_interface(self, beta, kappa, values)
!< Compute alpha (interpolate).
import :: alpha_object, RPP
class(alpha_object), intent(in) :: self !< Alpha.
real(RPP), intent(in) :: beta(0:) !< Beta [0:S-1].
real(RPP), intent(in) :: kappa(0:) !< Kappa [0:S-1].
real(RPP), intent(out) :: values(0:) !< Alpha values [0:S-1].
endsubroutine compute_int_interface

pure subroutine compute_rec_interface(self, beta, kappa, values)
!< Compute alpha (reconstruct).
import :: alpha_object, RPP
class(alpha_object), intent(in) :: self !< Alpha.
real(RPP), intent(in) :: beta(1:,0:) !< Beta [1:2,0:S-1].
real(RPP), intent(in) :: kappa(1:,0:) !< Kappa [1:2,0:S-1].
real(RPP), intent(out) :: values(1:,0:) !< Alpha values [1:2,0:S-1].
endsubroutine compute_rec_interface
endinterface
endmodule wenoof_alpha_object
7 changes: 4 additions & 3 deletions src/lib/abstract_objects/wenoof_base_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ subroutine create_interface(self, constructor)
class(base_object_constructor), intent(in) :: constructor !< Object constructor.
endsubroutine create_interface

pure function description_interface(self) result(string)
pure function description_interface(self, prefix) result(string)
!< Return object string-description.
import :: base_object
class(base_object), intent(in) :: self !< Object.
character(len=:), allocatable :: string !< String-description.
class(base_object), intent(in) :: self !< Object.
character(len=*), intent(in), optional :: prefix !< Prefixing string.
character(len=:), allocatable :: string !< String-description.
endfunction description_interface

elemental subroutine destroy_interface(self)
Expand Down
33 changes: 16 additions & 17 deletions src/lib/abstract_objects/wenoof_beta_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module wenoof_beta_object
#else
use penf, only: RPP=>R8P
#endif
use wenoof_base_object
use wenoof_base_object, only : base_object, base_object_constructor

implicit none
private
Expand All @@ -20,31 +20,30 @@ module wenoof_beta_object

type, extends(base_object), abstract :: beta_object
!< Abstract Beta coefficients (smoothness indicators of stencil interpolations) object.
real(RPP), allocatable :: values_rank_1(:) !< Beta values [0:S-1].
real(RPP), allocatable :: values_rank_2(:,:) !< Beta values [1:2,0:S-1].
contains
! public methods
generic :: compute => compute_with_stencil_of_rank_1, compute_with_stencil_of_rank_2
generic :: compute => compute_int, compute_rec !< Compute beta.
! deferred public methods
procedure(compute_with_stencil_of_rank_1_interface), pass(self), deferred :: compute_with_stencil_of_rank_1!< Compute beta.
procedure(compute_with_stencil_of_rank_2_interface), pass(self), deferred :: compute_with_stencil_of_rank_2!< Compute beta.
procedure(compute_int_interface), pass(self), deferred :: compute_int !< Compute beta (interpolate).
procedure(compute_rec_interface), pass(self), deferred :: compute_rec !< Compute beta (reconstruct).
endtype beta_object

abstract interface
!< Abstract interfaces of [[beta_object]].
pure subroutine compute_with_stencil_of_rank_1_interface(self, stencil)
!< Compute beta.
pure subroutine compute_int_interface(self, stencil, values)
!< Compute beta (interpolate).
import :: beta_object, RPP
class(beta_object), intent(inout) :: self !< Beta.
real(RPP), intent(in) :: stencil(1-self%S:) !< Stencil used for the interpolation, [1-S:-1+S].
endsubroutine compute_with_stencil_of_rank_1_interface
class(beta_object), intent(in) :: self !< Beta.
real(RPP), intent(in) :: stencil(1-self%S:) !< Stencil used for the interpolation, [1-S:-1+S].
real(RPP), intent(out) :: values(0:) !< Beta values [0:S-1].
endsubroutine compute_int_interface

pure subroutine compute_with_stencil_of_rank_2_interface(self, stencil)
!< Compute beta.
pure subroutine compute_rec_interface(self, stencil, values)
!< Compute beta (reconstruct).
import :: beta_object, RPP
class(beta_object), intent(inout) :: self !< Beta.
real(RPP), intent(in) :: stencil(1:,1-self%S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
endsubroutine compute_with_stencil_of_rank_2_interface
class(beta_object), intent(in) :: self !< Beta.
real(RPP), intent(in) :: stencil(1:,1-self%S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
real(RPP), intent(out) :: values(1:,0:) !< Beta values [1:2,0:S-1].
endsubroutine compute_rec_interface
endinterface

endmodule wenoof_beta_object
37 changes: 18 additions & 19 deletions src/lib/abstract_objects/wenoof_interpolations_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module wenoof_interpolations_object
#else
use penf, only: RPP=>R8P
#endif
use wenoof_base_object
use wenoof_base_object, only : base_object, base_object_constructor

implicit none
private
Expand All @@ -16,37 +16,36 @@ module wenoof_interpolations_object

type, extends(base_object_constructor), abstract :: interpolations_object_constructor
!< Abstract interpolations object constructor.
real(RPP), allocatable :: stencil(:) !< Stencil used for interpolation, [1-S:S-1].
real(RPP) :: x_target !< Coordinate of the interpolation point.
real(RPP), allocatable :: stencil(:) !< Stencil used for interpolation, [1-S:S-1].
real(RPP) :: x_target !< Coordinate of the interpolation point.
endtype interpolations_object_constructor

type, extends(base_object), abstract :: interpolations_object
!< Abstract interpolations object.
real(RPP), allocatable :: values_rank_1(:) !< Stencil interpolations values [0:S-1].
real(RPP), allocatable :: values_rank_2(:,:) !< Stencil interpolations values [1:2,0:S-1].
contains
! public methods
generic :: compute => compute_with_stencil_of_rank_1, compute_with_stencil_of_rank_2
generic :: compute => compute_int, compute_rec !< Compute interpolations.
! deferred public methods
procedure(compute_with_stencil_of_rank_1_interface), pass(self), deferred :: compute_with_stencil_of_rank_1!< Compute interp.
procedure(compute_with_stencil_of_rank_2_interface), pass(self), deferred :: compute_with_stencil_of_rank_2!< Compute interp.
procedure(compute_int_interface), pass(self), deferred :: compute_int !< Compute interpolations (interpolate).
procedure(compute_rec_interface), pass(self), deferred :: compute_rec !< Compute interpolations (reconstruct).
endtype interpolations_object

abstract interface
!< Abstract interfaces of [[interpolations_object]].
pure subroutine compute_with_stencil_of_rank_1_interface(self, stencil)
!< Compute interpolations.
pure subroutine compute_int_interface(self, stencil, values)
!< Compute interpolations (interpolate).
import :: interpolations_object, RPP
class(interpolations_object), intent(inout) :: self !< Interpolations.
real(RPP), intent(in) :: stencil(1-self%S:) !< Stencil used for the interpolation, [1-S:-1+S].
endsubroutine compute_with_stencil_of_rank_1_interface
class(interpolations_object), intent(in) :: self !< Interpolations.
real(RPP), intent(in) :: stencil(1-self%S:) !< Stencil used for the interpolation, [1-S:-1+S].
real(RPP), intent(out) :: values(0:) !< Interpolations values.
endsubroutine compute_int_interface

pure subroutine compute_with_stencil_of_rank_2_interface(self, stencil)
!< Compute interpolations.
pure subroutine compute_rec_interface(self, stencil, values)
!< Compute interpolations (reconstruct).
import :: interpolations_object, RPP
class(interpolations_object), intent(inout) :: self !< Interpolations.
real(RPP), intent(in) :: stencil(1:,1-self%S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
endsubroutine compute_with_stencil_of_rank_2_interface
class(interpolations_object), intent(in) :: self !< Interpolations.
real(RPP), intent(in) :: stencil(1:,1-self%S:) !< Stencil used for the interpolation, [1:2, 1-S:-1+S].
real(RPP), intent(out) :: values(1:, 0:) !< Interpolations values.
endsubroutine compute_rec_interface
endinterface

endmodule wenoof_interpolations_object
79 changes: 37 additions & 42 deletions src/lib/abstract_objects/wenoof_interpolator_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module wenoof_interpolator_object
#else
use penf, only: RPP=>R8P
#endif
use wenoof_base_object
use wenoof_interpolations_object
use wenoof_weights_object
use wenoof_base_object, only : base_object, base_object_constructor
use wenoof_interpolations_object, only : interpolations_object, interpolations_object_constructor
use wenoof_weights_object, only : weights_object, weights_object_constructor

implicit none
private
Expand All @@ -32,56 +32,51 @@ module wenoof_interpolator_object
class(weights_object), allocatable :: weights !< Weights of interpolations.
contains
! public methods
generic :: interpolate => interpolate_with_stencil_of_rank_1_debug, interpolate_with_stencil_of_rank_2_debug, &
interpolate_with_stencil_of_rank_1_standard, interpolate_with_stencil_of_rank_2_standard
generic :: interpolate => interpolate_int_debug, interpolate_rec_debug, &
interpolate_int_standard, interpolate_rec_standard !< Interpolate.
! public deferred methods
procedure(interpolate_with_stencil_of_rank_1_debug_interface), pass(self), &
deferred :: interpolate_with_stencil_of_rank_1_debug
procedure(interpolate_with_stencil_of_rank_2_debug_interface), pass(self), &
deferred :: interpolate_with_stencil_of_rank_2_debug
procedure(interpolate_with_stencil_of_rank_1_standard_interface), pass(self), &
deferred :: interpolate_with_stencil_of_rank_1_standard
procedure(interpolate_with_stencil_of_rank_2_standard_interface), pass(self), &
deferred :: interpolate_with_stencil_of_rank_2_standard
procedure(interpolate_int_debug_interface), pass(self), deferred :: interpolate_int_debug !< Interpolate (int) debug.
procedure(interpolate_int_standard_interface), pass(self), deferred :: interpolate_int_standard !< Interpolate (int) standard.
procedure(interpolate_rec_debug_interface), pass(self), deferred :: interpolate_rec_debug !< Interpolate (rec) debug.
procedure(interpolate_rec_standard_interface), pass(self), deferred :: interpolate_rec_standard !< Interpolate (rec) standard.
endtype interpolator_object

abstract interface
!< Abstract interfaces of [[interpolator_object]].
pure subroutine interpolate_with_stencil_of_rank_1_debug_interface(self, stencil, interpolation, si, weights)
!< Interpolate values (providing also debug values).
pure subroutine interpolate_int_debug_interface(self, stencil, interpolation, si, weights)
!< Interpolate (interpolate) values (providing also debug values).
import :: interpolator_object, RPP
class(interpolator_object), intent(inout) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1 - self%S:) !< Stencil of the interpolation [1-S:-1+S].
real(RPP), intent(out) :: interpolation !< Result of the interpolation.
real(RPP), intent(out) :: si(0:) !< Computed values of smoothness indicators [0:S-1].
real(RPP), intent(out) :: weights(0:) !< Weights of the stencils, [0:S-1].
endsubroutine interpolate_with_stencil_of_rank_1_debug_interface
class(interpolator_object), intent(in) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1 - self%S:) !< Stencil of the interpolation [1-S:-1+S].
real(RPP), intent(out) :: interpolation !< Result of the interpolation.
real(RPP), intent(out) :: si(0:) !< Computed values of smoothness indicators [0:S-1].
real(RPP), intent(out) :: weights(0:) !< Weights of the stencils, [0:S-1].
endsubroutine interpolate_int_debug_interface

pure subroutine interpolate_with_stencil_of_rank_2_debug_interface(self, stencil, interpolation, si, weights)
!< Interpolate values (providing also debug values).
pure subroutine interpolate_int_standard_interface(self, stencil, interpolation)
!< Interpolate (interpolate) values (without providing debug values).
import :: interpolator_object, RPP
class(interpolator_object), intent(inout) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1:, 1 - self%S:) !< Stencil of the interpolation [1:2, 1-S:-1+S].
real(RPP), intent(out) :: interpolation(1:) !< Result of the interpolation, [1:2].
real(RPP), intent(out) :: si(1:, 0:) !< Computed values of smoothness indicators [1:2, 0:S-1].
real(RPP), intent(out) :: weights(1:, 0:) !< Weights of the stencils, [1:2, 0:S-1].
endsubroutine interpolate_with_stencil_of_rank_2_debug_interface
class(interpolator_object), intent(in) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1 - self%S:) !< Stencil of the interpolation [1-S:-1+S].
real(RPP), intent(out) :: interpolation !< Result of the interpolation.
endsubroutine interpolate_int_standard_interface

pure subroutine interpolate_with_stencil_of_rank_1_standard_interface(self, stencil, interpolation)
!< Interpolate values (without providing debug values).
pure subroutine interpolate_rec_debug_interface(self, stencil, interpolation, si, weights)
!< Interpolate (reconstruct) values (providing also debug values).
import :: interpolator_object, RPP
class(interpolator_object), intent(inout) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1 - self%S:) !< Stencil of the interpolation [1-S:-1+S].
real(RPP), intent(out) :: interpolation !< Result of the interpolation.
endsubroutine interpolate_with_stencil_of_rank_1_standard_interface
class(interpolator_object), intent(in) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1:, 1 - self%S:) !< Stencil of the interpolation [1:2, 1-S:-1+S].
real(RPP), intent(out) :: interpolation(1:) !< Result of the interpolation, [1:2].
real(RPP), intent(out) :: si(1:, 0:) !< Computed values of smoothness indicators [1:2, 0:S-1].
real(RPP), intent(out) :: weights(1:, 0:) !< Weights of the stencils, [1:2, 0:S-1].
endsubroutine interpolate_rec_debug_interface

pure subroutine interpolate_with_stencil_of_rank_2_standard_interface(self, stencil, interpolation)
!< Interpolate values (without providing debug values).
pure subroutine interpolate_rec_standard_interface(self, stencil, interpolation)
!< Interpolate (reconstruct) values (without providing debug values).
import :: interpolator_object, RPP
class(interpolator_object), intent(inout) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1:, 1 - self%S:) !< Stencil of the interpolation [1:2, 1-S:-1+S].
real(RPP), intent(out) :: interpolation(1:) !< Result of the interpolation, [1:2].
endsubroutine interpolate_with_stencil_of_rank_2_standard_interface
class(interpolator_object), intent(in) :: self !< Interpolator.
real(RPP), intent(in) :: stencil(1:, 1 - self%S:) !< Stencil of the interpolation [1:2, 1-S:-1+S].
real(RPP), intent(out) :: interpolation(1:) !< Result of the interpolation, [1:2].
endsubroutine interpolate_rec_standard_interface
endinterface

endmodule wenoof_interpolator_object
Loading

0 comments on commit ad2d202

Please sign in to comment.