37 #include "libmesh/error_vector.h"
38 #include "libmesh/steady_solver.h"
39 #include "libmesh/adjoint_refinement_estimator.h"
58 libMesh::SteadySolver* time_solver =
new libMesh::SteadySolver( *(system) );
60 system->time_solver = libMesh::UniquePtr<libMesh::TimeSolver>( time_solver );
72 std::string error_message =
"You asked for QoI error estimates but did not use an Adjoint Refinement Error Estimator!\n";
73 error_message +=
"Please use the ADJOINT_REFINEMENT option for the estimator_type if you want QoI error estimates.\n";
74 std::cout<<error_message<<std::endl;
89 std::cout <<
"==========================================================" << std::endl
91 <<
" adaptive refinements" << std::endl
92 <<
"==========================================================" << std::endl;
96 std::cout <<
"==========================================================" << std::endl
97 <<
"Adaptive Refinement Step " << r_step << std::endl
98 <<
"==========================================================" << std::endl;
122 libMesh::ErrorVector error;
127 for(
unsigned int i = 0; i != context.
system->qoi.size(); i++)
129 libMesh::AdjointRefinementEstimator* adjoint_ref_error_estimator = libMesh::cast_ptr<libMesh::AdjointRefinementEstimator*>( context.
error_estimator.get() );
130 std::cout<<
"The error estimate for QoI("<<i<<
") is: "<<adjoint_ref_error_estimator->get_global_QoI_error_estimate(i)<<std::endl;
139 std::cout <<
"==========================================================" << std::endl
140 <<
"Convergence detected!" << std::endl
141 <<
"==========================================================" << std::endl;
165 const libMesh::QoISet& qoi_indices,
166 const libMesh::ParameterVector& parameters_in,
167 libMesh::SensitivityData& sensitivities)
const
169 context.
system->adjoint_qoi_parameter_sensitivity
170 (qoi_indices, parameters_in, sensitivities);
175 const libMesh::QoISet& qoi_indices,
176 const libMesh::ParameterVector& parameters_in,
177 libMesh::SensitivityData& sensitivities)
const
179 context.
system->forward_qoi_parameter_sensitivity
180 (qoi_indices, parameters_in, sensitivities);
183 context.
vis->output_residual_sensitivities
187 context.
vis->output_solution_sensitivities
virtual void forward_qoi_parameter_sensitivity(SolverContext &context, const libMesh::QoISet &qoi_indices, const libMesh::ParameterVector ¶meters_in, libMesh::SensitivityData &sensitivities) const
SharedPtr< libMesh::EquationSystems > equation_system
virtual void solve(SolverContext &context)
SharedPtr< PostProcessedQuantities< libMesh::Real > > postprocessing
void build_mesh_refinement(libMesh::MeshBase &mesh)
void check_qoi_error_option_consistency(SolverContext &context)
void perform_amr(SolverContext &context, const libMesh::ErrorVector &error)
void estimate_error_for_amr(SolverContext &context, libMesh::ErrorVector &error)
void steady_adjoint_solve(SolverContext &context)
Do steady version of adjoint solve.
bool check_for_convergence(SolverContext &context, const libMesh::ErrorVector &error) const
SharedPtr< libMesh::ErrorEstimator > error_estimator
SharedPtr< QoIOutput > qoi_output
virtual ~SteadyMeshAdaptiveSolver()
bool output_residual_sensitivities
GRINS::MultiphysicsSystem * system
SharedPtr< GRINS::Visualization > vis
Interface with libMesh for solving Multiphysics problems.
SteadyMeshAdaptiveSolver(const GetPot &input)
ErrorEstimatorOptions _error_estimator_options
Simple class to hold objects passed to Solver::solve.
void print_qoi(SolverContext &context)
unsigned int max_refinement_steps() const
bool compute_qoi_error_estimate() const
MeshAdaptivityOptions _mesh_adaptivity_options
virtual void adjoint_qoi_parameter_sensitivity(SolverContext &context, const libMesh::QoISet &qoi_indices, const libMesh::ParameterVector ¶meters_in, libMesh::SensitivityData &sensitivities) const
bool output_solution_sensitivities
virtual void init_time_solver(MultiphysicsSystem *system)