File: quants.htm

package info (click to toggle)
evolver 2.70+ds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 17,148 kB
  • sloc: ansic: 127,395; makefile: 209; sh: 98
file content (3148 lines) | stat: -rw-r--r-- 124,073 bytes parent folder | download | duplicates (2)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
<!DOCTYPE HTML>
<HEAD><TITLE>Surface Evolver Documentation: named quantities </title>
<link rel="stylesheet" type="text/css" href="evdoc-style.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
</head>

<BODY>
<!--NewPage-->

<h1 class="center">
<a href="http://www.susqu.edu/brakke/evolver/evolver.htm" class="comic">
Surface Evolver</a> Documentation</h1>

<a href="evolver.htm#doc-top">Back to top of Surface Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a>

<a   id="quantity-top"></a>
<a   id="quantity"></a>
<H2> Named quantities and methods </H2>
This is the systematic scheme of calculating global quantities 
such as area, volume, and surface integrals that replaces the 
original ad hoc scheme in the Evolver.  Briefly,
<a href="#named-methods">methods</a> are built-in
functions, and 
<a href="#named-quantities">named quantities</a>
are combinations of 
<a href="#method-instances">instances of methods</a>.
See the <a href="ringblob.htm">ringblob datafile</a>
for an example.
The original ad hoc calculations are still the default
where they exist, but all new quantities are being added
in the named quantity scheme.  Some new features will work
only with named quantities.  To convert everything to named
quantities, start Evolver with the <a href="general.htm#options">-q</a>
option or use the <a href="commands.htm#convert_to_quantities">
convert_to_quantities</a> command.
This has not been made the default since named quantities can be
slower than the originals.
<p>
The sample datafiles <code>qcube.fe</code>, <code>qmound.fe</code>, and 
<code>ringblob.fe</code>
contains some examples of named quantities and instances.  The first two
are quantity versions of <code>cube.fe</code> and <code>mound.fe</code>.  These 
illustrate the most general and useful methods, namely
facet_vector_integral, facet_scalar_integral, and edge_vector_integral,
rather than the faster but more specialized methods such as facet_area.
My advice is that the user stick to the old implicit methods for 
area, volume, and gravitational energy, and use named quantities only
for specialized circumstances.

<hr>
<h3>Chapter contents:</h3>
<ul>
<li> <a href="#named-methods">Named methods</a>
<li> <a href="#method-instances">Method instances</a>
<li> <a href="#named-quantities">Named quantities</a>
<li> <a href="#methods">Implemented methods</a>
</ul>

<hr>
<a   id="method"></a><a   id="named-methods"></a>
<H2>Named methods</H2>
A "method" is a way of calculating a scalar
value from some particular type of element (vertex, edge, facet, body).
Each method is implemented internally as a set of functions for
calculating the value and its gradient as a function of vertex
positions.  The most common methods also have Hessian functions.
Methods are referred to by their names.  
<p> See <a href="#methods">
Implemented methods</a> for a list of available methods.
Adding a new method involves writing C routines to calculate the value
and the gradient (and maybe the Hessian)
as functions of vertex coordinates, adding the function declarations
to <code>quantity.h</code>, and adding a
structure to the method declaration array in <code>quantity.c</code>. All the
other syntax for invoking it from the datafile is already in place.

<hr>
<h2><a   id="method-instances">Method instances</a></h2>
A "method instance" is the sum of a particular method applied
to a particular set of geometric elements.
Some methods (like facet_area)
are completely self-contained. Others (like facet_vector_integral)
require the user to specify some further information.  For these,
each instance has a specification of this further information.
Method instances are defined in the datafile, and may either be
unnamed parts of <a href="datafile.htm#named-quantity-decl">named quantity
definitions</a> or separate <a href="datafile.htm#method-instance-decl">
named method instances</a> for inclusion in named quantities.   
The separate named version is useful if you want to inspect 
instance values for the whole surface or individual elements.

An instance total value can be printed with the <a href="single.htm#A">A</a>
 commands, or may be 
referred to as "instancename.value" in commands.  The instance name
itself may be used as an element attribute.  For example, supposing there
is an instance named <code>moment</code>, which applies to facets.  
Then typical commands would be
<pre>  print moment.value
   print facet[3].moment
   list facet where moment &gt; 0.1
</pre>

<b>Modulus.</b>
<a   id="instance-modulus"></a>Every method
instance has a "modulus", which is multiplied times the basic
method value to give the instance value.  A modulus of 0
causes the entire instance calculation to be omitted whenever quantities
are calculated.  The modulus may be set in the 
<a href="datafile.htm#method-instance-decl">datafile</a> or with the 
<a href="single.htm#A">A</a> command or by assignment.  Example commands:
<pre>
   print moment.modulus
   moment.modulus := 1.3
</pre>

<a   id="element_modulus"></a>A method instance may be declared to use
a different modulus for each element by specifying an element extra
attribute to use for that purpose.  The extra attribute has to have already
been declared. Example:
<pre>
   define facet attribute mymod real
   quantity myquant energy method facet_area global element_modulus mymod
</pre>
Of course, it is up to the user to properly initialize the values of the
extra attribute.

<p> <a   id="element-orientation"></a>
<b>Orientation.</b> Some methods, those that logically depend on the orientation
of the element, can be applied with a relative orientation.
When applied to individual elements in the datafile, a negative
orientation is indicated by a '-' after the instance name.
When applied at runtime with the <code>set</code> command, 
the orientation will be negative if the element is generated
with negative orientation, 
i.e. <code>set body[1].facet method_instance qqq</code>.  
The methods currently implementing this feature are:
edge_vector_integral, string_gravity, facet_vector_integral,
facet_2form_integral, facet_volume, facet_torus_volume,
simplex_vector_integral, simplex_k_vector_integral,
edge_k_vector_integral, gravity_method, and full_gravity_method.



<hr>
<a   id="conserved"></a><a   id="named-quantities"></a>
<h2>Named quantities</h2>


A "named quantity" is the sum total of various
<a href="#method-instances">method instances</a>,
although usually just one instance is involved.
The instances need not apply to the same type of element;
for example, both facet and edge integrals may be needed to
define a volume quantity.
<a   id="energy-quantity"></a><a   id="info_only-quantity"></a>
<a   id="fixed-quantity"></a>  
<a   id="conserved-quantity"></a>  
Each named quantity is one of four types: 
<ul><li> "energy"  quantities which are added to the total energy of the surface; 
<li> "fixed" quantities that are constrained to a
fixed target value (by Newton steps at each iteration); and
<li> "conserved" quantities  are like fixed,  but the value is irrelevant. The
   quantity gradient is used to eliminate a degree of freedom in motion.  
Rarely used, but useful to eliminate rotational degree of freedom, for example.
  Will not work with optimizing parameters, since
they do gradients by differences.
<li> "info_only" quantities whose values are merely reported to the user.
</ul>
This type is initially set in a quantity's 
<a href="datafile.htm#named-quantity-decl">
datafile declaration</a>.  A quantity can be toggled between fixed and
info_only with the "<code>fix</code> <i>quantityname</i>" and 
"<code>unfix</code> <i>quantityname</i>" commands.
<p>
<a   id="quantity-value"></a>
<a   id="value"></a>
The value of a quantity may be displayed with the 
<a href="single.htm#A">A</a> or <a href="single.htm#v">v</a> commands,
or as an expression "quantityname.value".  Furthermore, using the
   quantity name as an element attribute evaluates to the sum of all
the applicable component instance values on that element.  For example,
supposing there is a quantity named <code>vol</code>, one could do
<pre> 
   print vol.value
   print facet[2].vol
   histogram(facet,vol)
</pre>
<p>
<b>Modulus.</b>
<a   id="quantity-modulus"></a>
Each quantity has a "modulus", which is just a scalar multiplier for
the sum of all instance values. A modulus of 0 will turn off calculation
of all the instances.  The modulus can be set in the 
<a href="datafile.htm#named-quantity-decl">datafile declaration</a>, with the
<a href="single.htm#A">A</a> command, or by assignment:
<pre> quantityname.modulus := 1.2 </pre>
<p>
<b>Target value.</b>
<a   id="quantity-target"></a>
Each fixed quantity has a target value, to which the Evolver attempts to
constraint the quantity value.  Each time an iteration is done
( <a href="single.htm#g">g</a> command or the various 
<a href="commands.htm#hessian-command">Hessian</a> commands), Newton's Method
is used to project the surface to the constrained values.  The target
value can be displayed with the <a href="single.htm#A">A</a> or 
<a href="single.htm#v">v</a> commands, or as "quantityname.target".  
It can be changed with the <a href="single.htm#A">A</a> command or 
by assignment.  Example:
<pre>
   print qname.target
   qname.target := 3.12
</pre>
<p>
<b>Volconst.</b>
<a   id="quantity-volconst"></a>
A quantity can have a constant value added to it, similar to the
body attribute <a href="elements.htm#body-volconst">volconst</a>.
This quantity attribute is also called <code>volconst</code>.  It is
useful for adding in known values of say integrals that are omitted
from the actual calculation.  It can be set in the quantity's
datafile <a href="datafile.htm#named-quantity-decl">definition</a>, or
by an <a href="commands.htm">assignment</a> command.
<p>
<b>Pressure.</b>
<a   id="quantity-pressure"></a><a   id="quantity-Lagrange-multiplier"></a>
Each fixed quantity has a Lagrange multiplier associated to it.
The Lagrange multiplier of a constraint is the rate of energy change
with respect to the constraint target value.  For a volume constraint,
the Lagrange multiplier is just the pressure.  Lagrange multipliers are
calculated whenever an iteration step is done.  They may be displayed
with the <a href="single.htm#v">v</a> command in the "<code>pressure</code>"
column, or as an expression "quantityname.pressure".
<p>
<a   id="quantity-tolerance"></a>
<b>Tolerance.</b> A fixed quantity can have a tolerance attribute, which
 is used to judge convergence.
A surface is deemed converged when the sum of all ratios of quantity
discrepancies to tolerances is less than 1.  This sum also includes
bodies of fixed volume.  If the tolerance is not set or is negative, 
the value of
the variable target_tolerance is used, which has a default value of 0.0001.
<p>
<b>Function quantities.</b> Instead of being a simple sum of methods,
a named quantity can be an arbitrary function of named method values.
The datafile syntax has "function expression" instead of a method list.
For example:
<pre>
   method_instance qwerty method facet_scalar_integral
   scalar_integrand: x^2
   quantity foobar energy function qwerty.value^3
</pre>
Note the method name is used with a "value" suffix.  Also
note that the method values used are global values, not element-wise.
Quantity functions can do Hessian operations, if the component methods
have Hessians.  Such hessians can become quite memory consuming in 
default dense matrix form;  there is a toggle command <code>
function_quantity_sparse</code> that will cause sparse matrices to be used.
<p>
<b> Example.</b> The sample datafile <a href="column.htm">column.fe</a>
 contains some examples of named quantities and instances.

<p>
<b>Future.</b> It is planned that eventually all
energies and global constraints will be converted to named quantity system.
However, existing syntax will remain valid wherever possible.
Starting Evolver with the -q option will do this conversion now.

<hr><a   id="methods"></a>
<h2>Implemented methods</h2>
The currently implemented methods are listed here, grouped
somewhat by nature.  
<h4> 0-dimensional </h4>
<ul>
<li><a href="#vertex_scalar_integral">vertex_scalar_integral</a>
</ul>

<h4> 1-dimensional </h4>
<ul>
<li><a href="#circular_arc_length">circular_arc_length</a>
<li><a href="#circular_arc_area">circular_arc_area</a>
<li><a href="#density_edge_length">density_edge_length</a>
<li><a href="#dihedral_hooke">dihedral_hooke</a>
<li><a href="#edge_area">edge_area</a>
<li><a href="#edge_general_integral">edge_general_integral</a>
<li><a href="#edge_length">edge_length</a>,
<a href="#edge_tension">edge_tension</a>
<li><a href="#edge_scalar_integral">edge_scalar_integral</a>
<li><a href="#edge_torus_area">edge_torus_area</a>
<li><a href="#edge_vector_integral">edge_vector_integral</a>
<li><a href="#hooke_energy">hooke_energy</a>
<li><a href="#hooke2_energy">hooke2_energy</a>
<li><a href="#hooke3_energy">hooke3_energy</a>
<li><a href="#klein_length">klein_length</a>
<li><a href="#laplacian_mean_curvature">laplacian_mean_curvature</a>
<li><a href="#local_hooke_energy">local_hooke_energy</a>
<li><a href="#metric_edge_length">metric_edge_length</a>
<li><a href="#neo_hookean">neo_hookean</a>
<li><a href="#null_length">null_length</a>
<li><a href="#spherical_arc_length">spherical_arc_length</a>
<li><a href="#spherical_arc_area_n">spherical_arc_area_n</a>
<li><a href="#spherical_arc_area_s">spherical_arc_area_s</a>
<li><a href="#sqcurve_string">sqcurve_string</a>
<li><a href="#sqcurve2_string">sqcurve2_string</a>
<li><a href="#sqcurve3_string">sqcurve3_string</a>
<li><a href="#sqcurve_string_marked">sqcurve_string_marked</a>
<li><a href="#sq_gaussian_curv_cyl">sq_gaussian_curv_cyl</a>
<li><a href="#sq_mean_curv_cyl">sq_mean_curv_cyl</a>
<li><a href="#sq_torsion">sq_torsion</a>
<li><a href="#string_gravity">string_gravity</a>
</ul>

