Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory-generated boundary conditions with new case file interface [Preview] #1264

Open
wants to merge 48 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c29fa7c
Deferred init for bc_t children
timofeymukha Apr 18, 2024
150d892
Simplify mark_zones_from_list
timofeymukha Apr 21, 2024
7af2e93
Refactor bc_list
timofeymukha Apr 22, 2024
cb6f891
Exchange wall to zero_dirichlet
timofeymukha Apr 22, 2024
3aeb2ff
Use constructors and simplified zone marking interface
timofeymukha Apr 22, 2024
58c7232
Put scalar debug logging in separate routine
timofeymukha Apr 22, 2024
0ae2e41
Fix plot script in scalar_mms
timofeymukha Apr 22, 2024
1eca46b
Working bc factory
timofeymukha Apr 23, 2024
c67e64f
fix init in poisson solver
timofeymukha Apr 23, 2024
1d46cb1
Add constructor fom components to dirichlet
timofeymukha Apr 23, 2024
57a202d
Add comonent to bc to mark if it is strong or not
timofeymukha Apr 23, 2024
8cff7ef
Use new contructor for dirichlet in fluid
timofeymukha Apr 23, 2024
e2c6d7d
Use zero_dirichlet for field bcs
timofeymukha Apr 23, 2024
05d6dda
Add wrapper for strong in bc_list
timofeymukha Apr 23, 2024
06c0bba
Make constructor for neumann use json
timofeymukha Apr 23, 2024
476f926
Use init instead of init_base in non-normal
timofeymukha Apr 23, 2024
89ce286
Use zero-dirichlet in symmetry
timofeymukha Apr 23, 2024
c78b0df
Add device-agnostic apply to bc
timofeymukha Apr 23, 2024
ae46530
Update depends
timofeymukha Apr 23, 2024
7034036
Rename wall kernels to zero_dirichlet
timofeymukha Apr 23, 2024
f1bbb86
Add deferred finalization
timofeymukha Apr 23, 2024
c60e799
Fix non-normal init
timofeymukha Apr 24, 2024
9039898
Add strong argument to bc list apply
timofeymukha Apr 24, 2024
1a43f64
Add warning to blasius docstring
timofeymukha Apr 24, 2024
2453e8d
Fix symmetry init in fluid_scheme
timofeymukha Apr 24, 2024
97202ee
WIP user bcs for scalar
timofeymukha Apr 24, 2024
7b58609
Merge branch 'develop' into feature/bc_overhaul
timofeymukha Apr 24, 2024
9396d06
Update depends
timofeymukha Apr 24, 2024
8f235f2
Merge branch 'develop' into feature/bc_overhaul
timofeymukha Apr 24, 2024
7e26962
Tiny docstring change
timofeymukha Apr 24, 2024
a83a697
Merge branch 'develop' into feature/bc_overhaul
timofeymukha Apr 30, 2024
9a9d462
Update two scalar examples
timofeymukha Apr 30, 2024
9385459
Update depends
timofeymukha Apr 30, 2024
7676483
Take care of pointwise bc in the scalar
timofeymukha Apr 30, 2024
31993e2
Fix imports
timofeymukha Apr 30, 2024
2707d48
Clean up
timofeymukha Apr 30, 2024
7625cf7
Fix zero_dirichlet kernel file names
timofeymukha Apr 30, 2024
2246740
Try to fix intel
timofeymukha Apr 30, 2024
ef570cf
Try to fix depends_device
timofeymukha Apr 30, 2024
30fb13f
Slight changes to bc after Tim's comments
timofeymukha May 2, 2024
8f23a8d
Fix copyright and docstrings in zero_dirichlet
timofeymukha May 2, 2024
c6d3ea3
Merge branch 'develop' into feature/bc_overhaul
timofeymukha Jun 24, 2024
ce761b1
Compiles
timofeymukha Jun 25, 2024
7cf29cd
Kill mesh zones
timofeymukha Jun 25, 2024
1e5e239
Merge branch 'develop' into feature/bc_overhaul
timofeymukha Jul 7, 2024
5653c53
Update depends
timofeymukha Jul 7, 2024
97c0544
Compiles but at what cost
timofeymukha Jul 7, 2024
390eec6
Update depends
timofeymukha Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions examples/poisson/driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,36 @@ program poisson
end if
stop
end if
call neko_init

