@@ -21,6 +21,17 @@ struct DipoleSourceTerm{Dipole<:Function,Field<:Union{ElectricFields.AbstractFie
21
21
new {Dipole,FieldAmplitude} (d, Fv)
22
22
end
23
23
24
+ Base. show (io:: IO , d:: DipoleSourceTerm ) =
25
+ write (io, " DipoleSourceTerm" )
26
+
27
+ function Base. show (io:: IO , mime:: MIME"text/plain" , d:: DipoleSourceTerm )
28
+ show (io, d)
29
+ print (io, " \n Dipole: " )
30
+ show (io, mime, d. d)
31
+ print (io, " \n Field: " )
32
+ show (io, d. F)
33
+ end
34
+
24
35
dipole (F:: Number , d:: Number ) = F* d
25
36
dipole (F:: SVector{3} , d:: SVector{3} ) = dot (F, d)
26
37
dipole (F:: Number , d:: SVector{3} ) = F* d[3 ]
@@ -54,11 +65,17 @@ IonizationChannel(E, args...) =
54
65
Base. show (io:: IO , ic:: IonizationChannel ) =
55
66
write (io, " IonizationChannel: Iₚ = $(ic. E) Ha = $(27.211 ic. E) eV" )
56
67
68
+ function Base. show (io:: IO , mime:: MIME"text/plain" , ic:: IonizationChannel )
69
+ show (io, ic)
70
+ print (io, " \n Source term: " )
71
+ show (io, mime, ic. st)
72
+ end
73
+
57
74
# * Couplings
58
75
59
76
abstract type AbstractCanonicalMomentumConservation end
60
- struct CanonicalMomentumConservation <: AbstractCanonicalMomentumConservation end
61
- struct NoCanonicalMomentumConservation <: AbstractCanonicalMomentumConservation end
77
+ struct CanonicalMomentumConservation <: AbstractCanonicalMomentumConservation end
78
+ struct NoCanonicalMomentumConservation <: AbstractCanonicalMomentumConservation end
62
79
63
80
abstract type AbstractCoupling end
64
81
Base. iszero (:: AbstractCoupling ) = false
@@ -69,6 +86,8 @@ struct NoCoupling <: AbstractCoupling end
69
86
Base. iszero (:: NoCoupling ) = true
70
87
Base. zero (:: AbstractCoupling ) = NoCoupling ()
71
88
89
+ Base. show (io:: IO , :: NoCoupling ) = write (io, " 0" )
90
+
72
91
# ** Dipole couplings
73
92
74
93
struct DipoleCoupling{DipoleMoment<: Union{Number,SVector{3}} ,Field<: ElectricFields.AbstractField } <: AbstractCoupling
79
98
canonical_momentum_conservation (:: DipoleCoupling ) = CanonicalMomentumConservation ()
80
99
canonical_momentum_conservation (:: Type{<:DipoleCoupling} ) = CanonicalMomentumConservation ()
81
100
101
+ Base. show (io:: IO , :: DipoleCoupling ) = write (io, " 𝐅⋅𝐫" )
102
+
82
103
# ** Coulomb couplings
83
104
84
105
momentum_transfer (k:: Number , p:: Number ) = k- p
@@ -90,3 +111,10 @@ struct CoulombCoupling{Coupling} <: AbstractCoupling
90
111
end
91
112
92
113
(cc:: CoulombCoupling )(𝐤, 𝐩, _) = cc. coupling (𝐤, 𝐩)
114
+
115
+ Base. show (io:: IO , :: CoulombCoupling ) = write (io, " ĝ" )
116
+
117
+ function Base. show (io:: IO , mime:: MIME"text/plain" , g:: CoulombCoupling )
118
+ write (io, " CoulombCoupling: " )
119
+ show (io, mime, g. coupling)
120
+ end
0 commit comments