PolyFEM
Loading...
Searching...
No Matches
TransientNavierStokesSolver.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <polyfem/Common.hpp>
7
8#include <polysolve/linear/Solver.hpp>
9
11
12#include <memory>
13
14namespace polyfem
15{
16 namespace solver
17 {
19 {
20 public:
22
23 void minimize(const int n_bases,
24 const int n_pressure_bases,
25 const double t,
26 const std::vector<basis::ElementBases> &bases,
27 const std::vector<basis::ElementBases> &gbases,
28 assembler::NavierStokesVelocity &velocity_assembler,
29 const assembler::AssemblyValsCache &ass_vals_cache,
30 const std::vector<int> &boundary_nodes,
31 const bool use_avg_pressure,
32 const int problem_dim,
33 const bool is_volume,
34 const double beta_dt, const Eigen::VectorXd &prev_sol,
35 const StiffnessMatrix &velocity_stiffness, const StiffnessMatrix &mixed_stiffness, const StiffnessMatrix &pressure_stiffness,
36 const StiffnessMatrix &velocity_mass1,
37 const Eigen::MatrixXd &rhs, Eigen::VectorXd &x);
38 void get_info(json &params)
39 {
40 params = solver_info;
41 }
42
43 int error_code() const { return 0; }
44
45 private:
46 int minimize_aux(const bool is_picard,
47 const std::vector<int> &skipping,
48 const int n_bases,
49 const int n_pressure_bases,
50 const double t,
51 const std::vector<basis::ElementBases> &bases,
52 const std::vector<basis::ElementBases> &gbases,
53 assembler::NavierStokesVelocity &velocity_assembler,
54 const assembler::AssemblyValsCache &ass_vals_cache,
55 const std::vector<int> &boundary_nodes,
56 const bool use_avg_pressure,
57 const int problem_dim,
58 const bool is_volume,
59 const StiffnessMatrix &velocity_stiffness, const StiffnessMatrix &mixed_stiffness, const StiffnessMatrix &pressure_stiffness,
60 const StiffnessMatrix &velocity_mass,
61 const Eigen::VectorXd &rhs, const double grad_norm,
62 std::unique_ptr<polysolve::linear::Solver> &solver, double &nlres_norm,
63 Eigen::VectorXd &x);
64
66
67 double gradNorm;
69
71
72 json internal_solver = json::array();
73
78
79 bool
81 };
82 } // namespace solver
83} // namespace polyfem
int x
Caches basis evaluation and geometric mapping at every element.
void minimize(const int n_bases, const int n_pressure_bases, const double t, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, assembler::NavierStokesVelocity &velocity_assembler, const assembler::AssemblyValsCache &ass_vals_cache, const std::vector< int > &boundary_nodes, const bool use_avg_pressure, const int problem_dim, const bool is_volume, const double beta_dt, const Eigen::VectorXd &prev_sol, const StiffnessMatrix &velocity_stiffness, const StiffnessMatrix &mixed_stiffness, const StiffnessMatrix &pressure_stiffness, const StiffnessMatrix &velocity_mass1, const Eigen::MatrixXd &rhs, Eigen::VectorXd &x)
int minimize_aux(const bool is_picard, const std::vector< int > &skipping, const int n_bases, const int n_pressure_bases, const double t, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, assembler::NavierStokesVelocity &velocity_assembler, const assembler::AssemblyValsCache &ass_vals_cache, const std::vector< int > &boundary_nodes, const bool use_avg_pressure, const int problem_dim, const bool is_volume, const StiffnessMatrix &velocity_stiffness, const StiffnessMatrix &mixed_stiffness, const StiffnessMatrix &pressure_stiffness, const StiffnessMatrix &velocity_mass, const Eigen::VectorXd &rhs, const double grad_norm, std::unique_ptr< polysolve::linear::Solver > &solver, double &nlres_norm, Eigen::VectorXd &x)
bool has_nans(const polyfem::StiffnessMatrix &hessian)
nlohmann::json json
Definition Common.hpp:9
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:22