Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions check/features.frm
Original file line number Diff line number Diff line change
Expand Up @@ -3101,3 +3101,47 @@ Local test = diagrams_(PHI3,{phi},{phi},{q1,q2},{},1,0);
#pend_if mpi?
assert runtime_error?('Insufficient internal momenta in diagrams_')
*--#] diagrams_err_4 :
*--#[ diagrams_err_5 :
Vector q1,q2,p1,p2;
Model PHI3;
Particle phi,1;
Vertex phi,phi,phi:g;
EndModel;
Local test = diagrams_(PHI3,{phi},{phi},{q1,-q2},{p1,p2},1,0);
.end
#pend_if mpi?
assert runtime_error?('Invalid negative external momentum in diagrams_: -q2')
*--#] diagrams_err_5 :
*--#[ diagrams_err_6 :
Vector q1,q2,p1,p2;
Model PHI3;
Particle phi,1;
Vertex phi,phi,phi:g;
EndModel;
Local test = diagrams_(PHI3,{phi},{phi},{q1,q2},{-p1,p2},1,0);
.end
#pend_if mpi?
assert runtime_error?('Invalid negative internal momentum in diagrams_: -p1')
*--#] diagrams_err_6 :
*--#[ diagrams_err_7 :
Vector q1,q2,p1,p2;
Model PHI3;
Particle phi,1;
Vertex phi,phi,phi:g;
EndModel;
Local test = diagrams_(PHI3,{phi},{phi},{q1,q1},{p1,p2},1,0);
.end
#pend_if mpi?
assert runtime_error?('Invalid repeated momentum in diagrams_: q1')
*--#] diagrams_err_7 :
*--#[ diagrams_err_8 :
Vector q1,q2,p1,p2;
Model PHI3;
Particle phi,1;
Vertex phi,phi,phi:g;
EndModel;
Local test = diagrams_(PHI3,{phi},{phi},{q1,q2},{q1,p2},1,0);
.end
#pend_if mpi?
assert runtime_error?('Invalid repeated momentum in diagrams_: q1')
*--#] diagrams_err_8 :
8 changes: 8 additions & 0 deletions doc/manual/statements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3833,6 +3833,10 @@ \section{off}
\leftvitem{3.5cm}{flint\index{off!flint}}
\rightvitem{13cm}{Disables the interface to FLINT; use FORM's built-in
polynomial routines.}

\leftvitem{3.5cm}{grccverbose\index{off!grccverbose}}
\rightvitem{13cm}{Disables extra print statements from the diagram generator.
This is the default.}

\leftvitem{3.5cm}{highfirst\index{off!highfirst}}
\rightvitem{13cm}{Puts the sorting in a low first mode.}
Expand Down Expand Up @@ -4038,6 +4042,10 @@ \section{on}
and when using Modulus\index{modulus} (\ref{substamodulus}) mode.
Note that occasionally the overall sign of gcd\_ may differ from that of the
built-in routine.}

\leftvitem{3.5cm}{grccverbose\index{on!grccverbose}}
\rightvitem{13cm}{Enable extra print statements from the diagram generator.
Useful for debugging error messages. Default is off.}

