LifeV
QuadraturePoint Class Reference

QuadraturePoint - Simple container for a point of a quadrature rule. More...

#include <QuadraturePoint.hpp>

+ Collaboration diagram for QuadraturePoint:

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 Realweight () const
 Getter for the weight. More...
 
const Realx () const
 Getter for the first coordinate. More...
 
const Realy () const
 Getter for the second coordinate. More...
 
const Realz () const
 Getter for the third coordinate. More...
 
const Realcoor (const UInt &i) const
 Getter for the coordinate (0<=i) More...
 
const GeoVectorcoor () const
 Getter for the full vector of coordinates. More...
 

Detailed Description

QuadraturePoint - Simple container for a point of a quadrature rule.

Author
Samuel Quinodoz
Date
05/2010
Version
2.0
Note
This class is based on a previous implementation, due to J.-F. Gerbeau (04/2002).

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.

QuadraturePoint myPoint(1,0,1,0.5); // Point(1,0,1) with weight 0.5

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!

QuadraturePoint myPoint(1,0.3); // Point(1,0,0) with weight 0.3

To create properly a QuadraturePoint, one should use the native vector (GeoVector):

GeoVector myCoordinates(1); // Create a vector with 1 component
myCoordinates[0]=1; // Put 1 in the first component
QuadraturePoint myPoint(myCoordinates,0.3); // Point(1) with weight 0.3

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.

Constructor & Destructor Documentation

◆ QuadraturePoint() [1/8]

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() [2/8]

QuadraturePoint ( Real  x,
Real  y,
Real  z,
Real  weight 
)

Full constructor for 3D.

This builds a quadrature with 3D coordinates.

Parameters
xFirst coordinate of the point
ySecond coordinate of the point
zThird coordinate of the point
weightWeight of the point

Definition at line 57 of file QuadraturePoint.cpp.

+ Here is the caller graph for this function:

◆ QuadraturePoint() [3/8]

QuadraturePoint ( Real  x,
Real  y,
Real  weight 
)

Full constructor for 2D.

Parameters
xFirst coordinate of the point
ySecond coordinate of the point
weightWeight of the point

Definition at line 66 of file QuadraturePoint.cpp.

◆ QuadraturePoint() [4/8]

QuadraturePoint ( Real  x,
Real  weight 
)

Full constructor for 1D.

Parameters
xFirst coordinate of the point
weightWeight of the point

Definition at line 75 of file QuadraturePoint.cpp.

◆ QuadraturePoint() [5/8]

QuadraturePoint ( const GeoVector coor,
const Real weight 
)

Full multidimension constructor.

Parameters
coorCoordinates of the point
weightWeight of the point

Definition at line 84 of file QuadraturePoint.cpp.

+ Here is the caller graph for this function:

◆ QuadraturePoint() [6/8]

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()).

Parameters
coorCoordinates of the point
weightWeight of the point
spaceDimThe new dimension of the point

Definition at line 89 of file QuadraturePoint.cpp.

◆ QuadraturePoint() [7/8]

Simple copy constructor.

Parameters
qpThe quadrature point to copy

Definition at line 105 of file QuadraturePoint.cpp.

+ Here is the caller graph for this function:

◆ QuadraturePoint() [8/8]

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.

Parameters
qpThe quadrature point to import
spaceDimThe dimension of the space where the quadrature point is defined

Definition at line 112 of file QuadraturePoint.cpp.

◆ ~QuadraturePoint()

virtual ~QuadraturePoint ( )
inlinevirtual

Destructor.

Definition at line 175 of file QuadraturePoint.hpp.

Member Function Documentation

◆ dimension()

Real dimension ( ) const
inline

Returns the dimension of the quadPoint.

Definition at line 184 of file QuadraturePoint.hpp.

◆ weight()

const Real& weight ( ) const
inline

Getter for the weight.

Definition at line 214 of file QuadraturePoint.hpp.

◆ x()

const Real& x ( ) const
inline

Getter for the first coordinate.

Definition at line 220 of file QuadraturePoint.hpp.

◆ y()

const Real& y ( ) const
inline

Getter for the second coordinate.

Definition at line 227 of file QuadraturePoint.hpp.

◆ z()

const Real& z ( ) const
inline

Getter for the third coordinate.

Definition at line 234 of file QuadraturePoint.hpp.

◆ coor() [1/2]

const Real& coor ( const UInt i) const
inline

Getter for the coordinate (0<=i)

Definition at line 241 of file QuadraturePoint.hpp.

◆ coor() [2/2]

const GeoVector& coor ( ) const
inline

Getter for the full vector of coordinates.

Definition at line 248 of file QuadraturePoint.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const QuadraturePoint qp 
)
friend

Output operator.

Definition at line 196 of file QuadraturePoint.hpp.

Field Documentation

◆ M_weight

Real M_weight
private

Definition at line 256 of file QuadraturePoint.hpp.

◆ M_coor

GeoVector M_coor
private

Definition at line 257 of file QuadraturePoint.hpp.


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