Simulating Guidewires in Blood Vessels using Cosserat Rod Theory |

Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
UnitTest_SolveBendTwistConstraint Class Reference

## 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...

## Detailed Description

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.

## Member Function Documentation

## ◆ PerformUnitTests()

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.

Note
  Only tests the case that all rod elements are aligned at rest state. If you want to test deformed rods at rest state, change `discreteRestDarbouxVector` accordingly.

## ◆ Test_SolveBendTwistConstraint()

void UnitTest_SolveBendTwistConstraint.Test_SolveBendTwistConstraint | ( | int | iterations,
|  | BSM.Quaternion | orientationOne,
|  | BSM.Quaternion | orientationTwo,
|  | float | rodElementLength,
|  | Vector3 | discreteRestDarbouxVector,
|  | GuidewireSim.MathHelper | mathHelper,
|  | GuidewireSim.ConstraintSolvingStep | constraintSolvingStep
| ) |  |
| 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.

Parameters

  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.

Requirements:

  `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.

## Member Data Documentation

## ◆ constraintSolverSteps

int UnitTest_SolveBendTwistConstraint.constraintSolverSteps = 50
| private

How often the constraint solver iterates over each constraint during the Constraint Solving Step.

## ◆ sampleSize

int UnitTest_SolveBendTwistConstraint.sampleSize = 10
| 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.

The documentation for this class was generated from the following file:

- UnitTest_SolveBendTwistConstraint.cs