hp2FEM  0.1
Public Member Functions | Protected Attributes
NumericalIntegration Class Reference

This container class returns the weights and coordinates for numerical integration of line, square, hexahedron and tetrahedron finite elements. The maximum integrand order is calculated by the multiplication of the maximum polynomial order Pmax and the integrand order factor IOFactor. Integration points are calculated for integrand orders obtained by [1,IOFactor] * Pmax. More...

#include <NumericalIntegration.h>

Collaboration diagram for NumericalIntegration:
Collaboration graph
[legend]

List of all members.

Public Member Functions

unsigned long *const GetIndices (ElementShape_E EntityShape, unsigned long IntegrandOrder, unsigned long &NumberIndices)
 Get Indices for tensorization of numerical integration coordinates and weights. This method assumes that the indices have been already calculated by the procedure RunNumericalIntegration.
OneIndexTable< unsigned long > & GetIndices (ElementShape_E ElementShape)
 Get Indices for tensorization of numerical integration coordinates and weights. This method assumes that the indices have been already calculated by the procedure RunNumericalIntegration.
unsigned long * GetIndicesBySet (ElementShape_E ElemShape, unsigned long SetNumber, unsigned long &NumberIndices)
 Returns the tensor indices. This method assumes that the tensor indices have been already calculated by the procedure RunNumericalIntegration.
double *const GetIntegrationPointsCoords (ElementShape_E ElementShape, ElementShape_E EntityShape, unsigned long IntegrandOrder, unsigned long &NumberIntegrationPoints, unsigned long LiDirection=1)
 Returns the coordinates of the integration points. The coordinates are stored only for the line elements. For the other shapes, the coordinates are collected from the line coordinates everytime the methods is executed.
double * GetIntegrationPointsCoords (ElementShape_E ElemShape, unsigned long &NumberCoords, unsigned long &NumberIndices, unsigned long **Indices)
 Returns the coordinates of all integration points. This method assumes that the coordinates have been already calculated by the procedure RunNumericalIntegration.
double * GetIntegrationPointsCoordsBySets (ElementShape_E ElemShape, unsigned long SetNumber, unsigned long &NumberIntegrationPoints)
 Returns the coordinates of the integration points. This method assumes that the coordinates have been already calculated by the procedure RunNumericalIntegration.
long GetIntegrationPointsSetNumber (ElementShape_E ElemShape, NumericalIntegrationAttributes_S &NIAttributes, unsigned long IntegrandOrder)
 Returns the set number of the integration points for the given order of the integrand according to element shape informed.
double *const GetIntegrationPointsWeights (ElementShape_E ElementShape, ElementShape_E EntityShape, unsigned long IntegrandOrder, unsigned long &NumberIntegrationPoints, unsigned long LiDirection=1)
 Returns the weights of the integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.
double * GetIntegrationPointsWeights (ElementShape_E ElemShape, unsigned long &NumberWeights, unsigned long &NumberIndices, unsigned long **Indices)
 Returns the weights of all integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.
double * GetIntegrationPointsWeightsBySets (ElementShape_E ElemShape, unsigned long SetNumber, unsigned long &NumberIntegrationPoints)
 Returns the weights of the integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.
LineNumericalIntegrationGetLineNumericalIntegration (ElementShape_E ElemShape, unsigned long LiDirection=1)
 Returns the LineNumericalIntegration reference according to element shape and baricentric direction number to (triangle and tetrahedron).
unsigned long GetMaxNumberIntegrationPoints (ElementShape_E ElemShape)
 Returns the maximum number of integration points. Using line numerical integration of each element.
unsigned long GetMaxNumberIntegrationPointsSets (ElementShape_E ElemShape)
 Returns the maximum number of sets of integration points.
unsigned long GetMaxPolyOrder (ElementShape_E ElemShape)
 Returns the maximum polynomial order according to element shape informed.
