├── 0_include.h ├── 2_globals.h ├── main.c ├── input.txt ├── 1_objects.h ├── README └── 3_functions.h /0_include.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void * malloc(size_t); 5 | void free(void *); 6 | void exit(int); 7 | -------------------------------------------------------------------------------- /2_globals.h: -------------------------------------------------------------------------------- 1 | /////////////// model ////////////////////////////////// 2 | int TotInterTypes; //total interaction types 3 | struct interaction * I; //'I[...]' contains all the interaction types from the input file; interaction type k is represented by I[k]; 4 | 5 | /////////////// process //////////////////////////////// 6 | int TotExterParticles; 7 | struct particleType P[MAX_E_PARTICLES]; //'P[...]' contains all the external particles from the input file 8 | int TotLoops; 9 | int TotVertices; 10 | 11 | /////////////// feynman diagram //////////////////////// 12 | struct feynDiagram FD; 13 | int FDCount=0; 14 | 15 | /////////////// output file //////////////////////////// 16 | FILE * FileOut; -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | #include "0_include.h" 2 | #include "1_objects.h" 3 | #include "2_globals.h" 4 | #include "3_functions.h" 5 | 6 | main() 7 | { 8 | int i; 9 | FileOut=fopen("output-feynman-diagrams.txt","w"); 10 | ////// obtain the information from the input file /////// 11 | ////// and rewrite them on the output file as a check /// 12 | obtainInput(); 13 | writeOutputHead(); 14 | ////// initialize the Feynman diagram /////////////////// 15 | for(i=0; i>> 9 | 9 10 | list of the interactions >>> 11 | 3> F1 F-1 U1:1 12 | 3> F2 F-2 U1:1 13 | 3> F3 F-3 U1:1 14 | 3> F4 F-4 U1:1 15 | 3> F5 F-5 U1:1 16 | 3> F6 F-6 U1:1 17 | 1> U1:3 18 | 1> U1:4 19 | 3> U1:1 C1:1 C-1:1 20 | 21 | ============================================================================ 22 | The physical process 23 | ============================================================================ 24 | total number of incoming and outgoing particles >>> 25 | 4 26 | the incoming and outgoing particles >>> 27 | 2> F1 F-1 28 | 2> F5 F-5 29 | total loops >>> 30 | 2 31 | -------------------------------------------------------------------------------- /1_objects.h: -------------------------------------------------------------------------------- 1 | /////////////// for model and process ////////////////// 2 | #define MAX_V_LEGTYPES 10 //max leg types of each interaction vertex, e.g. in (F1 F-1 U1:2) there are three leg types 3 | #define MAX_V_LEGS 30 //max legs of each interaction vertex, e.g. in (F1 F-1 U1:2) there are four legs 4 | 5 | struct particleType{ //this struct is used to describe a particle, e.g. 'F1' is described as: BorF='F', ID=1. 6 | char BorF; //Boson 'U'/'C' or Fermion 'F'; 7 | int ID; //the particle type (ID number); 8 | }; 9 | 10 | struct interaction{ //this struct is used to describe a interaction term, e.g. (F1 F-1 U1:2) has totLegTypes=3, totLegs=4... 11 | int totLegs; 12 | int totLegTypes; 13 | struct particleType legType[MAX_V_LEGTYPES]; 14 | int multip[MAX_V_LEGTYPES]; //multiplicity of each leg type; 15 | }; //Note, multiplicity of the fermion particle should never be larger than 1 in this program 16 | 17 | /////////////// for feynman diagram //////////////////// 18 | #define MAX_E_PARTICLES 100 //max external particles 19 | #define MAX_I_VERTICES 50 //max internal interaction vertices 20 | 21 | struct feynDiagExterPar{ //this struct describes how an external particle in the Feynman diagram is connected to a vertex 22 | int toVert; //the vertex (ID number) this external particle point to 23 | int toLegTyp; //the leg type (ID number) of the vertex this external particle point to 24 | }; 25 | 26 | struct feynDiagVertex{ //this struct describes the temporary state of an internal vertex and how the vertex is conncected to another vertex 27 | int interType; //the interaction type (ID number) of this vertex; 28 | int multip[MAX_V_LEGTYPES]; //the remaining multiplicity of each leg type after being taken (being pointed to by others). 29 | int totTo; 30 | int toVert[MAX_V_LEGS]; //similar as the 'toVert' in struct feynDiagExternal 31 | int toLegTyp[MAX_V_LEGS]; //similar as the 'toLeg' in struct feynDiagExternal 32 | int thisLegTyp[MAX_V_LEGS]; // 33 | }; 34 | 35 | typedef 36 | struct feynDiagram{ 37 | struct feynDiagExterPar fP[MAX_E_PARTICLES]; 38 | struct feynDiagVertex fV[MAX_I_VERTICES]; 39 | int symmetryFactor; 40 | int fermionSign; 41 | int bookMark; //used to identify the stage of the traversing process. 42 | } feynDiag; 43 | 44 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ******************************************** 2 | * C Program for Feynman Diagram Generation 3 | * 4 | * XIAO Bo (homenature@163.com), and 5 | * WANG Hao (hwang.phy@gmail.com) 6 | * 7 | * http://arxiv/abs/1209.0949 8 | ******************************************** 9 | 10 | ********************* 11 | * introduction * 12 | ********************* 13 | 14 | This is the source code of a C program for automatic Feynman diagrams generation. 15 | It is supposed to be used by the high energy particle physists. 16 | 17 | Advantage of this program: 18 | 1. It is small in size and run fast: 19 | 3860 Feynman diagrams of 'u + ubar --> t + tbar' at two loop order in QCD model 20 | can be generated in 0.015 seconds in a normal PC. 21 | 2. Yet it is a totally general Feynman diagram generator: 22 | it receives arbitrary user defined model and arbitrary process as input and 23 | generates Feynman diagrams at any order. 24 | 3. Symmetry factors from identical fields and signs from fermion exchanging can 25 | be naturely generated. 26 | 27 | The physical background and the algorithm adopted in this C program 28 | can be found at its companion paper: 29 | http://arxiv/abs/1209.0949 30 | 31 | 32 | ********************* 33 | * how to use * 34 | ********************* 35 | 36 | 1. Compile the source code and get an excutable file. 37 | 2. Put the excutable file and the input file "input.txt" in the same directory. 38 | 3. Modify the "input.txt" according to your needs (see below). 39 | 3. Run the excutable file. 40 | 4. The results are contained in the generated output file "output-feynman-diagrams.txt" (see below). 41 | 42 | 43 | ********************* 44 | * the input file * 45 | ********************* 46 | 47 | The user needs to modify the input file, named "input.txt", to describe the 48 | the physical model, scattering process, and the interaction order (loops). 49 | For example, to generate the Feynman diagrams of the process of 50 | u + ubar --> t + tbar 51 | at 1-loop order under the physical model of QED, the input file goes like: 52 | 53 | ### input file begin ### 54 | ============================================================================ 55 | The physical model (i.e. the relevent interactions) 56 | instructions: 57 | 'U' means a Boson having no charge, i.e. it has no antiparticle, e.g. photon 58 | 'C' means a Boson which has antiparticle, e.g. W+ and W- 59 | 'F' means a Fermion 60 | ============================================================================ 61 | total number of interactions >>> 62 | 2 63 | list of the interactions >>> 64 | 3> F1 F-1 U1:1 65 | 3> F2 F-2 U1:1 66 | 67 | ============================================================================ 68 | The physical process 69 | ============================================================================ 70 | total number of incoming and outgoing particles >>> 71 | 4 72 | the incoming and outgoing particles >>> 73 | 2> F1 F-1 74 | 2> F2 F-2 75 | total loops >>> 76 | 1 77 | ### input file end ### 78 | 79 | Explanations of the above input file: 80 | 1) The user needs to fill the informations under each label line "...>>>". 81 | 2) There are 2 interaction terms 'u-ubar-photon' and 't-tbar-photon' 82 | for the scattering process of 'u + ubar --> t + tbar' under QED. 83 | So, under the first label line "total number of interactions >>>" we 84 | write a "2". 85 | 3) Under the "list of the interactions >>>", we list the 2 interaction terms 86 | 'u-ubar-photon' and 't-tbar-photon' one by one as "3> F1 F-1 U1:1" and 87 | "3> F2 F-2 U1:1". 88 | 3.1) '?>' at the front of a line is a pre-information to tell the program 89 | how many 'word's follow in this line. 90 | 3.2) 'F1' represents an u quark. The user can use an arbitary integer number 91 | in 'F?' to represents the u quark, e.g. F888, F123. 92 | 'F-1' represents an anti u quark. The number in 'F-n' must be the same as 93 | the number in its anti partner 'Fn'. 94 | 'F2' and 'F-2' represent t quark and anti t quark, where the number '2' 95 | is also chosen at random. 96 | 3.3) 'U1' represents an photon, where the number '1' is chosen at random. 97 | 'Un' must be tightly followed by a ':m', where 'm' describe the multiplicity 98 | of 'Un' in an interaction term. In the interaction term 'u-ubar-photon', the 99 | multiplicity of the photon is '1', so 'Un:1' is written. 100 | 3.4) A fermion 'Fn' is not allowed to be followed by a ':m'. 101 | If one wants to write an interaction term composed of multiple identical "fermion"s, 102 | for example, 'e- e- mu+ mu+', one should write the input as 103 | "4> F1 F1 F-2 F-2" instead of "2> F1:2 F-2:2". 104 | See "http://arxiv/abs/1209.0949" for explanations. 105 | 4) After telling the program that there are totally 4 external particles under the 106 | label line "total number of incoming and outgoing particles >>>", 107 | the user should list the 4 incoming and outgoing particles under the label line 108 | "the incoming and outgoing particles >>>". 109 | The "2> F1 F-1" tells that there are two incoming particles u quark and anti u quark, 110 | The "2> F2 F-2" tells that there are two outgoing particles t quark and anti t quark. 111 | 5) Finally, the number of loops is given. 112 | For tree-level, the total loops are set to be '0'. 113 | 114 | One more example. 115 | Generating the Feynman diagrams of the process of 116 | u + ubar --> t + tbar 117 | at 2-loop order with the physical model of QCD. The input file is: 118 | 119 | ### input file begin ### 120 | ============================================================================ 121 | The physical model (i.e. the relevent interactions) 122 | instructions: 123 | 'U' means a Boson having no charge, i.e. it has no antiparticle, e.g. photon 124 | 'C' means a Boson which has antiparticle, e.g. W+ and W- 125 | 'F' means a Fermion 126 | ============================================================================ 127 | total number of interactions >>> 128 | 9 129 | list of the interactions >>> 130 | 3> F1 F-1 U1:1 131 | 3> F2 F-2 U1:1 132 | 3> F3 F-3 U1:1 133 | 3> F4 F-4 U1:1 134 | 3> F5 F-5 U1:1 135 | 3> F6 F-6 U1:1 136 | 1> U1:3 137 | 1> U1:4 138 | 3> U1:1 C1:1 C-1:1 139 | 140 | ============================================================================ 141 | The physical process 142 | ============================================================================ 143 | total number of incoming and outgoing particles >>> 144 | 4 145 | the incoming and outgoing particles >>> 146 | 2> F1 F-1 147 | 2> F5 F-5 148 | total loops >>> 149 | 2 150 | ### input file end ### 151 | 152 | Explanations of the input file: 153 | 1) "1> U1:3" represents an three-gluon self interaction term. 154 | 2) "3> U1:1 C1:1 C-1:1" represents an 'gluon-ghost-ghost' interaction term. 155 | 3) The 9 interaction terms listed under "list of the interactions >>>" 156 | can be put in random order. 157 | 4) We use F1 to present u quark and F5 to present t quark. 158 | 159 | 160 | ********************* 161 | * the output file * 162 | ********************* 163 | 164 | An output file corresponding to the second input file example above is 165 | 166 | ### output file begin ### 167 | ============================================================================ 168 | The physical model (i.e. the relevent interactions) 169 | ============================================================================ 170 | >>> the interactions 171 | I1: (F1,F-1,U1:1) 172 | I2: (F2,F-2,U1:1) 173 | I3: (F3,F-3,U1:1) 174 | I4: (F4,F-4,U1:1) 175 | I5: (F5,F-5,U1:1) 176 | I6: (F6,F-6,U1:1) 177 | I7: (U1:3) 178 | I8: (U1:4) 179 | I9: (U1:1,C1:1,C-1:1) 180 | 181 | ============================================================================ 182 | The physical process 183 | ============================================================================ 184 | >>> the external particles 185 | P1: (F-1) 186 | P2: (F1) 187 | P3: (F5) 188 | P4: (F-5) 189 | >>> the internal vertices 190 | H1 191 | H2 192 | H3 193 | H4 194 | H5 195 | H6 196 | 197 | ============================================================================ 198 | The Feynman diagrams 199 | ============================================================================ 200 | (1) 201 | P1-->H1 (I1.leg[2]) 202 | P2-->H1 (I1.leg[1]) 203 | P3-->H2 (I5.leg[1]) 204 | P4-->H2 (I5.leg[2]) 205 | H1-->H3 (I1.leg[3]-->I1.leg[3]) 206 | H2-->H4 (I5.leg[3]-->I1.leg[3]) 207 | H3-->H4 (I1.leg[1]-->I1.leg[2]) 208 | H3-->H5 (I1.leg[2]-->I1.leg[1]) 209 | H4-->H5 (I1.leg[1]-->I1.leg[2]) 210 | H5-->H6 (I1.leg[3]-->I1.leg[3]) 211 | H6-->H6 (I1.leg[1]-->I1.leg[2]) 212 | symmetryFactor = 1 213 | fermionSign=-1 214 | ------------------------------------------------ 215 | (2) 216 | P1-->H1 (I1.leg[2]) 217 | P2-->H1 (I1.leg[1]) 218 | P3-->H2 (I5.leg[1]) 219 | P4-->H2 (I5.leg[2]) 220 | H1-->H3 (I1.leg[3]-->I1.leg[3]) 221 | H2-->H4 (I5.leg[3]-->I1.leg[3]) 222 | H3-->H4 (I1.leg[1]-->I1.leg[2]) 223 | H3-->H5 (I1.leg[2]-->I1.leg[1]) 224 | H4-->H5 (I1.leg[1]-->I1.leg[2]) 225 | H5-->H6 (I1.leg[3]-->I2.leg[3]) 226 | H6-->H6 (I2.leg[1]-->I2.leg[2]) 227 | symmetryFactor = 1 228 | fermionSign=-1 229 | ------------------------------------------------ 230 | ... 231 | ### output file end ### 232 | 233 | Explanations of the output file: 234 | 1) Firstly, the input information is reshown, 235 | and 236 | each interaction term is labeled by 'I?', 237 | each external particle is labeled by 'P?', 238 | each internal vertex is labeled by 'H?'. 239 | 2) Then, all the Feynman diagrams are listed one by one. 240 | The topology of a Feynman diagram is expressed by the relations of the 241 | external particles and internal vertices. 242 | For example, the gragh form of the topology of Feynman diagram '(1)' is 243 | 244 | * P1 P3 * 245 | * * 246 | * * * * * * * 247 | * * * * 248 | * * * * 249 | H1 ~ ~ ~ ~ ~ H3 H4 ~ ~ ~ ~ ~ H2 250 | * * * * 251 | * * * * 252 | * * * H5* * * 253 | * ~ * 254 | * P2 ~ P4 * 255 | ~ 256 | * H6* 257 | * * 258 | * * 259 | * * * 260 | 261 | The "I[?].leg[?]" in the bracket represents the interaction type of the vertex 262 | and the particle type of the line between the vertices. 263 | -------------------------------------------------------------------------------- /3_functions.h: -------------------------------------------------------------------------------- 1 | void obtainInput() 2 | { 3 | FILE * fIn=NULL; 4 | char mark[100]; 5 | int i,j,totInP,totOutP; 6 | /////////////////////////// 7 | if( (fIn=fopen("input.txt","r"))==NULL ){ 8 | printf("cannot open file 'input.txt'\n"); 9 | exit(0);} 10 | /////////////////////////// 11 | do{ 12 | fscanf(fIn,"%s",mark); 13 | if(strcmp(mark,">>>")==0){ 14 | fscanf(fIn,"%d",&TotInterTypes); 15 | I=malloc(TotInterTypes*sizeof(struct interaction)); 16 | break;} 17 | }while(!feof(fIn)); 18 | do{ 19 | fscanf(fIn,"%s",mark); 20 | if(strcmp(mark,">>>")==0){ 21 | for(i=0; i",&I[i].totLegTypes); 23 | I[i].totLegs=0; 24 | for(j=0; j>>")==0){ 39 | fscanf(fIn,"%d",&TotExterParticles); 40 | break;} 41 | }while(!feof(fIn)); 42 | do{ 43 | fscanf(fIn,"%s",mark); 44 | if(strcmp(mark,">>>")==0){ 45 | fscanf(fIn,"%d>",&totInP); 46 | for(i=0; i",&totOutP); 51 | for(i=totInP; i>>")==0){ 59 | fscanf(fIn,"%d",&TotLoops); 60 | TotVertices=(TotExterParticles-2)+2*TotLoops; 61 | break;} 62 | }while(!feof(fIn)); 63 | ///////////////////////////// 64 | fclose(fIn); 65 | } 66 | 67 | void writeOutputHead() 68 | { 69 | int i,j; 70 | /////////////////////// 71 | fprintf(FileOut,"\ 72 | ============================================================================\n\ 73 | The physical model (i.e. the relevent interactions)\n\ 74 | ============================================================================\n\ 75 | >>> the interactions\n\ 76 | "); 77 | for(i=0; i>> the external particles\n\ 90 | "); 91 | for(i=0; i>> the internal vertices\n\ 96 | "); 97 | for(i=0; i1; n--)out*=n; 111 | return(out); 112 | } 113 | 114 | void writeFeynDiag(struct feynDiagram * pFeynDiag) 115 | { 116 | int i,j,factor=1; 117 | ////////////////////////////////////////////// 118 | for(i=0; iH%d (I%d.leg[%d])\n" 120 | ,i+1 121 | ,pFeynDiag->fP[i].toVert+1 122 | ,pFeynDiag->fV[pFeynDiag->fP[i].toVert].interType+1 123 | ,pFeynDiag->fP[i].toLegTyp+1);} 124 | for(i=0; ifV[i].totTo; j++){ 126 | fprintf(FileOut, "H%d-->H%d (I%d.leg[%d]-->I%d.leg[%d])\n" 127 | ,i+1 128 | ,pFeynDiag->fV[i].toVert[j]+1 129 | ,pFeynDiag->fV[i].interType+1 130 | ,pFeynDiag->fV[i].thisLegTyp[j]+1 131 | ,pFeynDiag->fV[pFeynDiag->fV[i].toVert[j]].interType+1 132 | ,pFeynDiag->fV[i].toLegTyp[j]+1);}} 133 | fprintf(FileOut,"symmetryFactor = %d ",pFeynDiag->symmetryFactor); 134 | for(i=0; ifV[i].interType].totLegTypes; j++){ 136 | if(I[pFeynDiag->fV[i].interType].multip[j]>1){ 137 | fprintf(FileOut, "*(1/%d!", I[pFeynDiag->fV[i].interType].multip[j]); 138 | factor*=factorial(I[pFeynDiag->fV[i].interType].multip[j]); 139 | break;}} 140 | if(jfV[i].interType].totLegTypes){ 141 | for(j++; jfV[i].interType].totLegTypes; j++){ 142 | if(I[pFeynDiag->fV[i].interType].multip[j]>1){ 143 | fprintf(FileOut, "%d!", I[pFeynDiag->fV[i].interType].multip[j]); 144 | factor*=factorial(I[pFeynDiag->fV[i].interType].multip[j]);}} 145 | fprintf(FileOut, ")");}} 146 | if(factor>1)fprintf(FileOut, " = 1/%d\n", factor/=pFeynDiag->symmetryFactor); 147 | else fprintf(FileOut, "\n"); 148 | fprintf(FileOut,"fermionSign=%d\n",pFeynDiag->fermionSign); 149 | fprintf(FileOut, "------------------------------------------------\n"); 150 | } 151 | 152 | int judgeConnectivity(struct feynDiagram * pFeynDiag) 153 | { 154 | int i,j,k; 155 | int group[MAX_I_VERTICES]; 156 | int label[MAX_I_VERTICES]; 157 | int totUnSettVert1,totUnSettVert2; 158 | ///////////////////////////////// 159 | for(i=1; ifV[0].totTo; i++){ 163 | group[pFeynDiag->fV[0].toVert[i]]=1;} 164 | ///////////////////////////////// 165 | totUnSettVert1=totUnSettVert2=TotVertices-1; 166 | do{ 167 | for(i=1; ifV[i].totTo; j++){ 172 | group[pFeynDiag->fV[i].toVert[j]]=1;} 173 | label[i]=1;} 174 | else{ 175 | for(k=0; kfV[i].totTo; k++){ 176 | if(group[pFeynDiag->fV[i].toVert[k]]==1){ 177 | totUnSettVert2--; 178 | group[i]=1; 179 | for(j=0; jfV[i].totTo; j++){ 180 | group[pFeynDiag->fV[i].toVert[j]]=1;} 181 | label[i]=1; 182 | break;}}}}} 183 | if(totUnSettVert2==0)return(1); 184 | if(totUnSettVert2==totUnSettVert1)return(0); 185 | totUnSettVert1=totUnSettVert2; 186 | }while(1); 187 | ///////////////////////////////// 188 | return(0); 189 | } 190 | 191 | void finishADiag() 192 | { 193 | if(judgeConnectivity(&FD)==1){ 194 | fprintf(FileOut, "(%d)\n", ++FDCount); 195 | writeFeynDiag(&FD);} 196 | } 197 | 198 | int fermionAcrossSign(int startVN, int startVL, int endVN, int endVL) 199 | { 200 | int sign=1; 201 | int i,j,jStart,jEnd; 202 | /////////////////////////////// 203 | if(startVN<0){ 204 | for(i=0; i<=endVN; i++){ 205 | if(i==endVN)jEnd=endVL-1; 206 | else jEnd=I[FD.fV[i].interType].totLegTypes; 207 | for(j=0; j<=jEnd; j++){ 208 | if(I[FD.fV[i].interType].legType[j].BorF=='F' && FD.fV[i].multip[j]==1)sign*=(-1);}}} 209 | else{ 210 | /////////////////////////////// 211 | for(i=startVN; i<=endVN; i++){ 212 | if(i==startVN)jStart=startVL+1; 213 | else jStart=0; 214 | if(i==endVN)jEnd=endVL-1; 215 | else jEnd=I[FD.fV[i].interType].totLegTypes; 216 | for(j=jStart; j<=jEnd; j++){ 217 | if(I[FD.fV[i].interType].legType[j].BorF=='F' && FD.fV[i].multip[j]==1)sign*=(-1);}} 218 | if(I[FD.fV[endVN].interType].legType[endVL].ID<0)sign*=(-1);} 219 | //////////////////// 220 | return(sign); 221 | } 222 | 223 | 224 | void tryPairing(int bookMarkJump, int thisVN, int thisVL, int toVN, int toVL) 225 | { 226 | if(FD.bookMark0){ 282 | thisVert=i; 283 | thisLegTyp=j; 284 | thisBorF=I[FD.fV[thisVert].interType].legType[thisLegTyp].BorF; 285 | thisID=I[FD.fV[thisVert].interType].legType[thisLegTyp].ID; 286 | if(I[FD.fV[thisVert].interType].legType[thisLegTyp].BorF!='U')thisID*=(-1); 287 | FD.fV[thisVert].multip[thisLegTyp]--; 288 | bookMarkJump=thisVert+TotExterParticles-FD.bookMark; 289 | toVert0 =thisVert; 290 | toLegTyp0=thisLegTyp; 291 | break;}}} 292 | ////////////////// 293 | if(thisVert==-1){ //if (thisVert.thisLegTyp) is not find in the above, this means all the fields have been paired, i.e. a Feynman diagram is finished. 294 | finishADiag(); 295 | return;}} 296 | ////////////////////////////////////// 297 | for(i=toVert0; i=0){ 299 | k=FD.fV[i].interType; 300 | for(j=(i==toVert0?toLegTyp0:0); j0 && thisBorF==I[k].legType[j].BorF && thisID==I[k].legType[j].ID){ 302 | tryPairing(bookMarkJump, thisVert, thisLegTyp, i, j); 303 | feynTraverse(); 304 | unTryPairing(bookMarkJump, thisVert, thisLegTyp, i, j);}}} 305 | else{ //this means the interaction vertex for connecting is "new" 306 | for(k=0; k=TotVertices-(I[k].totLegs-3))continue; 308 | for(j=0; j=TotExterParticles){ //additional operations that help resuming to the state before the connection try. 321 | FD.fV[thisVert].multip[thisLegTyp]++;} 322 | } 323 | --------------------------------------------------------------------------------