Bembel
 
Loading...
Searching...
No Matches
evaluateBilinearForm.hpp
1// This file is part of Bembel, the higher order C++ boundary element library.
2//
3// Copyright (C) 2022 see <http://www.bembel.eu>
4//
5// It was written as part of a cooperation of J. Doelz, H. Harbrecht, S. Kurz,
6// M. Multerer, S. Schoeps, and F. Wolf at Technische Universitaet Darmstadt,
7// Universitaet Basel, and Universita della Svizzera italiana, Lugano. This
8// source code is subject to the GNU General Public License version 3 and
9// provided WITHOUT ANY WARRANTY, see <http://www.bembel.eu> for further
10// information.
11#ifndef BEMBEL_SRC_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
12#define BEMBEL_SRC_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
13
14namespace Bembel {
15namespace DuffyTrick {
21template <typename Derived, class T, class CubatureVector>
24 const ElementTreeNode& e1, const ElementTreeNode& e2,
27 Eigen::Matrix<typename LinearOperatorTraits<Derived>::Scalar,
28 Eigen::Dynamic, Eigen::Dynamic>* intval) {
30 double dist = 0;
31 int ffield_deg =
32 linOp.get_FarfieldQuadratureDegree(super_space.get_polynomial_degree());
33 int nfield_deg = 0;
34 auto cp = compareElements(e1, e2, &dist);
35 nfield_deg = linOp.getNearfieldQuadratureDegree(
36 super_space.get_polynomial_degree(), dist, e1.level_);
37 // make sure that the quadratur degree is at least the far field degree
39 assert(nfield_deg < Constants::maximum_quadrature_degree &&
40 "nfield_deg too large, increase maximum_quadrature_degree");
41 auto Q = GS[nfield_deg];
42 switch (cp(2)) {
43 case 0:
44 if (nfield_deg == ffield_deg) {
47 return;
48 } else {
51 return;
52 }
53 case 1:
54 assert(!"you should not have ended up here!");
55 case 2:
58 return;
59 case 3:
62 return;
63 case 4:
66 return;
67 default:
68 assert(!"you should not have ended up here!");
69 }
70 return;
71}
72} // namespace DuffyTrick
73} // namespace Bembel
74#endif // BEMBEL_SRC_DUFFYTRICK_EVALUATEBILINEARFORM_HPP_
The ElementTreeNode corresponds to an element in the element tree.
void evaluateBilinearForm(const LinearOperatorBase< Derived > &linOp, const T &super_space, const ElementTreeNode &e1, const ElementTreeNode &e2, const CubatureVector &GS, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
This function wraps the quadrature routines for the DuffyTrick and returns all integrals for the give...
void integrate3(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
quadrature routine for the common edge case
void integrate1(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
no-problem quadrature routine, elements are sufficiently far away from each other,...
void integrate2(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
quadrature routine for identical elements
void integrate0(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
far-field quadrature routine, which is based on precomputed values in order to quickly evaluate the i...
void integrate4(const LinearOperatorBase< Derived > &LinOp, const T &super_space, const ElementTreeNode &e1, int rot1, const ElementTreeNode &e2, int rot2, const ElementSurfacePoints &ffield_qnodes1, const ElementSurfacePoints &ffield_qnodes2, const Cubature &Q, Eigen::Matrix< typename LinearOperatorTraits< Derived >::Scalar, Eigen::Dynamic, Eigen::Dynamic > *intval)
quadrature routine for common vertex case.
Eigen::Vector3i compareElements(const ElementTreeNode &e1, const ElementTreeNode &e2, double *dist)
Compares two elements for similarities and determines, how the elements have to be rotated to move th...
std::vector< SurfacePoint, Eigen::aligned_allocator< SurfacePoint > > ElementSurfacePoints
typedef std::vector<SurfacePoint> with aligned allocator of Eigen for compatibility with older compil...
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()
linear operator base class. this serves as a common interface for existing linear operators.
struct containing specifications on the linear operator has to be specialized or derived for any part...