HG-MD
1
|
Implementation of a 3D vector (by Vitaliy). More...
#include <Vector.h>
Public Member Functions | |
Vec3D (void) | |
Vec3D (const Mdouble x, const Mdouble y, const Mdouble z) | |
void | set_zero () |
Vec3D | operator+ (const Vec3D &A) const |
Vec3D | operator- (const Vec3D &A) const |
Vec3D | operator+ (const Mdouble A) const |
Vec3D | operator- (const Mdouble A) const |
Vec3D | operator* (const Mdouble A) const |
Vec3D | operator/ (const Mdouble A) const |
Vec3D & | operator+= (const Vec3D &A) |
Vec3D & | operator-= (const Vec3D &A) |
Vec3D & | operator*= (const Mdouble a) |
Vec3D & | operator/= (const Mdouble a) |
void | normalize () |
void | SetLength (Mdouble length) |
Mdouble | GetLength2 () const |
Mdouble | GetLength () const |
Public Attributes | |
Mdouble | X |
Mdouble | Y |
Mdouble | Z |
Friends | |
Mdouble | Dot (const Vec3D &A, const Vec3D &B) |
Vec3D | max (const Vec3D &A, const Vec3D &B) |
Vec3D | min (const Vec3D &A, const Vec3D &B) |
Vec3D | square (const Vec3D &A) |
Vec3D | sqrt (const Vec3D &A) |
Vec3D | Cross (const Vec3D &A, const Vec3D &B) |
Mdouble | GetDistance (const Vec3D &A, const Vec3D &B) |
Mdouble | GetDistance2 (const Vec3D &A, const Vec3D &B) |
Mdouble | GetLength2 (const Vec3D &A) |
Mdouble | GetLength (const Vec3D &A) |
Vec3D | GetUnitVector (const Vec3D &A) |
std::ostream & | operator<< (std::ostream &os, const Vec3D &A) |
std::istream & | operator>> (std::istream &is, Vec3D &A) |
Vec3D | operator+ (const Mdouble &a, const Vec3D &A) |
Vec3D | operator- (const Mdouble &a, const Vec3D &A) |
Vec3D | operator- (const Vec3D &A) |
Vec3D | operator* (const Mdouble &a, const Vec3D &A) |
Implementation of a 3D vector (by Vitaliy).
Modifications 21:9:2009 - Added the inclusion guards and some include objects
Vec3D::Vec3D | ( | void | ) | [inline] |
Referenced by operator*(), operator+(), operator-(), and operator/().
{}
Vec3D::Vec3D | ( | const Mdouble | x, |
const Mdouble | y, | ||
const Mdouble | z | ||
) | [inline] |
Mdouble Vec3D::GetLength | ( | ) | const [inline] |
References GetLength2(), and sqrt.
Referenced by StatisticsPoint< T >::CG_integral(), StatisticsPoint< T >::CG_integral_2D(), MD::compute_internal_forces(), MD::compute_plastic_internal_forces(), MD::compute_walls(), CylinderTransformer(), MD::do_integration_before_force_computation(), CWall::get_distance_and_normal(), CWall::get_distance_and_normal_for_axissymmetric_wall(), normalize(), Chute::set_ChuteAngle(), and SetLength().
{ return sqrt(GetLength2()); }
Mdouble Vec3D::GetLength2 | ( | ) | const [inline] |
void Vec3D::normalize | ( | ) | [inline] |
void Vec3D::set_zero | ( | ) | [inline] |
void Vec3D::SetLength | ( | Mdouble | length | ) | [inline] |
References GetLength().
{ *this /= this->GetLength()*length; }
Mdouble GetDistance | ( | const Vec3D & | A, |
const Vec3D & | B | ||
) | [friend] |
{ return sqrt(GetDistance2(A, B)); }
Mdouble GetDistance2 | ( | const Vec3D & | A, |
const Vec3D & | B | ||
) | [friend] |
Mdouble GetLength2 | ( | const Vec3D & | A | ) | [friend] |
Vec3D GetUnitVector | ( | const Vec3D & | A | ) | [friend] |
{ Mdouble Length2 = A.GetLength2(); if (Length2) return A/sqrt(Length2); else return Vec3D(0,0,0); }
std::ostream& operator<< | ( | std::ostream & | os, |
const Vec3D & | A | ||
) | [friend] |
std::istream& operator>> | ( | std::istream & | is, |
Vec3D & | A | ||
) | [friend] |
Referenced by ChuteWithHopper::add_hopper(), StatisticsPoint< T >::CG_gradient(), HGRID_2D::CheckObjAgainstGrid(), HGRID_3D::CheckObjAgainstGrid(), Chute::clean_chute(), Chute::create_bottom(), Chute::create_inflow_particle(), CylinderTransformer(), StatisticsPoint< T >::dot(), Dyadic(), StatisticsVector< T >::evaluate_force_statistics(), StatisticsVector< T >::evaluate_particle_statistics(), StatisticsVector< T >::evaluate_wall_force_statistics(), Export_to_VRML_format2(), StatisticsPoint< T >::get_distance2(), CWall::get_distance_and_normal(), CWall::get_distance_and_normal_for_axissymmetric_wall(), GetLength2(), HGRID_2D::HGRID_UpdateParticleInHgrid(), HGRID_3D::HGRID_UpdateParticleInHgrid(), operator*(), Matrix3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StatisticsVector< T >::set_Positions(), set_zero(), ChuteBottom::setup_particles_initial_conditions(), SymmetrizedDyadic(), HGRID_2D::TestObjAgainstGrid(), HGRID_3D::TestObjAgainstGrid(), and Vec3D().
Referenced by CWall::add_finite_wall(), StatisticsPoint< T >::CG_gradient(), HGRID_2D::CheckObjAgainstGrid(), HGRID_3D::CheckObjAgainstGrid(), Chute::create_bottom(), Chute::create_inflow_particle(), CylinderTransformer(), StatisticsPoint< T >::dot(), Dyadic(), StatisticsVector< T >::evaluate_force_statistics(), StatisticsVector< T >::evaluate_particle_statistics(), StatisticsVector< T >::evaluate_wall_force_statistics(), Export_to_VRML_format2(), StatisticsPoint< T >::get_distance2(), CWall::get_distance_and_normal(), CWall::get_distance_and_normal_for_axissymmetric_wall(), GetLength2(), HGRID_2D::HGRID_UpdateParticleInHgrid(), HGRID_3D::HGRID_UpdateParticleInHgrid(), operator*(), Matrix3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StatisticsVector< T >::set_Positions(), set_zero(), ChuteBottom::setup_particles_initial_conditions(), SymmetrizedDyadic(), HGRID_2D::TestObjAgainstGrid(), HGRID_3D::TestObjAgainstGrid(), and Vec3D().
Referenced by ChuteWithHopper::add_hopper(), StatisticsPoint< T >::CG_gradient(), HGRID_3D::CheckObjAgainstGrid(), Chute::create_inflow_particle(), ChuteWithHopper::create_inflow_particle(), CylinderTransformer(), StatisticsPoint< T >::dot(), Dyadic(), StatisticsVector< T >::evaluate_force_statistics(), StatisticsVector< T >::evaluate_particle_statistics(), StatisticsVector< T >::evaluate_wall_force_statistics(), Export_to_VRML_format2(), StatisticsVector< T >::gather_statistics_collision(), StatisticsPoint< T >::get_distance2(), CWall::get_distance_and_normal(), CWall::get_distance_and_normal_for_axissymmetric_wall(), GetLength2(), HGRID_3D::HGRID_UpdateParticleInHgrid(), operator*(), Matrix3D::operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StatisticsVector< T >::set_Positions(), set_zero(), ChuteBottom::setup_particles_initial_conditions(), SymmetrizedDyadic(), HGRID_3D::TestObjAgainstGrid(), and Vec3D().