Bembel
 
Loading...
Searching...
No Matches
Bembel Namespace Reference

Routines for the evalutation of pointwise errors. More...

Detailed Description

Routines for the evalutation of pointwise errors.

Typedef Documentation

◆ Cubature

Definition at line 17 of file Cubature.hpp.

◆ DiscreteLocalOperator

template<typename Derived >
using Bembel::DiscreteLocalOperator = typedef DiscreteOperator< Eigen::SparseMatrix<typename LinearOperatorTraits<Derived>::Scalar>, Derived>

DiscreteLocalOperator Specialization of the DiscreteOperator class for sparse matrices and an intgrator for local operators.

Definition at line 97 of file DiscreteLocalOperator.hpp.

◆ GaussLegendre

◆ GaussSquare

Function Documentation

◆ calculateFirstCoefficient()

double Bembel::calculateFirstCoefficient ( Eigen::VectorXd  cs,
unsigned int  deg,
Eigen::MatrixXd  ps_l,
Eigen::MatrixXd  ps_f,
Eigen::MatrixXd  ps_b 
)

Calculates the first coefficient such that the mean of the kernel vanishes.

Parameters
csThe already calculated other coefficients
degThe degree
ps_lGauss quadrature points on the left side of the cube
ps_fGauss quadrature points on the front side of the cube
ps_bGauss quadrature points on the bottom side of the cube

Definition at line 346 of file Coefficients.hpp.

◆ checkRateOfConvergence()

bool Bembel::checkRateOfConvergence ( const Eigen::VectorXd &  errors,
const int  expected_rate,
const double  tol_factor,
double rate_of_convergence_out = NULL 
)

Definition at line 111 of file Error.hpp.

◆ constant()

double Bembel::constant ( int  m,
unsigned int  n 
)

gives the norming factor of the spherical polynomials

Definition at line 709 of file Sphericals.hpp.

◆ Dk_mod()

Eigen::Vector3d Bembel::Dk_mod ( Eigen::Vector3d  in)
inline

Returns the gradient of the modified kernel \( - \sum_{m \in \{-1, 0, 1\}^3} \frac{x-m}{|x-m|^3} + \frac{x}{3} \).

Definition at line 312 of file Coefficients.hpp.

◆ double_to_string()

std::string Bembel::double_to_string ( double  d,
const int  precision 
)

Convert a double to a string with given precision.

Parameters
ddouble to be converted.
precisionPrecision of the conversion.

Definition at line 253 of file GeometryIGS.hpp.

◆ Dsolid_harmonics_full()

Eigen::Matrix< double, 3, Eigen::Dynamic > Bembel::Dsolid_harmonics_full ( Eigen::Vector3d  x,
unsigned int  N,
Eigen::MatrixXd  spherical_val 
)

Calculates all gradients of the solid harmonics, given the Legendre Coefficients L.

Definition at line 492 of file Sphericals.hpp.

◆ dsolid_spherical_prev()

Eigen::Matrix< double, 3, 2 > Bembel::dsolid_spherical_prev ( Eigen::Vector3d  y,
int  m,
unsigned int  n,
Eigen::VectorXd  L,
double  y_re,
double  y_im 
)

Calculates the derivative of the solid harmonics function \( \phi_n^m \) at the point \( y \) with the spherical values.

Definition at line 593 of file Sphericals.hpp.

◆ dspherical_prev()

Eigen::Matrix< double, 3, 2 > Bembel::dspherical_prev ( Eigen::Vector3d  x,
int  m,
unsigned int  n,
Eigen::VectorXd  L 
)
inline

Calculates \( \nabla Y_m^n(x) \) based on the Legendre Coefficients L.

Definition at line 532 of file Sphericals.hpp.

◆ errors() [1/2]

template<typename Scalar >
Eigen::Matrix< double, Eigen::Dynamic, 1 > Bembel::errors ( const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &  pot,
const Eigen::MatrixXd &  grid,
const std::function< Scalar(Eigen::Vector3d)> &  fun 
)
inline

