Skip to content

Commit

Permalink
Merge pull request #1543 from timfelle/bug/brinkman
Browse files Browse the repository at this point in the history
Brinkman forcing bug on gpu.
  • Loading branch information
timfelle authored Oct 15, 2024
2 parents 83ee040 + d362fa8 commit 6f9b98e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/.depends
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ source_terms/bcknd/cpu/boussinesq_source_term_cpu.o : source_terms/bcknd/cpu/bou
source_terms/bcknd/device/boussinesq_source_term_device.o : source_terms/bcknd/device/boussinesq_source_term_device.f90 math/bcknd/device/device_math.o field/field.o field/field_list.o config/num_types.o
source_terms/source_term_fctry.o : source_terms/source_term_fctry.f90 common/utils.o common/json_utils.o source_terms/coriolis_source_term.o source_terms/brinkman_source_term.o source_terms/boussinesq_source_term.o source_terms/const_source_term.o source_terms/source_term.o
source_terms/brinkman_source_term.o : source_terms/brinkman_source_term.f90 mesh/point_zone_registry.o mesh/point_zone.o mesh/search_tree/aabb.o common/profiler.o math/signed_distance.o source_terms/brinkman/filters.o device/device.o mesh/tri_mesh.o io/file.o math/field_math.o common/utils.o config/neko_config.o sem/coef.o source_terms/source_term.o field/field_registry.o common/json_utils.o field/field_list.o field/field.o config/num_types.o
source_terms/brinkman/filters.o : source_terms/brinkman/filters.f90 source_terms/bcknd/cpu/filters_cpu.o config/num_types.o field/field.o
source_terms/brinkman/filters.o : source_terms/brinkman/filters.f90 source_terms/bcknd/cpu/filters_cpu.o common/utils.o config/num_types.o config/neko_config.o field/field.o
source_terms/bcknd/cpu/filters_cpu.o : source_terms/bcknd/cpu/filters_cpu.f90 config/num_types.o
les/les_model.o : les/les_model.f90 math/bcknd/device/device_math.o math/math.o device/device.o config/neko_config.o gs/gs_ops.o sem/coef.o sem/dofmap.o field/field_registry.o field/field.o config/num_types.o
les/les_model_fctry.o : les/les_model_fctry.f90 common/utils.o les/sigma.o les/dynamic_smagorinsky.o les/smagorinsky.o les/vreman.o les/les_model.o
Expand Down
20 changes: 17 additions & 3 deletions src/source_terms/brinkman/filters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
!! simulations.
module filters
use field, only: field_t
use neko_config, only: NEKO_BCKND_DEVICE
use num_types, only: rp
use utils, only: neko_error
implicit none

private
Expand Down Expand Up @@ -64,7 +66,11 @@ subroutine smooth_step_field(F, edge0, edge1)
type(field_t), intent(inout) :: F
real(kind=rp), intent(in) :: edge0, edge1

F%x = smooth_step_cpu(F%x, edge0, edge1)
if (NEKO_BCKND_DEVICE .eq. 1) then
call neko_error('smooth_step_field: not implemented for device')
else
F%x = smooth_step_cpu(F%x, edge0, edge1)
end if
end subroutine smooth_step_field

!> @brief Apply a permeability function to a field.
Expand All @@ -82,7 +88,11 @@ subroutine permeability_field(F_out, x, k_0, k_1, q)
real(kind=rp), intent(in) :: k_0, k_1
real(kind=rp), intent(in) :: q

F_out%x = permeability_cpu(x%x, k_0, k_1, q)
if (NEKO_BCKND_DEVICE .eq. 1) then
call neko_error('permeability_field: not implemented for device')
else
F_out%x = permeability_cpu(x%x, k_0, k_1, q)
end if
end subroutine permeability_field

!> @brief Apply a step function to a field.
Expand All @@ -96,7 +106,11 @@ subroutine step_function_field(F, x0, value0, value1)
type(field_t), intent(inout) :: F
real(kind=rp), intent(in) :: x0, value0, value1

F%x = step_function_cpu(F%x, x0, value0, value1)
if (NEKO_BCKND_DEVICE .eq. 1) then
call neko_error('step_function_field: not implemented for device')
else
F%x = step_function_cpu(F%x, x0, value0, value1)
end if
end subroutine step_function_field

end module filters

0 comments on commit 6f9b98e

Please sign in to comment.