11 #ifndef BEMBEL_SRC_LINEARFORM_DISCRETELINEARFORM_HPP_
12 #define BEMBEL_SRC_LINEARFORM_DISCRETELINEARFORM_HPP_
20 template <
typename Derived,
typename LinOp>
28 init_DiscreteLinearForm(ansatz_space);
34 ansatz_space_ = ansatz_space;
49 const ElementTree &element_tree = super_space.get_mesh().get_element_tree();
51 auto polynomial_degree = super_space.get_polynomial_degree();
52 auto polynomial_degree_plus_one_squared =
53 (polynomial_degree + 1) * (polynomial_degree + 1);
54 const auto function_space_dimension =
55 getFunctionSpaceVectorDimension<LinearOperatorTraits<LinOp>::Form>();
56 Eigen::Matrix<typename LinearFormTraits<Derived>::Scalar, Eigen::Dynamic,
57 function_space_dimension>
58 intval(polynomial_degree_plus_one_squared, function_space_dimension);
59 Eigen::Matrix<typename LinearFormTraits<Derived>::Scalar, Eigen::Dynamic,
60 function_space_dimension>
61 disc_lf_matrix(polynomial_degree_plus_one_squared * number_of_elements,
62 function_space_dimension);
63 disc_lf_matrix.setZero();
64 for (
auto element = element_tree.
cpbegin(); element != element_tree.
cpend();
67 for (
auto i = 0; i < Q.w_.size(); ++i) {
68 super_space.map2surface(*element, Q.xi_.col(i),
69 element->get_h() * Q.w_(i), &qp);
70 lf_.evaluateIntegrand_impl(super_space, qp, &intval);
72 disc_lf_matrix.block(polynomial_degree_plus_one_squared * element->id_, 0,
73 polynomial_degree_plus_one_squared,
74 function_space_dimension) = intval;
78 Eigen::Map<Eigen::Matrix<typename LinearOperatorTraits<LinOp>::Scalar,
80 disc_lf_matrix.data(),
81 disc_lf_matrix.rows() * disc_lf_matrix.cols());
87 void set_degree(
const int °) { deg_ = deg; }
91 Derived &get_linear_form() {
return lf_; }
92 const Eigen::Matrix<typename LinearFormTraits<Derived>::Scalar,
94 &get_discrete_linear_form()
const {
103 Eigen::Matrix<typename LinearFormTraits<Derived>::Scalar, Eigen::Dynamic, 1>
105 AnsatzSpace<LinOp> ansatz_space_;
int get_polynomial_degree() const
Retrieves the polynomial degree of this AnsatzSpace.
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.
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.
Eigen::Matrix< double, 12, 1 > SurfacePoint
typedef of SurfacePoint
Routines for the evalutation of pointwise errors.