unsigned long GetNumberIntegrationPoints (ElementShape_E ElementShape, ElementShape_E EntityShape, unsigned long IntegrandOrder, long &IntegrationPointsSetNumber)
 Returns the number of integration points given by integrand order for the quadrature rule stored in the class. Returns also the number of the set which stores the points.
unsigned long GetNumberIntegrationPoints (ElementShape_E ElemShape, ElementShape_E EntityShape, long IntegrationPointsSetNumber, unsigned long LiDirection=1)
 Returns the number of integration points for a given set number according to element shape informed.
unsigned long GetNumberIntegrationPointsSets (ElementShape_E EntityShape)
 Returns the number of sets of integration points calculated using the polynomial and integration orders.
NumericalIntegrationAttributes_SGetNumericalIntegrationAttributes ()
 returns the numerical integration attributes.
unsigned long GetTotalNumberIntegrationPoints (ElementShape_E ElemShape)
 Returns the total number of integration points according to element shape informed.
 NumericalIntegration ()
 Default constructor.
 NumericalIntegration (NumericalIntegrationAttributes_S &NumericalIntegrationAttributes)
 Constructor with all class attributes input in an instance of the NumericalIntegrationAttributes_S instance.
 NumericalIntegration (ElementShape_E ElementShape, QuadCollocType_E QuadratureType, unsigned long Alpha, unsigned long Beta, unsigned long MaxPolyOrder, unsigned long IntegrandOrderFactor=2)
 Constructor with all class attributes as input parameters to be stored in the NumericalIntegrationAttributes_S instance.
 NumericalIntegration (NumericalIntegration &Instance)
 Copy-initializer constructor.
 operator NumericalIntegrationAttributes_S & ()
 Cast operator for the reference of the class attribute "NIAttributes".
 operator HexaNumericalIntegration & ()
 Cast operator for the reference of the class attribute "HexaNI".
 operator LineNumericalIntegration & ()
 Cast operator for the reference of the class attribute "LineNI".
 operator SquareNumericalIntegration & ()
 Cast operator for the reference of the class attribute "SquareNI".
 operator TetraNumericalIntegration & ()
 Cast operator for the reference of the class attribute "TetraNI".
 operator TriangleNumericalIntegration & ()
 Cast operator for the reference of the class attribute "TriangleNI".
NumericalIntegrationoperator= (NumericalIntegration &Instance)
 Copies the contents of instance to the object.
void Print (FILE *File, ElementShape_E ElementShape, ElementShape_E EntityShape)
 : Prints the numerical integration attributes and values to the given ascii file.
void Read (FILE *DefFile, unsigned long GroupNumber, ElementShape_E ElementShape, unsigned long MaxOrder)
 Reads the numerical integration attributes from the .def ascii file.
void RunNumericalIntegration (ElementShape_E ElementShape, ElementShape_E EntityShape, BuiltInArray< unsigned long > &PolyOrder)
 Calculates the tensorization indices and the weigths for numerical integration of the polynomial orders given in the input parameter PolyOrder and integrand orders calculated by [1,IOFactor] * P..
void SetMaxPolyOrder (ElementShape_E ElemShape, unsigned long MaxOrder)
 Sets the maximum polynomial according to element shape.
void SetNumberCoordsWeights (ElementShape_E ElemShape, unsigned long NumberRow, unsigned long NumberData)
 Sets the coordinates and weights table according to element shape informed.
void SetNumberIntegrationPointsSets (ElementShape_E ElemShape, NumericalIntegrationAttributes_S &NIAttributes, BuiltInArray< unsigned long > &PolyOrder)
 Sets the maximum number of sets of integration points.
void SetNumericalIntegrationAttributes (NumericalIntegrationAttributes_S &NumericalIntegrationAttributes)
 Setsl class attributes input in an instance of the NumericalIntegrationAttributes_S instance.
void SetNumericalIntegrationAttributes (ElementShape_E ElementShape, QuadCollocType_E QuadratureType, unsigned long Alpha, unsigned long Beta, unsigned long MaxPolyOrder, unsigned long IntegrandOrderFactor=2)
 Sets the class attributes as input parameters to be stored in the NumericalIntegrationAttributes_S instance.
 ~NumericalIntegration ()
 Class destructor.

