libMesh
|
Represents a line constraint defined by a base point and direction vector. More...
#include <variational_smoother_constraint.h>
Public Member Functions | |
LineConstraint ()=default | |
LineConstraint (const Point &point, const Point &direction, const Real &tol=TOLERANCE *TOLERANCE) | |
Constructor. More... | |
bool | operator< (const LineConstraint &other) const |
Comparison operator for ordering LineConstraint objects. More... | |
bool | operator== (const LineConstraint &other) const |
Equality operator. More... | |
bool | contains_point (const PointConstraint &p) const |
Query whether a point lies on the line. More... | |
bool | is_parallel (const LineConstraint &l) const |
Query whether a line is parallel to this line. More... | |
bool | is_parallel (const PlaneConstraint &p) const |
Query whether a plane is parallel to this line. More... | |
ConstraintVariant | intersect (const ConstraintVariant &other) const |
Computes the intersection of this line with another constraint. More... | |
const Point & | point () const |
Const getter for the _point attribute. More... | |
const Point & | direction () const |
Const getter for the _direction attribute. More... | |
const Real & | tol () const |
Const getter for the _tol attribute. More... | |
Private Attributes | |
Point | _point |
A point on the constraining line. More... | |
Point | _direction |
Direction of the constraining line. More... | |
Real | _tol |
Tolerance to use for numerical comparisons. More... | |
Represents a line constraint defined by a base point and direction vector.
Definition at line 123 of file variational_smoother_constraint.h.
|
default |
libMesh::LineConstraint::LineConstraint | ( | const Point & | point, |
const Point & | direction, | ||
const Real & | tol = TOLERANCE * TOLERANCE |
||
) |
Constructor.
point | A point on the constraining line. |
direction | the direction of the constraining line. |
tol | The tolerance to use for numerical comparisons. |
Definition at line 79 of file variational_smoother_constraint.C.
References _direction, _tol, and libMesh::TypeVector< T >::norm().
bool libMesh::LineConstraint::contains_point | ( | const PointConstraint & | p | ) | const |
Query whether a point lies on the line.
p | The point in question |
Definition at line 103 of file variational_smoother_constraint.C.
References _direction, _point, _tol, libMesh::TypeVector< T >::cross(), libMesh::TensorTools::norm(), and libMesh::PointConstraint::point().
Referenced by intersect(), and operator==().
|
inline |
Const getter for the _direction attribute.
Definition at line 194 of file variational_smoother_constraint.h.
References _direction.
Referenced by libMesh::PlaneConstraint::contains_line(), is_parallel(), operator<(), and operator==().
ConstraintVariant libMesh::LineConstraint::intersect | ( | const ConstraintVariant & | other | ) | const |
Computes the intersection of this line with another constraint.
Handles intersection with LineConstraint, PlaneConstraint, or PointConstraint.
other | The constraint to intersect with. |
Definition at line 121 of file variational_smoother_constraint.C.
References _direction, _point, _tol, contains_point(), libMesh::TypeVector< T >::cross(), is_parallel(), libMesh::TensorTools::norm(), libMesh::TypeVector< T >::norm_sq(), and libMesh::Real.
bool libMesh::LineConstraint::is_parallel | ( | const LineConstraint & | l | ) | const |
Query whether a line is parallel to this line.
l | The line in question |
Definition at line 111 of file variational_smoother_constraint.C.
References _direction, _tol, libMesh::TypeVector< T >::absolute_fuzzy_equals(), and direction().
Referenced by intersect(), and libMesh::PlaneConstraint::is_parallel().
bool libMesh::LineConstraint::is_parallel | ( | const PlaneConstraint & | p | ) | const |
Query whether a plane is parallel to this line.
p | The plane in question |
Definition at line 116 of file variational_smoother_constraint.C.
References _direction, _tol, and libMesh::PlaneConstraint::normal().
bool libMesh::LineConstraint::operator< | ( | const LineConstraint & | other | ) | const |
Comparison operator for ordering LineConstraint objects.
The comparison is primarily based on the direction vector. If the direction vectors are equal (within tolerance), the tie is broken using the dot product of the direction with the base point.
other | The LineConstraint to compare with. |
Definition at line 86 of file variational_smoother_constraint.C.
References _direction, _point, _tol, libMesh::TypeVector< T >::absolute_fuzzy_equals(), direction(), and point().
bool libMesh::LineConstraint::operator== | ( | const LineConstraint & | other | ) | const |
Equality operator.
other | The LineConstraint to compare with. |
Definition at line 96 of file variational_smoother_constraint.C.
References _direction, _tol, libMesh::TypeVector< T >::absolute_fuzzy_equals(), contains_point(), direction(), and point().
|
inline |
Const getter for the _point attribute.
Definition at line 189 of file variational_smoother_constraint.h.
References _point.
Referenced by libMesh::PlaneConstraint::contains_line(), operator<(), and operator==().
|
inline |
Const getter for the _tol attribute.
Definition at line 199 of file variational_smoother_constraint.h.
References _tol.
|
private |
Direction of the constraining line.
Definition at line 211 of file variational_smoother_constraint.h.
Referenced by contains_point(), direction(), intersect(), is_parallel(), LineConstraint(), operator<(), and operator==().
|
private |
A point on the constraining line.
Definition at line 206 of file variational_smoother_constraint.h.
Referenced by contains_point(), intersect(), operator<(), and point().
|
private |
Tolerance to use for numerical comparisons.
Definition at line 216 of file variational_smoother_constraint.h.
Referenced by contains_point(), intersect(), is_parallel(), LineConstraint(), operator<(), operator==(), and tol().