PolyFEM
Loading...
Searching...
No Matches
polyfem::solver::TransientNavierStokesSolver Class Reference

#include <TransientNavierStokesSolver.hpp>

Public Member Functions

 TransientNavierStokesSolver (const json &solver_param)
 
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)
 
void get_info (json &params)
 
int error_code () const
 

Private Member Functions

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)
 

Private Attributes

const json solver_param
 
double gradNorm
 
int iterations
 
json solver_info
 
json internal_solver = json::array()
 
double assembly_time
 
double inverting_time
 
double stokes_matrix_time
 
double stokes_solve_time
 

Detailed Description

Definition at line 18 of file TransientNavierStokesSolver.hpp.

Constructor & Destructor Documentation

◆ TransientNavierStokesSolver()

polyfem::solver::TransientNavierStokesSolver::TransientNavierStokesSolver ( const json solver_param)

Definition at line 24 of file TransientNavierStokesSolver.cpp.

References gradNorm, iterations, and solver_param.

Member Function Documentation

◆ error_code()

int polyfem::solver::TransientNavierStokesSolver::error_code ( ) const
inline

Definition at line 43 of file TransientNavierStokesSolver.hpp.

◆ get_info()

void polyfem::solver::TransientNavierStokesSolver::get_info ( json params)
inline

Definition at line 38 of file TransientNavierStokesSolver.hpp.

References solver_info.

◆ has_nans()

bool polyfem::solver::TransientNavierStokesSolver::has_nans ( const polyfem::StiffnessMatrix hessian)
private

◆ minimize()

void polyfem::solver::TransientNavierStokesSolver::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 
)

Definition at line 31 of file TransientNavierStokesSolver.cpp.

References assembly_time, gradNorm, inverting_time, polyfem::logger(), polyfem::assembler::AssemblerUtils::merge_mixed_matrices(), minimize_aux(), polyfem::assembler::NavierStokesVelocity::name(), solver_info, solver_param, stokes_matrix_time, stokes_solve_time, and x.

Referenced by polyfem::State::solve_transient_navier_stokes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ minimize_aux()

int polyfem::solver::TransientNavierStokesSolver::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 
)
private

Definition at line 161 of file TransientNavierStokesSolver.cpp.

References polyfem::assembler::NavierStokesVelocity::assemble_hessian(), assembly_time, inverting_time, iterations, polyfem::log_and_throw_error(), polyfem::logger(), polyfem::assembler::AssemblerUtils::merge_mixed_matrices(), polyfem::assembler::NavierStokesVelocity::set_picard(), and x.

Referenced by minimize().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ assembly_time

double polyfem::solver::TransientNavierStokesSolver::assembly_time
private

Definition at line 74 of file TransientNavierStokesSolver.hpp.

Referenced by minimize(), and minimize_aux().

◆ gradNorm

double polyfem::solver::TransientNavierStokesSolver::gradNorm
private

Definition at line 67 of file TransientNavierStokesSolver.hpp.

Referenced by minimize(), and TransientNavierStokesSolver().

◆ internal_solver

json polyfem::solver::TransientNavierStokesSolver::internal_solver = json::array()
private

Definition at line 72 of file TransientNavierStokesSolver.hpp.

◆ inverting_time

double polyfem::solver::TransientNavierStokesSolver::inverting_time
private

Definition at line 75 of file TransientNavierStokesSolver.hpp.

Referenced by minimize(), and minimize_aux().

◆ iterations

int polyfem::solver::TransientNavierStokesSolver::iterations
private

Definition at line 68 of file TransientNavierStokesSolver.hpp.

Referenced by minimize_aux(), and TransientNavierStokesSolver().

◆ solver_info

json polyfem::solver::TransientNavierStokesSolver::solver_info
private

Definition at line 70 of file TransientNavierStokesSolver.hpp.

Referenced by get_info(), and minimize().

◆ solver_param

const json polyfem::solver::TransientNavierStokesSolver::solver_param
private

Definition at line 65 of file TransientNavierStokesSolver.hpp.

Referenced by minimize(), and TransientNavierStokesSolver().

◆ stokes_matrix_time

double polyfem::solver::TransientNavierStokesSolver::stokes_matrix_time
private

Definition at line 76 of file TransientNavierStokesSolver.hpp.

Referenced by minimize().

◆ stokes_solve_time

double polyfem::solver::TransientNavierStokesSolver::stokes_solve_time
private

Definition at line 77 of file TransientNavierStokesSolver.hpp.

Referenced by minimize().


The documentation for this class was generated from the following files: