Skip to content

Commit 71157f6

Browse files
committed
Merge branch 'release/0.1.0'
2 parents 686554a + 62d3523 commit 71157f6

18 files changed

+1849
-500
lines changed

fobos

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ modes = shared-gnu static-gnu shared-gnu-debug static-gnu-debug
33
shared-intel static-intel shared-intel-debug static-intel-debug
44
tests-gnu tests-gnu-debug
55
tests-intel tests-intel-debug
6+
tests-pgi tests-pgi-debug
67

78
[common-variables]
89
$CSHARED_GNU = -cpp -c -fPIC -frealloc-lhs
910
$CSHARED_INT = -cpp -c -fpic -assume realloc_lhs
1011
$LSHARED = -shared
1112
$CSTATIC_GNU = -cpp -c -frealloc-lhs
1213
$CSTATIC_INT = -cpp -c -assume realloc_lhs
14+
$CSTATIC_PGI = -c -Mallocatable=03
1315
$DEBUG_GNU = -O0 -g3 -Warray-bounds -Wcharacter-truncation -Wline-truncation -Wimplicit-interface -Wimplicit-procedure -Wunderflow -fcheck=all -fmodule-private -ffree-line-length-132 -fimplicit-none -fbacktrace -fdump-core -finit-real=nan -std=f2008 -fall-intrinsics
1416
$DEBUG_INT = -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces#-fpe-all=0 -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std08
17+
$DEBUG_PGI = -C -g -gopt -Mchkfpstk -Mchkptr -Mchkstk -Mcoff -traceback
1518
$OPTIMIZE = -O2
1619
$EXDIRS = PENF/src/tests/
1720
FACE/src/tests/ FACE/src/third_party/
@@ -96,6 +99,15 @@ build_dir = ./exe/
9699
template = template-static-intel-debug
97100
build_dir = ./exe/
98101

102+
# PGI
103+
[tests-pgi]
104+
template = template-static-pgi
105+
build_dir = ./exe/
106+
107+
[tests-pgi-debug]
108+
template = template-static-pgi-debug
109+
build_dir = ./exe/
110+
99111
#templates
100112
[template-shared-gnu]
101113
compiler = gnu
@@ -207,6 +219,33 @@ quiet = False
207219
log = True
208220
jobs = 2
209221

222+
[template-static-pgi]
223+
compiler = pgi
224+
cflags = $CSTATIC_PGI $OPTIMIZE
225+
lflags = $OPTIMIZE
226+
exclude_dirs = $EXDIRS
227+
mod_dir = ./mod/
228+
obj_dir = ./obj/
229+
src = ./src/
230+
colors = True
231+
quiet = False
232+
log = True
233+
jobs = 2
234+
235+
[template-static-pgi-debug]
236+
compiler = pgi
237+
cflags = $CSTATIC_PGI $DEBUG_PGI
238+
lflags = $DEBUG_PGI
239+
preproc = -DDEBUG
240+
exclude_dirs = $EXDIRS
241+
mod_dir = ./mod/
242+
obj_dir = ./obj/
243+
src = ./src/
244+
colors = True
245+
quiet = False
246+
log = True
247+
jobs = 2
248+
210249
# rules
211250
[rule-makedoc]
212251
help = Build documentation from source files

src/lib/foreseer_riemann_solver_compressible_exact.F90

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ module foreseer_riemann_solver_compressible_exact
2222
real(R8P) :: tolerance=1.e-10_R8P !< Tolerance on Newton convergence.
2323
contains
2424
! public deferred methods
25-
procedure, pass(self) :: initialize !< Initialize solver.
26-
procedure, pass(self) :: solve !< Solve Riemann Problem.
25+
procedure, pass(self) :: initialize !< Initialize solver.
26+
procedure, pass(lhs) :: riem_assign_riem !< `=` operator.
27+
procedure, pass(self) :: solve !< Solve Riemann Problem.
2728
endtype riemann_solver_compressible_exact
2829

2930
contains
@@ -38,6 +39,17 @@ subroutine initialize(self, config)
3839
self%tolerance = cton(config_, knd=1._R8P)
3940
endsubroutine initialize
4041

