MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::IntegrationRule Class Reference

Class for an integration rule - an Array of IntegrationPoint. More...

#include <intrules.hpp>

Inheritance diagram for mfem::IntegrationRule:
[legend]
Collaboration diagram for mfem::IntegrationRule:
[legend]

Public Member Functions

 IntegrationRule ()
 
 IntegrationRule (int NP)
 Construct an integration rule with given number of points.
 
void SetPointIndices ()
 Sets the indices of each quadrature point on initialization.
 
 IntegrationRule (IntegrationRule &irx, IntegrationRule &iry)
 Tensor product of two 1D integration rules.
 
 IntegrationRule (IntegrationRule &irx, IntegrationRule &iry, IntegrationRule &irz)
 Tensor product of three 1D integration rules.
 
int GetOrder () const
 Returns the order of the integration rule.
 
void SetOrder (const int order)
 Sets the order of the integration rule. This is only for keeping order information, it does not alter any data in the IntegrationRule.
 
int GetNPoints () const
 Returns the number of the points in the integration rule.
 
IntegrationPointIntPoint (int i)
 Returns a reference to the i-th integration point.
 
const IntegrationPointIntPoint (int i) const
 Returns a const reference to the i-th integration point.
 
const Array< real_t > & GetWeights () const
 Return the quadrature weights in a contiguous array.
 
IntegrationRuleApplyToKnotIntervals (KnotVector const &kv) const
 Return an integration rule for KnotVector kv, defined by applying this rule on each knot interval.
 
 ~IntegrationRule ()
 Destroys an IntegrationRule object.
 
- Public Member Functions inherited from mfem::Array< IntegrationPoint >
 Array ()
 Creates an empty array.
 
 Array (MemoryType mt)
 Creates an empty array with a given MemoryType.
 
 Array (int asize)
 Creates array of asize elements.
 
 Array (int asize, MemoryType mt)
 Creates array of asize elements with a given MemoryType.
 
 Array (IntegrationPoint *data_, int asize, bool own_data=false)
 Creates array using an externally allocated host pointer data_ to asize elements. If own_data is true, the array takes ownership of the pointer.
 
 Array (const Array &src)
 Copy constructor: deep copy from src.
 
 Array (const Array< CT > &src)
 Copy constructor (deep copy) from 'src', an Array of convertible type.
 
 Array (const CT(&values)[N])
 Deep copy from a braced init-list of convertible type.
 
 Array (Array< IntegrationPoint > &&src)
 Move constructor ("steals" data from 'src')
 
 ~Array ()
 Destructor.
 
Array< IntegrationPoint > & operator= (const Array< IntegrationPoint > &src)
 Assignment operator: deep copy from 'src'.
 
Arrayoperator= (const Array< CT > &src)
 Assignment operator (deep copy) from src, an Array of convertible type.
 
void operator= (const IntegrationPoint &a)
 Set all entries of the array to the provided constant.
 
Array< IntegrationPoint > & operator= (const Array< CT > &src)
 
 operator IntegrationPoint * ()
 Return the data as 'T *'.
 
 operator const IntegrationPoint * () const
 Return the data as 'const T *'.
 
IntegrationPointGetData ()
 Returns the data.
 
const IntegrationPointGetData () const
 Returns the data.
 
Memory< IntegrationPoint > & GetMemory ()
 Return a reference to the Memory object used by the Array.
 
const Memory< IntegrationPoint > & GetMemory () const
 Return a reference to the Memory object used by the Array, const version.
 
bool UseDevice () const
 Return the device flag of the Memory object used by the Array.
 
bool OwnsData () const
 Return true if the data will be deleted by the Array.
 
void StealData (IntegrationPoint **p)
 Changes the ownership of the data.
 
void LoseData ()
 NULL-ifies the data.
 
void MakeDataOwner () const
 Make the Array own the data.
 
int Size () const
 Return the logical size of the array.
 
void SetSize (int nsize)
 Change the logical size of the array, keep existing entries.
 
void SetSize (int nsize, const IntegrationPoint &initval)
 Same as SetSize(int) plus initialize new entries with 'initval'.
 
void SetSize (int nsize, MemoryType mt)
 Resize the array to size nsize using MemoryType mt. Note that unlike the other versions of SetSize(), the current content of the array is not preserved.
 
