$extrastylesheet
#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) |
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.
| libMesh::TypeVector< T >::TypeVector | ( | ) | [protected] |
Empty constructor. Gives the vector 0 in LIBMESH_DIM dimensions.
| 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::x.
| 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::x.
| 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.
{
// copy the nodes from vector p to me
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] = p._coords[i];
}
| libMesh::TypeVector< T >::~TypeVector | ( | ) | [inline] |
| bool libMesh::TypeVector< T >::absolute_fuzzy_equals | ( | const TypeVector< T > & | rhs, |
| Real | tol = TOLERANCE |
||
| ) | const [inline] |
true iff two vectors occupy approximately the same physical location in space, to within an absolute tolerance of tol. 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::SerialMesh::stitching_helper().
{
#if LIBMESH_DIM == 1
return (std::abs(_coords[0] - rhs._coords[0])
<= tol);
#endif
#if LIBMESH_DIM == 2
return (std::abs(_coords[0] - rhs._coords[0]) +
std::abs(_coords[1] - rhs._coords[1])
<= tol);
#endif
#if LIBMESH_DIM == 3
return (std::abs(_coords[0] - rhs._coords[0]) +
std::abs(_coords[1] - rhs._coords[1]) +
std::abs(_coords[2] - rhs._coords[2])
<= tol);
#endif
}
| 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::FE< Dim, T >::inverse_map(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), libMesh::LaplaceMeshSmoother::smooth(), and libMesh::MeshTools::Modification::smooth().
| 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.
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::InfFE< Dim, T_radial, T_map >::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().
| 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] = p._coords[i];
}
| 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.
{
return (*this)*(p);
}
| TypeVector< typename CompareTypes< T, T2 >::supertype > libMesh::TypeVector< T >::cross | ( | const TypeVector< T2 > & | p | ) | const |
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::Quad4::volume(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Prism6::volume(), libMesh::Hex8::volume(), and libMesh::Tet4::volume().
{
typedef typename CompareTypes<T, T2>::supertype TS;
libmesh_assert_equal_to (LIBMESH_DIM, 3);
// | i j k |
// |(*this)(0) (*this)(1) (*this)(2)|
// | p(0) p(1) p(2) |
return TypeVector<TS>( _coords[1]*p._coords[2] - _coords[2]*p._coords[1],
-_coords[0]*p._coords[2] + _coords[2]*p._coords[0],
_coords[0]*p._coords[1] - _coords[1]*p._coords[0]);
}
| bool libMesh::TypeVector< T >::operator!= | ( | const TypeVector< T > & | rhs | ) | const |
true iff two vectors do not occupy approximately the same physical location in space. | bool libMesh::TypeVector< Real >::operator!= | ( | const TypeVector< Real > & | rhs | ) | const [inline] |
Definition at line 926 of file type_vector.h.
{
return (!(*this == rhs));
}
| 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.
{
libmesh_assert_less (i, LIBMESH_DIM);
return _coords[i];
}
| 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.
{
libmesh_assert_less (i, LIBMESH_DIM);
return _coords[i];
}
| 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.
{
typedef typename CompareTypes<T, Scalar>::supertype SuperType;
#if LIBMESH_DIM == 1
return TypeVector<SuperType>(_coords[0]*factor);
#endif
#if LIBMESH_DIM == 2
return TypeVector<SuperType>(_coords[0]*factor,
_coords[1]*factor);
#endif
#if LIBMESH_DIM == 3
return TypeVector<SuperType>(_coords[0]*factor,
_coords[1]*factor,
_coords[2]*factor);
#endif
}
| 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.
| 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.
| 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.
{
typedef typename CompareTypes<T, T2>::supertype TS;
#if LIBMESH_DIM == 1
return TypeVector<TS> (_coords[0] + p._coords[0]);
#endif
#if LIBMESH_DIM == 2
return TypeVector<TS> (_coords[0] + p._coords[0],
_coords[1] + p._coords[1]);
#endif
#if LIBMESH_DIM == 3
return TypeVector<TS> (_coords[0] + p._coords[0],
_coords[1] + p._coords[1],
_coords[2] + p._coords[2]);
#endif
}
| const TypeVector< T > & libMesh::TypeVector< T >::operator+= | ( | const TypeVector< T2 > & | p | ) | [inline] |
| 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.
{
typedef typename CompareTypes<T, T2>::supertype TS;
#if LIBMESH_DIM == 1
return TypeVector<TS>(_coords[0] - p._coords[0]);
#endif
#if LIBMESH_DIM == 2
return TypeVector<TS>(_coords[0] - p._coords[0],
_coords[1] - p._coords[1]);
#endif
#if LIBMESH_DIM == 3
return TypeVector<TS>(_coords[0] - p._coords[0],
_coords[1] - p._coords[1],
_coords[2] - p._coords[2]);
#endif
}
| TypeVector< T > libMesh::TypeVector< T >::operator- | ( | ) | const [inline] |
Return the opposite of a vector
Definition at line 624 of file type_vector.h.
{
#if LIBMESH_DIM == 1
return TypeVector(-_coords[0]);
#endif
#if LIBMESH_DIM == 2
return TypeVector(-_coords[0],
-_coords[1]);
#endif
#if LIBMESH_DIM == 3
return TypeVector(-_coords[0],
-_coords[1],
-_coords[2]);
#endif
}
| 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.
{
this->subtract (p);
return *this;
}
| 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.
{
libmesh_assert_not_equal_to (factor, static_cast<T>(0.));
typedef typename CompareTypes<T, Scalar>::supertype TS;
#if LIBMESH_DIM == 1
return TypeVector<TS>(_coords[0]/factor);
#endif
#if LIBMESH_DIM == 2
return TypeVector<TS>(_coords[0]/factor,
_coords[1]/factor);
#endif
#if LIBMESH_DIM == 3
return TypeVector<TS>(_coords[0]/factor,
_coords[1]/factor,
_coords[2]/factor);
#endif
}
| 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.
{
libmesh_assert_not_equal_to (factor, static_cast<T>(0.));
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] /= factor;
return *this;
}
| bool libMesh::TypeVector< Complex >::operator< | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 167 of file type_vector.C.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i).real() < rhs(i).real())
return true;
if ((*this)(i).real() > rhs(i).real())
return false;
if ((*this)(i).imag() < rhs(i).imag())
return true;
if ((*this)(i).imag() > rhs(i).imag())
return false;
}
return false;
}
| bool libMesh::TypeVector< T >::operator< | ( | const TypeVector< T > & | rhs | ) | const |
true if 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i) < rhs(i))
return true;
if ((*this)(i) > rhs(i))
return false;
}
return false;
}
| bool libMesh::TypeVector< Complex >::operator<= | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 186 of file type_vector.C.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i).real() < rhs(i).real())
return true;
if ((*this)(i).real() > rhs(i).real())
return false;
if ((*this)(i).imag() < rhs(i).imag())
return true;
if ((*this)(i).imag() > rhs(i).imag())
return false;
}
return true;
}
| bool libMesh::TypeVector< T >::operator<= | ( | const TypeVector< T > & | rhs | ) | const |
true if 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i) < rhs(i))
return true;
if ((*this)(i) > rhs(i))
return false;
}
return true;
}
| 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.
Definition at line 115 of file type_vector.h.
{ libmesh_assert_equal_to (p, Scalar(0)); this->zero(); return *this; }
| bool libMesh::TypeVector< T >::operator== | ( | const TypeVector< T > & | rhs | ) | const [inline] |
true iff two vectors occupy approximately the same physical location in space, to within an absolute tolerance of TOLERANCE. Definition at line 904 of file type_vector.h.
References libMesh::TypeVector< T >::_coords.
{
#if LIBMESH_DIM == 1
return (_coords[0] == rhs._coords[0]);
#endif
#if LIBMESH_DIM == 2
return (_coords[0] == rhs._coords[0] &&
_coords[1] == rhs._coords[1]);
#endif
#if LIBMESH_DIM == 3
return (_coords[0] == rhs._coords[0] &&
_coords[1] == rhs._coords[1] &&
_coords[2] == rhs._coords[2]);
#endif
}
| bool libMesh::TypeVector< Complex >::operator> | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 205 of file type_vector.C.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i).real() > rhs(i).real())
return true;
if ((*this)(i).real() < rhs(i).real())
return false;
if ((*this)(i).imag() > rhs(i).imag())
return true;
if ((*this)(i).imag() < rhs(i).imag())
return false;
}
return false;
}
| bool libMesh::TypeVector< T >::operator> | ( | const TypeVector< T > & | rhs | ) | const |
true if 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i) > rhs(i))
return true;
if ((*this)(i) < rhs(i))
return false;
}
return false;
}
| bool libMesh::TypeVector< Complex >::operator>= | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 224 of file type_vector.C.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i).real() > rhs(i).real())
return true;
if ((*this)(i).real() < rhs(i).real())
return false;
if ((*this)(i).imag() > rhs(i).imag())
return true;
if ((*this)(i).imag() < rhs(i).imag())
return false;
}
return true;
}
| bool libMesh::TypeVector< T >::operator>= | ( | const TypeVector< T > & | rhs | ) | const |
true if 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
{
if ((*this)(i) > rhs(i))
return true;
if ((*this)(i) < rhs(i))
return false;
}
return true;
}
| void libMesh::TypeVector< T >::print | ( | std::ostream & | os = libMesh::out | ) | const |
Formatted print, by default to libMesh::out.
Definition at line 64 of file type_vector.C.
{
#if LIBMESH_DIM == 1
os << "x=" << (*this)(0);
#endif
#if LIBMESH_DIM == 2
os << "(x,y)=("
<< std::setw(8) << (*this)(0) << ", "
<< std::setw(8) << (*this)(1) << ")";
#endif
#if LIBMESH_DIM == 3
os << "(x,y,z)=("
<< std::setw(8) << (*this)(0) << ", "
<< std::setw(8) << (*this)(1) << ", "
<< std::setw(8) << (*this)(2) << ")";
#endif
}
| bool libMesh::TypeVector< T >::relative_fuzzy_equals | ( | const TypeVector< T > & | rhs, |
| Real | tol = TOLERANCE |
||
| ) | const [inline] |
true iff two vectors occupy approximately the same physical location in space, to within a relative tolerance of tol. Definition at line 879 of file type_vector.h.
References libMesh::TypeVector< T >::_coords, and std::abs().
Referenced by libMesh::Prism6::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Hex20::has_affine_map(), libMesh::Prism15::has_affine_map(), and libMesh::Prism18::has_affine_map().
{
#if LIBMESH_DIM == 1
return this->absolute_fuzzy_equals(rhs, tol *
(std::abs(_coords[0]) + std::abs(rhs._coords[0])));
#endif
#if LIBMESH_DIM == 2
return this->absolute_fuzzy_equals(rhs, tol *
(std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
std::abs(_coords[1]) + std::abs(rhs._coords[1])));
#endif
#if LIBMESH_DIM == 3
return this->absolute_fuzzy_equals(rhs, tol *
(std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
std::abs(_coords[1]) + std::abs(rhs._coords[1]) +
std::abs(_coords[2]) + std::abs(rhs._coords[2])));
#endif
}
| 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.
Referenced by libMesh::Sphere::above_surface(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::System::calculate_norm(), libMesh::DofMap::get_info(), libMesh::FEInterface::inverse_map(), libMesh::FE< Dim, T >::inverse_map(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::Sphere::on_surface(), libMesh::Tri::quality(), libMesh::DofMap::scatter_constraints(), libMesh::MeshTools::Modification::smooth(), and libMesh::Sphere::surface_coords().
{
return std::sqrt(this->size_sq());
}
| 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::TensorTools::norm_sq().
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::System::calculate_norm(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism6::contains_point(), libMesh::InfHex8::contains_point(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::TensorTools::norm_sq(), libMesh::PointLocatorList::operator()(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Sphere::Sphere(), and libMesh::Edge3::volume().
{
#if LIBMESH_DIM == 1
return (TensorTools::norm_sq(_coords[0]));
#endif
#if LIBMESH_DIM == 2
return (TensorTools::norm_sq(_coords[0]) +
TensorTools::norm_sq(_coords[1]));
#endif
#if LIBMESH_DIM == 3
return (TensorTools::norm_sq(_coords[0]) +
TensorTools::norm_sq(_coords[1]) +
TensorTools::norm_sq(_coords[2]));
#endif
}
| const T& libMesh::TypeVector< T >::slice | ( | const unsigned int | i | ) | const [inline] |
Definition at line 123 of file type_vector.h.
{ return (*this)(i); }
| T& libMesh::TypeVector< T >::slice | ( | const unsigned int | i | ) | [inline] |
Definition at line 130 of file type_vector.h.
{ return (*this)(i); }
| 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.
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] -= p._coords[i];
}
| 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.
Referenced by libMesh::HPCoarsenTest::select_refinement().
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] -= factor*p(i);
}
| TypeVector< T > libMesh::TypeVector< T >::unit | ( | ) | const |
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::Real.
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().
{
const Real length = size();
libmesh_assert_not_equal_to (length, static_cast<Real>(0.));
#if LIBMESH_DIM == 1
return TypeVector<T>(_coords[0]/length);
#endif
#if LIBMESH_DIM == 2
return TypeVector<T>(_coords[0]/length,
_coords[1]/length);
#endif
#if LIBMESH_DIM == 3
return TypeVector<T>(_coords[0]/length,
_coords[1]/length,
_coords[2]/length);
#endif
}
| void libMesh::TypeVector< T >::write_unformatted | ( | std::ostream & | out, |
| const bool | newline = true |
||
| ) | const |
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.
References libMesh::libmesh_assert().
Referenced by libMesh::InfElemBuilder::build_inf_elem(), libMesh::TecplotIO::write_ascii(), and libMesh::DivaIO::write_stream().
{
libmesh_assert (os);
os << std::setiosflags(std::ios::showpoint)
<< (*this)(0) << " "
<< (*this)(1) << " "
<< (*this)(2) << " ";
if (newline)
os << '\n';
}
| void libMesh::TypeVector< T >::zero | ( | ) | [inline] |
Zero the vector in any dimension.
Definition at line 822 of file type_vector.h.
Referenced by libMesh::VectorValue< Real >::operator=(), and libMesh::TypeVector< Real >::operator=().
{
for (unsigned int i=0; i<LIBMESH_DIM; i++)
_coords[i] = 0.;
}
| 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.
{
t.print(os);
return os;
}
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.
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 >::assign(), libMesh::TypeVector< T >::cross(), 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 >::subtract(), and libMesh::TypeVector< T >::TypeVector().