Definition at line 21 of file Error.hpp.

◆ errors() [2/2]

Eigen::Matrix< double, Eigen::Dynamic, 1 > Bembel::errors ( const Eigen::MatrixXcd &  pot,
const Eigen::MatrixXd &  grid,
const std::function< Eigen::Vector3cd(Eigen::Vector3d, std::complex< double >)> &  fun,
std::complex< double kappa 
)
inline

Definition at line 40 of file Error.hpp.

◆ estimateRateOfConvergence()

double Bembel::estimateRateOfConvergence ( const Eigen::VectorXd &  errors)

Definition at line 102 of file Error.hpp.

◆ evaluate_dsolid_sphericals()

Eigen::Vector3d Bembel::evaluate_dsolid_sphericals ( Eigen::Vector3d  x,
Eigen::VectorXd  cs,
unsigned int  deg 
)

Evaluates the series \( \sum_{n = 0}^{\rm deg} \sum_{m = -n}^n |x|^{n-3} c_m^n (\nabla Y_m^n)(\frac{x}{|x|}) \) for real coefficients.

Parameters
xThe point of evaluation
csThe coefficients stored in the order \( [(0, 0), (1, -1), (1, 0), (1, 1) (2, -2), (2, -1), ... (n, n)] \)
degThe degree

Definition at line 302 of file Sphericals.hpp.

◆ evaluate_dsphericals()

Eigen::Vector3d Bembel::evaluate_dsphericals ( Eigen::Vector3d  x,
Eigen::VectorXd  cs,
unsigned int  deg 
)

Evaluates the series \( \sum_{n = 0}^{\rm deg} \sum_{m = -n}^n c_m^n \nabla Y_m^n(x) \) for real coefficients.

Parameters
xThe point of evaluation, a vector with length 1
csThe coefficients stored in the order \( [(0, 0), (1, -1), (1, 0), (1, 1) (2, -2), (2, -1), ... (n, n)] \)
degThe degree

Definition at line 213 of file Sphericals.hpp.

◆ evaluate_solid_sphericals()

double Bembel::evaluate_solid_sphericals ( Eigen::Vector3d  x,
Eigen::VectorXd  cs,
unsigned int  deg,
bool  grad 
)

Evaluates the series \( \sum_{n = 0}^{\rm deg} \sum_{m = -n}^n |x|^n c_m^n Y_m^n( \frac{x}{|x|}) \) for real coefficients cs if grad is false, and \( \sum_{n = 0}^{\rm deg} \sum_{m = -n}^n n |x|^{n-1} c_m^n Y_m^n(\frac{x}{|x|}) \) for real coefficients cs if grad is true.

Parameters
xThe point of evaluation
csThe coefficients stored in the order \( [(0, 0), (1, -1), (1, 0), (1, 1) (2, -2), (2, -1), ... (n, n)] \)
degThe degree
graddistinguish the two cases.

Definition at line 128 of file Sphericals.hpp.

◆ evaluate_sphericals()

double Bembel::evaluate_sphericals ( Eigen::Vector3d  x,
Eigen::VectorXd  cs,
unsigned int  deg 
)

Evaluates the series \( \sum_{n = 0}^{\rm deg} \sum_{m = -n}^n c_m^n Y_m^n(x) \) for real coefficients, with the convenction that \( Y_{-m}^n := \overline{Y_m^n} \).

See also
K. Giebermann. Schnelle Summationsverfahren zur numerischen Lösung von Integralgleichungen für Streuprobleme im \( \mathbb{R}^3 \). PhD thesis, Universität Karlsruhe (TH), Germany, 1997.
R. von Rickenbach. Boundary Element Methods for Shape Optimisation in Homogenisation. MSc thesis, Universität Basel, Switzerland, 2021.
Parameters
xThe point of evaluation, a vector with length 1
csThe coefficients stored in the order \( [(0, 0), (1, -1), (1, 0), (1, 1) (2, -2), (2, -1), ... (n, n)] \)
degThe degree

