OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
Utility

Utility and helper functions for quadrature routines. More...

Classes

struct  bem::QuadratureRule< dim >
 Data structure defining a quadrature rule. More...
 

Functions

bool bem::compare_with_tol (const Complex val, const Complex val_ref, const Float tol=1e-3, const uint8_t mode=1)
 Compares two complex numbers within a given tolerance based on a given rule.
 
template<uint8_t dim>
std::vector< QuadratureRule< dim > > bem::load_rules (const std::string file, ConstEigRef< EigColVec< Index > > orders)
 Loads quadrature rules from the specified json file assumed to be located in the same directory as this file.
 

Function Documentation

◆ compare_with_tol()

BEM_INLINE bool bem::compare_with_tol ( const Complex  val,
const Complex  val_ref,
const Float  tol = 1e-3,
const uint8_t  mode = 1 
)

Compares two complex numbers within a given tolerance based on a given rule.

Parameters
[in]val- Value to check.
[in]val_ref- Reference value.
[in]tol- Tolerance (optional).
[in]mode- Comparison mode:
  • 1: Compare real and imaginary parts separately (default).
  • 2: Compare magnitude and phase separately.
  • 3: Compare the absolute value.
Returns
true if the two values are within the specified tolerance, false otherwise.

Definition at line 36 of file utility.cpp.

◆ load_rules()

template<uint8_t dim>
std::vector< QuadratureRule< dim > > bem::load_rules ( const std::string  file,
ConstEigRef< EigColVec< Index > >  orders 
)

Loads quadrature rules from the specified json file assumed to be located in the same directory as this file.

Template Parameters
dim- Dimension in which the quadrature rules are defined.
Parameters
[in]file- json file name.
[in]orders- List of orders to load.
Returns
Vector of quadrature rule objects.

Definition at line 84 of file utility.cpp.