Closed adhishm closed 11 years ago
Updating the constructor for SlipPlane
and the function void SlipPlane::setExtremities (Vector3d *ends)
// Default axes for the extremities
// The extremities take the same axes as the slip plane
Vector3d *axes = new Vector3d[3];
axes[0] = Vector3d(1.0, 0.0, 0.0);
axes[1] = Vector3d(0.0, 1.0, 0.0);
axes[2] = Vector3d(0.0, 0.0, 1.0);
this->extremities[0] = Defect(GRAINBOUNDARY, ends[0], axes, this->coordinateSystem.getBase());
this->extremities[0] = Defect(GRAINBOUNDARY, ends[1], axes, this->coordinateSystem.getBase());
this->defects.insert(this->defects.begin(),1,this->extremities);
this->defects.insert(this->defects.end(),1,this->extremities+1);
By doing this, the two extremities are explicitly set to have the defectType=GRAINBOUNDARY
, and their co-ordinate systems are defined too.
The operations of reading in data are carried out in the following order:
SlipPlane::extremities
.std::vector dislocations
.std::vector dislocationSources
.SlipPlane::extremity[0]
.std::vector defects
is updated using the function updateDefects
:
Henceforth, care must be taken to call sortDislocations
and sortDislocationSources
functions every time a new dislocation or a new dislocation source is inserted or removed. The updateDefects
function must then be called to update the defects list.
The function SlipPlane::updateDefects()
has been fixed. It now clears the entire defects
vector and rebuilds it using the data available. In the end the list is sorted.
In the constructors of the class
SlipPlane
, there are several redundant operations which write to thestd::vector<Defect*> defects
repeatedly. There should be a logical order of calling the various functions likeSlipPlane::setExtremities
,SlipPlane::createDefects
, etc., amd also a clean up of the operations each of those functions carries out, in order to remove redundancy and conflicts.This bug may also be responsible for the other bug about wrong/changing
defectType
for the slip plane extremities.