libMesh
|
This class defines a vector in LIBMESH_DIM
dimensional space of type T.
More...
#include <tensor_tools.h>
Public Types | |
typedef T | value_type |
Helper typedef for C++98 generic programming. More... | |
typedef unsigned int | index_type |
Helper typedef for generic index programming. More... | |
Public Member Functions | |
TypeVector () | |
Empty constructor. More... | |
template<typename T2 > | |
TypeVector (const TypeVector< T2 > &p) | |
Copy-constructor. More... | |
TypeVector (const TypeVector &p)=default | |
Copy-constructor for the trivial case. More... | |
~TypeVector ()=default | |
Destructor. More... | |
template<typename T2 > | |
void | assign (const TypeVector< T2 > &) |
Assign to this vector without creating a temporary. More... | |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector & >::type | operator= (const Scalar &libmesh_dbg_var(p)) |
Assignment-from-scalar operator. More... | |
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 |
Add two vectors. More... | |
template<typename T2 > | |
const TypeVector< T > & | operator+= (const TypeVector< T2 > &) |
Add to this vector. More... | |
template<typename T2 > | |
void | add (const TypeVector< T2 > &) |
Add to this vector without creating a temporary. More... | |
template<typename T2 > | |
void | add_scaled (const TypeVector< T2 > &, const T &) |
Add a scaled value to this vector without creating a temporary. More... | |
template<typename T2 > | |
TypeVector< typename CompareTypes< T, T2 >::supertype > | operator- (const TypeVector< T2 > &) const |
Subtract from this vector. More... | |
template<typename T2 > | |
const TypeVector< T > & | operator-= (const TypeVector< T2 > &) |
Subtract from this vector. More... | |
template<typename T2 > | |
void | subtract (const TypeVector< T2 > &) |
Subtract from this vector without creating a temporary. More... | |
template<typename T2 > | |
void | subtract_scaled (const TypeVector< T2 > &, const T &) |
Subtract a scaled value from this vector without creating a temporary. More... | |
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 |
Multiply this vector by a scalar value. More... | |
const TypeVector< T > & | operator*= (const T &) |
Multiply this vector by a scalar value. More... | |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type | operator/ (const Scalar &) const |
Divide each entry of this vector by scalar value. More... | |
const TypeVector< T > & | operator/= (const T &) |
Divide each entry of this vector by scalar value. More... | |
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 > &v) const |
TypeVector< T > | unit () const |
auto | norm () const -> decltype(std::norm(T())) |
auto | norm_sq () const -> decltype(std::norm(T())) |
bool | is_zero () const |
void | zero () |
Set all entries of the vector to 0. More... | |
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 |
Formatted print, by default to libMesh::out . More... | |
void | write_unformatted (std::ostream &out_stream, const bool newline=true) const |
Unformatted print to the stream out . More... | |
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 |
Protected Member Functions | |
TypeVector (const T &x, const T &y=0, const T &z=0) | |
Constructor-from-T. More... | |
template<typename Scalar1 , typename Scalar2 , typename Scalar3 > | |
TypeVector (typename boostcopy::enable_if_c< ScalarTraits< Scalar1 >::value, const Scalar1 >::type &x, typename boostcopy::enable_if_c< ScalarTraits< Scalar2 >::value, const Scalar2 >::type &y=0, typename boostcopy::enable_if_c< ScalarTraits< Scalar3 >::value, const Scalar3 >::type &z=0) | |
Constructor-from-scalars. More... | |
template<typename Scalar > | |
TypeVector (const Scalar &x, typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, const Scalar >::type *sfinae=nullptr) | |
Constructor-from-scalar. More... | |
Protected Attributes | |
T | _coords [LIBMESH_DIM] |
The coordinates of the TypeVector . More... | |
Friends | |
template<typename T2 > | |
class | TypeVector |
class | TypeTensor< T > |
std::ostream & | operator<< (std::ostream &os, const TypeVector< T > &t) |
Formatted print as above but supports the syntax: More... | |
This class defines a vector in LIBMESH_DIM
dimensional space of type T.
T may either be Real or Complex. Instead use one of the derived types such as Point
or Node
.
Definition at line 34 of file tensor_tools.h.
typedef unsigned int libMesh::TypeVector< T >::index_type |
Helper typedef for generic index programming.
Definition at line 149 of file type_vector.h.
typedef T libMesh::TypeVector< T >::value_type |
Helper typedef for C++98 generic programming.
Definition at line 144 of file type_vector.h.
|
inline |
Empty constructor.
Gives the vector 0 in LIBMESH_DIM
dimensions.
Definition at line 451 of file type_vector.h.
|
inlineprotected |
Constructor-from-T.
By default sets higher dimensional entries to 0.
Definition at line 468 of file type_vector.h.
|
inlineprotected |
Constructor-from-scalars.
By default sets higher dimensional entries to 0.
Definition at line 493 of file type_vector.h.
|
inlineprotected |
Constructor-from-scalar.
Sets higher dimensional entries to 0. Necessary because for some reason the constructor-from-scalars alone is insufficient to let the compiler figure out TypeVector<Complex> v = 0;
Definition at line 523 of file type_vector.h.
|
inline |
Copy-constructor.
Definition at line 544 of file type_vector.h.
|
default |
Copy-constructor for the trivial case.
|
default |
Destructor.
|
inline |
true
if two vectors are equal to within an absolute tolerance of tol
. Definition at line 979 of file type_vector.h.
Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::LocationMap< T >::find(), libMesh::Pyramid::local_singular_node(), libMesh::Elem::parent_bracketing_nodes(), VolumeTest::test_true_centroid_and_volume(), MeshTriangulationTest::testFoundCenters(), and VolumeTest::testQuad4TrueCentroid().
|
inline |
Add to this vector without creating a temporary.
Definition at line 627 of file type_vector.h.
Referenced by libMesh::FEMap::inverse_map(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::MeshTools::Modification::smooth(), and libMesh::Elem::vertex_average().
|
inline |
Add a scaled value to this vector without creating a temporary.
Definition at line 651 of file type_vector.h.
Referenced by libMesh::MeshFunction::_gradient_on_elem(), libMesh::MeshRefinement::add_node(), libMesh::HPCoarsenTest::add_projection(), assemble_cd(), assemble_stokes(), InfFERadialTest::base_point(), libMesh::Elem::coarsen(), compute_stresses(), SolidSystem::element_time_derivative(), libMesh::InfFEMap::inverse_map(), libMesh::InfFEMap::map(), libMesh::FEMap::map(), libMesh::FEMap::map_deriv(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::Elem::parent_bracketing_nodes(), libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), libMesh::HPCoarsenTest::select_refinement(), libMesh::MeshTools::Modification::smooth(), TypeVectorTestBase< VectorValue< Number > >::testVectorAddScaled(), and TypeVectorTestBase< VectorValue< Number > >::testVectorAddScaledBase().
|
inline |
Assign to this vector without creating a temporary.
Definition at line 556 of file type_vector.h.
|
inline |
Definition at line 896 of file type_vector.h.
TypeVector< typename CompareTypes< T, T2 >::supertype > libMesh::TypeVector< T >::cross | ( | const TypeVector< T2 > & | v | ) | const |
v
. Definition at line 906 of file type_vector.h.
Referenced by libMesh::TriangulatorInterface::Hole::areavec(), assemble_shell(), libMesh::InfFE< Dim, T_radial, T_map >::compute_face_functions(), libMesh::FEMap::compute_face_map(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), ContainsPointTest::containsPointTri3Helper(), libMesh::Plane::create_from_three_points(), libMesh::Quad4::has_invertible_map(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), libMesh::Quad::quality(), libMesh::Face::quasicircumcenter(), and libMesh::Quad4::volume().
|
inline |
Definition at line 969 of file type_vector.h.
|
inline |
Definition at line 929 of file type_vector.h.
Referenced by libMesh::Sphere::above_surface(), libMesh::TriangulatorInterface::Hole::area(), assemble_shell(), InfFERadialTest::base_point(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::Quad4::has_invertible_map(), libMesh::Edge4::has_invertible_map(), libMesh::InfFEMap::inverse_map(), libMesh::FEMap::inverse_map(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::Sphere::on_surface(), libMesh::Tri::quality(), libMesh::Quad::quality(), libMesh::MeshTools::Modification::smooth(), libMesh::Sphere::surface_coords(), InfFERadialTest::testInfQuants(), InfFERadialTest::testInfQuants_numericDeriv(), and TypeVectorTestBase< VectorValue< Number > >::testNormBase().
|
inline |
Definition at line 948 of file type_vector.h.
Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::Edge3::has_invertible_map(), libMesh::PointLocatorNanoflann::kdtree_distance(), main(), libMesh::Face::quasicircumcenter(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Sphere::Sphere(), InfFERadialTest::testInfQuants(), InfFERadialTest::testInfQuants_numericDeriv(), TypeVectorTestBase< VectorValue< Number > >::testNormSqBase(), and libMesh::Edge3::volume().
|
inline |
Definition at line 1051 of file type_vector.h.
|
inline |
Definition at line 566 of file type_vector.h.
|
inline |
Definition at line 577 of file type_vector.h.
|
inline |
Multiply this vector by a scalar value.
Definition at line 763 of file type_vector.h.
|
inline |
Definition at line 874 of file type_vector.h.
|
inline |
Multiply this vector by a scalar value.
Definition at line 800 of file type_vector.h.
|
inline |
Add two vectors.
Definition at line 590 of file type_vector.h.
|
inline |
Add to this vector.
Definition at line 615 of file type_vector.h.
|
inline |
Subtract from this vector.
Definition at line 676 of file type_vector.h.
|
inline |
Definition at line 735 of file type_vector.h.
|
inline |
Subtract from this vector.
Definition at line 702 of file type_vector.h.
|
inline |
Divide each entry of this vector by scalar value.
Definition at line 828 of file type_vector.h.
|
inline |
Divide each entry of this vector by scalar value.
Definition at line 857 of file type_vector.h.
bool libMesh::TypeVector< Complex >::operator< | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 148 of file type_vector.C.
bool libMesh::TypeVector< T >::operator< | ( | const TypeVector< T > & | rhs | ) | const |
true
if this vector is "less" than rhs
.Useful for sorting. Also used for choosing some arbitrary basis function orientations.
Definition at line 90 of file type_vector.C.
bool libMesh::TypeVector< Complex >::operator<= | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 167 of file type_vector.C.
bool libMesh::TypeVector< T >::operator<= | ( | const TypeVector< T > & | rhs | ) | const |
true
if this vector is <= to rhs
.Useful for sorting. Also used for choosing some arbitrary constraint equation directions.
Definition at line 104 of file type_vector.C.
|
inline |
Assignment-from-scalar operator.
Used only to zero out vectors.
Definition at line 180 of file type_vector.h.
|
inline |
true
if this(i)==rhs(i) for each component of the vector.absolute_fuzzy_equals()
may be a more appropriate choice. Definition at line 1029 of file type_vector.h.
bool libMesh::TypeVector< Complex >::operator> | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 186 of file type_vector.C.
bool libMesh::TypeVector< T >::operator> | ( | const TypeVector< T > & | rhs | ) | const |
true
if this vector is "greater" than rhs
.Useful for sorting. Also used for choosing some arbitrary basis function orientations.
Definition at line 119 of file type_vector.C.
bool libMesh::TypeVector< Complex >::operator>= | ( | const TypeVector< Complex > & | rhs | ) | const |
Definition at line 205 of file type_vector.C.
bool libMesh::TypeVector< T >::operator>= | ( | const TypeVector< T > & | rhs | ) | const |
true
if this vector is >= rhs
.Useful for sorting. Also used for choosing some arbitrary constraint equation directions.
Definition at line 133 of file type_vector.C.
void libMesh::TypeVector< T >::print | ( | std::ostream & | os = libMesh::out | ) | const |
|
inline |
true
if two vectors are equal to within a relative tolerance of tol
. Definition at line 1004 of file type_vector.h.
Referenced by libMesh::Edge3::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Edge4::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tri7::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Hex20::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Tet14::has_affine_map(), libMesh::Prism20::has_affine_map(), libMesh::Prism21::has_affine_map(), libMesh::Quad4::volume(), and libMesh::Tri6::volume().
|
inline |
Definition at line 187 of file type_vector.h.
|
inline |
Definition at line 193 of file type_vector.h.
|
inline |
Subtract from this vector without creating a temporary.
Definition at line 714 of file type_vector.h.
|
inline |
Subtract a scaled value from this vector without creating a temporary.
Definition at line 725 of file type_vector.h.
Referenced by libMesh::HPCoarsenTest::select_refinement().
|
inline |
Definition at line 1120 of file type_vector.h.
Referenced by libMesh::InfFE< Dim, T_radial, T_map >::compute_face_functions(), libMesh::FEMap::compute_face_map(), ContainsPointTest::containsPointTri3Helper(), libMesh::Plane::create_from_point_normal(), libMesh::Plane::create_from_three_points(), libMesh::MeshTools::Modification::distort(), AzimuthalPeriodicBoundary::set_up_rotation_matrix(), and libMesh::Sphere::unit_normal().
void libMesh::TypeVector< T >::write_unformatted | ( | std::ostream & | out_stream, |
const bool | newline = true |
||
) | const |
Unformatted print to the stream out
.
Simply prints the elements of the vector separated by spaces. Also prints a newline by default, however, this behavior can be controlled with the newline
parameter.
Definition at line 75 of file type_vector.C.
Referenced by libMesh::InfElemBuilder::build_inf_elem(), and libMesh::TecplotIO::write_ascii().
|
inline |
Set all entries of the vector to 0.
Definition at line 938 of file type_vector.h.
Referenced by libMesh::VectorValue< Real >::operator=(), libMesh::TypeVector< Real >::operator=(), and TypeVectorTestBase< VectorValue< Number > >::testZeroBase().
|
friend |
Formatted print as above but supports the syntax:
Definition at line 419 of file type_vector.h.
|
friend |
Definition at line 94 of file type_vector.h.
Definition at line 92 of file type_vector.h.
|
protected |
The coordinates of the TypeVector
.
Definition at line 439 of file type_vector.h.
Referenced by libMesh::TypeTensor< T >::column(), and libMesh::TypeTensor< T >::row().