34 #include "libmesh/getpot.h"
35 #include "libmesh/parameter_vector.h"
41 (
const GetPot& input,
42 const libMesh::Parallel::Communicator &comm )
65 system->solution->swap( *(system->rhs) );
66 equation_system->update();
71 system->solution->swap( *(system->rhs) );
72 equation_system->update();
78 (SharedPtr<libMesh::EquationSystems> equation_system,
80 const libMesh::ParameterVector & params,
84 for (
unsigned int p=0; p != params.size(); ++p)
86 std::stringstream pstr;
89 std::string filename =
90 this->_vis_output_file_prefix+
"_dRdp"+pstr.str();
93 system->solution->swap(system->get_sensitivity_rhs(p));
94 equation_system->update();
96 this->dump_visualization( equation_system, filename, 0.0 );
99 system->solution->swap(system->get_sensitivity_rhs(p));
100 equation_system->update();
107 const libMesh::Real )
109 const libMesh::DifferentiableQoI* raw_qoi = system->get_qoi();
112 unsigned int n_qois = qoi->
n_qois();
114 for(
unsigned int q = 0; q < n_qois; q++ )
116 libMesh::NumericVector<libMesh::Number>& dual_solution = system->get_adjoint_solution(q);
118 const std::string& qoi_name = qoi->
get_qoi(q).
name();
121 system->solution->swap( dual_solution );
122 equation_system->update();
127 system->solution->swap( dual_solution );
128 equation_system->update();
133 (SharedPtr<libMesh::EquationSystems> equation_system,
135 const libMesh::ParameterVector & params,
137 const libMesh::Real )
139 for (
unsigned int p=0; p != params.size(); ++p)
141 std::stringstream pstr;
144 std::string filename =
145 this->_vis_output_file_prefix+
"_dudp"+pstr.str();
148 system->solution->swap(system->get_sensitivity_solution(p));
149 equation_system->update();
151 this->dump_visualization( equation_system, filename, 0.0 );
154 system->solution->swap(system->get_sensitivity_solution(p));
155 equation_system->update();
virtual void output_residual_sensitivities(SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system, const libMesh::ParameterVector ¶ms, const unsigned int time_step, const libMesh::Real time)
const std::string & name() const
Returns the name of this QoI.
virtual void output_adjoint(SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system, const unsigned int time_step, const libMesh::Real time)
void dump_visualization(SharedPtr< libMesh::EquationSystems > equation_system, const std::string &filename_prefix, const libMesh::Real time)
virtual void output_residual(SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system, const unsigned int time_step, const libMesh::Real time)
const QoIBase & get_qoi(unsigned int qoi_index) const
std::string _vis_output_file_prefix
virtual void output_solution_sensitivities(SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system, const libMesh::ParameterVector ¶ms, const unsigned int time_step, const libMesh::Real time)
Interface with libMesh for solving Multiphysics problems.
SteadyVisualization(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
unsigned int n_qois() const