Template Class NavierStokesSolver¶
Defined in File navier_stokes.h
Inheritance Relationships¶
Base Type¶
public dealii::EnableObserverPointer
Class Documentation¶
-
template<int dim, int spacedim = dim>
class NavierStokesSolver : public dealii::EnableObserverPointer¶ Distributed mixed finite-element solver for transient Stokes/Navier—Stokes.
The solver deliberately follows the lifecycle of PoissonSolver: grid creation, finite-element setup, algebraic setup, assembly, solve, output, and a small explicit time-stepping driver. A single Problem owns the native two-block algebraic system
[velocity, pressure].The default finite-element pair is Taylor—Hood Q_k/Q_{k-1}. The pressure is normalized by constraining one pressure degree of freedom to zero. This is a direct algebraic pressure normalization; it removes the constant nullspace without adding a third Lagrange-multiplier block.
This first implementation supports full-dimensional two- and three- dimensional meshes only (
dim == spacedim). It has no elasticity, immersed-boundary, coupling, ALE, or external time-integrator dependency.Public Functions
-
explicit NavierStokesSolver(const NavierStokesParameters<dim, spacedim> &par)¶
-
void make_grid()¶
-
void setup_fe()¶
-
void setup_system()¶
-
void assemble_system()¶
Assemble the time-discrete system at the current time.
-
void solve()¶
Solve the currently assembled two-block saddle-point system.
-
void output_results() const¶
-
void advance_one_timestep()¶
Advance one backward-Euler step and accept its solution.
-
void run()¶
Run the complete transient lifecycle.
-
void accept_state(const VectorType &velocity, const VectorType &pressure, double time, unsigned int step_number)¶
Accept semantic velocity and pressure fields from an external solver.
-
dealii::types::global_dof_index n_dofs() const¶
-
unsigned int n_time_steps() const¶
-
unsigned int timestep_number() const¶
-
double solution_l2_norm() const¶
-
bool solution_is_finite() const¶
-
double system_residual_l2_norm() const¶
-
double divergence_l2_norm() const¶
-
double current_time() const¶
-
double time_step() const¶
-
const dealii::AffineConstraints<double> &constraints() const¶
-
const LA::MPI::BlockSparseMatrix &system_matrix() const¶
-
const LA::MPI::BlockSparseMatrix &mass_matrix() const¶
-
const LA::MPI::BlockSparseMatrix &continuous_operator() const¶
Return the continuous spatial Stokes operator [A,-B^T;-B,0].
-
const LA::MPI::SparseMatrix &velocity_mass_matrix() const¶
Return the physical velocity mass matrix without the density factor.
-
const LA::MPI::SparseMatrix &pressure_metric_matrix() const¶
Return the pressure metric used only by the native preconditioner.
-
void velocity_forcing_at_time(double time, LA::MPI::Vector &destination) const¶
Assemble the unscaled velocity forcing vector at an external time.
-
const BlockVectorType &system_rhs() const¶
-
const BlockVectorType &solution() const¶
-
const BlockVectorType &previous_solution() const¶
-
const BlockVectorType &locally_relevant_solution() const¶
-
const dealii::IndexSet &locally_owned_dofs() const¶
-
const dealii::IndexSet &locally_relevant_dofs() const¶
-
const std::vector<dealii::IndexSet> &locally_owned_dofs_by_block() const¶
-
const std::vector<dealii::IndexSet> &locally_relevant_dofs_by_block() const¶
-
const dealii::FEValuesExtractors::Vector &velocity_extractor() const¶
-
const dealii::FEValuesExtractors::Scalar &pressure_extractor() const¶
-
const dealii::ComponentMask &velocity_component_mask() const¶
-
double density() const¶
Return the physical density used by the continuous velocity equation.
-
double viscosity() const¶
Return the physical viscosity used by the continuous velocity equation.
-
bool include_convective_term() const¶
Whether the semidiscrete contributor includes the convective term.
-
dealii::types::global_dof_index velocity_block_size() const¶
Return the global mixed-block offset of the pressure block.
-
void set_solution(const BlockVectorType &new_solution)¶
Replace the accepted state and use it as the next-step history.
-
explicit NavierStokesSolver(const NavierStokesParameters<dim, spacedim> &par)¶