MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Vec3D Class Reference

#include <Vector.h>

Public Member Functions

 Vec3D ()
 constructor More...
 
 Vec3D (const SmallVector< 3 > &vector)
 
 Vec3D (const Mdouble x, const Mdouble y, const Mdouble z)
 Alternative constructor, taking the three elements as arguments. More...
 
void setZero ()
 Sets all elements to zero. More...
 
void setNaN ()
 Sets all elements to NaN. More...
 
bool isZero () const
 Checks if ALL elements are zero. More...
 
bool isNaN () const
 Checks if ALL elements are zero. More...
 
Vec3D operator+ (const Vec3D &a) const
 Adds another vector. More...
 
Vec3D operator- (const Vec3D a) const
 Binary vector subtraction. More...
 
Vec3D multiplyElementwise (const Vec3D &a) const
 
Vec3D divideElementwise (const Vec3D &a) const
 
Vec3D signedSquare () const
 
Vec3D operator* (const Mdouble a) const
 Multiplies by a scalar. More...
 
Vec3D operator/ (Mdouble a) const
 Divides by a scalar. More...
 
Vec3Doperator+= (const Vec3D &a)
 Adds another vector. More...
 
bool operator>= (const Vec3D &a) const
 Checks if all coordinates satisfy this>=a. More...
 
bool operator< (const Vec3D &a) const
 
Vec3Doperator-= (const Vec3D &a)
 Subtracts another vector. More...
 
Vec3Doperator*= (Mdouble a)
 Multiplies by a scalar. More...
 
Vec3Doperator/= (const Mdouble a)
 Divides by a scalar. More...
 
void normalise ()
 Makes this Vec3D unit length. More...
 
void setLength (Mdouble length)
 Make this Vec3D a certain length. More...
 
Mdouble getLength () const
 Calculates the length of this Vec3D: \( \sqrt{a\cdot a} \). More...
 
Mdouble getLengthSquared () const
 Calculates the squared length of this Vec3D: \( a\cdot a \). More...
 
Mdouble getComponent (int index) const
 Returns the requested component of this Vec3D. More...
 
void setComponent (int index, double val)
 Sets the requested component of this Vec3D to the requested value. More...
 
Mdoublex ()
 RW reference to X. More...
 
Mdouble x () const
 RO reference to X. More...
 
Mdoubley ()
 RW reference to Y. More...
 
Mdouble y () const
 RO reference to Y. More...
 
Mdoublez ()
 RW reference to Z. More...
 
Mdouble z () const
 RO reference to Z. More...
 
void setX (Mdouble x)
 
void setY (Mdouble y)
 
void setZ (Mdouble z)
 
Mdouble getX ()
 
Mdouble getY ()
 
Mdouble getZ ()
 
void set (Mdouble x, Mdouble y, Mdouble z)
 
Mdouble getRadialCoordinateSquared () const
 Returns the square of the radial cylindrical coordinate, r^2=x^2+y^2. More...
 
Mdouble getRadialCoordinate () const
 Returns the square of the radial cylindrical coordinate, r=sqrt(x^2+y^2). More...
 
Vec3D getCylindricalCoordinates () const
 Returns the representation of this Vec3D in cylindrical coordinates. More...
 
Vec3D getFromCylindricalCoordinates () const
 Returns the representation of this Vec3D in cylindrical coordinates. More...
 
Vec3D getCylindricalTensorField (const Vec3D &position) const
 Returns this vector field at point p to cylindrical coordinates. More...
 
bool isEqualTo (const Vec3D &other, double tol) const
 Checks if the length this Vec3D is equal the length of other with a certain tolerance. More...
 

Static Public Member Functions

static Mdouble dot (const Vec3D &a, const Vec3D &b)
 Calculates the dot product of two Vec3D: \( a \cdot b\). More...
 
static Vec3D max (const Vec3D &a, const Vec3D &b)
 Calculates the pointwise maximum of two Vec3D. More...
 
static Vec3D min (const Vec3D &a, const Vec3D &b)
 Calculates the pointwise minimum of two Vec3D. More...
 
static double max (const Vec3D &a)
 Calculates the maximum coordinate of vector a. More...
 
static double min (const Vec3D &a)
 Calculates the minimum coordinate of vector a. More...
 
static Vec3D square (const Vec3D &a)
 Calculates the pointwise square of a Vec3D. More...
 
static Vec3D sqrt (const Vec3D &a)
 Calculates the pointwise square root of a Vec3D. More...
 
static Vec3D cross (const Vec3D &a, const Vec3D &b)
 Calculates the cross product of two Vec3D: \( a \times b\). More...
 
static Mdouble getDistance (const Vec3D &a, const Vec3D &b)
 Calculates the distance between two Vec3D: \( \sqrt{\left(a-b\right) \cdot \left(a-b\right)} \). More...
 
static Mdouble getDistanceSquared (const Vec3D &a, const Vec3D &b)
 Calculates the squared distance between two Vec3D: \( \left(a-b\right) \cdot \left(a-b\right) \). More...
 
static Mdouble getLength (const Vec3D &a)
 Calculates the length of a Vec3D: \( \sqrt{a\cdot a} \). More...
 
static Mdouble getLengthSquared (const Vec3D &a)
 Calculates the squared length of a Vec3D: \( a\cdot a \). More...
 
static Vec3D getUnitVector (const Vec3D &a)
 Returns a unit Vec3D based on a. More...
 

Public Attributes

Mdouble X
 the vector components More...
 
Mdouble Y
 
Mdouble Z
 

Friends

std::ostream & operator<< (std::ostream &os, const Vec3D &a)
 Adds elements to an output stream. More...
 
std::istream & operator>> (std::istream &is, Vec3D &a)
 Adds elements to an input stream. More...
 
Vec3D operator- (const Vec3D &a)
 Reverts the direction of a vector. More...
 
Vec3D operator* (Mdouble a, const Vec3D &b)
 Multiplies all elements by a scalar. More...
 

Detailed Description

Definition at line 49 of file Vector.h.

Constructor & Destructor Documentation

Vec3D::Vec3D ( )
inline
Vec3D::Vec3D ( const SmallVector< 3 > &  vector)

Alternative constructor, that constructs a Vec3D from a SmallVector size 3

Parameters
[in]vectorSmall vector that should be copied

Definition at line 33 of file Vector.cc.

References X, Y, and Z.

