adhishm / dd2d_Matryoshka

A set of classes defining the behaviour of crystalline defects, with the final goal of carrying out dislocation dynamics simulations in two dimensions.
Other
5 stars 4 forks source link

Seg fault at function call `Defect::stressField` after annihilation event #46

Closed adhishm closed 11 years ago

adhishm commented 11 years ago

After the annihilation event, when the function SlipPlane::calculateDislocationStresses calls Defect::stressField, the program throws a segmentation fault at the call for the dislocation.

adhishm commented 11 years ago

Look at SlipPlane::dislocation_dislocationInteraction. In the annihilation event, the call SlipPlane::defects.erase(d0,d1) erases d0 but not d1. See vector::erase. The call erase(first, last) erases all elements in [first, last).

adhishm commented 11 years ago

Error with defects resolved by using SlipPlane::defects.erase(d0, d1+1). Error with dislocations resolved by using SlipPlane::dislocations.erase(dislocation0_iterator, dislocation1_iterator+1).