int Capacity () const
 
void Reserve (int capacity)
 Ensures that the allocated size is at least the given size.
 
IntegrationPointoperator[] (int i)
 Reference access to the ith element.
 
const IntegrationPointoperator[] (int i) const
 Const reference access to the ith element.
 
int Append (const IntegrationPoint &el)
 Append element 'el' to array, resize if necessary.
 
int Append (const IntegrationPoint *els, int nels)
 Append another array to this array, resize if necessary.
 
int Append (const Array< IntegrationPoint > &els)
 Append another array to this array, resize if necessary.
 
int Prepend (const IntegrationPoint &el)
 Prepend an 'el' to the array, resize if necessary.
 
IntegrationPointLast ()
 Return the last element in the array.
 
const IntegrationPointLast () const
 Return the last element in the array.
 
int Union (const IntegrationPoint &el)
 Append element when it is not yet in the array, return index.
 
int Find (const IntegrationPoint &el) const
 Return the first index where 'el' is found; return -1 if not found.
 
int FindSorted (const IntegrationPoint &el) const
 Do bisection search for 'el' in a sorted array; return -1 if not found.
 
void DeleteLast ()
 Delete the last entry of the array.
 
void DeleteFirst (const IntegrationPoint &el)
 Delete the first entry with value == 'el'.
 
void DeleteAll ()
 Delete the whole array.
 
void Copy (Array &copy) const
 Create a copy of the internal array to the provided copy.
 
void MakeRef (IntegrationPoint *data_, int size_, bool own_data=false)
 Make this Array a reference to a pointer.
 
void MakeRef (IntegrationPoint *data_, int size, MemoryType mt, bool own_data)
 Make this Array a reference to a pointer.
 
void MakeRef (const Array &master)
 Make this Array a reference to 'master'.
 
void GetSubArray (int offset, int sa_size, Array< IntegrationPoint > &sa) const
 Copy sub array starting from offset out to the provided sa.
 
void Print (std::ostream &out=mfem::out, int width=4) const
 Prints array to stream with width elements per row.
 
void Save (std::ostream &out, int fmt=0) const
 Save the Array to the stream out using the format fmt. The format fmt can be:
 
void Load (std::istream &in, int fmt=0)
 Read an Array from the stream in using format fmt. The format fmt can be:
 
void Load (int new_size, std::istream &in)
 Set the Array size to new_size and read that many entries from the stream in.
 
IntegrationPoint Max () const
 Find the maximal element in the array, using the comparison operator < for class T.
 
IntegrationPoint Min () const
 Find the minimal element in the array, using the comparison operator < for class T.
 
void Sort ()
 Sorts the array in ascending order. This requires operator< to be defined for T.
 
void Sort (Compare cmp)
 Sorts the array in ascending order using the supplied comparison function object.
 
void Unique ()
 Removes duplicities from a sorted array. This requires operator== to be defined for T.
 
int IsSorted () const
 Return 1 if the array is sorted from lowest to highest. Otherwise return 0.
 
void PartialSum ()
 Fill the entries of the array with the cumulative sum of the entries.
 
IntegrationPoint Sum ()
 Return the sum of all the array entries using the '+'' operator for class 'T'.
 
void Assign (const IntegrationPoint *)
 Copy data from a pointer. 'Size()' elements are copied.
 
void CopyTo (U *dest)
 STL-like copyTo dest from begin to end.
 
void CopyFrom (const U *src)
 Copy from src into this array. Copies enough entries to fill the Capacity size of this array. Careful this does not update the Size to match this Capacity after this.
 
IntegrationPointbegin ()
 STL-like begin. Returns pointer to the first element of the array.
 
const IntegrationPointbegin () const
 STL-like begin. Returns const pointer to the first element of the array.
 
IntegrationPointend ()
 STL-like end. Returns pointer after the last element of the array.
 
const IntegrationPointend () const
 STL-like end. Returns const pointer after the last element of the array.
 
std::size_t MemoryUsage () const
 Returns the number of bytes allocated for the array including any reserve.
 
const IntegrationPointRead (bool on_dev=true) const
 Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
 
const IntegrationPointHostRead () const
 Shortcut for mfem::Read(a.GetMemory(), a.Size(), false).
 