34 {
35  X = vector[0];
36  Y = vector[1];
37  Z = vector[2];
38 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D::Vec3D ( const Mdouble  x,
const Mdouble  y,
const Mdouble  z 
)
inline

Alternative constructor, taking the three elements as arguments.

Alternative constructor, lets you define all three elements.

Parameters
[in]xthe x-component
[in]ythe y-component
[in]zthe z-component

Definition at line 82 of file Vector.h.

References X, x(), Y, y(), Z, and z().

83  {
84  X = x;
85  Y = y;
86  Z = z;
87  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble & z()
RW reference to Z.
Definition: Vector.h:368
Mdouble & x()
RW reference to X.
Definition: Vector.h:344
Mdouble & y()
RW reference to Y.
Definition: Vector.h:356
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65

Member Function Documentation

Vec3D Vec3D::cross ( const Vec3D a,
const Vec3D b 
)
static
Vec3D Vec3D::divideElementwise ( const Vec3D a) const
inline

Definition at line 136 of file Vector.h.

References Vec3D(), X, Y, and Z.

136  {
137  return Vec3D(X/a.X, Y/a.Y, Z/a.Z);
138  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble Vec3D::dot ( const Vec3D a,
const Vec3D b 
)
static

Calculates the dot product of two Vec3D: \( a \cdot b\).

Calculates the dot product of two vectors. NB: this is a STATIC function!

Parameters
[in]athe first vector
[in]bthe second vector
Returns
the resulting scalar

Definition at line 76 of file Vector.cc.

References X, Y, and Z.

Referenced by IntersectionOfWalls::addTetraSTL(), ConstantMassFlowMaserBoundary::checkBoundaryAfterParticleMoved(), CGHandler::computeContactPoints(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), HertzianViscoelasticInteraction::computeNormalForce(), LinearViscoelasticInteraction::computeNormalForce(), SinterInteraction::computeNormalForce(), LinearPlasticViscoelasticInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), SlidingFrictionInteraction::computeSlidingSpring(), SlidingFrictionInteraction::computeSlidingSpringSuperQuadric(), HorizontalBaseScrew::convertLimits(), AngledPeriodicBoundary::distance(), BaseInteraction::gatherContactStatistics(), CGCoordinates::R::getCNormal(), TriangulatedWall::Face::getDistance(), NurbsSurface::getDistance(), FluxBoundary::getDistance(), DeletionBoundary::getDistance(), PeriodicBoundary::getDistance(), SubcriticalMaserBoundary::getDistance(), ConstantMassFlowMaserBoundary::getDistance(), Combtooth::getDistanceAndNormal(), ArcWall::getDistanceAndNormal(), TriangulatedWall::Face::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), TriangleWall::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), SubcriticalMaserBoundaryTEST::getDistanceFromRight(), InfiniteWall::getDistanceNormalOverlapSuperquadric(), DPMBase::getGravitationalEnergy(), CGCoordinates::R::getINormal(), CGCoordinates::XYZ::getINormal(), InteractionHandler::getInteraction(), BaseWall::getInteractionWith(), BaseWall::getLinePlaneIntersect(), AngledPeriodicBoundary::getOpeningAngle(), CGCoordinates::R::getPNormal(), BaseParticle::getRotationalEnergy(), MindlinInteraction::getTangentialOverlap(), InfiniteWallWithHole::getWallDistance(), FrictionInteraction::integrate(), MindlinRollingTorsionInteraction::integrate(), PeriodicBoundary::isClosestToLeftBoundary(), SubcriticalMaserBoundary::isClosestToRightBoundary(), ConstantMassFlowMaserBoundary::isClosestToRightBoundary(), BaseWall::isInsideWallVTK(), InfiniteWallWithHole::move_time(), SuperQuadricParticle::overlapFromContactPoint(), BaseWall::projectOntoWallVTK(), AngledPeriodicBoundary::set(), FluxBoundary::set(), InfiniteWallWithHole::set(), ArcWall::set(), PeriodicBoundary::set(), DeletionBoundary::set(), SubcriticalMaserBoundary::set(), ConstantMassFlowMaserBoundary::set(), PeriodicBoundary::setPlanewiseShift(), IntersectionOfWalls::setPointsAndLines(), AngledPeriodicBoundary::shiftPosition(), AngledPeriodicBoundary::shiftPositions(), MindlinInteraction::updateK_t(), DPMBase::writeEneTimeStep(), and BaseInteraction::writeToFStat().