call neko_init
call get_command_argument(1, fname)
call get_command_argument(2, lxchar)
call get_command_argument(3, iterchar)
read(lxchar, *) lx
read(iterchar, *) niter

nmsh_file = file_t(fname)
call nmsh_file%read(msh)
call nmsh_file%read(msh)

call Xh%init(GLL, lx, lx, lx)

dm = dofmap_t(msh, Xh)
call gs_h%init(dm)

call coef%init(gs_h)

call x%init(dm, "x")

n = Xh%lx * Xh%ly * Xh%lz * msh%nelv

call dir_bc%init(coef)
call dir_bc%set_g(real(0.0d0,rp))

call dir_bc%init_from_components(coef, 0.0_rp)

!user specified
call set_bc(dir_bc, msh)

call dir_bc%finalize()
call bc_list_init(bclst)
call bc_list_add(bclst,dir_bc)
call bclst%init()
call bclst%append(dir_bc)
call solver%init(n, niter, abs_tol = tol)

allocate(f(n))
Expand All @@ -71,23 +70,23 @@ program poisson
call bc_list_apply(bclst,f,n)
ksp_mon = solver%solve(ax, x, f, n, coef, bclst, gs_h, niter)
n_glb = Xh%lx * Xh%ly * Xh%lz * msh%glb_nelv

call MPI_Barrier(NEKO_COMM, ierr)

call set_timer_flop_cnt(0, msh%glb_nelv, x%Xh%lx, niter, n_glb, ksp_mon)
ksp_mon = solver%solve(ax, x, f, n, coef, bclst, gs_h, niter)
call set_timer_flop_cnt(1, msh%glb_nelv, x%Xh%lx, niter, n_glb, ksp_mon)

fname = 'out.fld'
mf = file_t(fname)
call mf%write(x)
deallocate(f)
call solver%free()
call dir_bc%free()
call bc_list_free(bclst)
call bclst%free()
call Xh%free()
call x%free()
call msh%free()
call msh%free()
call neko_finalize

