PolyFEM
Loading...
Searching...
No Matches
Helmholtz.hpp
Go to the documentation of this file.
1#pragma once
2
5
7
8// local assembler for helmolhz equation, see Laplace
9namespace polyfem::assembler
10{
12 {
13 public:
15
16 Helmholtz();
17
18 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
19 assemble(const LinearAssemblerData &data) const override;
20 VectorNd compute_rhs(const AutodiffHessianPt &pt) const override;
21
22 Eigen::Matrix<AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1> kernel(const int dim, const AutodiffGradPt &rvect, const AutodiffScalarGrad &r) const override;
23
24 // sets the k parameter
25 void add_multimaterial(const int index, const json &params, const Units &units) override;
26
27 GenericMatParam k() const { return k_; }
28
29 std::string name() const override { return "Helmholtz"; }
30 std::map<std::string, ParamFunc> parameters() const override;
31
32 private:
34 };
35} // namespace polyfem::assembler
void add_multimaterial(const int index, const json &params, const Units &units) override
Definition Helmholtz.cpp:45
std::string name() const override
Definition Helmholtz.hpp:29
VectorNd compute_rhs(const AutodiffHessianPt &pt) const override
Definition Helmholtz.cpp:32
GenericMatParam k() const
Definition Helmholtz.hpp:27
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
local assembly function that defines the bilinear form (LHS) computes and returns a single local stif...
Definition Helmholtz.cpp:12
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > kernel(const int dim, const AutodiffGradPt &rvect, const AutodiffScalarGrad &r) const override
Definition Helmholtz.cpp:50
std::map< std::string, ParamFunc > parameters() const override
Definition Helmholtz.cpp:68
assemble matrix based on the local assembler local assembler is eg Laplace, LinearElasticity etc
void assemble(const bool is_volume, const int n_basis, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const AssemblyValsCache &cache, const double t, StiffnessMatrix &stiffness, const bool is_mass=false) const override
assembles the stiffness matrix for the given basis the bilinear form (local assembler) is encoded by ...
Used for test only.
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd
Definition Types.hpp:11
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt
Automatic differentiation scalar with first-order derivatives.
Definition autodiff.h:112