libMesh::Point Class Reference

A geometric point in (x,y,z) space. More...

#include <point.h>

Inheritance diagram for libMesh::Point:

Public Types

typedef Real value_type
 

Public Member Functions

 Point (const Real x=0., const Real y=0., const Real z=0.)
 
 Point (const Point &p)
 
 Point (const TypeVector< Real > &p)
 
 ~Point ()
 
void assign (const TypeVector< T2 > &)
 
const Realoperator() (const unsigned int i) const
 
Realoperator() (const unsigned int i)
 
const Realslice (const unsigned int i) const
 
Realslice (const unsigned int i)
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator+ (const TypeVector< T2 > &) const
 
const TypeVector< Real > & operator+= (const TypeVector< T2 > &)
 
void add (const TypeVector< T2 > &)
 
void add_scaled (const TypeVector< T2 > &, const Real)
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator- (const TypeVector< T2 > &) const
 
TypeVector< Realoperator- () const
 
const TypeVector< Real > & operator-= (const TypeVector< T2 > &)
 
void subtract (const TypeVector< T2 > &)
 
void subtract_scaled (const TypeVector< T2 > &, const Real)
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator* (const Scalar) const
 
CompareTypes< Real, T2 >::supertype operator* (const TypeVector< T2 > &) const
 
const TypeVector< Real > & operator*= (const Real)
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator/ (const Scalar) const
 
const TypeVector< Real > & operator/= (const Real)
 
CompareTypes< Real, T2 >::supertype contract (const TypeVector< T2 > &) const
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross (const TypeVector< T2 > &v) const
 
TypeVector< Realunit () const
 
Real size () const
 
Real norm () const
 
Real size_sq () const
 
Real norm_sq () const
 
void zero ()
 
bool relative_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool absolute_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool operator== (const TypeVector< Real > &rhs) const
 
bool operator!= (const TypeVector< Real > &rhs) const
 
bool operator< (const TypeVector< Real > &rhs) const
 
bool operator<= (const TypeVector< Real > &rhs) const
 
bool operator> (const TypeVector< Real > &rhs) const
 
bool operator>= (const TypeVector< Real > &rhs) const
 
void print (std::ostream &os=libMesh::out) const
 
void write_unformatted (std::ostream &out, const bool newline=true) const
 

Protected Attributes

Real _coords [LIBMESH_DIM]
 

Friends

class Node
 

Detailed Description

A geometric point in (x,y,z) space.

A Point defines a location in LIBMESH_DIM dimensional Real space. Points are always real-valued, even if the library is configured with –enable-complex.

Author
Benjamin S. Kirk
Date
2003

Definition at line 38 of file point.h.

Member Typedef Documentation

typedef Real libMesh::TypeVector< Real >::value_type
inherited

Helper typedef for C++98 generic programming

Definition at line 107 of file type_vector.h.

Constructor & Destructor Documentation

libMesh::Point::Point ( const Real  x = 0.,
const Real  y = 0.,
const Real  z = 0. 
)
inline

Constructor. By default sets all entries to 0. Gives the point 0 in LIBMESH_DIM dimensions.

Definition at line 46 of file point.h.

Referenced by libMesh::Node::Node().

48  :
49  TypeVector<Real> (x,y,z)
50  {}
PetscErrorCode Vec x
libMesh::Point::Point ( const Point p)
inline

Copy-constructor.

Definition at line 55 of file point.h.

55  :
56  TypeVector<Real> (p)
57  {}
libMesh::Point::Point ( const TypeVector< Real > &  p)
inline

Copy-constructor.

Definition at line 62 of file point.h.

62  :
63  TypeVector<Real> (p)
64  {}
libMesh::Point::~Point ( )
inline

Empty.

Definition at line 69 of file point.h.

69 {}

Member Function Documentation

bool libMesh::TypeVector< Real >::absolute_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inherited
Returns
true if two vectors are equal to within an absolute tolerance of tol.
void libMesh::TypeVector< Real >::add ( const TypeVector< T2 > &  )
inherited

Add to this vector without creating a temporary.

void libMesh::TypeVector< Real >::add_scaled ( const TypeVector< T2 > &  ,
const Real   
)
inherited

Add a scaled value to this vector without creating a temporary.

void libMesh::TypeVector< Real >::assign ( const TypeVector< T2 > &  )
inherited

Assign to this vector without creating a temporary.

