Add unit tests for selection position calculation.
[gromacs.git] / src / gromacs / selection / tests / refdata / referencedata.xsl
blob5f6cb924d267b745064a2cea77f589b965149baf
1 <?xml version="1.0"?>
3 <xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6 <xsl:import href="common-referencedata.xsl"/>
8 <!-- Index handling reference data -->
10 <xsl:template match="BlockAtoms">
11 <xsl:if test="Sequence[@Name='Input']">
12 <h2>Input Atoms</h2>
13 <xsl:call-template name="SequenceAsHorizontalTable">
14 <xsl:with-param name="root" select="Sequence[@Name='Input']"/>
15 </xsl:call-template>
16 </xsl:if>
17 <h2>Blocks</h2>
18 <table border="1">
19 <tr>
20 <th>Atom count</th>
21 <th>Atoms</th>
22 </tr>
23 <xsl:for-each select="Block">
24 <tr>
25 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
26 <td>
27 <xsl:call-template name="SequenceAsCSV">
28 <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
29 </xsl:call-template>
30 </td>
31 </tr>
32 </xsl:for-each>
33 </table>
34 </xsl:template>
36 <xsl:template match="IndexMapping">
37 <h2><xsl:value-of select="@Name"/></h2>
38 <h3>Input Atoms</h3>
39 <xsl:call-template name="SequenceAsHorizontalTable">
40 <xsl:with-param name="root" select="Sequence[@Name='Input']"/>
41 </xsl:call-template>
42 <h3>Mapping</h3>
43 <table border="1">
44 <tr>
45 <th>RefId</th>
46 <xsl:if test="Block/Int[@Name='MapId']">
47 <th>MapId</th>
48 </xsl:if>
49 <th>Atom count</th>
50 <th>Atoms</th>
51 </tr>
52 <xsl:for-each select="Block">
53 <tr>
54 <td><xsl:value-of select="Int[@Name='RefId']"/></td>
55 <xsl:if test="Int[@Name='MapId']">
56 <td><xsl:value-of select="Int[@Name='MapId']"/></td>
57 </xsl:if>
58 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
59 <td>
60 <xsl:call-template name="SequenceAsCSV">
61 <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
62 </xsl:call-template>
63 </td>
64 </tr>
65 </xsl:for-each>
66 </table>
67 </xsl:template>
69 <!-- Position calculation reference data -->
71 <xsl:template match="InitializedPositions">
72 <h2>Initialized Positions</h2>
73 <xsl:apply-templates />
74 </xsl:template>
76 <xsl:template match="EvaluatedPositions">
77 <h2>Evaluated for <xsl:value-of select="@Name"/></h2>
78 <xsl:apply-templates />
79 </xsl:template>
81 <xsl:template match="Positions">
82 <xsl:if test="@Name">
83 <h3><xsl:value-of select="@Name"/></h3>
84 </xsl:if>
85 <table>
86 <tr>
87 <td>Count:</td>
88 <td>
89 <xsl:value-of select="Int[@Name='Count']"/>
90 (type: <xsl:value-of select="String[@Name='Type']"/>)
91 </td>
92 </tr>
93 <tr>
94 <td>Blocks:</td>
95 <td>
96 <xsl:call-template name="SequenceAsCSV">
97 <xsl:with-param name="root" select="Sequence[@Name='Block']"/>
98 </xsl:call-template>
99 </td>
100 </tr>
101 </table>
102 <table border="1">
103 <tr>
104 <th>RefId</th>
105 <th>Atom count</th>
106 <th>Atoms</th>
107 <xsl:if test="Position/Vector[@Name='Coordinates']">
108 <th>Coordinates</th>
109 </xsl:if>
110 <xsl:if test="Position/Vector[@Name='Velocity']">
111 <th>Velocity</th>
112 </xsl:if>
113 <xsl:if test="Position/Vector[@Name='Force']">
114 <th>Force</th>
115 </xsl:if>
116 </tr>
117 <xsl:for-each select="Position">
118 <tr>
119 <td><xsl:value-of select="Int[@Name='RefId']"/></td>
120 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
121 <td>
122 <xsl:call-template name="SequenceAsCSV">
123 <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
124 </xsl:call-template>
125 </td>
126 <xsl:if test="Vector[@Name='Coordinates']">
127 <td>
128 <xsl:apply-templates select="Vector[@Name='Coordinates']"/>
129 </td>
130 </xsl:if>
131 <xsl:if test="Vector[@Name='Velocity']">
132 <td>
133 <xsl:apply-templates select="Vector[@Name='Velocity']"/>
134 </td>
135 </xsl:if>
136 <xsl:if test="Vector[@Name='Force']">
137 <td>
138 <xsl:apply-templates select="Vector[@Name='Force']"/>
139 </td>
140 </xsl:if>
141 </tr>
142 </xsl:for-each>
143 </table>
144 </xsl:template>
146 <!-- Selection reference data -->
148 <xsl:key name="SelectionName" match="ParsedSelections/ParsedSelection" use="@Name"/>
150 <xsl:template match="ParsedSelections">
151 <h2>Parsed Selections</h2>
152 <table border="1">
153 <tr>
154 <th/>
155 <th>Input</th>
156 <th>Name</th>
157 <th>Text</th>
158 <th>Dynamic</th>
159 </tr>
160 <xsl:for-each select="*">
161 <tr>
162 <td><xsl:value-of select="@Name"/></td>
163 <td><xsl:value-of select="String[@Name='Input']"/></td>
164 <td><xsl:value-of select="String[@Name='Name']"/></td>
165 <td><xsl:value-of select="String[@Name='Text']"/></td>
166 <td><xsl:value-of select="Bool[@Name='Dynamic']"/></td>
167 </tr>
168 </xsl:for-each>
169 </table>
170 </xsl:template>
172 <xsl:template match="CompiledSelections">
173 <h2>Compiled Selections</h2>
174 <xsl:apply-templates />
175 </xsl:template>
177 <xsl:template match="EvaluatedSelections">
178 <h2>Evaluated for <xsl:value-of select="@Name"/></h2>
179 <xsl:apply-templates />
180 </xsl:template>
182 <xsl:template match="Selection">
183 <h3><xsl:value-of select="@Name"/></h3>
185 Selection text:<br/>
186 <xsl:value-of select="key('SelectionName', @Name)/String[@Name='Text']"/>
187 </p>
188 <xsl:apply-templates />
189 </xsl:template>
191 <xsl:template match="Selection/Sequence[@Name='Atoms']">
193 Atoms:
194 <xsl:call-template name="SequenceAsHorizontalTable"/>
195 </p>
196 </xsl:template>
198 <xsl:template match="Selection/Sequence[@Name='Positions']">
200 Positions (count: <xsl:value-of select="Int[@Name='Length']"/>):
201 <table border="1">
202 <tr>
203 <xsl:if test="Position/Sequence[@Name='Atoms']">
204 <th>Atom count</th>
205 <th>Atoms</th>
206 </xsl:if>
207 <xsl:if test="Position/Int[@Name='RefId']">
208 <th>RefId</th>
209 <th>MappedId</th>
210 </xsl:if>
211 <xsl:if test="Position/Vector[@Name='Coordinates']">
212 <th>Coordinates</th>
213 </xsl:if>
214 <xsl:if test="Position/Real[@Name='Mass']">
215 <th>Mass</th>
216 </xsl:if>
217 <xsl:if test="Position/Real[@Name='Charge']">
218 <th>Charge</th>
219 </xsl:if>
220 </tr>
221 <xsl:for-each select="Position">
222 <tr>
223 <xsl:if test="Sequence[@Name='Atoms']">
224 <td><xsl:value-of select="Sequence[@Name='Atoms']/Int[@Name='Length']"/></td>
225 <td>
226 <xsl:call-template name="SequenceAsCSV">
227 <xsl:with-param name="root" select="Sequence[@Name='Atoms']"/>
228 </xsl:call-template>
229 </td>
230 </xsl:if>
231 <xsl:if test="Int[@Name='RefId']">
232 <td><xsl:value-of select="Int[@Name='RefId']"/></td>
233 <td><xsl:value-of select="Int[@Name='MappedId']"/></td>
234 </xsl:if>
235 <xsl:if test="Vector[@Name='Coordinates']">
236 <td>
237 <xsl:apply-templates select="Vector[@Name='Coordinates']"/>
238 </td>
239 </xsl:if>
240 <xsl:if test="Real[@Name='Mass']">
241 <td><xsl:value-of select="Real[@Name='Mass']"/></td>
242 </xsl:if>
243 <xsl:if test="Real[@Name='Charge']">
244 <td><xsl:value-of select="Real[@Name='Charge']"/></td>
245 </xsl:if>
246 </tr>
247 </xsl:for-each>
248 </table>
249 </p>
250 </xsl:template>
252 </xsl:stylesheet>