|
[Sponsors] |
October 4, 2018, 08:03 |
reasons for floating point error
|
#1 |
Senior Member
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10 |
I am getting problem in a very simple line in OF4.1
i.e. psifine += mag(psi0fine)/psi0fine; where psi0fine and psifine are volScalarField #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? at sigaction.c:? #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #6 ? at ??:? #7 __libc_start_main at ??:? #8 ? at ??:? Floating point exception (core dumped) Can anyone suggest what could be the possible cause for the error? |
|
October 4, 2018, 10:11 |
divide by zero
|
#2 |
New Member
Eric Bringley
Join Date: Nov 2016
Posts: 14
Rep Power: 10 |
is your psi0fine zero anywhere?
|
|
October 4, 2018, 11:50 |
|
#3 |
Senior Member
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10 |
NOPE... I tried to print the values of psi0fine over the entire field. It is never zero. And the boundary condition is cyclic.
|
|
October 4, 2018, 17:14 |
|
#4 |
Member
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11 |
if i understand correctly, you want the sign of volScalarField.
So try this codeline : psifine += sign(psi0fine); |
|
October 5, 2018, 08:12 |
|
#5 |
Senior Member
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10 |
Thanks that way is working
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
[blockMesh] error EOF in blockMesh | Ahmed Khattab | OpenFOAM Meshing & Mesh Conversion | 7 | May 17, 2012 01:37 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |