Public Member Functions | |
IEnumerator | PerformUnitTests () |
Private Member Functions | |
void | Test_SolveBendTwistConstraint (int iterations, BSM.Quaternion orientationOne, BSM.Quaternion orientationTwo, float rodElementLength, Vector3 discreteRestDarbouxVector, GuidewireSim.MathHelper mathHelper, GuidewireSim.ConstraintSolvingStep constraintSolvingStep) |
Private Attributes | |
int | sampleSize = 10 |
int | constraintSolverSteps = 50 |
How often the constraint solver iterates over each constraint during the Constraint Solving Step. More... | |
This class provides unit tests that test the method SolveBendTwistConstraint() of ConstraintSolvingStep. Executing this test once generates sampleSize
many random value pairs and executes the unit test with each of these pairs.
IEnumerator UnitTest_SolveBendTwistConstraint.PerformUnitTests | ( | ) |
Arranges all necessary data, generates sampleSize many random value pairs, and then passes all data to Test_SolveBendTwistConstraint(), where the unit tests are executed.
discreteRestDarbouxVector
accordingly.
|
private |
Executes SolveBendTwistConstraint() of ConstraintSolvingStep iterations
many times for one values pair, and then asserts whether the results of the algorithm of SolveBendTwistConstraint() converged towards the expected values.
iterations | The number of iterations that SolveBendTwistConstraint() of ConstraintSolvingStep is executed. |
orientationOne | The first orientation for SolveBendTwistConstraint(). |
orientationOne | The second orientation for SolveBendTwistConstraint(). |
rodElementLength | The rod element length for SolveBendTwistConstraint(). |
discreteRestDarbouxVector | The discrete Darboux Vector at rest state for SolveBendTwistConstraint(). |
mathHelper | The component MathHelper. |
constraintSolvingStep | The component ConstraintSolvingStep. |
orientationOne
and orientationTwo are still unit quaternions at the end of the test.
The deviation between the bend twist constraint and zero is lower than a reasonable tolerance, i.e. close to zero., which means that the algorithm of SolveBendTwistConstraint() converges towards the fulfillment of the bend twist constraint.
|
private |
How often the constraint solver iterates over each constraint during the Constraint Solving Step.
|
private |
The number of value-pairs the test is executed with. E.g. if sampleSize is 10, then the unit test is executed with 10 randomly drawn value-pairs. A higher number needs more time to execute.