Protected Attributes

HexaNumericalIntegrationHexaNI
 Numerical integration variable for hexahedron element.
LineNumericalIntegrationLineNI
 Numerical integration variable for line element.
NumericalIntegrationAttributes_S NIAttributes
 This variable stores a struct with all the atributtes of the NumericalIntegration class (quadrature type and its weights Alpha and Beta, the element shape and the maximum polynomial order)
SquareNumericalIntegrationSquareNI
 Numerical integration variable for square element.
TetraNumericalIntegrationTetraNI
 Numerical integration variable for tetrahedron element.
TriangleNumericalIntegrationTriangleNI
 Numerical integration variable for triangle element.

Detailed Description

This container class returns the weights and coordinates for numerical integration of line, square, hexahedron and tetrahedron finite elements. The maximum integrand order is calculated by the multiplication of the maximum polynomial order Pmax and the integrand order factor IOFactor. Integration points are calculated for integrand orders obtained by [1,IOFactor] * Pmax.

Note:
The element shape, quadrature type and maximum polynomial order are stored as class data
Author:
Fabiano Fernandes Bargos
Date:
March/15/2011

Constructor & Destructor Documentation

Constructor with all class attributes input in an instance of the NumericalIntegrationAttributes_S instance.

Parameters:
[in]NumericalIntegrationAttributes- parameters of numerical integration.
NumericalIntegration::NumericalIntegration ( ElementShape_E  ElementShape,
QuadCollocType_E  QuadratureType,
unsigned long  Alpha,
unsigned long  Beta,
unsigned long  MaxPolyOrder,
unsigned long  IntegrandOrderFactor = 2 
)

Constructor with all class attributes as input parameters to be stored in the NumericalIntegrationAttributes_S instance.

Parameters:
[in]ElementShape,:element shape
[in]QuadratureType,:specifies the quadrature type for numerical integration
[in]Alpha,Beta,:specifies the weights for the calculation of the weights and integration points
[in]MaxPolyOrder,:maximum polynomial order
[in]IntegrandOrderFactor,:integrand order factor that it is multiplied by the the polynomial order P to obtain the integrand order. The default value is 2 which means that the integration points will be calculated for orders P and 2P.

Copy-initializer constructor.

Parameters:
[in]Instance- instance of the NumericalIntegration class.

Member Function Documentation

unsigned long *const NumericalIntegration::GetIndices ( ElementShape_E  EntityShape,
unsigned long  IntegrandOrder,
unsigned long &  NumberIndices 
)

Get Indices for tensorization of numerical integration coordinates and weights. This method assumes that the indices have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]IntegrandOrder- order of the integrand. Based on this value, the number of integration points is calculated for the quadrature rule stored in the class data
[out]NumberIndices- number of tensorization indices.
Returns:
Pointer to the array of indices.
OneIndexTable< unsigned long > & NumericalIntegration::GetIndices ( ElementShape_E  ElementShape)

Get Indices for tensorization of numerical integration coordinates and weights. This method assumes that the indices have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElementShape- element shape
Returns:
OneIndexTable type that contains the tensor indices
unsigned long * NumericalIntegration::GetIndicesBySet ( ElementShape_E  ElemShape,
unsigned long  SetNumber,
unsigned long &  NumberIndices 
)

Returns the tensor indices. This method assumes that the tensor indices have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElemShape- Element Shape.
[in]SetNumber- the set number.
[out]NumberIndices- number of tensor indices
Returns:
Pointer to the array with the tensor indices.
double *const NumericalIntegration::GetIntegrationPointsCoords ( ElementShape_E  ElementShape,
ElementShape_E  EntityShape,
unsigned long  IntegrandOrder,
unsigned long &  NumberIntegrationPoints,
unsigned long  LiDirection = 1 
)

