11 #ifndef BEMBEL_SRC_AUGMENTEDEFIE_AUGMENTEDEFIE_HPP_
12 #define BEMBEL_SRC_AUGMENTEDEFIE_AUGMENTEDEFIE_HPP_
19 template <
typename MatrixFormat,
typename Derived>
28 init_AugmentedEFIE(ansatz_space_vector, geometry);
35 ansatz_space_vector_ = ansatz_space_vector;
46 dofs_scalar_ = ansatz_space_scalar_.get_number_of_dofs();
47 dofs_vector_ = ansatz_space_vector_.get_number_of_dofs();
57 system_matrix_ = Eigen::MatrixXcd(dofs_scalar_ + dofs_vector_,
58 dofs_scalar_ + dofs_vector_);
61 &system_matrix_, ansatz_space_mass_, ansatz_space_scalar_,
62 ansatz_space_vector_, wavenumber_);
69 const int elements_per_edge =
70 (1 << ansatz_space_vector_.get_refinement_level());
74 const int dofs_excitation =
76 (source.positive_.size() + source.negative_.size()) * elements_per_edge;
78 Eigen::MatrixXcd::Zero(dofs_scalar_ + dofs_vector_ + dofs_excitation,
79 dofs_scalar_ + dofs_vector_ + dofs_excitation);
80 excitation_ = Eigen::VectorXcd::Zero(dofs_scalar_);
83 &system_matrix_, &excitation_, ansatz_space_mass_, ansatz_space_scalar_,
84 ansatz_space_vector_, wavenumber_, source);
88 std::function<std::complex<double>(Eigen::Vector3d)> one =
89 [](Eigen::Vector3d in) {
return std::complex<double>(1., 0.); };
90 DiscreteLinearForm<DirichletTrace<std::complex<double>>,
91 HelmholtzSingleLayerOperator>
92 const_lf(ansatz_space_scalar_);
93 const_lf.get_linear_form().set_function(one);
96 system_matrix_.bottomRows(dofs_scalar_) *= omega_ *
97 std::complex<double>(0., 1.) *
98 Constants::mu0 * Constants::eps0;
99 system_matrix_.leftCols(dofs_vector_) *=
100 1. / (omega_ * std::complex<double>(0., 1.) * Constants::mu0);
102 std::complex<double> eigenvalues_average =
103 system_matrix_.trace() / ((double)system_matrix_.cols());
105 Eigen::VectorXcd a = Eigen::VectorXcd::Zero(system_matrix_.cols());
106 a.bottomRows(dofs_scalar_) = const_lf.get_discrete_linear_form();
108 system_matrix_ = system_matrix_ - eigenvalues_average * a * a.transpose();
117 wavenumber_ = wavenumber;
119 void set_omega(
double omega) { omega_ = omega; }
123 const MatrixFormat &get_system_matrix()
const {
return system_matrix_; }
144 return ansatz_space_scalar_;
147 return ansatz_space_mass_;
153 MatrixFormat system_matrix_;
154 Eigen::VectorXcd excitation_;
156 AnsatzSpace<MassMatrixScalarDisc> ansatz_space_mass_;
157 AnsatzSpace<HelmholtzSingleLayerOperator> ansatz_space_scalar_;
158 AnsatzSpace<InductanceMatrix> ansatz_space_vector_;
163 std::complex<double> wavenumber_;
The AnsatzSpace is the class that handles the assembly of the discrete basis.
int get_polynomial_degree() const
Retrieves the polynomial degree of this AnsatzSpace.
int get_refinement_level() const
Retrieves the refinement level of this AnsatzSpace.
This class handles the assembly and storage of the system matrix.
void compute()
Assembles the system matrix without voltage source excitation.
const int get_dofs_vector()
Return number of degrees of freedom for the current.
void compute(VoltageSource source)
Assembles the system matrix with voltage source excitation.
const int get_dofs_scalar()
Return number of degrees of freedom for the potential.
const AnsatzSpace< HelmholtzSingleLayerOperator > get_ansatz_space_scalar()
Debug output for the excitation.
const Eigen::VectorXcd get_excitation()
Debug output for the excitation.
void set_wavenumber(std::complex< double > wavenumber)
Set wave number.
const std::complex< double > get_wavenumber()
Return wave number.
this class wraps a GeometryVector and provides some basic functionality, like reading Geometry files
Routines for the evalutation of pointwise errors.