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

#include <NavierStokesSolver.hpp>

Public Member Functions

 NavierStokesSolver (const json &solver_param)
 
void minimize (const int n_bases, const int n_pressure_bases, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &pressure_bases, const std::vector< basis::ElementBases > &gbases, const assembler::Assembler &velocity_stokes_assembler, assembler::NavierStokesVelocity &velocity_assembler, const assembler::MixedAssembler &mixed_assembler, const assembler::Assembler &pressure_assembler, const assembler::AssemblyValsCache &ass_vals_cache, const assembler::AssemblyValsCache &pressure_ass_vals_cache, const std::vector< int > &boundary_nodes, const bool use_avg_pressure, const int problem_dim, const bool is_volume, 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 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 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 NavierStokesSolver.hpp.

Constructor & Destructor Documentation

◆ NavierStokesSolver()

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

Definition at line 24 of file NavierStokesSolver.cpp.

References gradNorm, iterations, and solver_param.

Member Function Documentation

◆ error_code()

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

Definition at line 46 of file NavierStokesSolver.hpp.

◆ get_info()

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

Definition at line 41 of file NavierStokesSolver.hpp.

References solver_info.

◆ has_nans()

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

Definition at line 244 of file NavierStokesSolver.cpp.

◆ minimize()

void polyfem::solver::NavierStokesSolver::minimize ( const int  n_bases,
const int  n_pressure_bases,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  pressure_bases,
const std::vector< basis::ElementBases > &  gbases,
const assembler::Assembler velocity_stokes_assembler,
assembler::NavierStokesVelocity velocity_assembler,
const assembler::MixedAssembler mixed_assembler,
const assembler::Assembler pressure_assembler,
const assembler::AssemblyValsCache ass_vals_cache,
const assembler::AssemblyValsCache pressure_ass_vals_cache,
const std::vector< int > &  boundary_nodes,
const bool  use_avg_pressure,
const int  problem_dim,
const bool  is_volume,
const Eigen::MatrixXd &  rhs,
Eigen::VectorXd &  x 
)

Definition at line 31 of file NavierStokesSolver.cpp.

References polyfem::assembler::Assembler::assemble(), polyfem::assembler::MixedAssembler::assemble(), 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_navier_stokes().

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

◆ minimize_aux()

int polyfem::solver::NavierStokesSolver::minimize_aux ( const bool  is_picard,
const std::vector< int > &  skipping,
const int  n_bases,
const int  n_pressure_bases,
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 Eigen::VectorXd &  rhs,
const double  grad_norm,
std::unique_ptr< polysolve::linear::Solver > &  solver,
double &  nlres_norm,
Eigen::VectorXd &  x 
)
private

Definition at line 145 of file NavierStokesSolver.cpp.

References polyfem::assembler::NavierStokesVelocity::assemble_hessian(), assembly_time, inverting_time, iterations, 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::NavierStokesSolver::assembly_time
private

Definition at line 76 of file NavierStokesSolver.hpp.

Referenced by minimize(), and minimize_aux().

◆ gradNorm

double polyfem::solver::NavierStokesSolver::gradNorm
private

Definition at line 69 of file NavierStokesSolver.hpp.

Referenced by minimize(), and NavierStokesSolver().

◆ internal_solver

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

Definition at line 74 of file NavierStokesSolver.hpp.

◆ inverting_time

double polyfem::solver::NavierStokesSolver::inverting_time
private

Definition at line 77 of file NavierStokesSolver.hpp.

Referenced by minimize(), and minimize_aux().

◆ iterations

int polyfem::solver::NavierStokesSolver::iterations
private

Definition at line 70 of file NavierStokesSolver.hpp.

Referenced by minimize_aux(), and NavierStokesSolver().

◆ solver_info

json polyfem::solver::NavierStokesSolver::solver_info
private

Definition at line 72 of file NavierStokesSolver.hpp.

Referenced by get_info(), and minimize().

◆ solver_param

const json polyfem::solver::NavierStokesSolver::solver_param
private

Definition at line 67 of file NavierStokesSolver.hpp.

Referenced by minimize(), and NavierStokesSolver().

◆ stokes_matrix_time

double polyfem::solver::NavierStokesSolver::stokes_matrix_time
private

Definition at line 78 of file NavierStokesSolver.hpp.

Referenced by minimize().

◆ stokes_solve_time

double polyfem::solver::NavierStokesSolver::stokes_solve_time
private

Definition at line 79 of file NavierStokesSolver.hpp.

Referenced by minimize().


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