diff --git a/configure.ac b/configure.ac index 85deb78ae6de..89e75a7f26fd 100644 --- a/configure.ac +++ b/configure.ac @@ -474,6 +474,8 @@ AC_CONFIG_FILES([tests/unit/stack/Makefile\ tests/unit/octree/Makefile\ tests/unit/vector/Makefile\ tests/unit/matrix/Makefile\ + tests/unit/tensor3/Makefile\ + tests/unit/tensor4/Makefile\ tests/unit/case_file_utils/Makefile\ tests/unit/scratch_registry/Makefile\ tests/unit/registry/Makefile\ diff --git a/contrib/calc_lift_from_field/calc_lift_from_field.f90 b/contrib/calc_lift_from_field/calc_lift_from_field.f90 index 5df844ef5e3a..025eca404e15 100644 --- a/contrib/calc_lift_from_field/calc_lift_from_field.f90 +++ b/contrib/calc_lift_from_field/calc_lift_from_field.f90 @@ -142,7 +142,6 @@ program calc_lift_from_field call copy(v%x,field_data%v%x,dof%size()) call copy(w%x,field_data%w%x,dof%size()) call copy(p%x,field_data%p%x,dof%size()) - drag_torq = 0.0_rp !set coords to somoething big drag_torq%x(:,2) = 1e15 diff --git a/src/.depends b/src/.depends index 24266055ad06..d1962e976153 100644 --- a/src/.depends +++ b/src/.depends @@ -11,10 +11,10 @@ io/format/re2.lo : io/format/re2.f90 config/num_types.lo io/format/map.lo : io/format/map.f90 mesh/mesh.lo io/format/stl.lo : io/format/stl.f90 config/num_types.lo io/format/vtk.lo : io/format/vtk.f90 common/utils.lo -io/buffer/buffer.lo : io/buffer/buffer.F90 math/vector.lo config/num_types.lo -io/buffer/buffer_1d.lo : io/buffer/buffer_1d.F90 io/buffer/buffer.lo math/vector.lo config/num_types.lo -io/buffer/buffer_4d.lo : io/buffer/buffer_4d.F90 io/buffer/buffer.lo math/vector.lo config/num_types.lo -io/buffer/buffer_4d_npar.lo : io/buffer/buffer_4d_npar.F90 io/buffer/buffer.lo math/vector.lo config/num_types.lo +io/buffer/buffer.lo : io/buffer/buffer.F90 data_types/vector.lo config/num_types.lo +io/buffer/buffer_1d.lo : io/buffer/buffer_1d.F90 io/buffer/buffer.lo data_types/vector.lo config/num_types.lo +io/buffer/buffer_4d.lo : io/buffer/buffer_4d.F90 io/buffer/buffer.lo data_types/vector.lo config/num_types.lo +io/buffer/buffer_4d_npar.lo : io/buffer/buffer_4d_npar.F90 io/buffer/buffer.lo data_types/vector.lo config/num_types.lo common/log.lo : common/log.f90 common/utils.lo comm/comm.lo config/neko_config.lo comm/comm.lo : comm/comm.F90 comm/shmem.lo config/neko_config.lo common/utils.lo comm/pfunit_comm_utils.lo : comm/pfunit_comm_utils.F90 common/utils.lo comm/comm.lo @@ -27,24 +27,29 @@ common/distdata.lo : common/distdata.f90 adt/uset.lo adt/tuple.lo adt/stack.lo common/utils.lo : common/utils.f90 config/num_types.lo common/time_state.lo : common/time_state.f90 common/json_utils.lo common/log.lo config/num_types.lo common/json_utils.lo : common/json_utils.f90 common/utils.lo config/num_types.lo -common/case_file_utils.lo : common/case_file_utils.f90 config/num_types.lo math/math.lo math/vector.lo registries/registry.lo common/json_utils.lo +common/case_file_utils.lo : common/case_file_utils.f90 config/num_types.lo math/math.lo data_types/vector.lo registries/registry.lo common/json_utils.lo common/mask.lo : common/mask.f90 common/utils.lo math/bcknd/device/device_math.lo device/device.lo config/neko_config.lo common/expression.lo : common/expression.f90 registries/registry.lo common/utils.lo config/num_types.lo common/system.lo : common/system.f90 -common/runtime_statistics.lo : common/runtime_statistics.f90 comm/comm.lo common/utils.lo math/matrix.lo io/file.lo common/json_utils.lo config/num_types.lo adt/tuple.lo adt/stack.lo common/log.lo +common/runtime_statistics.lo : common/runtime_statistics.f90 comm/comm.lo common/utils.lo data_types/matrix.lo io/file.lo common/json_utils.lo config/num_types.lo adt/tuple.lo adt/stack.lo common/log.lo common/user_access_singleton.lo : common/user_access_singleton.f90 case.lo +data_types/array.lo : data_types/array.f90 common/utils.lo math/bcknd/device/device_math.lo math/math.lo device/device.lo config/neko_config.lo config/num_types.lo data_types/host_array.lo : data_types/host_array.f90 math/math.lo config/num_types.lo data_types/device_array.lo : data_types/device_array.f90 common/utils.lo math/bcknd/device/device_math.lo device/device.lo config/neko_config.lo config/num_types.lo +data_types/vector.lo : data_types/vector.f90 config/num_types.lo data_types/array.lo +data_types/matrix.lo : data_types/matrix.f90 math/bcknd/cpu/cpu_matrix_math.lo common/utils.lo device/device.lo config/neko_config.lo config/num_types.lo data_types/array.lo +data_types/tensor3.lo : data_types/tensor3.f90 config/num_types.lo data_types/array.lo +data_types/tensor4.lo : data_types/tensor4.f90 config/num_types.lo data_types/array.lo math/mxm_wrapper.lo : math/mxm_wrapper.F90 common/utils.lo config/num_types.lo sem/speclib.lo : sem/speclib.f90 common/utils.lo math/math.lo config/num_types.lo -qoi/drag_torque.lo : qoi/drag_torque.f90 comm/comm.lo math/bcknd/device/device_math.lo device/device.lo config/neko_config.lo common/utils.lo config/num_types.lo sem/space.lo math/math.lo mesh/facet_zone.lo math/vector.lo sem/coef.lo field/field.lo +qoi/drag_torque.lo : qoi/drag_torque.f90 comm/comm.lo math/bcknd/device/device_math.lo device/device.lo config/neko_config.lo common/utils.lo config/num_types.lo sem/space.lo math/math.lo mesh/facet_zone.lo data_types/vector.lo sem/coef.lo field/field.lo sem/local_interpolation.lo : sem/local_interpolation.f90 config/neko_config.lo math/bcknd/device/device_math.lo device/device.lo field/field_list.lo field/field.lo common/utils.lo math/fast3d.lo math/math.lo mesh/point.lo config/num_types.lo sem/space.lo math/tensor.lo math/math.lo : math/math.f90 common/utils.lo comm/comm.lo config/num_types.lo math/mathops.lo : math/mathops.f90 config/num_types.lo math/fast3d.lo : math/fast3d.f90 math/math.lo sem/speclib.lo config/num_types.lo -sem/space.lo : sem/space.f90 math/math.lo math/mxm_wrapper.lo math/tensor.lo math/fast3d.lo common/utils.lo math/matrix.lo device/device.lo sem/speclib.lo config/num_types.lo config/neko_config.lo -sem/map_1d.lo : sem/map_1d.f90 math/math.lo common/utils.lo math/vector.lo math/matrix.lo field/field_list.lo sem/coef.lo comm/comm.lo device/device.lo mesh/mesh.lo gs/gather_scatter.lo sem/dofmap.lo sem/space.lo config/num_types.lo config/neko_config.lo -sem/map_2d.lo : sem/map_2d.f90 io/fld_file_data.lo comm/comm.lo device/device.lo field/field.lo math/math.lo common/utils.lo math/vector.lo sem/coef.lo field/field_list.lo mesh/mesh.lo gs/gather_scatter.lo sem/map_1d.lo sem/dofmap.lo config/num_types.lo config/neko_config.lo +sem/space.lo : sem/space.f90 math/math.lo math/mxm_wrapper.lo math/tensor.lo math/fast3d.lo common/utils.lo data_types/matrix.lo device/device.lo sem/speclib.lo config/num_types.lo config/neko_config.lo +sem/map_1d.lo : sem/map_1d.f90 math/matrix_math.lo math/math.lo common/utils.lo data_types/vector.lo data_types/matrix.lo field/field_list.lo sem/coef.lo comm/comm.lo device/device.lo mesh/mesh.lo gs/gather_scatter.lo sem/dofmap.lo sem/space.lo config/num_types.lo config/neko_config.lo +sem/map_2d.lo : sem/map_2d.f90 io/fld_file_data.lo comm/comm.lo device/device.lo field/field.lo math/math.lo common/utils.lo data_types/vector.lo sem/coef.lo field/field_list.lo mesh/mesh.lo gs/gather_scatter.lo sem/map_1d.lo sem/dofmap.lo config/num_types.lo config/neko_config.lo sem/dofmap.lo : sem/dofmap.f90 sem/interpolation.lo mesh/hex.lo mesh/quad.lo mesh/element.lo math/bcknd/device/device_math.lo math/math.lo device/device.lo math/tensor.lo math/fast3d.lo common/utils.lo config/num_types.lo adt/tuple.lo sem/space.lo common/mask.lo mesh/mesh.lo config/neko_config.lo sem/coef.lo : sem/coef.f90 comm/comm.lo common/utils.lo device/device.lo math/mxm_wrapper.lo sem/bcknd/device/device_coef.lo math/bcknd/device/device_math.lo mesh/mesh.lo common/log.lo math/math.lo sem/space.lo sem/dofmap.lo config/num_types.lo config/neko_config.lo gs/gs_ops.lo gs/gather_scatter.lo sem/cpr.lo : sem/cpr.f90 math/mxm_wrapper.lo sem/dofmap.lo common/log.lo sem/coef.lo mesh/mesh.lo math/tensor.lo math/math.lo sem/space.lo field/field.lo config/num_types.lo @@ -114,6 +119,7 @@ math/bcknd/cpu/cpu_dudxyz.lo : math/bcknd/cpu/cpu_dudxyz.f90 math/bcknd/cpu/opr_ math/bcknd/cpu/cpu_opgrad.lo : math/bcknd/cpu/cpu_opgrad.f90 math/bcknd/cpu/opr_cpu.lo math/bcknd/cpu/convect_scalar.lo : math/bcknd/cpu/convect_scalar.f90 math/math.lo math/bcknd/cpu/opr_cpu.lo math/bcknd/cpu/set_convect_rst.lo : math/bcknd/cpu/set_convect_rst.f90 math/bcknd/cpu/opr_cpu.lo +math/bcknd/cpu/cpu_matrix_math.lo : math/bcknd/cpu/cpu_matrix_math.f90 common/utils.lo config/num_types.lo math/bcknd/sx/sx_cdtp.lo : math/bcknd/sx/sx_cdtp.f90 math/math.lo math/bcknd/sx/opr_sx.lo math/bcknd/sx/sx_conv1.lo : math/bcknd/sx/sx_conv1.f90 math/bcknd/sx/opr_sx.lo math/bcknd/sx/sx_dudxyz.lo : math/bcknd/sx/sx_dudxyz.f90 math/math.lo math/bcknd/sx/opr_sx.lo @@ -122,11 +128,11 @@ math/bcknd/sx/sx_cfl.lo : math/bcknd/sx/sx_cfl.f90 math/bcknd/sx/opr_sx.lo math/bcknd/sx/sx_lambda2.lo : math/bcknd/sx/sx_lambda2.f90 math/math.lo math/bcknd/sx/opr_sx.lo math/bcknd/sx/sx_convect_scalar.lo : math/bcknd/sx/sx_convect_scalar.f90 math/math.lo config/num_types.lo math/bcknd/sx/opr_sx.lo math/bcknd/sx/sx_set_convect_rst.lo : math/bcknd/sx/sx_set_convect_rst.f90 config/num_types.lo math/bcknd/sx/opr_sx.lo -math/operators.lo : math/operators.f90 common/log.lo comm/comm.lo math/vector.lo registries/scratch_registry.lo math/bcknd/device/device_math.lo device/device.lo math/math.lo sem/interpolation.lo math/field_math.lo field/field_list.lo field/field.lo sem/coef.lo sem/space.lo math/bcknd/device/opr_device.lo math/bcknd/xsmm/opr_xsmm.lo math/bcknd/sx/opr_sx.lo math/bcknd/cpu/opr_cpu.lo config/num_types.lo config/neko_config.lo +math/operators.lo : math/operators.f90 common/log.lo comm/comm.lo data_types/vector.lo registries/scratch_registry.lo math/bcknd/device/device_math.lo device/device.lo math/math.lo sem/interpolation.lo math/field_math.lo field/field_list.lo field/field.lo sem/coef.lo sem/space.lo math/bcknd/device/opr_device.lo math/bcknd/xsmm/opr_xsmm.lo math/bcknd/sx/opr_sx.lo math/bcknd/cpu/opr_cpu.lo config/num_types.lo config/neko_config.lo math/bcknd/cpu/opr_cpu.lo : math/bcknd/cpu/opr_cpu.f90 math/mathops.lo sem/interpolation.lo gs/gather_scatter.lo math/math.lo sem/coef.lo sem/space.lo config/num_types.lo math/bcknd/sx/opr_sx.lo : math/bcknd/sx/opr_sx.f90 math/mathops.lo math/math.lo sem/coef.lo sem/space.lo config/num_types.lo sem/interpolation.lo gs/gather_scatter.lo math/bcknd/xsmm/opr_xsmm.lo : math/bcknd/xsmm/opr_xsmm.F90 math/mathops.lo gs/gather_scatter.lo sem/interpolation.lo mesh/mesh.lo math/math.lo sem/coef.lo sem/space.lo math/mxm_wrapper.lo config/num_types.lo -math/bcknd/device/opr_device.lo : math/bcknd/device/opr_device.F90 math/bcknd/device/device_mathops.lo math/bcknd/device/device_math.lo sem/interpolation.lo common/utils.lo registries/scratch_registry.lo math/vector.lo field/field.lo sem/coef.lo sem/space.lo device/device.lo config/num_types.lo gs/gather_scatter.lo +math/bcknd/device/opr_device.lo : math/bcknd/device/opr_device.F90 math/bcknd/device/device_mathops.lo math/bcknd/device/device_math.lo sem/interpolation.lo common/utils.lo registries/scratch_registry.lo data_types/vector.lo field/field.lo sem/coef.lo sem/space.lo device/device.lo config/num_types.lo gs/gather_scatter.lo math/tensor.lo : math/tensor.f90 device/device.lo config/neko_config.lo math/mxm_wrapper.lo config/num_types.lo math/bcknd/device/tensor_device.lo math/bcknd/sx/tensor_sx.lo math/bcknd/cpu/tensor_cpu.lo math/bcknd/xsmm/tensor_xsmm.lo math/bcknd/cpu/tensor_cpu.lo : math/bcknd/cpu/tensor_cpu.f90 math/mxm_wrapper.lo config/num_types.lo math/bcknd/sx/tensor_sx.lo : math/bcknd/sx/tensor_sx.f90 math/mxm_wrapper.lo config/num_types.lo @@ -136,16 +142,14 @@ math/bcknd/cpu/fdm_cpu.lo : math/bcknd/cpu/fdm_cpu.f90 math/bcknd/cpu/tensor_cpu math/bcknd/sx/fdm_sx.lo : math/bcknd/sx/fdm_sx.f90 math/bcknd/sx/tensor_sx.lo config/num_types.lo math/bcknd/xsmm/fdm_xsmm.lo : math/bcknd/xsmm/fdm_xsmm.f90 math/bcknd/xsmm/tensor_xsmm.lo config/num_types.lo math/schwarz.lo : math/schwarz.f90 bc/scalar_bc_projector.lo config/neko_config.lo device/device.lo math/fdm.lo math/bcknd/device/device_math.lo math/bcknd/device/device_schwarz.lo gs/gather_scatter.lo sem/dofmap.lo sem/space.lo mesh/mesh.lo math/math.lo config/num_types.lo -math/vector.lo : math/vector.f90 common/utils.lo math/bcknd/device/device_math.lo math/math.lo device/device.lo config/num_types.lo config/neko_config.lo -common/particles.lo : common/particles.f90 common/utils.lo math/vector.lo config/num_types.lo -math/vector_series.lo : math/vector_series.f90 math/vector.lo -math/vector_list.lo : math/vector_list.f90 comm/comm.lo common/utils.lo config/num_types.lo math/vector.lo -math/vector_math.lo : math/vector_math.f90 math/bcknd/device/device_math.lo math/math.lo common/utils.lo device/device.lo common/mask.lo math/vector.lo config/num_types.lo config/neko_config.lo -registries/registry.lo : registries/registry.f90 common/log.lo common/utils.lo sem/dofmap.lo registries/registry_entry.lo math/matrix.lo math/vector.lo field/field.lo config/num_types.lo -registries/registry_entry.lo : registries/registry_entry.f90 common/utils.lo sem/dofmap.lo field/field.lo math/matrix.lo math/vector.lo data_types/device_array.lo data_types/host_array.lo config/num_types.lo -registries/scratch_registry.lo : registries/scratch_registry.f90 common/utils.lo sem/dofmap.lo math/matrix_math.lo math/vector_math.lo math/field_math.lo math/bcknd/device/device_math.lo math/math.lo math/matrix.lo math/vector.lo field/field.lo data_types/device_array.lo data_types/host_array.lo registries/registry_entry.lo -math/matrix.lo : math/matrix.f90 common/utils.lo math/bcknd/device/device_math.lo device/device.lo config/num_types.lo config/neko_config.lo -math/matrix_math.lo : math/matrix_math.f90 math/bcknd/device/device_math.lo math/math.lo math/matrix.lo config/num_types.lo config/neko_config.lo +common/particles.lo : common/particles.f90 device/device.lo common/utils.lo data_types/vector.lo config/num_types.lo +math/vector_series.lo : math/vector_series.f90 data_types/vector.lo +math/vector_list.lo : math/vector_list.f90 comm/comm.lo common/utils.lo config/num_types.lo data_types/vector.lo +math/vector_math.lo : math/vector_math.f90 math/bcknd/device/device_math.lo math/math.lo common/utils.lo device/device.lo common/mask.lo data_types/vector.lo config/num_types.lo config/neko_config.lo +registries/registry.lo : registries/registry.f90 common/log.lo common/utils.lo sem/dofmap.lo registries/registry_entry.lo data_types/matrix.lo data_types/vector.lo field/field.lo config/num_types.lo +registries/registry_entry.lo : registries/registry_entry.f90 common/utils.lo sem/dofmap.lo field/field.lo data_types/matrix.lo data_types/vector.lo data_types/device_array.lo data_types/host_array.lo config/num_types.lo +registries/scratch_registry.lo : registries/scratch_registry.f90 common/utils.lo sem/dofmap.lo math/matrix_math.lo math/vector_math.lo math/field_math.lo math/bcknd/device/device_math.lo math/math.lo data_types/matrix.lo data_types/vector.lo field/field.lo data_types/device_array.lo data_types/host_array.lo registries/registry_entry.lo +math/matrix_math.lo : math/matrix_math.f90 math/bcknd/device/device_math.lo math/math.lo data_types/matrix.lo config/num_types.lo config/neko_config.lo math/signed_distance.lo : math/signed_distance.f90 adt/stack.lo math/math.lo common/utils.lo config/neko_config.lo device/device.lo mesh/aabb_tree.lo mesh/search_tree/aabb.lo mesh/tri_mesh.lo mesh/tri.lo field/field.lo config/num_types.lo multigrid/tree_amg.lo : multigrid/tree_amg.f90 config/neko_config.lo device/device.lo gs/gather_scatter.lo bc/scalar_bc_projector.lo math/ax.lo sem/space.lo mesh/mesh.lo sem/coef.lo math/bcknd/device/device_math.lo math/math.lo common/utils.lo config/num_types.lo multigrid/tree_amg_utils.lo : multigrid/tree_amg_utils.f90 gs/gather_scatter.lo multigrid/tree_amg.lo config/num_types.lo @@ -159,17 +163,17 @@ io/generic_file.lo : io/generic_file.f90 comm/comm.lo common/utils.lo config/num io/map_file.lo : io/map_file.f90 io/format/map.lo comm/comm.lo common/utils.lo io/generic_file.lo config/num_types.lo io/re2_file.lo : io/re2_file.f90 comm/comm.lo adt/htable.lo io/format/re2.lo common/utils.lo common/log.lo io/format/map.lo common/datadist.lo comm/mpi_types.lo mesh/point.lo mesh/mesh.lo io/map_file.lo config/num_types.lo io/generic_file.lo io/rea_file.lo : io/rea_file.f90 common/utils.lo common/log.lo adt/htable.lo common/datadist.lo comm/comm.lo io/map_file.lo io/re2_file.lo io/format/rea.lo io/format/map.lo mesh/point.lo mesh/mesh.lo config/num_types.lo io/generic_file.lo -io/bp_file.lo : io/bp_file.F90 io/buffer/buffer.lo io/buffer/buffer_4d_npar.lo io/buffer/buffer_4d.lo io/buffer/buffer_1d.lo comm/comm.lo common/datadist.lo io/fld_file_data.lo common/structs.lo mesh/mesh.lo sem/space.lo math/vector.lo sem/dofmap.lo field/field_list.lo io/generic_file.lo config/num_types.lo common/utils.lo -io/fld_file.lo : io/fld_file.f90 device/device.lo comm/mpi_types.lo math/math.lo common/datadist.lo comm/comm.lo common/utils.lo common/mask.lo mesh/mesh.lo common/log.lo io/fld_file_data.lo math/vector.lo common/structs.lo sem/space.lo sem/dofmap.lo field/field_list.lo field/field.lo io/generic_file.lo config/num_types.lo +io/bp_file.lo : io/bp_file.F90 io/buffer/buffer.lo io/buffer/buffer_4d_npar.lo io/buffer/buffer_4d.lo io/buffer/buffer_1d.lo comm/comm.lo common/datadist.lo io/fld_file_data.lo common/structs.lo mesh/mesh.lo sem/space.lo data_types/vector.lo sem/dofmap.lo field/field_list.lo io/generic_file.lo config/num_types.lo common/utils.lo +io/fld_file.lo : io/fld_file.f90 device/device.lo comm/mpi_types.lo math/math.lo common/datadist.lo comm/comm.lo common/utils.lo common/mask.lo mesh/mesh.lo common/log.lo io/fld_file_data.lo data_types/vector.lo common/structs.lo sem/space.lo sem/dofmap.lo field/field_list.lo field/field.lo io/generic_file.lo config/num_types.lo io/import_field_utils.lo : io/import_field_utils.f90 common/json_utils.lo device/device.lo common/log.lo common/utils.lo global_interpolation/global_interpolation.lo field/field_list.lo field/field.lo config/num_types.lo io/file.lo io/fld_file_data.lo -io/fld_file_data.lo : io/fld_file_data.f90 mesh/mesh.lo common/utils.lo global_interpolation/global_interpolation.lo sem/space.lo common/json_utils.lo sem/dofmap.lo device/device.lo common/log.lo field/field_list.lo field/field.lo sem/interpolation.lo math/vector.lo math/math.lo config/num_types.lo +io/fld_file_data.lo : io/fld_file_data.f90 mesh/mesh.lo common/utils.lo global_interpolation/global_interpolation.lo sem/space.lo common/json_utils.lo sem/dofmap.lo device/device.lo common/log.lo field/field_list.lo field/field.lo sem/interpolation.lo data_types/vector.lo math/math.lo config/num_types.lo io/vtk_file.lo : io/vtk_file.f90 comm/comm.lo common/log.lo mesh/tri_mesh.lo adt/htable.lo mesh/tet_mesh.lo field/mesh_field.lo sem/dofmap.lo field/field.lo mesh/mesh.lo common/utils.lo io/generic_file.lo config/num_types.lo io/stl_file.lo : io/stl_file.f90 io/format/stl.lo comm/comm.lo comm/mpi_types.lo mesh/point.lo common/log.lo mesh/tri_mesh.lo io/generic_file.lo config/num_types.lo io/nmsh_file.lo : io/nmsh_file.f90 common/log.lo comm/mpi_types.lo common/datadist.lo mesh/element.lo io/format/nmsh.lo adt/tuple.lo mesh/point.lo common/utils.lo mesh/mesh.lo config/num_types.lo comm/comm.lo io/generic_file.lo io/chkp_file.lo : io/chkp_file.f90 comm/comm.lo common/log.lo global_interpolation/global_interpolation.lo comm/mpi_types.lo sem/interpolation.lo math/math.lo mesh/mesh.lo sem/space.lo common/utils.lo sem/dofmap.lo field/field.lo config/num_types.lo common/checkpoint.lo field/field_series.lo io/generic_file.lo -io/csv_file.lo : io/csv_file.f90 comm/comm.lo common/log.lo config/num_types.lo common/utils.lo io/generic_file.lo math/matrix.lo math/vector.lo +io/csv_file.lo : io/csv_file.f90 comm/comm.lo common/log.lo config/num_types.lo common/utils.lo io/generic_file.lo data_types/matrix.lo data_types/vector.lo io/hdf5_session.lo : io/hdf5_session.F90 common/utils.lo -io/hdf5_file.lo : io/hdf5_file.F90 comm/comm.lo common/datadist.lo math/matrix.lo math/vector.lo common/log.lo sem/dofmap.lo field/field_series.lo field/field_list.lo field/field.lo mesh/mesh.lo common/utils.lo common/checkpoint.lo io/generic_file.lo config/num_types.lo +io/hdf5_file.lo : io/hdf5_file.F90 comm/comm.lo common/datadist.lo data_types/matrix.lo data_types/vector.lo common/log.lo sem/dofmap.lo field/field_series.lo field/field_list.lo field/field.lo mesh/mesh.lo common/utils.lo common/checkpoint.lo io/generic_file.lo config/num_types.lo io/vtkhdf_file.lo : io/vtkhdf_file.F90 io/format/vtk.lo device/device.lo comm/comm.lo common/log.lo sem/dofmap.lo field/field_series.lo field/field_list.lo field/field.lo mesh/mesh.lo common/utils.lo common/checkpoint.lo io/generic_file.lo config/num_types.lo io/file.lo : io/file.f90 io/hdf5_file.lo io/csv_file.lo io/stl_file.lo io/vtkhdf_file.lo io/vtk_file.lo io/fld_file_data.lo io/fld_file.lo io/bp_file.lo io/re2_file.lo io/rea_file.lo io/map_file.lo io/chkp_file.lo io/nmsh_file.lo io/generic_file.lo config/num_types.lo common/utils.lo io/output.lo : io/output.f90 io/file.lo config/num_types.lo @@ -177,14 +181,14 @@ io/fluid_output.lo : io/fluid_output.f90 io/fld_file.lo field/field.lo registrie io/field_output.lo : io/field_output.f90 io/output.lo device/device.lo config/neko_config.lo field/field_list.lo config/num_types.lo io/fld_file_output.lo : io/fld_file_output.f90 io/output.lo device/device.lo config/neko_config.lo field/field_list.lo config/num_types.lo io/chkp_output.lo : io/chkp_output.f90 config/num_types.lo io/output.lo common/checkpoint.lo -io/fluid_stats_output.lo : io/fluid_stats_output.f90 io/fld_file.lo math/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo fluid/fluid_stats.lo -io/fluid_sgs_stats_output.lo : io/fluid_sgs_stats_output.f90 io/fld_file.lo math/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo les/fluid_sgs_stats.lo -io/scalar_stats_output.lo : io/scalar_stats_output.f90 io/fld_file.lo math/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo scalar/scalar_stats.lo -io/scalar_sgs_stats_output.lo : io/scalar_sgs_stats_output.f90 io/fld_file.lo math/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo les/scalar_sgs_stats.lo -io/spatial_average_output.lo : io/spatial_average_output.f90 common/utils.lo registries/scratch_registry.lo registries/registry.lo io/output.lo math/matrix.lo math/field_math.lo device/device.lo sem/coef.lo sem/map_2d.lo sem/map_1d.lo io/fld_file_data.lo field/field_list.lo field/field.lo config/num_types.lo +io/fluid_stats_output.lo : io/fluid_stats_output.f90 io/fld_file.lo data_types/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo fluid/fluid_stats.lo +io/fluid_sgs_stats_output.lo : io/fluid_sgs_stats_output.f90 io/fld_file.lo data_types/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo les/fluid_sgs_stats.lo +io/scalar_stats_output.lo : io/scalar_stats_output.f90 io/fld_file.lo data_types/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo scalar/scalar_stats.lo +io/scalar_sgs_stats_output.lo : io/scalar_sgs_stats_output.f90 io/fld_file.lo data_types/matrix.lo io/output.lo device/device.lo io/fld_file_data.lo sem/map_2d.lo sem/map_1d.lo config/num_types.lo config/neko_config.lo les/scalar_sgs_stats.lo +io/spatial_average_output.lo : io/spatial_average_output.f90 common/utils.lo registries/scratch_registry.lo registries/registry.lo io/output.lo data_types/matrix.lo math/field_math.lo device/device.lo sem/coef.lo sem/map_2d.lo sem/map_1d.lo io/fld_file_data.lo field/field_list.lo field/field.lo config/num_types.lo io/data_streamer.lo : io/data_streamer.F90 common/log.lo comm/comm.lo common/utils.lo sem/coef.lo sem/space.lo mesh/mesh.lo config/num_types.lo io/output_controller.lo : io/output_controller.f90 common/time_based_controller.lo config/num_types.lo common/profiler.lo common/utils.lo common/log.lo common/time_state.lo comm/comm.lo io/fld_file.lo io/output.lo -global_interpolation/global_interpolation.lo : global_interpolation/global_interpolation.f90 common/structs.lo common/mask.lo math/math.lo math/matrix.lo math/vector_math.lo math/vector.lo global_interpolation/global_interpolation_comm.lo comm/comm.lo global_interpolation/pe_finder.lo global_interpolation/el_finder.lo global_interpolation/legendre_rst_finder.lo global_interpolation/cartesian_pe_finder.lo global_interpolation/cartesian_el_finder.lo global_interpolation/aabb_el_finder.lo global_interpolation/aabb_pe_finder.lo device/device.lo sem/local_interpolation.lo common/utils.lo common/json_utils.lo common/log.lo sem/dofmap.lo adt/stack.lo sem/space.lo config/neko_config.lo config/num_types.lo +global_interpolation/global_interpolation.lo : global_interpolation/global_interpolation.f90 common/structs.lo common/mask.lo math/math.lo math/matrix_math.lo data_types/matrix.lo math/vector_math.lo data_types/vector.lo global_interpolation/global_interpolation_comm.lo comm/comm.lo global_interpolation/pe_finder.lo global_interpolation/el_finder.lo global_interpolation/legendre_rst_finder.lo global_interpolation/cartesian_pe_finder.lo global_interpolation/cartesian_el_finder.lo global_interpolation/aabb_el_finder.lo global_interpolation/aabb_pe_finder.lo device/device.lo sem/local_interpolation.lo common/utils.lo common/json_utils.lo common/log.lo sem/dofmap.lo adt/stack.lo sem/space.lo config/neko_config.lo config/num_types.lo global_interpolation/global_interpolation_comm.lo : global_interpolation/global_interpolation_comm.f90 adt/stack.lo comm/comm.lo config/num_types.lo global_interpolation/aabb_pe_finder.lo : global_interpolation/aabb_pe_finder.f90 math/math.lo mesh/aabb_tree.lo mesh/search_tree/aabb.lo comm/comm.lo mesh/point.lo adt/htable.lo adt/tuple.lo common/utils.lo adt/stack.lo global_interpolation/pe_finder.lo sem/space.lo config/neko_config.lo config/num_types.lo global_interpolation/aabb_el_finder.lo : global_interpolation/aabb_el_finder.f90 mesh/aabb_tree.lo mesh/search_tree/aabb.lo mesh/point.lo adt/tuple.lo adt/stack.lo sem/space.lo global_interpolation/el_finder.lo config/neko_config.lo config/num_types.lo @@ -192,33 +196,33 @@ global_interpolation/cartesian_el_finder.lo : global_interpolation/cartesian_el_ global_interpolation/cartesian_pe_finder.lo : global_interpolation/cartesian_pe_finder.f90 comm/comm.lo mesh/point.lo adt/htable.lo common/utils.lo adt/stack.lo global_interpolation/pe_finder.lo sem/space.lo config/neko_config.lo config/num_types.lo global_interpolation/el_finder.lo : global_interpolation/el_finder.f90 mesh/point.lo adt/stack.lo config/num_types.lo global_interpolation/pe_finder.lo : global_interpolation/pe_finder.f90 mesh/point.lo adt/stack.lo config/num_types.lo -global_interpolation/legendre_rst_finder.lo : global_interpolation/legendre_rst_finder.f90 math/bcknd/device/device_math.lo sem/bcknd/device/device_local_interpolation.lo math/bcknd/cpu/tensor_cpu.lo math/math.lo math/matrix.lo math/vector.lo common/utils.lo sem/space.lo device/device.lo config/neko_config.lo config/num_types.lo -io/mean_field_output.lo : io/mean_field_output.f90 io/fld_file.lo math/matrix.lo io/output.lo field/mean_field.lo device/device.lo sem/coef.lo sem/map_1d.lo sem/map_2d.lo io/fld_file_data.lo config/neko_config.lo field/field_list.lo config/num_types.lo +global_interpolation/legendre_rst_finder.lo : global_interpolation/legendre_rst_finder.f90 math/bcknd/device/device_math.lo sem/bcknd/device/device_local_interpolation.lo math/bcknd/cpu/tensor_cpu.lo math/matrix_math.lo math/vector_math.lo math/math.lo data_types/matrix.lo data_types/vector.lo common/utils.lo sem/space.lo device/device.lo config/neko_config.lo config/num_types.lo +io/mean_field_output.lo : io/mean_field_output.f90 io/fld_file.lo data_types/matrix.lo io/output.lo field/mean_field.lo device/device.lo sem/coef.lo sem/map_1d.lo sem/map_2d.lo io/fld_file_data.lo config/neko_config.lo field/field_list.lo config/num_types.lo common/profiler.lo : common/profiler.F90 common/runtime_statistics.lo common/craypat.lo device/hip/roctx.lo device/cuda/nvtx.lo device/device.lo config/neko_config.lo common/craypat.lo : common/craypat.F90 bc/scalar_bc_projector.lo : bc/scalar_bc_projector.f90 common/utils.lo math/bcknd/device/device_math.lo device/device.lo config/num_types.lo config/neko_config.lo math/math.lo registries/scratch_registry.lo io/fld_file.lo field/field.lo common/mask.lo bc/bc_list.lo bc/bc.lo -bc/vector_bc_projector.lo : bc/vector_bc_projector.f90 math/operators.lo bc/scalar_bc_projector.lo bc/bcknd/device/device_coupled_vector_bc_projector.lo math/bcknd/device/device_math.lo device/device.lo common/utils.lo adt/tuple.lo config/num_types.lo config/neko_config.lo gs/gs_ops.lo math/math.lo registries/scratch_registry.lo math/matrix.lo common/log.lo adt/htable.lo mesh/hex.lo io/fld_file.lo field/field_list.lo field/field.lo sem/dofmap.lo sem/coef.lo common/mask.lo bc/mixed_bc.lo bc/bc_list.lo bc/bc.lo +bc/vector_bc_projector.lo : bc/vector_bc_projector.f90 math/operators.lo bc/scalar_bc_projector.lo bc/bcknd/device/device_coupled_vector_bc_projector.lo math/bcknd/device/device_math.lo device/device.lo common/utils.lo adt/tuple.lo config/num_types.lo config/neko_config.lo gs/gs_ops.lo math/math.lo registries/scratch_registry.lo data_types/matrix.lo common/log.lo adt/htable.lo mesh/hex.lo io/fld_file.lo field/field_list.lo field/field.lo sem/dofmap.lo sem/coef.lo common/mask.lo bc/mixed_bc.lo bc/bc_list.lo bc/bc.lo bc/bc.lo : bc/bc.f90 io/file.lo common/time_state.lo common/log.lo common/utils.lo math/bcknd/device/device_math.lo math/math.lo gs/gs_ops.lo field/field.lo adt/tuple.lo adt/stack.lo common/mask.lo mesh/facet_zone.lo mesh/mesh.lo sem/space.lo sem/coef.lo sem/dofmap.lo device/device.lo config/num_types.lo config/neko_config.lo -bc/mixed_bc.lo : bc/mixed_bc.f90 math/field_math.lo math/bcknd/device/device_math.lo math/math.lo registries/scratch_registry.lo io/fld_file.lo field/field_list.lo field/field.lo math/matrix.lo common/mask.lo device/device.lo config/num_types.lo config/neko_config.lo bc/bc.lo +bc/mixed_bc.lo : bc/mixed_bc.f90 math/field_math.lo math/bcknd/device/device_math.lo math/math.lo registries/scratch_registry.lo io/fld_file.lo field/field_list.lo field/field.lo data_types/matrix.lo common/mask.lo device/device.lo config/num_types.lo config/neko_config.lo bc/bc.lo bc/bc_list.lo : bc/bc_list.f90 common/time_state.lo bc/bc.lo common/utils.lo device/device.lo field/field.lo config/num_types.lo config/neko_config.lo bc/dirichlet.lo : bc/dirichlet.f90 common/time_state.lo common/json_utils.lo sem/coef.lo bc/bc.lo config/num_types.lo bc/bcknd/device/device_dirichlet.lo -bc/neumann.lo : bc/neumann.f90 common/time_state.lo bc/bcknd/device/device_neumann.lo device/device.lo math/bcknd/device/device_math.lo config/neko_config.lo math/vector.lo math/math.lo common/json_utils.lo sem/coef.lo common/utils.lo bc/bc.lo config/num_types.lo +bc/neumann.lo : bc/neumann.f90 common/time_state.lo bc/bcknd/device/device_neumann.lo device/device.lo math/vector_math.lo math/bcknd/device/device_math.lo config/neko_config.lo data_types/vector.lo math/math.lo common/json_utils.lo sem/coef.lo common/utils.lo bc/bc.lo config/num_types.lo bc/no_slip.lo : bc/no_slip.f90 registries/registry.lo common/utils.lo math/bcknd/device/device_math.lo math/math.lo common/time_state.lo common/json_utils.lo bc/zero_dirichlet.lo field/field.lo sem/coef.lo config/num_types.lo -bc/shear_stress.lo : bc/shear_stress.f90 common/time_state.lo math/vector.lo common/json_utils.lo bc/neumann.lo sem/coef.lo common/utils.lo bc/bcknd/device/device_constrain_mixed_bc.lo bc/mixed_bc.lo bc/bc.lo config/num_types.lo +bc/shear_stress.lo : bc/shear_stress.f90 common/time_state.lo data_types/vector.lo common/json_utils.lo bc/neumann.lo sem/coef.lo common/utils.lo bc/bcknd/device/device_constrain_mixed_bc.lo bc/mixed_bc.lo bc/bc.lo config/num_types.lo bc/dong_outflow.lo : bc/dong_outflow.f90 common/time_state.lo common/json_utils.lo registries/registry.lo bc/bcknd/device/device_dong_outflow.lo common/utils.lo sem/coef.lo sem/dofmap.lo field/field.lo bc/bc.lo config/num_types.lo device/device.lo bc/dirichlet.lo config/neko_config.lo bc/zero_dirichlet.lo : bc/zero_dirichlet.f90 common/time_state.lo sem/coef.lo bc/bc.lo config/num_types.lo bc/bcknd/device/device_zero_dirichlet.lo bc/inflow.lo : bc/inflow.f90 common/time_state.lo common/utils.lo common/json_utils.lo sem/coef.lo bc/bc.lo config/num_types.lo bc/bcknd/device/device_inflow.lo bc/field_dirichlet.lo : bc/field_dirichlet.f90 common/time_state.lo common/json_utils.lo sem/dofmap.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo field/field.lo common/utils.lo bc/bc_list.lo bc/bc.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo -bc/field_neumann.lo : bc/field_neumann.f90 common/time_state.lo config/neko_config.lo bc/bcknd/device/device_neumann.lo math/bcknd/device/device_math.lo math/math.lo common/json_utils.lo common/utils.lo math/vector.lo field/field_list.lo field/field.lo bc/bc.lo sem/coef.lo config/num_types.lo +bc/field_neumann.lo : bc/field_neumann.f90 common/time_state.lo config/neko_config.lo bc/bcknd/device/device_neumann.lo math/bcknd/device/device_math.lo math/math.lo common/json_utils.lo common/utils.lo data_types/vector.lo field/field_list.lo field/field.lo bc/bc.lo sem/coef.lo config/num_types.lo bc/field_dirichlet_vector.lo : bc/field_dirichlet_vector.f90 common/time_state.lo bc/field_dirichlet.lo sem/dofmap.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo field/field.lo common/utils.lo bc/bc_list.lo bc/bc.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo bc/expression_dirichlet.lo : bc/expression_dirichlet.f90 common/utils.lo common/time_state.lo common/json_utils.lo bc/bcknd/device/device_inhom_dirichlet.lo device/device.lo config/neko_config.lo common/expression.lo sem/coef.lo bc/bc.lo config/num_types.lo bc/expression_dirichlet_vector.lo : bc/expression_dirichlet_vector.f90 common/utils.lo common/time_state.lo common/json_utils.lo bc/bcknd/device/device_inhom_dirichlet.lo device/device.lo config/neko_config.lo bc/expression_dirichlet.lo common/expression.lo sem/coef.lo bc/bc.lo config/num_types.lo -bc/overset_interface.lo : bc/overset_interface.f90 common/time_state.lo registries/scratch_registry.lo common/log.lo field/field.lo common/json_utils.lo adt/stack.lo common/utils.lo time_schemes/iextm_time_scheme.lo bc/field_dirichlet.lo device/device.lo math/vector_math.lo math/vector_list.lo math/vector_series.lo math/vector.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo bc/bc.lo common/mask.lo global_interpolation/global_interpolation.lo sem/coef.lo config/num_types.lo registries/registry.lo config/neko_config.lo comm/comm.lo -bc/overset_interface_vector.lo : bc/overset_interface_vector.f90 common/log.lo registries/scratch_registry.lo common/time_state.lo time_schemes/iextm_time_scheme.lo common/json_utils.lo adt/stack.lo bc/overset_interface.lo bc/field_dirichlet.lo device/device.lo math/vector_math.lo math/vector_series.lo math/vector_list.lo math/vector.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo field/field.lo common/utils.lo bc/bc_list.lo bc/bc.lo sem/dofmap.lo common/mask.lo global_interpolation/global_interpolation.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo registries/registry.lo config/neko_config.lo comm/comm.lo -bc/facet_normal.lo : bc/facet_normal.f90 common/time_state.lo device/device.lo adt/htable.lo common/utils.lo bc/bc.lo sem/coef.lo math/vector.lo math/bcknd/device/device_math.lo math/math.lo config/neko_config.lo config/num_types.lo +bc/overset_interface.lo : bc/overset_interface.f90 common/time_state.lo registries/scratch_registry.lo common/log.lo field/field.lo common/json_utils.lo adt/stack.lo common/utils.lo time_schemes/iextm_time_scheme.lo bc/field_dirichlet.lo device/device.lo math/vector_math.lo math/vector_list.lo math/vector_series.lo data_types/vector.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo bc/bc.lo common/mask.lo global_interpolation/global_interpolation.lo sem/coef.lo config/num_types.lo registries/registry.lo config/neko_config.lo comm/comm.lo +bc/overset_interface_vector.lo : bc/overset_interface_vector.f90 common/log.lo registries/scratch_registry.lo common/time_state.lo time_schemes/iextm_time_scheme.lo common/json_utils.lo adt/stack.lo bc/overset_interface.lo bc/field_dirichlet.lo device/device.lo math/vector_math.lo math/vector_series.lo math/vector_list.lo data_types/vector.lo math/bcknd/device/device_math.lo math/math.lo field/field_list.lo field/field.lo common/utils.lo bc/bc_list.lo bc/bc.lo sem/dofmap.lo common/mask.lo global_interpolation/global_interpolation.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo registries/registry.lo config/neko_config.lo comm/comm.lo +bc/facet_normal.lo : bc/facet_normal.f90 common/time_state.lo device/device.lo adt/htable.lo common/utils.lo bc/bc.lo sem/coef.lo data_types/vector.lo math/bcknd/device/device_math.lo math/math.lo config/neko_config.lo config/num_types.lo bc/symmetry.lo : bc/symmetry.f90 common/time_state.lo sem/coef.lo bc/bcknd/device/device_constrain_mixed_bc.lo bc/mixed_bc.lo bc/bc.lo config/num_types.lo bc/symmetry_aligned.lo : bc/symmetry_aligned.f90 common/time_state.lo bc/zero_dirichlet.lo sem/coef.lo adt/tuple.lo bc/bc.lo config/num_types.lo bc/bcknd/device/device_symmetry_aligned.lo -bc/non_normal_aligned.lo : bc/non_normal_aligned.f90 common/time_state.lo global_interpolation/global_interpolation.lo field/field.lo registries/scratch_registry.lo math/vector_math.lo math/vector.lo common/utils.lo common/json_utils.lo sem/coef.lo adt/tuple.lo config/num_types.lo io/import_field_utils.lo bc/bcknd/device/device_inhom_dirichlet.lo bc/dirichlet.lo bc/bc.lo +bc/non_normal_aligned.lo : bc/non_normal_aligned.f90 common/time_state.lo global_interpolation/global_interpolation.lo field/field.lo registries/scratch_registry.lo math/vector_math.lo data_types/vector.lo common/utils.lo common/json_utils.lo sem/coef.lo adt/tuple.lo config/num_types.lo io/import_field_utils.lo bc/bcknd/device/device_inhom_dirichlet.lo bc/dirichlet.lo bc/bc.lo bc/non_normal.lo : bc/non_normal.f90 common/time_state.lo common/utils.lo common/json_utils.lo sem/coef.lo bc/bcknd/device/device_constrain_mixed_bc.lo config/num_types.lo bc/mixed_bc.lo bc/bc.lo bc/blasius.lo : bc/blasius.f90 common/time_state.lo common/json_utils.lo bc/bc.lo fluid/flow_profile.lo bc/bcknd/device/device_inhom_dirichlet.lo device/device.lo common/utils.lo sem/coef.lo config/num_types.lo bc/wall_model_bc.lo : bc/wall_model_bc.f90 common/time_state.lo common/user_intf.lo bc/shear_stress.lo wall_models/wall_model.lo sem/coef.lo common/json_utils.lo common/utils.lo config/num_types.lo @@ -253,21 +257,21 @@ time_schemes/bdf_time_scheme.lo : time_schemes/bdf_time_scheme.f90 common/utils. time_schemes/ext_time_scheme.lo : time_schemes/ext_time_scheme.f90 common/utils.lo math/math.lo time_schemes/time_scheme.lo config/num_types.lo time_schemes/iextm_time_scheme.lo : time_schemes/iextm_time_scheme.f90 common/utils.lo math/math.lo time_schemes/time_scheme.lo config/num_types.lo time_schemes/ab_time_scheme.lo : time_schemes/ab_time_scheme.f90 common/utils.lo math/math.lo time_schemes/time_scheme.lo config/num_types.lo -time_schemes/time_scheme_controller.lo : time_schemes/time_scheme_controller.f90 math/vector.lo device/device.lo time_schemes/ab_time_scheme.lo time_schemes/ext_time_scheme.lo time_schemes/bdf_time_scheme.lo config/num_types.lo config/neko_config.lo +time_schemes/time_scheme_controller.lo : time_schemes/time_scheme_controller.f90 data_types/vector.lo device/device.lo time_schemes/ab_time_scheme.lo time_schemes/ext_time_scheme.lo time_schemes/bdf_time_scheme.lo config/num_types.lo config/neko_config.lo time_schemes/runge_kutta_scheme.lo : time_schemes/runge_kutta_scheme.f90 device/device.lo common/utils.lo math/math.lo time_schemes/time_scheme.lo config/num_types.lo config/neko_config.lo -common/boundary_data.lo : common/boundary_data.f90 comm/comm.lo common/utils.lo config/neko_config.lo math/vector_math.lo math/field_math.lo mesh/mesh.lo registries/registry.lo math/vector.lo field/field.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo +common/boundary_data.lo : common/boundary_data.f90 comm/comm.lo common/utils.lo config/neko_config.lo math/vector_math.lo math/field_math.lo mesh/mesh.lo registries/registry.lo data_types/vector.lo field/field.lo bc/dirichlet.lo sem/coef.lo config/num_types.lo common/time_based_controller.lo : common/time_based_controller.f90 common/time_state.lo common/utils.lo config/num_types.lo common/stats_quant.lo : common/stats_quant.f90 config/num_types.lo common/statistics.lo : common/statistics.f90 comm/comm.lo common/log.lo common/stats_quant.lo config/num_types.lo common/rhs_maker.lo : common/rhs_maker.f90 field/field.lo field/field_series.lo config/num_types.lo common/rhs_maker_fctry.lo : common/rhs_maker_fctry.f90 config/neko_config.lo common/bcknd/device/rhs_maker_device.lo common/bcknd/sx/rhs_maker_sx.lo common/bcknd/cpu/rhs_maker_cpu.lo common/rhs_maker.lo -simulation_components/probes.lo : simulation_components/probes.F90 device/device.lo config/neko_config.lo comm/comm.lo case.lo math/bcknd/device/device_math.lo math/math.lo io/hdf5_file.lo io/csv_file.lo io/file.lo mesh/point_zone_registry.lo mesh/point_zone.lo math/tensor.lo global_interpolation/global_interpolation.lo common/json_utils.lo sem/dofmap.lo registries/registry.lo simulation_components/simulation_component.lo common/time_state.lo field/field_list.lo common/utils.lo common/log.lo math/vector.lo math/matrix.lo config/num_types.lo -simulation_components/boundary_operation.lo : simulation_components/boundary_operation.f90 common/time_based_controller.lo math/vector_math.lo math/vector.lo io/file.lo sem/space.lo common/utils.lo common/log.lo bc/neumann.lo sem/coef.lo common/time_state.lo common/json_utils.lo case.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo -simulation_components/boundary_flux.lo : simulation_components/boundary_flux.f90 device/device.lo config/neko_config.lo qoi/drag_torque.lo common/time_based_controller.lo math/vector_math.lo math/vector.lo io/file.lo common/utils.lo common/log.lo bc/neumann.lo sem/coef.lo common/time_state.lo common/json_utils.lo case.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo -simulation_components/boundary_data_writer_simcomp.lo : simulation_components/boundary_data_writer_simcomp.f90 comm/comm.lo common/utils.lo common/log.lo ale/ale_manager.lo io/hdf5_file.lo io/csv_file.lo io/file.lo common/boundary_data.lo math/matrix.lo math/tensor.lo math/math.lo device/device.lo math/vector.lo sem/coef.lo registries/registry.lo field/field_list.lo field/field.lo case.lo common/time_state.lo common/time_based_controller.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo config/neko_config.lo +simulation_components/probes.lo : simulation_components/probes.F90 device/device.lo config/neko_config.lo comm/comm.lo case.lo math/bcknd/device/device_math.lo math/math.lo io/hdf5_file.lo io/csv_file.lo io/file.lo mesh/point_zone_registry.lo mesh/point_zone.lo math/tensor.lo global_interpolation/global_interpolation.lo common/json_utils.lo sem/dofmap.lo registries/registry.lo simulation_components/simulation_component.lo common/time_state.lo field/field_list.lo common/utils.lo common/log.lo data_types/vector.lo data_types/matrix.lo config/num_types.lo +simulation_components/boundary_operation.lo : simulation_components/boundary_operation.f90 common/time_based_controller.lo math/vector_math.lo data_types/vector.lo io/file.lo sem/space.lo common/utils.lo common/log.lo bc/neumann.lo sem/coef.lo common/time_state.lo common/json_utils.lo case.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo +simulation_components/boundary_flux.lo : simulation_components/boundary_flux.f90 device/device.lo config/neko_config.lo qoi/drag_torque.lo common/time_based_controller.lo math/vector_math.lo data_types/vector.lo io/file.lo common/utils.lo common/log.lo bc/neumann.lo sem/coef.lo common/time_state.lo common/json_utils.lo case.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo +simulation_components/boundary_data_writer_simcomp.lo : simulation_components/boundary_data_writer_simcomp.f90 comm/comm.lo common/utils.lo common/log.lo ale/ale_manager.lo io/hdf5_file.lo io/csv_file.lo io/file.lo common/boundary_data.lo data_types/matrix.lo math/tensor.lo math/math.lo device/device.lo data_types/vector.lo sem/coef.lo registries/registry.lo field/field_list.lo field/field.lo case.lo common/time_state.lo common/time_based_controller.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo config/neko_config.lo simulation_components/data_streamer_simcomp.lo : simulation_components/data_streamer_simcomp.F90 common/utils.lo device/device.lo registries/registry.lo common/time_based_controller.lo common/log.lo io/data_streamer.lo common/time_state.lo comm/comm.lo case.lo field/field.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo simulation_components/field_subsampler.lo : simulation_components/field_subsampler.f90 simulation_components/field_writer.lo registries/scratch_registry.lo sem/interpolation.lo field/field_list.lo mesh/mesh.lo sem/space.lo sem/dofmap.lo registries/registry.lo mesh/point_zone_registry.lo common/time_based_controller.lo mesh/point_zone.lo case.lo common/json_utils.lo simulation_components/simulation_component.lo common/utils.lo comm/comm.lo math/bcknd/device/device_math.lo math/math.lo device/device.lo common/log.lo config/neko_config.lo common/time_state.lo sem/coef.lo field/field.lo config/num_types.lo -simulation_components/force_torque.lo : simulation_components/force_torque.f90 common/utils.lo ale/ale_rigid_kinematics.lo ale/ale_manager.lo device/device.lo comm/comm.lo math/bcknd/device/device_math.lo math/math.lo config/neko_config.lo common/log.lo qoi/drag_torque.lo bc/dirichlet.lo math/vector.lo sem/coef.lo common/json_utils.lo case.lo math/operators.lo field/field.lo common/time_state.lo registries/scratch_registry.lo registries/registry.lo simulation_components/simulation_component.lo common/time_based_controller.lo config/num_types.lo +simulation_components/force_torque.lo : simulation_components/force_torque.f90 common/utils.lo ale/ale_rigid_kinematics.lo ale/ale_manager.lo device/device.lo comm/comm.lo math/bcknd/device/device_math.lo math/math.lo config/neko_config.lo common/log.lo qoi/drag_torque.lo bc/dirichlet.lo data_types/vector.lo sem/coef.lo common/json_utils.lo case.lo math/operators.lo field/field.lo common/time_state.lo registries/scratch_registry.lo registries/registry.lo simulation_components/simulation_component.lo common/time_based_controller.lo config/num_types.lo simulation_components/fluid_stats_simcomp.lo : simulation_components/fluid_stats_simcomp.f90 comm/comm.lo common/json_utils.lo common/log.lo common/utils.lo sem/coef.lo case.lo io/fluid_stats_output.lo fluid/fluid_stats.lo field/field.lo common/time_state.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/fluid_sgs_stats_simcomp.lo : simulation_components/fluid_sgs_stats_simcomp.f90 comm/comm.lo common/json_utils.lo common/log.lo common/utils.lo sem/coef.lo case.lo io/fluid_sgs_stats_output.lo les/fluid_sgs_stats.lo field/field.lo common/time_state.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/scalar_stats_simcomp.lo : simulation_components/scalar_stats_simcomp.f90 comm/comm.lo common/json_utils.lo common/log.lo common/utils.lo sem/coef.lo case.lo io/scalar_stats_output.lo scalar/scalar_stats.lo field/field.lo common/time_state.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo @@ -275,12 +279,12 @@ simulation_components/scalar_sgs_stats_simcomp.lo : simulation_components/scalar simulation_components/spatial_average.lo : simulation_components/spatial_average.f90 io/spatial_average_output.lo common/utils.lo sem/coef.lo common/json_utils.lo common/time_state.lo case.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/user_stats.lo : simulation_components/user_stats.f90 common/utils.lo common/time_based_controller.lo common/time_state.lo sem/coef.lo field/mean_field.lo common/json_utils.lo io/mean_field_output.lo case.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/field_writer.lo : simulation_components/field_writer.f90 common/log.lo common/utils.lo common/time_based_controller.lo common/json_utils.lo io/field_output.lo mesh/point_zone.lo io/fld_file.lo mesh/point_zone_registry.lo case.lo registries/registry.lo common/time_state.lo simulation_components/simulation_component.lo config/num_types.lo -simulation_components/wall_shear_stress_simcomp.lo : simulation_components/wall_shear_stress_simcomp.f90 common/utils.lo common/log.lo ale/ale_manager.lo config/neko_config.lo math/bcknd/device/device_math.lo math/math.lo qoi/drag_torque.lo math/operators.lo common/boundary_data.lo math/vector.lo sem/coef.lo registries/scratch_registry.lo registries/registry.lo field/field.lo case.lo common/time_state.lo common/time_based_controller.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo +simulation_components/wall_shear_stress_simcomp.lo : simulation_components/wall_shear_stress_simcomp.f90 common/utils.lo common/log.lo ale/ale_manager.lo config/neko_config.lo math/bcknd/device/device_math.lo math/math.lo qoi/drag_torque.lo math/operators.lo common/boundary_data.lo data_types/vector.lo sem/coef.lo registries/scratch_registry.lo registries/registry.lo field/field.lo case.lo common/time_state.lo common/time_based_controller.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo common/bcknd/cpu/rhs_maker_cpu.lo : common/bcknd/cpu/rhs_maker_cpu.f90 registries/scratch_registry.lo config/num_types.lo field/field.lo field/field_series.lo common/rhs_maker.lo common/bcknd/sx/rhs_maker_sx.lo : common/bcknd/sx/rhs_maker_sx.f90 registries/scratch_registry.lo config/num_types.lo field/field.lo field/field_series.lo common/rhs_maker.lo common/bcknd/device/rhs_maker_device.lo : common/bcknd/device/rhs_maker_device.F90 config/num_types.lo field/field.lo field/field_series.lo math/bcknd/device/device_math.lo device/device.lo common/rhs_maker.lo config/neko_config.lo : config/neko_config.f90 -case.lo : case.f90 math/vector.lo registries/registry.lo comm/comm.lo scalar/scalars.lo mesh/point_zone_registry.lo registries/scratch_registry.lo common/json_utils.lo common/time_state.lo scalar/scalar_scheme.lo scalar/scalar_pnpn.lo common/user_intf.lo common/jobctrl.lo common/log.lo time_schemes/time_scheme_controller.lo common/checkpoint.lo math/math.lo mesh/mesh.lo common/utils.lo io/file.lo scalar/scalar_ic.lo fluid/flow_ic.lo io/output_controller.lo comm/redist.lo comm/parmetis.lo field/mesh_field.lo io/chkp_output.lo io/fluid_output.lo fluid/fluid_scheme_base.lo fluid/fluid_scheme_incompressible.lo fluid/fluid_pnpn.lo config/num_types.lo +case.lo : case.f90 data_types/vector.lo registries/registry.lo comm/comm.lo scalar/scalars.lo mesh/point_zone_registry.lo registries/scratch_registry.lo common/json_utils.lo common/time_state.lo scalar/scalar_scheme.lo scalar/scalar_pnpn.lo common/user_intf.lo common/jobctrl.lo common/log.lo time_schemes/time_scheme_controller.lo common/checkpoint.lo math/math.lo mesh/mesh.lo common/utils.lo io/file.lo scalar/scalar_ic.lo fluid/flow_ic.lo io/output_controller.lo comm/redist.lo comm/parmetis.lo field/mesh_field.lo io/chkp_output.lo io/fluid_output.lo fluid/fluid_scheme_base.lo fluid/fluid_scheme_incompressible.lo fluid/fluid_pnpn.lo config/num_types.lo common/user_intf.lo : common/user_intf.f90 common/time_state.lo bc/bc.lo common/log.lo common/utils.lo common/json_utils.lo config/num_types.lo bc/field_neumann.lo bc/field_dirichlet.lo bc/overset_interface.lo mesh/mesh.lo bc/bc_list.lo sem/coef.lo common/mask.lo math/vector_list.lo field/field_list.lo field/field.lo fluid/stress_formulation/pnpn_res_stress_fctry.lo : fluid/stress_formulation/pnpn_res_stress_fctry.f90 fluid/stress_formulation/bcknd/device/pnpn_res_stress_device.lo fluid/stress_formulation/bcknd/cpu/pnpn_res_stress_cpu.lo config/neko_config.lo fluid/pnpn_res.lo fluid/stress_formulation/bcknd/cpu/pnpn_res_stress_cpu.lo : fluid/stress_formulation/bcknd/cpu/pnpn_res_stress_cpu.f90 math/math.lo sem/space.lo config/num_types.lo mesh/mesh.lo registries/scratch_registry.lo fluid/pnpn_res.lo bc/facet_normal.lo sem/coef.lo math/ax.lo field/field.lo math/operators.lo gs/gather_scatter.lo @@ -387,15 +391,15 @@ simulation_components/simulation_component.lo : simulation_components/simulation simulation_components/simcomp_executor.lo : simulation_components/simcomp_executor.f90 common/log.lo common/utils.lo common/time_state.lo case.lo common/json_utils.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/spectral_error.lo : simulation_components/spectral_error.f90 registries/registry.lo case.lo common/json_utils.lo simulation_components/simulation_component.lo simulation_components/field_writer.lo common/utils.lo comm/comm.lo device/device.lo common/log.lo config/neko_config.lo math/bcknd/device/device_math.lo math/tensor.lo common/time_state.lo io/file.lo math/math.lo field/field_list.lo sem/coef.lo field/field.lo config/num_types.lo simulation_components/lambda2.lo : simulation_components/lambda2.f90 common/utils.lo common/time_based_controller.lo simulation_components/field_writer.lo case.lo math/operators.lo common/time_state.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo common/json_utils.lo config/num_types.lo -lpt/bcknd/cpu/lpt_periodic_bc_cpu.lo : lpt/bcknd/cpu/lpt_periodic_bc_cpu.f90 math/vector.lo config/num_types.lo -lpt/bcknd/cpu/lpt_wall_collision_cpu.lo : lpt/bcknd/cpu/lpt_wall_collision_cpu.f90 math/vector.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo config/num_types.lo -lpt/bcknd/device/lpt_periodic_bc_device.lo : lpt/bcknd/device/lpt_periodic_bc_device.F90 device/device.lo common/utils.lo math/vector.lo config/num_types.lo -lpt/bcknd/device/lpt_wall_collision_device.lo : lpt/bcknd/device/lpt_wall_collision_device.F90 device/device.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo common/utils.lo math/vector.lo -lpt/lpt_periodic_bc.lo : lpt/lpt_periodic_bc.f90 device/device.lo lpt/bcknd/device/lpt_periodic_bc_device.lo lpt/bcknd/cpu/lpt_periodic_bc_cpu.lo math/vector.lo comm/comm.lo mesh/mesh.lo sem/dofmap.lo sem/coef.lo config/neko_config.lo config/num_types.lo -lpt/lpt_output.lo : lpt/lpt_output.f90 comm/comm.lo math/tensor.lo math/matrix.lo io/hdf5_file.lo io/file.lo common/utils.lo config/num_types.lo -lpt/lpt.lo : lpt/lpt.f90 data_types/host_array.lo registries/scratch_registry.lo common/profiler.lo device/device.lo common/particles.lo math/vector.lo io/csv_file.lo comm/comm.lo lpt/lpt_output.lo lpt/lpt_migration.lo lpt/lpt_periodic_bc.lo time_schemes/ab_time_scheme.lo math/vector_math.lo math/matrix.lo io/file.lo common/utils.lo common/log.lo global_interpolation/global_interpolation.lo common/time_based_controller.lo common/time_state.lo common/json_utils.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo case.lo field/field.lo registries/registry.lo config/num_types.lo +lpt/bcknd/cpu/lpt_periodic_bc_cpu.lo : lpt/bcknd/cpu/lpt_periodic_bc_cpu.f90 data_types/vector.lo config/num_types.lo +lpt/bcknd/cpu/lpt_wall_collision_cpu.lo : lpt/bcknd/cpu/lpt_wall_collision_cpu.f90 data_types/vector.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo config/num_types.lo +lpt/bcknd/device/lpt_periodic_bc_device.lo : lpt/bcknd/device/lpt_periodic_bc_device.F90 device/device.lo common/utils.lo data_types/vector.lo config/num_types.lo +lpt/bcknd/device/lpt_wall_collision_device.lo : lpt/bcknd/device/lpt_wall_collision_device.F90 device/device.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo common/utils.lo data_types/vector.lo +lpt/lpt_periodic_bc.lo : lpt/lpt_periodic_bc.f90 device/device.lo lpt/bcknd/device/lpt_periodic_bc_device.lo lpt/bcknd/cpu/lpt_periodic_bc_cpu.lo data_types/vector.lo comm/comm.lo mesh/mesh.lo sem/dofmap.lo sem/coef.lo config/neko_config.lo config/num_types.lo +lpt/lpt_output.lo : lpt/lpt_output.f90 comm/comm.lo math/tensor.lo data_types/matrix.lo io/hdf5_file.lo io/file.lo common/utils.lo config/num_types.lo +lpt/lpt.lo : lpt/lpt.f90 data_types/host_array.lo registries/scratch_registry.lo common/profiler.lo device/device.lo common/particles.lo data_types/vector.lo io/csv_file.lo comm/comm.lo lpt/lpt_output.lo lpt/lpt_migration.lo lpt/lpt_periodic_bc.lo time_schemes/ab_time_scheme.lo math/vector_math.lo data_types/matrix.lo io/file.lo common/utils.lo common/log.lo global_interpolation/global_interpolation.lo common/time_based_controller.lo common/time_state.lo common/json_utils.lo sem/coef.lo sem/dofmap.lo mesh/mesh.lo case.lo field/field.lo registries/registry.lo config/num_types.lo simulation_components/lpt_simcomp.lo : simulation_components/lpt_simcomp.f90 lpt/lpt.lo common/time_state.lo case.lo simulation_components/simulation_component.lo -lpt/lpt_migration.lo : lpt/lpt_migration.f90 common/particles.lo registries/scratch_registry.lo device/device.lo math/vector.lo comm/comm.lo lpt/lpt_periodic_bc.lo global_interpolation/global_interpolation_comm.lo global_interpolation/global_interpolation.lo config/num_types.lo +lpt/lpt_migration.lo : lpt/lpt_migration.f90 common/particles.lo registries/scratch_registry.lo device/device.lo data_types/vector.lo comm/comm.lo lpt/lpt_periodic_bc.lo global_interpolation/global_interpolation_comm.lo global_interpolation/global_interpolation.lo config/num_types.lo lpt/lpt_wall_collision.lo : lpt/lpt_wall_collision.f90 registries/scratch_registry.lo device/device.lo lpt/bcknd/device/lpt_wall_collision_device.lo lpt/bcknd/cpu/lpt_wall_collision_cpu.lo config/neko_config.lo lpt/lpt.lo simulation_components/curl_simcomp.lo : simulation_components/curl_simcomp.f90 common/utils.lo common/time_based_controller.lo registries/scratch_registry.lo device/device.lo simulation_components/field_writer.lo common/json_utils.lo io/fld_file_output.lo case.lo math/operators.lo common/time_state.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo simulation_components/divergence_simcomp.lo : simulation_components/divergence_simcomp.f90 common/utils.lo common/time_based_controller.lo simulation_components/field_writer.lo common/json_utils.lo case.lo math/operators.lo common/time_state.lo field/field.lo registries/registry.lo simulation_components/simulation_component.lo config/num_types.lo @@ -429,7 +433,7 @@ filter/mappings.lo : filter/mappings.f90 filter/bcknd/device/mappings_device.lo filter/filter.lo : filter/filter.f90 field/field.lo sem/coef.lo config/num_types.lo filter/filter_fctry.lo : filter/filter_fctry.f90 common/utils.lo filter/PDE_filter.lo filter/elementwise_filter.lo filter/filter.lo filter/PDE_filter.lo : filter/PDE_filter.f90 common/json_utils.lo math/bcknd/device/device_math.lo common/utils.lo krylov/bcknd/sx/pc_jacobi_sx.lo krylov/bcknd/device/pc_jacobi_device.lo krylov/bcknd/cpu/pc_jacobi.lo sem/dofmap.lo config/neko_config.lo common/log.lo math/field_math.lo registries/scratch_registry.lo filter/filter.lo mesh/mesh.lo fluid/pnpn_res.lo gs/gather_scatter.lo common/profiler.lo bc/neumann.lo bc/scalar_bc_projector.lo bc/bc_list.lo krylov/precon.lo krylov/krylov.lo math/ax.lo sem/coef.lo field/field.lo registries/registry.lo config/num_types.lo -filter/elementwise_filter.lo : filter/elementwise_filter.f90 math/bcknd/device/device_math.lo device/device.lo math/tensor.lo math/mxm_wrapper.lo math/matrix.lo sem/speclib.lo common/json_utils.lo config/neko_config.lo common/utils.lo sem/coef.lo field/field.lo math/math.lo filter/filter.lo config/num_types.lo +filter/elementwise_filter.lo : filter/elementwise_filter.f90 math/bcknd/device/device_math.lo device/device.lo math/tensor.lo math/mxm_wrapper.lo data_types/matrix.lo sem/speclib.lo common/json_utils.lo config/neko_config.lo common/utils.lo sem/coef.lo field/field.lo math/math.lo filter/filter.lo config/num_types.lo filter/bcknd/cpu/mappings_cpu.lo : filter/bcknd/cpu/mappings_cpu.f90 config/num_types.lo filter/bcknd/device/mappings_device.lo : filter/bcknd/device/mappings_device.F90 filter/bcknd/device/metal/metal_mappings.lo filter/bcknd/device/opencl/opencl_mappings.lo filter/bcknd/device/hip/hip_mappings.lo filter/bcknd/device/cuda/cuda_mappings.lo common/utils.lo config/num_types.lo filter/bcknd/device/cuda/cuda_mappings.lo : filter/bcknd/device/cuda/cuda_mappings.f90 config/num_types.lo @@ -466,26 +470,26 @@ les/deardorff.lo : les/deardorff.f90 common/log.lo registries/registry.lo les/bc les/bcknd/cpu/deardorff_cpu.lo : les/bcknd/cpu/deardorff_cpu.f90 math/math.lo gs/gs_ops.lo sem/coef.lo math/operators.lo field/field.lo registries/registry.lo registries/scratch_registry.lo field/field_list.lo config/num_types.lo common/utils.lo les/bcknd/device/deardorff_device.lo : les/bcknd/device/deardorff_device.f90 les/bcknd/device/device_deardorff_nut.lo math/bcknd/device/device_math.lo gs/gs_ops.lo sem/coef.lo math/operators.lo field/field.lo registries/registry.lo registries/scratch_registry.lo math/math.lo common/utils.lo config/num_types.lo les/bcknd/device/device_deardorff_nut.lo : les/bcknd/device/device_deardorff_nut.F90 comm/comm.lo common/utils.lo config/num_types.lo -wall_models/wall_sampler.lo : wall_models/wall_sampler.f90 common/utils.lo device/device.lo config/neko_config.lo io/fld_file_output.lo math/vector_math.lo registries/scratch_registry.lo common/user_intf.lo math/vector.lo sem/coef.lo field/field.lo config/num_types.lo -wall_models/wall_gll_sampler.lo : wall_models/wall_gll_sampler.f90 device/device.lo math/bcknd/device/device_math.lo math/math.lo common/utils.lo config/neko_config.lo common/mask.lo common/user_intf.lo wall_models/wall_sampler.lo common/json_utils.lo math/vector.lo sem/coef.lo field/field.lo config/num_types.lo -wall_models/wall_distance_sampler.lo : wall_models/wall_distance_sampler.f90 device/device.lo common/utils.lo config/neko_config.lo global_interpolation/global_interpolation.lo common/user_intf.lo wall_models/wall_sampler.lo common/json_utils.lo math/vector.lo sem/coef.lo field/field.lo config/num_types.lo +wall_models/wall_sampler.lo : wall_models/wall_sampler.f90 common/utils.lo device/device.lo config/neko_config.lo io/fld_file_output.lo math/vector_math.lo registries/scratch_registry.lo common/user_intf.lo data_types/vector.lo sem/coef.lo field/field.lo config/num_types.lo +wall_models/wall_gll_sampler.lo : wall_models/wall_gll_sampler.f90 device/device.lo math/bcknd/device/device_math.lo math/math.lo common/utils.lo config/neko_config.lo common/mask.lo common/user_intf.lo wall_models/wall_sampler.lo common/json_utils.lo data_types/vector.lo sem/coef.lo field/field.lo config/num_types.lo +wall_models/wall_distance_sampler.lo : wall_models/wall_distance_sampler.f90 device/device.lo common/utils.lo config/neko_config.lo global_interpolation/global_interpolation.lo common/user_intf.lo wall_models/wall_sampler.lo common/json_utils.lo data_types/vector.lo sem/coef.lo field/field.lo config/num_types.lo wall_models/wall_sampler_fctry.lo : wall_models/wall_sampler_fctry.f90 common/utils.lo wall_models/wall_distance_sampler.lo wall_models/wall_gll_sampler.lo wall_models/wall_sampler.lo common/json_utils.lo -wall_models/wall_model.lo : wall_models/wall_model.f90 common/json_utils.lo wall_models/bcknd/device/wall_model_device.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo common/utils.lo math/vector.lo device/device.lo config/neko_config.lo sem/coef.lo sem/dofmap.lo registries/registry.lo field/field.lo config/num_types.lo +wall_models/wall_model.lo : wall_models/wall_model.f90 common/json_utils.lo wall_models/bcknd/device/wall_model_device.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo common/utils.lo data_types/vector.lo device/device.lo config/neko_config.lo sem/coef.lo sem/dofmap.lo registries/registry.lo field/field.lo config/num_types.lo wall_models/bcknd/device/wall_model_device.lo : wall_models/bcknd/device/wall_model_device.F90 common/utils.lo config/num_types.lo -wall_models/spalding.lo : wall_models/spalding.f90 common/log.lo registries/scratch_registry.lo math/bcknd/device/device_math.lo math/math.lo math/vector.lo math/field_math.lo wall_models/bcknd/device/spalding_device.lo wall_models/bcknd/cpu/spalding_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo -wall_models/cai_sagaut_model_ii.lo : wall_models/cai_sagaut_model_ii.f90 registries/scratch_registry.lo math/bcknd/device/device_math.lo math/math.lo math/vector.lo math/field_math.lo wall_models/bcknd/device/cai_sagaut_model_ii_device.lo wall_models/bcknd/cpu/cai_sagaut_model_ii_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo +wall_models/spalding.lo : wall_models/spalding.f90 common/log.lo registries/scratch_registry.lo math/bcknd/device/device_math.lo math/math.lo data_types/vector.lo math/field_math.lo wall_models/bcknd/device/spalding_device.lo wall_models/bcknd/cpu/spalding_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo +wall_models/cai_sagaut_model_ii.lo : wall_models/cai_sagaut_model_ii.f90 registries/scratch_registry.lo math/bcknd/device/device_math.lo math/math.lo data_types/vector.lo math/field_math.lo wall_models/bcknd/device/cai_sagaut_model_ii_device.lo wall_models/bcknd/cpu/cai_sagaut_model_ii_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo wall_models/bcknd/cpu/spalding_cpu.lo : wall_models/bcknd/cpu/spalding_cpu.f90 common/log.lo config/num_types.lo wall_models/bcknd/cpu/cai_sagaut_model_ii_cpu.lo : wall_models/bcknd/cpu/cai_sagaut_model_ii_cpu.f90 math/math.lo config/num_types.lo wall_models/bcknd/device/spalding_device.lo : wall_models/bcknd/device/spalding_device.F90 common/utils.lo config/num_types.lo wall_models/bcknd/device/cai_sagaut_model_ii_device.lo : wall_models/bcknd/device/cai_sagaut_model_ii_device.F90 common/utils.lo config/num_types.lo -wall_models/rough_log_law.lo : wall_models/rough_log_law.f90 common/log.lo math/bcknd/device/device_math.lo math/math.lo registries/scratch_registry.lo wall_models/bcknd/cpu/rough_log_law_cpu.lo wall_models/bcknd/device/rough_log_law_device.lo common/json_utils.lo registries/registry.lo common/utils.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo math/vector.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo +wall_models/rough_log_law.lo : wall_models/rough_log_law.f90 common/log.lo math/bcknd/device/device_math.lo math/math.lo registries/scratch_registry.lo wall_models/bcknd/cpu/rough_log_law_cpu.lo wall_models/bcknd/device/rough_log_law_device.lo common/json_utils.lo registries/registry.lo common/utils.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo data_types/vector.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo wall_models/bcknd/cpu/rough_log_law_cpu.lo : wall_models/bcknd/cpu/rough_log_law_cpu.f90 config/num_types.lo wall_models/bcknd/device/rough_log_law_device.lo : wall_models/bcknd/device/rough_log_law_device.F90 common/utils.lo config/num_types.lo -wall_models/most.lo : wall_models/most.f90 math/bcknd/device/device_math.lo math/math.lo math/vector_math.lo math/vector.lo common/log.lo common/utils.lo registries/scratch_registry.lo wall_models/bcknd/cpu/most_cpu.lo wall_models/bcknd/device/most_device.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo +wall_models/most.lo : wall_models/most.f90 math/bcknd/device/device_math.lo math/math.lo math/vector_math.lo data_types/vector.lo common/log.lo common/utils.lo registries/scratch_registry.lo wall_models/bcknd/cpu/most_cpu.lo wall_models/bcknd/device/most_device.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo wall_models/bcknd/cpu/most_cpu.lo : wall_models/bcknd/cpu/most_cpu.f90 math/math.lo common/log.lo common/utils.lo config/num_types.lo wall_models/bcknd/device/most_device.lo : wall_models/bcknd/device/most_device.F90 common/utils.lo config/num_types.lo -wall_models/richardson.lo : wall_models/richardson.f90 math/bcknd/device/device_math.lo math/math.lo math/vector_math.lo math/vector.lo common/log.lo common/utils.lo registries/scratch_registry.lo wall_models/bcknd/device/richardson_device.lo wall_models/bcknd/cpu/richardson_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo +wall_models/richardson.lo : wall_models/richardson.f90 math/bcknd/device/device_math.lo math/math.lo math/vector_math.lo data_types/vector.lo common/log.lo common/utils.lo registries/scratch_registry.lo wall_models/bcknd/device/richardson_device.lo wall_models/bcknd/cpu/richardson_cpu.lo common/json_utils.lo registries/registry.lo common/user_intf.lo wall_models/wall_sampler_fctry.lo wall_models/wall_sampler.lo wall_models/wall_model.lo config/neko_config.lo sem/coef.lo config/num_types.lo field/field.lo wall_models/bcknd/cpu/richardson_cpu.lo : wall_models/bcknd/cpu/richardson_cpu.f90 math/math.lo common/log.lo common/utils.lo config/num_types.lo wall_models/bcknd/device/richardson_device.lo : wall_models/bcknd/device/richardson_device.F90 common/utils.lo config/num_types.lo wall_models/wall_model_fctry.lo : wall_models/wall_model_fctry.f90 common/utils.lo wall_models/richardson.lo wall_models/most.lo wall_models/rough_log_law.lo wall_models/cai_sagaut_model_ii.lo wall_models/spalding.lo wall_models/wall_model.lo -neko.lo : neko.f90 io/hdf5_session.lo ale/ale_manager.lo common/user_access_singleton.lo source_terms/source_term.lo common/time_step_controller.lo common/time_based_controller.lo simulation_components/lambda2.lo simulation_components/force_torque.lo simulation_components/weak_gradient_simcomp.lo simulation_components/gradient_simcomp.lo simulation_components/curl_simcomp.lo simulation_components/divergence_simcomp.lo simulation_components/derivative_simcomp.lo simulation_components/field_writer.lo les/les_model.lo common/json_utils.lo common/runtime_statistics.lo bc/field_neumann.lo bc/field_dirichlet_vector.lo bc/field_dirichlet.lo mesh/point_zone_registry.lo mesh/point_zones/sphere_point_zone.lo mesh/point_zones/box_point_zone.lo mesh/point_zone.lo sem/point_interpolator.lo common/time_interpolator.lo io/data_streamer.lo simulation_components/simcomp_executor.lo registries/scratch_registry.lo registries/registry.lo qoi/drag_torque.lo common/system.lo common/profiler.lo simulation_components/spectral_error.lo simulation_components/probes.lo common/boundary_data.lo simulation_components/boundary_flux.lo simulation_components/boundary_operation.lo simulation_components/simulation_component.lo math/tensor.lo math/matrix.lo math/vector_list.lo math/vector.lo source_terms/user_source_term.lo field/field_list.lo fluid/fluid_stats.lo sem/cpr.lo sem/map_2d.lo sem/map_1d.lo math/bcknd/device/device_math.lo device/device.lo common/jobctrl.lo common/time_state.lo common/signal.lo common/user_intf.lo common/projection.lo math/mathops.lo math/operators.lo simulation.lo io/output.lo io/output_controller.lo case.lo config/neko_config.lo comm/parmetis.lo math/ax.lo bc/dirichlet.lo bc/bc_list.lo bc/zero_dirichlet.lo bc/vector_bc_projector.lo bc/scalar_bc_projector.lo bc/mixed_bc.lo bc/bc.lo sem/coef.lo krylov/krylov.lo gs/gather_scatter.lo comm/mpi_types.lo math/field_math.lo field/field.lo io/file.lo global_interpolation/global_interpolation.lo math/mxm_wrapper.lo io/import_field_utils.lo io/format/map.lo field/mesh_field.lo mesh/point.lo mesh/mesh.lo adt/tuple.lo adt/stack.lo adt/uset.lo adt/htable.lo sem/space.lo sem/dofmap.lo sem/speclib.lo math/math.lo common/mask.lo common/log.lo common/utils.lo comm/comm.lo config/num_types.lo +neko.lo : neko.f90 io/hdf5_session.lo ale/ale_manager.lo common/user_access_singleton.lo source_terms/source_term.lo common/time_step_controller.lo common/time_based_controller.lo simulation_components/lambda2.lo simulation_components/force_torque.lo simulation_components/weak_gradient_simcomp.lo simulation_components/gradient_simcomp.lo simulation_components/curl_simcomp.lo simulation_components/divergence_simcomp.lo simulation_components/derivative_simcomp.lo simulation_components/field_writer.lo les/les_model.lo common/json_utils.lo common/runtime_statistics.lo bc/field_neumann.lo bc/field_dirichlet_vector.lo bc/field_dirichlet.lo mesh/point_zone_registry.lo mesh/point_zones/sphere_point_zone.lo mesh/point_zones/box_point_zone.lo mesh/point_zone.lo sem/point_interpolator.lo common/time_interpolator.lo io/data_streamer.lo simulation_components/simcomp_executor.lo registries/scratch_registry.lo registries/registry.lo qoi/drag_torque.lo common/system.lo common/profiler.lo simulation_components/spectral_error.lo simulation_components/probes.lo common/boundary_data.lo simulation_components/boundary_flux.lo simulation_components/boundary_operation.lo simulation_components/simulation_component.lo math/tensor.lo data_types/tensor4.lo data_types/tensor3.lo data_types/matrix.lo math/vector_list.lo data_types/vector.lo source_terms/user_source_term.lo field/field_list.lo fluid/fluid_stats.lo sem/cpr.lo sem/map_2d.lo sem/map_1d.lo math/bcknd/device/device_math.lo device/device.lo common/jobctrl.lo common/time_state.lo common/signal.lo common/user_intf.lo common/projection.lo math/mathops.lo math/operators.lo simulation.lo io/output.lo io/output_controller.lo case.lo config/neko_config.lo comm/parmetis.lo math/ax.lo bc/dirichlet.lo bc/bc_list.lo bc/zero_dirichlet.lo bc/vector_bc_projector.lo bc/scalar_bc_projector.lo bc/mixed_bc.lo bc/bc.lo sem/coef.lo krylov/krylov.lo gs/gather_scatter.lo comm/mpi_types.lo math/field_math.lo field/field.lo io/file.lo global_interpolation/global_interpolation.lo math/mxm_wrapper.lo io/import_field_utils.lo io/format/map.lo field/mesh_field.lo mesh/point.lo mesh/mesh.lo adt/tuple.lo adt/stack.lo adt/uset.lo adt/htable.lo sem/space.lo sem/dofmap.lo sem/speclib.lo math/math.lo common/mask.lo common/log.lo common/utils.lo comm/comm.lo config/num_types.lo diff --git a/src/Makefile.am b/src/Makefile.am index df2bcd2cd031..d75621a18159 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,8 +36,13 @@ neko_fortran_SOURCES = \ common/system.f90\ common/runtime_statistics.f90\ common/user_access_singleton.f90\ + data_types/array.f90\ data_types/host_array.f90\ data_types/device_array.f90\ + data_types/vector.f90\ + data_types/matrix.f90\ + data_types/tensor3.f90\ + data_types/tensor4.f90\ math/mxm_wrapper.F90\ sem/speclib.f90 \ qoi/drag_torque.f90\ @@ -117,6 +122,7 @@ neko_fortran_SOURCES = \ math/bcknd/cpu/cpu_opgrad.f90\ math/bcknd/cpu/convect_scalar.f90\ math/bcknd/cpu/set_convect_rst.f90\ + math/bcknd/cpu/cpu_matrix_math.f90\ math/bcknd/sx/sx_cdtp.f90\ math/bcknd/sx/sx_conv1.f90\ math/bcknd/sx/sx_dudxyz.f90\ @@ -139,7 +145,6 @@ neko_fortran_SOURCES = \ math/bcknd/sx/fdm_sx.f90\ math/bcknd/xsmm/fdm_xsmm.f90\ math/schwarz.f90\ - math/vector.f90\ common/particles.f90\ math/vector_series.f90\ math/vector_list.f90\ @@ -147,7 +152,6 @@ neko_fortran_SOURCES = \ registries/registry.f90\ registries/registry_entry.f90\ registries/scratch_registry.f90\ - math/matrix.f90\ math/matrix_math.f90\ math/signed_distance.f90\ multigrid/tree_amg.f90\ diff --git a/src/bc/neumann.f90 b/src/bc/neumann.f90 index 2497b39bf650..093e725b2643 100644 --- a/src/bc/neumann.f90 +++ b/src/bc/neumann.f90 @@ -43,6 +43,7 @@ module neumann use vector, only : vector_t use neko_config, only : NEKO_BCKND_DEVICE use device_math, only : device_cfill, device_copy + use vector_math, only : vector_cfill, vector_copy use device, only : device_memcpy, DEVICE_TO_HOST use device_neumann, only : device_neumann_apply_scalar, & device_neumann_apply_vector @@ -360,7 +361,7 @@ subroutine neumann_finalize(this) ! Allocate flux vectors and assign to initial constant values do i = 1, size(this%init_flux_) call this%flux(i)%init(this%facet_node_msk(0)) - this%flux(i) = this%init_flux_(i) + call vector_cfill(this%flux(i), this%init_flux_(i)) end do this%uniform_0 = .true. @@ -383,7 +384,7 @@ subroutine neumann_set_flux_scalar(this, flux, comp) "neumann_set_flux_scalar") end if - this%flux(comp) = flux + call vector_cfill(this%flux(comp), flux) ! If we were uniform zero before, and this comp is set to zero, we are still ! uniform zero this%uniform_0 = abscmp(flux, 0.0_rp) .and. this%uniform_0 @@ -404,7 +405,7 @@ subroutine neumann_set_flux_array(this, flux, comp) "neuman_set_flux_array") end if - this%flux(comp) = flux + call vector_copy(this%flux(comp), flux) ! Once a flux is set explicitly, we no longer assume it is uniform zero. this%uniform_0 = .false. diff --git a/src/bc/non_normal_aligned.f90 b/src/bc/non_normal_aligned.f90 index e44cd65e4ca8..c2653a76b992 100644 --- a/src/bc/non_normal_aligned.f90 +++ b/src/bc/non_normal_aligned.f90 @@ -44,7 +44,7 @@ module non_normal_aligned json_get_or_lookup use utils, only : neko_error use vector, only : vector_t - use vector_math, only : vector_masked_gather_copy_0 + use vector_math, only : vector_cfill, vector_masked_gather_copy_0 use scratch_registry, only : neko_scratch_registry use field, only : field_t use global_interpolation, only : GLOB_INTERP_TOL, GLOB_INTERP_PAD @@ -421,9 +421,9 @@ subroutine non_normal_aligned_finalize(this) call this%value_z%init(this%bc_z%msk(0), 'non_normal_aligned_z') if (this%use_constant_value) then - this%value_x = this%constant_value(1) - this%value_y = this%constant_value(2) - this%value_z = this%constant_value(3) + call vector_cfill(this%value_x, this%constant_value(1)) + call vector_cfill(this%value_y, this%constant_value(2)) + call vector_cfill(this%value_z, this%constant_value(3)) else if (this%read_values_from_field) then call neko_scratch_registry%request_field(value_x_field, scratch_idx(1), & .true.) diff --git a/src/bc/vector_bc_projector.f90 b/src/bc/vector_bc_projector.f90 index 512e0a3c5929..f6a8d2309bf2 100644 --- a/src/bc/vector_bc_projector.f90 +++ b/src/bc/vector_bc_projector.f90 @@ -980,10 +980,6 @@ subroutine coupled_vector_bc_projector_rebuild_basis(this) call rzero(normal_y_field%x, dof_size) call rzero(normal_z_field%x, dof_size) - this%n = 0.0_rp - this%t1 = 0.0_rp - this%t2 = 0.0_rp - do i = 1, this%bcs%size() bc => this%bcs%get(i) diff --git a/src/common/particles.f90 b/src/common/particles.f90 index 7cfb48d9a8bb..07315d85c6e4 100644 --- a/src/common/particles.f90 +++ b/src/common/particles.f90 @@ -35,6 +35,7 @@ module particles use num_types, only : rp use vector, only : vector_t use utils, only : neko_error + use device, only : HOST_TO_DEVICE implicit none private @@ -112,31 +113,34 @@ subroutine particles_init(this, x, y, z, time_order, u, v, w, diameter, & call this%acc_zlaglag%init(this%n) call this%d%init(this%n) call this%rho%init(this%n) - this%x = x - this%y = y - this%z = z + + this%x%x = x + this%y%x = y + this%z%x = z if (present(u) .and. present(v) .and. present(w)) then - this%u = u - this%v = v - this%w = w + this%u%x = u + this%v%x = v + this%w%x = w else - this%u = 0.0_rp - this%v = 0.0_rp - this%w = 0.0_rp + this%u%x = 0.0_rp + this%v%x = 0.0_rp + this%w%x = 0.0_rp end if if (present(diameter)) then - this%d = diameter + this%d%x = diameter else - this%d = 0.0_rp + this%d%x = 0.0_rp end if if (present(density)) then - this%rho = density + this%rho%x = density else - this%rho = 0.0_rp + this%rho%x = 0.0_rp end if do i = 1, this%n this%ids(i) = i end do + + call this%device_sync(HOST_TO_DEVICE) end subroutine particles_init subroutine particles_free(this) diff --git a/src/data_types/array.f90 b/src/data_types/array.f90 new file mode 100644 index 000000000000..51272981be2b --- /dev/null +++ b/src/data_types/array.f90 @@ -0,0 +1,224 @@ +! Copyright (c) 2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +!> Defines an array +module array + use, intrinsic :: iso_c_binding, only : c_ptr, C_NULL_PTR + use num_types, only : rp + use neko_config, only : NEKO_BCKND_DEVICE + use device, only : device_map, device_unmap, & + device_memcpy, device_sync, HOST_TO_DEVICE + use math, only : cfill, copy + use device_math, only : device_copy, device_cfill + use utils, only : neko_error, NEKO_VARNAME_LEN + implicit none + private + + type, abstract, public :: array_t + !> Name of the array + character(len=NEKO_VARNAME_LEN) :: name = "" + !> Array entries. + real(kind=rp), allocatable :: data(:) + !> Device pointer. + type(c_ptr) :: x_d = C_NULL_PTR + !> Size of array. + integer, private :: n = 0 + contains + + ! ----------------------------------------------------------------------- ! + ! Deferred methods + + !> All array types must implement the free method. + procedure(array_free), pass(this), deferred :: free + + ! ----------------------------------------------------------------------- ! + ! Shared interfaces + + !> Initialise a array of size `n` and optional name. + procedure, pass(this) :: init_base => array_init_base + !> Deallocate a array. + procedure, pass(this) :: free_base => array_free_base + !> Copy data between host and device + procedure, pass(this) :: copy_from => array_copy_from + !> Returns the number of entries in the array. + procedure, pass(this) :: size => array_size + !> Determine if the array has been allocated. + procedure, pass(this) :: is_allocated => array_is_allocated + + ! ----------------------------------------------------------------------- ! + ! Private interfaces + + !> Allocation of the array, without initialisation. + procedure, pass(this), private :: alloc => array_allocate + + end type array_t + + ! Define the abstract interfaces for the deferred procedures + abstract interface + subroutine array_free(this) + import array_t + class(array_t), intent(inout) :: this + end subroutine array_free + end interface + +contains + + !> Initialise a array of size @a n. + subroutine array_init_base(this, n, name) + class(array_t), intent(inout), target :: this + integer, intent(in) :: n + character(len=*), intent(in), optional :: name + + call this%alloc(n) + if (NEKO_BCKND_DEVICE .eq. 1) then + ! Zero the device side first: under zero-copy the device then + ! faults the pages (device first touch), which gives contiguous + ! physical mappings and thus better GPU TLB utilisation + call device_cfill(this%x_d, 0.0_rp, n) + call device_sync() + end if + call cfill(this%data, 0.0_rp, n) + + if (present(name)) then + this%name = name + end if + + end subroutine array_init_base + + !> Vector allocation without initialisation. + subroutine array_allocate(this, n) + class(array_t), intent(inout) :: this + integer, intent(in) :: n + + if (this%n .eq. n) return + call this%free_base() + + this%n = n + allocate(this%data(n)) + if (NEKO_BCKND_DEVICE .eq. 1) then + call device_map(this%data, this%x_d, n) + end if + + end subroutine array_allocate + + !> Deallocate a array. + subroutine array_free_base(this) + class(array_t), intent(inout) :: this + + if (allocated(this%data)) then + if (NEKO_BCKND_DEVICE .eq. 1) then + call device_unmap(this%data, this%x_d) + end if + deallocate(this%data) + end if + + this%n = 0 + this%name = "" + + end subroutine array_free_base + + !> Return the number of entries in the array. + pure function array_size(this) result(s) + class(array_t), intent(in) :: this + integer :: s + s = this%n + end function array_size + + !> Easy way to copy between host and device. + !! @param this array to copy to/from device/host + !! @memdir direction to copy (HOST_TO_DEVICE or DEVICE_TO_HOST) + !! @sync whether the memcopy to be blocking or not + subroutine array_copy_from(this, memdir, sync) + class(array_t), intent(inout) :: this + integer, intent(in) :: memdir + logical, intent(in) :: sync + + if (NEKO_BCKND_DEVICE .eq. 1) then + call device_memcpy(this%data, this%x_d, this%size(), memdir, sync) + end if + + end subroutine array_copy_from + + !> Check the the object is currently allocated + pure function array_is_allocated(this) result(is_allocated) + class(array_t), intent(in) :: this + logical :: is_allocated + is_allocated = allocated(this%data) + end function array_is_allocated + + !> Assignment \f$ this = w \f$. + subroutine array_assign_array(this, w) + class(array_t), intent(inout) :: this + class(array_t), intent(in) :: w + + if (this%size() .ne. w%size()) then + call neko_error('Error in array assignment: incompatible size') + end if + + if (NEKO_BCKND_DEVICE .eq. 1) then + call device_copy(this%x_d, w%x_d, this%size()) + else + call copy(this%data, w%data, this%size()) + end if + + end subroutine array_assign_array + + !> Assignment \f$ this = s \f$. + subroutine array_assign_scalar(this, s) + class(array_t), intent(inout) :: this + real(kind=rp), intent(in) :: s + + if (NEKO_BCKND_DEVICE .eq. 1) then + call device_cfill(this%x_d, s, this%size()) + else + call cfill(this%data, s, this%size()) + end if + + end subroutine array_assign_scalar + + !> Assignment \f$ this = array \f$. + subroutine array_assign_real(this, array) + class(array_t), intent(inout) :: this + real(kind=rp), intent(in) :: array(:) + + if (this%size() .ne. size(array)) then + call neko_error('Error in array assignment: incompatible size') + end if + + call copy(this%data, array, this%size()) + if (NEKO_BCKND_DEVICE .eq. 1) then + call this%copy_from(HOST_TO_DEVICE, .true.) + end if + + end subroutine array_assign_real + +end module array diff --git a/src/data_types/matrix.f90 b/src/data_types/matrix.f90 new file mode 100644 index 000000000000..8400eaaaf3e7 --- /dev/null +++ b/src/data_types/matrix.f90 @@ -0,0 +1,199 @@ +! Copyright (c) 2024-2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +!> Defines a matrix +module matrix + use array, only : array_t + use num_types, only : rp + use neko_config, only : NEKO_BCKND_DEVICE + use device, only : HOST_TO_DEVICE, DEVICE_TO_HOST + use utils, only : neko_error, neko_warning + use cpu_matrix_math, only : cpu_matrix_inverse + implicit none + private + + type, public, extends(array_t) :: matrix_t + !> Matrix shaped pointer. + real(kind=rp), pointer, dimension(:,:) :: x => null() + !> Number of matrix rows. + integer, dimension(2), private :: dims = [0, 0] + + contains + !> Generic init method. Calls the matrix specific init method. + generic :: init => init_matrix + !> Initialise a matrix of size `nrows*ncols`. + procedure, pass(this), private :: init_matrix => matrix_init + !> Deallocate a matrix. + procedure, pass(this) :: free => matrix_free + + !> Returns the dimensions of the matrix. + procedure, pass(this) :: get_dims => matrix_dims + !> Return the specific dimension of the matrix. + procedure, pass(this) :: get_dim => matrix_dim + !> Returns the number of rows in the matrix. + procedure, pass(this) :: get_nrows => matrix_nrows + !> Returns the number of columns in the matrix. + procedure, pass(this) :: get_ncols => matrix_ncols + + !> Invert a matrix. + procedure, pass(this) :: inverse => matrix_inverse + !> Invert a matrix on the host. + procedure, pass(this) :: inverse_on_host => matrix_inverse_on_host + + end type matrix_t + + type, public :: matrix_ptr_t + type(matrix_t), pointer :: ptr => null() + contains + !> Constructor. Just assigns the pointer + procedure, pass(this) :: init => matrix_ptr_init + !> Destructor. Just nullifies the pointer. + procedure, pass(this) :: free => matrix_ptr_free + end type matrix_ptr_t + +contains + + !> Initialise a matrix of size `nrows*ncols`. + !! @param nrows Number of rows. + !! @param ncols Number of columns. + !! @param name Optional name of the object. + subroutine matrix_init(this, nrows, ncols, name) + class(matrix_t), intent(inout), target :: this + integer, intent(in) :: nrows, ncols + character(len=*), intent(in), optional :: name + + call this%init_base(nrows*ncols, name) + + this%dims = [nrows, ncols] + this%x(1:nrows, 1:ncols) => this%data(:) + + end subroutine matrix_init + + !> Deallocate a matrix. + subroutine matrix_free(this) + class(matrix_t), intent(inout) :: this + + call this%free_base() + this%dims = [0, 0] + nullify(this%x) + + end subroutine matrix_free + + !> Returns the dimensions of the matrix. + pure function matrix_dims(this) result(dims) + class(matrix_t), intent(in) :: this + integer :: dims(2) + dims = this%dims + end function matrix_dims + + !> Return the specific dimension of the matrix. + function matrix_dim(this, dim) result(d) + class(matrix_t), intent(in) :: this + integer, intent(in) :: dim + integer :: d + d = this%dims(dim) + end function matrix_dim + + !> Returns the number of rows in the matrix. + pure function matrix_nrows(this) result(nr) + class(matrix_t), intent(in) :: this + integer :: nr + nr = this%dims(1) + end function matrix_nrows + + !> Returns the number of columns in the matrix. + pure function matrix_ncols(this) result(nc) + class(matrix_t), intent(in) :: this + integer :: nc + nc = this%dims(2) + end function matrix_ncols + + ! ========================================================================== ! + ! matrix pointer type subroutines + + subroutine matrix_ptr_init(this, ptr) + class(matrix_ptr_t), intent(inout) :: this + type(matrix_t), target, intent(in) :: ptr + + call this%free() + this%ptr => ptr + end subroutine matrix_ptr_init + + subroutine matrix_ptr_free(this) + class(matrix_ptr_t), intent(inout) :: this + + if (associated(this%ptr)) then + nullify(this%ptr) + end if + + end subroutine matrix_ptr_free + + ! ========================================================================== ! + ! Matrix Specific extensions + + !> Compute the inverse of the matrix. + !! @details Invert the current matrix. If the optional argument `bcknd` is + !! provided, then we expect the user have supplied a matrix which is ready to + !! execute on the specified backend. Otherwise, we will call the appropriate + !! backend based on the current configuration. + subroutine matrix_inverse(this, bcknd) + class(matrix_t), intent(inout) :: this + integer, optional :: bcknd + + if (present(bcknd)) then + if (bcknd .eq. 1) then + call neko_error("matrix_inverse: GPU backend not implemented yet.") + else if (bcknd .eq. 0) then + call cpu_matrix_inverse(this%x, this%dims(1), this%dims(2)) + else + call neko_error("matrix_inverse: Invalid backend specified. " // & + "Use 0 for CPU or 1 for GPU.") + end if + else if (NEKO_BCKND_DEVICE .eq. 1) then + call neko_warning("matrix_inverse: GPU backend not implemented yet. " // & + "Falling back to CPU.") + call this%copy_from(DEVICE_TO_HOST, .true.) + call cpu_matrix_inverse(this%x, this%dims(1), this%dims(2)) + call this%copy_from(HOST_TO_DEVICE, .true.) + else + call cpu_matrix_inverse(this%x, this%dims(1), this%dims(2)) + end if + + end subroutine matrix_inverse + + !> Compute the inverse of the matrix on the host. + subroutine matrix_inverse_on_host(this) + class(matrix_t), intent(inout) :: this + call cpu_matrix_inverse(this%x, this%dims(1), this%dims(2)) + end subroutine matrix_inverse_on_host + +end module matrix diff --git a/src/data_types/tensor3.f90 b/src/data_types/tensor3.f90 new file mode 100644 index 000000000000..80b1c8e8198f --- /dev/null +++ b/src/data_types/tensor3.f90 @@ -0,0 +1,142 @@ +! Copyright (c) 2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +!> Defines a tensor3 +module tensor3 + use array, only : array_t + use num_types, only : rp + implicit none + private + + type, public, extends(array_t) :: tensor3_t + !> tensor3 shaped pointer. + real(kind=rp), pointer, dimension(:,:,:) :: x => null() + !> Number of tensor3 dimensions. + integer, dimension(3), private :: dims = [0, 0, 0] + + contains + !> Generic init method. Calls the tensor3 specific init method. + generic :: init => init_tensor3 + !> Initialise a tensor3 of size `n1*n2*n3`. + procedure, pass(this), private :: init_tensor3 => tensor3_init + !> Deallocate a tensor3. + procedure, pass(this) :: free => tensor3_free + + !> Returns the dimensions of the tensor3. + procedure, pass(this) :: get_dims => tensor3_dims + !> Return the specific dimension of the tensor3. + procedure, pass(this) :: get_dim => tensor3_dim + + end type tensor3_t + + type, public :: tensor3_ptr_t + type(tensor3_t), pointer :: ptr => null() + contains + !> Constructor. Just assigns the pointer + procedure, pass(this) :: init => tensor3_ptr_init + !> Destructor. Just nullifies the pointer. + procedure, pass(this) :: free => tensor3_ptr_free + end type tensor3_ptr_t + +contains + + !> Initialise a tensor of size `n1*n2*n3`. + !! @param t Tensor to initialise. + !! @param n1 Size of the first dimension. + !! @param n2 Size of the second dimension. + !! @param n3 Size of the third dimension. + !! @param name Optional name of the tensor. + subroutine tensor3_init(this, n1, n2, n3, name) + class(tensor3_t), intent(inout), target :: this + integer, intent(in) :: n1 + integer, intent(in) :: n2 + integer, intent(in) :: n3 + character(len=*), intent(in), optional :: name + + call this%init_base(n1*n2*n3, name) + + this%dims = [n1, n2, n3] + this%x(1:n1, 1:n2, 1:n3) => this%data(:) + + end subroutine tensor3_init + + !> Deallocate a tensor3. + subroutine tensor3_free(this) + class(tensor3_t), intent(inout) :: this + + call this%free_base() + this%dims = [0, 0, 0] + nullify(this%x) + + end subroutine tensor3_free + + !> Returns the dimensions of the tensor3. + pure function tensor3_dims(this) result(dims) + class(tensor3_t), intent(in) :: this + integer :: dims(3) + dims = this%dims + end function tensor3_dims + + !> Return the specific dimension of the tensor3. + function tensor3_dim(this, dim) result(d) + class(tensor3_t), intent(in) :: this + integer, intent(in) :: dim + integer :: d + d = this%dims(dim) + end function tensor3_dim + + ! ========================================================================== ! + ! tensor3 pointer type subroutines + + !> Constructor. Just assigns the pointer. + !! @param this Pointer wrapper to initialise. + !! @param ptr Tensor to point to. + subroutine tensor3_ptr_init(this, ptr) + class(tensor3_ptr_t), intent(inout) :: this + type(tensor3_t), target, intent(in) :: ptr + + call this%free() + this%ptr => ptr + end subroutine tensor3_ptr_init + + !> Destructor. Just nullifies the pointer. + !! @param this Pointer wrapper to destroy. + subroutine tensor3_ptr_free(this) + class(tensor3_ptr_t), intent(inout) :: this + + if (associated(this%ptr)) then + nullify(this%ptr) + end if + + end subroutine tensor3_ptr_free + +end module tensor3 diff --git a/src/data_types/tensor4.f90 b/src/data_types/tensor4.f90 new file mode 100644 index 000000000000..b76880f8a797 --- /dev/null +++ b/src/data_types/tensor4.f90 @@ -0,0 +1,143 @@ +! Copyright (c) 2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +!> Defines a tensor4 +module tensor4 + use array, only : array_t + use num_types, only : rp + implicit none + private + + type, public, extends(array_t) :: tensor4_t + !> tensor4 shaped pointer. + real(kind=rp), pointer, dimension(:,:,:,:) :: x => null() + !> Number of tensor4 dimensions. + integer, dimension(4), private :: dims = [0, 0, 0, 0] + + contains + !> Generic init method. Calls the tensor4 specific init method. + generic :: init => init_tensor4 + !> Initialise a tensor4 of size `n1*n2*n3*n4`. + procedure, pass(this), private :: init_tensor4 => tensor4_init + !> Deallocate a tensor4. + procedure, pass(this) :: free => tensor4_free + + !> Returns the dimensions of the tensor4. + procedure, pass(this) :: get_dims => tensor4_dims + !> Return the specific dimension of the tensor4. + procedure, pass(this) :: get_dim => tensor4_dim + + end type tensor4_t + + type, public :: tensor4_ptr_t + type(tensor4_t), pointer :: ptr => null() + contains + !> Constructor. Just assigns the pointer + procedure, pass(this) :: init => tensor4_ptr_init + !> Destructor. Just nullifies the pointer. + procedure, pass(this) :: free => tensor4_ptr_free + end type tensor4_ptr_t + +contains + + !> Initialise a tensor of size `n1*n2*n3*n4`. + !! @param this Tensor to initialise. + !! @param n1 Size of the first dimension. + !! @param n2 Size of the second dimension. + !! @param n3 Size of the third dimension. + !! @param n4 Size of the fourth dimension. + !! @param name Optional name of the tensor. + subroutine tensor4_init(this, n1, n2, n3, n4, name) + class(tensor4_t), intent(inout), target :: this + integer, intent(in) :: n1 + integer, intent(in) :: n2 + integer, intent(in) :: n3 + integer, intent(in) :: n4 + character(len=*), intent(in), optional :: name + + call this%init_base(n1*n2*n3*n4, name) + this%dims = [n1, n2, n3, n4] + this%x(1:n1, 1:n2, 1:n3, 1:n4) => this%data(:) + + end subroutine tensor4_init + + !> Deallocate a tensor4. + subroutine tensor4_free(this) + class(tensor4_t), intent(inout) :: this + + call this%free_base() + this%dims = [0, 0, 0, 0] + nullify(this%x) + + end subroutine tensor4_free + + !> Returns the dimensions of the tensor4. + pure function tensor4_dims(this) result(dims) + class(tensor4_t), intent(in) :: this + integer :: dims(4) + dims = this%dims + end function tensor4_dims + + !> Return the specific dimension of the tensor4. + function tensor4_dim(this, dim) result(d) + class(tensor4_t), intent(in) :: this + integer, intent(in) :: dim + integer :: d + d = this%dims(dim) + end function tensor4_dim + + ! ========================================================================== ! + ! tensor4 pointer type subroutines + + !> Constructor. Just assigns the pointer. + !! @param this Pointer wrapper to initialise. + !! @param ptr Tensor to point to. + subroutine tensor4_ptr_init(this, ptr) + class(tensor4_ptr_t), intent(inout) :: this + type(tensor4_t), target, intent(in) :: ptr + + call this%free() + this%ptr => ptr + end subroutine tensor4_ptr_init + + !> Destructor. Just nullifies the pointer. + !! @param this Pointer wrapper to destroy. + subroutine tensor4_ptr_free(this) + class(tensor4_ptr_t), intent(inout) :: this + + if (associated(this%ptr)) then + nullify(this%ptr) + end if + + end subroutine tensor4_ptr_free + +end module tensor4 diff --git a/src/data_types/vector.f90 b/src/data_types/vector.f90 new file mode 100644 index 000000000000..b4bbea038e70 --- /dev/null +++ b/src/data_types/vector.f90 @@ -0,0 +1,104 @@ +! Copyright (c) 2022-2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +!> Defines a vector +module vector + use array, only : array_t + use num_types, only : rp + implicit none + private + + type, public, extends(array_t) :: vector_t + !> Vector shaped pointer. + real(kind=rp), pointer, dimension(:) :: x => null() + contains + !> Generic init method. Calls the vector specific init method. + generic :: init => init_vector + !> Initialise a vector of size `n`. + procedure, pass(this), private :: init_vector => vector_init + !> Free the vector + procedure, pass(this) :: free => vector_free + end type vector_t + + type, public :: vector_ptr_t + type(vector_t), pointer :: ptr => null() + contains + !> Constructor. Just assigns the pointer + procedure, pass(this) :: init => vector_ptr_init + !> Destructor. Just nullifies the pointer. + procedure, pass(this) :: free => vector_ptr_free + end type vector_ptr_t + +contains + + !> Initialise a vector of size @a n. + subroutine vector_init(this, n, name) + class(vector_t), intent(inout), target :: this + integer, intent(in) :: n + character(len=*), intent(in), optional :: name + + call this%init_base(n, name) + + this%x => this%data + + end subroutine vector_init + + !> Free the vector + subroutine vector_free(this) + class(vector_t), intent(inout) :: this + + call this%free_base() + nullify(this%x) + + end subroutine vector_free + + ! ========================================================================== ! + ! vector pointer type subroutines + + subroutine vector_ptr_init(this, ptr) + class(vector_ptr_t), intent(inout) :: this + type(vector_t), target, intent(in) :: ptr + + call this%free() + this%ptr => ptr + end subroutine vector_ptr_init + + subroutine vector_ptr_free(this) + class(vector_ptr_t), intent(inout) :: this + + if (associated(this%ptr)) then + nullify(this%ptr) + end if + + end subroutine vector_ptr_free + +end module vector diff --git a/src/global_interpolation/global_interpolation.f90 b/src/global_interpolation/global_interpolation.f90 index 14bf04049349..709a617825cc 100644 --- a/src/global_interpolation/global_interpolation.f90 +++ b/src/global_interpolation/global_interpolation.f90 @@ -62,6 +62,7 @@ module global_interpolation use vector, only : vector_t use vector_math, only : vector_masked_gather_copy use matrix, only : matrix_t + use matrix_math, only : matrix_cfill use math, only : copy, NEKO_EPS use mask, only : mask_t use structs, only : array_ptr_t @@ -814,7 +815,7 @@ subroutine global_interpolation_find_common(this) allocate(rst_results(3, n_glb_point_cand)) allocate(res_results(3, n_glb_point_cand)) allocate(el_owner_results(n_glb_point_cand)) - res = 1e2_rp + call matrix_cfill(res, 1e2_rp) this%rst = 1e2 this%pe_owner = -1 this%el_owner0 = -1 diff --git a/src/global_interpolation/legendre_rst_finder.f90 b/src/global_interpolation/legendre_rst_finder.f90 index 6e2d1f5d458c..960f86092feb 100644 --- a/src/global_interpolation/legendre_rst_finder.f90 +++ b/src/global_interpolation/legendre_rst_finder.f90 @@ -40,6 +40,8 @@ module legendre_rst_finder use vector, only: vector_t use matrix, only: matrix_t use math, only: NEKO_EPS, matinv39 + use vector_math, only: vector_cfill + use matrix_math, only: matrix_cfill use tensor_cpu, only: tnsr3d_cpu, tnsr3d_el_cpu use device_local_interpolation, only: device_find_rst_legendre use, intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr @@ -156,7 +158,7 @@ subroutine legendre_rst_finder_find(this, rst_local_cand, x_t, y_t, z_t, & !> Find the elements that contain the points if (n_point_cand .lt. 1) return - rst_local_cand = 0.0_rp + call matrix_cfill(rst_local_cand, 0.0_rp) if (NEKO_BCKND_DEVICE .eq. 1) then el_cands_d = device_get_ptr(el_cands) @@ -197,7 +199,7 @@ subroutine find_rst_legendre_device(this, rst, pt_x, pt_y, pt_z, & call conv_pts%init(n_pts) - conv_pts = 1.0_rp + call vector_cfill(conv_pts, 1.0_rp) iter = 0 converged = .false. @@ -245,9 +247,12 @@ subroutine find_rst_legendre_cpu(this, rst, pt_x, pt_y, pt_z, & real(kind=rp) :: dt_legendre(this%Xh%lx, 1) real(kind=rp) :: jac(3,3) real(kind=xp) :: rst_d(3), jacinv(3,3) + real(kind=rp), dimension(this%Xh%lx * this%Xh%lx * this%Xh%lx) :: x_hat + real(kind=rp), dimension(this%Xh%lx * this%Xh%lx * this%Xh%lx) :: y_hat + real(kind=rp), dimension(this%Xh%lx * this%Xh%lx * this%Xh%lx) :: z_hat integer :: conv_pts logical :: converged - integer :: i, j, e, iter, lx + integer :: i, j, e, iter, lx, ih @@ -293,32 +298,40 @@ subroutine find_rst_legendre_cpu(this, rst, pt_x, pt_y, pt_z, & + rst(3,i)*dt_legendre(j, 1) end do e = (el_list(i))*this%Xh%lxyz + 1 + + ! Pull the element data to a static array instead of a slice + do ih = 0, lx*lx*lx - 1 + x_hat(ih + 1) = this%x_hat%x(e + ih) + y_hat(ih + 1) = this%y_hat%x(e + ih) + z_hat(ih + 1) = this%z_hat%x(e + ih) + end do + ! Compute the current xyz value - call tnsr3d_el_cpu(resx(i), 1, this%x_hat%x(e), lx, & + call tnsr3d_el_cpu(resx(i), 1, x_hat, lx, & r_legendre, s_legendre, t_legendre) - call tnsr3d_el_cpu(resy(i), 1, this%y_hat%x(e), lx, & + call tnsr3d_el_cpu(resy(i), 1, y_hat, lx, & r_legendre, s_legendre, t_legendre) - call tnsr3d_el_cpu(resz(i), 1, this%z_hat%x(e), lx, & + call tnsr3d_el_cpu(resz(i), 1, z_hat, lx, & r_legendre, s_legendre, t_legendre) ! This should in principle be merged into some larger kernel ! Compute the jacobian - call tnsr3d_el_cpu(jac(1,1), 1, this%x_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(1,1), 1, x_hat, lx, & dr_legendre, s_legendre, t_legendre) - call tnsr3d_el_cpu(jac(1,2), 1, this%y_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(1,2), 1, y_hat, lx, & dr_legendre, s_legendre, t_legendre) - call tnsr3d_el_cpu(jac(1,3), 1, this%z_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(1,3), 1, z_hat, lx, & dr_legendre, s_legendre, t_legendre) - call tnsr3d_el_cpu(jac(2,1), 1, this%x_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(2,1), 1, x_hat, lx, & r_legendre, ds_legendre, t_legendre) - call tnsr3d_el_cpu(jac(2,2), 1, this%y_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(2,2), 1, y_hat, lx, & r_legendre, ds_legendre, t_legendre) - call tnsr3d_el_cpu(jac(2,3), 1, this%z_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(2,3), 1, z_hat, lx, & r_legendre, ds_legendre, t_legendre) - call tnsr3d_el_cpu(jac(3,1), 1, this%x_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(3,1), 1, x_hat, lx, & r_legendre, s_legendre, dt_legendre) - call tnsr3d_el_cpu(jac(3,2), 1, this%y_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(3,2), 1, y_hat, lx, & r_legendre, s_legendre, dt_legendre) - call tnsr3d_el_cpu(jac(3,3), 1, this%z_hat%x(e), lx, & + call tnsr3d_el_cpu(jac(3,3), 1, z_hat, lx, & r_legendre, s_legendre, dt_legendre) resx(i) = pt_x(i) - resx(i) resy(i) = pt_y(i) - resy(i) diff --git a/src/io/csv_file.f90 b/src/io/csv_file.f90 index d815250824f0..55c49b00b29f 100644 --- a/src/io/csv_file.f90 +++ b/src/io/csv_file.f90 @@ -69,43 +69,30 @@ subroutine csv_file_write(this, data, t) class(*), target, intent(in) :: data real(kind=dp), intent(in), optional :: t - type(vector_t), pointer :: vec - type(matrix_t), pointer :: mat - - nullify(vec) - nullify(mat) - - select type (data) - type is (vector_t) - if (.not. allocated(data%x)) then - call neko_error("Vector is not allocated. Use & - &vector%init() to associate your array & - &with a vector_t object") - end if - vec => data - - type is (matrix_t) - if (.not. allocated(data%x)) then - call neko_error("Matrix is not allocated. Use & - &matrix%init() to associate your array & - &with a matrix_t object") - end if - mat => data - - class default - call neko_error("Invalid data. Expected vector_t or & - &matrix_t") - end select - ! Write is performed on rank 0 if (pe_rank .eq. 0) then - call neko_log%message("Writing to " // trim(this%get_fname())) - if (associated(vec)) then - call csv_file_write_vector(this, vec, t) - else if (associated(mat)) then - call csv_file_write_matrix(this, mat, t) - end if + + select type (ptr => data) + type is (vector_t) + if (.not. ptr%is_allocated()) then + call neko_error("Vector is not allocated. Use " // & + "vector%init() to associate your array " // & + "with a vector_t object") + end if + call csv_file_write_vector(this, ptr, t) + + type is (matrix_t) + if (.not. ptr%is_allocated()) then + call neko_error("Matrix is not allocated. Use " // & + "matrix%init() to associate your array " // & + "with a matrix_t object") + end if + call csv_file_write_matrix(this, ptr, t) + + class default + call neko_error("Invalid data. Expected vector_t or matrix_t") + end select end if @@ -203,46 +190,34 @@ end subroutine csv_file_write_matrix subroutine csv_file_read(this, data) class(csv_file_t) :: this class(*), target, intent(inout) :: data - type(vector_t), pointer :: vec - type(matrix_t), pointer :: mat call this%check_exists() - nullify(vec) - nullify(mat) - - select type (data) - type is (vector_t) - vec => data - if (.not. allocated(data%x)) then - call neko_error("Vector is not allocated. Use & - &vector%init() to associate your array & - &with a vector_t object") - end if - - type is (matrix_t) - mat => data - if (.not. allocated(data%x)) then - call neko_error("Matrix is not allocated. Use & - &matrix%init() to associate your array & - &with a matrix_t object") - end if - - - class default - call neko_error("Invalid data type for csv_file (expected: vector_t, & - &matrix_t)") - end select - if (pe_rank .eq. 0) then - call neko_log%newline() call neko_log%message("Reading csv file " // trim(this%get_fname())) - if (associated(vec)) then - call csv_file_read_vector(this, vec) - else if (associated(mat)) then - call csv_file_read_matrix(this, mat) - end if + + select type (ptr => data) + type is (vector_t) + if (.not. ptr%is_allocated()) then + call neko_error("Vector is not allocated. Use " // & + "vector%init() to associate your array " // & + "with a vector_t object") + end if + call csv_file_read_vector(this, ptr) + + type is (matrix_t) + if (.not. ptr%is_allocated()) then + call neko_error("Matrix is not allocated. Use " // & + "matrix%init() to associate your array " // & + "with a matrix_t object") + end if + call csv_file_read_matrix(this, ptr) + + class default + call neko_error("Invalid data type for csv_file " // & + "(expected: vector_t, matrix_t)") + end select end if diff --git a/src/io/fld_file_data.f90 b/src/io/fld_file_data.f90 index acf9d650d6a5..0d97cf60028b 100644 --- a/src/io/fld_file_data.f90 +++ b/src/io/fld_file_data.f90 @@ -522,10 +522,10 @@ subroutine fld_file_data_generate_interpolator(this, global_interp, to_dof, & to_Xh => to_dof%Xh ! Safeguard in case we didn't read mesh information - if (.not. allocated(this%x%x) .or. & - .not. allocated(this%y%x) .or. & - .not. allocated(this%z%x)) call neko_error("Unable to retrieve & - &mesh information from fld data.") + if (.not. this%x%is_allocated() .or. .not. this%y%is_allocated() .or. & + .not. this%z%is_allocated()) then + call neko_error("Unable to retrieve mesh information from fld data.") + end if ! Create a space based on the fld data call fld_Xh%init(GLL, this%lx, this%ly, this%lz) diff --git a/src/lpt/lpt_migration.f90 b/src/lpt/lpt_migration.f90 index a0a959666ef8..1dd750b2d350 100644 --- a/src/lpt/lpt_migration.f90 +++ b/src/lpt/lpt_migration.f90 @@ -625,7 +625,7 @@ subroutine migrate_particle_ids(this, migrate_comm, ids_old, & integer :: n_sendbuf integer :: n_recvbuf - if (n_particles_old .eq. 0 .and. n_local .eq. 0) return + if (n_particles_old .le. 0 .or. n_local .le. 0) return n_sendbuf = max(1, n_particles_old) n_recvbuf = max(1, n_local) @@ -633,9 +633,9 @@ subroutine migrate_particle_ids(this, migrate_comm, ids_old, & allocate(recvbuf(n_recvbuf)) sendbuf = 0.0_rp recvbuf = 0.0_rp - if (n_particles_old .gt. 0) sendbuf = real(ids_old, rp) + sendbuf = real(ids_old, rp) call migrate_comm%sendrecv(sendbuf, recvbuf, n_sendbuf, n_recvbuf) - if (n_local .gt. 0) particle_ids_local = nint(recvbuf(1:n_local)) + particle_ids_local = nint(recvbuf(1:n_local)) if (allocated(sendbuf)) deallocate(sendbuf) if (allocated(recvbuf)) deallocate(recvbuf) end subroutine migrate_particle_ids @@ -659,19 +659,25 @@ subroutine migrate_particle_scalar(this, migrate_comm, scalar_old, & integer :: n_sendbuf integer :: n_recvbuf - if (n_particles_old .eq. 0 .and. n_local .eq. 0) return + if (n_particles_old .le. 0 .or. n_local .le. 0) return - n_sendbuf = max(1, n_particles_old) - n_recvbuf = max(1, n_local) + n_sendbuf = n_particles_old + n_recvbuf = n_local allocate(sendbuf(n_sendbuf)) allocate(recvbuf(n_recvbuf)) sendbuf = 0.0_rp recvbuf = 0.0_rp call scalar_old%copy_from(DEVICE_TO_HOST, .true.) - if (n_particles_old .gt. 0) sendbuf = scalar_old%x + sendbuf = scalar_old%x + call migrate_comm%sendrecv(sendbuf, recvbuf, n_sendbuf, n_recvbuf) + + if (n_local .ne. scalar_local%size()) then + call scalar_local%init(n_local) + end if + scalar_local%x = recvbuf(1:n_local) call scalar_local%copy_from(HOST_TO_DEVICE, .true.) - if (n_local .gt. 0) scalar_local = recvbuf(1:n_local) + if (allocated(sendbuf)) deallocate(sendbuf) if (allocated(recvbuf)) deallocate(recvbuf) end subroutine migrate_particle_scalar diff --git a/src/math/bcknd/cpu/cpu_matrix_math.f90 b/src/math/bcknd/cpu/cpu_matrix_math.f90 new file mode 100644 index 000000000000..73fcf5004e21 --- /dev/null +++ b/src/math/bcknd/cpu/cpu_matrix_math.f90 @@ -0,0 +1,138 @@ +! Copyright (c) 2026, The Neko Authors +! All rights reserved. +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! +! * Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! +! * Redistributions in binary form must reproduce the above +! copyright notice, this list of conditions and the following +! disclaimer in the documentation and/or other materials provided +! with the distribution. +! +! * Neither the name of the authors nor the names of its +! contributors may be used to endorse or promote products derived +! from this software without specific prior written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +module cpu_matrix_math + use num_types, only : rp, xp + use utils, only : neko_error + implicit none + private + + public :: cpu_matrix_inverse +contains + + !> Gauss-Jordan matrix inversion with full pivoting + !! Num. Rec. p. 30, 2nd Ed., Fortran + !! @param x is an square matrix + !! @param r is the number of rows + !! @param c is the number of columns + !! rmult is this work array of length nrows = ncols + subroutine cpu_matrix_inverse(x, r, c) + integer, intent(in) :: r, c + real(kind=rp), intent(inout) :: x(r, c) + integer :: indr(r), indc(c), ipiv(c) + real(kind=xp) :: rmult(r), amx, tmp, piv, eps + integer :: i, j, k, ir, jc + + if (.not. (c .eq. r)) then + call neko_error("Fatal error: trying to invert this matrix that is " // & + "not square") + end if + + eps = 1e-9_rp + ipiv = 0 + + do k = 1, r + amx = 0.0_rp + do i = 1, r ! Pivot search + if (ipiv(i) .ne. 1) then + do j = 1, r + if (ipiv(j) .eq. 0) then + if (abs(x(i, j)) .ge. amx) then + amx = abs(x(i, j)) + ir = i + jc = j + end if + else if (ipiv(j) .gt. 1) then + return + end if + end do + end if + end do + ipiv(jc) = ipiv(jc) + 1 + + ! Swap rows + if (ir .ne. jc) then + do j = 1, c + tmp = x(ir, j) + x(ir, j) = x(jc, j) + x(jc, j) = tmp + end do + end if + indr(k) = ir + indc(k) = jc + + if (abs(x(jc, jc)) .lt. eps) then + call neko_error("matrix_inverse error: small Gauss Jordan Piv") + end if + piv = 1.0_xp/x(jc, jc) + x(jc, jc) = 1.0_xp + do j = 1, c + x(jc, j) = x(jc, j)*piv + end do + + do j = 1, c + tmp = x(jc, j) + x(jc, j) = x(1 , j) + x(1 , j) = tmp + end do + do i = 2, r + rmult(i) = x(i, jc) + x(i, jc) = 0.0_rp + end do + + do j = 1, c + do i = 2, r + x(i, j) = x(i, j) - rmult(i)*x(1, j) + end do + end do + + do j = 1, c + tmp = x(jc, j) + x(jc, j) = x(1 , j) + x(1 , j) = tmp + end do + end do + + ! Unscramble matrix + do j = r, 1, -1 + if (indr(j) .ne. indc(j)) then + do i = 1, r + tmp = x(i, indr(j)) + x(i, indr(j)) = x(i, indc(j)) + x(i, indc(j)) = tmp + end do + end if + end do + + end subroutine cpu_matrix_inverse + + +end module cpu_matrix_math diff --git a/src/math/matrix.f90 b/src/math/matrix.f90 deleted file mode 100644 index 3383871e843f..000000000000 --- a/src/math/matrix.f90 +++ /dev/null @@ -1,345 +0,0 @@ -! Copyright (c) 2024, The Neko Authors -! All rights reserved. -! -! Redistribution and use in source and binary forms, with or without -! modification, are permitted provided that the following conditions -! are met: -! -! * Redistributions of source code must retain the above copyright -! notice, this list of conditions and the following disclaimer. -! -! * Redistributions in binary form must reproduce the above -! copyright notice, this list of conditions and the following -! disclaimer in the documentation and/or other materials provided -! with the distribution. -! -! * Neither the name of the authors nor the names of its -! contributors may be used to endorse or promote products derived -! from this software without specific prior written permission. -! -! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -! POSSIBILITY OF SUCH DAMAGE. -! -!> Defines a matrix -module matrix - use neko_config, only : NEKO_BCKND_DEVICE - use num_types, only : rp, xp - use device, only : device_map, device_unmap, device_memcpy, & - device_sync - use device_math, only : device_copy, device_cfill - use utils, only : neko_error, NEKO_VARNAME_LEN - use, intrinsic :: iso_c_binding - implicit none - private - - type, public :: matrix_t - real(kind=rp), allocatable :: x(:,:) !< Matrix entries. - character(len=NEKO_VARNAME_LEN) :: name = "" !< Name of the matrix - type(c_ptr) :: x_d = C_NULL_PTR !< Device pointer. - integer, private :: nrows = 0 !< Number of matrix rows. - integer, private :: ncols = 0 !< Number of matrix columns. - integer, private :: n = 0 !< Total size nows*ncols. - contains - !> Initialise a matrix of size `nrows*ncols`. - procedure, pass(m) :: init => matrix_init - !> Deallocate a matrix. - procedure, pass(m) :: free => matrix_free - !> Returns the number of entries in the matrix. - procedure, pass(m) :: size => matrix_size - !> Copy between host and device - procedure, pass(m) :: copy_from => matrix_copy_from - !> Returns the number of rows in the matrix. - procedure, pass(m) :: get_nrows => matrix_nrows - !> Returns the number of columns in the matrix. - procedure, pass(m) :: get_ncols => matrix_ncols - !> Assignment \f$ m = w \f$ - procedure, pass(m) :: matrix_assign_matrix - !> Assignment \f$ m = s \f$. - procedure, pass(m) :: matrix_assign_scalar - !> Inverse a matrix. - procedure, pass(m) :: inverse => matrix_bcknd_inverse - procedure, pass(m) :: inverse_on_host => cpu_matrix_inverse - - generic :: assignment(=) => matrix_assign_matrix, & - matrix_assign_scalar - - !> Allocate a matrix of size `nrows*ncols`. - procedure, pass(m), private :: alloc => matrix_allocate - end type matrix_t - - type, public :: matrix_ptr_t - type(matrix_t), pointer :: ptr - end type matrix_ptr_t - -contains - - !> Initialise a matrix of size `nrows*ncols`. - !! @param nrows Number of rows. - !! @param ncols Number of columns. - subroutine matrix_init(m, nrows, ncols, name) - class(matrix_t), intent(inout) :: m - integer, intent(in) :: nrows - integer, intent(in) :: ncols - character(len=*), intent(in), optional :: name - - ! m%alloc zeroes the device side (and synchronizes) before any - ! host-side touch: under zero-copy the device then faults the - ! pages (device first touch), which gives contiguous physical - ! mappings and thus better GPU TLB utilisation; rewriting the - ! zeros on the host afterwards is benign - call m%alloc(nrows, ncols) - m%x = 0.0_rp - - if (present(name)) then - m%name = name - end if - - - end subroutine matrix_init - - !> Allocate a matrix of size `nrows*ncols`. - !! @param nrows Number of rows. - !! @param ncols Number of columns. - subroutine matrix_allocate(m, nrows, ncols) - class(matrix_t), intent(inout) :: m - integer, intent(in) :: nrows - integer, intent(in) :: ncols - - call m%free() - - allocate(m%x(nrows, ncols)) - m%nrows = nrows - m%ncols = ncols - m%n = nrows*ncols - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_map(m%x, m%x_d, m%n) - call device_cfill(m%x_d, 0.0_rp, m%n) - call device_sync() - end if - - end subroutine matrix_allocate - - !> Deallocate a matrix. - subroutine matrix_free(m) - class(matrix_t), intent(inout) :: m - - if (allocated(m%x)) then - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_unmap(m%x, m%x_d) - end if - deallocate(m%x) - end if - - m%nrows = 0 - m%ncols = 0 - m%n = 0 - m%name = "" - - end subroutine matrix_free - - !> Returns the number of entries in the matrix. - pure function matrix_size(m) result(s) - class(matrix_t), intent(in) :: m - integer :: s - s = m%n - end function matrix_size - - - !> Easy way to copy between host and device. - !! @param m matrix to copy to/from device/host - !! @memdir direction to copy (HOST_TO_DEVICE or DEVICE_TO_HOST) - !! @sync whether the memcopy to be blocking or not - subroutine matrix_copy_from(m, memdir, sync) - class(matrix_t), intent(inout) :: m - integer, intent(in) :: memdir - logical, intent(in) :: sync - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_memcpy(m%x, m%x_d, m%n, memdir, sync) - end if - - end subroutine matrix_copy_from - - !> Returns the number of rows in the matrix. - pure function matrix_nrows(m) result(nr) - class(matrix_t), intent(in) :: m - integer :: nr - nr = m%nrows - end function matrix_nrows - - !> Returns the number of columns in the matrix. - pure function matrix_ncols(m) result(nc) - class(matrix_t), intent(in) :: m - integer :: nc - nc = m%ncols - end function matrix_ncols - - !> Assignment \f$ m = w \f$ - subroutine matrix_assign_matrix(m, w) - class(matrix_t), intent(inout) :: m - type(matrix_t), intent(in) :: w - - if (allocated(m%x)) then - call m%free() - end if - - if (.not. allocated(m%x)) then - - m%nrows = w%nrows - m%ncols = w%ncols - m%n = w%n - allocate(m%x(m%nrows, m%ncols)) - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_map(m%x, m%x_d, m%n) - end if - - end if - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_copy(m%x_d, w%x_d, m%n) - else - m%x = w%x - end if - - m%name = w%name - - end subroutine matrix_assign_matrix - - !> Assignment \f$ m = s \f$. - subroutine matrix_assign_scalar(m, s) - class(matrix_t), intent(inout) :: m - real(kind=rp), intent(in) :: s - - if (.not. allocated(m%x)) then - call neko_error('matrix not allocated') - end if - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_cfill(m%x_d, s, m%n) - else - m%x = s - end if - - end subroutine matrix_assign_scalar - - subroutine matrix_bcknd_inverse(m, bcknd) - class(matrix_t), intent(inout) :: m - integer, optional :: bcknd - - if (NEKO_BCKND_DEVICE .eq. 1 .and. & - bcknd .eq. NEKO_BCKND_DEVICE) then - call neko_error("matrix_bcknd_inverse not & - &implemented on accelarators.") - else - call cpu_matrix_inverse(m) - end if - - end subroutine matrix_bcknd_inverse - - subroutine cpu_matrix_inverse(m) - ! Gauss-Jordan matrix inversion with full pivoting - ! Num. Rec. p. 30, 2nd Ed., Fortran - ! m%x is an sqaure matrix - ! rmult is m work array of length nrows = ncols - class(matrix_t), intent(inout) :: m - integer :: indr(m%nrows), indc(m%ncols), ipiv(m%ncols) - real(kind=xp) :: rmult(m%nrows), amx, tmp, piv, eps - integer :: i, j, k, ir, jc - - if (.not. (m%ncols .eq. m%nrows)) then - call neko_error("Fatal error: trying to invert m matrix that is not & - &square") - end if - - eps = 1e-9_rp - ipiv = 0 - - do k = 1, m%nrows - amx = 0.0_rp - do i = 1, m%nrows ! Pivot search - if (ipiv(i) .ne. 1) then - do j = 1, m%nrows - if (ipiv(j) .eq. 0) then - if (abs(m%x(i, j)) .ge. amx) then - amx = abs(m%x(i, j)) - ir = i - jc = j - end if - else if (ipiv(j) .gt. 1) then - return - end if - end do - end if - end do - ipiv(jc) = ipiv(jc) + 1 - - ! Swap rows - if (ir .ne. jc) then - do j = 1, m%ncols - tmp = m%x(ir, j) - m%x(ir, j) = m%x(jc, j) - m%x(jc, j) = tmp - end do - end if - indr(k) = ir - indc(k) = jc - - if (abs(m%x(jc, jc)) .lt. eps) then - call neko_error("matrix_inverse error: small Gauss Jordan Piv") - end if - piv = 1.0_xp/m%x(jc, jc) - m%x(jc, jc) = 1.0_xp - do j = 1, m%ncols - m%x(jc, j) = m%x(jc, j)*piv - end do - - do j = 1, m%ncols - tmp = m%x(jc, j) - m%x(jc, j) = m%x(1 , j) - m%x(1 , j) = tmp - end do - do i = 2, m%nrows - rmult(i) = m%x(i, jc) - m%x(i, jc) = 0.0_rp - end do - - do j = 1, m%ncols - do i = 2, m%nrows - m%x(i, j) = m%x(i, j) - rmult(i)*m%x(1, j) - end do - end do - - do j = 1, m%ncols - tmp = m%x(jc, j) - m%x(jc, j) = m%x(1 , j) - m%x(1 , j) = tmp - end do - end do - - ! Unscramble matrix - do j = m%nrows, 1, -1 - if (indr(j) .ne. indc(j)) then - do i = 1, m%nrows - tmp = m%x(i, indr(j)) - m%x(i, indr(j)) = m%x(i, indc(j)) - m%x(i, indc(j)) = tmp - end do - end if - end do - - return - end subroutine cpu_matrix_inverse - -end module matrix diff --git a/src/math/vector.f90 b/src/math/vector.f90 deleted file mode 100644 index 836ecfb06bb2..000000000000 --- a/src/math/vector.f90 +++ /dev/null @@ -1,233 +0,0 @@ -! Copyright (c) 2022-2025, The Neko Authors -! All rights reserved. -! -! Redistribution and use in source and binary forms, with or without -! modification, are permitted provided that the following conditions -! are met: -! -! * Redistributions of source code must retain the above copyright -! notice, this list of conditions and the following disclaimer. -! -! * Redistributions in binary form must reproduce the above -! copyright notice, this list of conditions and the following -! disclaimer in the documentation and/or other materials provided -! with the distribution. -! -! * Neither the name of the authors nor the names of its -! contributors may be used to endorse or promote products derived -! from this software without specific prior written permission. -! -! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -! POSSIBILITY OF SUCH DAMAGE. -! -!> Defines a vector -module vector - use neko_config, only : NEKO_BCKND_DEVICE - use num_types, only : rp - use device, only : device_map, device_unmap, & - device_memcpy, device_sync, HOST_TO_DEVICE - use math, only : cfill, copy - use device_math, only : device_copy, device_cfill, device_cmult, & - device_sub3, device_cmult2, device_add3, device_cadd2, device_col3, & - device_col2, device_invcol3, device_cdiv2 - use utils, only : neko_error, NEKO_VARNAME_LEN - use, intrinsic :: iso_c_binding - implicit none - private - - type, public :: vector_t - !> Vector entries. - real(kind=rp), allocatable :: x(:) - character(len=NEKO_VARNAME_LEN) :: name = "" !< Name of the vector - !> Device pointer. - type(c_ptr) :: x_d = C_NULL_PTR - !> Size of vector. - integer, private :: n = 0 - contains - !> Initialise a vector of size `n`. - procedure, pass(v) :: init => vector_init - !> Deallocate a vector. - procedure, pass(v) :: free => vector_free - !> Copy data between host and device - procedure, pass(v) :: copy_from => vector_copy_from - !> Returns the number of entries in the vector. - procedure, pass(v) :: size => vector_size - !> Assignment \f$ v = w \f$ - procedure, pass(v) :: vector_assign_vector - !> Assignment \f$ v = s \f$. - procedure, pass(v) :: vector_assign_scalar - !> Assignment \f$ v = array \f$. - procedure, pass(v) :: vector_assign_array - - !> Assignments - generic :: assignment(=) => vector_assign_vector, & - vector_assign_scalar, vector_assign_array - - ! Private interfaces - procedure, pass(a), private :: alloc => vector_allocate - - end type vector_t - - type, public :: vector_ptr_t - type(vector_t), pointer :: ptr => null() - contains - !> Constructor. Just assigns the pointer - procedure, pass(this) :: init => vector_ptr_init - !> Destructor. Just nullifies the pointer. - procedure, pass(this) :: free => vector_ptr_free - end type vector_ptr_t - -contains - - !> Initialise a vector of size @a n. - subroutine vector_init(v, n, name) - class(vector_t), intent(inout) :: v - integer, intent(in) :: n - character(len=*), intent(in), optional :: name - - call v%alloc(n) - if (NEKO_BCKND_DEVICE .eq. 1) then - ! Zero the device side first: under zero-copy the device then - ! faults the pages (device first touch), which gives contiguous - ! physical mappings and thus better GPU TLB utilisation - call device_cfill(v%x_d, 0.0_rp, n) - call device_sync() - end if - call cfill(v%x, 0.0_rp, n) - - if (present(name)) then - v%name = name - end if - - end subroutine vector_init - - !> Vector allocation without initialisation. - subroutine vector_allocate(a, n) - class(vector_t), intent(inout) :: a - integer, intent(in) :: n - - - if (a%n .eq. n) return - call a%free() - - a%n = n - allocate(a%x(n)) - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_map(a%x, a%x_d, n) - end if - - end subroutine vector_allocate - - !> Deallocate a vector. - subroutine vector_free(v) - class(vector_t), intent(inout) :: v - - if (allocated(v%x)) then - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_unmap(v%x, v%x_d) - end if - deallocate(v%x) - end if - - v%n = 0 - v%name = "" - - end subroutine vector_free - - !> Return the number of entries in the vector. - pure function vector_size(v) result(s) - class(vector_t), intent(in) :: v - integer :: s - s = v%n - end function vector_size - - !> Easy way to copy between host and device. - !! @param v vector to copy to/from device/host - !! @memdir direction to copy (HOST_TO_DEVICE or DEVICE_TO_HOST) - !! @sync whether the memcopy to be blocking or not - subroutine vector_copy_from(v, memdir, sync) - class(vector_t), intent(inout) :: v - integer, intent(in) :: memdir - logical, intent(in) :: sync - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_memcpy(v%x, v%x_d, v%n, memdir, sync) - end if - - end subroutine vector_copy_from - - - !> Assignment \f$ v = w \f$. - subroutine vector_assign_vector(v, w) - class(vector_t), intent(inout) :: v - type(vector_t), intent(in) :: w - - call v%alloc(w%n) - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_copy(v%x_d, w%x_d, v%n) - else - call copy(v%x, w%x, v%n) - end if - - v%name = w%name - - end subroutine vector_assign_vector - - !> Assignment \f$ v = s \f$. - subroutine vector_assign_scalar(v, s) - class(vector_t), intent(inout) :: v - real(kind=rp), intent(in) :: s - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_cfill(v%x_d, s, v%n) - else - call cfill(v%x, s, v%n) - end if - - end subroutine vector_assign_scalar - - !> Assignment \f$ v = array \f$. - subroutine vector_assign_array(v, array) - class(vector_t), intent(inout) :: v - real(kind=rp), intent(in) :: array(:) - - call v%alloc(size(array)) - v%x = array - - if (NEKO_BCKND_DEVICE .eq. 1) then - call v%copy_from(HOST_TO_DEVICE, .true.) - end if - - end subroutine vector_assign_array - - ! ========================================================================== ! - ! vector pointer type subroutines - - subroutine vector_ptr_init(this, ptr) - class(vector_ptr_t), intent(inout) :: this - type(vector_t), target, intent(in) :: ptr - - call this%free() - this%ptr => ptr - end subroutine vector_ptr_init - - subroutine vector_ptr_free(this) - class(vector_ptr_t), intent(inout) :: this - - if (associated(this%ptr)) then - nullify(this%ptr) - end if - - end subroutine vector_ptr_free - -end module vector diff --git a/src/neko.f90 b/src/neko.f90 index d95c9a56cc3d..d528137fb87f 100644 --- a/src/neko.f90 +++ b/src/neko.f90 @@ -110,6 +110,8 @@ module neko use vector, only : vector_t, vector_ptr_t use vector_list, only : vector_list_t use matrix, only : matrix_t + use tensor3, only : tensor3_t + use tensor4, only : tensor4_t use tensor use simulation_component, only : simulation_component_t, & simulation_component_wrapper_t, simulation_component_factory, & diff --git a/src/sem/map_1d.f90 b/src/sem/map_1d.f90 index 4a7daccf3a24..d3b7ca1c4f9a 100644 --- a/src/sem/map_1d.f90 +++ b/src/sem/map_1d.f90 @@ -49,6 +49,7 @@ module map_1d use vector, only : vector_ptr_t use utils, only : neko_error, neko_warning use math, only : glmax, glmin, glimax, relcmp, cmult, add2s1, col2 + use matrix_math, only : matrix_cfill use mpi_f08, only : MPI_Allreduce, MPI_SUM, MPI_Barrier, MPI_IN_PLACE use, intrinsic :: iso_c_binding implicit none @@ -395,7 +396,7 @@ subroutine map_1d_average_field_list(this, avg_planes, field_list) real(kind=rp) :: coord call avg_planes%free() call avg_planes%init(this%n_gll_lvls, field_list%size() + 1) - avg_planes = 0.0_rp + call matrix_cfill(avg_planes, 0.0_rp) !ugly way of getting coordinates, computes average n = this%dof%size() do i = 1, n @@ -439,7 +440,7 @@ subroutine map_1d_average_vector_ptr(this, avg_planes, vector_ptr) call avg_planes%free() call avg_planes%init(this%n_gll_lvls, size(vector_ptr) + 1) !ugly way of getting coordinates, computes average - avg_planes = 0.0_rp + call matrix_cfill(avg_planes, 0.0_rp) n = this%dof%size() do i = 1, n diff --git a/src/wall_models/wall_sampler.f90 b/src/wall_models/wall_sampler.f90 index 15f226492173..6a53bc2ebfab 100644 --- a/src/wall_models/wall_sampler.f90 +++ b/src/wall_models/wall_sampler.f90 @@ -39,7 +39,7 @@ module wall_sampler use json_module, only : json_file use user_intf, only : user_t use scratch_registry, only : neko_scratch_registry - use vector_math, only : vector_masked_scatter_copy_0 + use vector_math, only : vector_copy, vector_masked_scatter_copy_0 use fld_file_output, only : fld_file_output_t use neko_config, only : NEKO_BCKND_DEVICE use device, only : HOST_TO_DEVICE @@ -147,12 +147,14 @@ subroutine wall_sampler_init_base(this, n_nodes, n_samples, h, output_h) call neko_error('Wall sampler distances have an invalid size') end if - call this%h%free() + call this%h%init(h%size()) this%n_nodes = n_nodes this%n_samples = n_samples this%user_values = .false. this%output_h_enabled = output_h - this%h = h + + call this%h%init(h%size()) + call vector_copy(this%h, h) end subroutine wall_sampler_init_base !> Write the first sampling distance at every wall node to a field file. diff --git a/tests/unit/.gitignore b/tests/unit/.gitignore index 2f03228d076f..d09fea6261ef 100644 --- a/tests/unit/.gitignore +++ b/tests/unit/.gitignore @@ -21,6 +21,8 @@ test-suite.log !mesh/mesh_test !point_interpolation/point_interpolation_test !templates/parallel/parallel_test +!tensor3/tensor3_test +!tensor4/tensor4_test !vector/vector_test !vtkhdf/vtkhdf_test diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index a646de9617b9..df201076afdf 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -28,6 +28,8 @@ SUBDIRS = tuple\ octree\ vector\ matrix\ + tensor3\ + tensor4\ case_file_utils\ registry\ scratch_registry\ @@ -76,6 +78,8 @@ TESTS = device/device_test\ octree/octree_test\ vector/vector_test\ matrix/matrix_test\ + tensor3/tensor3_test\ + tensor4/tensor4_test\ case_file_utils/case_file_utils_test\ registry/registry_test\ scratch_registry/scratch_registry_test\ @@ -153,6 +157,8 @@ EXTRA_DIST = \ octree/test_octree.pf\ vector/test_vector_parallel.pf\ matrix/test_matrix_parallel.pf\ + tensor3/test_tensor3_parallel.pf\ + tensor4/test_tensor4_parallel.pf\ case_file_utils/test_case_file_utils.pf\ registry/test_registry.pf\ registry/test_field_registry.pf\ diff --git a/tests/unit/matrix/test_matrix_parallel.pf b/tests/unit/matrix/test_matrix_parallel.pf index df6e076064d5..05c7e54cd11d 100644 --- a/tests/unit/matrix/test_matrix_parallel.pf +++ b/tests/unit/matrix/test_matrix_parallel.pf @@ -45,7 +45,7 @@ contains integer :: ierr call v%init(n,m) - @assertTrue(allocated(v%x)) + @assertTrue(associated(v%x)) @assertEqual(size(v%x), n*m) @assertEqual(v%size(), n*m) @assertEqual(v%get_nrows(), n) @@ -69,7 +69,7 @@ contains call v%init(n, m) call v%free() - @assertFalse(allocated(v%x)) + @assertFalse(associated(v%x)) @assertEqual(v%size(), 0) @assertEqual(v%get_nrows(), 0) @assertEqual(v%get_ncols(), 0) @@ -80,60 +80,6 @@ contains end subroutine test_matrix_free - @test(npes=[1]) - subroutine test_matrix_assign_matrix(this) - class (test_matrix), intent(inout) :: this - integer, parameter :: n = 42 - integer, parameter :: m = 4711 - type(matrix_t) :: v, w - - call w%init(n,m) - v = w - @assertEqual(v%size(), w%size()) - @assertEqual(v%get_nrows(), n) - @assertEqual(v%get_ncols(), m) - @assertEqual(v%get_nrows(), w%get_nrows()) - @assertEqual(v%get_ncols(), w%get_ncols()) - @assertEqual(v%size(), n*m) - @assertTrue(allocated(v%x)) - - call w%free() - call w%init(m,n) - - v = w - @assertEqual(v%size(), w%size()) - @assertEqual(v%get_nrows(), m) - @assertEqual(v%get_ncols(), n) - @assertEqual(v%get_nrows(), w%get_nrows()) - @assertEqual(v%get_ncols(), w%get_ncols()) - @assertEqual(v%size(), m*n) - @assertTrue(allocated(v%x)) - - end subroutine test_matrix_assign_matrix - - @test(npes[1]) - subroutine test_matrix_assign_scalar(this) - class (test_matrix), intent(inout) :: this - integer, parameter :: n = 4711, m = 42 - real(kind=rp), parameter :: s =42.0_rp - type(matrix_t) :: v - integer :: i, j - - call v%init(n, m) - v = s - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_memcpy(v%x, v%x_d, n*m, DEVICE_TO_HOST, sync=.true.) - end if - - do j = 1, m - do i = 1, n - @assertEqual(42.0_rp, v%x(i,j), tolerance=NEKO_EPS) - end do - end do - - end subroutine test_matrix_assign_scalar - ! @test(npes=[1]) ! subroutine test_matrix_add_matrix(this) ! class (test_matrix), intent(inout) :: this diff --git a/tests/unit/tensor3/Makefile.in b/tests/unit/tensor3/Makefile.in new file mode 100644 index 000000000000..ea2bc36520de --- /dev/null +++ b/tests/unit/tensor3/Makefile.in @@ -0,0 +1,29 @@ +USEMPI=YES +ifneq ("$(wildcard @PFUNIT_DIR@/include/PFUNIT.mk)", "") +include @PFUNIT_DIR@/include/PFUNIT.mk +endif +FFLAGS += $(PFUNIT_EXTRA_FFLAGS) @NEKO_PKG_FCFLAGS@ -I@top_builddir@/src +FC = @FC@ + +%.o : %.F90 + $(FC) -c $(FFLAGS) $< + + +check: tensor3_suite + + +tensor3_suite_TESTS := test_tensor3_parallel.pf +tensor3_suite_OTHER_LIBRARIES = -L@top_builddir@/src/.libs -lneko @LDFLAGS@ @LIBS@ +$(eval $(call make_pfunit_test,tensor3_suite)) +tensor3_suite.inc: Makefile + +distclean: +clean: + $(RM) *.o *.mod *.a *.inc *.F90 tensor3_suite + + + +all: +html: +install: +distdir: diff --git a/tests/unit/tensor3/tensor3_test b/tests/unit/tensor3/tensor3_test new file mode 100755 index 000000000000..c8ecaebcf364 --- /dev/null +++ b/tests/unit/tensor3/tensor3_test @@ -0,0 +1,6 @@ +#!/bin/sh +if which mpirun >/dev/null; then + mpirun -np 1 ./tensor3/tensor3_suite +else + mpiexec -np 1 ./tensor3/tensor3_suite +fi diff --git a/tests/unit/tensor3/test_tensor3_parallel.pf b/tests/unit/tensor3/test_tensor3_parallel.pf new file mode 100644 index 000000000000..d720b2bdc6cc --- /dev/null +++ b/tests/unit/tensor3/test_tensor3_parallel.pf @@ -0,0 +1,112 @@ +module test_tensor3_parallel + use mpi + use pfunit + use neko_config + use tensor3 + use num_types + use device + use math + use comm, only : NEKO_COMM, pe_rank, pe_size + use pfunit_comm_utils, only : comm_init_test, comm_free_test + use, intrinsic :: iso_c_binding + implicit none + + @TestCase + type, extends(MPITestCase) :: test_tensor3 + contains + procedure :: setUp + procedure :: tearDown + end type test_tensor3 + +contains + + subroutine setUp(this) + class(test_tensor3), intent(inout) :: this + call comm_init_test(this%getMpiCommunicator()) + if ((NEKO_BCKND_DEVICE .eq. 1)) then + call device_init + end if + end subroutine setUp + + subroutine tearDown(this) + class(test_tensor3), intent(inout) :: this + if ((NEKO_BCKND_DEVICE .eq. 1)) then + call device_finalize + end if + call comm_free_test() + end subroutine tearDown + + @test(npes=[1]) + subroutine test_tensor3_init(this) + class(test_tensor3), intent(inout) :: this + integer, parameter :: n1 = 7, n2 = 5, n3 = 3 + type(tensor3_t) :: t + + call t%init(n1, n2, n3) + @assertTrue(associated(t%x)) + @assertEqual(size(t%x), n1*n2*n3) + @assertEqual(t%size(), n1*n2*n3) + @assertEqual(t%get_dim(1), n1) + @assertEqual(t%get_dim(2), n2) + @assertEqual(t%get_dim(3), n3) + @assertEqual(maxval(t%x), 0d0) + @assertEqual(minval(t%x), 0d0) + + if (NEKO_BCKND_DEVICE .eq. 1) then + @assertTrue(c_associated(t%x_d)) + else + @assertFalse(c_associated(t%x_d)) + end if + + end subroutine test_tensor3_init + + @test(npes=[1]) + subroutine test_tensor3_init_name(this) + class(test_tensor3), intent(inout) :: this + integer, parameter :: n1 = 4, n2 = 3, n3 = 2 + type(tensor3_t) :: t + + call t%init(n1, n2, n3, 'my_tensor') + @assertEqual(trim(t%name), 'my_tensor') + + end subroutine test_tensor3_init_name + + @test(npes=[1]) + subroutine test_tensor3_free(this) + class(test_tensor3), intent(inout) :: this + integer, parameter :: n1 = 7, n2 = 5, n3 = 3 + type(tensor3_t) :: t + + call t%init(n1, n2, n3, 'my_tensor') + call t%free() + @assertFalse(associated(t%x)) + @assertEqual(t%size(), 0) + @assertEqual(t%get_dim(1), 0) + @assertEqual(t%get_dim(2), 0) + @assertEqual(t%get_dim(3), 0) + @assertEqual(trim(t%name), '') + + if (NEKO_BCKND_DEVICE .eq. 1) then + @assertFalse(c_associated(t%x_d)) + end if + + end subroutine test_tensor3_free + + @test(npes=[1]) + subroutine test_tensor3_ptr(this) + class(test_tensor3), intent(inout) :: this + integer, parameter :: n1 = 3, n2 = 4, n3 = 5 + type(tensor3_t), target :: t + type(tensor3_ptr_t) :: p + + call t%init(n1, n2, n3) + call p%init(t) + @assertTrue(associated(p%ptr)) + @assertEqual(p%ptr%size(), n1*n2*n3) + + call p%free() + @assertFalse(associated(p%ptr)) + + end subroutine test_tensor3_ptr + +end module test_tensor3_parallel diff --git a/tests/unit/tensor4/Makefile.in b/tests/unit/tensor4/Makefile.in new file mode 100644 index 000000000000..de8b563db9c0 --- /dev/null +++ b/tests/unit/tensor4/Makefile.in @@ -0,0 +1,29 @@ +USEMPI=YES +ifneq ("$(wildcard @PFUNIT_DIR@/include/PFUNIT.mk)", "") +include @PFUNIT_DIR@/include/PFUNIT.mk +endif +FFLAGS += $(PFUNIT_EXTRA_FFLAGS) @NEKO_PKG_FCFLAGS@ -I@top_builddir@/src +FC = @FC@ + +%.o : %.F90 + $(FC) -c $(FFLAGS) $< + + +check: tensor4_suite + + +tensor4_suite_TESTS := test_tensor4_parallel.pf +tensor4_suite_OTHER_LIBRARIES = -L@top_builddir@/src/.libs -lneko @LDFLAGS@ @LIBS@ +$(eval $(call make_pfunit_test,tensor4_suite)) +tensor4_suite.inc: Makefile + +distclean: +clean: + $(RM) *.o *.mod *.a *.inc *.F90 tensor4_suite + + + +all: +html: +install: +distdir: diff --git a/tests/unit/tensor4/tensor4_test b/tests/unit/tensor4/tensor4_test new file mode 100755 index 000000000000..832d3a8f471a --- /dev/null +++ b/tests/unit/tensor4/tensor4_test @@ -0,0 +1,6 @@ +#!/bin/sh +if which mpirun >/dev/null; then + mpirun -np 1 ./tensor4/tensor4_suite +else + mpiexec -np 1 ./tensor4/tensor4_suite +fi diff --git a/tests/unit/tensor4/test_tensor4_parallel.pf b/tests/unit/tensor4/test_tensor4_parallel.pf new file mode 100644 index 000000000000..5e07686ad085 --- /dev/null +++ b/tests/unit/tensor4/test_tensor4_parallel.pf @@ -0,0 +1,114 @@ +module test_tensor4_parallel + use mpi + use pfunit + use neko_config + use tensor4 + use num_types + use device + use math + use comm, only : NEKO_COMM, pe_rank, pe_size + use pfunit_comm_utils, only : comm_init_test, comm_free_test + use, intrinsic :: iso_c_binding + implicit none + + @TestCase + type, extends(MPITestCase) :: test_tensor4 + contains + procedure :: setUp + procedure :: tearDown + end type test_tensor4 + +contains + + subroutine setUp(this) + class(test_tensor4), intent(inout) :: this + call comm_init_test(this%getMpiCommunicator()) + if ((NEKO_BCKND_DEVICE .eq. 1)) then + call device_init + end if + end subroutine setUp + + subroutine tearDown(this) + class(test_tensor4), intent(inout) :: this + if ((NEKO_BCKND_DEVICE .eq. 1)) then + call device_finalize + end if + call comm_free_test() + end subroutine tearDown + + @test(npes=[1]) + subroutine test_tensor4_init(this) + class (test_tensor4), intent(inout) :: this + integer, parameter :: n1 = 7, n2 = 5, n3 = 3, n4 = 2 + type(tensor4_t) :: t + + call t%init(n1, n2, n3, n4) + @assertTrue(associated(t%x)) + @assertEqual(size(t%x), n1*n2*n3*n4) + @assertEqual(t%size(), n1*n2*n3*n4) + @assertEqual(t%get_dim(1), n1) + @assertEqual(t%get_dim(2), n2) + @assertEqual(t%get_dim(3), n3) + @assertEqual(t%get_dim(4), n4) + @assertEqual(maxval(t%x), 0d0) + @assertEqual(minval(t%x), 0d0) + + if (NEKO_BCKND_DEVICE .eq. 1) then + @assertTrue(c_associated(t%x_d)) + else + @assertFalse(c_associated(t%x_d)) + end if + + end subroutine test_tensor4_init + + @test(npes=[1]) + subroutine test_tensor4_init_name(this) + class (test_tensor4), intent(inout) :: this + integer, parameter :: n1 = 4, n2 = 3, n3 = 2, n4 = 5 + type(tensor4_t) :: t + + call t%init(n1, n2, n3, n4, 'my_tensor') + @assertEqual(trim(t%name), 'my_tensor') + + end subroutine test_tensor4_init_name + + @test(npes=[1]) + subroutine test_tensor4_free(this) + class (test_tensor4), intent(inout) :: this + integer, parameter :: n1 = 7, n2 = 5, n3 = 3, n4 = 2 + type(tensor4_t) :: t + + call t%init(n1, n2, n3, n4, 'my_tensor') + call t%free() + @assertFalse(associated(t%x)) + @assertEqual(t%size(), 0) + @assertEqual(t%get_dim(1), 0) + @assertEqual(t%get_dim(2), 0) + @assertEqual(t%get_dim(3), 0) + @assertEqual(t%get_dim(4), 0) + @assertEqual(trim(t%name), '') + + if (NEKO_BCKND_DEVICE .eq. 1) then + @assertFalse(c_associated(t%x_d)) + end if + + end subroutine test_tensor4_free + + @test(npes=[1]) + subroutine test_tensor4_ptr(this) + class (test_tensor4), intent(inout) :: this + integer, parameter :: n1 = 3, n2 = 4, n3 = 5, n4 = 2 + type(tensor4_t), target :: t + type(tensor4_ptr_t) :: p + + call t%init(n1, n2, n3, n4) + call p%init(t) + @assertTrue(associated(p%ptr)) + @assertEqual(p%ptr%size(), n1*n2*n3*n4) + + call p%free() + @assertFalse(associated(p%ptr)) + + end subroutine test_tensor4_ptr + +end module test_tensor4_parallel diff --git a/tests/unit/vector/test_vector_parallel.pf b/tests/unit/vector/test_vector_parallel.pf index 65c32d7983f3..955f5302704d 100644 --- a/tests/unit/vector/test_vector_parallel.pf +++ b/tests/unit/vector/test_vector_parallel.pf @@ -45,7 +45,7 @@ contains integer :: ierr call v%init(n) - @assertTrue(allocated(v%x)) + @assertTrue(associated(v%x)) @assertEqual(size(v%x), n) @assertEqual(v%size(), n) @assertEqual(maxval(v%x), 0d0) @@ -67,57 +67,16 @@ contains call v%init(n) call v%free() - @assertFalse(allocated(v%x)) + @assertFalse(associated(v%x)) @assertEqual(v%size(), 0) + @assertFalse(associated(v%x)) if (NEKO_BCKND_DEVICE .eq. 1) then @assertFalse(c_associated(v%x_d)) end if end subroutine test_vector_free - @test(npes=[1]) - subroutine test_vector_assign_vector(this) - class (test_vector), intent(inout) :: this - integer, parameter :: n = 42 - integer, parameter :: m = 4711 - type(vector_t) :: v, w - - call w%init(n) - v = w - @assertEqual(v%size(), w%size()) - @assertTrue(allocated(v%x)) - - call w%free() - call w%init(m) - - v = w - @assertEqual(v%size(), w%size()) - @assertTrue(allocated(v%x)) - - end subroutine test_vector_assign_vector - - @test(npes[1]) - subroutine test_vector_assign_scalar(this) - class (test_vector), intent(inout) :: this - integer, parameter :: n = 4711 - real(kind=rp), parameter :: s =42.0_rp - type(vector_t) :: v - integer :: i - - call v%init(n) - v = s - - if (NEKO_BCKND_DEVICE .eq. 1) then - call device_memcpy(v%x, v%x_d, n, DEVICE_TO_HOST, sync=.true.) - end if - - do i = 1, n - @assertEqual(42.0_rp, v%x(i), tolerance=NEKO_EPS) - end do - - end subroutine test_vector_assign_scalar - @test(npes=[1]) subroutine test_vector_add_vector(this) class (test_vector), intent(inout) :: this @@ -129,8 +88,8 @@ contains call v%init(n) call u%init(n) - w = 1.0_rp - v = 3.0_rp + call vector_cfill(w, 1.0_rp) + call vector_cfill(v, 3.0_rp) call vector_add2(v, w) @@ -145,7 +104,7 @@ contains call vector_add3(u, v, w) @assertEqual(u%size(), v%size()) - @assertTrue(allocated(u%x)) + @assertTrue(associated(u%x)) if (NEKO_BCKND_DEVICE .eq. 1) then call device_memcpy(u%x, u%x_d, n, DEVICE_TO_HOST, sync=.true.) @@ -166,7 +125,7 @@ contains integer :: i call v%init(n) - v = 2.0_rp + call vector_cfill(v, 2.0_rp) call vector_cadd(v, s) if (NEKO_BCKND_DEVICE .eq. 1) then @@ -190,8 +149,8 @@ contains call v%init(n) call u%init(n) - v = 3.0_rp - w = 1.0_rp + call vector_cfill(v, 3.0_rp) + call vector_cfill(w, 1.0_rp) call vector_sub2(v, w) @@ -206,8 +165,9 @@ contains call vector_sub3(u, v, w) @assertEqual(u%size(), v%size()) + @assertTrue(associated(u%x)) @assertEqual(u%size(), w%size()) - @assertTrue(allocated(u%x)) + @assertTrue(associated(w%x)) if (NEKO_BCKND_DEVICE .eq. 1) then call device_memcpy(u%x, u%x_d, n, DEVICE_TO_HOST, sync=.true.) @@ -223,13 +183,13 @@ contains subroutine test_vector_cmult_scalar(this) class (test_vector), intent(inout) :: this integer, parameter :: n = 4711 - real(kind=rp), parameter :: s =42.0_rp + real(kind=rp), parameter :: s = 42.0_rp type(vector_t) :: v, u integer :: i call v%init(n) call u%init(n) - v = 2.0_rp + call vector_cfill(v, 2.0_rp) call vector_cmult(v, s) if (NEKO_BCKND_DEVICE .eq. 1) then @@ -243,7 +203,7 @@ contains call vector_cmult2(u, v, s) @assertEqual(u%size(), v%size()) - @assertTrue(allocated(u%x)) + @assertTrue(u%is_allocated()) if (NEKO_BCKND_DEVICE .eq. 1) then call device_memcpy(u%x, u%x_d, n, DEVICE_TO_HOST, sync=.true.)