<h4> 2-dimensional </h4>
<ul>
<li><a href="#circle_willmore">circle_willmore</a>
<li><a href="#dirichlet_area">dirichlet_area</a>
<li><a href="#density_facet_area">density_facet_area</a>
<li><a href="#density_facet_area_u">density_facet_area_u</a>
<li><a href="#facet_2form_integral">facet_2form_integral</a>
<li><a href="#facet_2form_integral">facet_2form_sq_integral</a>
<li><a href="#facet_area">facet_area</a>,
    <a href="#facet_tension">facet_tension</a>
<li><a href="#facet_area_u">facet_area_u</a>
<li><a href="#facet_general_integral">facet_general_integral</a>
<li><a href="#facet_general_hi_d_integral">facet_general_hi_d_integral</a>
<li><a href="#facet_scalar_integral">facet_scalar_integral</a>
<li><a href="#facet_torus_volume">facet_torus_volume</a>
<li><a href="#facet_vector_integral">facet_vector_integral</a>
<li><a href="#facet_volume">facet_volume</a>
<li><a href="#full_gravity_method">full_gravity_method</a>
<li><a href="#gap_energy">gap_energy</a>
<li><a href="#gravity_method">gravity_method</a>
<li><a href="#klein_area">klein_area</a>
<li><a href="#laplacian_mean_curvature">laplacian_mean_curvature</a>
<li><a href="#metric_facet_area">metric_facet_area</a>
<li><a href="#null_area">null_area</a>
<li><a href="#pos_area_hess">pos_area_hess</a>
<li><a href="#sobolev_area">sobolev_area</a>
<li><a href="#spherical_area">spherical_area</a>
<li><a href="#stokes2d">stokes2d</a>
<li><a href="#stokes2d_laplacian">stokes2d_laplacian</a>
</ul>

<h4> 2-D Curvatures </h4>
<ul>
<li><a href="#mean_curvature_integral">mean_curvature_integral</a>
<li><a href="#mean_curvature_integral_a">mean_curvature_integral_a</a>
<li><a href="#sq_mean_curvature">sq_mean_curvature</a>
<li><a href="#eff_area_sq_mean_curvature">eff_area_sq_mean_curvature</a>
<li><a href="#normal_sq_mean_curvature">normal_sq_mean_curvature</a>
<li><a href="#mix_sq_mean_curvature">mix_sq_mean_curvature</a>
<li><a href="#star_sq_mean_curvature">star_sq_mean_curvature</a>
<li><a href="#star_eff_area_sq_mean_curvature">star_eff_area_sq_mean_curvature</a>
<li><a href="#star_normal_sq_mean_curvature">star_normal_sq_mean_curvature</a>
<li><a href="#star_perp_sq_mean_curvature">star_perp_sq_mean_curvature</a>
<li><a href="#gauss_curvature_integral">gauss_curvature_integral</a>
<li><a href="#star_gauss_curvature">star_gauss_curvature</a>
<li><a href="#sq_gauss_curvature">sq_gauss_curvature</a>
</ul>

<h4> General dimensions </h4>
<ul>
<li><a href="#simplex_vector_integral">simplex_vector_integral</a>
<li><a href="#simplex_k_vector_integral">simplex_k_vector_integral</a>
<li><a href="#edge_k_vector_integral">edge_k_vector_integral</a>
</ul>

<h4> Knot energies </h4>
<ul>
<li><a href="#knot_energy">knot_energy</a>
<li><a href="#uniform_knot_energy">uniform_knot_energy</a>
<li><a href="#uniform_knot_energy_normalizer">uniform_knot_energy_normalizer</a>
<li><a href="#uniform_knot_normalizer1">uniform_knot_normalizer1</a>
<li><a href="#uniform_knot_normalizer2">uniform_knot_normalizer2</a>
<li><a href="#edge_edge_knot_energy">edge_edge_knot_energy</a>,
<a href="#edge_knot_energy">edge_knot_energy</a>
<li><a href="#edge_knot_energy_normalizer">edge_knot_energy_normalizer</a>
<li><a href="#simon_knot_energy_normalizer">simon_knot_energy_normalizer</a>
<li><a href="#facet_knot_energy">facet_knot_energy</a>
<li><a href="#facet_knot_energy_fix">facet_knot_energy_fix</a>
<li><a href="#bi_surface">bi_surface</a>
<li><a href="#buck_knot_energy">buck_knot_energy</a>
<li><a href="#proj_knot_energy">proj_knot_energy</a>
<li><a href="#circle_knot_energy">circle_knot_energy</a>
<li><a href="#sphere_knot_energy">sphere_knot_energy</a>
<li><a href="#sin_knot_energy">sin_knot_energy</a>
<li><a href="#curvature_binormal">curvature_binormal</a>
<li><a href="#ddd_gamma_sq">ddd_gamma_sq</a>
<li><a href="#edge_min_knot_energy">edge_min_knot_energy</a>
<li><a href="#true_average_crossings">true_average_crossings</a>
<li><a href="#true_writhe">true_writhe</a>
<li><a href="#twist">twist</a>
<li><a href="#writhe">writhe</a>
<li><a href="#curvature_function">curvature_function</a>
<li><a href="#knot_thickness">knot_thickness</a>
<li><a href="#knot_thickness_0">knot_thickness_0</a>
<li><a href="#knot_thickness_p">knot_thickness_p</a>
<li><a href="#knot_thickness_p2">knot_thickness_p2</a>
<li><a href="#knot_thickness2">knot_thickness2</a>
<li><a href="#knot_local_thickness">knot_local_thickness</a>

</ul>

<h4> Elastic stretching energies </h4>
<ul>
<li><a href="#dirichlet_elastic">dirichlet_elastic</a>
<li><a href="#linear_elastic">linear_elastic</a>
<li><a href="#general_linear_elastic">general_linear_elastic</a>
<li><a href="#linear_elastic_B">linear_elastic_B</a>
<li><a href="#relaxed_elastic_A">relaxed_elastic_A</a>
<li><a href="#relaxed_elastic1_A">relaxed_elastic1_A</a>
<li><a href="#relaxed_elastic2_A">relaxed_elastic2_A</a>
<li><a href="#relaxed_elastic">relaxed_elastic</a>
<li><a href="#relaxed_elastic1">relaxed_elastic1</a>
<li><a href="#relaxed_elastic2">relaxed_elastic2</a>
<li><a href="#SVK_elastic">SVK_elastic</a>
</ul>

<h4> Weird and miscellaneous </h4>
<ul>
<li><a href="#wulff_energy">wulff_energy</a>
<li><a href="#area_square">area_square</a>
<li><a href="#stress_integral">stress_integral</a>
<li><a href="#carter_energy">carter_energy</a>
<li><a href="#charge_gradient">charge_gradient</a>
<li><a href="#johndust">johndust</a>
<li><a href="#ackerman">ackerman</a>
</ul>
<hr><a   id="method-list"></a>
<h2>Method descriptions</h2>

The descriptions below of the individual methods give a 
mathematical definition of the method, what type of element
it applies to, definition parameters,
 which types of models it applies to, any 
restrictions on the dimension of ambient space, and whether
the method has a Hessian implemented.  Unless specifically noted,
a method has the gradient implemented, and hence may be used for
an energy or a constraint. The definition parameters are usually
scalar or vector integrands (see the 
<a href="datafile.htm#method_instance"> datafile declaration</a>
for full syntax). Some methods also depend on global
variables as noted.  The sample datafile declarations given
are for simple cases; 
<a href="datafile.htm#named-quantity-decl">full syntax</a> is given elsewhere.
Remember in the samples that for quantities not declared global,
the quantity has to be individually applied to the desired elements.
<hr>

<h2>0-dimensional </h2>

<a   id="vertex_scalar_integral"></a>
<hr><h3>vertex_scalar_integral</h3>
<a href="#quantity-top">Named method.</a>
Description: Function value at a vertex.  This actually produces a sum
over vertices, but as a mathematician, I think of a sum over vertices
as a point-weighted integral.
<br>Element: vertex. 
<br>Parameters: scalar_integrand. 
<br>Models: linear, quadratic, Lagrange, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity point_value energy method vertex_scalar_integral
   scalar_integrand: x^2 + y^2 - 2x + 3
</pre>

<hr>
<h2>1-dimensional</h2>

<a   id="edge_length"></a>
<hr><h3> <a   id="edge_tension"> </a>
   edge_tension or edge_length </h3>
<a href="#quantity-top">Named method.</a>
Description: Length of edge. 
Quadratic model uses Gaussian quadrature of order integral_order_1D.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity len energy method edge_length global
</pre>

<hr>  <a   id="density_edge_length"> </a><h3>density_edge_length </h3>
<a href="#quantity-top">Named method.</a>
Description: Length of edge, multiplied by the edge density.  
Quadratic model uses Gaussian quadrature of order integral_order_1D.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity len energy method density_edge_length global
</pre>

<hr> <a   id="edge_scalar_integral"></a><h3>edge_scalar_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of a scalar function over arclength.
Uses Gaussian quadrature of order integral_order_1D.
<br>Element: edge.
<br>Parameters: scalar_integrand. 
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity edge_sint energy method edge_scalar_integral
   scalar_integrand: x^2 - 3*y + 4
</pre>

<hr> <a   id="edge_vector_integral"></a><h3>edge_vector_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of a vectorfield over an oriented edge.
Uses Gaussian quadrature of order integral_order_1D.
<br>Element: edge.
<br>Parameters: vector_integrand.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Orientable: yes.
<br>Example datafile declaration:
<pre>
   quantity edge_vint energy method edge_vector_integral
   vector_integrand:
   q1: 0
   q2: 0
   q3: z^2/2
</pre>

<hr> <a   id="edge_general_integral"></a><h3>edge_general_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of a scalar function of 
  position and tangent over an edge.  The components of the tangent vector
are represented by continuing the coordinate indices.  That is, in 3D the
position coordinates are x1,x2,x3 and the tangent components are x4,x5,x6.
For proper behavior, the integrand should be homogeneous of degree 1
in the tangent components.  
Uses Gaussian quadrature of order integral_order_1D.
<br>Element: edge.
<br>Parameters: scalar_integrand.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration: 
the edge length in 3D could be calculated with this quantity:
<pre>
   quantity arclength energy method edge_general_integral
   scalar_integrand: sqrt(x4^2 + x5^2 + x6^2)
</pre>

<hr> <a   id="edge_area"></a><h3>edge_area </h3>
<a href="#quantity-top">Named method.</a>
Description:  For calculating the area of a body in the string model.  
Implemented as the exact integral of -y dx over the
 edge. Valid for torus model, but not general symmetry groups.
 You may have to set the quantity volconst attribute in the 
 torus model, since the area calculation is ambiguous up
 to one torus area.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: 2. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity cell1_area fixed = 1.3 method edge_area
</pre>

<hr> <a   id="edge_torus_area"></a><h3>edge_torus_area</h3>
<a href="#quantity-top">Named method.</a>
Description: For 2D torus string model body area calculations.
Contains adjustments for torus wraps.
 You may have to set the quantity volconst attribute in the 
 torus model, since the area calculation is ambiguous up
 to one torus area.
<br>Element: edge.
<br>Parameters: none.
<br>Models: torus; string; linear,quadratic,Lagrange.
<br>Ambient dimension: 2. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity cell_area fixed = 1.3 method edge_torus_area
</pre>

<hr> <a   id="string_gravity"></a><h3>string_gravity</h3>
<a href="#quantity-top">Named method.</a>
Description:  To calculate the gravitational potential energy
of a body in the string model.  Uses differences in body 
densities.  Does not use gravitational constant G as modulus
(unless invoked as internal quantity by convert_to_quantities).
<br>Element: edge.
<br>Parameters: none.
<br>Models: string linear, quadratic, lagrange.
<br>Ambient dimension: 2. 
<br>Hessian: yes.
<br>Orientable: yes.
<br>Example datafile declaration:
<pre>
   quantity cell_grav energy modulus 980*8.5 method string_gravity
</pre>

<a   id="hooke_length"></a><a   id="hooke_power"></a>
<hr> <a   id="hooke_energy"></a><h3>hooke_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
One would often like to require edges to have fixed length.
The total length of some set of edges may be constrained by
defining a fixed quantity.  This is used to fix the total
length of an evolving knot, for example.  But to have one
constraint for each edge would be impractical, since projecting
to n constraints requires inverting an n x n matrix.
Instead there is a Hooke's Law energy available to encourage
edges to have equal length. Its form per edge is
<pre>
   E =  | L - L_0| ^p 