Returns the coordinates of the integration points. The coordinates are stored only for the line elements. For the other shapes, the coordinates are collected from the line coordinates everytime the methods is executed.

Parameters:
[in]ElementShape- element shape
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]IntegrandOrder- order of the integrand. Based on this value, the number of integration points are calculated for the quadrature rule stored in the class data.
[in]Coords- Table that stores the integration points coordinates.
[out]NumberIntegrationPoints- number of integration points
[in]LiDirection- Baricentric direction number.
Returns:
Pointer to the array with the coordinates.
double * NumericalIntegration::GetIntegrationPointsCoords ( ElementShape_E  ElemShape,
unsigned long &  NumberCoords,
unsigned long &  NumberIndices,
unsigned long **  Indices 
)

Returns the coordinates of all integration points. This method assumes that the coordinates have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElemShape- Element Shape.
[out]NumberCoords- number of integration points.
[out]NumberIndices- number of indices of the table.
[out]Indices- indices of table.
Returns:
Pointer to double - the array with the coordinates.
double * NumericalIntegration::GetIntegrationPointsCoordsBySets ( ElementShape_E  ElemShape,
unsigned long  SetNumber,
unsigned long &  NumberIntegrationPoints 
)

Returns the coordinates of the integration points. This method assumes that the coordinates have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElemShape- Element Shape.
[in]SetNumber- the set number.
[out]NumberIntegrationPoints- number of integration points
Returns:
Pointer to the array with the coordinates.
long NumericalIntegration::GetIntegrationPointsSetNumber ( ElementShape_E  ElemShape,
NumericalIntegrationAttributes_S NIAttributes,
unsigned long  IntegrandOrder 
)

Returns the set number of the integration points for the given order of the integrand according to element shape informed.

Parameters:
[in]ElemShape- Element Shape.
[in]NIAttributes- parameters of the quadrature rule.
[in]IntegrandOrder- Order of the integrand. Based on this value, the number of integration points are calculated for the quadrature rule stored in the class data.
Returns:
a long type with set number value.
double *const NumericalIntegration::GetIntegrationPointsWeights ( ElementShape_E  ElementShape,
ElementShape_E  EntityShape,
unsigned long  IntegrandOrder,
unsigned long &  NumberIntegrationPoints,
unsigned long  LiDirection = 1 
)

Returns the weights of the integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElementShape- element shape
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]IntegrandOrder- order of the integrand. Based on this value, the number of integration points are calculated for the quadrature rule stored in the class data.
[out]NumberIntegrationPoints- number of integration points
[in]LiDirection- Baricentric direction number.
Returns:
Pointer to the array with the weights
double * NumericalIntegration::GetIntegrationPointsWeights ( ElementShape_E  ElemShape,
unsigned long &  NumberWeights,
unsigned long &  NumberIndices,
unsigned long **  Indices 
)

Returns the weights of all integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElemShape- Element Shape.
[out]NumberWeights- number of integration points
[out]NumberIndices- size of array indices of weights table.
[out]Indices- indices of table.
Returns:
Pointer to double - the array with the weights.
double * NumericalIntegration::GetIntegrationPointsWeightsBySets ( ElementShape_E  ElemShape,
unsigned long  SetNumber,
unsigned long &  NumberIntegrationPoints 
)

Returns the weights of the integration points. This method assumes that the weights have been already calculated by the procedure RunNumericalIntegration.

Parameters:
[in]ElemShape- Element Shape.
[in]SetNumber- the set number.
[out]NumberIntegrationPoints- number of integration points
Returns:
Pointer to the array with the weigths.
LineNumericalIntegration & NumericalIntegration::GetLineNumericalIntegration ( ElementShape_E  ElemShape,
unsigned long  LiDirection = 1 
)

Returns the LineNumericalIntegration reference according to element shape and baricentric direction number to (triangle and tetrahedron).

Parameters:
[in]ElemShape- Element Shape
[in]LiDirection- Baricentric direction number.
Returns:
LineNumericalIntegration& - reference to the LineNumericalIntegration class.
unsigned long NumericalIntegration::GetMaxNumberIntegrationPoints ( ElementShape_E  ElemShape)

