PolyFEM
Loading...
Searching...
No Matches
DifferentiableScalarVarForm.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace polyfem::varform
7{
9 {
10 public:
11 std::string name() const override;
12 void solve(
13 Eigen::MatrixXd &solution,
14 const InitialConditionOverride *initial_condition_override,
15 const ForwardStepCallback &post_step,
16 bool differentiable) override;
17 void prepare() override;
18 void save_vtu(const std::string &path, const Eigen::MatrixXd &solution, double time, double dt) const override;
19
20 json &get_args() override;
21 const json &get_args() const override;
22 const mesh::Mesh &get_mesh() const override;
24 const assembler::Problem &get_problem() const override;
25 const std::string &get_root_path() const override;
26 std::string input_path(const std::string &path, bool only_if_exists = false) const override;
27 std::string output_file_path(const std::string &path) const override;
28 const Units &get_units() const override;
29 bool is_contact_enabled() const override;
30
31 const FESpace &primary_space() const override;
32 const VarFormBoundaryState &boundary_state() const override;
33 const assembler::Assembler &primary_assembler() const override;
34 const assembler::Mass &mass_assembler() const override;
35 const assembler::AssemblyValsCache &assembly_cache() const override;
37 const StiffnessMatrix &mass_matrix() const override;
38 solver::SolveData *solve_data() override;
39 const solver::SolveData *solve_data() const override;
40
41 protected:
42 mesh::Mesh &mutable_mesh() override;
45 QuadratureOrders boundary_samples(int discr_order, int discr_orderq, int geometry_discr_order) const override;
46 };
47} // namespace polyfem::varform
Caches basis evaluation and geometric mapping at every element.
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
Definition Mesh.hpp:49
class to store time stepping data
Definition SolveData.hpp:55
const assembler::AssemblyValsCache & mass_assembly_cache() const override
std::string input_path(const std::string &path, bool only_if_exists=false) const override
std::string output_file_path(const std::string &path) const override
const assembler::Mass & mass_assembler() const override
QuadratureOrders boundary_samples(int discr_order, int discr_orderq, int geometry_discr_order) const override
const VarFormBoundaryState & boundary_state() const override
void save_vtu(const std::string &path, const Eigen::MatrixXd &solution, double time, double dt) const override
std::string name() const override
Get the name of the variational formulation.
const StiffnessMatrix & mass_matrix() const override
const assembler::AssemblyValsCache & assembly_cache() const override
const assembler::Assembler & primary_assembler() const override
void solve(Eigen::MatrixXd &solution, const InitialConditionOverride *initial_condition_override, const ForwardStepCallback &post_step, bool differentiable) override
bool is_contact_enabled() const override
Check if contact is enabled for the variational formulation, for output purposes.
Optimization-facing interface implemented by differentiated VarForm adapters.
A finite-element space for one scalar- or vector-valued field.
Definition FESpace.hpp:59
std::function< void(int step, const Eigen::MatrixXd &solution)> ForwardStepCallback
Definition VarForm.hpp:49
std::array< int, 2 > QuadratureOrders
Definition Types.hpp:19
nlohmann::json json
Definition Common.hpp:9
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:24
Temporary compatibility wrapper for boundary data belonging to one FE space.
Definition FESpace.hpp:152