-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmgs_physfields.h
More file actions
111 lines (104 loc) · 4.27 KB
/
mgs_physfields.h
File metadata and controls
111 lines (104 loc) · 4.27 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
99
100
101
102
103
104
105
106
107
108
109
110
!******************************************************************************
!* Material model plugin for Elmer's MagnetoStriction.f90 *
!* *
!* This file is part of 'elmer-mgs-galfenol' *
!******************************************************************************
!***************************************************
! This file is manually implemented, do not delete!
!***************************************************
! Do not compact the format of the intent declarations. The rudimentary parser
! in the stage2 code generator only understands this one-item-per-line format.
! (This format is also produced by SymPy.)
!
! This file contains essentially additional, user-defined stage1 functions
! and subroutines.
!
! These routines implement H, ∂H/∂B, σ, and ∂σ/∂ε in terms of partial derivatives
! of the potential ϕ. These are needed in the material model for Elmer's
! MagnetoStriction.f90. An adaptor is needed to fit the interface, because
! we cannot here control the ordering of the formal parameter list produced
! by stage2 for the public API.
!
! For more information, see the implementation file.
! H = -∂ϕ/∂B
interface
subroutine H(dphi_dBx, dphi_dBy, dphi_dBz, &
H_out)
use types
implicit none
REAL(KIND=dp), intent(in) :: dphi_dBx
REAL(KIND=dp), intent(in) :: dphi_dBy
REAL(KIND=dp), intent(in) :: dphi_dBz
REAL(KIND=dp), intent(out), dimension(1:3, 1:1) :: H_out
end subroutine
end interface
interface
subroutine dH_dB(d2phi_dBx2, d2phi_dBy2, d2phi_dBz2, &
d2phi_dBxdBy, d2phi_dBxdBz, d2phi_dBydBz, &
dH_dB_out)
use types
implicit none
REAL(KIND=dp), intent(in) :: d2phi_dBx2
REAL(KIND=dp), intent(in) :: d2phi_dBy2
REAL(KIND=dp), intent(in) :: d2phi_dBz2
REAL(KIND=dp), intent(in) :: d2phi_dBxdBy
REAL(KIND=dp), intent(in) :: d2phi_dBxdBz
REAL(KIND=dp), intent(in) :: d2phi_dBydBz
REAL(KIND=dp), intent(out), dimension(1:3, 1:3) :: dH_dB_out
end subroutine
end interface
! σ = +∂ϕ/∂ε
interface
subroutine S(dphi_depsxx, dphi_depsyy, dphi_depszz, &
dphi_depsyz, dphi_depszx, dphi_depsxy, &
S_out)
use types
implicit none
REAL(KIND=dp), intent(in) :: dphi_depsxx
REAL(KIND=dp), intent(in) :: dphi_depsyy
REAL(KIND=dp), intent(in) :: dphi_depszz
REAL(KIND=dp), intent(in) :: dphi_depsyz
REAL(KIND=dp), intent(in) :: dphi_depszx
REAL(KIND=dp), intent(in) :: dphi_depsxy
REAL(KIND=dp), intent(out), dimension(1:3, 1:3) :: S_out
end subroutine
end interface
interface
subroutine dS_deps(d2phi_depsxx2, d2phi_depsyy2, d2phi_depszz2, &
d2phi_depsyz2, d2phi_depszx2, d2phi_depsxy2, &
d2phi_depsxxdepsxy, d2phi_depsxxdepsyy, &
d2phi_depsxxdepsyz, d2phi_depsxxdepszx, &
d2phi_depsxxdepszz, &
d2phi_depsxydepsyy, d2phi_depsxydepsyz, &
d2phi_depsxydepszx, d2phi_depsxydepszz, &
d2phi_depsyydepsyz, d2phi_depsyydepszx, &
d2phi_depsyydepszz, &
d2phi_depsyzdepszx, d2phi_depsyzdepszz, &
d2phi_depszxdepszz, &
dS_deps_out)
use types
implicit none
REAL(KIND=dp), intent(in) :: d2phi_depsxx2
REAL(KIND=dp), intent(in) :: d2phi_depsyy2
REAL(KIND=dp), intent(in) :: d2phi_depszz2
REAL(KIND=dp), intent(in) :: d2phi_depsyz2
REAL(KIND=dp), intent(in) :: d2phi_depszx2
REAL(KIND=dp), intent(in) :: d2phi_depsxy2
REAL(KIND=dp), intent(in) :: d2phi_depsxxdepsxy
REAL(KIND=dp), intent(in) :: d2phi_depsxxdepsyy
REAL(KIND=dp), intent(in) :: d2phi_depsxxdepsyz
REAL(KIND=dp), intent(in) :: d2phi_depsxxdepszx
REAL(KIND=dp), intent(in) :: d2phi_depsxxdepszz
REAL(KIND=dp), intent(in) :: d2phi_depsxydepsyy
REAL(KIND=dp), intent(in) :: d2phi_depsxydepsyz
REAL(KIND=dp), intent(in) :: d2phi_depsxydepszx
REAL(KIND=dp), intent(in) :: d2phi_depsxydepszz
REAL(KIND=dp), intent(in) :: d2phi_depsyydepsyz
REAL(KIND=dp), intent(in) :: d2phi_depsyydepszx
REAL(KIND=dp), intent(in) :: d2phi_depsyydepszz
REAL(KIND=dp), intent(in) :: d2phi_depsyzdepszx
REAL(KIND=dp), intent(in) :: d2phi_depsyzdepszz
REAL(KIND=dp), intent(in) :: d2phi_depszxdepszz
REAL(KIND=dp), intent(out), dimension(1:9, 1:9) :: dS_deps_out
end subroutine
end interface