</pre>
where L is the edge length,
L_0 is the equilibrium length, embodied as an adjustable
parameter `hooke_length', and  the power p is an adjustable
parameter `hooke_power'.  The default power is p = 2, and
the default equilibrium length is the average edge length
in the initial datafile.  You will want to adjust this,
especially if you have a total length constaint.
A high modulus will decrease the hooke component of the total
energy, since the restoring force is linear in displacement and the 
energy is quadratic (when p=2).  As an extra added bonus, 
a `hooke_power' of 0 will give
<pre>   E = -\log|L-L_0|.</pre>
See <a href="#hooke2_energy">hooke2_energy</a> for individual edge
equilibrium lengths.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.

<br>Example datafile declaration:
<pre>
   parameter hooke_length 0.3   // will apply to all edges
   parameter hooke_power  2     // the default
   quantity slinky energy method hooke_energy global
</pre>

<a   id="hooke2_power"></a>
<a   id="hooke_size"></a>
<hr> <a   id="hooke2_energy"></a><h3>hooke2_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: Same as <a href="#hooke_energy">hooke_energy</a>,
but each edge has an equilibrium length
<a href="elements.htm#extra-attributes">extra attribute</a> `hooke_size'
(which the user need not declare).
If the user does not set hooke_size by the time the method is 
first called, the value will default to the current length.
Hooke_size is not automatically adjusted by refining.
It is the responsibility of the
user to reset hooke_size after refining; you could re-define the 'r' command
<pre>
   r :::= { 'r'; set vertex hooke_size hooke_size/2 }
</pre>
to take care of it automatically.
The power of displacement used is given by the internal
read-write variable hooke2_power, which has default value 2.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   parameter hooke2_power  2     // the default
   define edge attribute hooke_size real
   quantity slinky energy method hooke2_energy global
   ...
   read
   r;r;set edge hooke_size length
</pre>

<a   id="frickenhaus_flag"></a>
<a   id="hooke3_power"></a>
<hr> <a   id="hooke3_energy"></a><h3>hooke3_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: Same as <a href="#hooke2_energy">hooke2_energy</a>,
but uses an elastic model instead of a spring. The energy is
<pre>energy = 0.5*(length-hooke_size)^2/hooke_size.</pre>
The exponent can be altered from 2 by setting the parameter hooke3_power.
If the internal variable frickenhaus_flag is nonzero, then the energy
is taken to be 0 if the length is less than the equilibrium length.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   parameter hooke3_power  2     // the default
   quantity slinky energy method hooke3_energy global
   ...
   read
   r;r;set edge hooke_size length
</pre>

<hr> <a   id="local_hooke_energy"></a><h3>local_hooke_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Energy of edges as springs with
 equilibrium length being average of lengths of neighbor edges.
 Actually, the energy is calculated per vertex,
 <pre> E = ({L_1 - L_2 \over L_1 + L_2})^2 
 </pre>
 where L_1 and L_2 are the lengths of the edges adjacent
 to the vertex. Meant for loops of string. (by John Sullivan)
If you set the variable local_hooke_flag} nonzero then
local_hooke_energy will not be evaluated at vertices
with valence not equal to 2.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity slinky energy method local_hooke_energy global
</pre>

<hr> <a   id="dihedral_hooke"></a><h3>dihedral_hooke </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Energy of an edge is edge length times square of angle between 
 normals of adjacent facets.  Actually, e = (1 - cos(angle))*length.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity bender energy method dihedral_hooke global
</pre>

<a   id="curvature_power"></a>
<hr> <a   id="sqcurve_string"></a><h3>sqcurve_string </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of squared curvature in
string model.  Assumes two edges per vertex, so it just uses the first 
two edges it finds at a vertex;
 see <a href="#sqcurve_string_marked">sqcurve_string_marked</a> for
more complicated topologies.  
Value zero at endpoint of curve. Value is calculated as if
the exterior angle at the vertex is evenly spread over the adjacent
half-edges.  More precisely, if s1 and s2 are the adjacent edge lengths
and t is the exterior angle, value = 4*(1 - cos(t))/(s1+s2). 
Other powers of the curvature can be specified by using the
parameter parameter_1 in the instance definition.  If parameter_1
is not present, then the internal read-write variable curvature_power is
used, which defaults to 2.
Also see <a href="#sqcurve2_string">sqcurve2_string</a> for a version
with intrinsic curvature, and <a href="#sqcurve3_string">sqcurve3_string</a>
for a version that uses a slightly different formula to encourage
equal length edges.
<br>Element: vertex.
<br>Parameters: parameter_1.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity sq energy method sqcurve_string global
   parameter_1 3
</pre>

<hr> <a   id="sqcurve2_string"></a><h3>sqcurve2_string </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of squared curvature in
string model, but with an intrinsic curvature.
The value zero at endpoint of curve. The value is calculated as if
the exterior angle at the vertex is evenly spread over the adjacent
half-edges.  More precisely, if s1 and s2 are the adjacent edge lengths,
h0 is the intrinsic curvature, 
and t is the exterior angle, then value = (sin(t)/((s1+s2)/2)-h0)<sup>2</sup>.
The intrinsic curvature h0 may be specified
either with a global variable h_zero or a real-valued vertex extra
attribute h_zero.  
<br>Element: vertex.
<br>Models: linear.
<br>Ambient dimension:  2
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   define vertex attribute intrinsic_curvature real
   quantity sq2 energy method sqcurve2_string global
</pre>


<hr> <a   id="sqcurve3_string"></a><h3>sqcurve3_string </h3>
<a href="#quantity-top">Named method.</a>
Description:  Same as <a href="#sqcurve_string">sqcurve_string</a>,
but uses a slightly different formula to encourage equal length edges
The value zero at endpoint of curve. The value is calculated as if
the exterior angle at the vertex is evenly spread over the adjacent
half-edges.  More precisely, if s1 and s2 are the adjacent edge lengths,
h0 is the intrinsic curvature, 
and t is the exterior angle, value = 2*(1 - cos(t))*(1/s1+1/s2). 
<br>Element: vertex.
<br>Models: linear.
<br>Ambient dimension:  any
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity sq3 energy method sqcurve3_string global
</pre>


<a   id="sqcurve_string_mark"></a>
<hr> <a   id="sqcurve_string_marked"></a><h3>sqcurve_string_marked </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of squared curvature in
string model.  Same as <a href="#sqcurve_string">sqcurve_string</a>, but
 only "marked" edges are used, so the topology of edges
can be more complicated than a loop or curve.
The marking is done by declaring an integer-valued edge attribute
named <code>sqcurve_string_mark</code> and setting it to some nonzero
value for those edges you want to be involved, usually two at each
vertex to which this method is applied.
  Value zero at vertex with only one marked edge. Value is calculated as if
the exterior angle at the vertex is evenly spread over the adjacent
half-edges.  More precisely, if s1 and s2 are the adjacent edge lengths
and t is the exterior angle, value = 4*(1 - cos(t))/(s1+s2). 
Other powers of the curvature can be specified by using the
parameter parameter_1 in the instance definition. 
<br>Element: vertex.
<br>Parameters: parameter_1.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   define edge attribute sqcurve_string_mark integer
   quantity sqmark energy method sqcurve_string_marked
</pre>


<hr> <a   id="sq_gaussian_curv_cyl"></a><h3>sq_gaussian_curv_cyl </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of the squared gaussian curvature of a 
surface of revolution.  The generating curve is set up in 
the <a href="model.htm">string model</a>, and this method
applied to its vertices.  The axis of rotation is the x-axis.
<br>Element: vertex.
<br>Models: linear string.
<br>Ambient dimension:  2
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity sqgausscyl energy method sq_gaussian_curv_cyl global
</pre>

<hr> <a   id="sq_mean_curv_cyl"></a><h3>sq_mean_curv_cyl </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of the squared mean curvature of a 
surface of revolution.  The generating curve is set up in 
the <a href="model.htm">string model</a>, and this method
applied to its vertices.  The axis of rotation is the x-axis.
This method will do intrinsic curvature by means either
of a global variable <code>h_zero</code> or a real-valued
vertex attribute <code>h_zero</code>.
<br>Element: vertex.
<br>Models: linear string.
<br>Ambient dimension:  2
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   define vertex attribute h_zero real
   quantity sqcyl energy method sq_mean_curv_cyl global
</pre>


<hr> <a   id="sq_torsion"></a><a   id="sq_torsion_mark"></a><h3>sq_torsion </h3>
<a href="#quantity-top">Named method.</a>
Integral of squared torsion for curves.
The torsion is approximated by looking at triples of adjacent
edges; if A,B,C are the edge vectors, then the sin of the angle the
osculating plane twists by (from AxB to BxC) is
<pre>
       [A,B,C] |B|
  S =  -----------
       |AxB| |BxC|
