Bembel
AugmentedEFIEExcitation.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_AUGMENTEDEFIE_AUGMENTEDEFIEEXCITATION_HPP_
12 #define BEMBEL_SRC_AUGMENTEDEFIE_AUGMENTEDEFIEEXCITATION_HPP_
13 
14 namespace Bembel {
20 template <typename Derived, typename LinOp>
22  public:
24  // constructors
27  explicit AugmentedEFIEExcitation(const AnsatzSpace<LinOp> &ansatz_space,
28  const int dofs_scalar) {
29  init_AugmentedEFIEExcitation(ansatz_space, dofs_scalar);
30  }
32  // init_AugmentedEFIEExcitation
34  void init_AugmentedEFIEExcitation(const AnsatzSpace<LinOp> &ansatz_space,
35  const int dofs_scalar) {
36  ansatz_space_ = ansatz_space;
37  disc_lf_ = DiscreteLinearForm<Derived, LinOp>(ansatz_space_);
38  dofs_scalar_ = dofs_scalar;
39  dofs_vector_ = ansatz_space.get_number_of_dofs();
40  return;
41  }
43  // compute
45 
48  void compute() {
49  excitation_ = Eigen::VectorXcd::Zero(dofs_scalar_ + dofs_vector_);
50  disc_lf_.compute();
51 
52  excitation_.head(dofs_vector_) = -disc_lf_.get_discrete_linear_form();
53  return;
54  }
56  // getter
58  Derived &get_linear_form() { return disc_lf_.get_linear_form(); }
59  const Eigen::VectorXcd &get_excitation() const { return excitation_; }
61  // private member variables
63  private:
64  Eigen::VectorXcd excitation_;
65 
66  DiscreteLinearForm<Derived, LinOp> disc_lf_;
67  AnsatzSpace<LinOp> ansatz_space_;
68 
69  int dofs_scalar_;
70  int dofs_vector_;
71 };
72 
73 } // namespace Bembel
74 #endif // BEMBEL_SRC_AUGMENTEDEFIE_AUGMENTEDEFIEEXCITATION_HPP_
int get_number_of_dofs() const
Retrieves the number of degrees of freedom of this AnsatzSpace.
This class, given a LinearForm with defined traits, takes care of the assembly of the right hand side...
This class, given a LinearForm with defined traits, takes care of the assembly of the right hand side...
Routines for the evalutation of pointwise errors.
Definition: AnsatzSpace.hpp:14