42+
pure subroutine riem_assign_riem(lhs, rhs)
43+
!< `=` operator.
44+
class(riemann_solver_compressible_exact), intent(inout) :: lhs !< Left hand side.
45+
class(riemann_solver_object), intent(in) :: rhs !< Right hand side.
46+
47+
select type(rhs)
48+
type is(riemann_solver_compressible_exact)
49+
lhs%tolerance = rhs%tolerance
50+
endselect
51+
endsubroutine riem_assign_riem
52+
4153
pure subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, fluxes)
4254
!< Solve Riemann Problem.
4355
!<
@@ -49,12 +61,16 @@ pure subroutine solve(self, eos_left, state_left, eos_right, state_right, normal
4961
class(conservative_object), intent(in) :: state_right !< Right Riemann state.
5062
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
5163
class(conservative_object), intent(inout) :: fluxes !< Fluxes of the Riemann Problem solution.
64+
type(conservative_compressible) :: state_left_ !< Left Riemann state, local variable.
65+
type(conservative_compressible) :: state_right_ !< Right Riemann state, local variable.
5266
type(riemann_pattern_compressible_pvl) :: pattern !< Riemann (states) pattern solution.
5367
real(R8P) :: dum, alfa, beta !< Dummies coefficients.
5468
real(R8P) :: p_2, p_3 !< Pessure of state 2 and 3.
5569
real(R8P) :: dp2, dp3 !< Derivate of pessure (dp/du) of state 2 and 3.
5670

57-
call pattern%initialize(eos_left=eos_left, state_left=state_left, eos_right=eos_right, state_right=state_right, normal=normal)
71+
state_left_ = state_left ; call state_left_%normalize(eos=eos_left, normal=normal)
72+
state_right_ = state_right ; call state_right_%normalize(eos=eos_right, normal=normal)
73+
call pattern%initialize(eos_left=eos_left, state_left=state_left_, eos_right=eos_right, state_right=state_right_, normal=normal)
5874

5975
! initiale u23 speed
6076
if (pattern%p_1 < pattern%p_4) then

src/lib/foreseer_riemann_solver_compressible_hllc.F90

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ module foreseer_riemann_solver_compressible_hllc
2121
!< @note This is the implemention for [[conservative_compressible]] Riemann states.
2222
contains
2323
! public deferred methods
24-
procedure, pass(self) :: initialize !< Initialize solver.
25-
procedure, pass(self) :: solve !< Solve Riemann Problem.
24+
procedure, pass(self) :: initialize !< Initialize solver.
25+
procedure, pass(lhs) :: riem_assign_riem !< `=` operator.
26+
procedure, pass(self) :: solve !< Solve Riemann Problem.
2627
endtype riemann_solver_compressible_hllc
2728

2829
contains
@@ -37,6 +38,14 @@ subroutine initialize(self, config)
3738
! call self%solver_pvl%initialize(config=config_)
3839
endsubroutine initialize
3940

41+
pure subroutine riem_assign_riem(lhs, rhs)
42+
!< `=` operator.
43+
!<
44+
!< @TODO Update this if solver is updated.
45+
class(riemann_solver_compressible_hllc), intent(inout) :: lhs !< Left hand side.
46+
class(riemann_solver_object), intent(in) :: rhs !< Right hand side.
47+
endsubroutine riem_assign_riem
48+
4049
subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, fluxes)
4150
!< Solve Riemann Problem.
4251
!<
@@ -49,15 +58,15 @@ subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, flu
4958
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
5059
class(conservative_object), intent(inout) :: fluxes !< Fluxes of the Riemann Problem solution.
5160
type(conservative_compressible) :: state23 !< Intermediate states.
52-
type(conservative_compressible), pointer :: state_left_ !< Left Riemann state, local variable.
53-
type(conservative_compressible), pointer :: state_right_ !< Right Riemann state, local variable.
61+
type(conservative_compressible) :: state_left_ !< Left Riemann state, local variable.
62+
type(conservative_compressible) :: state_right_ !< Right Riemann state, local variable.
5463
type(riemann_pattern_compressible_pvl) :: pattern !< Riemann (states) PVL pattern solution.
5564
real(R8P) :: u23 !< Maximum wave speed estimation.
5665

