Skip to content

Commit

Permalink
BUG: Fix incorrect calculation in CylinderOps
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Dec 5, 2023
1 parent bd02eee commit 1db029e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Source/SIMPLib/Geometry/ShapeOps/CylinderAOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ float CylinderAOps::radcur1(QMap<ArgName, float> args)
float covera = args[C_OverA];

// the equation for volume for an A cylinder is pi*b*c*h where b and c are semi axis lengths, but
// h is a full axis length - meaning h = 2a. However, since our aspect ratios relate semi axis lengths, the 2.0
// factor can be ingored in this part
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
// h is a full axis length - meaning h = 2a.
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
radcur1 = powf(radcur1, 0.333333333333f);
return radcur1;
}
Expand Down
5 changes: 2 additions & 3 deletions Source/SIMPLib/Geometry/ShapeOps/CylinderBOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ float CylinderBOps::radcur1(QMap<ArgName, float> args)
float covera = args[C_OverA];

// the equation for volume for a B cylinder is pi*a*c*h where a and c are semi axis lengths, but
// h is a full axis length - meaning h = 2b. However, since our aspect ratios relate semi axis lengths, the 2.0
// factor can be ingored in this part
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
// h is a full axis length - meaning h = 2b.
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
radcur1 = powf(radcur1, 0.333333333333f);
return radcur1;
}
Expand Down
5 changes: 2 additions & 3 deletions Source/SIMPLib/Geometry/ShapeOps/CylinderCOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ float CylinderCOps::radcur1(QMap<ArgName, float> args)
float covera = args[C_OverA];

// the equation for volume for a C cylinder is pi*a*b*h where a and b are semi axis lengths, but
// h is a full axis length - meaning h = 2c. However, since our aspect ratios relate semi axis lengths, the 2.0
// factor can be ingored in this part
radcur1 = static_cast<float>((volcur * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
// h is a full axis length - meaning h = 2c.
radcur1 = static_cast<float>((volcur* 0.5 * SIMPLib::Constants::k_1OverPiD * (1.0f / bovera) * (1.0f / covera)));
radcur1 = powf(radcur1, 0.333333333333f);
return radcur1;
}
Expand Down

0 comments on commit 1db029e

Please sign in to comment.