[关闭]
@guoxs 2017-03-11T09:17:24.000000Z 字数 3066 阅读 796

Pseudo-code

Zeolite


GenerateLTA

  1. GenerateLTA(HEAD,L,N)
  2. INPUT: HEAD(the head of linklist), L(layer), N(number of nodes)
  3. OUTPUT: The LinkList which represents the structure of LTA
  4. Initialise(HEAD); (Add N emputy nodes in linklist)
  5. i = 1;
  6. while i <= L:
  7. add 4 bonds of each node in layer i;
  8. complete the loop configuration of each node in layer i;
  9. add 4 bond labels of each node in layer i;
  10. if i > 2 :
  11. close the 6-numbered ring of each node in layer i-2;
  12. if i > 3 :
  13. close the 8-numbered ring of each node in layer i-3;
  14. compute the number of nodes in layer i+1;
  15. exchange nodes deleted in ring closing with nodes which do not belong to layer i+1;
  16. i=i+1;
  17. return HEAD;

add 4 bond labels of node:

  1. AddBondLabels(HEAD,node,labels)
  2. INPUT: HEAD(the head of linklist),node(node to complete bonds lebels),labels={446,446,448,668};
  3. OUTPUT: HEAD
  4. if Loop Configuration of node is complete :
  5. bonds = node.bonds;
  6. while bonds != null :
  7. if bonds.hasLabel:
  8. remove the type of label in bonds from labels;
  9. bonds = bonds.next;
  10. switch labels.length:
  11. case 1:
  12. set the bond wothout label of labels[0];
  13. break;
  14. case 2,3,4:
  15. if label of 668 in labels:
  16. set label 668 in bonds;
  17. set the other bond labels;
  18. break;
  19. return HEAD;

close the 6-numbered ring

  1. closeHexRing(HEAD,node,labels)
  2. INPUT: HEAD(the head of linklist),node(node to complete bonds lebels),labels={446,446,448,668};
  3. OUTPUT: the count of ring that closed
  4. if four bonds labels are not completed :
  5. return 0;
  6. closeRingCount = 0;
  7. bonds = {bond668,bond446_1,bond446_2};
  8. path = {};
  9. i = 1;
  10. for i <= 2:
  11. bond1 = bonds[0], bond2 = bonds[i];
  12. if both bond1 and bond2 are not in any 6-numbered ring :
  13. while path.length <= 6 :
  14. if bond1 != null && bond2 != null:
  15. path.add(bond1.bond2);
  16. else
  17. break;
  18. if bond1.label == 668:
  19. from bond1 get bond3 of label 446 in next layer;
  20. from bond2 get bond4 of label 668 in next layer;
  21. else if bond1.label == 446:
  22. from bond1 get bond3 of label 668 in next layer;
  23. from bond2 get bond4 of label 446 in next layer;
  24. bond1 = bond3;
  25. bond2 = bond4;
  26. mark all bonds in path in 6-numbered ring;
  27. node1 = path[5].toNode, node2 = path[6].toNode;
  28. if node1 == node2:
  29. return 0;
  30. append the information of node2 to node1 and empty node2;
  31. closeRingCount++;
  32. return closeRingCount;

close the 8-numbered ring

  1. closeOctRing(HEAD,node,labels)
  2. INPUT: HEAD(the head of linklist),node(node to complete bonds lebels),labels={446,446,448,668};
  3. OUTPUT: the count of ring that closed
  4. if four bonds labels are not completed :
  5. return 0;
  6. closeRingCount = 0;
  7. bond1 = bond668, bond2 = bond446;
  8. path = {};
  9. while path.length <= 8:
  10. if bond1 != null && bond2 != null:
  11. path.add(bond1.bond2);
  12. if bond1.label == 668:
  13. from bond1 get bond3 of label 448 in next layer;
  14. from bond2 get bond4 of label 668 in next layer;
  15. else if bond1.label == 448:
  16. from bond1 get bond3 of label 668 in next layer;
  17. from bond2 get bond4 of label 448 in next layer;
  18. bond1 = bond3;
  19. bond2 = bond4;
  20. node1 = path[7].toNode, node2 = path[8].toNode;
  21. if node1 == node2:
  22. return 0;
  23. append the information of node2 to node1 and empty node2;
  24. closeRingCount++;
  25. return closeRingCount;

Embedding

  1. origin = {sqrt(2) / 2.0,0.0,sqrt(2)};
  2. Xlta = { 0.0, -sqrt(2) / 2.0, sqrt(2) };
  3. Ylta = { 0.0, sqrt(2) / 2.0, sqrt(2) };
  4. Zlta = { sqrt(2) / 2.0, 0.0, sqrt(2)+1.0 };
  5. Plta = { sqrt(2), 0, sqrt(2) / 2.0 };
  6. embeddingLTA(HEAD,length)
  7. INPUT: HEAD(the head of linklist), length(bond length);
  8. OUTPUT: the linklist of LTA
  9. node = HEAD.next;
  10. if node == null:
  11. return null;
  12. node.coordinate = origin;
  13. set four nodes coordinate in layer 2 from Xlta, Ylta, Zlta, Plta according to bond label;
  14. while node.vs != null && node.vs is complete :
  15. for ring in node.vs:
  16. compute coordinate of nodes in ring;
  17. node = node.next;
  18. return HEAD

PeriodDetection

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注