end program poisson
Expand Down
7 changes: 6 additions & 1 deletion examples/rayleigh-benard-cylinder/rayleigh.case
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
"Pr": 1.0,
"initial_condition": {
"type": "user"
}
},
"boundary_conditions": [
{
"type": "user_pointwise"
}
],
},
"simulation_components": [
{
Expand Down
23 changes: 15 additions & 8 deletions examples/rayleigh-benard/rayleigh.case
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,24 @@
"scalar": {
"enabled": true,
"Pr": 0.71,
"boundary_types": [
"",
"",
"",
"",
"d=1",
"d=0"
"boundary_conditions": [
{
"type": "dirichlet",
"zone_index": 5,
"value": 1.0
},
{
"type": "dirichlet",
"zone_index": 6,
"value": 0.0
},
{
"type": "user_pointwise"
}
],
"initial_condition": {
"type": "user"
}
}
}
}
}
70 changes: 36 additions & 34 deletions src/.depends

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/.depends_device
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ krylov/bcknd/device/hip/gmres_aux.o : krylov/bcknd/device/hip/gmres_aux.hip kryl
gs/bcknd/device/hip/gs.o : gs/bcknd/device/hip/gs.hip gs/bcknd/device/hip/gs_kernels.h
bc/bcknd/device/hip/dirichlet.o : bc/bcknd/device/hip/dirichlet.hip bc/bcknd/device/hip/dirichlet_kernel.h
bc/bcknd/device/hip/inflow.o : bc/bcknd/device/hip/inflow.hip bc/bcknd/device/hip/inflow_kernel.h
bc/bcknd/device/hip/no_slip_wall.o : bc/bcknd/device/hip/no_slip_wall.hip bc/bcknd/device/hip/no_slip_wall_kernel.h
bc/bcknd/device/hip/zero_dirichlet.o : bc/bcknd/device/hip/zero_dirichlet.hip bc/bcknd/device/hip/zero_dirichlet_kernel.h
bc/bcknd/device/hip/symmetry.o : bc/bcknd/device/hip/symmetry.hip bc/bcknd/device/hip/symmetry_kernel.h
bc/bcknd/device/hip/facet_normal.o : bc/bcknd/device/hip/facet_normal.hip bc/bcknd/device/hip/facet_normal_kernel.h
bc/bcknd/device/hip/inhom_dirichlet.o : bc/bcknd/device/hip/inhom_dirichlet.hip bc/bcknd/device/hip/inhom_dirichlet_kernel.h
bc/bcknd/device/hip/dong_outflow.o : bc/bcknd/device/hip/dong_outflow.hip bc/bcknd/device/hip/dong_outflow_kernel.h
common/bcknd/device/hip/rhs_maker.o : common/bcknd/device/hip/rhs_maker.hip common/bcknd/device/hip/sumab_kernel.h common/bcknd/device/hip/makeext_kernel.h common/bcknd/device/hip/makebdf_kernel.h
common/bcknd/device/hip/projection.o : common/bcknd/device/hip/projection.hip common/bcknd/device/hip/projection_kernel.h
fluid/bcknd/device/hip/pnpn_res.o : fluid/bcknd/device/hip/pnpn_res.hip fluid/bcknd/device/hip/vel_res_update_kernel.h fluid/bcknd/device/hip/prs_res_kernel.h
fluid/bcknd/device/hip/pnpn_res.o : fluid/bcknd/device/hip/pnpn_res.hip fluid/bcknd/device/hip/vel_res_update_kernel.h fluid/bcknd/device/hip/prs_res_kernel.h
scalar/bcknd/device/hip/scalar_residual.o : scalar/bcknd/device/hip/scalar_residual.hip scalar/bcknd/device/hip/scalar_residual_update_kernel.h
sem/bcknd/device/hip/coef.o : sem/bcknd/device/hip/coef.hip sem/bcknd/device/hip/coef_kernel.h
device/cuda/check.o : device/cuda/check.cu device/cuda/check.h
Expand All @@ -46,22 +46,22 @@ krylov/bcknd/device/cuda/pipecg_aux.o : krylov/bcknd/device/cuda/pipecg_aux.cu k
krylov/bcknd/device/cuda/fusedcg_aux.o : krylov/bcknd/device/cuda/fusedcg_aux.cu krylov/bcknd/device/cuda/fusedcg_kernel.h
krylov/bcknd/device/cuda/fusedcg_cpld_aux.o : krylov/bcknd/device/cuda/fusedcg_cpld_aux.cu krylov/bcknd/device/cuda/fusedcg_cpld_kernel.h
krylov/bcknd/device/cuda/gmres_aux.o : krylov/bcknd/device/cuda/gmres_aux.cu krylov/bcknd/device/cuda/gmres_kernel.h
gs/bcknd/device/cuda/gs.o : gs/bcknd/device/cuda/gs.cu gs/bcknd/device/cuda/gs_kernels.h
gs/bcknd/device/cuda/gs.o : gs/bcknd/device/cuda/gs.cu gs/bcknd/device/cuda/gs_kernels.h
bc/bcknd/device/cuda/dirichlet.o : bc/bcknd/device/cuda/dirichlet.cu bc/bcknd/device/cuda/dirichlet_kernel.h
bc/bcknd/device/cuda/inflow.o : bc/bcknd/device/cuda/inflow.cu bc/bcknd/device/cuda/inflow_kernel.h
bc/bcknd/device/cuda/no_slip_wall.o : bc/bcknd/device/cuda/no_slip_wall.cu bc/bcknd/device/cuda/no_slip_wall_kernel.h
bc/bcknd/device/cuda/zero_dirichlet.o : bc/bcknd/device/cuda/zero_dirichlet.cu bc/bcknd/device/cuda/zero_dirichlet_kernel.h
bc/bcknd/device/cuda/symmetry.o : bc/bcknd/device/cuda/symmetry.cu bc/bcknd/device/cuda/symmetry_kernel.h
bc/bcknd/device/cuda/facet_normal.o : bc/bcknd/device/cuda/facet_normal.cu bc/bcknd/device/cuda/facet_normal_kernel.h
bc/bcknd/device/cuda/inhom_dirichlet.o : bc/bcknd/device/cuda/inhom_dirichlet.cu bc/bcknd/device/cuda/inhom_dirichlet_kernel.h
bc/bcknd/device/cuda/dong_outflow.o : bc/bcknd/device/cuda/dong_outflow.cu bc/bcknd/device/cuda/dong_outflow_kernel.h
common/bcknd/device/cuda/rhs_maker.o : common/bcknd/device/cuda/rhs_maker.cu common/bcknd/device/cuda/sumab_kernel.h common/bcknd/device/cuda/makeext_kernel.h common/bcknd/device/cuda/makebdf_kernel.h
common/bcknd/device/cuda/projection.o : common/bcknd/device/cuda/projection.cu common/bcknd/device/cuda/projection_kernel.h
fluid/bcknd/device/cuda/pnpn_res.o : fluid/bcknd/device/cuda/pnpn_res.cu fluid/bcknd/device/cuda/vel_res_update_kernel.h fluid/bcknd/device/cuda/prs_res_kernel.h
fluid/bcknd/device/cuda/pnpn_res.o : fluid/bcknd/device/cuda/pnpn_res.cu fluid/bcknd/device/cuda/vel_res_update_kernel.h fluid/bcknd/device/cuda/prs_res_kernel.h
scalar/bcknd/device/cuda/scalar_residual.o : scalar/bcknd/device/cuda/scalar_residual.cu scalar/bcknd/device/cuda/scalar_residual_update_kernel.h
sem/bcknd/device/cuda/coef.o : sem/bcknd/device/cuda/coef.cu sem/bcknd/device/cuda/coef_kernel.h
device/opencl/check.o : device/opencl/check.c device/opencl/check.h
device/opencl/jit.o : device/opencl/jit.c device/opencl/jit.h
math/bcknd/device/opencl/math.o : math/bcknd/device/opencl/math.c math/bcknd/device/opencl/math_kernel.cl.h
math/bcknd/device/opencl/math.o : math/bcknd/device/opencl/math.c math/bcknd/device/opencl/math_kernel.cl.h
math/bcknd/device/opencl/schwarz.o : math/bcknd/device/opencl/schwarz.c math/bcknd/device/opencl/schwarz_kernel.cl.h
math/bcknd/device/opencl/tensor.o : math/bcknd/device/opencl/tensor.c math/bcknd/device/opencl/tensor_kernel.cl.h
math/bcknd/device/opencl/fdm.o : math/bcknd/device/opencl/fdm.c math/bcknd/device/opencl/fdm_kernel.cl.h
Expand All @@ -74,10 +74,10 @@ math/bcknd/device/opencl/opr_lambda2.o : math/bcknd/device/opencl/opr_lambda2.c
math/bcknd/device/opencl/opr_cfl.o : math/bcknd/device/opencl/opr_cfl.c math/bcknd/device/opencl/cfl_kernel.cl.h
math/bcknd/device/opencl/ax_helm.o : math/bcknd/device/opencl/ax_helm.c math/bcknd/device/opencl/ax_helm_kernel.cl.h
krylov/bcknd/device/opencl/pc_jacobi.o : krylov/bcknd/device/opencl/pc_jacobi.c krylov/bcknd/device/opencl/jacobi_kernel.cl.h
gs/bcknd/device/opencl/gs.o : gs/bcknd/device/opencl/gs.c gs/bcknd/device/opencl/gs_kernels.cl.h
gs/bcknd/device/opencl/gs.o : gs/bcknd/device/opencl/gs.c gs/bcknd/device/opencl/gs_kernels.cl.h
bc/bcknd/device/opencl/dirichlet.o : bc/bcknd/device/opencl/dirichlet.c bc/bcknd/device/opencl/dirichlet_kernel.cl.h
bc/bcknd/device/opencl/inflow.o : bc/bcknd/device/opencl/inflow.c bc/bcknd/device/opencl/inflow_kernel.cl.h
bc/bcknd/device/opencl/no_slip_wall.o : bc/bcknd/device/opencl/no_slip_wall.c bc/bcknd/device/opencl/no_slip_wall_kernel.cl.h
bc/bcknd/device/opencl/zero_dirichlet.o : bc/bcknd/device/opencl/zero_dirichlet.c bc/bcknd/device/opencl/zero_dirichlet_kernel.cl.h
bc/bcknd/device/opencl/symmetry.o : bc/bcknd/device/opencl/symmetry.c bc/bcknd/device/opencl/symmetry_kernel.cl.h
bc/bcknd/device/opencl/facet_normal.o : bc/bcknd/device/opencl/facet_normal.c bc/bcknd/device/opencl/facet_normal_kernel.cl.h
bc/bcknd/device/opencl/inhom_dirichlet.o : bc/bcknd/device/opencl/inhom_dirichlet.c bc/bcknd/device/opencl/inhom_dirichlet_kernel.cl.h
Expand Down
18 changes: 10 additions & 8 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ neko_fortran_SOURCES = \
common/profiler.F90\
common/craypat.F90\
bc/bc.f90\
bc/bc_list.f90\
bc/bc_fctry.f90\
bc/dirichlet.f90\
bc/neumann.f90\
bc/dong_outflow.f90\
bc/wall.f90\
bc/zero_dirichlet.f90\
bc/inflow.f90\
bc/field_dirichlet.f90\
bc/field_dirichlet_vector.f90\
Expand Down Expand Up @@ -244,7 +246,7 @@ neko_fortran_SOURCES = \
math/bcknd/device/device_mathops.F90\
bc/bcknd/device/device_dirichlet.F90\
bc/bcknd/device/device_inflow.F90\
bc/bcknd/device/device_wall.F90\
bc/bcknd/device/device_zero_dirichlet.F90\
bc/bcknd/device/device_symmetry.F90\
bc/bcknd/device/device_facet_normal.F90\
bc/bcknd/device/device_inhom_dirichlet.F90\
Expand Down Expand Up @@ -335,7 +337,7 @@ libneko_a_SOURCES += \
gs/bcknd/device/hip/gs.hip\
bc/bcknd/device/hip/dirichlet.hip\
bc/bcknd/device/hip/inflow.hip\
bc/bcknd/device/hip/no_slip_wall.hip\
bc/bcknd/device/hip/zero_dirichlet.hip\
bc/bcknd/device/hip/symmetry.hip\
bc/bcknd/device/hip/facet_normal.hip\
bc/bcknd/device/hip/inhom_dirichlet.hip\
Expand Down Expand Up @@ -370,7 +372,7 @@ libneko_a_SOURCES += \
gs/bcknd/device/cuda/gs.cu\
bc/bcknd/device/cuda/dirichlet.cu\
bc/bcknd/device/cuda/inflow.cu\
bc/bcknd/device/cuda/no_slip_wall.cu\
bc/bcknd/device/cuda/zero_dirichlet.cu\
bc/bcknd/device/cuda/symmetry.cu\
bc/bcknd/device/cuda/facet_normal.cu\
bc/bcknd/device/cuda/inhom_dirichlet.cu\
Expand Down Expand Up @@ -403,7 +405,7 @@ libneko_a_SOURCES += \
gs/bcknd/device/opencl/gs.c\
bc/bcknd/device/opencl/dirichlet.c\
bc/bcknd/device/opencl/inflow.c\
bc/bcknd/device/opencl/no_slip_wall.c\
bc/bcknd/device/opencl/zero_dirichlet.c\
bc/bcknd/device/opencl/symmetry.c\
bc/bcknd/device/opencl/facet_normal.c\
bc/bcknd/device/opencl/inhom_dirichlet.c\
Expand Down Expand Up @@ -491,7 +493,7 @@ endif
EXTRA_DIST = \
bc/bcknd/device/cuda/dirichlet_kernel.h\
bc/bcknd/device/cuda/inflow_kernel.h\
bc/bcknd/device/cuda/no_slip_wall_kernel.h\
bc/bcknd/device/cuda/zero_dirichlet_kernel.h\
bc/bcknd/device/cuda/symmetry_kernel.h\
bc/bcknd/device/cuda/facet_normal_kernel.h\
bc/bcknd/device/cuda/inhom_dirichlet_kernel.h\
Expand Down Expand Up @@ -520,7 +522,7 @@ EXTRA_DIST = \
sem/bcknd/device/cuda/coef_kernel.h\
bc/bcknd/device/hip/dirichlet_kernel.h\
bc/bcknd/device/hip/inflow_kernel.h\
bc/bcknd/device/hip/no_slip_wall_kernel.h\
bc/bcknd/device/hip/zero_dirichlet_kernel.h\
bc/bcknd/device/hip/symmetry_kernel.h\
bc/bcknd/device/hip/facet_normal_kernel.h\
bc/bcknd/device/hip/inhom_dirichlet_kernel.h\
Expand Down Expand Up @@ -555,7 +557,7 @@ EXTRA_DIST = \
sem/bcknd/device/hip/coef_kernel.h\
bc/bcknd/device/opencl/dirichlet_kernel.cl\
bc/bcknd/device/opencl/inflow_kernel.cl\
bc/bcknd/device/opencl/no_slip_wall_kernel.cl\
bc/bcknd/device/opencl/zero_dirichlet_kernel.cl\
bc/bcknd/device/opencl/symmetry_kernel.cl\
bc/bcknd/device/opencl/facet_normal_kernel.cl\
bc/bcknd/device/opencl/inhom_dirichlet_kernel.cl\
Expand Down
Loading
Loading