</pre>
(This is analogous to t = [T,T',T'']/k^2 for tangent vector T and curvature k. 
 I'm using [A,B,C] as notation for triple product.)  Then the torsion is
<pre>
   t = arcsin(S)/|B|
</pre>
and the integral of the square of the torsion is
<pre>
   t^2 |B| = arcsin(S)^2/|B|
</pre>
This function assumes the edges in each component are consistently oriented.
Since this method is meant to be used on boundary wires of surfaces, it
uses a "sq_torsion_mark" attribute on edges to tell which edges are to be
included.  Example top of datafile declaration:
<pre>
  define edge attribute sq_torsion_mark integer
  quantity sqtor energy method sq_torsion
</pre>
Then mark the edges you want included, for example using quad.fe
<pre>
edges
1   1  2 constraints 1,2 sq_torsion_mark 1 quantity sqtor
2   2  3 constraints 1,2 sq_torsion_mark 1 quantity sqtor
3   3  4 constraints 1,2 sq_torsion_mark 1 quantity sqtor
4   4  1 constraints 1,2 sq_torsion_mark 1 quantity sqtor
</pre>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3.
<br>Hessian: no.


<hr> <a   id="metric_edge_length"></a><h3>metric_edge_length</h3>
<a href="#quantity-top">Named method.</a>
Description: In the string model with a 
<a href="model.htm#metric">Riemannian metric</a>, this is the
length of an edge.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear,quadratic,simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   string
   space_dimension 2
   metric
   1+x^2 y
   y   1+y^2
   quantity mel energy method metric_edge_length global
</pre>

<hr> <a   id="klein_length"></a><h3>klein_length</h3>
<a href="#quantity-top">Named method.</a>
Description:  Edge length in Klein hyperbolic plane model. Does not
depend on <a href="datafile.htm#klein_metric">klein_metric</a>
being declared.  Vertices should be inside unit sphere.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 2. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kleinlen energy method klein_length global
</pre>

<hr> <a   id="circular_arc_length"></a><h3>circular_arc_length</h3>
<a href="#quantity-top">Named method.</a>
Description:  Edge length, modelling the edge as a circular
arc through three points, hence useful only in the 
<a href="model.htm#quadratic-model">quadratic model</a>. 
If not in the quadratic model, it evaluates as the 
<a href="quants.htm#edge_length">edge_length</a> method.
The presence of this quantity has the side effect of automatically
toggling <a href="toggle.htm#circular_arc_draw">circular_arc_draw</a>, 
causing edges to display as circular arcs in the quadratic model.
<br>Element: edge.
<br>Parameters: none.
<br>Models: quadratic; string.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity arclen energy method circular_arc_length global
</pre>
More commonly used with the <a href="datafile.htm#area_method_name">
area_method_name</a> declaration in the top of the datafile.

<hr> <a   id="circular_arc_area"></a><h3>circular_arc_area</h3>
<a href="#quantity-top">Named method.</a>
Description: Area between an edge and the y axis, with the edge modelled
as a circular arc through three points.  Useful in the 
<a href="model.htm#quadratic-model">quadratic model</a>;
in other models it is the same as
<a href="quants.htm#facet_area">edge_area</a>.
<br>Element: edge.
<br>Parameters: none.
<br>Models: quadratic.
<br>Ambient dimension: 2. 
<br>Orientable: yes.
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity arcarea energy method circular_arc_area global
</pre>
More commonly used with the <a href="datafile.htm#area_method_name">
area_method_name</a> declaration in the top of the datafile.

<hr> <a   id="spherical_arc_length"></a><h3>spherical_arc_length</h3>
<a href="#quantity-top">Named method.</a>
Description:  Edge length, modelling the edge as a spherical
great circle arc between its two endpoints,  which are assumed to 
lie on an arbitrary radius sphere centered at the origin.
This method is meant for modelling string networks on spheres, and
is suitable for use with the <a href="datafile.htm#length_method_name">
length_method_name</a> feature for substituting the default edge length
calculation method.  Note that this method is an exact spherical calculation
in the linear model,
so there is no need to refine edges or use higher order models for accuracy.
Edges are graphed as spherical arcs (actually, lots of segments).
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   parameter rad = 2
   constraint 1
   formula: x^2 + y^2 + z^2 = rad^2
   length_method_name "spherical_arc_length"
</pre>

<hr> <a   id="spherical_arc_area_n"> </a>
 <a   id="spherical_arc_area_s"> </a>
<h3>spherical_arc_area_n, spherical_arc_area_s</h3>
<a href="#quantity-top">Named method.</a>
Description: Area on a sphere between an edge (considered as a great circle 
arc) and the north (or south) pole.    This is an exact calculation in
the linear model.  Meant for calculating the areas of facets in the 
string model with the string network confined to a sphere of arbitrary
radius centered at the origin.  There are two versions of this method,
since calculation of facet areas by means of edges necessarily has
a singularity somewhere on the sphere. Spherical_arc_area_n has its 
singularity at the south pole, and spherical_arc_area_s has its
singularity at the north pole.  Thus spherical_arc_area_s will work 
accurately for facets not including the north pole in there interiors;
a facet including the north pole will have its area calculated as the
negative complement of its true area, so a body defined using it could
get the correct area by using a volconst of a whole sphere area.  If
the singular pole falls on an edge or vertex, then results are
unpredictable.   With these caveats, these methods are suitable for
use with the <a href="datafile.htm#area_method_name">
area_method_name</a> feature for substituting the default edge area
method.  If you do a facet as an explicit quantity, you are responsible
for applying or unapplying the quantity after topology changes!!
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Orientable: yes.
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   parameter rad = 2
   constraint 1
   formula: x^2 + y^2 + z^2 = rad^2
   area_method_name "spherical_arc_area_s"
</pre>




<hr>
<h2>2-dimensional</h2>

<hr> <a   id="facet_tension"> </a>
<a   id="facet_area"> </a> <h3>facet_tension, facet_area </h3>
<a href="#quantity-top">Named method.</a>
Description:  Area of facet. Does not multiply by facet density;
<a href="#density_facet_area">density_facet_area</a> does that.
Quadratic model uses Gaussian cubature of order integral_order_2D.
Beware that this is an approximation to the area, and if the facets
in the quadratic or Lagrange model
get too distorted, it can be a bad approximation.  Furthermore,
facets can distort themselves in seeking the lowest numerical area.
By default, changing the model to 
quadratic or Lagrange will set an appropriate integral_order_2D.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange; soapfilm, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity farea energy method facet_area global
</pre>

<hr> <a   id="density_facet_area"></a><h3>density_facet_area </h3>
<a href="#quantity-top">Named method.</a>
Description:  Area of facet, multiplied by its density. 
Otherwise same as <a href="#facet_area">facet_area</a>.
<br>Element: 
<br>Parameters:
<br>Models: linear, quadratic, Lagrange, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity farea energy method density_facet_area global
</pre>

<hr> <a   id="facet_volume"></a><h3>facet_volume </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of z dx dy over an oriented facet. Valid
in the torus domain. Not valid for other symmetry groups.
 You may have to set the quantity volconst attribute in the 
 torus model, since the volume calculation is ambiguous up
 to one torus volume.
<br>Element: facet. 
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Orientable: yes.
<br>Example datafile declaration:
<pre>
   quantity vol fixed = 1.3 method facet_volume
</pre>

<hr> <a   id="facet_scalar_integral"></a><h3>facet_scalar_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of a scalar function over facet area. 
Uses Gaussian cubature of order integral_order_2D.
<br>Element: facet.
<br>Parameters: scalar_integrand.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity fint energy method facet_scalar_integral global
   scalar_integrand: x^2+y^2
</pre>

<hr> <a   id="facet_vector_integral"></a><h3>facet_vector_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Integral of a vectorfield inner product with the surface normal over a facet.
 The normal is the right-hand rule normal of the facet as defined in the
 datafile.
Uses Gaussian cubature of order integral_order_2D.
<br>Element: facet.
<br>Parameters: vector_integrand. 
<br>Models: linear, quadratic, Lagrange, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Orientable: yes.
Example datafile declaration, for volume equivalent:
<pre>
   quantity fvint energy method facet_vector_integrand
   vector_integrand:
   q1: 0
   q2: 0
   q3: z
</pre>

<hr> <a   id="facet_2form_integral"></a><h3>facet_2form_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Integral of a 2-form over 
a facet.  Meant for ambient dimensions higher than 3.
Uses Gaussian cubature of order integral_order_2D.
<br>Element: facet. <br>Parameters: form_integrand (components in lexicographic order). 
<br>Models: linear,  Lagrange, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Orientable: yes.
Example datafile declaration in 4D:
<pre>
   quantity formex energy method facet_2form_integral
   form_integrand:
   q1: x2     // 12 component
   q2: 0      // 13 component
   q3: x4     // 14 component
   q4: 0      // 23 component
   q5: 0      // 24 component
   q6: x3*x2  // 34 component
</pre>


<hr> <a   id="facet_2form_sq_integral"></a><h3>facet_2form_sq_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Integral of the square of a 2-form over 
a facet.  Meant for ambient dimensions higher than 3.
Uses Gaussian cubature of order integral_order_2D.
<br>Element: facet. <br>Parameters: form_integrand (components in lexicographic order). 
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Orientable: no.
Example datafile declaration in 4D:
<pre>
   space_dimension 4
   // symplectic area
   // Correspondence: z1 = (x1,x2)  z2 = (x3,x4)
   #define DENOM ((x1^2+x2^2+x3^2+x4^2)^2)
   quantity symplectic_sq energy method facet_2form_sq_integral global
   form_integrand:
   q1: -2*(x3^2 + x4^2)/DENOM    // dx1 wedge dx2 term
   q2:  2*(x2*x3-x1*x4)/DENOM    // dx1 wedge dx3 term
   q3:  2*(x1*x3+x2*x4)/DENOM    // dx1 wedge dx4 term
   q4: -2*(x1*x3+x2*x4)/DENOM    // dx2 wedge dx3 term
   q5:  2*(x2*x3-x1*x4)/DENOM    // dx2 wedge dx4 term
   q6: -2*(x1^2 + x2^2)/DENOM    // dx3 wedge dx4 term

</pre>

<hr> <a   id="facet_general_integral"></a><h3>facet_general_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of a scalar function 
of position and normal vector over a facet. 
Uses Gaussian cubature of order integral_order_2D.  The components of the normal vector
are represented by continuing the coordinate indices.  That is, in 3D the
position coordinates are x1,x2,x3 and the normal components are x4,x5,x6.
For proper behavior, the integrand should be homogeneous of degree 1
in the normal components.
<br>Element: facet.
<br>Parameters: scalar_integrand.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
Example: The facet area could be calculated with this quantity:
<pre>
   quantity surfacearea energy method facet_general_integral
   scalar_integrand: sqrt(x4^2 + x5^2 + x6^2)
</pre>

<hr> <a   id="facet_general_hi_d_integral"></a><h3>facet_general_hi_d_integral </h3>
<a href="#quantity-top">Named method.</a>
Named method. Description: Integral of a scalar function of position and
normal vector over a 2D facet in any ambient dimension space.
Uses Gaussian cubature of order integral_order_2D.  The 2D facet is represented
by a 2-vector.  The components of the 2-vector are named as xn, where the number
n ranges from  N+1 to N+N*(N+1)/2, continuing the coordinate indices. That is,
in 4D the position coordinates are x1,x2,x3,x4 and the 2-vector components are
x5 = x1 &and; x2, x6 = x1 &and; x3, x7 = x1 &and; x4, x8 = x2 &and; x3,
x9 = x2 &and; x4, and x10 = x3 &and; x4. For proper behavior,
the integrand should be homogeneous of degree 1 in the 2-form components.
<br>Element: facet.
<br>Parameters: scalar_integrand.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: any. 
<br>Hessian: yes.
Example: The facet area could be calculated with this quantity:
<pre>
   space_dimension 4
   quantity surfacearea energy method facet_general_hi_d_integral
   scalar_integrand: sqrt(x5^2 + x6^2 + x7^2 + x8^2 + x9^2 + x10^2) )
</pre>

<hr> <a   id="facet_torus_volume"></a><h3>facet_torus_volume</h3>
<a href="#quantity-top">Named method.</a>
Description:  For 3D soapfilm model, calculates body volume integral
for a facet, with corrections for edge wraps.
 You may have to set the quantity volconst attribute in the 
 torus model, since the volume calculation is ambiguous up
 to one torus volume.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear,quadratic,lagrange.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Orientable: yes.
<br>Example datafile declaration:
<pre>
   quantity body_vol energy method facet_torus_volume
</pre>

<hr>
<a   id="full_gravity_method"></a>
<a   id="gravity_method"></a><h3>gravity_method, full_gravity_method </h3>
<a href="#quantity-top">Named method.</a>
Description:  Gravitational energy, integral of
  p z^2/2 dxdy over a facet, where p is difference in adjacent body densities.
Note: this method uses the gravitational constant as the modulus
if invoked as full_gravity_method.
Just gravity_method does not automatically use the
gravitational constant.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear, quadratic, Lagrange.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Orientable: yes.
<br>Example datafile declaration:
<pre>
   quantity grav energy modulus 980*8.5 method gravity_method 
</pre>

<hr> 
<a   id="density_facet_area_u"></a>
<a   id="facet_area_u"></a><h3>facet_area_u, density_facet_area_u </h3>
<a href="#quantity-top">Named method.</a>
Description:  Area of facet. In quadratic model, it is
an upper bound of area, by the Schwarz Inequality.  For the paranoid.  
Same as facet_area in linear model.
Sets integral_order_2D to 6, since it doesn't work well with less. 
Using the density_facet_area_u name automatically
incorporates the facet tension, but facet_area_u doesn't.
<br>Element: facet.  
<br>Parameters: none.
<br>Models: linear, quadratic.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity area_u energy method facet_area_u global
</pre>

<hr> <a   id="gap_energy"></a><h3>gap_energy</h3>
<a href="#quantity-top">Named method.</a>
Description:  Implementation of <a href="energies.htm#gap-energy">gap energy</a>, which is designed to keep edges from short-cutting curved
constraint surfaces.  This method serves the same purpose as 
declaring a constraint <a href="constrnt.htm#convex-constraint">convex</a>.
Automatically incorporates the
<a href="datafile.htm#gap_constant">gap_constant</a> set in the datafile
or by the <a href="single.htm#k">k</a> command.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity gappy energy method gap_energy global
</pre>
As an alternative to gap_energy, you should consider a system of "guide
lines", i.e. a plane level set constraint whose coefficients are
extra attributes of vertices.  This can keep the contact line vertices
evenly spaced without adding extra energy, and permitting Hessian
operations.

<hr> <a   id="metric_facet_area"></a><h3>metric_facet_area</h3>
<a href="#quantity-top">Named method.</a>
Description: For a 
<a href="model.htm#metric">Riemannian metric</a>, this is the
area of a facet.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear,quadratic,simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   metric
   1+x^2 0 z
   0 1+y^2 0
   z 0 1+z^2
   quantity mfa energy method metric_facet_area global
</pre>

<hr> <a   id="klein_area"></a><h3>klein_area</h3>
<a href="#quantity-top">Named method.</a>
Description:  Facet area in Klein hyperbolic 3D space model.
Does not
depend on <a href="datafile.htm#klein_metric">klein_metric</a>
being declared in the datafile.
Vertices should be inside the unit sphere.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kleinarea energy method klein_area global
</pre>

<hr> <a   id="circle_willmore"></a><h3>circle_willmore</h3>
<a href="#quantity-top">Named method.</a>
Description: 
 Alexander Bobenko's circle-based discrete Willmore energy,
 which is conformally invariant.
 At each vertex, energy is (sum of the angles between facet
 circumcircles) - 2*pi.  More simply done as edge quantity, since
 angles at each end are the same.
 For edge e, if adjacent facet edge loops are a,e,d and b,c,-e, then
 circle angle beta for edge has
<pre>
   cos(beta) = (&lt;a,c&gt;&lt;b,c&gt;-&lt;a,b&gt;&lt;c,d&gt;-&lt;b,c&gt;&lt;d,a&gt;)/|a|/|b|/|c|/|d|
</pre>
 For now, assumes all vertices are faceted, and fully starred.
  Severe numerical difficulties: Not smooth when angle beta is zero,
 which is all too common.  Set of zero angles should be codimension 2,
 which means generally avoided, but still crops up.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity bobenko energy method circle_willmore global
</pre>



<hr> <a   id="dirichlet_area"></a><h3>dirichlet_area</h3>
<a href="#quantity-top">Named method.</a>
Description: Same as the <a href="#facet_tension">facet_tension</a>
method, but the Hessian is modified to be guaranteed positive definite,
after the scheme of Polthier and Pinkall
<a href="biblio.htm#refPP">[PP]</a>.  The energy is taken to be the
Dirichlet integral of the perturbation from the current surface, which
is exactly quadratic and positive definite.  Hence the hessian command
always works, but final convergence may be slow (no faster than regular
iteration) since it is only an approximate Hessian.  Also see
the <a href="commands.htm#dirichlet">dirichlet</a> command.

<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity dirarea energy method dirichlet_area global
</pre>

<hr> <a   id="sobolev_area"></a><h3>sobolev_area</h3>
<a href="#quantity-top">Named method.</a>
Description: Same as the <a href="#facet_tension">facet_tension</a>
method, but the Hessian is modified to be guaranteed positive definite,
after the scheme of Renka and Neuberger.
<a href="biblio.htm#refRN">[RN]</a>.  Hence the hessian command
always works, but final convergence may be slow (no faster than regular
iteration) since it is only an approximate Hessian.  Also see
the <a href="commands.htm#sobolev">sobolev</a> command.

<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity sobarea energy method sobolev_area global
</pre>


<a   id="fgagfa_coeff"></a>
<a   id="gfa_2_coeff"></a>
<a   id="gfaafg_coeff"></a>
<a   id="gfagfa_coeff"></a>
<a   id="gga_coeff"></a>
<hr> <a   id="pos_area_hess"></a><h3>pos_area_hess</h3>
<a href="#quantity-top">Named method.</a>
Description:  Same as the <a href="quants.htm#facet_area">facet_area</a>
method, but the Hessian can be adjusted various ways by setting
the variables fgagfa_coeff, gfa_2_coeff, gfagfa_coeff, and gfaafg_coeff.
This will make sense if you look at the Dirichlet section of the
Technical Reference chapter of the printed manual.  The default
values of the coefficients are -1, 1, -1, and 0 respectively.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity parea energy method pos_area_hess global
</pre>

<hr> <a   id="spherical_area"></a><h3>spherical_area</h3>
<a href="#quantity-top">Named method.</a>
Description: Area of the facet projected to unit sphere.  The vertices of
the facet are assumed to be on the unit sphere.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   constraint 1  formula: x^2 + y^2 + z^2 = 1
   quantity spharea energy method spherical_area global
</pre>

<a   id="stokes_type"></a>
<a   id="stokes_velocity"></a>
<hr> <a   id="stokes2d"></a><h3>stokes2d</h3>
<a href="#quantity-top">Named method.</a>
Description: Square of the Laplacian of z viewed as a function of (x,y).
Meant for the calculation of two-dimensional Stokes flow of a fluid (i.e.
slow steady-state flow where inertia is not significant) by having the
Evolver surface be the graph of the velocity potential and minimizing
the viscous dissipation, which is the square of the Laplacian of z.
Boundary conditions are handled by declaring a vertex attribute "stokes_type"
of type integer, and assigning each boundary vertex one of these values:
<ul>
<li> 0 - vertex is not on a wall; treat as if on a mirror symmetry plane.
<li> 1 - vertex is on a slip wall.
<li> 2 = vertex is on a nonslip wall; normal derivative of potential is zero.
</ul>
Boundary values of z should be set to constants between 0 and 1 on
various sections of boundary that represent walls.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity dissip energy method stokes2d global
</pre>

Note: Evolver creates a vertex attribute stokes_velocity for internal use.

<hr> <a   id="stokes2d_laplacian"></a><h3>stokes2d_laplacian</h3>
<a href="#quantity-top">Named method.</a>
Description: The Laplacian of z viewed as a function of (x,y).  This is
auxiliary to the <a href="#stokes2d">stokes2d</a> method.  It is the
same Laplacian, unsquared, with the same boundary rules.  Meant for
calculating pressures and such after stokes2d energy has been minimized.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity laplac info_only method stokes2d_laplacian global
</pre>



<hr>
<H2>Surface curvature functions</h2>
<a   id="mean_curvature_integral_a"></a>
<hr> <a   id="mean_curvature_integral"></a><h3>mean_curvature_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of signed scalar mean curvature of a 2D surface.  
 The computation is exact, in the sense that
for a polyhedral surface the mean curvature is concentrated
on edges and singular there, but the total mean curvature for
an edge is the edge length times its dihedral angle.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity mci energy method mean_curvature_integral
</pre>
The method <code>mean_curvature_integral_a</code> does the same thing,
but uses a numerical formulation which may be better behaved.
<p>
There is an obsolete use of mean_curvature_integral in the top of the
datafile to indicate the integral of the mean curvature should be
included as an energy, with syntax
<pre>
  mean_curvature_integral: modulus
</pre>
where modulus is the multiplier for the energy.  The modulus winds up
as the internal read-write variable mean_curvature_modulus.
<hr>
<a   id="ignore_constraints"></a>
<a   id="ignore_fixed"></a>
 <a   id="sq_mean_curvature"></a><h3>sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>

Description:  Integral of squared mean curvature of a surface.
There are several methods implemented for calculating the integral
of the squared mean curvature of a surface.  The older methods
<a href="#sq_mean_curvature">sq_mean_curvature</a>,
<a href="#eff_area_sq_mean_curvature">eff_area_sq_mean_curvature</a>, and
<a href="#normal_sq_mean_curvature">normal_sq_mean_curvature</a>, are now
deprecated, since they don't have Hessians and the newer methods
<a href="#star_sq_mean_curvature">star_sq_mean_curvature</a>,
<a href="#star_eff_area_sq_mean_curvature">star_eff_area_sq_mean_curvature</a>, 
<a href="#star_normal_sq_mean_curvature">star_normal_sq_mean_curvature</a>, and 
my current favorite
 <a href="#star_perp_sq_mean_curvature">star_perp_sq_mean_curvature</a>, do
have Hessians and can now handle incomplete facet stars around vertices. 
But read the following for general remarks on squared curvature also.
<p>
The integral of squared mean curvature in the soapfilm model
 is calculated for this method as follows:
Each vertex v has a star of facets around it of area A.
The force F due to surface tension on the vertex is the gradient of area,
Since each facet has 3 vertices, the area associated with v is
A/3. Hence the average mean curvature at v is
<blockquote><code>   h = (1/2)(F/(A/3)), </code></blockquote>
where the 1/2 factor comes from the "mean" part of "mean curvature".
This vertex's contribution to the total integral is then
<blockquote><code>  E = h<sup>2</sup>A/3 = (3/4)F<sup>2</sup>/A.</code> </blockquote>
Philosophical note:  The squared mean curvature on a triangulated
surface is technically infinite, so some kind of approximation scheme
is needed.  The alternative to locating curvature at vertices is to
locate it on the edges, where it really is, and average it over the
neighboring facets.  But this has the problem that a least area
triangulated surface would have nonzero squared curvature, whereas
in the vertex formulation it would have zero squared curvature.
<p>
Practical note: The above definition of squared mean curvature
seems in practice to be subject to instablities. One is that
sharp corners grow sharper rather than smoothing out.  Another is
that some facets want to get very large at the expense of their
neighbors. Hence a couple of alternate definitions have been added.<br>

Curvature at boundary: If the edge of the surface is a free boundary
on a constraint, then the above calculation gives the proper curvature
under the assumption the surface is continued by reflection across
the constraint.  This permits symmetric surfaces to be represented
by one fundamental region.  If the edge of the surface is a fixed edge
or on a 1-dimensional boundary, then there is no way to calculate the
curvature on a boundary vertex from knowledge of neighboring facets.
For example, the rings of facets around the bases  of  a catenoid and
a spherical cap may be identical.  Therefore curvature is calculated
only at interior vertices, and when the surface integral is done,
area along the boundary is assigned to the nearest interior vertex.
However, including IGNORE_FIXED or IGNORE_CONSTRAINTS in the method declaration
will force the calculation of energy even at fixed points or 
ignoring constraints respectively.<br> 

If the parameter or vertex attribute <code>h_zero</code> is defined, 
then the value per vertex
is the same as for the following method, 
<a href="#eff_area_sq_mean_curvature">eff_area_sq_mean_curvature</a>.
<br>

<br>Element: vertex.  
<br>Parameters: IGNORE_CONSTRAINTS, IGNORE_FIXED.  
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity sqc energy method sq_mean_curvature global
</pre>


<hr> <a   id="eff_area_sq_mean_curvature"></a><h3>eff_area_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of squared mean curvature of a surface, with
a slightly different definition from <a href="#sq_mean_curvature">
sq_mean_curvature</a> or <a href="#normal_sq_mean_curvature">
normal_sq_mean_curvature</a>.
The area around a vertex is taken to
be the magnitude of the gradient of the volume.  This is less than the 
true area, so makes a larger curvature.  This also eliminates the
spike instability, since a spike has more area gradient but the
same volume gradient.  Letting N be the volume gradient at vertex v,
<blockquote><code>   h = (1/2)(F/N)), </code></blockquote>
and
<blockquote><code>  E = h<sup>2</sup> A/3 =  (3/4)(F&middot;F/N&middot;N)A. </code>
</blockquote>
The facets of the surface must be consistently oriented for this 
to work, since the evolver needs an `inside' and `outside' of the
surface to calculate the volume gradient.   There are still possible
instabilities where some facets grow at the expense of others.
<br>
If the parameter or vertex attribute
 <code>h_zero</code> is defined, then the value per vertex