\leftvitem{3.5cm}{highfirst\index{on!highfirst}}
\rightvitem{13cm}{In this mode polynomials are sorted in a way that high
Expand Down
1 change: 1 addition & 0 deletions sources/compcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ static KEYWORDV onoffoptions[] = {
,{"flint", &(AC.FlintPolyFlag), 1, 0}
,{"humanstats", &(AC.HumanStatsFlag), 1, 0}
,{"humanstatistics", &(AC.HumanStatsFlag), 1, 0}
,{"grccverbose", &(AC.GrccVerbose), 1, 0}
};

static WORD one = 1;
Expand Down
54 changes: 48 additions & 6 deletions sources/diawrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern "C" {

#include "grccparam.h"
#include "grcc.h"
#include <map>

#define MAXPOINTS 120

Expand Down Expand Up @@ -809,12 +810,13 @@ int GenDiagrams(PHEAD WORD *term, WORD level)
Options *opt;
Process *proc;
int pid = 1, x;
int babble = 0; // Later we may set this at the FORM code level
int babble = AC.GrccVerbose ? 2 : 0;
TERMINFO info;
WORD inset,outset,*coupl,setnum,optionnumber = 0;
int i, j, cpl[GRCC_MAXNCPLG];
int ninitl, initlPart[GRCC_MAXLEGS], nfinal, finalPart[GRCC_MAXLEGS];
for ( i = 0; i < GRCC_MAXNCPLG; i++ ) cpl[i] = 0;
std::map<int,int> momlist;
//
// Here we create an object of type Option and load it up.
// Next we run the diagram generation on it.
Expand Down Expand Up @@ -894,20 +896,60 @@ int GenDiagrams(PHEAD WORD *term, WORD level)
info.legcouple[i+ninitl] = m->vertices[numParticle(m,x)]->couplings;
}
info.numextern = ninitl + nfinal;
for ( i = 2; i <= MAXLEGS; i++ ) {
if ( m->legcouple[i] == 1 ) {
for ( j = 0; j < info.numextern; j++ ) {
if ( info.legcouple[j][i] == 0 ) { info.flags |= CHECKEXTERN; goto Go_on; }
}
}
}

// Check that we have sufficient external momenta in the set:
if ( info.numextern > Sets[info.externalset].last - Sets[info.externalset].first ) {
MLOCK(ErrorMessageLock);
MesPrint("&Insufficient external momenta in diagrams_");
MUNLOCK(ErrorMessageLock);
Terminate(-1);
}
for ( i = 2; i <= MAXLEGS; i++ ) {
if ( m->legcouple[i] == 1 ) {
for ( j = 0; j < info.numextern; j++ ) {
if ( info.legcouple[j][i] == 0 ) { info.flags |= CHECKEXTERN; goto Go_on; }
}

// Check that none of the supplied momenta are negative or repeated:
for ( i = 0; i < Sets[info.externalset].last - Sets[info.externalset].first; i++ ) {
const int momcode = SetElements[Sets[info.externalset].first + i];
if ( momcode < AM.OffsetVector ) {
MLOCK(ErrorMessageLock);
MesPrint("&Invalid negative external momentum in diagrams_: -%s",
VARNAME(vectors, momcode+WILDMASK-AM.OffsetVector));
MUNLOCK(ErrorMessageLock);
Terminate(-1);
}
momlist[momcode]++;
if ( momlist[momcode] != 1 ) {
MLOCK(ErrorMessageLock);
MesPrint("&Invalid repeated momentum in diagrams_: %s",
VARNAME(vectors, momcode-AM.OffsetVector));
MUNLOCK(ErrorMessageLock);
Terminate(-1);
}
}
for ( i = 0; i < Sets[info.internalset].last - Sets[info.internalset].first; i++ ) {
const int momcode = SetElements[Sets[info.internalset].first + i];
if ( momcode < AM.OffsetVector ) {
MLOCK(ErrorMessageLock);
MesPrint("&Invalid negative internal momentum in diagrams_: -%s",
VARNAME(vectors, momcode+WILDMASK-AM.OffsetVector));
MUNLOCK(ErrorMessageLock);
Terminate(-1);
}
momlist[momcode]++;
if ( momlist[momcode] != 1 ) {
MLOCK(ErrorMessageLock);
MesPrint("&Invalid repeated momentum in diagrams_: %s",
VARNAME(vectors, momcode-AM.OffsetVector));
MUNLOCK(ErrorMessageLock);
Terminate(-1);
}
}

Go_on:;
//
// Now we have to sort out the coupling constants.
Expand Down
3 changes: 2 additions & 1 deletion sources/grcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,7 @@ void Model::addInteraction(IInput *iinp)
grcc_fprintf(GRCC_Stderr, "*** illegal coupling const : ");
grcc_fprintf(GRCC_Stderr, "nlegs - 2 + 2*loop: 2*loop = %d\n", lp2);
}
erEnd("illegal value of c-constants");
}
lp = lp2/2;

Expand Down Expand Up @@ -10590,7 +10591,7 @@ static void grcc_fprintf(FILE* out, const char* fmt, ...)
char *buffer = new char[len+1];
vsnprintf(buffer, len+1, fmt, args_copy);
MLOCK(ErrorMessageLock);
MesPrint("%s", buffer);
MesPrint("%s%", buffer);
MUNLOCK(ErrorMessageLock);
delete[] buffer;
va_end(args_copy);
Expand Down
1 change: 1 addition & 0 deletions sources/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,7 @@ struct C_const {
int PrintBacktraceFlag; /* Print backtrace on terminate? */
int FlintPolyFlag; /* Use Flint for polynomial arithmetic */
int HumanStatsFlag; /* Print human-readable stats in the stats print? */
int GrccVerbose; /* Enable extra print statements in grcc? */
int doloopstacksize;
int dolooplevel;
int CheckpointFlag; /**< Tells preprocessor whether checkpoint code must executed.
Expand Down
Loading