IOStream Code - dsmcParcelIO.C
Hi,
I have been developing the DSMC code to run with vibrational energy and this involves adding a scalarField of vibrational energies (one energy for each mode). My code runs well in serial, but I am getting segmentation faults when running in parallel: [1] #3 cfree in "/lib/x86_64-linux-gnu/libc.so.6" [0] #3 cfree in "/lib/x86_64-linux-gnu/libc.so.6" [1] #4 Foam::dsmcParcel::dsmcParcel(Foam::polyMesh const&, Foam::Istream&, bool) in "/lib/x86_64-linux-gnu/libc.so.6" [0] #4 Foam::dsmcParcel::dsmcParcel(Foam::polyMesh const&, Foam::Istream&, bool) in "/home/craig/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libdsmcPolyStrath.so" [1] #5 in void Foam::Cloud<Foam::dsmcParcel>::move<Foam::dsmcParc el::trackingData>(Foam::dsmcParcel::trackingData&, double)"/home/craig/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libdsmcPolyStrath.so" [0] #5 void Foam::Cloud<Foam::dsmcParcel>::move<Foam::dsmcParc el::trackingData>(Foam::dsmcParcel::trackingData&, double) in "/home/craig/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/li in "/home/craig/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lb/libdsmcPolyStrath.so" I'm quite sure it's an issue with my code in dsmcParcelIO.C - I have created a IOField<scalarField> for the vibrational energy that successfully writes out the vibrational energies: Code:
IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np); Code:
IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ)); Any help would be appreciated here. Thanks, Craig |
Could it be a problem with my Ostream operator function? The problem only seems to happen when a particle hits a boundary (even a processor patch).
Code:
Foam::Ostream& Foam::operator<< |
I got this working, so I'll post my solution here in the hope it helps someone in the future.
I had to move the EVib_ entry to the end of the list of things to be initialised, which initially looked like: Code:
inline Foam::dsmcParcel::dsmcParcel Code:
inline Foam::dsmcParcel::dsmcParcel Code:
Foam::dsmcParcel::dsmcParcel Code:
Foam::Ostream& Foam::operator<< |
All times are GMT -4. The time now is 20:04. |