IntegrationPointWrite (bool on_dev=true)
 Shortcut for mfem::Write(a.GetMemory(), a.Size(), on_dev).
 
IntegrationPointHostWrite ()
 Shortcut for mfem::Write(a.GetMemory(), a.Size(), false).
 
IntegrationPointReadWrite (bool on_dev=true)
 Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev).
 
IntegrationPointHostReadWrite ()
 Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false).
 

Friends

class IntegrationRules
 

Additional Inherited Members

- Protected Member Functions inherited from mfem::Array< IntegrationPoint >
void GrowSize (int minsize)
 
- Static Protected Member Functions inherited from mfem::Array< IntegrationPoint >
static void TypeAssert ()
 
- Protected Attributes inherited from mfem::Array< IntegrationPoint >
Memory< IntegrationPointdata
 Pointer to data.
 
int size
 Size of the array.
 

Detailed Description

Class for an integration rule - an Array of IntegrationPoint.

Definition at line 99 of file intrules.hpp.

Constructor & Destructor Documentation

◆ IntegrationRule() [1/4]

mfem::IntegrationRule::IntegrationRule ( )
inline

Definition at line 223 of file intrules.hpp.

◆ IntegrationRule() [2/4]

mfem::IntegrationRule::IntegrationRule ( int NP)
inlineexplicit

Construct an integration rule with given number of points.

Definition at line 227 of file intrules.hpp.

◆ IntegrationRule() [3/4]

mfem::IntegrationRule::IntegrationRule ( IntegrationRule & irx,
IntegrationRule & iry )

Tensor product of two 1D integration rules.

Definition at line 31 of file intrules.cpp.

◆ IntegrationRule() [4/4]

mfem::IntegrationRule::IntegrationRule ( IntegrationRule & irx,
IntegrationRule & iry,
IntegrationRule & irz )

Tensor product of three 1D integration rules.

Definition at line 56 of file intrules.cpp.

◆ ~IntegrationRule()

mfem::IntegrationRule::~IntegrationRule ( )
inline

Destroys an IntegrationRule object.

Definition at line 274 of file intrules.hpp.

Member Function Documentation

◆ ApplyToKnotIntervals()

IntegrationRule * mfem::IntegrationRule::ApplyToKnotIntervals ( KnotVector const & kv) const

Return an integration rule for KnotVector kv, defined by applying this rule on each knot interval.

Definition at line 181 of file intrules.cpp.

◆ GetNPoints()

int mfem::IntegrationRule::GetNPoints ( ) const
inline

Returns the number of the points in the integration rule.

Definition at line 256 of file intrules.hpp.

◆ GetOrder()

int mfem::IntegrationRule::GetOrder ( ) const
inline

Returns the order of the integration rule.

Definition at line 249 of file intrules.hpp.

◆ GetWeights()

const Array< real_t > & mfem::IntegrationRule::GetWeights ( ) const

Return the quadrature weights in a contiguous array.

If a contiguous array is not required, the weights can be accessed with a call like this: IntPoint(i).weight.

Definition at line 86 of file intrules.cpp.

◆ IntPoint() [1/2]

IntegrationPoint & mfem::IntegrationRule::IntPoint ( int i)
inline

Returns a reference to the i-th integration point.

Definition at line 259 of file intrules.hpp.

◆ IntPoint() [2/2]

const IntegrationPoint & mfem::IntegrationRule::IntPoint ( int i) const
inline

Returns a const reference to the i-th integration point.

Definition at line 262 of file intrules.hpp.

◆ SetOrder()

void mfem::IntegrationRule::SetOrder ( const int order)
inline

Sets the order of the integration rule. This is only for keeping order information, it does not alter any data in the IntegrationRule.

Definition at line 253 of file intrules.hpp.

◆ SetPointIndices()

void mfem::IntegrationRule::SetPointIndices ( )

Sets the indices of each quadrature point on initialization.

Note that most calls to IntegrationRule::SetSize should be paired with a call to SetPointIndices in order for the indices to be set correctly.

Definition at line 99 of file intrules.cpp.

Friends And Related Symbol Documentation

◆ IntegrationRules

friend class IntegrationRules
friend

Definition at line 102 of file intrules.hpp.


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