GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GRINS::Simulation Class Reference

#include <simulation.h>

Collaboration diagram for GRINS::Simulation:
Collaboration graph
[legend]

Public Member Functions

 Simulation (const GetPot &input, SimulationBuilder &sim_builder, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
 
 Simulation (const GetPot &input, GetPot &command_line, SimulationBuilder &sim_builder, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
 
virtual ~Simulation ()
 
void run ()
 
void print_sim_info ()
 
SharedPtr< libMesh::EquationSystems > get_equation_system ()
 
MultiphysicsSystemget_multiphysics_system ()
 
const MultiphysicsSystemget_multiphysics_system () const
 
libMesh::Number get_qoi_value (unsigned int qoi_index) const
 
const std::string & get_multiphysics_system_name () const
 

Protected Member Functions

void read_restart (const GetPot &input)
 
void init_multiphysics_system (const GetPot &input)
 Helper function. More...
 
void init_qois (const GetPot &input, SimulationBuilder &sim_builder)
 Helper function. More...
 
void init_params (const GetPot &input, SimulationBuilder &sim_builder)
 Helper function. More...
 
void init_restart (const GetPot &input, SimulationBuilder &sim_builder, const libMesh::Parallel::Communicator &comm)
 Helper function. More...
 
void check_for_unused_vars (const GetPot &input, bool warning_only)
 Helper function. More...
 
bool check_for_adjoint_solve (const GetPot &input) const
 Helper function. More...
 
void init_adjoint_solve (const GetPot &input, bool output_adjoint)
 Helper function. More...
 
void build_error_estimator (const GetPot &input)
 

Protected Attributes

SharedPtr< libMesh::UnstructuredMesh > _mesh
 
SharedPtr< libMesh::EquationSystems > _equation_system
 
SharedPtr< GRINS::Solver_solver
 
std::string _system_name
 GRINS::Multiphysics system name. More...
 
GRINS::MultiphysicsSystem_multiphysics_system
 
SharedPtr< GRINS::Visualization_vis
 
SharedPtr< PostProcessedQuantities< libMesh::Real > > _postprocessing
 
bool _print_mesh_info
 
bool _print_log_info
 
bool _print_equation_system_info
 
bool _print_perflog
 
bool _print_qoi
 
bool _print_scalars
 
bool _output_vis
 
bool _output_adjoint
 
bool _output_residual
 
bool _output_residual_sensitivities
 
bool _output_solution_sensitivities
 
unsigned int _timesteps_per_vis
 
unsigned int _timesteps_per_perflog
 
ErrorEstimatorOptions _error_estimator_options
 
SharedPtr< libMesh::ErrorEstimator > _error_estimator
 
ParameterManager _adjoint_parameters
 
ParameterManager _forward_parameters
 
bool _do_adjoint_solve
 
bool _have_restart
 

Private Member Functions

 Simulation ()
 

Detailed Description

Definition at line 62 of file simulation.h.

Constructor & Destructor Documentation

GRINS::Simulation::Simulation ( const GetPot &  input,
SimulationBuilder sim_builder,
const libMesh::Parallel::Communicator &comm  LIBMESH_CAN_DEFAULT_TO_COMMWORLD 
)
GRINS::Simulation::Simulation ( const GetPot &  input,
GetPot &  command_line,
SimulationBuilder sim_builder,
const libMesh::Parallel::Communicator &comm  LIBMESH_CAN_DEFAULT_TO_COMMWORLD 
)
virtual GRINS::Simulation::~Simulation ( )
inlinevirtual

Definition at line 77 of file simulation.h.

77 {};
GRINS::Simulation::Simulation ( )
private

Member Function Documentation

void GRINS::Simulation::build_error_estimator ( const GetPot &  input)
protected

Definition at line 540 of file simulation.C.

References _error_estimator, _error_estimator_options, _multiphysics_system, GRINS::ErrorEstimatorOptions::estimator_type(), GRINS::ErrorEstimatorFactoryBase::set_estimator_options(), GRINS::FactoryWithGetPot< libMesh::ErrorEstimator >::set_getpot(), and GRINS::ErrorEstimatorFactoryBase::set_system().

541  {
542  std::string estimator_type = _error_estimator_options.estimator_type();
543  if( estimator_type != std::string("none") )
544  {
548  _error_estimator.reset( (ErrorEstimatorFactoryBase::build(estimator_type)).release() );
549  }
550  }
static void set_estimator_options(const ErrorEstimatorOptions &estimator_options)
const std::string & estimator_type() const
SharedPtr< libMesh::ErrorEstimator > _error_estimator
Definition: simulation.h:159
static void set_system(MultiphysicsSystem &system)
ErrorEstimatorOptions _error_estimator_options
Definition: simulation.h:158
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
bool GRINS::Simulation::check_for_adjoint_solve ( const GetPot &  input) const
protected

Helper function.

Todo:
This option name WILL change at some point.

Definition at line 518 of file simulation.C.

References _adjoint_parameters, _error_estimator_options, GRINS::StrategiesParsing::do_adjoint_solve(), GRINS::ErrorEstimatorOptions::estimator_requires_adjoint(), GRINS::ErrorEstimatorOptions::estimator_type(), and GRINS::ParameterManager::parameter_vector.

Referenced by init_adjoint_solve().

519  {
520  std::string error_estimator = _error_estimator_options.estimator_type();
521 
522  bool do_adjoint_solve = false;
523 
524  // First check if the error estimator requires an adjoint solve
526  do_adjoint_solve = true;
527 
528  // Next check if parameter sensitivies require an adjoint solve
530  do_adjoint_solve = true;
531 
532  // Now check if the user requested to do an adjoint solve regardless
535  do_adjoint_solve = true;
536 
537  return do_adjoint_solve;
538  }
static bool do_adjoint_solve(const GetPot &input)
Option to let user manually trigger adjoint solve.
const std::string & estimator_type() const
libMesh::ParameterVector parameter_vector
ParameterManager _adjoint_parameters
Definition: simulation.h:161
ErrorEstimatorOptions _error_estimator_options
Definition: simulation.h:158
void GRINS::Simulation::check_for_unused_vars ( const GetPot &  input,
bool  warning_only 
)
protected

Helper function.

Definition at line 265 of file simulation.C.

266  {
267  /* Everything should be set up now, so check if there's any unused variables
268  in the input file. If so, then tell the user what they were and error out. */
269  std::vector<std::string> unused_vars = input.unidentified_variables();
270 
271  bool unused_vars_detected = false;
272 
273  // String we use to check if there is a variable in the Materials section
274  std::string mat_string = "Materials/";
275 
276  // If we do have unused variables, make sure they are in the Materials
277  // section since we're allowing those to be present and not used.
278  if( !unused_vars.empty() )
279  {
280  int n_total = unused_vars.size();
281 
282  int n_mats = 0;
283 
284  for( int v = 0; v < n_total; v++ )
285  if( (unused_vars[v]).find(mat_string) != std::string::npos )
286  n_mats += 1;
287 
288  libmesh_assert_greater_equal( n_total, n_mats );
289 
290  if( n_mats < n_total )
291  unused_vars_detected = true;
292  }
293 
294  if( unused_vars_detected )
295  {
296  libMesh::err << "==========================================================" << std::endl;
297  if( warning_only )
298  libMesh::err << "Warning: ";
299  else
300  libMesh::err << "Error: ";
301 
302  libMesh::err << "Found unused variables!" << std::endl;
303 
304  for( std::vector<std::string>::const_iterator it = unused_vars.begin();
305  it != unused_vars.end(); ++it )
306  {
307  // Don't print out any unused Material variables, since we allow these
308  if( (*it).find(mat_string) != std::string::npos )
309  continue;
310 
311  libMesh::err << *it << std::endl;
312  }
313  libMesh::err << "==========================================================" << std::endl;
314 
315  if( !warning_only )
316  libmesh_error();
317  }
318 
319  return;
320  }
SharedPtr< libMesh::EquationSystems > GRINS::Simulation::get_equation_system ( )

Definition at line 442 of file simulation.C.

References _equation_system.

443  {
444  return _equation_system;
445  }
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126
MultiphysicsSystem * GRINS::Simulation::get_multiphysics_system ( )
inline

Definition at line 185 of file simulation.h.

References _multiphysics_system.

186  {
187  return this->_multiphysics_system;
188  }
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
const MultiphysicsSystem * GRINS::Simulation::get_multiphysics_system ( ) const
inline

Definition at line 178 of file simulation.h.

References _multiphysics_system.

179  {
180  return this->_multiphysics_system;
181  }
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
const std::string & GRINS::Simulation::get_multiphysics_system_name ( ) const
inline

Definition at line 191 of file simulation.h.

References _system_name.

192  {
193  return this->_system_name;
194  }
std::string _system_name
GRINS::Multiphysics system name.
Definition: simulation.h:131
libMesh::Number GRINS::Simulation::get_qoi_value ( unsigned int  qoi_index) const

Definition at line 447 of file simulation.C.

References _multiphysics_system, and GRINS::CompositeQoI::get_qoi_value().

448  {
449  const CompositeQoI* qoi = libMesh::libmesh_cast_ptr<const CompositeQoI*>(this->_multiphysics_system->get_qoi());
450  return qoi->get_qoi_value(qoi_index);
451  }
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
void GRINS::Simulation::init_adjoint_solve ( const GetPot &  input,
bool  output_adjoint 
)
protected

Helper function.

Definition at line 495 of file simulation.C.

References _do_adjoint_solve, _multiphysics_system, and check_for_adjoint_solve().

496  {
497  // Check if we're doing an adjoint solve
499 
500  const libMesh::DifferentiableQoI* raw_qoi = _multiphysics_system->get_qoi();
501  const CompositeQoI* qoi = dynamic_cast<const CompositeQoI*>( raw_qoi );
502 
503  // If we are trying to do an adjoint solve without a QoI, that's an error
504  // If there are no QoIs, the CompositeQoI never gets built and qoi will be NULL
505  if( _do_adjoint_solve && !qoi )
506  {
507  libmesh_error_msg("Error: Adjoint solve requested, but no QoIs detected.");
508  }
509 
510  /* If we are not doing an adjoint solve, but adjoint output was requested:
511  that's an error. */
512  if( !_do_adjoint_solve && output_adjoint )
513  {
514  libmesh_error_msg("Error: Adjoint output requested, but no adjoint solve requested.");
515  }
516  }
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
bool check_for_adjoint_solve(const GetPot &input) const
Helper function.
Definition: simulation.C:518
void GRINS::Simulation::init_multiphysics_system ( const GetPot &  input)
protected

Helper function.

Definition at line 142 of file simulation.C.

References _equation_system, _multiphysics_system, _postprocessing, _print_log_info, _solver, GRINS::MultiphysicsSystem::attach_physics_list(), GRINS::PhysicsBuilder::build_physics_map(), GRINS::StrategiesParsing::extra_quadrature_order(), GRINS::MultiphysicsSystem::read_input_options(), and GRINS::MultiphysicsSystem::register_postprocessing_vars().

143  {
144  // Only print libMesh logging info if the user requests it
145  libMesh::perflog.disable_logging();
146  if( this->_print_log_info ) libMesh::perflog.enable_logging();
147 
148  PhysicsList physics_list = PhysicsBuilder::build_physics_map(input);
149 
150  _multiphysics_system->attach_physics_list( physics_list );
151 
153 
155 
156  /* Postprocessing needs to be initialized before the solver since that's
157  where equation_system gets init'ed */
159 
160  _solver->initialize( input, _equation_system, _multiphysics_system );
161 
162  // Useful for debugging
163  if( input("screen-options/print_dof_constraints", false ) )
164  {
165  _multiphysics_system->get_dof_map().print_dof_constraints();
166  }
167 
168  // This *must* be done after equation_system->init in order to get variable indices
169  // Set any extra quadrature order the user requested. By default, is 0.
170  _multiphysics_system->extra_quadrature_order = StrategiesParsing::extra_quadrature_order(input);
171  }
static PhysicsList build_physics_map(const GetPot &input)
Returns container of constructed Physics objects.
void attach_physics_list(PhysicsList physics_list)
PhysicsList gets built by GRINS::PhysicsFactory and attached here.
void register_postprocessing_vars(const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
Each Physics will register their postprocessed quantities with this call.
SharedPtr< PostProcessedQuantities< libMesh::Real > > _postprocessing
Definition: simulation.h:138
static int extra_quadrature_order(const GetPot &input)
SharedPtr< GRINS::Solver > _solver
Definition: simulation.h:128
std::map< std::string, SharedPtr< GRINS::Physics > > PhysicsList
Container for GRINS::Physics object pointers.
Definition: var_typedefs.h:59
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
virtual void read_input_options(const GetPot &input)
Reads input options for this class and all physics that are enabled.
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126
void GRINS::Simulation::init_params ( const GetPot &  input,
SimulationBuilder sim_builder 
)
protected

Helper function.

Definition at line 196 of file simulation.C.

References _adjoint_parameters, _forward_parameters, _multiphysics_system, and GRINS::ParameterManager::initialize().

198  {
199  unsigned int n_adjoint_parameters =
200  input.vector_variable_size("QoI/adjoint_sensitivity_parameters");
201 
202  unsigned int n_forward_parameters =
203  input.vector_variable_size("QoI/forward_sensitivity_parameters");
204 
205  // If the user actually asks for parameter sensitivities, then we
206  // set up the parameter vectors to use.
207  if ( n_adjoint_parameters )
208  {
209  // If we're doing adjoint sensitivities, dq/dp only makes
210  // sense if we have q
211  CompositeQoI* qoi =
212  libMesh::cast_ptr<CompositeQoI*>
213  (this->_multiphysics_system->get_qoi());
214 
215  if (!qoi)
216  {
217  std::cout <<
218  "Error: adjoint_sensitivity_parameters are specified but\n"
219  << "no QoIs have been specified.\n" << std::endl;
220  libmesh_error();
221  }
222 
224  (input, "QoI/adjoint_sensitivity_parameters",
225  *this->_multiphysics_system, qoi);
226  }
227 
228  if ( n_forward_parameters )
229  {
230  // If we're doing forward sensitivities, du/dp can make
231  // sense even with no q defined
232  CompositeQoI* qoi =
233  dynamic_cast<CompositeQoI*>
234  (this->_multiphysics_system->get_qoi());
235 
236  // dynamic_cast returns NULL if our QoI isn't a CompositeQoI;
237  // i.e. if there were no QoIs that made us bother setting up
238  // the CompositeQoI object. Passing NULL tells
239  // ParameterManager not to bother asking for qoi registration
240  // of parameters.
241 
243  (input, "QoI/forward_sensitivity_parameters",
244  *this->_multiphysics_system, qoi);
245  }
246  }
ParameterManager _forward_parameters
Definition: simulation.h:163
ParameterManager _adjoint_parameters
Definition: simulation.h:161
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
virtual void initialize(const GetPot &input, const std::string &parameters_varname, GRINS::MultiphysicsSystem &system, GRINS::CompositeQoI *qoi)
void GRINS::Simulation::init_qois ( const GetPot &  input,
SimulationBuilder sim_builder 
)
protected

Helper function.

Definition at line 173 of file simulation.C.

References _multiphysics_system, _print_qoi, and GRINS::SimulationBuilder::build_qoi().

174  {
175  // If the user actually asks for a QoI, then we add it.
176  SharedPtr<CompositeQoI> qois = sim_builder.build_qoi( input );
177  if( qois->n_qois() > 0 )
178  {
179  // This *must* be done after equation_system->init in order to get variable indices
180  qois->init(input, *_multiphysics_system );
181 
182  /* Note that we are effectively transfering ownership of the qoi pointer because
183  it will be cloned in _multiphysics_system and all the calculations are done there. */
184  _multiphysics_system->attach_qoi( qois.get() );
185  }
186  else if (_print_qoi)
187  {
188  std::cout << "Error: print_qoi is specified but\n" <<
189  "no QoIs have been specified.\n" << std::endl;
190  libmesh_error();
191  }
192 
193  return;
194  }
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
void GRINS::Simulation::init_restart ( const GetPot &  input,
SimulationBuilder sim_builder,
const libMesh::Parallel::Communicator &  comm 
)
protected

Helper function.

Definition at line 249 of file simulation.C.

References _equation_system, _mesh, GRINS::MeshBuilder::do_mesh_refinement_from_input(), GRINS::SimulationBuilder::mesh_builder(), and read_restart().

251  {
252  this->read_restart( input );
253 
254  /* We do this here only if there's a restart file. Otherwise, this was done
255  at mesh construction time */
256  sim_builder.mesh_builder().do_mesh_refinement_from_input( input, comm, *_mesh );
257 
258  /* \todo Any way to tell if the mesh got refined so we don't unnecessarily
259  call reinit()? */
260  _equation_system->reinit();
261 
262  return;
263  }
void read_restart(const GetPot &input)
Definition: simulation.C:453
SharedPtr< libMesh::UnstructuredMesh > _mesh
Definition: simulation.h:124
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126
void GRINS::Simulation::print_sim_info ( )

Definition at line 431 of file simulation.C.

References _equation_system, _mesh, _print_equation_system_info, and _print_mesh_info.

Referenced by run().

432  {
433  // Print mesh info if the user wants it
434  if( this->_print_mesh_info ) this->_mesh->print_info();
435 
436  // Print info if requested
437  if( this->_print_equation_system_info ) this->_equation_system->print_info();
438 
439  return;
440  }
bool _print_equation_system_info
Definition: simulation.h:143
SharedPtr< libMesh::UnstructuredMesh > _mesh
Definition: simulation.h:124
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126
void GRINS::Simulation::read_restart ( const GetPot &  input)
protected

Definition at line 453 of file simulation.C.

References _equation_system, _have_restart, and GRINS::SimulationParsing::restart_file().

Referenced by init_restart().

454  {
455  const std::string restart_file = SimulationParsing::restart_file(input);
456 
457  // Most of this was pulled from FIN-S
458  if (restart_file != "none")
459  {
460  std::cout << " ====== Restarting from " << restart_file << std::endl;
461 
462  // Must have correct file type to restart
463  if (restart_file.rfind(".xdr") < restart_file.size())
464  _equation_system->read(restart_file,GRINSEnums::DECODE,
465  //libMesh::EquationSystems::READ_HEADER | // Allow for thermochemistry upgrades
466  libMesh::EquationSystems::READ_DATA |
467  libMesh::EquationSystems::READ_ADDITIONAL_DATA);
468 
469  else if (restart_file.rfind(".xda") < restart_file.size())
470  _equation_system->read(restart_file,GRINSEnums::READ,
471  //libMesh::EquationSystems::READ_HEADER | // Allow for thermochemistry upgrades
472  libMesh::EquationSystems::READ_DATA |
473  libMesh::EquationSystems::READ_ADDITIONAL_DATA);
474 
475  else
476  {
477  std::cerr << "Error: Restart filename must have .xdr or .xda extension!" << std::endl;
478  libmesh_error();
479  }
480 
481  this->_have_restart = true;
482 
483  const std::string system_name = input("screen-options/system_name", "GRINS" );
484 
485  MultiphysicsSystem& system =
486  _equation_system->get_system<MultiphysicsSystem>(system_name);
487 
488  // Update the old data
489  system.update();
490  }
491 
492  return;
493  }
static std::string restart_file(const GetPot &input)
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126
void GRINS::Simulation::run ( )

Definition at line 322 of file simulation.C.

References _adjoint_parameters, _do_adjoint_solve, _equation_system, _error_estimator, _forward_parameters, _have_restart, _multiphysics_system, _output_adjoint, _output_residual, _output_residual_sensitivities, _output_solution_sensitivities, _output_vis, _postprocessing, _print_log_info, _print_qoi, _print_scalars, _solver, _timesteps_per_perflog, _timesteps_per_vis, _vis, GRINS::SolverContext::do_adjoint_solve, GRINS::SolverContext::equation_system, GRINS::SolverContext::error_estimator, GRINS::SolverContext::have_restart, GRINS::SolverContext::output_adjoint, GRINS::CompositeQoI::output_qoi(), GRINS::SolverContext::output_residual, GRINS::SolverContext::output_residual_sensitivities, GRINS::SolverContext::output_solution_sensitivities, GRINS::SolverContext::output_vis, GRINS::ParameterManager::parameter_vector, GRINS::SolverContext::postprocessing, GRINS::SolverContext::print_perflog, GRINS::SolverContext::print_qoi, GRINS::SolverContext::print_scalars, print_sim_info(), GRINS::SolverContext::system, GRINS::SolverContext::timesteps_per_perflog, GRINS::SolverContext::timesteps_per_vis, and GRINS::SolverContext::vis.

Referenced by main(), and run().

323  {
324  this->print_sim_info();
325 
326  SolverContext context;
327  context.system = _multiphysics_system;
328  context.equation_system = _equation_system;
329  context.vis = _vis;
330  context.output_adjoint = _output_adjoint;
331  context.timesteps_per_vis = _timesteps_per_vis;
332  context.timesteps_per_perflog = _timesteps_per_perflog;
333  context.output_vis = _output_vis;
334  context.output_residual = _output_residual;
335  context.output_residual_sensitivities = _output_residual_sensitivities;
336  context.output_solution_sensitivities = _output_solution_sensitivities;
337  context.print_scalars = _print_scalars;
338  context.print_perflog = _print_log_info;
339  context.postprocessing = _postprocessing;
340  context.error_estimator = _error_estimator;
341  context.print_qoi = _print_qoi;
342  context.do_adjoint_solve = _do_adjoint_solve;
343  context.have_restart = _have_restart;
344 
347  {
348  std::cout <<
349  "Error: output_residual_sensitivities is specified but\n" <<
350  "no forward sensitivity parameters have been specified.\n" <<
351  std::endl;
352  libmesh_error();
353  }
354 
357  {
358  std::cout <<
359  "Error: output_solution_sensitivities is specified but\n" <<
360  "no forward sensitivity parameters have been specified.\n" <<
361  std::endl;
362  libmesh_error();
363  }
364 
365  _solver->solve( context );
366 
367  if ( this->_print_qoi )
368  {
369  _multiphysics_system->assemble_qoi();
370  const CompositeQoI* my_qoi = libMesh::libmesh_cast_ptr<const CompositeQoI*>(this->_multiphysics_system->get_qoi());
371  my_qoi->output_qoi( std::cout );
372  }
373 
375  {
376  // Default: "calculate sensitivities for all QoIs"
377  libMesh::QoISet qois;
378 
379  const libMesh::ParameterVector & params =
381 
382  libMesh::SensitivityData sensitivities
383  (qois, *this->_multiphysics_system, params);
384 
385  _solver->adjoint_qoi_parameter_sensitivity
386  (context, qois, params, sensitivities);
387 
388  std::cout << "Adjoint sensitivities:" << std::endl;
389 
390  for (unsigned int q=0;
391  q != this->_multiphysics_system->qoi.size(); ++q)
392  {
393  for (unsigned int p=0; p != params.size(); ++p)
394  {
395  std::cout << "dq" << q << "/dp" << p << " = " <<
396  sensitivities[q][p] << std::endl;
397  }
398  }
399  }
400 
402  {
403  // Default: "calculate sensitivities for all QoIs"
404  libMesh::QoISet qois;
405 
406  const libMesh::ParameterVector & params =
408 
409  libMesh::SensitivityData sensitivities
410  (qois, *this->_multiphysics_system, params);
411 
412  _solver->forward_qoi_parameter_sensitivity
413  (context, qois, params, sensitivities);
414 
415  std::cout << "Forward sensitivities:" << std::endl;
416 
417  for (unsigned int q=0;
418  q != this->_multiphysics_system->qoi.size(); ++q)
419  {
420  for (unsigned int p=0; p != params.size(); ++p)
421  {
422  std::cout << "dq" << q << "/dp" << p << " = " <<
423  sensitivities[q][p] << std::endl;
424  }
425  }
426  }
427 
428  return;
429  }
ParameterManager _forward_parameters
Definition: simulation.h:163
unsigned int _timesteps_per_vis
Definition: simulation.h:155
SharedPtr< PostProcessedQuantities< libMesh::Real > > _postprocessing
Definition: simulation.h:138
SharedPtr< libMesh::ErrorEstimator > _error_estimator
Definition: simulation.h:159
SharedPtr< GRINS::Solver > _solver
Definition: simulation.h:128
libMesh::ParameterVector parameter_vector
ParameterManager _adjoint_parameters
Definition: simulation.h:161
bool _output_residual_sensitivities
Definition: simulation.h:152
bool _output_solution_sensitivities
Definition: simulation.h:153
GRINS::MultiphysicsSystem * _multiphysics_system
Definition: simulation.h:134
unsigned int _timesteps_per_perflog
Definition: simulation.h:156
SharedPtr< GRINS::Visualization > _vis
Definition: simulation.h:136
void print_sim_info()
Definition: simulation.C:431
SharedPtr< libMesh::EquationSystems > _equation_system
Definition: simulation.h:126

Member Data Documentation

ParameterManager GRINS::Simulation::_adjoint_parameters
protected

Definition at line 161 of file simulation.h.

Referenced by check_for_adjoint_solve(), init_params(), and run().

bool GRINS::Simulation::_do_adjoint_solve
protected

Definition at line 166 of file simulation.h.

Referenced by init_adjoint_solve(), and run().

SharedPtr<libMesh::EquationSystems> GRINS::Simulation::_equation_system
protected
SharedPtr<libMesh::ErrorEstimator> GRINS::Simulation::_error_estimator
protected

Definition at line 159 of file simulation.h.

Referenced by build_error_estimator(), and run().

ErrorEstimatorOptions GRINS::Simulation::_error_estimator_options
protected

Definition at line 158 of file simulation.h.

Referenced by build_error_estimator(), and check_for_adjoint_solve().

ParameterManager GRINS::Simulation::_forward_parameters
protected

Definition at line 163 of file simulation.h.

Referenced by init_params(), and run().

bool GRINS::Simulation::_have_restart
protected

Definition at line 168 of file simulation.h.

Referenced by read_restart(), and run().

SharedPtr<libMesh::UnstructuredMesh> GRINS::Simulation::_mesh
protected

Definition at line 124 of file simulation.h.

Referenced by init_restart(), and print_sim_info().

GRINS::MultiphysicsSystem* GRINS::Simulation::_multiphysics_system
protected
bool GRINS::Simulation::_output_adjoint
protected

Definition at line 150 of file simulation.h.

Referenced by run().

bool GRINS::Simulation::_output_residual
protected

Definition at line 151 of file simulation.h.

Referenced by run().

bool GRINS::Simulation::_output_residual_sensitivities
protected

Definition at line 152 of file simulation.h.

Referenced by run().

bool GRINS::Simulation::_output_solution_sensitivities
protected

Definition at line 153 of file simulation.h.

Referenced by run().

bool GRINS::Simulation::_output_vis
protected

Definition at line 149 of file simulation.h.

Referenced by run().

SharedPtr<PostProcessedQuantities<libMesh::Real> > GRINS::Simulation::_postprocessing
protected

Definition at line 138 of file simulation.h.

Referenced by init_multiphysics_system(), and run().

bool GRINS::Simulation::_print_equation_system_info
protected

Definition at line 143 of file simulation.h.

Referenced by print_sim_info().

bool GRINS::Simulation::_print_log_info
protected

Definition at line 142 of file simulation.h.

Referenced by init_multiphysics_system(), and run().

bool GRINS::Simulation::_print_mesh_info
protected

Definition at line 141 of file simulation.h.

Referenced by print_sim_info().

bool GRINS::Simulation::_print_perflog
protected

Definition at line 144 of file simulation.h.

bool GRINS::Simulation::_print_qoi
protected

Definition at line 145 of file simulation.h.

Referenced by init_qois(), and run().

bool GRINS::Simulation::_print_scalars
protected

Definition at line 146 of file simulation.h.

Referenced by run().

SharedPtr<GRINS::Solver> GRINS::Simulation::_solver
protected

Definition at line 128 of file simulation.h.

Referenced by init_multiphysics_system(), and run().

std::string GRINS::Simulation::_system_name
protected

GRINS::Multiphysics system name.

Definition at line 131 of file simulation.h.

Referenced by get_multiphysics_system_name().

unsigned int GRINS::Simulation::_timesteps_per_perflog
protected

Definition at line 156 of file simulation.h.

Referenced by run().

unsigned int GRINS::Simulation::_timesteps_per_vis
protected

Definition at line 155 of file simulation.h.

Referenced by run().

SharedPtr<GRINS::Visualization> GRINS::Simulation::_vis
protected

Definition at line 136 of file simulation.h.

Referenced by run().


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

Generated on Thu Jun 2 2016 21:52:32 for GRINS-0.7.0 by  doxygen 1.8.10