IFEM  90A354
Public Member Functions | Public Attributes | List of all members
Vec4 Class Reference

Simple class for representing a point in 3D space and time. More...

#include <Vec3.h>

Inheritance diagram for Vec4:
Inheritance graph
[legend]
Collaboration diagram for Vec4:
Collaboration graph
[legend]

Public Member Functions

 Vec4 (const Real *par=nullptr, Real T=Real(0))
 Default constructor creating a point at origin.
 
 Vec4 (Real T)
 Constructor creating a point at origin and time T.
 
 Vec4 (Real X, Real Y, Real Z, Real T=Real(0))
 Constructor creating a point at the specified location.
 
 Vec4 (const Vec3 &X, Real T=Real(0), int id=-1)
 Constructor creating a point at the specified location.
 
 Vec4 (const Vec3 &X, Real T, const Real *par)
 Constructor creating a point at the specified location.
 
 Vec4 (const std::vector< Real > &X, const Real *par=nullptr)
 Constructor creating a point from the given std::vector.
 
 Vec4 (const Vec4 &X)
 Copy constructor.
 
Vec4operator= (const Vec4 &X)
 Assignment operator.
 
Vec4operator= (Real val)
 Overloaded assignment operator.
 
Vec4assign (const Vec3 &X)
 Assignment method.
 
std::ostream & print (std::ostream &os, double tol=1.0e-12) const override
 Print out a vector.
 
- Public Member Functions inherited from Vec3
 Vec3 ()
 Default constructor creating a point at origin.
 
 Vec3 (Real X, Real Y, Real Z=Real(0))
 Constructor creating a point at the specified location.
 
 Vec3 (const Real *pos, size_t n=3)
 Constructor creating a point at the specified location.
 
 Vec3 (const std::vector< Real > &X)
 Constructor creating a point from the given std::vector.
 
 Vec3 (const Vec3 &X)
 Copy constructor.
 
 Vec3 (const Vec3 &X, const Vec3 &Y)
 Constructor creating a cross product of two other vectors.
 
virtual ~Vec3 ()
 Empty destructor.
 
Vec3operator= (const Vec3 &X)
 Assignment operator.
 
Vec3operator= (Real val)
 Overloaded assignment operator.
 
const Realoperator() (int i) const
 Indexing operator for component reference (1-based).
 
const Realoperator[] (int i) const
 Indexing operator for component reference (0-based).
 
Realoperator() (int i)
 Indexing operator for component assignment (1-based).
 
Realoperator[] (int i)
 Indexing operator for component assignment (0-based).
 
const Realptr () const
 Reference through a pointer.
 
std::vector< Realvec (size_t n=3) const
 Conversion to std::vector.
 
Vec3operator*= (Real c)
 Multiplication with a scalar.
 
Vec3operator/= (Real d)
 Division by a scalar.
 
Vec3operator+= (const Vec3 &X)
 Add the given vector X to *this.
 
Vec3operator-= (const Vec3 &X)
 Subtract the given vector X from *this.
 
Vec3 operator- () const
 Negation operator.
 
Real sum () const
 Return the sum of the vector components.
 
Real asum () const
 Return the sum of absolute values of the vector components.
 
Real length2 () const
 Return the square of the length of the vector.
 
double length () const
 Return the length of the vector.
 
Real normalize (double tol=1.0e-16)
 Normalize the vector and return its length.
 
Vec3cross (const Vec3 &a, const Vec3 &b)
 Cross product between two vectors.
 
bool equal (const Vec3 &a, double tol=1.0e-6) const
 Equality check between two vectors.
 
bool isZero (double tol=1.0e-6) const
 Check if the vector is zero with the given tolerance.
 
bool lessThan (const Vec3 &a, double tol=1.0e-6) const
 Check if one vector is less than the other. More...
 
bool inside (const Vec3 &a, const Vec3 &b, double tol=1.0e-6) const
 Check if a vector is inside the box defined by two other vectors.
 

Public Attributes

const Realu
 Spline parameters of point.
 
Real t
 The time coordinate.
 
int idx
 Nodal point index.
 
- Public Attributes inherited from Vec3
Realx
 Reference to X-component.
 
Realy
 Reference to Y-component.
 
Realz
 Reference to Z-component.
 

Additional Inherited Members

- Static Public Attributes inherited from Vec3
static double comparisonTolerance = 1.0e-4
 Coordinate comparison tolerance.
 

Detailed Description

Simple class for representing a point in 3D space and time.


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