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
GuidewireSim.InitializationStep Class Reference
Inheritance diagram for GuidewireSim.InitializationStep:

## Public Member Functions
void | InitSpherePositions (GameObject[] spheres, int spheresCount, out Vector3[] spherePositions)
void | InitSphereVelocities (int spheresCount, out Vector3[] sphereVelocities)
void | InitSphereInverseMasses (int spheresCount, out float[] sphereInverseMasses)
void | InitCylinderPositions (int cylinderCount, Vector3[] spherePositions, out Vector3[] cylinderPositions)
void | InitCylinderOrientations (int cylinderCount, out BSM.Quaternion[] cylinderOrientations)
void | InitDiscreteRestDarbouxVectors (int cylinderCount, BSM.Quaternion[] cylinderOrientations, out Vector3[] discreteRestDarbouxVectors, float rodElementLength)
void | InitCylinderAngularVelocities (int cylinderCount, out Vector3[] cylinderAngularVelocities)
void | InitCylinderScalarWeights (int cylinderCount, out float[] cylinderScalarWeights)
void | InitSphereExternalForces (int spheresCount, out Vector3[] sphereExternalForces)
void | InitSpherePositionPredictions (GameObject[] spheres, int spheresCount, out Vector3[] spherePositionPredictions)
void | InitCylinderOrientationPredictions (int cylinderCount, out BSM.Quaternion[] cylinderOrientationPredictions)
void | InitInertiaTensor (out float[,] inertiaTensor)
void | InitInverseInertiaTensor (float[,] inertiaTensor, out float[,] inverseInertiaTensor)
void | InitCylinderExternalTorques (int cylinderCount, out Vector3[] cylinderExternalTorques)
void | InitWorldSpaceBasis (out BSM.Quaternion[] worldSpaceBasis)
void | InitDirectors (int cylinderCount, BSM.Quaternion[] worldSpaceBasis, out Vector3[][] directors)
void | InitSphereColliders (int spheresCount, GameObject[] spheres)

## Private Member Functions
void | Awake ()

## Private Attributes
CollisionHandler | collisionHandler
| The component CollisionHandler that solves all collisions. More...
MathHelper | mathHelper
| The component MathHelper that provides math related helper functions. More...
float | materialDensity = 7860
float | materialRadius = 0.001f

## Detailed Description

This class is responsible for initializing all data with their initial values of the simulation at the start of the simulation.

## Member Function Documentation

## ◆ Awake()

void GuidewireSim.InitializationStep.Awake | ( |  | ) |
| private

## ◆ InitCylinderAngularVelocities()

void GuidewireSim.InitializationStep.InitCylinderAngularVelocities | ( | int | cylinderCount,
|  | out Vector3[] | cylinderAngularVelocities
| ) |  |

Initializes `cylinderAngularVelocities` with the default value of zero at the start of the simulation.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  [out] | cylinderAngularVelocities | The angular velocity of the current frame of each orientation element/ cylinder.

## ◆ InitCylinderExternalTorques()

void GuidewireSim.InitializationStep.InitCylinderExternalTorques | ( | int | cylinderCount,
|  | out Vector3[] | cylinderExternalTorques
| ) |  |

Initializes `cylinderExternalTorques` with the default value of zero at the start of the simulation.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  [out] | cylinderExternalTorques | The sum of all current external torques that are applied per orientation element/ cylinder.

## ◆ InitCylinderOrientationPredictions()

void GuidewireSim.InitializationStep.InitCylinderOrientationPredictions | ( | int | cylinderCount,
|  | out BSM.Quaternion[] | cylinderOrientationPredictions
| ) |  |

Initializes `cylinderOrientationPredictions` with the default value of (0f, 0f, 0f, 1f) which equals the quaternion identity at the start of the simulation.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  [out] | cylinderOrientationPredictions | The prediction of the orientation of each cylinder at its center of mass.

## ◆ InitCylinderOrientations()

void GuidewireSim.InitializationStep.InitCylinderOrientations | ( | int | cylinderCount,
|  | out BSM.Quaternion[] | cylinderOrientations
| ) |  |

