PolyFEM
Loading...
Searching...
No Matches
Mass.hpp
Go to the documentation of this file.
1#pragma once
2
6
7namespace polyfem::assembler
8{
9 class Mass : public LinearAssembler
10 {
11 public:
13
17 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
18 assemble(const LinearAssemblerData &data) const override;
19
23 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1> compute_rhs(const AutodiffHessianPt &pt) const override;
24
26 void add_multimaterial(const int index, const json &params, const Units &units) override;
27
29 const Density &density() const { return density_; }
30
31 std::string name() const override { return "Mass"; }
32 virtual std::map<std::string, ParamFunc> parameters() const override;
33
34 private:
35 // class that stores and compute density per point
37 };
38} // namespace polyfem::assembler
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 ...
const Density & density() const
class that stores and compute density per point
Definition Mass.hpp:29
std::string name() const override
Definition Mass.hpp:31
void add_multimaterial(const int index, const json &params, const Units &units) override
inialize material parameter
Definition Mass.cpp:33
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > compute_rhs(const AutodiffHessianPt &pt) const override
uses autodiff to compute the rhs for a fabricated solution in this case it just return pt....
Definition Mass.cpp:25
virtual std::map< std::string, ParamFunc > parameters() const override
Definition Mass.cpp:40
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
computes and returns local stiffness matrix (1x1) for bases i,j (where i,j is passed in through data)...
Definition Mass.cpp:5
Used for test only.
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
nlohmann::json json
Definition Common.hpp:9