Segmentation Fault error after min-max
Hello Dear Foamers,
I have been writing one of my solver and am stucked at one place due to segmentation fault error. Given below are the details about this error. Code:
Code:
This piece of code is written inside krBrooksAndCarey.H which contains a derived class called krBrooksAndCarey. This is derived from a base abstract class wherein this H_ is declared as a volScalarField using following: volScalarField H_ Also the H volscalarField which is a primitive variable for enthalpy equation is declared in createFields.H file as: volScalarField H ( IOobject ( "H", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); I think there is something wrong with H volScalarField. I think there is no connection b/w H_ and H defined separately. I wish them to be representing same field variable. But dont know how to do so. Can someone help me sortout this problem. I am really stucked. Bharat |
Hi Bharat,
Just an idea, please make sure that all the variables are properly initialized, sometimes that gives a Segmentation Fault error. Best, Likun |
Hi all,
I agree with Likun, check the initialization of the variables. I think your solver is not able to initialize the variable (in your custom BC) which leads to the segmentation fault. I am not expert on custom BC, anyways I think the error could be in this formulation: Code:
forAll(H_,i) {......} Code:
forAll(H_.BoundaryField(),i) {......} - Best Regards! |
can the error be due to values out of bound as is printed below ?
Enthalpy Min(H) = -2.5054e+23 Max(H) = 5.6046e+36 Can some one tell me what is the maximum and minimum numerical value supported by openFoam in double or single precision ? |
problem solved....
:-) |
Hi all,
I have a similar problem. When I initialize a 3D array and run it for n=128, it crashes with Segmentation fault. The exact line where this happens is Code:
double array[n+2][n+2][n+2]; Thanks, Sugajen |
Quote:
|
Hi all,
I solved my problem using the following way of dynamically allocating a 3D array so that the heap memory is used. If we do a declaration as I had done on my original post, the stack memory will be used which has some memory limitations that could cause segmentation error. Code:
double ***array = new double**[n+2]; Code:
for(int i = 0; i < n+2; ++i) Sugajen |
sigsegv error
Quote:
|
All times are GMT -4. The time now is 11:22. |