CompareTypes<Real , T2>::supertype libMesh::TypeVector< Real >::contract ( const TypeVector< T2 > &  ) const
inherited
Returns
The result of TypeVector::operator*().
TypeVector<typename CompareTypes<Real , T2>::supertype> libMesh::TypeVector< Real >::cross ( const TypeVector< T2 > &  v) const
inherited
Returns
The cross product of this vector with v.
Real libMesh::TypeVector< Real >::norm ( ) const
inherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.
Real libMesh::TypeVector< Real >::norm_sq ( ) const
inherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.
bool libMesh::TypeVector< Real >::operator!= ( const TypeVector< Real > &  rhs) const
inherited
Returns
!(*this == rhs)
const Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i) const
inherited
Returns
A const reference to the $ i^{th} $ entry of the vector.
Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i)
inherited
Returns
A writable reference to the $ i^{th} $ entry of the vector.
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeVector<typename CompareTypes<Real , Scalar>::supertype> >::type libMesh::TypeVector< Real >::operator* ( const Scalar  ) const
inherited

Multiply this vector by a scalar value.

Returns
A copy of the result, this vector is unchanged.
CompareTypes<Real , T2>::supertype libMesh::TypeVector< Real >::operator* ( const TypeVector< T2 > &  ) const
inherited
Returns
The dot-product of this vector with another vector.
Note
The complex conjugate is not taken in the complex-valued case.
The vectors may contain different numeric types.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator*= ( const Real  )
inherited

Multiply this vector by a scalar value.

Returns
A reference to *this.
TypeVector<typename CompareTypes<Real , T2>::supertype> libMesh::TypeVector< Real >::operator+ ( const TypeVector< T2 > &  ) const
inherited

Add two vectors.

Returns
A copy of the result, this vector is unchanged.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator+= ( const TypeVector< T2 > &  )
inherited

Add to this vector.

Returns
A reference to *this.
TypeVector<typename CompareTypes<Real , T2>::supertype> libMesh::TypeVector< Real >::operator- ( const TypeVector< T2 > &  ) const
inherited

Subtract from this vector.

Returns
A copy of the result, this vector is unchanged.
TypeVector<Real > libMesh::TypeVector< Real >::operator- ( ) const
inherited
Returns
The negative of this vector in a separate copy.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator-= ( const TypeVector< T2 > &  )
inherited

Subtract from this vector.

Returns
A reference to *this.
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeVector<typename CompareTypes<Real , Scalar>::supertype> >::type libMesh::TypeVector< Real >::operator/ ( const Scalar  ) const
inherited

Divide each entry of this vector by scalar value.

Returns
A copy of the result, this vector is unchanged.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator/= ( const Real  )
inherited

Divide each entry of this vector by scalar value.

Returns
A reference to *this.
bool libMesh::TypeVector< Real >::operator< ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is "less" than rhs.

Useful for sorting. Also used for choosing some arbitrary basis function orientations.

bool libMesh::TypeVector< Real >::operator<= ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is <= to rhs.

Useful for sorting. Also used for choosing some arbitrary constraint equation directions.

bool libMesh::TypeVector< Real >::operator== ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this(i)==rhs(i) for each component of the vector.
Note
For floating point types T, the function absolute_fuzzy_equals() may be a more appropriate choice.

Referenced by libMesh::Node::operator==().

bool libMesh::TypeVector< Real >::operator> ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is "greater" than rhs.

Useful for sorting. Also used for choosing some arbitrary basis function orientations.

bool libMesh::TypeVector< Real >::operator>= ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is >= rhs.

Useful for sorting. Also used for choosing some arbitrary constraint equation directions.

void libMesh::TypeVector< Real >::print ( std::ostream &  os = libMesh::out) const
inherited

Formatted print, by default to libMesh::out.

bool libMesh::TypeVector< Real >::relative_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inherited
Returns
true if two vectors are equal to within a relative tolerance of tol.
Real libMesh::TypeVector< Real >::size ( ) const
inherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.
Deprecated:
Use the norm() function instead.
Real libMesh::TypeVector< Real >::size_sq ( ) const
inherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.
Deprecated:
Use the norm_sq() function instead.
const Real & libMesh::TypeVector< Real >::slice ( const unsigned int  i) const
inlineinherited

Definition at line 140 of file type_vector.h.

References libMesh::TypeVector< T >::operator()().

140 { return (*this)(i); }
void libMesh::TypeVector< Real >::subtract ( const TypeVector< T2 > &  )
inherited

Subtract from this vector without creating a temporary.

void libMesh::TypeVector< Real >::subtract_scaled ( const TypeVector< T2 > &  ,
const Real   
)
inherited

Subtract a scaled value from this vector without creating a temporary.

TypeVector<Real > libMesh::TypeVector< Real >::unit ( ) const
inherited
Returns
A unit vector in the direction of *this.
void libMesh::TypeVector< Real >::write_unformatted ( std::ostream &  out,
const bool  newline = true 
) const
inherited

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.

void libMesh::TypeVector< Real >::zero ( )
inherited

Set all entries of the vector to 0.

Friends And Related Function Documentation

friend class Node
friend

Make the derived class a friend.

Definition at line 76 of file point.h.

Member Data Documentation

Real libMesh::TypeVector< Real >::_coords[LIBMESH_DIM]
protectedinherited

The coordinates of the TypeVector.

Definition at line 402 of file type_vector.h.


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