Chi-Tech
|
#include <chi_meshvector.h>
Public Member Functions | |
Vector3 () | |
Vector3 (double a) | |
Vector3 (double a, double b) | |
Vector3 (double a, double b, double c) | |
Vector3 (std::initializer_list< double > list) | |
Vector3 (const std::vector< double > &list) | |
Vector3 (const Vector3 &that) | |
Vector3 & | operator= (const Vector3 &that) |
Vector3 & | operator= (std::initializer_list< double > list) |
Vector3 & | operator= (const std::vector< double > &list) |
Vector3 | operator+ (const Vector3 &that) const |
Vector3 & | operator+= (const Vector3 &that) |
Vector3 | Shifted (const double value) const |
Vector3 & | Shift (const double value) |
Vector3 | operator- (const Vector3 &that) const |
Vector3 & | operator-= (const Vector3 &that) |
Vector3 | operator* (const double value) const |
Vector3 & | operator*= (const double value) |
Vector3 | operator* (const Vector3 &that) const |
Vector3 & | operator*= (const Vector3 &that) |
Vector3 | operator/ (const double value) const |
Vector3 & | operator/= (const double value) |
Vector3 | operator/ (const Vector3 &that) const |
Vector3 & | operator/= (const Vector3 &that) |
double | operator[] (const size_t i) const |
double & | operator() (const size_t i) |
chi_mesh::TensorRank2Dim3 | OTimes (const Vector3 &that) const |
Vector3 | Dot (const chi_mesh::TensorRank2Dim3 &that) const |
Vector3 | Cross (const Vector3 &that) const |
double | Dot (const Vector3 &that) const |
double | Norm () const |
double | NormSquare () const |
void | Normalize () |
Vector3 | Normalized () const |
Vector3 | InverseZeroIfSmaller (const double tol) const |
Vector3 | InverseOneIfSmaller (const double tol) const |
Vector3 | Inverse () const |
void | Print () const |
std::string | PrintS () const |
std::string | PrintStr () const |
Static Public Member Functions | |
static size_t | Size () |
Data Fields | |
double | x |
Element-0. More... | |
double | y |
Element-1. More... | |
double | z |
Element-2. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, Vector3 &v) |
General 3 element vector structure.
Definition at line 18 of file chi_meshvector.h.
|
inline |
Default constructor. Initialized as all zeros.
Definition at line 25 of file chi_meshvector.h.
|
inlineexplicit |
Constructor where single element is initialized .
Definition at line 30 of file chi_meshvector.h.
|
inlineexplicit |
Constructor where and .
Definition at line 35 of file chi_meshvector.h.
|
inlineexplicit |
Constructor where .
Definition at line 40 of file chi_meshvector.h.
|
inline |
Constructor where .
Definition at line 45 of file chi_meshvector.h.
|
inlineexplicit |
Constructor where .
Definition at line 60 of file chi_meshvector.h.
|
inline |
Copy constructor.
Definition at line 75 of file chi_meshvector.h.
Vector cross-product.
Definition at line 317 of file chi_meshvector.h.
chi_mesh::Vector3 chi_mesh::Vector3::Dot | ( | const chi_mesh::TensorRank2Dim3 & | that | ) | const |
Dot product of vector and a rank-2 tensor.
Definition at line 19 of file chi_mesh_utilities.cc.
|
inline |
Vector dot-product.
Definition at line 329 of file chi_meshvector.h.
|
inline |
Returns a vector v^* where each element is inverted without any check for division by zero.
Definition at line 422 of file chi_meshvector.h.
|
inline |
Returns a vector v^* where each element is inverted provided that it is greater than the given tolerance, otherwise the offending entry is set to 1.0.
Definition at line 409 of file chi_meshvector.h.
|
inline |
Returns a vector v^* where each element is inverted provided that it is greater than the given tolerance, otherwise the offending entry is set to 0.0.
Definition at line 395 of file chi_meshvector.h.
|
inline |
Computes the L2-norm of the vector. Otherwise known as the length of a 3D vector.
Definition at line 341 of file chi_meshvector.h.
|
inline |
Normalizes the vector in-place.
Definition at line 368 of file chi_meshvector.h.
|
inline |
Returns a normalized version of the vector.
Definition at line 379 of file chi_meshvector.h.
|
inline |
Computes the square of the L2-norm of the vector. This eliminates the usage of the square root and is therefore less expensive that a proper L2-norm. Useful if only comparing distances.
Definition at line 356 of file chi_meshvector.h.
|
inline |
Returns a reference of the value at the given index.
Definition at line 297 of file chi_meshvector.h.
|
inline |
Vector component-wise multiplication by scalar.
Definition at line 194 of file chi_meshvector.h.
Vector component-wise multiplication.
Definition at line 217 of file chi_meshvector.h.
|
inline |
Vector in-place component-wise multiplication by scalar.
Definition at line 206 of file chi_meshvector.h.
Vector in-place component-wise multiplication.
Definition at line 229 of file chi_meshvector.h.
Component-wise addition of two vectors.
Definition at line 123 of file chi_meshvector.h.
In-place component-wise addition of two vectors.
Definition at line 135 of file chi_meshvector.h.
Component-wise subtraction.
Definition at line 170 of file chi_meshvector.h.
In-place component-wise subtraction.
Definition at line 182 of file chi_meshvector.h.
|
inline |
Vector component-wise division by scalar.
Definition at line 241 of file chi_meshvector.h.
Vector component-wise division.
Definition at line 264 of file chi_meshvector.h.
|
inline |
Vector in-place component-wise division by scalar.
Definition at line 253 of file chi_meshvector.h.
Vector in-place component-wise division.
Definition at line 276 of file chi_meshvector.h.
|
inline |
Definition at line 106 of file chi_meshvector.h.
Assignment operator.
Definition at line 83 of file chi_meshvector.h.
|
inline |
Definition at line 92 of file chi_meshvector.h.
|
inline |
Returns a copy of the value at the given index.
Definition at line 287 of file chi_meshvector.h.
chi_mesh::TensorRank2Dim3 chi_mesh::Vector3::OTimes | ( | const Vector3 & | that | ) | const |
Tensor product of two vectors.
Definition at line 6 of file chi_mesh_utilities.cc.
|
inline |
Prints the vector to std::cout.
Definition at line 433 of file chi_meshvector.h.
|
inline |
Deprecated. Prints the vector to a string and then returns the string.
Definition at line 448 of file chi_meshvector.h.
|
inline |
Prints the vector to a string and then returns the string.
Definition at line 457 of file chi_meshvector.h.
|
inline |
In-place component-wise shift by scalar-value.
Definition at line 158 of file chi_meshvector.h.
|
inline |
Component-wise shift by scalar-value.
Definition at line 146 of file chi_meshvector.h.
|
inlinestatic |
Definition at line 465 of file chi_meshvector.h.
|
friend |
Definition at line 440 of file chi_meshvector.h.
double chi_mesh::Vector3::x |
Element-0.
Definition at line 20 of file chi_meshvector.h.
double chi_mesh::Vector3::y |
Element-1.
Definition at line 21 of file chi_meshvector.h.
double chi_mesh::Vector3::z |
Element-2.
Definition at line 22 of file chi_meshvector.h.