PolyFEM
Loading...
Searching...
No Matches
LinearElasticVarForm.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7
8namespace polysolve::linear
9{
10 class Solver;
11}
12
13namespace polyfem::solver
14{
15 class BodyForm;
16 class ElasticForm;
17 class InertiaForm;
18} // namespace polyfem::solver
19
20namespace polyfem::varform
21{
23 {
25
26 public:
27 using ElasticVarForm::ElasticVarForm;
28 std::string name() const override { return "LinearElastic"; }
29
30 std::vector<io::OutputField> output_fields(
31 const io::OutputSample &sample,
32 const Eigen::MatrixXd &solution,
33 const io::OutputFieldOptions &options) const override;
34
35 protected:
36 void reset() override;
37
38 void solve_problem(
39 Eigen::MatrixXd &sol,
40 const InitialConditionOverride *initial_condition_override,
41 const ForwardStepCallback &post_step) override;
42 void init_linear_solve(Eigen::MatrixXd &sol, const double t, const InitialConditionOverride *initial_condition_override);
43 void build_stiffness_mat(StiffnessMatrix &stiffness);
45 const std::unique_ptr<polysolve::linear::Solver> &solver,
47 Eigen::VectorXd &b,
48 const bool compute_spectrum,
49 Eigen::MatrixXd &sol);
50 void solve_static_linear(Eigen::MatrixXd &sol, const ForwardStepCallback &post_step);
51 void solve_transient_linear(Eigen::MatrixXd &sol, const ForwardStepCallback &post_step);
52
54 };
55} // namespace polyfem::varform
class to store time stepping data
Definition SolveData.hpp:56
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_static_linear(Eigen::MatrixXd &sol, const ForwardStepCallback &post_step)
void init_linear_solve(Eigen::MatrixXd &sol, const double t, const InitialConditionOverride *initial_condition_override)
void solve_problem(Eigen::MatrixXd &sol, const InitialConditionOverride *initial_condition_override, const ForwardStepCallback &post_step) override
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.
void solve_transient_linear(Eigen::MatrixXd &sol, const ForwardStepCallback &post_step)
void build_stiffness_mat(StiffnessMatrix &stiffness)
friend class polyfem::test::VarFormTestAccess
std::function< void(int step, const Eigen::MatrixXd &solution)> ForwardStepCallback
Definition VarForm.hpp:53
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:24