This repository was archived by the owner on May 15, 2024. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathFFaUserFuncInterface.f90
More file actions
98 lines (85 loc) · 4.01 KB
/
Copy pathFFaUserFuncInterface.f90
File metadata and controls
98 lines (85 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
!! SPDX-FileCopyrightText: 2023 SAP SE
!!
!! SPDX-License-Identifier: Apache-2.0
!!
!! This file is part of FEDEM - https://openfedem.org
!!==============================================================================
!> @file FFaUserFuncInterface.f90
!> @brief Fortran interface for FFaUserFuncPlugin methods.
!> @details This file contains a module with Fortran interface definitions
!> for the methods of the FFaUserFuncPlugin class.
!> See the file FFaUserFuncPlugin_F.C for the implementation
!> of the wrapper functions of this interface.
!!==============================================================================
!> @brief Fortran interface for FFaUserFuncPlugin methods.
module FFaUserFuncInterface
implicit none
interface
!> @brief Loads the user-defined plugin(s) into core memory.
!> @param[in] funcId Index of function to return number of arguments for
!> @param[out] sign Signature string of the user-defined function plugin
!> @return Number of arguments for specified user-defined function
function ffauf_init (funcId,sign)
integer :: ffauf_init
integer , intent(in) :: funcId
character(len=*), intent(out) :: sign
end function ffauf_init
!> @brief Returns the number of parameters for the function @a funcId.
function ffauf_getnopar (funcId)
integer :: ffauf_getnopar
integer , intent(in) :: funcId
end function ffauf_getnopar
!> @brief Returns the function flag for the function @a funcId.
function ffauf_getflag (funcId)
integer :: ffauf_getflag
integer , intent(in) :: funcId
end function ffauf_getflag
!> @brief Evaluates the specified user-defined function.
!> @param[in] baseId Base Id of the function to evaluate
!> @param[in] funcId Index of function to evaluate
!> @param[in] params Function parameters (constant)
!> @param[in] args Function argument values
!> @param[out] err Error flag
!> @return The function value
function ffauf_getvalue (baseId,funcId,params,args,err)
integer , parameter :: dp = kind(1.0D0)
real(dp) :: ffauf_getvalue
integer , intent(in) :: baseId, funcId
real(dp), intent(in) :: params(*), args(*)
integer , intent(out) :: err
end function ffauf_getvalue
!> @brief Evaluates the derivative of specified user-defined function.
!> @param[in] baseId Base Id of the function to evaluate
!> @param[in] funcId Index of function to evaluate
!> @param[in] ia Index of the argument to return derivative with respect to
!> @param[in] params Function parameters (constant)
!> @param[in] args Function argument values
!> @param[out] err Error flag
!> @return The function derivative
function ffauf_getdiff (baseId,funcId,ia,params,args,err)
integer , parameter :: dp = kind(1.0D0)
real(dp) :: ffauf_getdiff
integer , intent(in) :: baseId, funcId, ia
real(dp), intent(in) :: params(*), args(*)
integer , intent(out) :: err
end function ffauf_getdiff
!> @brief Evaluates the specified user-defined wave function.
!> @param[in] baseId Base Id of the function to evaluate
!> @param[in] funcId Index of function to evaluate
!> @param[in] d Wather depth
!> @param[in] g Gravity constant
!> @param[in] params Function parameters (constant)
!> @param[in] args Function argument values (position and time)
!> @param[out] h Wave elevation
!> @param[out] u Water particle velocity
!> @param[out] du Water particle acceleration
!> @return Error flag
function ffauf_wave (baseId,funcId,d,g,params,args,h,u,du)
integer , parameter :: dp = kind(1.0D0)
integer :: ffauf_wave
integer , intent(in) :: baseId, funcId
real(dp), intent(in) :: d, g, params(*), args(*)
real(dp), intent(out) :: h, u(3), du(3)
end function ffauf_wave
end interface
end module FFaUserFuncInterface