57-
call pattern%initialize(eos_left=eos_left, state_left=state_left, eos_right=eos_right, state_right=state_right, normal=normal)
66+
state_left_ = state_left ; call state_left_%normalize(eos=eos_left, normal=normal)
67+
state_right_ = state_right ; call state_right_%normalize(eos=eos_right, normal=normal)
68+
call pattern%initialize(eos_left=eos_left, state_left=state_left_, eos_right=eos_right, state_right=state_right_, normal=normal)
5869
call pattern%compute_waves_extrema
59-
state_left_ => conservative_compressible_pointer(to=state_left)
60-
state_right_ => conservative_compressible_pointer(to=state_right)
6170
associate(r_1=>pattern%r_1, u_1=>pattern%u_1, p_1=>pattern%p_1, g_1=>pattern%eos_1%g(), &
6271
r_4=>pattern%r_4, u_4=>pattern%u_4, p_4=>pattern%p_4, g_4=>pattern%eos_4%g(), &
6372
s_1=>pattern%s_1, s_4=>pattern%s_4, &
@@ -66,35 +75,35 @@ subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, flu
6675
(r_4 * (s_4 - u_4) - r_1 * (s_1 - u_1))
6776
select case(minloc([-s_1, s_1 * u23, u23 * s_4, s_4], dim=1))
6877
case(1)
69-
call state_left%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes)
78+
call state_left_%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes)
7079
case(2)
71-
call state_left%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes)
80+
call state_left_%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes)
7281
state23%density = r_1 * (s_1 - u_1) / (s_1 - u23)
7382
state23%momentum = state23%density * u23 * normal
7483
state23%energy = state23%density * (E_1 + (u23 - u_1) * (u23 + p_1 / (r_1 * (s_1 - u_1))))
7584
select type(fluxes)
7685
type is(conservative_compressible)
7786
#ifdef __GFORTRAN__
78-
fluxes = fluxes + s_1 * (state23 - state_left_)
87+
fluxes = fluxes + (s_1 * (state23 - state_left_))
7988
#else
8089
error stop 'error: Intel fortran still does not support abstract math!'
8190
#endif
8291
endselect
8392
case(3)
84-
call state_right%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes)
93+
call state_right_%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes)
8594
state23%density = r_4 * (s_4 - u_4) / (s_4 - u23)
8695
state23%momentum = state23%density * u23 * normal
8796
state23%energy = state23%density * (E_4 + (u23 - u_4) * (u23 + p_4 / (r_4 * (s_4 - u_4))))
8897
select type(fluxes)
8998
type is(conservative_compressible)
9099
#ifdef __GFORTRAN__
91-
fluxes = fluxes + s_4 * (state23 - state_right_)
100+
fluxes = fluxes + (s_4 * (state23 - state_right_))
92101
#else
93102
error stop 'error: Intel fortran still does not support abstract math!'
94103
#endif
95104
endselect
96105
case(4)
97-
call state_right%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes)
106+
call state_right_%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes)
98107
endselect
99108
endassociate
100109
endsubroutine solve

src/lib/foreseer_riemann_solver_compressible_llf.F90

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ module foreseer_riemann_solver_compressible_llf
2121
!< @note This is the implemention for [[conservative_compressible]] Riemann states.
2222
contains
2323
! public deferred methods
24-
procedure, pass(self) :: initialize !< Initialize solver.
25-
procedure, pass(self) :: solve !< Solve Riemann Problem.
24+
procedure, pass(self) :: initialize !< Initialize solver.
25+
procedure, pass(lhs) :: riem_assign_riem !< `=` operator.
26+
procedure, pass(self) :: solve !< Solve Riemann Problem.
2627
endtype riemann_solver_compressible_llf
2728

2829
contains
@@ -37,6 +38,14 @@ subroutine initialize(self, config)
3738
! call self%solver_pvl%initialize(config=config_)
3839
endsubroutine initialize
3940

41+
pure subroutine riem_assign_riem(lhs, rhs)
42+
!< `=` operator.
43+
!<
44+
!< @TODO Update this if solver is updated.
45+
class(riemann_solver_compressible_llf), intent(inout) :: lhs !< Left hand side.
46+
class(riemann_solver_object), intent(in) :: rhs !< Right hand side.
47+
endsubroutine riem_assign_riem
48+
4049
subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, fluxes)
4150
!< Solve Riemann Problem.
4251
!<
@@ -49,19 +58,19 @@ subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, flu
4958
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
5059
class(conservative_object), intent(inout) :: fluxes !< Fluxes of the Riemann Problem solution.
5160
type(riemann_pattern_compressible_pvl) :: pattern !< Riemann (states) PVL pattern solution.
52-
type(conservative_compressible), pointer :: state_left_ !< Left Riemann state, local variable.
53-
type(conservative_compressible), pointer :: state_right_ !< Right Riemann state, local variable.
61+
type(conservative_compressible) :: state_left_ !< Left Riemann state, local variable.
62+
type(conservative_compressible) :: state_right_ !< Right Riemann state, local variable.
5463
type(conservative_compressible) :: fluxes_left !< Fluxes of left state.
5564
type(conservative_compressible) :: fluxes_right !< Fluxes of right state.
5665
real(R8P) :: lmax !< Maximum wave speed estimation.
5766

