LifeV
|
QuadraturePoint - Simple container for a point of a quadrature rule. More...
#include <QuadraturePoint.hpp>
Private Attributes | |
Real | M_weight |
GeoVector | M_coor |
Constructor & Destructor | |
QuadraturePoint () | |
Empty constructor (all zero data). More... | |
QuadraturePoint (Real x, Real y, Real z, Real weight) | |
Full constructor for 3D. More... | |
QuadraturePoint (Real x, Real y, Real weight) | |
Full constructor for 2D. More... | |
QuadraturePoint (Real x, Real weight) | |
Full constructor for 1D. More... | |
QuadraturePoint (const GeoVector &coor, const Real &weight) | |
Full multidimension constructor. More... | |
QuadraturePoint (const GeoVector &coor, const Real &weight, const UInt &spaceDim) | |
Multidimension constructor with specified dimension. More... | |
QuadraturePoint (const QuadraturePoint &qp) | |
Simple copy constructor. More... | |
QuadraturePoint (const QuadraturePoint &qp, const UInt spaceDim) | |
Import from another dimension. More... | |
virtual | ~QuadraturePoint () |
Destructor. More... | |
Methods | |
Real | dimension () const |
Returns the dimension of the quadPoint. More... | |
Operator | |
std::ostream & | operator<< (std::ostream &out, const QuadraturePoint &qp) |
Output operator. More... | |
Get Methods | |
const Real & | weight () const |
Getter for the weight. More... | |
const Real & | x () const |
Getter for the first coordinate. More... | |
const Real & | y () const |
Getter for the second coordinate. More... | |
const Real & | z () const |
Getter for the third coordinate. More... | |
const Real & | coor (const UInt &i) const |
Getter for the coordinate (0<=i) More... | |
const GeoVector & | coor () const |
Getter for the full vector of coordinates. More... | |
QuadraturePoint - Simple container for a point of a quadrature rule.
Definition
The QuadraturePoint class consists basically in a real number (the weight of the point) and a vector of real numbers (the coordinates of the point). To enable fast computations if needed, blas vectors (look in the file /lifearray/tab.hpp to know precisely the type) are used internally.
Create a QuadraturePoint
A QuadraturePoint can be defined using directly 1,2 or 3 coordinates and the weight.
However, this use should be avoided if possible, because it assumes (for backward compatibility purpose) that the dimension of the QuadraturePoint is 3, even if only 1 or 2 coordinates are passed!
To create properly a QuadraturePoint, one should use the native vector (GeoVector):
This makes the code "surprise-free" and also easier to generalize to any dimension.
Dimension of the QuadraturePoint
The QuadraturePoint has naturally a dimension, the number of coordinates of the point. To change the dimension of the QuadraturePoint, use the copy constructor where you can specify the new dimension.
If you intend to use your code for different dimensions, take care of the methods that you call: avoid using x(),y(),z() and replace them by the coor() method.
Definition at line 98 of file QuadraturePoint.hpp.
QuadraturePoint | ( | ) |
Empty constructor (all zero data).
This constructor builds a QuadraturePoint with 3 components (for the location) and a weight that are all set to zero
Definition at line 48 of file QuadraturePoint.cpp.
QuadraturePoint | ( | Real | x, |
Real | y, | ||
Real | z, | ||
Real | weight | ||
) |
Full constructor for 3D.
This builds a quadrature with 3D coordinates.
x | First coordinate of the point |
y | Second coordinate of the point |
z | Third coordinate of the point |
weight | Weight of the point |
Definition at line 57 of file QuadraturePoint.cpp.
QuadraturePoint | ( | Real | x, |
Real | y, | ||
Real | weight | ||
) |
Full constructor for 2D.
x | First coordinate of the point |
y | Second coordinate of the point |
weight | Weight of the point |
Definition at line 66 of file QuadraturePoint.cpp.
QuadraturePoint | ( | Real | x, |
Real | weight | ||
) |
Full constructor for 1D.
x | First coordinate of the point |
weight | Weight of the point |
Definition at line 75 of file QuadraturePoint.cpp.
QuadraturePoint | ( | const GeoVector & | coor, |
const Real & | weight | ||
) |
Full multidimension constructor.
coor | Coordinates of the point |
weight | Weight of the point |
Definition at line 84 of file QuadraturePoint.cpp.
QuadraturePoint | ( | const GeoVector & | coor, |
const Real & | weight, | ||
const UInt & | spaceDim | ||
) |
Multidimension constructor with specified dimension.
With this constructor, one can specify the dimension of the QuadraturePoint (that can therefore be different from coor.size()).
coor | Coordinates of the point |
weight | Weight of the point |
spaceDim | The new dimension of the point |
Definition at line 89 of file QuadraturePoint.cpp.
QuadraturePoint | ( | const QuadraturePoint & | qp | ) |
Simple copy constructor.
qp | The quadrature point to copy |
Definition at line 105 of file QuadraturePoint.cpp.
QuadraturePoint | ( | const QuadraturePoint & | qp, |
const UInt | spaceDim | ||
) |
Import from another dimension.
With this constructor, one can change the dimension of the space where the quadrature point is living. For example, we can see a 2D quadrature point as a 3D quadrature point with 0 for the third component.
qp | The quadrature point to import |
spaceDim | The dimension of the space where the quadrature point is defined |
Definition at line 112 of file QuadraturePoint.cpp.
|
inlinevirtual |
Destructor.
Definition at line 175 of file QuadraturePoint.hpp.
|
inline |
Returns the dimension of the quadPoint.
Definition at line 184 of file QuadraturePoint.hpp.
|
inline |
Getter for the weight.
Definition at line 214 of file QuadraturePoint.hpp.
|
inline |
Getter for the first coordinate.
Definition at line 220 of file QuadraturePoint.hpp.
|
inline |
Getter for the second coordinate.
Definition at line 227 of file QuadraturePoint.hpp.
|
inline |
Getter for the third coordinate.
Definition at line 234 of file QuadraturePoint.hpp.
Getter for the coordinate (0<=i)
Definition at line 241 of file QuadraturePoint.hpp.
|
inline |
Getter for the full vector of coordinates.
Definition at line 248 of file QuadraturePoint.hpp.
|
friend |
Output operator.
Definition at line 196 of file QuadraturePoint.hpp.
|
private |
Definition at line 256 of file QuadraturePoint.hpp.
|
private |
Definition at line 257 of file QuadraturePoint.hpp.