41
41
42
42
from nomad_simulations .physical_property import PhysicalProperty
43
43
44
+ ####################################################
45
+ # Abstract force classes
46
+ ####################################################
44
47
45
- ################################
46
- # List of Forces Contributions #
47
- ################################
48
-
49
-
50
- class FreeForce (PhysicalProperty ):
48
+ class Force (PhysicalProperty ):
51
49
"""
52
- Contains the value and information regarding the forces on the atoms
53
- corresponding to the minus gradient of energy_free. The (electronic) energy_free
54
- contains the information on the change in (fractional) occupation of the
55
- electronic eigenstates, which are accounted for in the derivatives, yielding a
56
- truly energy-conserved quantity.
50
+ Abstract physical property section describing some energy of a (sub)system.
57
51
"""
58
52
53
+ type = Quantity (
54
+ type = MEnum ('classical' , 'quantum' ),
55
+ description = """
56
+ """ ,
57
+ )
58
+
59
59
value = Quantity (
60
60
type = np .dtype (np .float64 ),
61
- shape = ['n_atoms' , 3 ],
62
61
unit = 'newton' ,
63
62
description = """
64
- The value of the free force.
63
+ The value of the force.
65
64
""" ,
66
65
)
67
66
68
67
def normalize (self , archive , logger ) -> None :
69
68
super ().normalize (archive , logger )
70
69
70
+ ######################################################
71
+ # List of general force properties/contributions that
72
+ # can have both classical and quantum interpretations
73
+ ######################################################
71
74
72
- class ZeroTemperatureForce ( PhysicalProperty ):
75
+ class TotalForce ( Force ):
73
76
"""
74
- Contains the value and information regarding the forces on the atoms
75
- corresponding to the minus gradient of energy_T0.
77
+ Section containing the total force of a (sub)system.
78
+
79
+ Contains the value and information regarding the total forces on the atoms
80
+ calculated as minus gradient of energy_total.
76
81
"""
82
+ # ! We need to avoid giving the precise method of calculation without also providing context, this is not necessarily true in general!
77
83
78
- value = Quantity (
79
- type = np .dtype (np .float64 ),
80
- shape = ['n_atoms' , 3 ],
81
- unit = 'newton' ,
82
- description = """
83
- The value of the free force.
84
- """ ,
84
+ contributions = SubSection (
85
+ sub_section = Force .m_def , repeats = True
85
86
)
86
87
87
88
def normalize (self , archive , logger ) -> None :
88
89
super ().normalize (archive , logger )
89
90
90
91
91
- class RawForce (PhysicalProperty ):
92
- """ """
92
+ ################################
93
+ # List of Forces Contributions #
94
+ ################################
93
95
94
- value = Quantity (
95
- type = np .dtype (np .float64 ),
96
- shape = ['n_atoms' , 3 ],
97
- unit = 'newton' ,
98
- description = """
99
- Value of the forces acting on the atoms **not including** such as fixed atoms,
100
- distances, angles, dihedrals, etc.
101
- """ ,
102
- # ? This is VERY imprecise, is this used regularly?
103
- )
96
+
97
+ class FreeForce (Force ):
98
+ """
99
+ Physical property section describing...
100
+
101
+ Contains the value and information regarding the forces on the atoms
102
+ corresponding to the minus gradient of energy_free. The (electronic) energy_free
103
+ contains the information on the change in (fractional) occupation of the
104
+ electronic eigenstates, which are accounted for in the derivatives, yielding a
105
+ truly energy-conserved quantity.
106
+ """
104
107
105
108
def normalize (self , archive , logger ) -> None :
106
109
super ().normalize (archive , logger )
107
110
108
- # ? Do we want to support custom contributions?
109
- # contributions = SubSection(
110
- # sub_section=ForcesEntry.m_def,
111
- # description="""
112
- # Contains other forces contributions to the total atomic forces not already
113
- # defined.
114
- # """,
115
- # repeats=True,
116
- # )
117
-
118
- # types = SubSection(
119
- # sub_section=ForcesEntry.m_def,
120
- # description="""
121
- # Contains other types of forces not already defined.
122
- # """,
123
- # repeats=True,
124
- # )
125
-
126
-
127
- class ForceContributions (ArchiveSection ):
111
+
112
+ class ZeroTemperatureForce (Force ):
128
113
"""
129
- Section containing contributions to the potential energy from a classical force field.
114
+ Physical property section describing...
115
+
116
+ Contains the value and information regarding the forces on the atoms
117
+ corresponding to the minus gradient of energy_T0.
130
118
"""
131
119
132
- free = SubSection (sub_section = FreeForce .m_def , repeats = False )
120
+ def normalize (self , archive , logger ) -> None :
121
+ super ().normalize (archive , logger )
133
122
134
- zero_temperature_force = SubSection (
135
- sub_section = ZeroTemperatureForce .m_def , repeats = False
136
- )
137
123
138
- raw = SubSection (sub_section = RawForce .m_def , repeats = False )
124
+ class RawForce (Force ):
125
+ """
126
+ Physical property section describing...
127
+
128
+ Value of the forces acting on the atoms **not including** such as fixed atoms,
129
+ distances, angles, dihedrals, etc.
130
+ """
131
+ # ? This is VERY imprecise, is this used regularly?
139
132
140
133
def normalize (self , archive , logger ) -> None :
141
134
super ().normalize (archive , logger )
142
- self .name = self .m_def .name
135
+
136
+
137
+ # ? Do we want to support custom contributions?
138
+ # contributions = SubSection(
139
+ # sub_section=ForcesEntry.m_def,
140
+ # description="""
141
+ # Contains other forces contributions to the total atomic forces not already
142
+ # defined.
143
+ # """,
144
+ # repeats=True,
145
+ # )
146
+
147
+ # types = SubSection(
148
+ # sub_section=ForcesEntry.m_def,
149
+ # description="""
150
+ # Contains other types of forces not already defined.
151
+ # """,
152
+ # repeats=True,
153
+ # )
143
154
144
155
145
156
# Old version of the Forces description
@@ -149,28 +160,4 @@ def normalize(self, archive, logger) -> None:
149
160
# Cartesian coordinates. In addition, these are obtained by filtering out the
150
161
# unitary transformations (center-of-mass translations and rigid rotations for
151
162
# non-periodic systems, see value_raw for the unfiltered counterpart).
152
- class TotalForce (PhysicalProperty ):
153
- """
154
- Section containing the total force of a (sub)system.
155
-
156
- Contains the value and information regarding the total forces on the atoms
157
- calculated as minus gradient of energy_total.
158
- """
159
-
160
- # ! We need to avoid giving the precise method of calculation without also providing context, this is not necessarily true in general!
161
163
162
- value = Quantity (
163
- type = np .float64 ,
164
- unit = 'newton' ,
165
- description = """
166
- The value of the total force.
167
- """ ,
168
- )
169
-
170
- contributions = SubSection (
171
- sub_section = ForceContributions .m_def , repeats = False
172
- )
173
- # ? Do we need to separate classical and quantum contributions here?
174
-
175
- def normalize (self , archive , logger ) -> None :
176
- super ().normalize (archive , logger )
0 commit comments