Error using fixedGradient patch
I'm having troubles with a new solver. I built it without problems, and I ran it on a 2D mesh. For my program to work properly I have to use a fixedGradient patch. It gave me back this error:
*** glibc detected *** double free or corruption (out)
(followed by the usual memory map and backtrace...)
I tried to debug and I found that the error was generated by this instruction in fixedGradientfvPatchField.C:
this->patchInternalField() + gradient_/this->patch().deltaCoeffs()
This command recall the following operator from Field.C (line 653), and generate a memory error.
// This is dodgy stuff, don't try it at home.
Field* fieldPtr = rhs.ptr();
I'd like to implement the same command in an alternative way.
Does anyone know if there's a way to change this "dodgy stuff"?
Thanks to all,
fixedGradient error - update
I've tried to solve my problem and I've discovered that the memory error is ought to this command in the List.C file (line 392):
The memory address at the end of the "**** glibc detected ****" message is the same pointed by this->v_.
I don't know why but deallocating this memory causes the solver to crash...
|All times are GMT -4. The time now is 08:07.|