PolyFEM
Loading...
Searching...
No Matches
MacroStrainALForm.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Form.hpp"
4
5namespace polyfem::assembler {
6 class MacroStrainValue;
7}
8
9namespace polyfem::solver
10{
11 class MacroStrainALForm : public Form
12 {
13 public:
14 MacroStrainALForm(const assembler::MacroStrainValue &macro_strain_constraint);
15
16 std::string name() const override { return "strain-penalty"; }
17
18 void update_quantities(const double t, const Eigen::VectorXd &x) override;
19 double compute_error(const Eigen::VectorXd &x) const;
20
21 protected:
25 double value_unweighted(const Eigen::VectorXd &x) const override;
26
30 void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override;
31
35 void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override;
36
37 private:
38 Eigen::VectorXd values;
40 };
41}
int x
std::string name() const override
const assembler::MacroStrainValue & macro_strain_constraint_
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
double compute_error(const Eigen::VectorXd &x) const
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
void update_quantities(const double t, const Eigen::VectorXd &x) override
Update time-dependent fields.
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the contact barrier potential value.
Used for test only.
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:22