Bembel
 
Loading...
Searching...
No Matches
SingleLayerPotential.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_LAPLACE_SINGLELAYERPOTENTIAL_HPP_
12#define BEMBEL_SRC_LAPLACE_SINGLELAYERPOTENTIAL_HPP_
13
14namespace Bembel {
15// forward declaration of class LaplaceSingleLayerPotential in order to define
16// traits
17template <typename LinOp>
18class LaplaceSingleLayerPotential;
22template <typename LinOp>
24 typedef Eigen::VectorXd::Scalar Scalar;
25 static constexpr int OutputSpaceDimension = 1;
26};
27
33template <typename LinOp>
35 : public PotentialBase<LaplaceSingleLayerPotential<LinOp>, LinOp> {
36 // implementation of the kernel evaluation, which may be based on the
37 // information available from the superSpace
38 public:
40 Eigen::Matrix<
41 typename PotentialReturnScalar<
42 typename LinearOperatorTraits<LinOp>::Scalar, double>::Scalar,
43 1, 1>
44 evaluateIntegrand_impl(const FunctionEvaluator<LinOp> &fun_ev,
46 const Eigen::Vector3d &point,
47 const SurfacePoint &p) const {
48 // get evaluation points on unit square
49 auto s = p.segment<2>(0);
50
51 // get quadrature weights
52 auto ws = p(2);
53
54 // get points on geometry and tangential derivatives
55 auto x_f = p.segment<3>(3);
56 auto x_f_dx = p.segment<3>(6);
57 auto x_f_dy = p.segment<3>(9);
58
59 // compute surface measures from tangential derivatives
60 auto x_kappa = x_f_dx.cross(x_f_dy).norm();
61
62 // evaluate kernel
64
65 // assemble Galerkin solution
66 auto cauchy_value = fun_ev.evaluate(element, p);
67
68 // integrand without basis functions
70
71 return integrand;
72 }
73
77 double evaluateKernel(const Eigen::Vector3d &x,
78 const Eigen::Vector3d &y) const {
79 return 1. / 4. / BEMBEL_PI / (x - y).norm();
80 }
81};
82
83} // namespace Bembel
84#endif // BEMBEL_SRC_LAPLACE_SINGLELAYERPOTENTIAL_HPP_
The ElementTreeNode corresponds to an element in the element tree.
The FunctionEvaluator provides means to evaluate coefficient vectors as functions on the geometry.
This class implements the specification of the integration for the single layer potential for Laplace...
double evaluateKernel(const Eigen::Vector3d &x, const Eigen::Vector3d &y) const
Fundamental solution of Laplace problem.
Eigen::Matrix< double, 12, 1 > SurfacePoint
typedef of SurfacePoint
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()
struct containing specifications on the linear operator has to be specialized or derived for any part...
functional base class. this serves as a common interface for existing functionals.
Definition Potential.hpp:81
Base case for specifying the return type of the potential.
Definition Potential.hpp:36
struct containing specifications on the functional has to be specialized or derived for any particula...
Definition Potential.hpp:28