libMesh::TypeVector< T > Class Template Reference
#include <type_vector.h>

Public Member Functions | |
| template<typename T2 > | |
| TypeVector (const TypeVector< T2 > &p) | |
| ~TypeVector () | |
| template<typename T2 > | |
| void | assign (const TypeVector< T2 > &) |
| template<typename Scalar > | |
| boostcopy::enable_if_c < ScalarTraits< Scalar > ::value, TypeVector & >::type | operator= (const Scalar &p) |
| const T & | operator() (const unsigned int i) const |
| const T & | slice (const unsigned int i) const |
| T & | operator() (const unsigned int i) |
| T & | slice (const unsigned int i) |
| template<typename T2 > | |
| TypeVector< typename CompareTypes< T, T2 > ::supertype > | operator+ (const TypeVector< T2 > &) const |
| template<typename T2 > | |
| const TypeVector< T > & | operator+= (const TypeVector< T2 > &) |
| template<typename T2 > | |
| void | add (const TypeVector< T2 > &) |
| template<typename T2 > | |
| void | add_scaled (const TypeVector< T2 > &, const T) |
| template<typename T2 > | |
| TypeVector< typename CompareTypes< T, T2 > ::supertype > | operator- (const TypeVector< T2 > &) const |
| template<typename T2 > | |
| const TypeVector< T > & | operator-= (const TypeVector< T2 > &) |
| template<typename T2 > | |
| void | subtract (const TypeVector< T2 > &) |
| template<typename T2 > | |
| void | subtract_scaled (const TypeVector< T2 > &, const T) |
| TypeVector< T > | operator- () const |
| template<typename Scalar > | |
| boostcopy::enable_if_c < ScalarTraits< Scalar > ::value, TypeVector< typename CompareTypes< T, Scalar > ::supertype > >::type | operator* (const Scalar) const |
| const TypeVector< T > & | operator*= (const T) |
| template<typename Scalar > | |
| boostcopy::enable_if_c < ScalarTraits< Scalar > ::value, TypeVector< typename CompareTypes< T, Scalar > ::supertype > >::type | operator/ (const Scalar) const |
| const TypeVector< T > & | operator/= (const T) |
| template<typename T2 > | |
| CompareTypes< T, T2 >::supertype | operator* (const TypeVector< T2 > &) const |
| template<typename T2 > | |
| CompareTypes< T, T2 >::supertype | contract (const TypeVector< T2 > &) const |
| template<typename T2 > | |
| TypeVector< typename CompareTypes< T, T2 > ::supertype > | cross (const TypeVector< T2 > &) const |
| TypeVector< T > | unit () const |
| Real | size () const |
| Real | size_sq () const |
| void | zero () |
| bool | relative_fuzzy_equals (const TypeVector< T > &rhs, Real tol=TOLERANCE) const |
| bool | absolute_fuzzy_equals (const TypeVector< T > &rhs, Real tol=TOLERANCE) const |
| bool | operator== (const TypeVector< T > &rhs) const |
| bool | operator!= (const TypeVector< T > &rhs) const |
| bool | operator< (const TypeVector< T > &rhs) const |
| bool | operator<= (const TypeVector< T > &rhs) const |
| bool | operator> (const TypeVector< T > &rhs) const |
| bool | operator>= (const TypeVector< T > &rhs) const |
| void | print (std::ostream &os=libMesh::out) const |
| void | write_unformatted (std::ostream &out, const bool newline=true) const |
| template<> | |
| bool | operator< (const TypeVector< Complex > &rhs) const |
| template<> | |
| bool | operator<= (const TypeVector< Complex > &rhs) const |
| template<> | |
| bool | operator> (const TypeVector< Complex > &rhs) const |
| template<> | |
| bool | operator>= (const TypeVector< Complex > &rhs) const |
| template<> | |
| bool | operator!= (const TypeVector< Real > &rhs) const |
Protected Member Functions | |
| TypeVector () | |
| TypeVector (const T x, const T y=0, const T z=0) | |
| template<typename Scalar > | |
| TypeVector (const Scalar x, const Scalar y=0, typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, const Scalar >::type z=0) | |
Protected Attributes | |
| T | _coords [LIBMESH_DIM] |
Friends | |
| class | TypeVector |
| class | TypeTensor< T > |
| std::ostream & | operator<< (std::ostream &os, const TypeVector< T > &t) |
Detailed Description
template<typename T>
class libMesh::TypeVector< T >
This class defines a vector in LIBMESH_DIM dimensional space of type T. T may either be Real or Complex. The default constructor for this class is protected, suggesting that you should not instantiate one of these directly. Instead use one of the derived types: Point for a real-valued point in LIBMESH_DIM-space, or SpaceVector for a real or complex-valued vector in LIBMESH_DIM-space.
Definition at line 53 of file type_vector.h.
Constructor & Destructor Documentation
| libMesh::TypeVector< T >::TypeVector | ( | ) | [protected] |
Empty constructor. Gives the vector 0 in LIBMESH_DIM dimensions.
Referenced by libMesh::TypeVector< T >::operator-().
| libMesh::TypeVector< T >::TypeVector | ( | const T | x, | |
| const T | y = 0, |
|||
| const T | z = 0 | |||
| ) | [inline, protected] |
Constructor-from-T. By default sets higher dimensional entries to 0.
Definition at line 376 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
| libMesh::TypeVector< T >::TypeVector | ( | const Scalar | x, | |
| const Scalar | y = 0, |
|||
| typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, const Scalar >::type | z = 0 | |||
| ) | [inline, protected] |
Constructor-from-scalars. By default sets higher dimensional entries to 0.
Definition at line 399 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
| libMesh::TypeVector< T >::TypeVector | ( | const TypeVector< T2 > & | p | ) | [inline] |
Copy-constructor.
Definition at line 425 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00426 { 00427 // copy the nodes from vector p to me 00428 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00429 _coords[i] = p._coords[i]; 00430 }
| libMesh::TypeVector< T >::~TypeVector | ( | ) | [inline] |
Member Function Documentation
| bool libMesh::TypeVector< T >::absolute_fuzzy_equals | ( | const TypeVector< T > & | rhs, | |
| Real | tol = TOLERANCE | |||
| ) | const [inline] |
- Returns:
trueiff two vectors occupy approximately the same physical location in space, to within an absolute tolerance oftol.
Definition at line 854 of file type_vector.h.
References libMesh::TypeVector< T >::_coords, and std::abs().
Referenced by libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::LocationMap< T >::find(), and libMesh::TypeVector< T >::relative_fuzzy_equals().
00855 { 00856 #if LIBMESH_DIM == 1 00857 return (std::abs(_coords[0] - rhs._coords[0]) 00858 <= tol); 00859 #endif 00860 00861 #if LIBMESH_DIM == 2 00862 return (std::abs(_coords[0] - rhs._coords[0]) + 00863 std::abs(_coords[1] - rhs._coords[1]) 00864 <= tol); 00865 #endif 00866 00867 #if LIBMESH_DIM == 3 00868 return (std::abs(_coords[0] - rhs._coords[0]) + 00869 std::abs(_coords[1] - rhs._coords[1]) + 00870 std::abs(_coords[2] - rhs._coords[2]) 00871 <= tol); 00872 #endif 00873 }
| void libMesh::TypeVector< T >::add | ( | const TypeVector< T2 > & | p | ) | [inline] |
Add to this vector without creating a temporary.
Definition at line 516 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::Elem::centroid(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), libMesh::FE< Dim, T >::inverse_map(), libMesh::TypeVector< T >::operator+=(), libMesh::LaplaceMeshSmoother::smooth(), and libMesh::MeshTools::Modification::smooth().
00517 { 00518 #if LIBMESH_DIM == 1 00519 _coords[0] += p._coords[0]; 00520 #endif 00521 00522 #if LIBMESH_DIM == 2 00523 _coords[0] += p._coords[0]; 00524 _coords[1] += p._coords[1]; 00525 #endif 00526 00527 #if LIBMESH_DIM == 3 00528 _coords[0] += p._coords[0]; 00529 _coords[1] += p._coords[1]; 00530 _coords[2] += p._coords[2]; 00531 #endif 00532 00533 }
| void libMesh::TypeVector< T >::add_scaled | ( | const TypeVector< T2 > & | p, | |
| const T | factor | |||
| ) | [inline] |
Add a scaled value to this vector without creating a temporary.
Definition at line 540 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::System::calculate_norm(), libMesh::Elem::coarsen(), libMesh::MeshFunction::gradient(), libMesh::KellyErrorEstimator::internal_side_integration(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), libMesh::FE< Dim, T >::map(), libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::map_zeta(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::System::point_gradient(), libMesh::HPCoarsenTest::select_refinement(), and libMesh::MeshTools::Modification::smooth().
00541 { 00542 #if LIBMESH_DIM == 1 00543 _coords[0] += factor*p(0); 00544 #endif 00545 00546 #if LIBMESH_DIM == 2 00547 _coords[0] += factor*p(0); 00548 _coords[1] += factor*p(1); 00549 #endif 00550 00551 #if LIBMESH_DIM == 3 00552 _coords[0] += factor*p(0); 00553 _coords[1] += factor*p(1); 00554 _coords[2] += factor*p(2); 00555 #endif 00556 00557 }
| void libMesh::TypeVector< T >::assign | ( | const TypeVector< T2 > & | p | ) | [inline] |
Assign to a vector without creating a temporary.
Definition at line 445 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00446 { 00447 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00448 _coords[i] = p._coords[i]; 00449 }
| CompareTypes< T, T2 >::supertype libMesh::TypeVector< T >::contract | ( | const TypeVector< T2 > & | p | ) | const [inline] |
Multiply 2 vectors together, i.e. dot-product. The vectors may be of different types.
Definition at line 785 of file type_vector.h.
| TypeVector< typename CompareTypes< T, T2 >::supertype > libMesh::TypeVector< T >::cross | ( | const TypeVector< T2 > & | p | ) | const [inline] |
Cross 2 vectors together, i.e. cross-product.
Definition at line 795 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_map(), libMesh::Plane::create_from_three_points(), libMesh::Tri3::volume(), libMesh::Quad4::volume(), libMesh::Tet4::volume(), libMesh::Pyramid5::volume(), libMesh::Prism6::volume(), and libMesh::Hex8::volume().
00796 { 00797 typedef typename CompareTypes<T, T2>::supertype TS; 00798 libmesh_assert_equal_to (LIBMESH_DIM, 3); 00799 00800 // | i j k | 00801 // |(*this)(0) (*this)(1) (*this)(2)| 00802 // | p(0) p(1) p(2) | 00803 00804 return TypeVector<TS>( _coords[1]*p._coords[2] - _coords[2]*p._coords[1], 00805 -_coords[0]*p._coords[2] + _coords[2]*p._coords[0], 00806 _coords[0]*p._coords[1] - _coords[1]*p._coords[0]); 00807 }
| bool libMesh::TypeVector< Real >::operator!= | ( | const TypeVector< Real > & | rhs | ) | const [inline] |
Definition at line 926 of file type_vector.h.
| bool libMesh::TypeVector< T >::operator!= | ( | const TypeVector< T > & | rhs | ) | const |
- Returns:
trueiff two vectors do not occupy approximately the same physical location in space.
| T & libMesh::TypeVector< T >::operator() | ( | const unsigned int | i | ) | [inline] |
Return a writeable reference to the
element of the vector.
Definition at line 466 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00467 { 00468 libmesh_assert_less (i, LIBMESH_DIM); 00469 00470 return _coords[i]; 00471 }
| const T & libMesh::TypeVector< T >::operator() | ( | const unsigned int | i | ) | const [inline] |
Return the
element of the vector.
Definition at line 455 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00456 { 00457 libmesh_assert_less (i, LIBMESH_DIM); 00458 00459 return _coords[i]; 00460 }
| CompareTypes< T, T2 >::supertype libMesh::TypeVector< T >::operator* | ( | const TypeVector< T2 > & | p | ) | const [inline] |
Multiply 2 vectors together, i.e. dot-product. The vectors may be of different types.
Definition at line 763 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00764 { 00765 #if LIBMESH_DIM == 1 00766 return _coords[0]*p._coords[0]; 00767 #endif 00768 00769 #if LIBMESH_DIM == 2 00770 return (_coords[0]*p._coords[0] + 00771 _coords[1]*p._coords[1]); 00772 #endif 00773 00774 #if LIBMESH_DIM == 3 00775 return (_coords[0]*p(0) + 00776 _coords[1]*p(1) + 00777 _coords[2]*p(2)); 00778 #endif 00779 }
| boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type libMesh::TypeVector< T >::operator* | ( | const Scalar | factor | ) | const [inline] |
Multiply a vector by a number, i.e. scale.
Definition at line 652 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00653 { 00654 typedef typename CompareTypes<T, Scalar>::supertype SuperType; 00655 00656 #if LIBMESH_DIM == 1 00657 return TypeVector<SuperType>(_coords[0]*factor); 00658 #endif 00659 00660 #if LIBMESH_DIM == 2 00661 return TypeVector<SuperType>(_coords[0]*factor, 00662 _coords[1]*factor); 00663 #endif 00664 00665 #if LIBMESH_DIM == 3 00666 return TypeVector<SuperType>(_coords[0]*factor, 00667 _coords[1]*factor, 00668 _coords[2]*factor); 00669 #endif 00670 }
| const TypeVector< T > & libMesh::TypeVector< T >::operator*= | ( | const T | factor | ) | [inline] |
Multiply this vector by a number, i.e. scale.
Definition at line 689 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00690 { 00691 #if LIBMESH_DIM == 1 00692 _coords[0] *= factor; 00693 #endif 00694 00695 #if LIBMESH_DIM == 2 00696 _coords[0] *= factor; 00697 _coords[1] *= factor; 00698 #endif 00699 00700 #if LIBMESH_DIM == 3 00701 _coords[0] *= factor; 00702 _coords[1] *= factor; 00703 _coords[2] *= factor; 00704 #endif 00705 00706 return *this; 00707 }
| TypeVector< typename CompareTypes< T, T2 >::supertype > libMesh::TypeVector< T >::operator+ | ( | const TypeVector< T2 > & | p | ) | const [inline] |
Add two vectors.
Definition at line 479 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00480 { 00481 typedef typename CompareTypes<T, T2>::supertype TS; 00482 #if LIBMESH_DIM == 1 00483 return TypeVector<TS> (_coords[0] + p._coords[0]); 00484 #endif 00485 00486 #if LIBMESH_DIM == 2 00487 return TypeVector<TS> (_coords[0] + p._coords[0], 00488 _coords[1] + p._coords[1]); 00489 #endif 00490 00491 #if LIBMESH_DIM == 3 00492 return TypeVector<TS> (_coords[0] + p._coords[0], 00493 _coords[1] + p._coords[1], 00494 _coords[2] + p._coords[2]); 00495 #endif 00496 00497 }
| const TypeVector< T > & libMesh::TypeVector< T >::operator+= | ( | const TypeVector< T2 > & | p | ) | [inline] |
Add to this vector.
Definition at line 504 of file type_vector.h.
References libMesh::TypeVector< T >::add().
00505 { 00506 this->add (p); 00507 00508 return *this; 00509 }
| TypeVector< T > libMesh::TypeVector< T >::operator- | ( | ) | const [inline] |
Return the opposite of a vector
Definition at line 624 of file type_vector.h.
References libMesh::TypeVector< T >::_coords, and libMesh::TypeVector< T >::TypeVector().
00625 { 00626 00627 #if LIBMESH_DIM == 1 00628 return TypeVector(-_coords[0]); 00629 #endif 00630 00631 #if LIBMESH_DIM == 2 00632 return TypeVector(-_coords[0], 00633 -_coords[1]); 00634 #endif 00635 00636 #if LIBMESH_DIM == 3 00637 return TypeVector(-_coords[0], 00638 -_coords[1], 00639 -_coords[2]); 00640 #endif 00641 00642 }
| TypeVector< typename CompareTypes< T, T2 >::supertype > libMesh::TypeVector< T >::operator- | ( | const TypeVector< T2 > & | p | ) | const [inline] |
Subtract two vectors.
Definition at line 565 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00566 { 00567 typedef typename CompareTypes<T, T2>::supertype TS; 00568 00569 #if LIBMESH_DIM == 1 00570 return TypeVector<TS>(_coords[0] - p._coords[0]); 00571 #endif 00572 00573 #if LIBMESH_DIM == 2 00574 return TypeVector<TS>(_coords[0] - p._coords[0], 00575 _coords[1] - p._coords[1]); 00576 #endif 00577 00578 #if LIBMESH_DIM == 3 00579 return TypeVector<TS>(_coords[0] - p._coords[0], 00580 _coords[1] - p._coords[1], 00581 _coords[2] - p._coords[2]); 00582 #endif 00583 00584 }
| const TypeVector< T > & libMesh::TypeVector< T >::operator-= | ( | const TypeVector< T2 > & | p | ) | [inline] |
Subtract from this vector.
Definition at line 591 of file type_vector.h.
References libMesh::TypeVector< T >::subtract().
00592 { 00593 this->subtract (p); 00594 00595 return *this; 00596 }
| boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type libMesh::TypeVector< T >::operator/ | ( | const Scalar | factor | ) | const [inline] |
Divide a vector by a number, i.e. scale.
Definition at line 717 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00718 { 00719 libmesh_assert_not_equal_to (factor, static_cast<T>(0.)); 00720 00721 typedef typename CompareTypes<T, Scalar>::supertype TS; 00722 00723 #if LIBMESH_DIM == 1 00724 return TypeVector<TS>(_coords[0]/factor); 00725 #endif 00726 00727 #if LIBMESH_DIM == 2 00728 return TypeVector<TS>(_coords[0]/factor, 00729 _coords[1]/factor); 00730 #endif 00731 00732 #if LIBMESH_DIM == 3 00733 return TypeVector<TS>(_coords[0]/factor, 00734 _coords[1]/factor, 00735 _coords[2]/factor); 00736 #endif 00737 00738 }
| const TypeVector< T > & libMesh::TypeVector< T >::operator/= | ( | const T | factor | ) | [inline] |
Divide this vector by a number, i.e. scale.
Definition at line 746 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00747 { 00748 libmesh_assert_not_equal_to (factor, static_cast<T>(0.)); 00749 00750 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00751 _coords[i] /= factor; 00752 00753 return *this; 00754 }
| bool libMesh::TypeVector< Complex >::operator< | ( | const TypeVector< Complex > & | rhs | ) | const [inline] |
Definition at line 167 of file type_vector.C.
00168 { 00169 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00170 { 00171 if ((*this)(i).real() < rhs(i).real()) 00172 return true; 00173 if ((*this)(i).real() > rhs(i).real()) 00174 return false; 00175 if ((*this)(i).imag() < rhs(i).imag()) 00176 return true; 00177 if ((*this)(i).imag() > rhs(i).imag()) 00178 return false; 00179 } 00180 return false; 00181 }
| bool libMesh::TypeVector< T >::operator< | ( | const TypeVector< T > & | rhs | ) | const [inline] |
- Returns:
trueif this vector is "less" than another. Useful for sorting. Also used for choosing some arbitrary basis function orientations
Definition at line 109 of file type_vector.C.
| bool libMesh::TypeVector< Complex >::operator<= | ( | const TypeVector< Complex > & | rhs | ) | const [inline] |
Definition at line 186 of file type_vector.C.
00187 { 00188 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00189 { 00190 if ((*this)(i).real() < rhs(i).real()) 00191 return true; 00192 if ((*this)(i).real() > rhs(i).real()) 00193 return false; 00194 if ((*this)(i).imag() < rhs(i).imag()) 00195 return true; 00196 if ((*this)(i).imag() > rhs(i).imag()) 00197 return false; 00198 } 00199 return true; 00200 }
| bool libMesh::TypeVector< T >::operator<= | ( | const TypeVector< T > & | rhs | ) | const [inline] |
- Returns:
trueif this vector is "less" than or equal to another. Useful for sorting. Also used for choosing some arbitrary constraint equation directions
Definition at line 123 of file type_vector.C.
| boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeVector&>::type libMesh::TypeVector< T >::operator= | ( | const Scalar & | p | ) | [inline] |
Assignment-from-scalar operator. Used only to zero out vectors.
Reimplemented in libMesh::VectorValue< T >, and libMesh::VectorValue< Real >.
Definition at line 115 of file type_vector.h.
00116 { libmesh_assert_equal_to (p, Scalar(0)); this->zero(); return *this; }
| bool libMesh::TypeVector< T >::operator== | ( | const TypeVector< T > & | rhs | ) | const [inline] |
- Returns:
trueiff two vectors occupy approximately the same physical location in space, to within an absolute tolerance ofTOLERANCE.
Reimplemented in libMesh::Node.
Definition at line 904 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
00905 { 00906 #if LIBMESH_DIM == 1 00907 return (_coords[0] == rhs._coords[0]); 00908 #endif 00909 00910 #if LIBMESH_DIM == 2 00911 return (_coords[0] == rhs._coords[0] && 00912 _coords[1] == rhs._coords[1]); 00913 #endif 00914 00915 #if LIBMESH_DIM == 3 00916 return (_coords[0] == rhs._coords[0] && 00917 _coords[1] == rhs._coords[1] && 00918 _coords[2] == rhs._coords[2]); 00919 #endif 00920 }
| bool libMesh::TypeVector< Complex >::operator> | ( | const TypeVector< Complex > & | rhs | ) | const [inline] |
Definition at line 205 of file type_vector.C.
00206 { 00207 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00208 { 00209 if ((*this)(i).real() > rhs(i).real()) 00210 return true; 00211 if ((*this)(i).real() < rhs(i).real()) 00212 return false; 00213 if ((*this)(i).imag() > rhs(i).imag()) 00214 return true; 00215 if ((*this)(i).imag() < rhs(i).imag()) 00216 return false; 00217 } 00218 return false; 00219 }
| bool libMesh::TypeVector< T >::operator> | ( | const TypeVector< T > & | rhs | ) | const [inline] |
- Returns:
trueif this vector is "greater" than another. Useful for sorting. Also used for choosing some arbitrary basis function orientations
Definition at line 138 of file type_vector.C.
| bool libMesh::TypeVector< Complex >::operator>= | ( | const TypeVector< Complex > & | rhs | ) | const [inline] |
Definition at line 224 of file type_vector.C.
00225 { 00226 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00227 { 00228 if ((*this)(i).real() > rhs(i).real()) 00229 return true; 00230 if ((*this)(i).real() < rhs(i).real()) 00231 return false; 00232 if ((*this)(i).imag() > rhs(i).imag()) 00233 return true; 00234 if ((*this)(i).imag() < rhs(i).imag()) 00235 return false; 00236 } 00237 return true; 00238 }
| bool libMesh::TypeVector< T >::operator>= | ( | const TypeVector< T > & | rhs | ) | const [inline] |
- Returns:
trueif this vector is "greater" than or equal to another. Useful for sorting. Also used for choosing some arbitrary constraint equation directions
Definition at line 152 of file type_vector.C.
| void libMesh::TypeVector< T >::print | ( | std::ostream & | os = libMesh::out |
) | const [inline] |
Formatted print, by default to libMesh::out.
Definition at line 64 of file type_vector.C.
00065 { 00066 #if LIBMESH_DIM == 1 00067 00068 os << "x=" << (*this)(0); 00069 00070 #endif 00071 #if LIBMESH_DIM == 2 00072 00073 os << "(x,y)=(" 00074 << std::setw(8) << (*this)(0) << ", " 00075 << std::setw(8) << (*this)(1) << ")"; 00076 00077 #endif 00078 #if LIBMESH_DIM == 3 00079 00080 os << "(x,y,z)=(" 00081 << std::setw(8) << (*this)(0) << ", " 00082 << std::setw(8) << (*this)(1) << ", " 00083 << std::setw(8) << (*this)(2) << ")"; 00084 #endif 00085 }
| bool libMesh::TypeVector< T >::relative_fuzzy_equals | ( | const TypeVector< T > & | rhs, | |
| Real | tol = TOLERANCE | |||
| ) | const [inline] |
- Returns:
trueiff two vectors occupy approximately the same physical location in space, to within a relative tolerance oftol.
Definition at line 879 of file type_vector.h.
References libMesh::TypeVector< T >::_coords, std::abs(), and libMesh::TypeVector< T >::absolute_fuzzy_equals().
Referenced by libMesh::Quad9::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Hex27::has_affine_map(), and libMesh::Hex20::has_affine_map().
00880 { 00881 #if LIBMESH_DIM == 1 00882 return this->absolute_fuzzy_equals(rhs, tol * 00883 (std::abs(_coords[0]) + std::abs(rhs._coords[0]))); 00884 #endif 00885 00886 #if LIBMESH_DIM == 2 00887 return this->absolute_fuzzy_equals(rhs, tol * 00888 (std::abs(_coords[0]) + std::abs(rhs._coords[0]) + 00889 std::abs(_coords[1]) + std::abs(rhs._coords[1]))); 00890 #endif 00891 00892 #if LIBMESH_DIM == 3 00893 return this->absolute_fuzzy_equals(rhs, tol * 00894 (std::abs(_coords[0]) + std::abs(rhs._coords[0]) + 00895 std::abs(_coords[1]) + std::abs(rhs._coords[1]) + 00896 std::abs(_coords[2]) + std::abs(rhs._coords[2]))); 00897 #endif 00898 }
| Real libMesh::TypeVector< T >::size | ( | ) | const [inline] |
Returns the magnitude of the vector, i.e. the square-root of the sum of the elements squared.
Definition at line 813 of file type_vector.h.
References libMesh::TypeVector< T >::size_sq().
Referenced by libMesh::Sphere::above_surface(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::System::calculate_norm(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), libMesh::FE< Dim, T >::inverse_map(), libMesh::FEInterface::inverse_map(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::Sphere::on_surface(), libMesh::Tri::quality(), libMesh::MeshTools::Modification::smooth(), libMesh::Sphere::surface_coords(), and libMesh::TypeVector< T >::unit().
00814 { 00815 return std::sqrt(this->size_sq()); 00816 }
| Real libMesh::TypeVector< T >::size_sq | ( | ) | const [inline] |
Returns the magnitude of the vector squared, i.e. the sum of the element magnitudes squared.
Definition at line 832 of file type_vector.h.
References libMesh::TypeVector< T >::_coords, and libMesh::TensorTools::norm_sq().
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::System::calculate_norm(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::TensorTools::norm_sq(), libMesh::HPCoarsenTest::select_refinement(), libMesh::TypeVector< T >::size(), libMesh::Sphere::Sphere(), and libMesh::Edge3::volume().
00833 { 00834 #if LIBMESH_DIM == 1 00835 return (TensorTools::norm_sq(_coords[0])); 00836 #endif 00837 00838 #if LIBMESH_DIM == 2 00839 return (TensorTools::norm_sq(_coords[0]) + 00840 TensorTools::norm_sq(_coords[1])); 00841 #endif 00842 00843 #if LIBMESH_DIM == 3 00844 return (TensorTools::norm_sq(_coords[0]) + 00845 TensorTools::norm_sq(_coords[1]) + 00846 TensorTools::norm_sq(_coords[2])); 00847 #endif 00848 }
| T& libMesh::TypeVector< T >::slice | ( | const unsigned int | i | ) | [inline] |
Definition at line 130 of file type_vector.h.
| const T& libMesh::TypeVector< T >::slice | ( | const unsigned int | i | ) | const [inline] |
Definition at line 123 of file type_vector.h.
| void libMesh::TypeVector< T >::subtract | ( | const TypeVector< T2 > & | p | ) | [inline] |
Subtract from this vector without creating a temporary.
Definition at line 603 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::TypeVector< T >::operator-=().
00604 { 00605 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00606 _coords[i] -= p._coords[i]; 00607 }
| void libMesh::TypeVector< T >::subtract_scaled | ( | const TypeVector< T2 > & | p, | |
| const T | factor | |||
| ) | [inline] |
Subtract a scaled value from this vector without creating a temporary.
Definition at line 614 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::HPCoarsenTest::select_refinement().
00615 { 00616 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00617 _coords[i] -= factor*p(i); 00618 }
| TypeVector< T > libMesh::TypeVector< T >::unit | ( | ) | const [inline] |
Think of a vector as a dim dimensional vector. This will return a unit vector aligned in that direction.
Definition at line 37 of file type_vector.C.
References libMesh::TypeVector< T >::_coords, libMesh::Real, and libMesh::TypeVector< T >::size().
Referenced by libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_map(), libMesh::Plane::create_from_point_normal(), libMesh::Plane::create_from_three_points(), libMesh::MeshTools::Modification::distort(), and libMesh::Sphere::unit_normal().
00038 { 00039 00040 const Real length = size(); 00041 00042 libmesh_assert_not_equal_to (length, static_cast<Real>(0.)); 00043 00044 #if LIBMESH_DIM == 1 00045 return TypeVector<T>(_coords[0]/length); 00046 #endif 00047 00048 #if LIBMESH_DIM == 2 00049 return TypeVector<T>(_coords[0]/length, 00050 _coords[1]/length); 00051 #endif 00052 00053 #if LIBMESH_DIM == 3 00054 return TypeVector<T>(_coords[0]/length, 00055 _coords[1]/length, 00056 _coords[2]/length); 00057 #endif 00058 00059 }
| void libMesh::TypeVector< T >::write_unformatted | ( | std::ostream & | out, | |
| const bool | newline = true | |||
| ) | const [inline] |
Unformatted print to the stream out. Simply prints the elements of the vector separated by spaces. Optionally prints a newline, which it does by default.
Definition at line 92 of file type_vector.C.
Referenced by libMesh::InfElemBuilder::build_inf_elem(), libMesh::TecplotIO::write_ascii(), and libMesh::DivaIO::write_stream().
| void libMesh::TypeVector< T >::zero | ( | ) | [inline] |
Zero the vector in any dimension.
Definition at line 822 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
Referenced by libMesh::VectorValue< Real >::operator=(), and libMesh::TypeVector< Real >::operator=().
00823 { 00824 for (unsigned int i=0; i<LIBMESH_DIM; i++) 00825 _coords[i] = 0.; 00826 }
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const TypeVector< T > & | t | |||
| ) | [friend] |
Formatted print as above but allows you to do Point p(1,2,3); std::cout << p << std::endl;
Definition at line 329 of file type_vector.h.
friend class TypeTensor< T > [friend] |
Definition at line 58 of file type_vector.h.
libMesh::TypeVector< T >::TypeVector [friend] |
Definition at line 56 of file type_vector.h.
Member Data Documentation
T libMesh::TypeVector< T >::_coords[LIBMESH_DIM] [protected] |
The coordinates of the TypeVector
Definition at line 347 of file type_vector.h.
Referenced by libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::TypeVector< T >::add(), libMesh::TypeVector< T >::add_scaled(), libMesh::TypeVector< T >::assign(), libMesh::TypeVector< T >::cross(), libMesh::TypeVector< T >::operator()(), libMesh::TypeVector< T >::operator*(), libMesh::TypeVector< T >::operator*=(), libMesh::TypeVector< T >::operator+(), libMesh::TypeVector< T >::operator-(), libMesh::TypeVector< T >::operator/(), libMesh::TypeVector< T >::operator/=(), libMesh::TypeVector< T >::operator==(), libMesh::TypeVector< T >::relative_fuzzy_equals(), libMesh::TypeTensor< T >::row(), libMesh::TypeVector< T >::size_sq(), libMesh::TypeVector< T >::subtract(), libMesh::TypeVector< T >::subtract_scaled(), libMesh::TypeVector< T >::TypeVector(), libMesh::TypeVector< T >::unit(), and libMesh::TypeVector< T >::zero().
The documentation for this class was generated from the following files:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:42 UTC
Hosted By: