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, const io::ResourceIO &resources) override;
21 void set_params(const LameParameters &params) { params_ = params; }
22
23 std::string name() const override { return "IncompressibleLinearElasticity"; }
24 bool allow_inversion() const override { return true; }
25 std::map<std::string, ParamFunc> parameters() const override;
26
27 protected:
29 Eigen::Index point, const MatrixNd &displacement_gradient, OutputStress &stress) const override;
30
31 private:
33 };
34
35 // mixed, displacement and pressure
37 {
38 public:
39 std::string name() const override { return "IncompressibleLinearElasticityMixed"; }
40
41 // res is R^{dim}
42 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1>
43 assemble(const MixedAssemblerData &data) const override;
44
45 inline int rows() const override { return size_; }
46 inline int cols() const override { return 1; }
47 };
48
49 // pressure only part
51 {
52 public:
54
55 // res is R^{1}
56 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
57 assemble(const LinearAssemblerData &data) const override;
58
59 void add_multimaterial(const int index, const json &params, const Units &units, const io::ResourceIO &resources) override;
60 void set_params(const LameParameters &params) { params_ = params; }
61
62 std::string name() const override { return "IncompressibleLinearElasticityPressure"; }
63 std::map<std::string, ParamFunc> parameters() const override { return std::map<std::string, ParamFunc>(); }
64
65 void set_size(const int size) override
66 {
68 size_ = 1;
69 }
70
71 private:
73 int disp_size_ = 0;
74 };
75} // namespace polyfem::assembler
ElementAssemblyValues vals
Eigen::RowVectorXd point
stores per element basis values at given quadrature points and geometric mapping
void add_multimaterial(const int index, const json &params, const Units &units, const io::ResourceIO &resources) 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
bool compute_output_stress(const OutputData &data, const ElementAssemblyValues &vals, Eigen::Index point, const MatrixNd &displacement_gradient, OutputStress &stress) const override
Return false to use a material's legacy assign_stress_tensor implementation.
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > assemble(const MixedAssemblerData &data) const override
void add_multimaterial(const int index, const json &params, const Units &units, const io::ResourceIO &resources) override
std::map< std::string, ParamFunc > parameters() const 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 ...
Read-only interface to a hierarchical collection of simulation resources.
Used for test only.
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 3, 3 > MatrixNd
Definition Types.hpp:14