PolyFEM
Loading...
Searching...
No Matches
LinearElasticVarForm.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <memory>
6
7namespace polysolve::linear
8{
9 class Solver;
10}
11
12namespace polyfem::solver
13{
14 class BodyForm;
15 class ElasticForm;
16 class InertiaForm;
17} // namespace polyfem::solver
18
19namespace polyfem::varform
20{
22 {
24
25 public:
26 std::string name() const override { return "LinearElastic"; }
27
28 std::vector<io::OutputField> output_fields(
29 const io::OutputSample &sample,
30 const Eigen::MatrixXd &solution,
31 const io::OutputFieldOptions &options) const override;
32
33 private:
34 void reset() override;
35
36 void solve_problem(Eigen::MatrixXd &sol) override;
37 void init_linear_solve(Eigen::MatrixXd &sol, const double t);
38 void build_stiffness_mat(StiffnessMatrix &stiffness);
40 const std::unique_ptr<polysolve::linear::Solver> &solver,
42 Eigen::VectorXd &b,
43 const bool compute_spectrum,
44 Eigen::MatrixXd &sol);
45 void solve_static_linear(Eigen::MatrixXd &sol);
46 void solve_transient_linear(Eigen::MatrixXd &sol);
47
48 std::shared_ptr<solver::ElasticForm> elastic_form;
49 std::shared_ptr<solver::BodyForm> body_form;
50 std::shared_ptr<solver::InertiaForm> inertia_form;
51
52 std::shared_ptr<time_integrator::ImplicitTimeIntegrator> time_integrator;
53 };
54} // namespace polyfem::varform
void init_linear_solve(Eigen::MatrixXd &sol, const double t)
void solve_linear_system(const std::unique_ptr< polysolve::linear::Solver > &solver, StiffnessMatrix &A, Eigen::VectorXd &b, const bool compute_spectrum, Eigen::MatrixXd &sol)
void solve_problem(Eigen::MatrixXd &sol) override
void solve_transient_linear(Eigen::MatrixXd &sol)
std::shared_ptr< solver::ElasticForm > elastic_form
std::string name() const override
Get the name of the variational formulation.
std::vector< io::OutputField > output_fields(const io::OutputSample &sample, const Eigen::MatrixXd &solution, const io::OutputFieldOptions &options) const override
Get the output fields of the variational formulation, for output purposes.
std::shared_ptr< solver::InertiaForm > inertia_form
void build_stiffness_mat(StiffnessMatrix &stiffness)
std::shared_ptr< solver::BodyForm > body_form
friend class polyfem::test::VarFormTestAccess
std::shared_ptr< time_integrator::ImplicitTimeIntegrator > time_integrator
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:24