GRINS-0.8.0
List of all members | Public Member Functions | Public Attributes
GRINS::ParameterManager Class Reference

Simple class to hold and initialize a ParameterVector. More...

#include <parameter_manager.h>

Public Member Functions

 ParameterManager ()
 
virtual ~ParameterManager ()
 
virtual void initialize (const GetPot &input, const std::string &parameters_varname, GRINS::MultiphysicsSystem &system, GRINS::CompositeQoI *qoi)
 

Public Attributes

std::vector< std::string > parameter_name_list
 
libMesh::ParameterVector parameter_vector
 

Detailed Description

Simple class to hold and initialize a ParameterVector.

Allows the user to specify parameters by name in the input file.

Definition at line 46 of file parameter_manager.h.

Constructor & Destructor Documentation

GRINS::ParameterManager::ParameterManager ( )
inline

Definition at line 50 of file parameter_manager.h.

50 {}
virtual GRINS::ParameterManager::~ParameterManager ( )
inlinevirtual

Definition at line 51 of file parameter_manager.h.

51 {}

Member Function Documentation

void GRINS::ParameterManager::initialize ( const GetPot &  input,
const std::string &  parameters_varname,
GRINS::MultiphysicsSystem system,
GRINS::CompositeQoI qoi 
)
virtual

Definition at line 43 of file parameter_manager.C.

References GRINS::CompositeQoI::register_parameter(), and GRINS::MultiphysicsSystem::register_parameter().

Referenced by GRINS::Simulation::init_params().

47  {
48  const unsigned int n_parameters =
49  input.vector_variable_size(parameters_varname);
50  libmesh_assert(n_parameters);
51 
52  this->parameter_name_list.resize(n_parameters);
53  this->parameter_vector.clear();
54  for (unsigned int i=0; i != n_parameters; ++i)
55  {
56  std::string param_name =
57  input(parameters_varname, std::string(), i);
58 
59  this->parameter_name_list[i] = param_name;
60 
63 
64  // We always have Physics solving for u
65  system.register_parameter(param_name, *next_param);
66 
67  // We don't always have QoIs when solving for du/dp
68  if (qoi)
69  qoi->register_parameter(param_name, *next_param);
70 
71  if (next_param->size() == 0)
72  {
73  std::cout << "No parameters named " << param_name <<
74  " found in active Physics or QoIs" << std::endl;
75  libmesh_error();
76  }
77 
78  this->parameter_vector.push_back
79  (libMesh::UniquePtr<libMesh::ParameterAccessor<libMesh::Number> >
80  (next_param));
81  }
82  }
std::vector< std::string > parameter_name_list
void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
Each QoI will register its copy(s) of an independent variable.
void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer)
Each Physics will register its copy(s) of an independent variable.
libMesh::ParameterVector parameter_vector

Member Data Documentation

std::vector<std::string> GRINS::ParameterManager::parameter_name_list

Definition at line 61 of file parameter_manager.h.

libMesh::ParameterVector GRINS::ParameterManager::parameter_vector

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

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