Skip to content

Commit

Permalink
Updated reaction force log variables to be more consistent with "reac…
Browse files Browse the repository at this point in the history
…tion forces" plot variable.
  • Loading branch information
SteveMaas1978 committed Feb 25, 2025
1 parent e1c0d04 commit 8ec661c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions FEBioMech/FEBioMechData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ double FENodeForceX::value(const FENode& node)
const vector<int>& id = node.m_ID;
return (-id[0] - 2 >= 0 ? Fr[-id[0] - 2] : 0);
}

// This code is from the "reaction forces" plot variable
// TODO: Need to check if code above produces the same answer as below. If so,
// just use code below.
FEModel& fem = *GetFEModel();
int dofX = fem.GetDOFIndex("x");
if (dofX >= 0)
{
double Rx = node.get_load(dofX);
return Rx;
}

return 0;
}

Expand All @@ -152,6 +164,18 @@ double FENodeForceY::value(const FENode& node)
const vector<int>& id = node.m_ID;
return (-id[1] - 2 >= 0 ? Fr[-id[1]-2] : 0);
}

// This code is from the "reaction forces" plot variable
// TODO: Need to check if code above produces the same answer as below. If so,
// just use code below.
FEModel& fem = *GetFEModel();
int dofY = fem.GetDOFIndex("y");
if (dofY >= 0)
{
double Ry = node.get_load(dofY);
return Ry;
}

return 0;
}

Expand All @@ -173,6 +197,18 @@ double FENodeForceZ::value(const FENode& node)
const vector<int>& id = node.m_ID;
return (-id[2] - 2 >= 0 ? Fr[-id[2] - 2] : 0);
}

// This code is from the "reaction forces" plot variable
// TODO: Need to check if code above produces the same answer as below. If so,
// just use code below.
FEModel& fem = *GetFEModel();
int dofZ = fem.GetDOFIndex("z");
if (dofZ >= 0)
{
double Rz = node.get_load(dofZ);
return Rz;
}

return 0;
}

Expand Down

0 comments on commit 8ec661c

Please sign in to comment.