Skip to content

Commit

Permalink
Merge pull request #89 from Plant-Root-Soil-Interactions-Modelling/up…
Browse files Browse the repository at this point in the history
…dateMerge

Your Message
  • Loading branch information
m-giraud authored Mar 16, 2023
2 parents cd5fe05 + 8218533 commit 3f9eaa7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/structural/Organ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,13 @@ void Organ::abs2rel()
*/
Vector3d Organ::getiHeading0() const
{
if (!getParent()) { // in case of class RootSystem base roots (tap, basal, shootborne) have no parent
Vector3d vparentHeading = Vector3d(0, 0, -1);
if (!getParent()) { // in case of class RootSystem base roots (tap, basal, shootborne) or Organism organs created manually have no parent
Vector3d vparentHeading ;
if(organType() <= Organism::ot_root){//root (2) or unrecognized organ (0)
vparentHeading = Vector3d(0, 0, -1);
}else{//stem (3) or leaf(4)
vparentHeading = Vector3d(0, 0, 1);
}
Matrix3d parentHeading = Matrix3d::ons(vparentHeading);
return parentHeading.times(this->partialIHeading);
}
Expand Down

0 comments on commit 3f9eaa7

Please sign in to comment.