multiplication printstack error
Hello
I declared two volScalarfields in createFields.H, namely: Code:
volScalarField r Code:
volScalarField faceCellDist Code:
const surfaceVectorField& Cf = mesh.Cf(); and the initial value for "r": Code:
r=r*id.value()/2; My printStack (multiply) error comes when I do: Code:
r*faceCellDist Vrede |
printStack is not the error. What is the error? Was it a segmentation fault? (SigSEGV) or a floating point error? (SigFPE) The forAll(own, I) loop will cause a segmentation fault when it reaches the final index (i = faceCellDist.size()-1)... because I+1 will be out of range.
|
Good morning David.
Thank you for the quick reply. The error is as follows: #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 void Foam::multiply<Foam::fvPatchField>(Foam::FieldFiel d<Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, Foam::FieldField<Foam::fvPatchField, double> const&) at ??:? #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #6 at ??:? #7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #8 at ??:? Segmentation fault (core dumped) Weirdly enough, the forAll loop does not give me an error, since it run successfully through the loop. Note: When I did this for a "1D" test case (shock tube tutorial of rhoCentralFoam), I did not have this error. Only when I went to "2D" (30 cells in x-dir, 3 in y-dir and 1 cell in z-dir) that this error showed. Kind regards |
Ah, I see. It's a segmentation fault. Opt doesn't always throw an error exactly where the bug is. You could try running in debug mode. And you should fix your forall loop.
|
Dear all,
what if it's a floating point error? such as Code:
#0 Foam::error::printStack(Foam::Ostream&) at ??:? Sandra |
Quick answer:
Quote:
Quote:
Quote:
Quote:
If you have access to the source code for the equation where this product occurs, you can try using old school debugging, as... I've already explained here: http://www.cfd-online.com/Forums/ope...tml#post577363 post #3 |
Forgot to update that I fixed this.
Issue was that the fields being multiplied were of different sizes so I fixed that. Best, Sandra |
All times are GMT -4. The time now is 11:35. |