Returns the maximum number of integration points. Using line numerical integration of each element.

Parameters:
[in]ElemShape- element shape.
Returns:
the maximum number of integration points as an unsigned long.
unsigned long NumericalIntegration::GetMaxNumberIntegrationPointsSets ( ElementShape_E  ElemShape)

Returns the maximum number of sets of integration points.

Parameters:
[in]ElemShape- element shape.
Returns:
the maximum number of sets as an unsigned long.
unsigned long NumericalIntegration::GetMaxPolyOrder ( ElementShape_E  ElemShape)

Returns the maximum polynomial order according to element shape informed.

Parameters:
[in]ElemShape- Element Shape.
Returns:
Maximum polynomial order as an unsigned long.
unsigned long NumericalIntegration::GetNumberIntegrationPoints ( ElementShape_E  ElementShape,
ElementShape_E  EntityShape,
unsigned long  IntegrandOrder,
long &  IntegrationPointsSetNumber 
)

Returns the number of integration points given by integrand order for the quadrature rule stored in the class. Returns also the number of the set which stores the points.

Parameters:
[in]ElementShape- element shape
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]IntegrandOrder- order of the integrand. Based on this value, the number of integration points is calculated for the quadrature rule stored in the class data.
[out]IntegrationPointsSetNumber- number of the integration point set which stores the coordinates.
Returns:
the number of integration points as an unsigned long.
unsigned long NumericalIntegration::GetNumberIntegrationPoints ( ElementShape_E  ElemShape,
ElementShape_E  EntityShape,
long  IntegrationPointsSetNumber,
unsigned long  LiDirection = 1 
)

Returns the number of integration points for a given set number according to element shape informed.

Parameters:
[in]ElemShape- Element Shape.
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]IntegrationPointsSetNumber- number of the integration point set which stores the coordinates.
[in]LiDirection- Baricentric direction number used to triangle and tetrahedron
Returns:
the number of integration points for a given set number as an unsigned long. If the set number is not used, returns 0.
unsigned long NumericalIntegration::GetNumberIntegrationPointsSets ( ElementShape_E  EntityShape)

Returns the number of sets of integration points calculated using the polynomial and integration orders.

Parameters:
[in]EntityShape- element shape
Returns:
the number of sets as an unsigend long

returns the numerical integration attributes.

Returns:
a struct with attributes of numerical integration.
unsigned long NumericalIntegration::GetTotalNumberIntegrationPoints ( ElementShape_E  ElemShape)

Returns the total number of integration points according to element shape informed.

Parameters:
[in]ElemShape- Element Shape.
Returns:
an unsigned long with the total number of integration points value.
NumericalIntegration::operator HexaNumericalIntegration & ( )

Cast operator for the reference of the class attribute "HexaNI".

Returns:
reference to the class attribute "HexaNI" of type HexaNumericalIntegration
NumericalIntegration::operator LineNumericalIntegration & ( )

Cast operator for the reference of the class attribute "LineNI".

Returns:
reference to the class attribute "LineNI" of type LineNumericalIntegration
NumericalIntegration::operator NumericalIntegrationAttributes_S & ( )

Cast operator for the reference of the class attribute "NIAttributes".

Returns:
reference to the class attribute "NIAttributes" of type NumericalIntegrationAttributes_S
NumericalIntegration::operator SquareNumericalIntegration & ( )

Cast operator for the reference of the class attribute "SquareNI".

Returns:
reference to the class attribute "SquareNI" of type SquareNumericalIntegration
NumericalIntegration::operator TetraNumericalIntegration & ( )

Cast operator for the reference of the class attribute "TetraNI".

Returns:
reference to the class attribute "TetraNI" of type TetraNumericalIntegration
NumericalIntegration::operator TriangleNumericalIntegration & ( )

Cast operator for the reference of the class attribute "TriangleNI".