is
<blockquote><code>  E = (h-h<sub>0</sub>)<sup>2</sup> A/3 = (3/4)(F&middot;N/N&middot;N-2h<sub>0</sub>)<sup>2</sup>A. </code></blockquote> 
  This does not reduce to the non-<code>h_zero</code> formula when <code>h_zero</code>
  has the value zero, but is actually a pretty good formula in its own
  right (see <a href="#star_perp_sq_mean_curvature">star_perp_sq_mean_curvature
</a>.
<br>
If the vertex is on one or several constraints, the F and N are
projected to the constraints, essentially making the constraints act as
mirror symmetry planes.  If a constraint should not be considered as
a mirror plane, it should be given the attribute <code>nonwall</code> in
its declaration in the datafile.
<br>
WARNING: For some extreme shapes, 
Evolver may have problems detecting consistent local surface orientation.
The assume_oriented toggle lets Evolver assume that the facets
have been defined with consistent local orientation.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity effsq energy method eff_area_sq_mean_curvature global
</pre>

<hr> <a   id="normal_sq_mean_curvature"></a><h3>normal_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of squared mean curvature of a surface, with
a slightly different definition from <a href="#sq_mean_curvature">
sq_mean_curvature</a> or <a href="#eff_area_sq_mean_curvature">
eff_area_sq_mean_curvature</a>.
 To alleviate the instability of eff_area_sq_mean_curvature,
normal_sq_mean_curvature considers the area around the
vertex to be the component of the volume gradient parallel to the
mean curvature vector, rather than the magnitude of the volume gradient.
Thus
<blockquote><code>  h = (1/2)(F&middot;F/N&middot;F) <br>

  E = h<sup>2</sup>A/3 = (3/4)(F&middot;F/N&middot;F)<sup>2</sup> A. </code></blockquote>
This is still not perfect, but is a lot better.
WARNING: For some extreme shapes, 
Evolver may have problems detecting consistent local surface orientation.
The assume_oriented toggle lets Evolver assume that the facets
have been defined with consistent local orientation.
<br>
If the parameter or vertex attribute <code>h_zero</code> is defined, 
then the value per vertex is
<blockquote><code>  E = (h-h<sub>0</sub>)<sup>2</sup> A/3 = (3/4)(F&middot;F/N&middot;F - 2h<sub>0</sub>)<sup>2</sup>A </code></blockquote>

  If the vertex is on one or several constraints, the F and N are
  projected to the constraints, essentially making the constraints act as
  mirror symmetry planes.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity nsq energy method normal_sq_mean_curvature global
</pre>

<hr> 
<a   id="sq_mean_mix"></a><a   id="mix_sq_mean_curvature"></a><h3>mix_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of squared mean curvature of a surface, with
combination of approximate formulas for the mean curvature.
<blockquote><code> h = ((F&middot;F/N&middot;F)*sq_mean_mix + (F&middot;N/N&middot;N))/2  <br>

  E = h<sup>2</sup>A/3. </code></blockquote>
where F is the force or area gradient at a vertex, N is the unit normal vector as 
determined by the volume gradient, and A is the area of the facets adjacent to the vertex.
{\cf sq\_mean\_mix} is a user-defined variable that controls the combination; its 
default version is 0.
WARNING: For some extreme shapes, 
Evolver may have problems detecting consistent local surface orientation.
The assume_oriented toggle lets Evolver assume that the facets
have been defined with consistent local orientation.
<br>
If the parameter or vertex attribute <code>h_zero</code> is defined, 
then the value per vertex is
<blockquote><code>  E = (h-h<sub>0</sub>)<sup>2</sup> A/3  </code></blockquote>

  If the vertex is on one or several constraints, the F and N are
  projected to the constraints, essentially making the constraints act as
  mirror symmetry planes.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
  parameter sq_mean_mix = 0.5
  quantity mixsq energy method mix_sq_mean_curvature global
</pre>

<hr> <a   id="star_sq_mean_curvature"></a><h3>star_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of squared mean curvature over a surface.
This is a different implementation of <a href="#sq_mean_curvature">
sq_mean_curvature</a>, and it has a Hessian.  
This method no longer requires a complete circle of vertices around a vertex;
boundary edges are treated as if they are on mirror symmetry planes, which
is usually true.
  The positive orientation of the surface is 
  determined by the positive orientation of the first facet of the vertex's
  internal facet list. 
This method does not do prescribed mean curvature with
the <code>h_zero</code> parameter.
<p>
The curvature calculation works in any dimension space. If for some reason
the space has an ambient dimension greater than 3, and you want to restrict
the calculation of curvature to the first three coordinates, the toggle
<a href="toggle.htm#calculate_in_3d">calculate_in_3d</a> will do that.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity starsq energy method star_sq_mean_curvature global
</pre>

<hr> <a   id="star_eff_area_sq_mean_curvature"></a><h3>star_eff_area_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of squared mean curvature over a surface.
This is a different implementation of <a href="#eff_area_sq_mean_curvature">
eff_area_sq_mean_curvature</a>, and it has a Hessian. 
This method no longer requires a complete circle of vertices around a vertex;
boundary edges are treated as if they are on mirror symmetry planes, which
is usually true.
  The positive orientation of the surface is 
  determined by the positive orientation of the first facet of the vertex's
  internal facet list. 
This method does not use the <code>h_zero</code> parameter.
<p>
The curvature calculation works in any dimension space. If for some reason
the space has an ambient dimension greater than 3, and you want to restrict
the calculation of curvature to the first three coordinates, the toggle
<a href="toggle.htm#calculate_in_3d">calculate_in_3d</a> will do that.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity seffsq energy method star_eff_area_sq_mean_curvature global
</pre>

<hr> <a   id="star_normal_sq_mean_curvature"></a><h3>star_normal_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of squared mean curvature over a surface.
This is a different implementation of <a href="#normal_sq_mean_curvature">
normal_sq_mean_curvature</a> which is more suitable for parallel
calculation and has a Hessian. 
This method no longer requires a complete circle of vertices around a vertex;
boundary edges are treated as if they are on mirror symmetry planes, which
is usually true.
  The positive orientation of the surface is 
  determined by the positive orientation of the first facet of the vertex's
  internal facet list. 
This method can use the <code>h_zero</code> parameter or vertex attribute
for prescribed mean curvature.
<p>
The curvature calculation works in any dimension space. If for some reason
the space has an ambient dimension greater than 3, and you want to restrict
the calculation of curvature to the first three coordinates, the toggle
<a href="toggle.htm#calculate_in_3d">calculate_in_3d</a> will do that.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity stnsq energy method star_normal_sq_mean_curvature global
</pre>

WARNING: The division by F.N can cause problems sometimes.  Usually
F and N are close to parallel, but I have seen cases where they get close
to parallel and things go awry.  I recommend using star_perp_sq_mean_curvature
instead.


<hr> <a   id="star_perp_sq_mean_curvature"></a><h3>star_perp_sq_mean_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of squared mean curvature over a surface.
This is my current favorite implementation of squared mean curvature.
It is an implementation specifically
designed to agree with the mean curvature computed as the gradient of
area when normal motion is on (either the <a href="toggle.htm#normal_motion">
normal_motion</a> toggle for 'g' iteration, or Hessian with 
<a href="toggle.htm#hessian_normal">hessian_normal</a>).  Thus if you
get zero squared mean curvature with this method, then switch to area energy,
the hessian will report exact convergence.  Likewise if you do prescribed 
curvature and  then convert to area minimization with a volume constraint.
This method has a Hessian. 
This method does not require a complete circle of vertices around a vertex;
boundary edges are treated as if they are on mirror symmetry planes, which
is usually true.  
This method can use the <code>h_zero</code> parameter or vertex attribute
 for prescribed mean
curvature.  The actual formula for the energy at a vertex is
<blockquote><code>  h = (1/2)(F&middot;N/N&middot;N) <br>
  E = (h-h<sub>0</sub>)<sup>2</sup> A/3 = (3/4)(F&middot;N/N&middot;N - 2h<sub>0</sub>)<sup>2</sup>A </code></blockquote>
where F is the area gradient at the vertex, N is the volume gradient,
and A is the area of the adjacent facets.
  If the vertex is on one or several constraints, the F and N are
  projected to the constraints, essentially making the constraints act as
  mirror symmetry planes.  
  The positive orientation of the surface is 
  determined by the positive orientation of the first facet of the vertex's
  internal facet list. 
<p>
The curvature calculation works in any dimension space. If for some reason
the space has an ambient dimension greater than 3, and you want to restrict
the calculation of curvature to the first three coordinates, the toggle
<a href="toggle.htm#calculate_in_3d">calculate_in_3d</a> will do that.
<br>
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity stnsq energy method star_perp_sq_mean_curvature global
</pre>

<hr>
<a   id="gauss_bdry_v"></a>
<a   id="gauss_bdry_e"></a>
 <a   id="gauss_curvature_integral"></a><h3>gauss_curvature_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: 
This computes the total Gaussian curvature of a surface with
boundary.  The Gaussian curvature of a polyhedral surface may
be defined at an interior vertex as the angle deficit of the
adjacent angles.  But as is well-known, total Gaussian curvature
can be computed simply in terms of the boundary vertices, which
is what is done here. 
The total Gaussian curvature is implemented as the total geodesic
curvature around the boundary of the surface.  
The contribution of a boundary vertex is
<pre>E =  (\sum_i \theta_i) - pi.</pre>
For reasons due to the Evolver's internal architecture, the sum is actually
broken up as a sum over facets, adding the vertex angle for each facet 
vertex on the boundary and subtracting pi for each boundary edge.
The total over all boundary vertices is
exactly equal to the total angle deficit
of all interior vertices plus 2*pi*chi, where chi is the 
Euler characteristic of the surface.
Boundary vertices are deemed to be those that are fixed or on a 
parametric boundary.  Alternately, one may define a vertex extra attribute
<code>gauss_bdry_v</code> and an edge extra attribute <code>gauss_bdry_e</code>
 and set them nonzero on the relevant vertices and edges; this overrides
the fixed/boundary criterion.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity gint energy method gauss_curvature_integral global
</pre>

<hr> <a   id="star_gauss_curvature"></a><h3>star_gauss_curvature </h3>
<a href="#quantity-top">Named method.</a>
Computes the angle deficit around vertices to which this method is applied.
The angle deficit is 2*pi minus the sum of all the adjacent angles of facets.
No compensation is made for vertices on the boundary of a surface; you just
get big deficits there.  Deficits are counted as positive, following the
convention for gaussian curvature.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any.
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity total_deficit energy method star_gauss_curvature global
</pre>

<hr> <a   id="sq_gauss_curvature"></a><h3>sq_gauss_curvature </h3>
<a href="#quantity-top">Named method.</a>
Description: 
Computes the integral of the squared Gaussian curvature.  At each
vertex, the Gaussian curvature is calculated as the angle defect
divided by one third of the total area of the adjacent facets. This is
then squared and weighted with one third of the area of the adjacent
facets.  This method works only on closed surfaces with no singularities
due to the way it calculates the angle defect.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any.
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity sqg energy method sq_gauss_curvature global
</pre>

<hr>
<H2>Simplex model methods</h2>

<hr> <a   id="simplex_vector_integral"></a><h3>simplex_vector_integral </h3>
<a href="#quantity-top">Named method.</a>
Description:  Integral of a vectorfield over a (n-1)-dimensional
 simplicial facet in n-space. Vectorfield is dotted with normal of
 facet; actually the side vectors of the simplex and the integrand
 vector are formed into a determinant.
<br>Element: facet.
<br>Parameters: vector_integrand.
<br>Models: simplex.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Orientable: yes.
Example datafile declaration, for 4-volume under a 3D surface in 4D:
<pre>
   quantity xvint energy method simplex_vector_integral
   vector_integrand:
   q1: 0
   q2: 0
   q3: 0
   q4: x4
</pre>



<hr>
<a   id="k_vector_order"></a>
 <a   id="simplex_k_vector_integral"></a><h3>simplex_k_vector_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of a simple (n-k)-vector over an oriented k-dimensional
simplicial facet in  n-space.
  The vector integrand lists the components of each of the k vectors
sequentially.  Evaluation is done by forming a determinant whose
first k rows are k vectors spanning the facet, and last (n-k) rows are vectors
of the integrand.
<br>Element: facet.
<br>Parameters: k_vector_order, vector_integrand.
<br>Models: simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Orientable: yes.
Example datafile declaration, for 3D surface in 5D:
<pre>
   quantity kvec energy method simplex_k_vector_integral
   k_vector_order 3
   vector_integrand:
   q1: 0   // first vector
   q2: 0
   q3: 0
   q4: 0
   q5: x4
   q6: 0   // second vector
   q7: 0
   q8: 0
   q9: x3
   q10: 0
</pre>

<hr> <a   id="edge_k_vector_integral"></a><h3>edge_k_vector_integral </h3>
<a href="#quantity-top">Named method.</a>
Description: Integral of a simple (n-k)-vector over an oriented
 k-dimensional simplicial edge in  n-space.
The vector integrand lists the components of each of the k vectors
sequentially.  Evaluation is done by forming a determinant whose
first k rows are k vectors spanning the edge, and last (n-k) rows are vectors
of the integrand.
<br>Element: edge.
<br>Parameters: k_vector_order, vector_integrand.
<br>Models: linear, quadratic, simplex.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Orientable: yes.
Example datafile declaration, for 3D edges of a 4D surface in 5D:
<pre>
   quantity kvec energy method edge_k_vector_integral
   k_vector_order 3
   vector_integrand:
   q1: 0   // first vector
   q2: 0
   q3: 0
   q4: 0
   q5: x4
   q6: 0   // second vector
   q7: 0
   q8: 0
   q9: x3
   q10: 0
</pre>


<hr>>
<a   id="node_charge"></a>
<a   id="knot_energy"></a><h3>knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
 An ``electrostatic'' energy in which vertices
are endowed with equal charges.  Inverse power law of potential is adjustable
via the global parameter `knot_power', default value 2 (which is
not electrostatic, but the knot theorists like it).  If the 
<a href="elements.htm#extra-attributes">extra attribute</a>
`node_charge' is defined for vertices, then that value is used for 
the vertex charge.  Use of this energy is not restricted to knots;
it has been used to embed complicated network graphs in space.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knotten energy method knot_energy global
</pre>

<hr> <a   id="uniform_knot_energy"></a><h3>
uniform_knot_energy or edge_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: A knot energy where vertex charge
is proportional to neighboring edge length. This simulates an
electrostatic charge uniformly distributed along a wire.
Inverse power law of potential is adjustable via the 
global parameter `knot_power' (default 2).
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knotten energy method uniform_knot_energy global
</pre>

<hr> <a   id="uniform_knot_energy_normalizer"></a><h3>uniform_knot_energy_normalizer </h3>
<a href="#quantity-top">Named method.</a>
Description:  Supposed to approximate
the part of <a href="#uniform_knot_energy">uniform_knot_energy</a>
 that is singular in the continuous limit.
<br>Element: vertex.
<br>Parameters:
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knottenorm energy method uniform_knot_energy global
			   method uniform_knot_energy_normalizer global
</pre>

<hr> <a   id="uniform_knot_normalizer1"></a><h3>uniform_knot_normalizer1</h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates internal knot energy to normalize
           singular divergence of integral of 
<a href="quants.htm#uniform_knot_energy">uniform_knot_energy</a>.
Actually a synonym for 
<a href="quants.htm#uniform_knot_energy_normalizer">uniform_knot_energy_normalizer</a>.
No gradient.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knottenorm energy method uniform_knot_energy global
			   method uniform_knot_energy_normalizer1 global
</pre>

<hr> <a   id="uniform_knot_normalizer2"></a><h3>uniform_knot_normalizer2</h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates internal knot energy to normalize
           singular divergence of integral of 
<a href="quants.htm#uniform_knot_energy">uniform_knot_energy</a>
a different way from <a href="quants.htm#uniform_knot_energy_normalizer">uniform_knot_energy_normalizer</a>.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knottenorm energy method uniform_knot_energy global
			   method uniform_knot_energy_normalizer2 global
</pre>

<hr>>
<a   id="edge_knot_energy"></a>
 <a   id="edge_edge_knot_energy"></a><h3>edge_edge_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
Between pairs of edges, energy is inverse square power of distance
between midpoints of edges. Can also be called just
edge_knot_energy.  See also 
<a href="#edge_knot_energy_normalizer">edge_knot_energy_normalizer</a>.
  (by John Sullivan) 
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity knotten energy method edge_edge_knot_energy global
</pre>

<hr> <a   id="edge_knot_energy_normalizer"></a><h3>edge_knot_energy_normalizer</h3>
<a href="#quantity-top">Named method.</a>
Description:  Calculates internal knot energy to normalize
           singular divergence of integral of
<a href="#edge_edge_knot_energy">edge_edge_knot_energy</a>.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity knotten energy method edge_edge_knot_energy global
                        method edge_knot_energy_normalizer global
</pre>

<hr> <a   id="simon_knot_energy_normalizer"></a><h3>simon_knot_energy_normalizer</h3>
<a href="#quantity-top">Named method.</a>
Description:  Another normalization of edge_knot_energy, which I
don't feel like deciphering right now.
<br>Element: edge.
<br>Parameters: none.
<br>Models: string linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kenergy energy method edge_knotenergy global
                   method simon_knot_energy_normalizer global
</pre>


<hr> <a   id="facet_knot_energy"></a><h3>facet_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description:  Charge on vertex is proportional to area of neighboring facets. 
Meant for knotted surfaces in 4D. Power law of potential is adjustable
via the global parameter `knot_power'.  See also
<a href="#facet_knot_energy_fix">facet_knot_energy_fix</a>.
<br>Element: vertex. 
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
parameter knot_power  2     // the default
   quantity knotten energy method facet_knot_energy global
</pre>

<hr> <a   id="facet_knot_energy_fix"></a><h3>facet_knot_energy_fix</h3>
<a href="#quantity-top">Named method.</a>
Description:  Provides adjacent vertex correction to 
<a href="#facet_knot_energy_fix">facet_knot_energy</a>.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knotten energy method facet_knot_energy global
                        method facet_knot_energy_fix global
</pre>

<hr> <a   id="bi_surface"></a><h3>bi_surface</h3>
<a href="#quantity-top">Named method.</a>
Named method of the knot energy family.   Double integral over surface, i.e.
all pairs of vertices weighted with adjacent facet areas.  Adapted from
facet_knot_energy. Uses an arbitrary formula for energy, a function of the vector between
vertices, instead of just power rule.  The formula is  given by the  scalar_integrand
in datafile definition.
The vertex pairs it is evaluated over can be controlled. If the vertex integer
attribute bi_surface_attr is defined, only those with different values of
bi_surface_attr will be included; otherwise all pairs are included.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity qqqq energy method bi_surface
   scalar_integrand  x^2 + y^2 + z^2
</pre>

<hr> <a   id="buck_knot_energy"></a><h3>buck_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description:  Energy between pair of edges
given by formula suggested by Greg Buck.
 Power law of potential is adjustable
via the global parameter `knot_power'.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
parameter knot_power  2     // the default
   quantity knotten energy method buck_knot_energy global
</pre>

<hr> <a   id="proj_knot_energy"></a><h3>proj_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
This energy is due to Gregory Buck.  It tries to 
eliminate the need for a normalization term by projecting
the energy to the normal to the curve.  Its form is
<pre>
   E_{e_1e_2} = {L_1L_2 \cos^p\theta\over |x_1 - x_2|^p}
</pre>
where x_1,x_2 are the midpoints of the edges and \theta
is the angle between the normal plane of edge e_1 and
the vector x_1 - x_2. The default power is 2.
 Power law of potential is adjustable
via the global parameter `knot_power'.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knotten energy method proj_knot_energy global
</pre>

<hr> <a   id="circle_knot_energy"></a><h3>circle_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: This energy is due to Peter Doyle, who says it is equivalent
in the continuous case to the insulating wire with power 2.
Its form is 
<pre>
  E_{e_1e_2} = {L_1L_2 (1 - \cos\alpha)^2 \over |x_1 - x_2|^2},
</pre>
where x_1,x_2 are the midpoints of the edges and \alpha
is the angle between edge 1 and the circle through  x_1
 tangent to edge 2 at x_2. Only power 2 is implemented.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity knotten energy method circle_knot_energy global
</pre>

<a   id="surface_cos_power"></a>
<hr> <a   id="sphere_knot_energy"></a><h3>sphere_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description: 
This is the 2D surface version of the circle energy.
Its most general form is 
<pre>
  E_{f_1f_2} = { A_1A_2(1 - \cos\alpha)^p \over |x_1 - x_2|^q},
</pre>
where A_1,A_2 are the facet areas, x_1,x_2 are the barycenters
of the facets, and \alpha is the angle between f_1 and the sphere
through x_1 tangent to f2 at x_2.  The energy is conformally
invariant for p = 1 and q = 4.  For p=0 and q=1, one gets
electrostatic energy for a uniform charge density.  Note that
facet self-energies are not included.  For electrostatic energy,
this is approximately 2.8A^{3/2} per facet.

The powers p and q are Evolver variables surface_knot_power and
surface_cos_power respectively.
The defaults are p=1 and q=4.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter surface_knot_power  1     // the default
   parameter surface_cos_power  4     // the default
   quantity knotten energy method sphere_knot_energy global
</pre>

<hr> <a   id="sin_knot_energy"></a><h3>sin_knot_energy </h3>
<a href="#quantity-top">Named method.</a>
Description:  Another weird way to 
calculate a nonsingular energy between midpoints of pairs of edges.
(by John Sullivan)
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity knotten energy method sin_knot_energy global
</pre>

<hr> <a   id="curvature_binormal"></a><h3>curvature_binormal</h3>
<a href="#quantity-top">Named method.</a>
Description: For string model.  The energy evaluates to zero, but the force
calculated is the mean curvature vector rotated to the binormal direction.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity curbi energy method curvature_binormal global
</pre>


<hr> <a   id="ddd_gamma_sq"></a><h3>ddd_gamma_sq</h3>
<a href="#quantity-top">Named method.</a>
Description:  Third derivative of curve position as 
function of arclength, squared.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: string, linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity ddd energy method ddd_gamma_sq global
</pre>


<hr> <a   id="edge_min_knot_energy"></a><h3>edge_min_knot_energy</h3>
<a href="#quantity-top">Named method.</a>
Description:
 Between pairs of edges, energy is inverse square power of distance
between closest points of edges.
<pre>    Energy = 1/d^2 * |e1||e2|
</pre>
This should be roughly the same as edge_edge_knot_energy, but distances
are calculated from edge midpoints there.
  This is not a smooth function,
so we don't try to compute a gradient.  DO NOT use as an energy;
use just for info_only quantities.

<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity eminknot info_only method edge_min_knot_energy global
</pre>

<hr> <a   id="true_average_crossings"></a><h3>true_average_crossings</h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates the average crossing number of an edge with
respect to all other edges, averaged over all projections. Knot stuff.
No gradient, so use just in info_only quantities.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity true_cross info_only method true_average_crossings global
</pre>

<hr> <a   id="true_writhe"></a><h3>true_writhe</h3>
<a href="#quantity-top">Named method.</a>
Description: For calculating the writhe of a link or knot.
No gradient, so use just in info_only quantities.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity twrithe info_only method true_average_crossings global
</pre>

<hr> <a   id="twist"></a><h3>twist</h3>
<a href="#quantity-top">Named method.</a>
Description:  Another average crossing number calculation.
No gradient, so use just in info_only quantities.
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity twister info_only method twist global
</pre>

<hr> <a   id="writhe"></a><h3>writhe</h3>
<a href="#quantity-top">Named method.</a>
Description:  An average crossing number calculation.  This one does
have a gradient. Suggested by Hermann Gluck.
Programmed by John Sullivan.
Between pairs of edges, energy is inverse cube power of distance
between midpoints of edges, times triple product of edge vectors
and distance vector.
<pre>     E = 1/d^3 * (e1,e2,d)
</pre>
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity writhy energy method writhe global
</pre>

<hr> <a   id="curvature_function"></a><h3>curvature_function </h3>
<a href="#quantity-top">Named method.</a>
Description:  Calculates forces as function of
mean and Gaussian curvatures at vertices.  Function may be
changed by user by altering teix.c.  No energy, just forces.
<br>Element: vertex. 
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity curfun energy method curvature_function global
</pre>

<hr> <a   id="average_crossings"></a><h3>average_crossings </h3>
<a href="#quantity-top">Named method.</a>
Description:  To calculate the average
crossing number in all projections of a knot. (by John Sullivan)
<br>Element: edge.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity across energy method average_crossings global
</pre>


<hr> <a   id="knot_thickness"></a><h3>knot_thickness </h3>
<a href="#quantity-top">Named method.</a>
Description:   Calculates global radius of curvature at one vertex v,
     as the minimum radius of circle containing the vertex and
  the endpoints of any non-adjacent edge.
 Because of "min", this has no gradient, so should be used
in info_only quantities.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
Gradient: no.
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kthick info_only method knot_thickness global
</pre>

<hr> <a   id="knot_thickness_0"></a><h3>knot_thickness_0 </h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates global radius of curvature at one vertex,
  as Lp integral of radius of curvature of circle containing the 
  vertex and the endpoints of edges not adjacent to the vertex.
   Integrand raised to -p power.  The power p is taken from
  the global variable knot_power. No factor of length in integral.
  This method has a gradient.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kthick info_only method knot_thickness_0 global
</pre>

<hr> <a   id="knot_thickness_p"></a><h3>knot_thickness_p </h3>
<a href="#quantity-top">Named method.</a>
Description: purpose: calculates global radius of curvature at one vertex v,
    as Lp integral of radius of curvature of v and endpoints of
    nonadjacent edges.  Includes factors of length at v and w.
    This method has a gradient.
 The power p is taken from the global variable knot_power.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kthick info_only method knot_thickness_p global
</pre>

<hr> <a   id="knot_thickness_p2"></a><h3>knot_thickness_p2 </h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates the global radius of curvature at one vertex v,
   as Lp integral of  r(v,w1,w2) over all vertices w.
   Here w1 and w2 are the two neighbors of vertex w.
  Includes factors of length at v and w.
   This has not been extended to allow open arcs (valence 1 vertices).
 This method does have a gradient.
 The power p is taken from the global variable knot_power.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kthick info_only method knot_thickness_p2 global
</pre>

<hr> <a   id="knot_thickness2"></a><h3>knot_thickness2 </h3>
<a href="#quantity-top">Named method.</a>
Description:   calculates global radius of curvature at one vertex v,
     as the minimum radius of circle containing the vertex and
  the neighbor vertices of any non-adjacent vertex.
 Because of "min", this has no gradient, so should be used
in info_only quantities.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
Gradient: no.
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity kthick info_only method knot_thickness2 global
</pre>


<hr> <a   id="knot_local_thickness"></a><h3>knot_local_thickness </h3>
<a href="#quantity-top">Named method.</a>
Description: Calculates the radius of curvature at a vertex of
the circle containing the
 vertex and its two neighbor vertices.   Meant to investigate
the radius at individual vertices.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
Gradient: no.
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity klocalthick info_only method knot_local_thickness global
</pre>



<hr>
<h2> Weird and miscellaneous </h2>

<hr> <a   id="wulff_energy"></a><h3>wulff_energy</h3>
<a href="#quantity-top">Named method.</a>
Description: Method version of <a href="datafile.htm#wulff">wulff</a>
energy.  If Wulff filename is not given in top section of datafile,
then the user will be prompted for it.  
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   wulff "crystal.wlf"
   quantity wolf energy method wulff_energy global
</pre>

<hr> <a   id="linear_elastic"></a><h3>linear_elastic</h3>
<a href="#quantity-top">Named method.</a>
Description:  To calculate the isotropic linear elastic strain 
energy for facets based on the Cauchy-Green strain matrix.
 Let S be Gram matrix of unstrained facet (dots of sides).
Let Q be the inverse of S.
    Let F be Gram matrix of strained facet.
	Let C = (FQ-I)/2, the Cauchy-Green strain tensor.
	    Let v be Poisson ratio.
	Then energy density is
<blockquote><code> (1/2/(1+v))(Tr(C^2) + v*(Tr C)^2/(1-(dim-1)*v))
</code></blockquote>
  Each facet has extra attribute poisson_ratio and
   extra attribute array form_factors[3] = {s11,s12,s22}, which 
   are the entries in S.  That is, s11 = dot(v2-v1,v2-v1), 
   s12 = dot(v2-v1,v3-v1), and s22 = dot(v3-v1,v3-v1).
   If form_factor is not defined by the user, it will be created by Evolver,
   and the initial facet shape will be assumed to be unstrained.
For a version of this method that gives compression zero energy, see
<a href="#relaxed_elastic_A">relaxed_elastic_A</a>.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity lastic energy method linear_elastic global
</pre>


<a   id="elastic_basis"></a> <a   id="elastic_coeff"></a>
<hr> <a   id="general_linear_elastic"></a><h3>general_linear_elastic</h3>
<a href="#quantity-top">Named method.</a>
Description:  To calculate the nonisotropic linear elastic strain
energy for facets.
Let A be the linear transformation from the unstrained shape
to the strained shape.  Then the Cauchy-Green strain tensor
is C = (A<sup>T</sup>A - I)/2.  Let S<sub>1</sub> and S<sub>2</sub> be the
sides of the unstrained facet. Let W<sub>1</sub> and W<sub>2</sub> be the 
transformed facet sides. Let F be the  Gram matrix of strained facet.
Define
<blockquote>    S = [ S<sub>1</sub> S<sub>2</sub> ],  Q = S<sup>-1</sup>
<br>
    W = [ W<sub>1</sub> W<sub>2</sub> ] = AS
<br>
    F = W<sup>T</sup>W = S<sup>T</sup>A<sup>T</sup>AS
</blockquote>
Then
<blockquote>
    A<sup>T</sup>A = Q<sup>T</sup>FQ
<br>
    C = (Q<sup>T</sup>FQ - I)/2
</blockquote>
    The energy density is
<blockquote><code>    (1/2)C<sub>ij</sub> K<sub>ijkl</sub> C<sub>kl</sub>
</code></blockquote>
 where K<sub>ijkl</sub> is the full tensor of elastic constants.
  By using symmetries, this can be reduced to
  <blockquote>
  <table> <tr><td> (1/2) [ C<sub>11</sub> C<sub>22</sub> C<sub>12</sub> ] </td>
    <td> [ E<sub>1</sub> E<sub>3</sub> E<sub>4</sub> ] [ C<sub>11</sub> ]
    </td></tr>
    <tr><td></td><td> 
            [ E<sub>3</sub> E<sub>2</sub> E<sub>5</sub> ] [ C<sub>22</sub> ] 
    </td></tr>
 <tr><td></td><td>
            [ E<sub>4</sub> E<sub>5</sub> E<sub>6</sub> ] [ C<sub>12</sub> ]
   </td></tr>
   </table>
  </blockquote>
  
  Each facet has extra attribute elastic_coeff of size 6
 containing  { E<sub>1</sub>, E<sub>2</sub>, E<sub>3</sub>, 
  E<sub>4</sub>, E<sub>5</sub>, E<sub>6</sub> }, and
   extra attribute array elastic_basis of size 2x2
  containing { {s11,s12},{s21,s22}}, which
      are the two sides of the unstrained facet.
  Note that the E<sub>i</sub> are defined with respect to the original
   sides as defined by the form factors, so it is up to you to
   make sure everything works out right.  Test carefully!!!
   The elastic_coeff attribute must be created and initialized by the
   user.

<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   define facet attribute elastic_basis real[2][2]
   define facet attribute elastic_coeff real[6]
   quantity genlastic energy method general_linear_elastic global
</pre>

<hr> <a   id="linear_elastic_B"></a><h3>linear_elastic_B</h3>
<a href="#quantity-top">Named method.</a>
Description:  A variation of the
<a href="#linear_elastic">linear_elastic</a> method.
To calculate the linear elastic strain
energy for facets based on the Cauchy-Green strain matrix.
 Let S be Gram matrix of unstrained facet (dots of sides).
Let Q be the inverse of S.
    Let F be Gram matrix of strained facet.
	Let C = (FQ-I)/2, the Cauchy-Green strain tensor.
	    Let v be Poisson ratio.
	Then energy density is
<pre> (1/2/(1+v))(Tr(C^2) + v*(Tr C)^2/(1-(dim-1)*v))
</pre>
  Each facet has extra attribute poisson_ratio and
  each vertex has two extra coordinates, the coordinates of
  the unstrained surface in a plane.  Hence the surface must
  be set up as five dimensional.
There can also be a
real-valued facet extra attribute LEBweight, which can be used to give
a per-facet weighting of the energy.  
For a version of this method that gives compression zero energy, see
<a href="#relaxed_elastic">relaxed_elastic</a>.

<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 5. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   space_dimension 5
   quantity lastic energy method linear_elastic_B global
</pre> 

 <a   id="relaxed_elastic_A">relaxed_elastic_A</a>,
<hr><a   id="relaxed_elastic1_A"></a>
<a   id="relaxed_elastic2_A"></a><h3>
 relaxed_elastic1_A, relaxed_elastic2_A</h3>
<a href="#quantity-top">Named method.</a>
Description:  Calculates the linear elastic strain
energy for facets based on the Cauchy-Green strain matrix,
with compression counting for zero energy, simulating, say, plastic film.
The effect is to permit wrinkling.
 Let S be the Gram matrix of unstrained facet (dots of sides).
Let Q be the inverse of S.
    Let F be Gram matrix of strained facet.
	Let C = (FQ-I)/2, the Cauchy-Green strain tensor.
	    Let v be Poisson ratio.
	Then the energy is
<pre>    (1/2/(1+v))(Tr(C^2) + v*(Tr C)^2/(1-(dim-1)*v))
</pre>
  Each facet has extra attribute poisson_ratio and
   extra attribute array form_factors[3] = {s11,s12,s22}, which 
   are the entries in S.  That is, s11 = dot(v2-v1,v2-v1), 
   s12 = dot(v2-v1,v3-v1), and s22 = dot(v3-v1,v3-v1).
   If form_factor is not defined by the user, it will be created by Evolver,
   and the initial facet shape will be assumed to be unstrained.
The compression is detected by doing an eigenvalue analysis of the strain
tensor, and discarding any negative eigenvalues.  
Facets which are stressed in one or two dimensions  can
be separately counted by the relaxed_elastic1_A (one stress direction, and one
wrinkle direction) and
relaxed_elastic2_A (two stressed directions) methods, which are meant to be
used in <a href="datafile.htm#info_only">info_only</a> mode.
There can also be a
real-valued facet extra attribute LEBweight, which can be used to give
a per-facet weighting of the energy.  
For a sample datafile, see mylarcube.fe.
For a version of this method that gives compression positive energy, see
<a href="#linear_elastic">linear_elastic</a>.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity lastic energy method relaxed_elastic_A global
</pre>

<hr><a   id="relaxed_elastic1"></a><a   id="relaxed_elastic2"></a>
 <a   id="relaxed_elastic"></a><h3>relaxed_elastic,
relaxed_elastic1, relaxed_elastic2</h3>
<a href="#quantity-top">Named method.</a>
Description:  A variation of the
<a href="#linear_elastic">linear_elastic</a> method.
Calculates the linear elastic strain 
energy for facets based on the Cauchy-Green strain matrix,
with compression counting for zero energy, simulating, say, plastic film.
The effect is to permit wrinkling.
 Let S be Gram matrix of unstrained facet (dots of sides).
Let Q be the inverse of S.
    Let F be Gram matrix of strained facet.
	Let C = (FQ-I)/2, the Cauchy-Green strain tensor.
	    Let v be Poisson ratio.
	Then energy density is
<pre>   (1/2/(1+v))(Tr(C^2) + v*(Tr C)^2/(1-(dim-1)*v))
</pre>
  Each facet has extra attribute poisson_ratio and
  each vertex has two extra coordinates, the coordinates of
  the unstrained surface in a plane.  Hence the surface must
  be set up as five dimensional.
The compression is detected by doing an eigenvalue analysis of the strain
tensor, and discarding any negative eigenvalues.  The eigenvalues may
be separately accessed by the relaxed_elastic1_A (lower eigenvalue) and
relaxed_elastic2_A (higher eigenvalue) methods, which are meant to be
used in <a href="datafile.htm#info_only">info_only</a> mode.
There can also be a real-valued facet extra attribute LEBweight, which
can be used to give a per-facet weighting of the energy.
For a sample datafile, see mylarcube.fe.
For a version of this method that gives compression zero energy, see
<a href="#linear_elastic_B">linear_elastic_B</a>.

<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 5. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   space_dimension 5
   quantity lastic energy method relaxed_elastic global
</pre> 



<hr> <a   id="dirichlet_elastic"></a><h3>dirichlet_elastic</h3>
<a href="#quantity-top">Named method.</a>
Description:  Calculate the Dirichlet elastic strain
energy for facets, minimization of which gives conformal mapping.
 Let S be Gram matrix of unstrained facet (dots of sides).
Let Q be the inverse of S.
    Let F be Gram matrix of strained facet.
	Let C = FQ, the linear deformation matrix.
	Then energy density is
<blockquote><code>  Tr(CC<sup>T</sup>)
</code></blockquote>
  Each facet has an extra attribute array form_factors[3] = {s11,s12,s22}, 
   which  are the entries in S.  That is, s11 = dot(v2-v1,v2-v1), 
   s12 = dot(v2-v1,v3-v1), and s22 = dot(v3-v1,v3-v1).
   If form_factor is not defined by the user, it will be created by Evolver,
   and the initial facet shape will be assumed to be unstrained.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity dirich energy method dirichlet_elastic global
</pre>

<a   id="SVK_mu">
</a><a   id="SVK_lambda">
</a><a   id="SVK_theta"></a>
<a   id="SVK_alpha"></a>
<hr> <a   id="SVK_elastic"></a><h3>SVK_elastic</h3>
<a href="#quantity-top">Named method.</a>
Description:      SVK (Saint-Venant - Kirchhoff) potential.
The facet energy is
<blockquote>
    lambda/2*(tr(E))^2+mu*(E:E) - (3 lambda + 2 mu) * alpha*theta*tr(E)
</blockquote>

    where E=(C-I)/2 is the Green-Lagrange Strain tensor,
    theta = T-T0 is the temperature deviation, and
    alpha is the thermal dilation coefficient. 

Needs real-valued facet attributes SVK_alpha, SVK_mu, SVK_lambda, and
 SVK_theta. Also needs the facet attribute form_factors, 
decribed in <a href="#linear_elastic">linear_elastic</a>.
   Written by  Dr. Rabah Bouzidi. 
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   define facet attribute SVK_alpha real
   define facet attribute SVK_lambda real
   define facet attribute SVK_mu real
   define facet attribute SVK_theta real
   define facet attribute form_factors real[3]
   quantity svk energy method SVK_elastic  global
</pre>


<a   id="neo_mu"></a><a   id="neo_lambda"></a>
<hr> <a   id="neo_hookean"></a><h3>neo_hookean </h3>
<a href="#quantity-top">Named method.</a>
Contributed by Prof. Rabah Bouzidi.
I don't seem to have the compact formula for this one.
Needs neo_lambda, neo_mu, and form_factors.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: yes.
<br>Example datafile declaration:
<pre>
   quantity bender energy method neo_hookean global
</pre>

<hr> <a   id="null_length"></a><h3>null_length </h3>
<a href="#quantity-top">Named method.</a>
Description: Simply returns 0 for any edge.  Useful
in the string model with length_method_name when you don't want edge
energy, but you still want to assign edges tension.
<br>Element: edge. <br>Parameters: none. <br>Models: any.
<br>Ambient dimension: any. <br>Hessian: yes. <br>Example datafile declaration:
<pre>
  length_method_name "null_length"
</pre>

<hr> <a   id="null_area"></a><h3>null_area </h3>
<a href="#quantity-top">Named method.</a>
Named method. Description: Simply returns 0 for any facet.  Useful
with area_method_name when you don't want area as energy, but you still
want to assign facets tension.
<br>Element: edge. <br>Parameters: none. <br>Models: any.
<br>Ambient dimension: any. <br>Hessian: yes. <br>Example datafile declaration:
<pre>
  area_method_name "null_area"
</pre>

<hr> <a   id="area_square"></a><h3>area_square</h3>
<a href="#quantity-top">Named method.</a>
Description:  Energy of a facet is the square of the facet area.
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity asquare energy method area_square global
</pre>




<a   id="carter_power"></a>
<hr> <a   id="carter_energy"></a><h3>carter_energy</h3>
<a href="#quantity-top">Named method.</a>
Description: 
Craig Carter's energy.
<pre>
Given bodies $B_1$ and $B_2$ in $R^3$, define the energy
    E = \int_{B_1}\int_{B_2} {1 \over |z_1 - z_2|^{p} } d^3 z_2 d^3 z_1
This reduces to
E = {1\over (3-p)(2-p)}\sum_{F_2\in\partial B_2}\sum_{F_1\in\partial B_1}
    N_1 \cdot N_2 \int_{F_2}\int_{F_1}{1\over |z_1 - z_2|^{p-2}}
    d^2 z_1 d^2 z_2.
And if we crudely approximate with centroids $\bar z_1$ and $\bar z_2$,
E = {1\over (3-p)(2-p)}\sum_{F_2\in\partial B_2}\sum_{F_1\in\partial B_1}
        {A_1 \cdot A_2 \over |\bar z_1 - \bar z_2|^{p-2}},
where $A_1$ and $A_2$ are unnormalized area vectors for the facets.
The power p is set by the variable carter_power (default 6).
</pre>
<br>Element: facet.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter carter_power  6     // the default
   quantity craig energy method carter_energy global
</pre>

<hr> <a   id="charge_gradient"></a><h3>charge_gradient</h3>
<a href="#quantity-top">Named method.</a>
Description: This energy is the gradient^2 of the
<a href="#knot_energy">knot_energy</a> method,
 assuming the points are constrained to the unit sphere. 
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   parameter knot_power  2     // the default
   quantity knotten energy method knot_energy global
</pre>

<hr> <a   id="johndust"></a><h3>johndust</h3>
<a href="#quantity-top">Named method.</a>
Description:  For all point pairs (meant to be on a sphere),
<pre>       E = (pi - asin(d/2))/d, 
</pre>
where d is chord distance.  For point
packing problems on the sphere.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: linear.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   constraint 1 formula: x^2+y^2+z^2 = 1
   quantity jms energy method johndust global
</pre>



<hr> <a   id="stress_integral"></a><h3>stress_integral</h3>
<a href="#quantity-top">Named method.</a>
Description: Hmm.  Looks like this one calculates integrals of
 components of a stress tensor.  The scalar_integrand value
is set as an integer standing for which component to do (a kludge).
See the function stress_integral in method3.c for details.
Does not have a gradient, so should be used for just info_only quantities.
<br>Element: facet.
<br>Parameters: scalar_integrand.
<br>Models: linear.
<br>Ambient dimension: 3. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity stressy info_only method stress_integral global
   scalar_integrand: 3
</pre>

<hr> <a   id="ackerman"></a><h3>ackerman</h3>
<a href="#quantity-top">Named method.</a>
Description: Not actually an energy, but a 
kludge to put inertia on vertices.  
Uses extra velocity coordinates to represent vertex in phase space.
Invocation actually transfers computed forces from space coordinates
to velocity coordinates, so forces become acceleration instead of
velocity.
<br>Element: vertex.
<br>Parameters: none.
<br>Models: any.
<br>Ambient dimension: any. 
<br>Hessian: no.
<br>Example datafile declaration:
<pre>
   quantity jeremy energy method ackerman global
</pre>


<a   id="lmc_mobility"></a>
<a   id="lmc_mean_curvature"></a>
<hr> <a   id="laplacian_mean_curvature"></a><h3>laplacian_mean_curvature</h3>
<a href="#quantity-top">Named method.</a>

Description: Calculates the velocity of a vertex as the
Laplacian of the mean curvature of the surface, meant to model the
surface diffusion of atoms in sintering. The mean curvature at each vertex is
calculated as a scalar, in the same way as for area_normalized area gradient,
i.e. area gradient dotted with volume gradient, divided by the area of the
surrounding facets.  Then finite differences are used to calculate the
Laplacian of the mean curvature.  This calculates velocity only;
the energy is always 0.  This method should only be used with fixed
scale in the 'g' command.
<p>

The relative speed of vertices can be controlled by the vertex
attribute lmc_mobility, which the user should declare if wanted.
If the user wants to access the values of mean curvature the method
finds, the user should define the vertex scalar attribute lmc_mean_curvature.
This method conserves volume ideally, but you might want to put on volume
constraints anyway due to numerical inaccuracies.
<p>
Warning: This method should only be used with a fixed 'g' scale factor.
And for stability, the factor should be proportional to the fourth power of
the shortest edge, since Laplacian of mean curvature is a fourth-derivative
operator, something like 0.001*length^4.  This can make for very slow
evolution for highly refined surfaces.
<p>

<br>Element: vertex. <br>Parameters: none. <br>Models: linear string and linear
soapfilm. <br>Ambient dimension: any.
<br>Hessian: no. <br>Example datafile declaration:
<pre>
  area_method_name "null_area"
  define facet attribute lmc_mobility real
  define facet attribute lmc_mean_curvature real
  quantity lmc energy method laplacian_mean_curvature global
</pre>



<hr>
<a href="evolver.htm#doc-top">Back to top of Surface Evolver documentation.</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="index.htm">Index.</a>
</body>
</html>