Skip to content

Commit bbab82f

Browse files
committed
fix(scalar_1D): operator(/) for integer denominator
1 parent de0ca77 commit bbab82f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/formal/scalar_1D_s.F90‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pure function cell_center_locations(x_min, x_max, cells) result(x)
6868

6969
module procedure divide_by_integer
7070
ratio%tensor_1D_t = tensor_1D_t( &
71-
values = self%values_/2, x_min = self%x_min_, x_max = self%x_max_, cells = self%cells_, order = self%order_ &
71+
values = self%values_/denominator, x_min = self%x_min_, x_max = self%x_max_, cells = self%cells_, order = self%order_ &
7272
)
7373
ratio%gradient_operator_1D_ = gradient_operator_1D_t( &
7474
k = self%order_, dx = (self%x_max_ - self%x_min_)/self%cells_, cells = self%cells_ &

‎test/scalar_1D_test_m.F90‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ function check_divison_operator() result(test_diagnosis)
8383

8484
do order = 2, 4, 2
8585
associate(scalar_1D => scalar_1D_t(scalar_1D_initializer, order=order, cells=10, x_min=0D0, x_max=10D0) )
86-
associate( scalar_1D_squared => scalar_1D/2 )
86+
associate( ratio => scalar_1D/2 )
8787
test_diagnosis = test_diagnosis .also. .all. &
88-
(scalar_1D_squared%values() .approximates. scalar_1D%values()/2 .within. tolerance) &
88+
(ratio%values() .approximates. scalar_1D%values()/2 .within. tolerance) &
8989
// string_t(" for order ") // string_t(order)
9090
end associate
9191
end associate

0 commit comments

Comments
 (0)