-
Notifications
You must be signed in to change notification settings - Fork 0
/
DM_OOD.pas
2091 lines (1862 loc) · 45.7 KB
/
DM_OOD.pas
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
unit DM_OOD;
{$MODE Delphi}
interface
uses NuclideClassesMin, ObjectsMin;
type
AlphaRec = TAlpha;
BetaRec = TBeta;
GammaRec = TGamma;
// SubBranching - later TODO?
(*
TSubBranchType= ( sbA, sbBM, sbEC, sbIT, sbN, sbP, sbSF, sbQ, // Decay
sbCaptureT, sbCaptureR, sbCaptureF, // Capture
sbYieldT, sbYieldF, sbYieldS, // Fission
sbNP, sbNA, sbN2N, sbNN, sbNG // Threshold
);
function sd2dt(const aSubBranchingType: TSubBranchType): TDecayType; TODO?
*)
TVUniThZpA_s = class(TVUniNumberObj) // abstract !!!
function GetThZpA_s: integer;
procedure SetThZpA_s(aThZpA_s: integer);
public
property ThZpA_s: integer read GetThZpA_s write SetThZpA_s;
end;
TVState = class(TVUniThZpA_s)
private
fT1_2: double; // 10 bytes 80 bit double in FPC64 - 8 bytes
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor CreateFromNuclideState(aState: TNuclideState);
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property T1_2: double read fT1_2 write fT1_2;
end;
TVStateColl = class(TVUniNumberColl) // TVCollection)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVAbundance = class(TVUniNumberObj)
private
fAbundance: double;
function GetThZpA: integer;
procedure SetThZpA(aThZpA: integer);
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA: integer read GetThZpA write SetThZpA;
property Abundance: double read fAbundance write fAbundance;
end;
TVAbundanceColl = class(TVUniNumberColl) // TVCollection)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVElement = class(TVUniNumberObj)
private
fAmassMean: double;
fSymbol: string[2];
fRo: double; // Ro_g/cm^3
fksi: double;
fSigmaS: double;
fRI: double;
fSigmaA: double;
function GetSymbol: shortstring;
procedure SetSymbol(const Value: shortstring);
function GetZnum: integer;
procedure SetZnum(aZnum: integer);
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor CreateFromElement(aElement: TElement);
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property AmassMean: double read fAmassMean write fAmassMean;
property Symbol: shortstring read GetSymbol write SetSymbol;
property Znum: integer read GetZnum write SetZnum;
property Ro: double read fRo write fRo;
property ksi: double read fksi write fksi;
property SigmaS: double read fSigmaS write fSigmaS;
property RI: double read fRI write fRI;
property SigmaA: double read fSigmaA write fSigmaA;
end;
TVElementColl = class(TVUniNumberColl)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVDecay = class(TVObject)
private
fThZpA_s: integer;
fDecayType: TDecayType;
fBranching: double;
fState: TVState; // VState pointer
public
function IsEqual(Obj: Pointer): Boolean; virtual;
constructor Create; override;
constructor CreateFromStateDecay(const aState: TNuclideState; const aDecay: TDecay);
constructor Load(S: TVStream; Version: Word); override;
procedure SetDecayType(const DecayMode: shortstring);
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property DecayType: TDecayType read fDecayType write fDecayType;
property Branching: double read fBranching write fBranching;
end;
TVDecayColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
procedure UpdateLink(const LinkID: ShortString; AColl: TVUniCollection); virtual; // QQQQ was override;
procedure RemoveLink(const LinkID: ShortString); virtual; // QQQQ was override;
end;
TVSigmaC = class(TVObject)
private
fThZpA_s: integer;
fProductState: integer;
fSigma: double;
fg_factor: double;
public
function IsEqual(Obj: Pointer): Boolean; virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property ProductState: integer read fProductState write fProductState;
property Sigma: double read fSigma write fSigma;
property g_factor: double read fg_factor write fg_factor;
end;
TVSigmaCColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVRI = class(TVObject)
private
fThZpA_s: integer;
fProductState: integer;
fRI: double;
public
function IsEqual(Obj: Pointer): Boolean; virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property ProductState: integer read fProductState write fProductState;
property RI: double read fRI write fRI;
end;
TVRIColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVSigmaF = class(TVUniThZpA_s)
private
fSigma: double;
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property Sigma: double read fSigma write fSigma;
end;
TVSigmaFColl = class(TVUniNumberColl)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVRIf = class(TVUniThZpA_s)
private
fRI: double;
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property RI: double read fRI write fRI;
end;
TVRIFColl = class(TVUniNumberColl)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVSigmaThreshold = class(TVUniThZpA_s)
private
fg_factor: double;
fSigmaNP: double;
fSigmaNA: double; // (n,alpha)
fSigmaN2N: double;
fSigmaNN: double; // (n,n')
fSigmaNG: double; // (n,gamma)-fast
public
function IsEqual(Obj: Pointer): Boolean; override; // virtual;
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property g_factor: double read fg_factor write fg_factor;
property SigmaNP: double read fSigmaNP write fSigmaNP;
property SigmaNA: double read fSigmaNA write fSigmaNA;
property SigmaN2N: double read fSigmaN2N write fSigmaN2N;
property SigmaNN: double read fSigmaNN write fSigmaNN;
property SigmaNG: double read fSigmaNG write fSigmaNG;
end;
TVSigmaThresholdColl = class(TVUniNumberColl)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
{ TVYield }
TVYield = class(TVObject)
private
fThZpA_s: integer;
fProductThZpA_s: integer;
fIndYield: double;
fCumYield: double;
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property ProductThZpA_s: integer read fProductThZpA_s write fProductThZpA_s;
property IndYield: double read fIndYield write fIndYield;
property CumYield: double read fCumYield write fCumYield;
end;
TVYieldColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ProductThZpA_s; // The only for Yields
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVYieldT = class(TVYield);
TVYieldF = class(TVYield);
TVYieldTColl = class(TVYieldColl);
TVYieldFColl = class(TVYieldColl);
{ TVAlpha }
TVAlpha = class(TVObject)
private
fThZpA_s: integer;
fProbability: double;
fMeV: double;
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property Probability: double read fProbability write fProbability;
property MeV: double read fMeV write fMeV;
end;
TVAlphaColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVGamma = class(TVAlpha);
TVGammaColl = class(TVAlphaColl);
TVElectron = class(TVAlpha);
TVElectronColl = class(TVAlphaColl);
TVBeta = class(TVAlpha)
private
fMaxMeV: double;
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property MaxMeV: double read fMaxMeV write fMaxMeV;
end;
TVBetaColl = class(TVAlphaColl);
TVPositron = class(TVBeta);
TVPositronColl = class(TVBetaColl);
TVSubBranching = class(TVObject)
private
fThZpA_s: integer;
fBranchingName: string[2];
fBranchingToG: double;
fBranchingToM1: double;
fBranchingToM2: double;
function GetName: shortstring;
procedure SetName(const Value: shortstring);
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property SubBranchingName: shortstring read GetName write SetName;
property BranchingToG: double read fBranchingToG write fBranchingToG;
property BranchingToM1: double read fBranchingToM1 write fBranchingToM1;
property BranchingToM2: double read fBranchingToM2 write fBranchingToM2;
end;
TVSubBranchingColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ThZpA_s;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVFastFission = class(TVUniThZpA_s)
private
// fThZpA_s: integer;
fSigma: double;
// fg_factor: double;
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
// property ThZpA_s: integer read fThZpA_s write fThZpA_s;
property Sigma: double read fSigma write fSigma;
// property g_factor: double read fg_factor write fg_factor;
end;
TVFastFissionColl = class(TVUniNumberColl)
private
public
constructor Create; override;
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
TVSpecialCaptureCase = class(TVObject)
private
fParentThZpA_s: integer;
fChildThZpA_s: integer;
fSigma: double;
fg_factor: double;
fRI: double;
public
constructor Create; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
function Clone: Pointer; override;
property ParentThZpA_s: integer read fParentThZpA_s write fParentThZpA_s;
property ChildThZpA_s: integer read fChildThZpA_s write fChildThZpA_s;
property Sigma: double read fSigma write fSigma;
property g_factor: double read fg_factor write fg_factor;
property RI: double read fRI write fRI;
end;
TVSpecialCaptureCaseColl = class(TVUniCollection)
private
public
constructor Create; override;
procedure MakeIndexBy_ParentThZpA_s; // the only
function Clone: Pointer; override;
constructor Load(S: TVStream; Version: Word); override;
procedure Store(S: TVStream); override;
end;
const
IndexBy_T1_2 = 'IndexBy_T1_2';
IndexBy_ThZpA_s = 'IndexBy_ThZpA_s';
IndexBy_ParentThZpA_s = 'IndexBy_ParentThZpA_s';
IndexBy_Branching = 'IndexBy_Branching';
IndexBy_Abundance = 'IndexBy_Abundance';
IndexBy_Sigma = 'IndexBy_Sigma';
IndexBy_RI = 'IndexBy_RI';
IndexBy_CumYield = 'IndexBy_CumYield';
IndexBy_ProductThZpA_s = 'IndexBy_ProductThZpA_s';
IndexBy_Probability = 'IndexBy_Probability';
IndexBy_MeV = 'IndexBy_MeV';
rg_TVState = 1001;
rg_TVStateColl = 1002;
rg_TVElement = 1003;
rg_TVElementColl = 1004;
rg_TVDecay = 1005;
rg_TVDecayColl = 1006;
rg_TVAbundance = 1007;
rg_TVAbundanceColl = 1008;
rg_TVSigmaF = 1009;
rg_TVSigmaFColl = 1010;
rg_TVRIF = 1011;
rg_TVRIFColl = 1012;
rg_TVSigmaThreshold = 1013;
rg_TVSigmaThresholdColl = 1014;
rg_TVSigmaC = 1015;
rg_TVSigmaCColl = 1016;
rg_TVRI = 1017;
rg_TVRIColl = 1018;
rg_TVYieldT = 1019;
rg_TVYieldTColl = 1020;
rg_TVYieldF = 1021;
rg_TVYieldFColl = 1022;
rg_TVAlpha = 1023;
rg_TVAlphaColl = 1024;
rg_TVGamma = 1025;
rg_TVGammaColl = 1026;
rg_TVElectron = 1027;
rg_TVElectronColl = 1028;
rg_TVBeta = 1029;
rg_TVBetaColl = 1030;
rg_TVPositron = 1031;
rg_TVPositronColl = 1032;
rg_TVSubBranching = 1033;
rg_TVSubBranchingColl = 1034;
rg_TVFastFission = 1035;
rg_TVFastFissionColl = 1036;
rg_TVSpecialCaptureCase = 1037;
rg_TVSpecialCaptureCaseColl = 1038;
{ Links }
ThZpA_s_Link = 'ThZpA_s';
implementation
uses QStringsMin;
{ TVUniThZpA_s }
function TVUniThZpA_s.GetThZpA_s: integer;
begin
Result:= Number;
end;
procedure TVUniThZpA_s.SetThZpA_s(aThZpA_s: integer);
begin
if aThZpA_s <> Number then
Number:= aThZpA_s;
end;
{ TVState }
function TVState.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVState.Create;
begin
inherited;
end;
constructor TVState.CreateFromNuclideState(aState: TNuclideState);
begin
Create;
fT1_2:= aState.T1_2;
Number:= 10 * (1000 * aState.Nuclide.Znum + aState.Nuclide.Amass) + aState.State;
end;
function TVState.IsEqual(Obj: Pointer): Boolean;
begin
Result:= inherited IsEqual(Obj) and
(Self.fT1_2 = TVState(Obj).fT1_2);
end;
procedure TVState.Store(S: TVStream);
begin
inherited;
S.Write(fT1_2, SizeOf(fT1_2));
end;
constructor TVState.Load(S: TVStream; Version: Word);
begin
inherited;
S.read(fT1_2, SizeOf(fT1_2));
end;
{ TVStateColl }
function TVStateColl.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVStateColl.Create;
begin
inherited;
GetIndexRec('Number').Descending:= False;
end;
constructor TVStateColl.Load(S: TVStream; Version: Word);
begin
inherited;
end;
function CompTVStatesT1_2(Item1, Item2: Pointer): integer;
var
P1, P2: TVState;
begin
P1:= TVState(Item1);
P2:= TVState(Item2);
if P1.fT1_2 < P2.fT1_2 then
Result:= -1
else if P1.fT1_2 > P2.fT1_2 then
Result:= 1
else
Result:= 0;
end;
function TVT1_2OfState(Item: Pointer): double;
begin
Result:= TVState(Item).fT1_2;
end;
procedure TVStateColl.Store(S: TVStream);
begin
inherited;
end;
{ TVElement }
function TVElement.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVElement.Create;
begin
inherited;
end;
constructor TVElement.CreateFromElement(aElement: TElement);
begin
inherited Create;
with Self, aElement do
begin
Znum:= aElement.Znum;
fAmassMean:= aElement.AmassMean;
fSymbol:= aElement.Symbol;
fSigmaA:= aElement.SigmaA;
fRo:= aElement.Ro;
fksi:= aElement.ksi;
fSigmaS:= aElement.SigmaS;
fRI:= aElement.RI;
end;
end;
function TVElement.GetSymbol: shortstring;
begin
Result:= fSymbol;
end;
function TVElement.GetZnum: integer;
begin
Result:= Number;
end;
function TVElement.IsEqual(Obj: Pointer): Boolean;
begin
Result:= inherited IsEqual(Obj) and
(Self.fAmassMean = TVElement(Obj).fAmassMean) and
(Self.fSymbol = TVElement(Obj).fSymbol) and
(Self.fRo = TVElement(Obj).fRo) and
(Self.fksi = TVElement(Obj).fksi) and
(Self.fSigmaS = TVElement(Obj).fSigmaS) and
(Self.fRI = TVElement(Obj).fRI) and
(Self.fSigmaA = TVElement(Obj).fSigmaA);
end;
constructor TVElement.Load(S: TVStream; Version: Word);
begin
inherited;
with Self, S do
begin
S.read(fAmassMean, SizeOf(fAmassMean));
S.read(fSymbol, SizeOf(fSymbol));
S.read(fRo, SizeOf(fRo));
S.read(fksi, SizeOf(fksi));
S.read(fSigmaS, SizeOf(fSigmaS));
S.read(fRI, SizeOf(fRI));
S.read(fSigmaA, SizeOf(fSigmaA));
end;
end;
procedure TVElement.SetSymbol(const Value: shortstring);
begin
fSymbol:= Value;
end;
procedure TVElement.SetZnum(aZnum: integer);
begin
if aZnum <> Number then
Number:= aZnum;
end;
procedure TVElement.Store(S: TVStream);
begin
inherited;
with Self, S do
begin
S.Write(fAmassMean, SizeOf(fAmassMean));
S.Write(fSymbol, SizeOf(fSymbol));
S.Write(fRo, SizeOf(fRo));
S.Write(fksi, SizeOf(fksi));
S.Write(fSigmaS, SizeOf(fSigmaS));
S.Write(fRI, SizeOf(fRI));
S.Write(fSigmaA, SizeOf(fSigmaA));
end;
end;
{ TVElementColl }
function TVElementColl.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVElementColl.Create;
begin
inherited;
GetIndexRec('Number').Descending:= False;
end;
constructor TVElementColl.Load(S: TVStream; Version: Word);
begin
inherited;
end;
procedure TVElementColl.Store(S: TVStream);
begin
inherited;
end;
{ TVDecay }
function TVDecay.Clone: Pointer;
begin
Result:= inherited Clone;
with TVDecay(Result) do
begin
fThZpA_s:= Self.fThZpA_s;
fDecayType:= Self.fDecayType;
fBranching:= Self.fBranching;
end;
end;
constructor TVDecay.Create;
begin
inherited;
end;
constructor TVDecay.CreateFromStateDecay(const aState: TNuclideState; const aDecay: TDecay);
begin
inherited Create;
with Self, aState, aDecay do
begin
if aState.Nuclide <> nil
then
Self.fThZpA_s:= 10 * (1000 * aState.Nuclide.Znum + aState.Nuclide.Amass) + aState.State;
Self.fDecayType:= aDecay.DecayType;
Self.fBranching:= aDecay.Branching;
end;
end;
function TVDecay.IsEqual(Obj: Pointer): Boolean;
begin
Result:= IsEqual(Obj) and
(Self.fThZpA_s = TVDecay(Obj).fThZpA_s) and
(Self.fDecayType = TVDecay(Obj).fDecayType) and
(Self.fBranching = TVDecay(Obj).fBranching) and
(Self.fState = TVDecay(Obj).fState);
end;
constructor TVDecay.Load(S: TVStream; Version: Word);
begin
inherited;
with Self, S do
begin
S.read(fThZpA_s, SizeOf(fThZpA_s));
S.read(fDecayType, SizeOf(fDecayType));
S.read(fBranching, SizeOf(fBranching));
end;
end;
procedure TVDecay.SetDecayType(const DecayMode: shortstring);
begin
fDecayType:= StrToDecayType(DecayMode);
end;
procedure TVDecay.Store(S: TVStream);
begin
inherited;
with Self, S do
begin
S.Write(fThZpA_s, SizeOf(fThZpA_s));
S.Write(fDecayType, SizeOf(fDecayType));
S.Write(fBranching, SizeOf(fBranching));
end;
end;
{ TVDecayColl }
function TVDecayColl.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVDecayColl.Create;
begin
inherited;
MakeIndexBy_ThZpA_s;
// MakeIndexBy_Branching;
end;
constructor TVDecayColl.Load(S: TVStream; Version: Word);
begin
inherited;
end;
function TVDecayThZpA_s_OfDecay(Item: Pointer): integer;
begin
Result:= TVDecay(Item).fThZpA_s;
end;
function CompTVDecaysThZpA_s(Item1, Item2: Pointer): integer;
var
P1, P2: TVDecay;
begin
P1:= TVDecay(Item1);
P2:= TVDecay(Item2);
if P1.fThZpA_s < P2.fThZpA_s then
Result:= -1
else if P1.fThZpA_s > P2.fThZpA_s then
Result:= 1
else
Result:= 0;
end;
procedure TVDecayColl.MakeIndexBy_ThZpA_s;
var
PIR: PTVIndexRec;
begin
CreateIndexRec(PIR);
with PIR^ do
begin
IndName:= IndexBy_ThZpA_s;
IndCompare:= CompTVDecaysThZpA_s;
Regular:= True;
Unique:= False;
IndType:= itInteger;
KeyOf_Integer:= TVDecayThZpA_s_OfDecay;
Descending:= False;
end;
AddIndex(PIR, True);
end;
function TVDecayBranching(Item: Pointer): double;
begin
Result:= TVDecay(Item).fBranching;
end;
function CompTVDecayBranching(Item1, Item2: Pointer): integer;
var
P1, P2: TVDecay;
begin
P1:= TVDecay(Item1);
P2:= TVDecay(Item2);
if P1.fBranching < P2.fBranching then
Result:= -1
else if P1.fBranching > P2.fBranching then
Result:= 1
else
Result:= 0;
end;
procedure TVDecayColl.RemoveLink(const LinkID: ShortString);
var
I: integer;
begin
// inherited;// QQQQ was override;
TVUniCollection(Self).RemoveLink(LinkID);
if Q_SameText(LinkID, ThZpA_s_Link) then
for I:= 0 to Count - 1 do
TVDecay(List^[I]).fState:= nil
else
RaiseLinkIDNotIdentified(Self, LinkID);
end;
procedure TVDecayColl.Store(S: TVStream);
begin
inherited;
end;
procedure TVDecayColl.UpdateLink(const LinkID: ShortString; AColl: TVUniCollection);
var
I, J: integer;
StateColl, PB: TVStateColl;
begin
// inherited; // QQQQ was override;
TVUniCollection(Self).UpdateLink(LinkID, AColl);
if Q_SameText(LinkID, ThZpA_s_Link) then
begin
StateColl:= TVStateColl(AColl);
PB:= TVStateColl(StateColl.Bin);
for I:= 0 to Count - 1 do
TVDecay(List^[I]).fState:= nil;
for I:= 0 to Count - 1 do
with TVDecay(List^[I]) do
if fState = nil then
begin
fState:= TVState(StateColl.SearchNumberObj(fThZpA_s));
if fState <> nil then
begin
for J:= I + 1 to Count - 1 do
if TVDecay(List^[J]).fThZpA_s = fThZpA_s then
TVDecay(List^[J]).fState:= fState;
end
else if PB <> nil then
fState:= TVState(PB.SearchNumberObj(fThZpA_s));
end;
end
else
RaiseLinkIDNotIdentified(Self, LinkID);
end;
{ TVAbundance }
function TVAbundance.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVAbundance.Create;
begin
inherited;
end;
function TVAbundance.GetThZpA: integer;
begin
Result:= Number;
end;
function TVAbundance.IsEqual(Obj: Pointer): Boolean;
begin
Result:= inherited IsEqual(Obj) and
(Self.fAbundance = TVAbundance(Obj).fAbundance);
end;
constructor TVAbundance.Load(S: TVStream; Version: Word);
begin
inherited;
S.read(fAbundance, SizeOf(fAbundance));
end;
procedure TVAbundance.SetThZpA(aThZpA: integer);
begin
if aThZpA <> Number then
Number:= aThZpA;
end;
procedure TVAbundance.Store(S: TVStream);
begin
inherited;
S.Write(fAbundance, SizeOf(fAbundance));
end;
{ TVAbundanceColl }
function TVAbundanceColl.Clone: Pointer;
begin
Result:= inherited Clone;
end;
constructor TVAbundanceColl.Create;
begin
inherited;
GetIndexRec('Number').Descending:= False;
// qq MakeIndexBy_Abundance;
end;
constructor TVAbundanceColl.Load(S: TVStream; Version: Word);
begin
inherited;
end;
function CompTVStatesAbundance(Item1, Item2: Pointer): integer;
var
P1, P2: TVAbundance;
begin
P1:= TVAbundance(Item1);
P2:= TVAbundance(Item2);
if P1.fAbundance < P2.fAbundance then
Result:= -1
else if P1.fAbundance > P2.fAbundance then
Result:= 1
else
Result:= 0;
end;
function TVAbundanceOfState(Item: Pointer): double;
begin
Result:= TVAbundance(Item).fAbundance;
end;
procedure TVAbundanceColl.Store(S: TVStream);
begin
inherited;
end;
{ TVSigmaF }
function TVSigmaF.Clone: Pointer;
begin
Result:= inherited Clone;
with TVSigmaF(Result) do
begin
fSigma:= Self.fSigma;
end;
end;
constructor TVSigmaF.Create;
begin
inherited;
end;
function TVSigmaF.IsEqual(Obj: Pointer): Boolean;
begin
Result:= IsEqual(Obj) and
(Self.fSigma = TVSigmaF(Obj).fSigma);
end;
constructor TVSigmaF.Load(S: TVStream; Version: Word);
begin
inherited;
with Self, S do
begin
S.read(fSigma, SizeOf(fSigma));
end;
end;
procedure TVSigmaF.Store(S: TVStream);
begin
inherited;
with Self, S do
begin
S.Write(fSigma, SizeOf(fSigma));