Definition at line 68 of file Sphericals.hpp.

◆ functionalMatrix()

Eigen::Matrix3d Bembel::functionalMatrix ( Eigen::Vector3d  z)
inline

gives \( |z|^3 \) times the Jacobi Matrix of the transformation \( z \mapsto \frac{z}{|z|} \)

Definition at line 723 of file Sphericals.hpp.

◆ getCoefficients()

Eigen::VectorXd Bembel::getCoefficients ( double  precision)

Calculates the coefficients for the solid harmonics expansion of the periodic kernel \( k(x) = \sum_{m \in \{-1, 0, 1\}^3} \frac{1}{4 \pi |x-m|} + \frac{|x|^2}{6} + \sum_{n = 0}^{N} \sum_{m = -n}^n c_m^n \phi_n^m(x) \).

Parameters
precisionThe desired mean error from periodicity.
See also
A. Barnett and L. Greengard. A new integral representation for quasi-periodic fields and its application to two-dimensional band structure calculations. Journal of Computational Physics, 229(19):6898–6914, 2010.
P. Cazeaux and O. Zahm. A fast boundary element method for the solution of periodic many-inclusion problems via hierarchical matrix techniques. ESAIM: Proceedings and Surveys, 48:156–168, 2015.
R. von Rickenbach. Boundary Element Methods for Shape Optimisation in Homogenisation. MSc thesis, Universität Basel, 2021.

Definition at line 60 of file Coefficients.hpp.

◆ getDegree()

unsigned int Bembel::getDegree ( double  precision)
inline

Returns the degree of the sphericals expansion given a precision. Can be extended, use even numbers only!

See also
P. Cazeaux and O. Zahm. A fast boundary element method for the solution of periodic many-inclusion problems via hierarchical matrix techniques. ESAIM: Proceedings and Surveys, 48:156–168, 2015.
R. von Rickenbach. Boundary Element Methods for Shape Optimisation in Homogenisation. MSc thesis, Universität Basel, 2021.

Definition at line 221 of file Coefficients.hpp.

◆ getDisplacement()

Eigen::VectorXd Bembel::getDisplacement ( Eigen::MatrixXd  ps_l,
Eigen::MatrixXd  ps_f,
Eigen::MatrixXd  ps_b 
)

Returns the right-hand side for the homogenised coefficient calculation.

Parameters
ps_lPoints on the left side, i.e. \( \subseteq \{-0.5\} \times [-0.5, 0.5] \times [-0.5, 0.5] \).
ps_fPoints on the front side, i.e. \( \subseteq [-0.5, 0.5] \times \{-0.5\} \times [-0.5, 0.5] \).
ps_bPoints on the bottom side, i.e. \( \subseteq [-0.5, 0.5] \times [-0.5, 0.5] \times \{-0.5\} \).

Definition at line 238 of file Coefficients.hpp.

◆ getFunctionSpaceOutputDimension()

template<unsigned int DF>
constexpr int Bembel::getFunctionSpaceOutputDimension ( )
constexpr
Deprecated:
Use DifferentialFormTraits instead.

Definition at line 75 of file DifferentialFormEnum.hpp.

◆ getFunctionSpaceVectorDimension()

template<unsigned int DF>
constexpr int Bembel::getFunctionSpaceVectorDimension ( )
constexpr
Deprecated:
Use DifferentialFormTraits instead.

Definition at line 67 of file DifferentialFormEnum.hpp.

◆ k_mod()

double Bembel::k_mod ( Eigen::Vector3d  in)
inline

Returns the modified kernel \( \sum_{m \in \{-1, 0, 1 \}^3} \frac{1}{4 \pi |x-m|} + \frac{|x|^2}{6} \).

Definition at line 286 of file Coefficients.hpp.

◆ legendreFull()

Eigen::VectorXd Bembel::legendreFull ( unsigned int  N,
double  t 
)

Returns the values of the spherical polynomials \( P_n^m(t) \).

Definition at line 677 of file Sphericals.hpp.