Returns:
reference to the class attribute "TriangleNI" of type TriangleNumericalIntegration
NumericalIntegration & NumericalIntegration::operator= ( NumericalIntegration Instance)

Copies the contents of instance to the object.

Parameters:
[in]Instance- instance of the NumericalIntegration class
void NumericalIntegration::Print ( FILE *  File,
ElementShape_E  ElementShape,
ElementShape_E  EntityShape 
)

: Prints the numerical integration attributes and values to the given ascii file.

Parameters:
[in]File- pointer to the ascii file
[in]ElementShape- Element shape.
[in]EntityShape- entity shape for which the integration points must be returned. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
void NumericalIntegration::Read ( FILE *  DefFile,
unsigned long  GroupNumber,
ElementShape_E  ElementShape,
unsigned long  MaxOrder 
)

Reads the numerical integration attributes from the .def ascii file.

Parameters:
[in]DEFFile- pointer to the .def ascii file.
[in]GroupNumber- group number.
[in]ElementShape- element shape.
[in]MaxOrder- maximum polynomial order.
void NumericalIntegration::RunNumericalIntegration ( ElementShape_E  ElementShape,
ElementShape_E  EntityShape,
BuiltInArray< unsigned long > &  PolyOrder 
)

Calculates the tensorization indices and the weigths for numerical integration of the polynomial orders given in the input parameter PolyOrder and integrand orders calculated by [1,IOFactor] * P..

Parameters:
[in]ElementShape- element shape
[in]EntityShape- entity shape for which the integration weights and points must be calculated. For example, the element shape is SQUARE, but only the edge points are required. In this case, EntityShape must be LINE.
[in]PolyOrder- element orders for a p-nonuniform mesh in an increasing sequence. For a p-uniform, this array stores only one value.
void NumericalIntegration::SetMaxPolyOrder ( ElementShape_E  ElemShape,
unsigned long  MaxOrder 
)

Sets the maximum polynomial according to element shape.

Parameters:
[in]ElemShape- ElementShape_E.
[in]MaxOrder- maximum polynomial order.
void NumericalIntegration::SetNumberCoordsWeights ( ElementShape_E  ElemShape,
unsigned long  NumberRow,
unsigned long  NumberData 
)

Sets the coordinates and weights table according to element shape informed.

Parameters:
[in]ElemShape- Element Shape.
[in]NumberRow- Number of table row.
[in]NumberData- Number of table coefficients.
void NumericalIntegration::SetNumberIntegrationPointsSets ( ElementShape_E  ElemShape,
NumericalIntegrationAttributes_S NIAttributes,
BuiltInArray< unsigned long > &  PolyOrder 
)

Sets the maximum number of sets of integration points.

Parameters:
[in]ElemShape- Element Shape.
[in]NIAttributes- parameters of the quadrature rule.
[in]PolyOrder- element orders for a p-nonuniform mesh in an increasing sequence. For a p-uniform, this array stores only one value.

Setsl class attributes input in an instance of the NumericalIntegrationAttributes_S instance.

Parameters:
[in]NumericalIntegrationAttributes- parameters of numerical integration
void NumericalIntegration::SetNumericalIntegrationAttributes ( ElementShape_E  ElementShape,
QuadCollocType_E  QuadratureType,
unsigned long  Alpha,
unsigned long  Beta,
unsigned long  MaxPolyOrder,
unsigned long  IntegrandOrderFactor = 2 
)

Sets the class attributes as input parameters to be stored in the NumericalIntegrationAttributes_S instance.

Parameters:
[in]ElementShaper,:element shape
[in]QuadratureType,:specifies the quadrature type for numerical integration
[in]Alpha,Beta,:specifies the weights for the calculation of the weights and integration points
[in]MaxPolyOrder,:maximum polynomial order
[in]IntegrandOrderFactor,:integrand order factor that it is multiplied by the the polynomial order P to obtain the integrand order. The default value is 2 which means that the integration points will be calculated for orders P and 2P.

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Friends Defines