PolyFEM
Loading...
Searching...
No Matches
IncompressibleLinElast.hpp
Go to the documentation of this file.
1#pragma once
2
7
8// local assembler for incompressible model, pressure is separate (see Stokes)
9namespace polyfem::assembler
10{
11 // displacement assembler
13 {
14 public:
16 // res is R^{dimĀ²}
17 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
18 assemble(const LinearAssemblerData &data) const override;
19
20 void add_multimaterial(const int index, const json &params, const Units &units) override;
21 void set_params(const LameParameters &params) { params_ = params; }
22
23 std::string name() const override { return "IncompressibleLinearElasticity"; }
24 std::map<std::string, ParamFunc> parameters() const override;
25
26 protected:
27 void assign_stress_tensor(const OutputData &data,
28 const int all_size,
29 const ElasticityTensorType &type,
30 Eigen::MatrixXd &all,
31 const std::function<Eigen::MatrixXd(const Eigen::MatrixXd &)> &fun) const override;
32
33 private:
35 };
36
37 // mixed, displacement and pressure
39 {
40 public:
41 std::string name() const override { return "IncompressibleLinearElasticityMixed"; }
42
43 // res is R^{dim}
44 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1>
45 assemble(const MixedAssemblerData &data) const override;
46
47 inline int rows() const override { return size_; }
48 inline int cols() const override { return 1; }
49 };
50
51 // pressure only part
53 {
54 public:
56
57 // res is R^{1}
58 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
59 assemble(const LinearAssemblerData &data) const override;
60
61 void add_multimaterial(const int index, const json &params, const Units &units) override;
62 void set_params(const LameParameters &params) { params_ = params; }
63
64 std::string name() const override { return "IncompressibleLinearElasticityPressure"; }
65 std::map<std::string, ParamFunc> parameters() const override { return std::map<std::string, ParamFunc>(); }
66
67 void set_size(const int size) override
68 {
70 size_ = 1;
71 }
72
73 private:
75 int disp_size_ = 0;
76 };
77} // namespace polyfem::assembler
void add_multimaterial(const int index, const json &params, const Units &units) override
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...
std::map< std::string, ParamFunc > parameters() const override
void assign_stress_tensor(const OutputData &data, const int all_size, const ElasticityTensorType &type, Eigen::MatrixXd &all, const std::function< Eigen::MatrixXd(const Eigen::MatrixXd &)> &fun) const override
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > assemble(const MixedAssemblerData &data) const override
std::map< std::string, ParamFunc > parameters() const override
void add_multimaterial(const int index, const json &params, const Units &units) override
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...
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.
nlohmann::json json
Definition Common.hpp:9