58-
call pattern%initialize(eos_left=eos_left, state_left=state_left, eos_right=eos_right, state_right=state_right, normal=normal)
67+
state_left_ = state_left ; call state_left_%normalize(eos=eos_left, normal=normal)
68+
state_right_ = state_right ; call state_right_%normalize(eos=eos_right, normal=normal)
69+
call pattern%initialize(eos_left=eos_left, state_left=state_left_, eos_right=eos_right, state_right=state_right_, normal=normal)
5970
call pattern%compute_waves_extrema
6071
lmax = max(abs(pattern%s_1), abs(pattern%s_4))
61-
call state_left%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes_left)
62-
call state_right%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes_right)
63-
state_left_ => conservative_compressible_pointer(to=state_left)
64-
state_right_ => conservative_compressible_pointer(to=state_right)
72+
call state_left_%compute_fluxes(eos=eos_left, normal=normal, fluxes=fluxes_left)
73+
call state_right_%compute_fluxes(eos=eos_right, normal=normal, fluxes=fluxes_right)
6574
select type(fluxes)
6675
type is(conservative_compressible)
6776
#ifdef __GFORTRAN__

src/lib/foreseer_riemann_solver_compressible_pvl.f90

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ module foreseer_riemann_solver_compressible_pvl
2121
!< @note This is the implemention for [[conservative_compressible]] Riemann states.
2222
contains
2323
! public deferred methods
24-
procedure, pass(self) :: initialize !< Initialize solver.
25-
procedure, pass(self) :: solve !< Solve Riemann Problem.
24+
procedure, pass(self) :: initialize !< Initialize solver.
25+
procedure, pass(lhs) :: riem_assign_riem !< `=` operator.
26+
procedure, pass(self) :: solve !< Solve Riemann Problem.
2627
endtype riemann_solver_compressible_pvl
2728

2829
contains
@@ -43,18 +44,30 @@ subroutine initialize(self, config)
4344
endselect
4445
endsubroutine initialize
4546

47+
pure subroutine riem_assign_riem(lhs, rhs)
48+
!< `=` operator.
49+
!<
50+
!< @TODO Update this if solver is updated.
51+
class(riemann_solver_compressible_pvl), intent(inout) :: lhs !< Left hand side.
52+
class(riemann_solver_object), intent(in) :: rhs !< Right hand side.
53+
endsubroutine riem_assign_riem
54+
4655
pure subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, fluxes)
4756
!< Solve Riemann problem by PVL algorithm.
48-
class(riemann_solver_compressible_pvl), intent(in) :: self !< Solver.
49-
class(eos_object), intent(in) :: eos_left !< Equation of state for left state.
50-
class(conservative_object), intent(in) :: state_left !< Left Riemann state.
51-
class(eos_object), intent(in) :: eos_right !< Equation of state for right state.
52-
class(conservative_object), intent(in) :: state_right !< Right Riemann state.
53-
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
54-
class(conservative_object), intent(inout) :: fluxes !< Fluxes of the Riemann Problem solution.
55-
type(riemann_pattern_compressible_pvl) :: pattern !< Riemann (states) pattern solution.
56-
57-
call pattern%initialize(eos_left=eos_left, state_left=state_left, eos_right=eos_right, state_right=state_right, normal=normal)
57+
class(riemann_solver_compressible_pvl), intent(in) :: self !< Solver.
58+
class(eos_object), intent(in) :: eos_left !< Equation of state for left state.
59+
class(conservative_object), intent(in) :: state_left !< Left Riemann state.
60+
class(eos_object), intent(in) :: eos_right !< Equation of state for right state.
61+
class(conservative_object), intent(in) :: state_right !< Right Riemann state.
62+
type(vector), intent(in) :: normal !< Normal (versor) of face where fluxes are given.
63+
class(conservative_object), intent(inout) :: fluxes !< Fluxes of the Riemann Problem solution.
64+
type(conservative_compressible) :: state_left_ !< Left Riemann state, local variable.
65+
type(conservative_compressible) :: state_right_ !< Right Riemann state, local variable.
66+
type(riemann_pattern_compressible_pvl) :: pattern !< Riemann (states) pattern solution.
67+
68+
state_left_ = state_left ; call state_left_%normalize(eos=eos_left, normal=normal)
69+
state_right_ = state_right ; call state_right_%normalize(eos=eos_right, normal=normal)
70+
call pattern%initialize(eos_left=eos_left, state_left=state_left_, eos_right=eos_right, state_right=state_right_, normal=normal)
5871
call pattern%compute
5972
call pattern%compute_fluxes(normal=normal, fluxes=fluxes)
6073
endsubroutine solve

0 commit comments

Comments
 (0)