I am tracing a bug in ViewFactors.c:
I have the following debug code in the "static void IntegrateFromGeometry"
Code: Select all
fprintf( stdout, "Debug: ViewFactorCompute: ");
fflush( stdout );
(*ViewFactorCompute[Elements[i].GeometryType])( &Elements[i],&Elements[j],0,0 );
fprintf( stdout, "Debug: ComputeViewFactorValue\n: ");
fflush( stdout );
Fact = ComputeViewFactorValue( &Elements[i],0 );
fprintf( stdout, "Debug: ComputeViewFactorValue done\n: ");
fflush( stdout );
fprintf( stdout, "Debug: Factor 1 assignment:\n: ");
fflush( stdout );
Factors[i*N+j] = Fact / Elements[i].Area;
fprintf( stdout, "Debug: Factor 1 assignment done\n: ");
fflush( stdout );
fprintf( stdout, "Debug: Factor 2 assignment:\n: ");
fflush( stdout );
fprintf( stdout, "Debug: N = %d, j*N+i = %d \n:", N, j*N+i);
fflush( stdout );
fprintf( stdout, "Debug: j = %d, Fact = %f, Elements[j].area = %f \n:", j, Fact, Elements[j].Area);
fflush( stdout );
fprintf( stdout, "Debug: Fact / Elements[j].area = %f \n:", Fact / Elements[j].Area);
fflush( stdout );
Factors[j*N+i] = Fact / Elements[j].Area;
fprintf( stdout, "Debug: Factor 2 assignment done\n: ");
fflush( stdout );
Code: Select all
: j = 9717: Debug: ViewFactorCompute: Debug: ComputeViewFactorValue
: Debug: ComputeViewFactorValue done
: Debug: Factor 1 assignment:
: Debug: Factor 1 assignment done
: Debug: Factor 2 assignment:
: Debug: N = 97473, j*N+i = 947145141
:Debug: j = 9717, Fact = 0.000000, Elements[j].area = 0.000737
:Debug: Fact / Elements[j].area = 0.000000
:Segmentation fault (core dumped)
Please advice!
Cheers,
Eelis