11 #ifndef BEMBEL_SRC_LINEAROPERATOR_DISCRETEOPERATOR_HPP_
12 #define BEMBEL_SRC_LINEAROPERATOR_DISCRETEOPERATOR_HPP_
21 template <
typename MatrixFormat,
typename Derived>
27 template <
typename Derived,
typename Scalar>
29 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>, Derived> {
32 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> *disc_op,
38 const auto vector_dimension =
39 getFunctionSpaceVectorDimension<LinearOperatorTraits<Derived>::Form>();
40 auto polynomial_degree = super_space.get_polynomial_degree();
41 auto polynomial_degree_plus_one_squared =
42 (polynomial_degree + 1) * (polynomial_degree + 1);
43 auto ffield_deg = lin_op.get_FarfieldQuadratureDegree(polynomial_degree);
46 disc_op->resize(vector_dimension * polynomial_degree_plus_one_squared *
48 vector_dimension * polynomial_degree_plus_one_squared *
54 for (
auto element1 = element_tree.
cpbegin();
55 element1 != element_tree.
cpend(); ++element1)
56 for (
auto element2 = element_tree.
cpbegin();
57 element2 != element_tree.
cpend(); ++element2) {
58 #pragma omp task firstprivate(element1, element2)
60 Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> intval(
61 vector_dimension * polynomial_degree_plus_one_squared,
62 vector_dimension * polynomial_degree_plus_one_squared);
64 lin_op, super_space, *element1, *element2, GS,
65 ffield_qnodes[element1->id_], ffield_qnodes[element2->id_],
67 for (
auto i = 0; i < vector_dimension; ++i)
68 for (
auto j = 0; j < vector_dimension; ++j)
69 disc_op->block(polynomial_degree_plus_one_squared *
70 (i * number_of_elements + element1->id_),
71 polynomial_degree_plus_one_squared *
72 (j * number_of_elements + element2->id_),
73 polynomial_degree_plus_one_squared,
74 polynomial_degree_plus_one_squared) =
75 intval.block(i * polynomial_degree_plus_one_squared,
76 j * polynomial_degree_plus_one_squared,
77 polynomial_degree_plus_one_squared,
78 polynomial_degree_plus_one_squared);
84 disc_op[0] = projector.transpose() * (disc_op[0] * projector);
92 template <
typename Derived>
94 Eigen::
H2Matrix<typename LinearOperatorTraits<Derived>::Scalar>, Derived> {
99 disc_op->init_H2Matrix(lin_op, ansatz_space);
107 template <
typename MatrixFormat,
typename Derived>
115 init_DiscreteOperator(ansatz_space);
121 ansatz_space_ = ansatz_space;
127 inline void compute() {
135 const MatrixFormat &get_discrete_operator()
const {
return disc_op_; }
136 const Derived &get_linear_operator()
const {
return lin_op_; }
137 Derived &get_linear_operator() {
return lin_op_; }
143 MatrixFormat disc_op_;
The AnsatzSpace is the class that handles the assembly of the discrete basis.
const Eigen::SparseMatrix< double > & get_transformation_matrix() const
Retrieves the transformation matrix associated with this AnsatzSpace.
const SuperSpace< Derived > & get_superspace() const
Retrieves the reference to the SuperSpace associated with this AnsatzSpace.
ElementTree & get_element_tree()
getter
This class organizes an element structure on a Geometry object and handles refinement.
ElementTreeNode::const_iterator cpbegin() const
Returns an iterator to the beginning of the sequence represented by the leafs as ElementTreeNodes of ...
ElementTreeNode::const_iterator cpend() const
Returns an iterator one past the end of the sequence represented by the leafs as ElementTreeNodes of ...
int get_number_of_elements() const
Return number of elements in the ElementTree.
forward definition of the H2Matrix Class in order to define traits
Hierarchical Matrix class, which extends the EigenBase class.
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...
std::vector< ElementSurfacePoints > computeFfieldQnodes(const T &super_space, const Cubature &Q)
evaluates a given quadrature on all surface panels storage format is qNodes.col(k) = [xi,...
Routines for the evalutation of pointwise errors.
Helper struct that is used in order to partially specialise the compute routine of DiscreteOperator f...
struct containing specifications on the linear operator has to be specialized or derived for any part...
The superspace manages local polynomial bases on each element of the mesh and provides an interface t...