◆ MakeFile()

void Bembel::MakeFile ( const std::string &  file_name,
int  number_of_patches 
)
inlinenoexcept

method to generate textfile for the geometry

Parameters
file_namename of new textfile
number_of_patchesoverall number of patches

Definition at line 130 of file GeometryIO.hpp.

◆ maxPointwiseError() [1/2]

template<typename Scalar >
double Bembel::maxPointwiseError ( const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > &  pot,
const Eigen::MatrixXd &  grid,
const std::function< Scalar(Eigen::Vector3d)> &  fun 
)
inline

Definition at line 62 of file Error.hpp.

◆ maxPointwiseError() [2/2]

double Bembel::maxPointwiseError ( const Eigen::MatrixXcd &  pot,
const Eigen::MatrixXd &  grid,
const std::function< Eigen::Vector3cd(Eigen::Vector3d)> &  fun 
)
inline

Definition at line 82 of file Error.hpp.

◆ PatchShredder() [1/2]

std::vector< Patch > Bembel::PatchShredder ( const Patch patch)
inlinenoexcept

This function cuts a patch along internal knots, if any.

Parameters
patchPatch which gets checked and cut if there are internal knots.
Returns
Vector of patches if it got cut, otherwise the vector is of size 1.

Definition at line 386 of file Patch.hpp.

◆ PatchShredder() [2/2]

std::vector< Patch > Bembel::PatchShredder ( const std::vector< Patch > &  patches)
inlinenoexcept

This function cuts all patches along internal knots, if any.

Parameters
patchesVector with patches.
Returns
Vector of patches if it got cut.

Definition at line 437 of file Patch.hpp.

◆ pow_int()

double Bembel::pow_int ( double  x,
int  n 
)
inline

returns the \( n \)-th power of \( x \) without using pow.

Definition at line 742 of file Sphericals.hpp.

◆ spherical_harmonics_full()

Eigen::Matrix< double, Eigen::Dynamic, 2 > Bembel::spherical_harmonics_full ( Eigen::Vector3d  x,
unsigned int  N 
)

Calculates the the spherical harmonics \( Y_n^m(\frac{x}{|x|}) \), ordered by \( [Y_0^0, \, Y_1^{-1}, \, Y_1^0, \, Y_1^1, \, Y_2^{-2}, ..., Y_N^N] \).

Parameters
xthe point of evaluation
Nthe maximal degree

Definition at line 388 of file Sphericals.hpp.

◆ spherical_prev()

Eigen::Vector2d Bembel::spherical_prev ( Eigen::Vector3d  x,
int  m,
int  n,
Eigen::Vector2d  y1,
Eigen::Vector2d  y2 
)
inline

Calculates the spherical harmonic \( Y_n^m(x) \) based on previous values.

Definition at line 463 of file Sphericals.hpp.

◆ surfaceL2error()

template<typename Op , typename Derived , typename Functor >
double Bembel::surfaceL2error ( const AnsatzSpace< Op > &  ansatz_space,
const Eigen::MatrixBase< Derived > &  vec,
const Functor functor,
int  deg = 4 
)

Definition at line 18 of file surfaceL2error.hpp.

◆ WritePatch()

void Bembel::WritePatch ( const std::string &  file_name,
int  current_patch_number,
const std::vector< Eigen::MatrixXd > &  xyzw,
const std::vector< double > &  knt1,
const std::vector< double > &  knt2 
)
noexcept

method to write Patch information into textfile

Parameters
knt1knotVector1
knt2knotVector2
xyzwVector with x,y,z,w Matices
file_namefilename
current_patch_numbercurrent patch number

Definition at line 154 of file GeometryIO.hpp.

Variable Documentation

◆ DummyOperator_test_function

std::function<double(const Eigen::Vector2d &, const Eigen::Vector2d &)> Bembel::DummyOperator_test_function
Initial value:
=
[](const Eigen::Vector2d &x, const Eigen::Vector2d &y) { return 1.; }

Definition at line 34 of file DummyOperator.hpp.