GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions
GRINS::SteadySolver Class Reference

#include <steady_solver.h>

Inheritance diagram for GRINS::SteadySolver:
Inheritance graph
[legend]
Collaboration diagram for GRINS::SteadySolver:
Collaboration graph
[legend]

Public Member Functions

 SteadySolver (const GetPot &input)
 
virtual ~SteadySolver ()
 
virtual void solve (SolverContext &context)
 
virtual void adjoint_qoi_parameter_sensitivity (SolverContext &context, const libMesh::QoISet &qoi_indices, const libMesh::ParameterVector &parameters_in, libMesh::SensitivityData &sensitivities) const
 
virtual void forward_qoi_parameter_sensitivity (SolverContext &context, const libMesh::QoISet &qoi_indices, const libMesh::ParameterVector &parameters_in, libMesh::SensitivityData &sensitivities) const
 
- Public Member Functions inherited from GRINS::Solver
 Solver (const GetPot &input)
 
virtual ~Solver ()
 
virtual void initialize (const GetPot &input, SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system)
 
void steady_adjoint_solve (SolverContext &context)
 Do steady version of adjoint solve. More...
 
void print_scalar_vars (SolverContext &context)
 
void print_qoi (SolverContext &context)
 

Protected Member Functions

virtual void init_time_solver (GRINS::MultiphysicsSystem *system)
 
- Protected Member Functions inherited from GRINS::Solver
void set_solver_options (libMesh::DiffSolver &solver)
 

Additional Inherited Members

- Protected Attributes inherited from GRINS::Solver
unsigned int _max_nonlinear_iterations
 
double _relative_step_tolerance
 
double _absolute_step_tolerance
 
double _relative_residual_tolerance
 
double _absolute_residual_tolerance
 
double _initial_linear_tolerance
 
double _minimum_linear_tolerance
 
unsigned int _max_linear_iterations
 
bool _continue_after_backtrack_failure
 
bool _continue_after_max_iterations
 
bool _require_residual_reduction
 
bool _solver_quiet
 
bool _solver_verbose
 

Detailed Description

Definition at line 34 of file steady_solver.h.

Constructor & Destructor Documentation

GRINS::SteadySolver::SteadySolver ( const GetPot &  input)

Definition at line 43 of file steady_solver.C.

44  : Solver( input )
45  {
46  return;
47  }
Solver(const GetPot &input)
Definition: solver.C:48
GRINS::SteadySolver::~SteadySolver ( )
virtual

Definition at line 49 of file steady_solver.C.

50  {
51  return;
52  }

Member Function Documentation

void GRINS::SteadySolver::adjoint_qoi_parameter_sensitivity ( SolverContext context,
const libMesh::QoISet &  qoi_indices,
const libMesh::ParameterVector &  parameters_in,
libMesh::SensitivityData &  sensitivities 
) const
virtual

Reimplemented from GRINS::Solver.

Definition at line 107 of file steady_solver.C.

References GRINS::SolverContext::system.

111  {
112  // Get the linear solver
113  libMesh::LinearSolver<libMesh::Number> *linear_solver = context.system->get_linear_solver();
114 
115  // Set ourselves to reuse the preconditioner
116  linear_solver->reuse_preconditioner(true);
117 
118  context.system->adjoint_qoi_parameter_sensitivity
119  (qoi_indices, parameters_in, sensitivities);
120 
121  // Go back to not reusing the preconditioner
122  linear_solver->reuse_preconditioner(false);
123  }
void GRINS::SteadySolver::forward_qoi_parameter_sensitivity ( SolverContext context,
const libMesh::QoISet &  qoi_indices,
const libMesh::ParameterVector &  parameters_in,
libMesh::SensitivityData &  sensitivities 
) const
virtual

Reimplemented from GRINS::Solver.

Definition at line 126 of file steady_solver.C.

References GRINS::SolverContext::equation_system, GRINS::SolverContext::output_residual_sensitivities, GRINS::SolverContext::output_solution_sensitivities, GRINS::SolverContext::system, and GRINS::SolverContext::vis.

130  {
131  context.system->forward_qoi_parameter_sensitivity
132  (qoi_indices, parameters_in, sensitivities);
133 
134  if( context.output_residual_sensitivities )
135  context.vis->output_residual_sensitivities
136  ( context.equation_system, context.system, parameters_in );
137 
138  if( context.output_solution_sensitivities )
139  context.vis->output_solution_sensitivities
140  ( context.equation_system, context.system, parameters_in );
141  }
void GRINS::SteadySolver::init_time_solver ( GRINS::MultiphysicsSystem system)
protectedvirtual

Implements GRINS::Solver.

Definition at line 54 of file steady_solver.C.

55  {
56  libMesh::SteadySolver* time_solver = new libMesh::SteadySolver( *(system) );
57 
58  system->time_solver = libMesh::UniquePtr<libMesh::TimeSolver>(time_solver);
59  return;
60  }
void GRINS::SteadySolver::solve ( SolverContext context)
virtual

Implements GRINS::Solver.

Definition at line 62 of file steady_solver.C.

References GRINS::SolverContext::do_adjoint_solve, GRINS::SolverContext::equation_system, GRINS::SolverContext::output_adjoint, GRINS::SolverContext::output_residual, GRINS::SolverContext::output_vis, GRINS::SolverContext::postprocessing, GRINS::Solver::print_scalar_vars(), GRINS::SolverContext::print_scalars, GRINS::Solver::steady_adjoint_solve(), GRINS::SolverContext::system, and GRINS::SolverContext::vis.

63  {
64  libmesh_assert( context.system );
65 
66  if( context.output_vis )
67  {
68  context.postprocessing->update_quantities( *(context.equation_system) );
69  context.vis->output( context.equation_system );
70  }
71 
72  context.system->solve();
73 
74  if ( context.print_scalars )
75  this->print_scalar_vars(context);
76 
77  if( context.do_adjoint_solve )
78  {
79  // Get the linear solver
80  libMesh::LinearSolver<libMesh::Number> *linear_solver = context.system->get_linear_solver();
81 
82  // Set ourselves to reuse the preconditioner
83  linear_solver->reuse_preconditioner(true);
84 
85  // Solve the adjoint problem
86  this->steady_adjoint_solve(context);
87 
88  // Go back to not reusing the preconditioner
89  linear_solver->reuse_preconditioner(false);
90  }
91 
92  if( context.output_adjoint )
93  context.vis->output_adjoint( context.equation_system, context.system );
94 
95  if( context.output_vis )
96  {
97  context.postprocessing->update_quantities( *(context.equation_system) );
98  context.vis->output( context.equation_system );
99  }
100 
101  if( context.output_residual ) context.vis->output_residual( context.equation_system, context.system );
102 
103  return;
104  }
void steady_adjoint_solve(SolverContext &context)
Do steady version of adjoint solve.
Definition: solver.C:123
void print_scalar_vars(SolverContext &context)
Definition: solver.C:133

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

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1