77 {
78  return a.X * b.X + a.Y * b.Y + a.Z * b.Z;
79 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble Vec3D::getComponent ( int  index) const

Returns the requested component of this Vec3D.

returns the vector element belonging to the given index.

Parameters
[in]indexthe index of interest (should be 0, 1 or 2)
Returns
the value of the vector element belonging to the given index

Definition at line 194 of file Vector.cc.

References ERROR, logger, X, Y, and Z.

Referenced by Dipole::computeMultipoleExpansion(), Domain::containsParticle(), Panel::createPanels(), Domain::findNearbyBoundaries(), Panel::Panel(), Domain::setBounds(), and Domain::setRange().

195 {
196  switch (index)
197  {
198  case 0:
199  return X;
200  case 1:
201  return Y;
202  case 2:
203  return Z;
204  default:
205  logger(ERROR, "[Vector::getComponent] Index = %, which is too high for a 3D vector (should be 0-2).",
206  index);
207  return 0;
208  }
209 }
Mdouble X
the vector components
Definition: Vector.h:65
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::getCylindricalCoordinates ( ) const

Returns the representation of this Vec3D in cylindrical coordinates.

Transforms the (Cartesian) vector to cylindrical coordinates

Returns
Transformed vector

Definition at line 251 of file Vector.cc.

References Vec3D(), X, Y, and Z.

252 {
253  return Vec3D(std::sqrt(X * X + Y * Y), std::atan2(Y, X), Z);
254 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::getCylindricalTensorField ( const Vec3D p) const

Returns this vector field at point p to cylindrical coordinates.

Transforms the (Cartesian) vector to cylindrical coordinates. See https://en.wikipedia.org/wiki/Vector_fields_in_cylindrical_and_spherical_coordinates

Returns
Transformed vector

Definition at line 261 of file Vector.cc.

References Vec3D(), X, Y, and Z.

Referenced by CGFields::GradVelocityField::setCylindricalFields(), and CGFields::StandardFields::setCylindricalFields().

262 {
263  //define sin(A)=y/r, cos(A)=x/r
264  Mdouble r = std::sqrt(p.X * p.X + p.Y * p.Y);
265  Mdouble s = p.Y / r;
266  Mdouble c = p.X / r;
267  if (r == 0)
268  {
269  s = 0;
270  c = 1;
271  }
272  return Vec3D(X * c + Y * s, -X * s + Y * c, Z);
273 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
double Mdouble
Definition: GeneralDefine.h:34
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble Vec3D::getDistance ( const Vec3D a,
const Vec3D b 
)
static

Calculates the distance between two Vec3D: \( \sqrt{\left(a-b\right) \cdot \left(a-b\right)} \).

Calculates the square of the distance (i.e. the length of the difference) between two vectors. NB: this is a STATIC function!

Parameters
[in]athe first vector
[in]bthe second vector
Returns
the square of the distance between the two arguments.

Calculates the distance (i.e. the length of the difference) between two vectors NB: this is a STATIC function!

Parameters
[in]athe first vector
[in]bthe second vector
Returns
the distance between the two arguments.

Definition at line 175 of file Vector.cc.

References getDistanceSquared().

Referenced by Panel::setPanelInteractions().

176 {
177  return std::sqrt(getDistanceSquared(a, b));
178 }
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Vector.h:295
static Mdouble Vec3D::getDistanceSquared ( const Vec3D a,
const Vec3D b 
)
inlinestatic

Calculates the squared distance between two Vec3D: \( \left(a-b\right) \cdot \left(a-b\right) \).

Definition at line 295 of file Vector.h.

References X, Y, and Z.

Referenced by DPMBase::checkParticleForInteractionLocal(), getDistance(), Mercury3D::hGridFindContactsWithTargetCell(), and BaseParticle::isInContactWith().

295  {
296  const double X = a.X-b.X;
297  const double Y = a.Y-b.Y;
298  const double Z = a.Z-b.Z;
299  return (X * X + Y * Y + Z * Z);
300  //return getLengthSquared(a - b);
301  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::getFromCylindricalCoordinates ( ) const

Returns the representation of this Vec3D in cylindrical coordinates.

Transforms the (cylindrical) vector to cartesian coordinates

Returns
Transformed vector
Todo:

Definition at line 279 of file Vector.cc.

References mathsFunc::cos(), mathsFunc::sin(), Vec3D(), X, Y, and Z.

280 {
282  return Vec3D(X * std::cos(Y), X * std::sin(Y), Z);
283 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble Vec3D::getLength ( const Vec3D a)
static

Calculates the length of a Vec3D: \( \sqrt{a\cdot a} \).

Calculates the length of a given vector NB: this is a STATIC function!

Parameters
[in]avector to be measured.
Returns
length of the argument.

Definition at line 331 of file Vector.cc.

References getLength().

Referenced by BaseCluster::applyCentralForce(), Combtooth::Combtooth(), CGHandler::computeContactPoints(), MindlinInteraction::computeFrictionForce(), ScrewsymmetricIntersectionOfWalls::computeNormalRadialDeltaN(), SlidingFrictionInteraction::computeSlidingSpringSuperQuadric(), BaseInteraction::gatherContactStatistics(), VChute::getDistanceAndNormal(), ParabolaChute::getDistanceAndNormal(), Combtooth::getDistanceAndNormal(), SineWall::getDistanceAndNormal(), CylindricalWall::getDistanceAndNormal(), ArcWall::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), Coil::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), TriangleWall::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), LevelSetWall::getDistanceAndNormalLabCoordinates(), CGCoordinates::RZ::getLength(), getLength(), SlidingFrictionInteraction::getTangentialOverlap(), MindlinInteraction::getTangentialOverlap(), BaseCluster::makeDataAnalysis(), FileReader::read(), Combtooth::set(), ArcWall::set(), Chute::setChuteAngle(), MindlinInteraction::updateK_t(), and BaseInteraction::writeToFStat().

332 {
333  return a.getLength();
334 }
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
Mdouble Vec3D::getLength ( ) const

Calculates the length of this Vec3D: \( \sqrt{a\cdot a} \).

Calculates the length of this vector

Returns
the (scalar) length of this vector

Definition at line 320 of file Vector.cc.

References getLengthSquared().

Referenced by CGHandler::computeContactPoints(), SphericalWall::getDistance(), TriangulatedWall::Face::getDistanceAndNormal(), SphericalWall::getDistanceAndNormal(), and AngledPeriodicBoundary::set().

321 {
322  return std::sqrt(getLengthSquared());
323 }
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:184
static Mdouble Vec3D::getLengthSquared ( const Vec3D a)
inlinestatic
Mdouble Vec3D::getLengthSquared ( ) const

Calculates the squared length of this Vec3D: \( a\cdot a \).

Calculates the square of the length of itself

Returns
the square of the length of this vector

Definition at line 184 of file Vector.cc.

References X, Y, and Z.

Referenced by HorizontalBaseScrew::convertLimits(), Domain::findNewMPIInteractions(), NurbsSurface::getDistance(), TriangulatedWall::Face::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), CGCoordinates::XYZ::getDistanceSquared(), SuperQuadricParticle::getInitialGuessForContact(), SuperQuadricParticle::getInteractionWith(), BaseParticle::getInteractionWith(), getLength(), CGCoordinates::XYZ::getTangentialSquared(), isEqualTo(), and normalise().

185 {
186  return (X * X + Y * Y + Z * Z);
187 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble Vec3D::getRadialCoordinate ( ) const

Returns the square of the radial cylindrical coordinate, r=sqrt(x^2+y^2).

Definition at line 242 of file Vector.cc.

References X, and Y.

243 {
244  return std::sqrt(X * X + Y * Y);
245 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Vec3D::getRadialCoordinateSquared ( ) const

Returns the square of the radial cylindrical coordinate, r^2=x^2+y^2.

Definition at line 237 of file Vector.cc.

References X, and Y.

238 {
239  return X * X + Y * Y;
240 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Vec3D Vec3D::getUnitVector ( const Vec3D a)
static

Returns a unit Vec3D based on a.

Calculates the unit vector of a given vector (unless it is a vector with zero length; in that case it returns a 3D vector with each element equal to zero). NB: this is a STATIC function!

Parameters
[in]athe vector of interest
Returns
unit vector in the direction of the argument (unless the argument has length zero; in that case a zero-vector).

Definition at line 345 of file Vector.cc.

References getLengthSquared(), and Vec3D().

Referenced by IntersectionOfWalls::createOpenPrism(), IntersectionOfWalls::createPrism(), MindlinInteraction::getTangentialOverlap(), TriangulatedWall::readVTK(), and MindlinInteraction::updateK_t().

346 {
347  Mdouble Length2 = a.getLengthSquared();
348  if (Length2 != 0.0)
349  return a / std::sqrt(Length2);
350  else
351  return Vec3D(0, 0, 0);
352 }
Vec3D()
constructor
Definition: Vector.h:70
double Mdouble
Definition: GeneralDefine.h:34
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316
Mdouble Vec3D::getX ( )
inline

Definition at line 386 of file Vector.h.

References X.

387  { return X; }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Vec3D::getY ( )
inline

Definition at line 389 of file Vector.h.

References Y.

390  { return Y; }
Mdouble Y
Definition: Vector.h:65
Mdouble Vec3D::getZ ( )
inline

Definition at line 392 of file Vector.h.

References Z.

393  { return Z; }
Mdouble Z
Definition: Vector.h:65
bool Vec3D::isEqualTo ( const Vec3D other,
double  tol 
) const

Checks if the length this Vec3D is equal the length of other with a certain tolerance.

Checks if the length of the vector is equal to the one given in the first argument (other), with a tolerance given in the second argument (tol).

Parameters
[in]otherthe 3D vector to check against
[in]tolthe tolerance
Returns
returns TRUE if the difference between the lengths of this vector and that given in the first argument (other) is smaller than the given tolerance.

Definition at line 294 of file Vector.cc.

References getLengthSquared().

Referenced by STLTriangle::isEqualTo().

295 {
296  if ((Vec3D::getLengthSquared(*this - other)) <= tol * tol)
297  {
298  return true;
299  }
300  else
301  {
302  return false;
303  }
304 }
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:184
bool Vec3D::isNaN ( ) const

Checks if ALL elements are zero.

Checks if ALL elements are zero

Returns
TRUE if ALL elements are zero

Definition at line 64 of file Vector.cc.

References X, Y, and Z.

65 {
66  return std::isnan(X) || std::isnan(Y) || std::isnan(Z);
67 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
bool Vec3D::isZero ( ) const
inline

Checks if ALL elements are zero.

Definition at line 102 of file Vector.h.

References X, Y, and Z.

Referenced by TriangleWall::rotate().

103  { return X == 0.0 && Y == 0.0 && Z == 0.0; }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::max ( const Vec3D a,
const Vec3D b 
)
static

Calculates the pointwise maximum of two Vec3D.

Calculates the pointwise maximum of two vectors. NB: this is a STATIC function!

Parameters
[in]athe first vector
[in]bthe second vector
Returns
The resulting vector, in which each element is the maximum of the equivalent elements of the arguments

Definition at line 89 of file Vector.cc.

References Vec3D(), X, Y, and Z.

Referenced by FileReader::read(), and TriangleWall::updateVertexAndNormal().

90 {
91  return Vec3D(std::max(a.X, b.X), std::max(a.Y, b.Y), std::max(a.Z, b.Z));
92 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
static double Vec3D::max ( const Vec3D a)
inlinestatic

Calculates the maximum coordinate of vector a.

Definition at line 249 of file Vector.h.

References X, Y, and Z.

249 {return std::max(std::max(a.X,a.Y),a.Z);}
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::min ( const Vec3D a,
const Vec3D b 
)
static

Calculates the pointwise minimum of two Vec3D.

Calculates the pointwise minimum of two vectors. NB: this is a STATIC function!

Parameters
[in]athe first vector
[in]bthe second vector
Returns
The resulting vector, in which each element is the minimum of the equivalent elements of the arguments

Definition at line 102 of file Vector.cc.

References Vec3D(), X, Y, and Z.

Referenced by BaseWall::addParticlesAtWall(), FileReader::read(), and TriangleWall::updateVertexAndNormal().

103 {
104  return Vec3D(std::min(a.X, b.X), std::min(a.Y, b.Y), std::min(a.Z, b.Z));
105 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
static double Vec3D::min ( const Vec3D a)
inlinestatic

Calculates the minimum coordinate of vector a.

Definition at line 254 of file Vector.h.

References X, Y, and Z.

254 {return std::min(std::min(a.X,a.Y),a.Z);}
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::multiplyElementwise ( const Vec3D a) const
inline

Definition at line 132 of file Vector.h.

References Vec3D(), X, Y, and Z.

Referenced by BaseWall::setForceControl(), and BaseWall::setVelocityControl().

132  {
133  return Vec3D(X*a.X, Y*a.Y, Z*a.Z);
134  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
void Vec3D::normalise ( )

Makes this Vec3D unit length.

Normalises the vector, i.e. divides all elements by the vectors length (resulting in a vector in the same direction, but with unit length).

Definition at line 123 of file Vector.cc.

References ERROR, getLengthSquared(), and logger.

Referenced by IntersectionOfWalls::addObject(), IntersectionOfWalls::addTetraSTL(), SlidingFrictionInteraction::computeSlidingSpringSuperQuadric(), HorizontalScrew::getDistanceAndNormal(), SimpleDrumSuperquadrics::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), Screw::getDistanceAndNormalLabCoordinates(), SimpleDrumSuperquadrics::getDistanceNormalOverlapSuperquadric(), setLength(), Quaternion::setOrientationViaNormal(), and TriangleWall::updateVertexAndNormal().

124 {
125  Mdouble length2 = this->getLengthSquared();
126  if (length2 == 0)
127  {
128  logger(ERROR, "Normalizing a vector of length 0");
129  }
130  *this /= std::sqrt(length2);
131 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:184
Vec3D Vec3D::operator* ( const Mdouble  a) const
inline

Multiplies by a scalar.

Multiplies each element with a scalar

Parameters
[in]athe scalar to be multiplied with
Returns
the resulting vector

Definition at line 150 of file Vector.h.

References Vec3D(), X, Y, and Z.

151  {
152  return Vec3D(X * a, Y * a, Z * a);
153  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D& Vec3D::operator*= ( Mdouble  a)
inline

Multiplies by a scalar.

Multiplies each element by a scalar

Parameters
[in]ascalar to be multiplied by
Returns
(reference to) itself, i.e. resulting vector

Definition at line 210 of file Vector.h.

References X, Y, and Z.

210  {
211  X *= a;
212  Y *= a;
213  Z *= a;
214  return *this;
215  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::operator+ ( const Vec3D a) const
inline

Adds another vector.

Adds vector to itself

Parameters
[in]avector to be added
Returns
resulting 3D vector

Definition at line 116 of file Vector.h.

References Vec3D(), X, Y, and Z.

117  {
118  return Vec3D(X + a.X, Y + a.Y, Z + a.Z);
119  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D& Vec3D::operator+= ( const Vec3D a)
inline

Adds another vector.

Adds a vector to itself

Parameters
[in]avector to be added
Returns
(reference to) itself, i.e. resulting vector

Definition at line 171 of file Vector.h.

References X, Y, and Z.

172  {
173  X += a.X;
174  Y += a.Y;
175  Z += a.Z;
176  return *this;
177  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::operator- ( const Vec3D  a) const
inline

Binary vector subtraction.

Subtracts a vector from another vector

Parameters
[in]avector to be subtracted
Returns
resulting vector

Definition at line 127 of file Vector.h.

References Vec3D(), X, Y, and Z.

128  {
129  return Vec3D(X - a.X, Y - a.Y, Z - a.Z);
130  };
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D& Vec3D::operator-= ( const Vec3D a)
inline

Subtracts another vector.

Subtracts a vector from itself

Parameters
[in]avector to be subtracted
Returns
(reference to) itself, i.e. resulting vector

Definition at line 196 of file Vector.h.

References X, Y, and Z.

197  {
198  X -= a.X;
199  Y -= a.Y;
200  Z -= a.Z;
201  return *this;
202  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::operator/ ( Mdouble  a) const
inline

Divides by a scalar.

Divides each element by a scalar

Parameters
[in]athe scalar to be divided by
Returns
resulting vector

Definition at line 161 of file Vector.h.

References Vec3D(), X, Y, and Z.

161  {
162  return Vec3D(X / a, Y / a, Z / a);
163  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D& Vec3D::operator/= ( const Mdouble  a)
inline

Divides by a scalar.

Divides each element by a scalar

Parameters
[in]ascalar to be divided by
Returns
(reference to) itself, i.e. resulting vector

Definition at line 223 of file Vector.h.

References X, Y, and Z.

224  {
225  X /= a;
226  Y /= a;
227  Z /= a;
228  return *this;
229  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
bool Vec3D::operator< ( const Vec3D a) const
inline

Definition at line 186 of file Vector.h.

References X, Y, and Z.

186  {
187  return X<a.X && Y<a.Y && Z<a.Z;
188  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
bool Vec3D::operator>= ( const Vec3D a) const
inline

Checks if all coordinates satisfy this>=a.

Definition at line 182 of file Vector.h.

References X, Y, and Z.

182  {
183  return X>=a.X && Y>=a.Y && Z>=a.Z;
184  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
void Vec3D::set ( Mdouble  x,
Mdouble  y,
Mdouble  z 
)
inline

Definition at line 395 of file Vector.h.

References X, x(), Y, y(), Z, and z().

396  {
397  X = x;
398  Y = y;
399  Z = z;
400  }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble & z()
RW reference to Z.
Definition: Vector.h:368
Mdouble & x()
RW reference to X.
Definition: Vector.h:344
Mdouble & y()
RW reference to Y.
Definition: Vector.h:356
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
void Vec3D::setComponent ( int  index,
double  val 
)

Sets the requested component of this Vec3D to the requested value.

Sets the element of the vector belonging to the first argument (index) to the value given in the second argument (val).

Parameters
[in]indexindex of element of interest,
[in]valvalue to be set

Definition at line 217 of file Vector.cc.

References ERROR, logger, X, Y, and Z.

Referenced by Panel::createPanels(), Panel::Panel(), and Domain::setBounds().

218 {
219  switch (index)
220  {
221  case 0:
222  X = val;
223  break;
224  case 1:
225  Y = val;
226  break;
227  case 2:
228  Z = val;
229  break;
230  default:
231  logger(ERROR, "[Vector::setComponent] Index = %, which is too high for a 3D vector (should be 0-2).",
232  index);
233  }
234 }
Mdouble X
the vector components
Definition: Vector.h:65
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
void Vec3D::setLength ( Mdouble  length)

Make this Vec3D a certain length.

Sets the length of the vector to a given scalar (while maintaining the direction).

Parameters
[in]lengththe length to be set

Definition at line 138 of file Vector.cc.

References normalise().

139 {
140  this->normalise();
141  *this *= length;
142 }
void normalise()
Makes this Vec3D unit length.
Definition: Vector.cc:123
void Vec3D::setNaN ( )

Sets all elements to NaN.

Sets each element to zero.

Definition at line 53 of file Vector.cc.

References constants::NaN, X, Y, and Z.

Referenced by BaseInteraction::BaseInteraction().

54 {
55  X = constants::NaN;
56  Y = constants::NaN;
57  Z = constants::NaN;
58 }
Mdouble X
the vector components
Definition: Vector.h:65
const Mdouble NaN
Definition: GeneralDefine.h:43
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
void Vec3D::setX ( Mdouble  x)
inline

Definition at line 377 of file Vector.h.

References X, and x().

378  { X = x; }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble & x()
RW reference to X.
Definition: Vector.h:344
void Vec3D::setY ( Mdouble  y)
inline

Definition at line 380 of file Vector.h.

References Y, and y().

381  { Y = y; }
Mdouble & y()
RW reference to Y.
Definition: Vector.h:356
Mdouble Y
Definition: Vector.h:65
void Vec3D::setZ ( Mdouble  z)
inline

Definition at line 383 of file Vector.h.

References Z, and z().

384  { Z = z; }
Mdouble & z()
RW reference to Z.
Definition: Vector.h:368
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::signedSquare ( ) const
inline

Definition at line 140 of file Vector.h.

References Vec3D(), X, Y, and Z.

140  {
141  return Vec3D(fabs(X)*X, fabs(Y)*Y, fabs(Z)*Z);
142  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::sqrt ( const Vec3D a)
static

Calculates the pointwise square root of a Vec3D.

Calculates the pointwise square root of a given vector. NB: this is a STATIC function!

Parameters
[in]athe vector to be pointwise square rooted
Returns
the resulting vector, of which each element is the square root of the equivalent element of the argument.

Definition at line 151 of file Vector.cc.

References Vec3D(), X, Y, and Z.

152 {
153  return Vec3D(std::sqrt(a.X), std::sqrt(a.Y), std::sqrt(a.Z));
154 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D Vec3D::square ( const Vec3D a)
static

Calculates the pointwise square of a Vec3D.

Calculates the pointwise square of the vector. NB: this is a STATIC function!

Parameters
[in]athe vector to be squared.
Returns
the resulting vector, of which each element is the square of the equivalent element of the argument.

Definition at line 114 of file Vector.cc.

References Vec3D(), X, Y, and Z.

Referenced by CGFields::GradVelocityField::getSquared(), and CGFields::StandardFields::getSquared().

115 {
116  return Vec3D(a.X * a.X, a.Y * a.Y, a.Z * a.Z);
117 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Mdouble& Vec3D::x ( )
inline

RW reference to X.

Definition at line 344 of file Vector.h.

References X.

Referenced by DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::read(), DPMBase::readNextDataFile(), DPMBase::readOld(), WallHandler::readTriangleWall(), set(), DPMBase::setMax(), DPMBase::setMin(), setX(), DPMBase::setXMax(), DPMBase::setXMin(), and Vec3D().

345  { return X; }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Vec3D::x ( ) const
inline

RO reference to X.

Definition at line 350 of file Vector.h.

References X.

351  { return X; }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble& Vec3D::y ( )
inline
Mdouble Vec3D::y ( ) const
inline

RO reference to Y.

Definition at line 362 of file Vector.h.

References Y.

363  { return Y; }
Mdouble Y
Definition: Vector.h:65
Mdouble& Vec3D::z ( )
inline
Mdouble Vec3D::z ( ) const
inline

RO reference to Z.

Definition at line 374 of file Vector.h.

References Z.

375  { return Z; }
Mdouble Z
Definition: Vector.h:65

Friends And Related Function Documentation

Vec3D operator* ( Mdouble  a,
const Vec3D b 
)
friend

Multiplies all elements by a scalar.

Multiplies each element of a given vector (b) by a given scalar (a). NB: this is a global function and a friend of the Vec3D class. Gets called when a scalar multiplication of the form (Mdouble) * (Vec3D) is performed.

Parameters
[in]athe scalar
[in]bthe vector
Returns
the resulting vector

Definition at line 463 of file Vector.h.

463  {
464  return Vec3D(b.X * a, b.Y * a, b.Z * a);
465  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
Vec3D operator- ( const Vec3D a)
friend

Reverts the direction of a vector.

Definition at line 450 of file Vector.h.

450  {
451  return Vec3D(-a.X, -a.Y, -a.Z);
452  }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D()
constructor
Definition: Vector.h:70
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
std::ostream& operator<< ( std::ostream &  os,
const Vec3D a 
)
friend

Adds elements to an output stream.

Adds all elements of the vector to an output stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in]osthe output stream,
[in]aThe vector of interest
Returns
the output stream with vector elements added

Definition at line 361 of file Vector.cc.

362 {
363  os << a.X << ' ' << a.Y << ' ' << a.Z;
364  return os;
365 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
std::istream& operator>> ( std::istream &  is,
Vec3D a 
)
friend

Adds elements to an input stream.

Reads all elements of a given vector from an input stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in,out]isthe input stream
[in,out]athe vector to be read in
Returns
the input stream from which the vector elements were read

Definition at line 374 of file Vector.cc.

375 {
376  //TW: clearing the stream avoids the nasty problem that the failbit is set to true if numbers below DBL_MIN=1e-308 are read.
377  is >> a.X; is.clear();
378  is >> a.Y; is.clear();
379  is >> a.Z; //is.clear();
380  return is;
381 }
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65

Member Data Documentation

Mdouble Vec3D::X

the vector components

Definition at line 65 of file Vector.h.

Referenced by StressStrainControlBoundary::activateStrainRateControl(), ChuteWithHopper::addHopper(), BaseWall::addParticlesAtWall(), Quaternion::angularDisplacementTimeDerivative(), Quaternion::angularVelocityBodyFixedFrameToAngularDisplacement(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), DeletionBoundary::checkBoundaryAfterParticleMoved(), HeaterBoundary::checkBoundaryAfterParticleMoved(), Chute::cleanChute(), ScrewsymmetricIntersectionOfWalls::computeDeltaZ(), SuperQuadricParticle::computeHessianLabFixed(), Mercury2D::computeInternalForces(), Mercury3D::computeInternalForces(), BaseCluster::computeInternalStructure(), SuperQuadricParticle::computeMass(), ScrewsymmetricIntersectionOfWalls::computeNormalRadialDeltaN(), SuperQuadricParticle::computeResidualContactDetection(), SuperQuadricParticle::computeShape(), SuperQuadricParticle::computeShapeGradientLabFixed(), Mercury3D::computeWallForces(), HorizontalBaseScrew::convertLimits(), AxisymmetricIntersectionOfWalls::convertLimits(), ScrewsymmetricIntersectionOfWalls::convertLimits(), Chute::createBottom(), CircularPeriodicBoundary::createPeriodicParticle(), InfiniteWall::createVTK(), Matrix3D::cross(), cross(), StressStrainControlBoundary::determineLengthAndCentre(), divideElementwise(), dot(), Matrix3D::dyadic(), SubcriticalMaserBoundaryTEST::extendBottom(), BidisperseCubeInsertionBoundary::generateParticle(), BaseWall::getAxis(), CGCoordinates::RZ::getCNormal(), CGCoordinates::XY::getCNormal(), CGCoordinates::XZ::getCNormal(), CGCoordinates::X::getCNormal(), getComponent(), SuperQuadricParticle::getContactPointPlanB(), getCylindricalCoordinates(), Matrix3D::getCylindricalTensorField(), getCylindricalTensorField(), BaseParticle::getDisplacement2(), CubeDeletionBoundary::getDistance(), HeaterBoundary::getDistance(), Quaternion::getDistance(), VChute::getDistanceAndNormal(), Combtooth::getDistanceAndNormal(), SineWall::getDistanceAndNormal(), CylindricalWall::getDistanceAndNormal(), HorizontalScrew::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), Coil::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), Screw::getDistanceAndNormalLabCoordinates(), LevelSetWall::getDistanceAndNormalLabCoordinates(), CGCoordinates::RZ::getDistanceSquared(), CGCoordinates::X::getDistanceSquared(), CGCoordinates::XY::getDistanceSquared(), CGCoordinates::XZ::getDistanceSquared(), getDistanceSquared(), CGCoordinates::BaseCoordinates::getDomainVolume(), CGCoordinates::R::getDomainVolume(), getFromCylindricalCoordinates(), InfiniteWall::getFurthestPointSuperQuadric(), InfiniteWallWithHole::getHoleDistance(), ShearBoxBoundary::getHorizontalDistance(), LeesEdwardsBoundary::getHorizontalDistance(), SuperQuadricParticle::getInitialGuessForContact(), CGCoordinates::RZ::getINormal(), CGCoordinates::XY::getINormal(), CGCoordinates::XZ::getINormal(), CGCoordinates::X::getINormal(), SuperQuadricParticle::getInteractionWithSuperQuad(), SuperQuadricParticle::getJacobianOfContactDetectionObjective(), CGCoordinates::X::getLength(), CGCoordinates::XY::getLength(), CGCoordinates::XZ::getLength(), CGCoordinates::R::getLength(), CGCoordinates::XYZ::getLength(), getLengthSquared(), ParticleHandler::getMassTimesPosition(), getMPISum(), DomainHandler::getParticleDomainGlobalIndex(), CGCoordinates::RZ::getPNormal(), CGCoordinates::XY::getPNormal(), CGCoordinates::XZ::getPNormal(), CGCoordinates::X::getPNormal(), getRadialCoordinate(), getRadialCoordinateSquared(), CGCoordinates::RZ::getTangentialSquared(), CGCoordinates::XY::getTangentialSquared(), CGCoordinates::XZ::getTangentialSquared(), HeaterBoundary::getVolume(), SuperQuadricParticle::getVolume(), CGCoordinates::Y::getVolumeOfAveragedDimensions(), CGCoordinates::YZ::getVolumeOfAveragedDimensions(), CGCoordinates::Z::getVolumeOfAveragedDimensions(), CGCoordinates::O::getVolumeOfAveragedDimensions(), getX(), Mercury2D::hGridFindParticleContacts(), Mercury3D::hGridFindParticleContacts(), Mercury2D::hGridGetInteractingParticleList(), Mercury3D::hGridGetInteractingParticleList(), Mercury2D::hGridHasParticleContacts(), Mercury2D::hGridUpdateParticle(), Mercury3D::hGridUpdateParticle(), mathsFunc::isEqual(), SuperQuadricParticle::isInContactWith(), isNaN(), isZero(), Matrix3D::ldivide(), max(), min(), multiplyElementwise(), Matrix3D::operator*(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator>=(), operator>>(), SuperQuadricParticle::overlapFromContactPoint(), BaseCluster::particleInsertionSuccessful(), ChuteInsertionBoundary::placeParticle(), FixedClusterInsertionBoundary::placeParticle(), RandomClusterInsertionBoundary::placeParticle(), CubeInsertionBoundary::placeParticle(), PolydisperseInsertionBoundary::placeParticle(), BaseCluster::printTime(), DPMBase::readNextDataFile(), WallHandler::readTriangleWall(), TriangulatedWall::readVTK(), CircularPeriodicBoundary::rotateParticle(), MatrixSymmetric3D::selfDyadic(), AngledPeriodicBoundary::set(), set(), SuperQuadricParticle::setBoundingRadius(), setComponent(), DPMBase::setDomain(), Quaternion::setEuler(), CGFields::OrientationField::setFields(), BaseCG::setHX(), SuperQuadricParticle::setInertia(), setNaN(), Quaternion::setOrientationViaNormal(), Domain::setRange(), HeaterBoundary::setStrength2D(), HeaterBoundary::setStrength3D(), ChuteBottom::setupInitialConditions(), BaseCG::setX(), setX(), setZero(), signedSquare(), CGCoordinates::spaceEvenly(), sqrt(), square(), MatrixSymmetric3D::symmetrisedDyadic(), StressStrainControlBoundary::updateDomainSize(), PeriodicBoundaryHandler::updateMaserParticle(), Vec3D(), SuperQuadricParticle::writeDebugMessageStep2(), SuperQuadricParticle::writeDebugMessageStep3(), DPMBase::writeEneTimeStep(), BaseCluster::writeToCdatFile(), HorizontalScrew::writeVTK(), Screw::writeVTK(), and x().

Mdouble Vec3D::Y

Definition at line 65 of file Vector.h.

Referenced by StressStrainControlBoundary::activateStrainRateControl(), BaseWall::addParticlesAtWall(), Quaternion::angularDisplacementTimeDerivative(), Quaternion::angularVelocityBodyFixedFrameToAngularDisplacement(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), DeletionBoundary::checkBoundaryAfterParticleMoved(), HeaterBoundary::checkBoundaryAfterParticleMoved(), ScrewsymmetricIntersectionOfWalls::computeDeltaZ(), SuperQuadricParticle::computeHessianLabFixed(), Mercury2D::computeInternalForces(), Mercury3D::computeInternalForces(), BaseCluster::computeInternalStructure(), SuperQuadricParticle::computeMass(), ScrewsymmetricIntersectionOfWalls::computeNormalRadialDeltaN(), SuperQuadricParticle::computeResidualContactDetection(), SuperQuadricParticle::computeShape(), SuperQuadricParticle::computeShapeGradientLabFixed(), Mercury3D::computeWallForces(), HorizontalBaseScrew::convertLimits(), AxisymmetricIntersectionOfWalls::convertLimits(), ScrewsymmetricIntersectionOfWalls::convertLimits(), Chute::createBottom(), CircularPeriodicBoundary::createPeriodicParticle(), InfiniteWall::createVTK(), Matrix3D::cross(), cross(), StressStrainControlBoundary::determineLengthAndCentre(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), divideElementwise(), dot(), Matrix3D::dyadic(), SubcriticalMaserBoundaryTEST::extendBottom(), BidisperseCubeInsertionBoundary::generateParticle(), BaseWall::getAxis(), CGCoordinates::XY::getCNormal(), CGCoordinates::Y::getCNormal(), CGCoordinates::YZ::getCNormal(), getComponent(), SuperQuadricParticle::getContactPointPlanB(), getCylindricalCoordinates(), Matrix3D::getCylindricalTensorField(), getCylindricalTensorField(), BaseParticle::getDisplacement2(), CubeDeletionBoundary::getDistance(), HeaterBoundary::getDistance(), Quaternion::getDistance(), VChute::getDistanceAndNormal(), ParabolaChute::getDistanceAndNormal(), Combtooth::getDistanceAndNormal(), SineWall::getDistanceAndNormal(), CylindricalWall::getDistanceAndNormal(), HorizontalScrew::getDistanceAndNormal(), Coil::getDistanceAndNormal(), SimpleDrumSuperquadrics::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), Screw::getDistanceAndNormalLabCoordinates(), LevelSetWall::getDistanceAndNormalLabCoordinates(), SimpleDrumSuperquadrics::getDistanceNormalOverlapSuperquadric(), CGCoordinates::RZ::getDistanceSquared(), CGCoordinates::XY::getDistanceSquared(), CGCoordinates::Y::getDistanceSquared(), CGCoordinates::YZ::getDistanceSquared(), getDistanceSquared(), CGCoordinates::BaseCoordinates::getDomainVolume(), getFromCylindricalCoordinates(), InfiniteWall::getFurthestPointSuperQuadric(), InfiniteWallWithHole::getHoleDistance(), SuperQuadricParticle::getInitialGuessForContact(), CGCoordinates::XY::getINormal(), CGCoordinates::Y::getINormal(), CGCoordinates::YZ::getINormal(), SuperQuadricParticle::getInteractionWithSuperQuad(), SuperQuadricParticle::getJacobianOfContactDetectionObjective(), CGCoordinates::XY::getLength(), CGCoordinates::Y::getLength(), CGCoordinates::YZ::getLength(), CGCoordinates::R::getLength(), CGCoordinates::XYZ::getLength(), getLengthSquared(), ParticleHandler::getMassTimesPosition(), getMPISum(), DomainHandler::getParticleDomainGlobalIndex(), CGCoordinates::XY::getPNormal(), CGCoordinates::Y::getPNormal(), CGCoordinates::YZ::getPNormal(), getRadialCoordinate(), getRadialCoordinateSquared(), CGCoordinates::XY::getTangentialSquared(), CGCoordinates::YZ::getTangentialSquared(), ShearBoxBoundary::getVerticalDistance(), LeesEdwardsBoundary::getVerticalDistance(), HeaterBoundary::getVolume(), SuperQuadricParticle::getVolume(), CGCoordinates::O::getVolumeOfAveragedDimensions(), CGCoordinates::XZ::getVolumeOfAveragedDimensions(), CGCoordinates::X::getVolumeOfAveragedDimensions(), CGCoordinates::Z::getVolumeOfAveragedDimensions(), getY(), Mercury2D::hGridFindParticleContacts(), Mercury3D::hGridFindParticleContacts(), Mercury2D::hGridGetInteractingParticleList(), Mercury3D::hGridGetInteractingParticleList(), Mercury2D::hGridHasParticleContacts(), Mercury2D::hGridUpdateParticle(), Mercury3D::hGridUpdateParticle(), mathsFunc::isEqual(), SuperQuadricParticle::isInContactWith(), isNaN(), isZero(), Matrix3D::ldivide(), max(), min(), multiplyElementwise(), Matrix3D::operator*(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator>=(), operator>>(), SuperQuadricParticle::overlapFromContactPoint(), BaseCluster::particleInsertionSuccessful(), ChuteInsertionBoundary::placeParticle(), FixedClusterInsertionBoundary::placeParticle(), RandomClusterInsertionBoundary::placeParticle(), CubeInsertionBoundary::placeParticle(), PolydisperseInsertionBoundary::placeParticle(), BaseCluster::printTime(), DPMBase::readNextDataFile(), WallHandler::readTriangleWall(), TriangulatedWall::readVTK(), CircularPeriodicBoundary::rotateParticle(), MatrixSymmetric3D::selfDyadic(), AngledPeriodicBoundary::set(), set(), SuperQuadricParticle::setBoundingRadius(), setComponent(), DPMBase::setDomain(), Quaternion::setEuler(), CGFields::OrientationField::setFields(), BaseCG::setHY(), SuperQuadricParticle::setInertia(), setNaN(), Quaternion::setOrientationViaNormal(), Domain::setRange(), HeaterBoundary::setStrength2D(), HeaterBoundary::setStrength3D(), ChuteBottom::setupInitialConditions(), BaseCG::setY(), setY(), setZero(), signedSquare(), CGCoordinates::spaceEvenly(), sqrt(), square(), MatrixSymmetric3D::symmetrisedDyadic(), StressStrainControlBoundary::updateDomainSize(), Vec3D(), SuperQuadricParticle::writeDebugMessageStep2(), SuperQuadricParticle::writeDebugMessageStep3(), DPMBase::writeEneTimeStep(), BaseCluster::writeToCdatFile(), HorizontalScrew::writeVTK(), Screw::writeVTK(), and y().

Mdouble Vec3D::Z

Definition at line 65 of file Vector.h.

Referenced by StressStrainControlBoundary::activateStrainRateControl(), ChuteWithHopper::addHopper(), BaseWall::addParticlesAtWall(), Quaternion::angularDisplacementTimeDerivative(), Quaternion::angularVelocityBodyFixedFrameToAngularDisplacement(), DeletionBoundary::checkBoundaryAfterParticleMoved(), HeaterBoundary::checkBoundaryAfterParticleMoved(), ScrewsymmetricIntersectionOfWalls::computeDeltaZ(), SuperQuadricParticle::computeHessianLabFixed(), Mercury3D::computeInternalForces(), BaseCluster::computeInternalStructure(), SuperQuadricParticle::computeMass(), ScrewsymmetricIntersectionOfWalls::computeNormalRadialDeltaN(), SuperQuadricParticle::computeResidualContactDetection(), SuperQuadricParticle::computeShape(), SuperQuadricParticle::computeShapeGradientLabFixed(), Mercury3D::computeWallForces(), HorizontalBaseScrew::convertLimits(), AxisymmetricIntersectionOfWalls::convertLimits(), ScrewsymmetricIntersectionOfWalls::convertLimits(), InfiniteWall::createVTK(), Matrix3D::cross(), cross(), StressStrainControlBoundary::determineLengthAndCentre(), divideElementwise(), dot(), Matrix3D::dyadic(), SubcriticalMaserBoundaryTEST::extendBottom(), BidisperseCubeInsertionBoundary::generateParticle(), BaseWall::getAxis(), CGCoordinates::RZ::getCNormal(), CGCoordinates::XZ::getCNormal(), CGCoordinates::YZ::getCNormal(), CGCoordinates::Z::getCNormal(), getComponent(), SuperQuadricParticle::getContactPointPlanB(), getCylindricalCoordinates(), getCylindricalTensorField(), BaseParticle::getDisplacement2(), CubeDeletionBoundary::getDistance(), HeaterBoundary::getDistance(), Quaternion::getDistance(), VChute::getDistanceAndNormal(), ParabolaChute::getDistanceAndNormal(), Combtooth::getDistanceAndNormal(), SineWall::getDistanceAndNormal(), CylindricalWall::getDistanceAndNormal(), HorizontalScrew::getDistanceAndNormal(), HorizontalBaseScrew::getDistanceAndNormal(), Coil::getDistanceAndNormal(), BasicIntersectionOfWalls::getDistanceAndNormal(), InfiniteWallWithHole::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), Screw::getDistanceAndNormalLabCoordinates(), LevelSetWall::getDistanceAndNormalLabCoordinates(), CGCoordinates::XZ::getDistanceSquared(), CGCoordinates::YZ::getDistanceSquared(), CGCoordinates::Z::getDistanceSquared(), CGCoordinates::RZ::getDistanceSquared(), getDistanceSquared(), CGCoordinates::BaseCoordinates::getDomainVolume(), CGCoordinates::R::getDomainVolume(), getFromCylindricalCoordinates(), InfiniteWall::getFurthestPointSuperQuadric(), SuperQuadricParticle::getInitialGuessForContact(), CGCoordinates::RZ::getINormal(), CGCoordinates::XZ::getINormal(), CGCoordinates::YZ::getINormal(), CGCoordinates::Z::getINormal(), SuperQuadricParticle::getInteractionWithSuperQuad(), SuperQuadricParticle::getJacobianOfContactDetectionObjective(), CGCoordinates::YZ::getLength(), CGCoordinates::Z::getLength(), CGCoordinates::XZ::getLength(), CGCoordinates::XYZ::getLength(), getLengthSquared(), ParticleHandler::getMassTimesPosition(), getMPISum(), DomainHandler::getParticleDomainGlobalIndex(), CGCoordinates::RZ::getPNormal(), CGCoordinates::XZ::getPNormal(), CGCoordinates::YZ::getPNormal(), CGCoordinates::Z::getPNormal(), CGCoordinates::RZ::getTangentialSquared(), CGCoordinates::XZ::getTangentialSquared(), CGCoordinates::YZ::getTangentialSquared(), HeaterBoundary::getVolume(), SuperQuadricParticle::getVolume(), CGCoordinates::XY::getVolumeOfAveragedDimensions(), CGCoordinates::X::getVolumeOfAveragedDimensions(), CGCoordinates::Y::getVolumeOfAveragedDimensions(), CGCoordinates::O::getVolumeOfAveragedDimensions(), CGCoordinates::R::getVolumeOfAveragedDimensions(), getZ(), Mercury3D::hGridFindParticleContacts(), Mercury3D::hGridGetInteractingParticleList(), Mercury3D::hGridUpdateParticle(), mathsFunc::isEqual(), SuperQuadricParticle::isInContactWith(), isNaN(), isZero(), Matrix3D::ldivide(), max(), min(), multiplyElementwise(), Matrix3D::operator*(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator>=(), operator>>(), SuperQuadricParticle::overlapFromContactPoint(), BaseCluster::particleInsertionSuccessful(), ChuteInsertionBoundary::placeParticle(), FixedClusterInsertionBoundary::placeParticle(), RandomClusterInsertionBoundary::placeParticle(), CubeInsertionBoundary::placeParticle(), PolydisperseInsertionBoundary::placeParticle(), BaseCluster::printTime(), DPMBase::readNextDataFile(), WallHandler::readTriangleWall(), TriangulatedWall::readVTK(), CircularPeriodicBoundary::rotateParticle(), MatrixSymmetric3D::selfDyadic(), AngledPeriodicBoundary::set(), set(), SuperQuadricParticle::setBoundingRadius(), setComponent(), DPMBase::setDomain(), Quaternion::setEuler(), CGFields::OrientationField::setFields(), BaseCG::setHZ(), SuperQuadricParticle::setInertia(), setNaN(), Quaternion::setOrientationViaNormal(), Domain::setRange(), HeaterBoundary::setStrength2D(), HeaterBoundary::setStrength3D(), ChuteBottom::setupInitialConditions(), BaseCG::setZ(), setZ(), setZero(), ShearBoxBoundary::shiftHorizontalPosition(), signedSquare(), CGCoordinates::spaceEvenly(), sqrt(), square(), MatrixSymmetric3D::symmetrisedDyadic(), StressStrainControlBoundary::updateDomainSize(), Vec3D(), SuperQuadricParticle::writeDebugMessageStep2(), SuperQuadricParticle::writeDebugMessageStep3(), DPMBase::writeEneTimeStep(), BaseCluster::writeToCdatFile(), HorizontalBaseScrew::writeVTK(), HorizontalScrew::writeVTK(), Screw::writeVTK(), and z().


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