Initializes `cylinderOrientations` with the default value of (0f, 0f, 0f, 1f) which equals the quaternion identity at the start of the simulation.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientations`.
  [out] | cylinderOrientations | The orientation of each cylinder at its center of mass.

## ◆ InitCylinderPositions()

void GuidewireSim.InitializationStep.InitCylinderPositions | ( | int | cylinderCount,
|  | Vector3[] | spherePositions,
|  | out Vector3[] | cylinderPositions
| ) |  |

Initializes `cylinderPositions` as middle points of the positions of `spheres` at the start of the simulation.

Parameters

  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  [out] | cylinderPositions | The position/ center of mass of each cylinder.

## ◆ InitCylinderScalarWeights()

void GuidewireSim.InitializationStep.InitCylinderScalarWeights | ( | int | cylinderCount,
|  | out float[] | cylinderScalarWeights
| ) |  |

Initializes `cylinderScalarWeights` with the default value of one at the start of the simulation.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  [out] | cylinderScalarWeights | The constant scalar weights of each orientation/ quaternion similar to `sphereInverseMasses`.

## ◆ InitDirectors()

void GuidewireSim.InitializationStep.InitDirectors | ( | int | cylinderCount,
|  | BSM.Quaternion[] | worldSpaceBasis,
|  | out Vector3 | directors[][]
| ) |  |

Initializes the `directors` array of arrays. The zero-th array defines all first directors of each director basis and so on.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  | worldSpaceBasis | The three basis vectors of the world coordinate system.
  [out] | directors | The orthonormal basis of each orientation element / cylinder, also called directors.

Note
  Example: The (i, j)th element holds the (i-1)th director of orientation element j.

## ◆ InitDiscreteRestDarbouxVectors()

void GuidewireSim.InitializationStep.InitDiscreteRestDarbouxVectors | ( | int | cylinderCount,
|  | BSM.Quaternion[] | cylinderOrientations,
|  | out Vector3[] | discreteRestDarbouxVectors,
|  | float | rodElementLength
| ) |  |

Calculates the discrete darboux vector for each orientation pair (two adjacent orientations) at its rest configuration, i.e. at frame 0.

Parameters

  | cylinderCount | The count of all cylinders of the guidewire. Equals the length of `cylinderOrientationPredictions`.
  | cylinderOrientations | The orientation of each cylinder at its center of mass.
  [out] | discreteRestDarbouxVectors | The array of all discrete Darboux Vectors at the rest configuration, i.e. at frame 0. Has (n-1) elements, if n is the number of orientations of the guidewire, because the darboux vector is taken of two adjacent orientations.
  | rodElementLength | The distance between two spheres, also the distance between two orientations.

Requirements:

  `cylinderCount` should be at least one.

  `rodElementLength` should be positive.

Note
  All cylinder orientations must be computed for frame 0 first.

## ◆ InitInertiaTensor()

void GuidewireSim.InitializationStep.InitInertiaTensor | ( | out float | inertiaTensor[,] | ) |

Initializes `inertiaTensor` so that all elements except the diagonal ones are zero. The first and second diagonal entry equal \( \rho * \pi * \frac{r^{2}}{4} \), and the third diagonal entry equals \( \rho * \pi * \frac{r^{2}}{2} \).

Parameters

  [out] | inertiaTensor | The inertia tensor. Entries are approximates as in the CoRdE paper.

## ◆ InitInverseInertiaTensor()

void GuidewireSim.InitializationStep.InitInverseInertiaTensor | ( | float | inertiaTensor[,],
|  | out float | inverseInertiaTensor[,]
| ) |  |

Initializes `inverseInertiaTensor` as the inverse of `inertiaTensor`.

Parameters

  | inertiaTensor | The inertia tensor. Entries are approximates as in the CoRdE paper.
  [out] | inverseInertiaTensor | The inverse of `inertiaTensor`.

## ◆ InitSphereColliders()

void GuidewireSim.InitializationStep.InitSphereColliders | ( | int | spheresCount,
|  | GameObject[] | spheres
| ) |  |

## ◆ InitSphereExternalForces()

void GuidewireSim.InitializationStep.InitSphereExternalForces | ( | int | spheresCount,
|  | out Vector3[] | sphereExternalForces
| ) |  |

Initializes `sphereExternalForces` with the default value of zero at the start of the simulation.

Parameters

  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  [out] | sphereExternalForces | The sum of all current external forces that are applied per particle/ sphere.

## ◆ InitSphereInverseMasses()

void GuidewireSim.InitializationStep.InitSphereInverseMasses | ( | int | spheresCount,
|  | out float[] | sphereInverseMasses
| ) |  |

Initializes `sphereInverseMasses` with the default value of one at the start of the simulation.

Parameters

  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  [out] | sphereInverseMasses | The constant inverse masses of each sphere.

## ◆ InitSpherePositionPredictions()

void GuidewireSim.InitializationStep.InitSpherePositionPredictions | ( | GameObject[] | spheres,
|  | int | spheresCount,
|  | out Vector3[] | spherePositionPredictions
| ) |  |

Initializes `spherePositionPredictions` with the default value of zero at the start of the simulation.

Parameters

  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  [out] | spherePositionPredictions | The prediction of the position at the current frame of each sphere.

## ◆ InitSpherePositions()

void GuidewireSim.InitializationStep.InitSpherePositions | ( | GameObject[] | spheres,
|  | int | spheresCount,
|  | out Vector3[] | spherePositions
| ) |  |

Initializes `spherePositions` with the positions of `spheres` at the start of the simulation.

Parameters

  | spheres | All spheres that are part of the guidewire.
  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  [out] | spherePositions | The position at the current frame of each sphere.

Requirements:
  `spheresCount` should be at least one.

## ◆ InitSphereVelocities()

void GuidewireSim.InitializationStep.InitSphereVelocities | ( | int | spheresCount,
|  | out Vector3[] | sphereVelocities
| ) |  |

Initializes `sphereVelocities` with the default value of zero at the start of the simulation.

Parameters

  | spheresCount | The count of all spheres of the guidewire. Equals the length of `spherePositionPredictions`.
  [out] | sphereVelocities | The velocity of the current frame of each sphere.

Note
  Velocities are set to zero at the start of the simulation.

## ◆ InitWorldSpaceBasis()

void GuidewireSim.InitializationStep.InitWorldSpaceBasis | ( | out BSM.Quaternion[] | worldSpaceBasis | ) |

Initializes the world space basis vectors (1, 0, 0), (0, 1, 0), (0, 0, 1) as embedded quaternions with scalar part zero.

Parameters

  [out] | worldSpaceBasis | The three basis vectors of the world coordinate system.

## Member Data Documentation

## ◆ collisionHandler

CollisionHandler GuidewireSim.InitializationStep.collisionHandler
| private

The component CollisionHandler that solves all collisions.

## ◆ materialDensity

float GuidewireSim.InitializationStep.materialDensity = 7860
| private

The density of the rod material. The value 7960 is taken from Table 2 of the CoRdE paper.

## ◆ materialRadius

float GuidewireSim.InitializationStep.materialRadius = 0.001f
| private

The radius of the cross-section of the rod. Tha value 0.001 or 1mm is taken from Table 2 of the CoRdE paper.

## ◆ mathHelper

MathHelper GuidewireSim.InitializationStep.mathHelper
| private

The component MathHelper that provides math related helper functions.

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

- InitializationStep.cs