GRINS-0.6.0
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
GRINS::ScalarODE Class Reference

Physics class for arbitrary scalar-valued ODEs. More...

#include <scalar_ode.h>

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

Public Member Functions

 ScalarODE (const std::string &physics_name, const GetPot &input)
 
 ~ScalarODE ()
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialization of variables. More...
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Sets scalar variable(s) to be time-evolving. More...
 
virtual void read_input_options (const GetPot &input)
 Read options from GetPot input file. More...
 
virtual void init_context (AssemblyContext &context)
 Prepare the context for evaluations. More...
 
virtual void nonlocal_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void nonlocal_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void nonlocal_mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for scalar variables. More...
 
VariableIndex scalar_ode_var () const
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void element_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void side_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void element_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for element interiors. More...
 
virtual void side_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
void init_bcs (libMesh::FEMSystem *system)
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
void attach_neumann_bound_func (GRINS::NBCContainer &neumann_bcs)
 
void attach_dirichlet_bound_func (const GRINS::DBCContainer &dirichlet_bc)
 
virtual void compute_element_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_element_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
BCHandlingBaseget_bc_handler ()
 
ICHandlingBaseget_ic_handler ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Protected Attributes

const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::BCHandlingBase_bc_handler
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 
bool _is_axisymmetric
 

Static Protected Attributes

static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 

Private Member Functions

 ScalarODE ()
 

Private Attributes

std::string time_deriv_function_string
 
std::string constraint_function_string
 
std::string mass_residual_function_string
 
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > time_deriv_function
 
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > constraint_function
 
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > mass_residual_function
 
libMesh::Number _order
 
libMesh::Number _epsilon
 
VariableIndex _scalar_ode_var
 
std::string _scalar_ode_var_name
 

Detailed Description

Physics class for arbitrary scalar-valued ODEs.

Definition at line 50 of file scalar_ode.h.

Constructor & Destructor Documentation

GRINS::ScalarODE::ScalarODE ( const std::string &  physics_name,
const GetPot &  input 
)

Definition at line 40 of file scalar_ode.C.

References GRINS::Physics::_ic_handler, and read_input_options().

41  : Physics(physics_name, input), _order(1), _epsilon(1e-6)
42  {
43  this->read_input_options(input);
44 
45  this->_ic_handler = new GenericICHandler( physics_name, input );
46 
47  return;
48  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
libMesh::Number _order
Definition: scalar_ode.h:109
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.
Definition: scalar_ode.C:84
libMesh::Number _epsilon
Definition: scalar_ode.h:112
GRINS::ScalarODE::~ScalarODE ( )

Definition at line 50 of file scalar_ode.C.

51  {
52  return;
53  }
GRINS::ScalarODE::ScalarODE ( )
private

Member Function Documentation

void GRINS::Physics::attach_dirichlet_bound_func ( const GRINS::DBCContainer dirichlet_bc)
inherited

Definition at line 150 of file physics.C.

References GRINS::Physics::_bc_handler, and GRINS::BCHandlingBase::attach_dirichlet_bound_func().

151  {
152  _bc_handler->attach_dirichlet_bound_func( dirichlet_bc );
153  return;
154  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
void attach_dirichlet_bound_func(const GRINS::DBCContainer &dirichlet_bc)
void GRINS::Physics::attach_neumann_bound_func ( GRINS::NBCContainer neumann_bcs)
inherited

Definition at line 144 of file physics.C.

References GRINS::Physics::_bc_handler, and GRINS::BCHandlingBase::attach_neumann_bound_func().

145  {
146  _bc_handler->attach_neumann_bound_func( neumann_bcs );
147  return;
148  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
void attach_neumann_bound_func(GRINS::NBCContainer &neumann_bcs)
void GRINS::Physics::auxiliary_init ( MultiphysicsSystem system)
virtualinherited

Any auxillary initialization a Physics class may need.

This is called after all variables are added, so this method can safely query the MultiphysicsSystem about variable information.

Definition at line 113 of file physics.C.

114  {
115  return;
116  }
void GRINS::Physics::compute_element_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 185 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::element_constraint().

187  {
188  return;
189  }
void GRINS::Physics::compute_element_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited
void GRINS::Physics::compute_mass_residual_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 203 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::mass_residual().

205  {
206  return;
207  }
void GRINS::Physics::compute_nonlocal_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 197 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_constraint().

199  {
200  return;
201  }
void GRINS::Physics::compute_nonlocal_mass_residual_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 209 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_mass_residual().

211  {
212  return;
213  }
void GRINS::Physics::compute_nonlocal_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 179 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::nonlocal_time_derivative().

181  {
182  return;
183  }
void GRINS::Physics::compute_postprocessed_quantity ( unsigned int  quantity_index,
const AssemblyContext context,
const libMesh::Point &  point,
libMesh::Real &  value 
)
virtualinherited
void GRINS::Physics::compute_side_constraint_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Definition at line 191 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_constraint().

193  {
194  return;
195  }
void GRINS::Physics::compute_side_time_derivative_cache ( const AssemblyContext context,
CachedValues cache 
)
virtualinherited

Reimplemented in GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 173 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_time_derivative().

175  {
176  return;
177  }
void GRINS::Physics::element_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited
void GRINS::Physics::element_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Time dependent part(s) of physics for element interiors.

Reimplemented in GRINS::SpalartAllmaras< Viscosity >, GRINS::AxisymmetricBoussinesqBuoyancy, GRINS::AxisymmetricHeatTransfer< Conductivity >, GRINS::ParsedVelocitySource< Viscosity >, GRINS::VelocityPenalty< Viscosity >, GRINS::AveragedTurbine< Viscosity >, GRINS::VelocityDrag< Viscosity >, GRINS::AveragedFan< Viscosity >, GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::HeatTransferSource< SourceFunction >, GRINS::BoussinesqBuoyancy, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::AveragedTurbineAdjointStabilization< Viscosity >, GRINS::HeatTransfer< Conductivity >, GRINS::VelocityDragAdjointStabilization< Viscosity >, GRINS::AveragedFanAdjointStabilization< Viscosity >, GRINS::HeatConduction< Conductivity >, GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >, GRINS::Stokes< Viscosity >, GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >, GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >, GRINS::ElasticCable< StressStrainLaw >, GRINS::ParsedVelocitySourceAdjointStabilization< Viscosity >, GRINS::VelocityPenaltyAdjointStabilization< Viscosity >, GRINS::ElasticMembrane< StressStrainLaw >, GRINS::ParsedSourceTerm, GRINS::SpalartAllmarasSPGSMStabilization< Viscosity >, GRINS::HeatTransferAdjointStabilization< Conductivity >, GRINS::HeatTransferSPGSMStabilization< Conductivity >, GRINS::LowMachNavierStokesBraackStabilization< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::LowMachNavierStokesVMSStabilization< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::ConstantSourceTerm, GRINS::IncompressibleNavierStokesAdjointStabilization< Viscosity >, GRINS::IncompressibleNavierStokesSPGSMStabilization< Viscosity >, GRINS::LowMachNavierStokesSPGSMStabilization< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::ElasticCableConstantGravity, and GRINS::ElasticMembraneConstantPressure.

Definition at line 215 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::element_time_derivative().

218  {
219  return;
220  }
bool GRINS::Physics::enabled_on_elem ( const libMesh::Elem *  elem)
virtualinherited

Find if current physics is active on supplied element.

Definition at line 83 of file physics.C.

References GRINS::Physics::_enabled_subdomains.

84  {
85  // Check if enabled_subdomains flag has been set and if we're
86  // looking at a real element (rather than a nonlocal evaluation)
87  if( !elem || _enabled_subdomains.empty() )
88  return true;
89 
90  // Check if current physics is enabled on elem
91  if( _enabled_subdomains.find( elem->subdomain_id() ) == _enabled_subdomains.end() )
92  return false;
93 
94  return true;
95  }
std::set< libMesh::subdomain_id_type > _enabled_subdomains
Subdomains on which the current Physics class is enabled.
Definition: physics.h:261
BCHandlingBase * GRINS::Physics::get_bc_handler ( )
inlineinherited

Definition at line 282 of file physics.h.

References GRINS::Physics::_bc_handler.

283  {
284  return _bc_handler;
285  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
ICHandlingBase * GRINS::Physics::get_ic_handler ( )
inlineinherited

Definition at line 288 of file physics.h.

References GRINS::Physics::_ic_handler.

289  {
290  return _ic_handler;
291  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
void GRINS::Physics::init_bcs ( libMesh::FEMSystem *  system)
inherited

Definition at line 118 of file physics.C.

References GRINS::Physics::_bc_handler, GRINS::BCHandlingBase::init_bc_data(), GRINS::BCHandlingBase::init_dirichlet_bc_func_objs(), GRINS::BCHandlingBase::init_dirichlet_bcs(), and GRINS::BCHandlingBase::init_periodic_bcs().

119  {
120  // Only need to init BC's if the physics actually created a handler
121  if( _bc_handler )
122  {
123  _bc_handler->init_bc_data( *system );
124  _bc_handler->init_dirichlet_bcs( system );
126  _bc_handler->init_periodic_bcs( system );
127  }
128 
129  return;
130  }
GRINS::BCHandlingBase * _bc_handler
Definition: physics.h:256
virtual void init_dirichlet_bcs(libMesh::FEMSystem *system) const
virtual void init_periodic_bcs(libMesh::FEMSystem *system) const
virtual void init_dirichlet_bc_func_objs(libMesh::FEMSystem *system) const
virtual void init_bc_data(const libMesh::FEMSystem &system)
Override this method to initialize any system-dependent data.
void GRINS::ScalarODE::init_context ( AssemblyContext context)
virtual

Prepare the context for evaluations.

Reimplemented from GRINS::Physics.

Definition at line 116 of file scalar_ode.C.

References constraint_function, mass_residual_function, and time_deriv_function.

117  {
118  mass_residual_function->init_context(context);
119  time_deriv_function->init_context(context);
120  constraint_function->init_context(context);
121  }
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > mass_residual_function
Definition: scalar_ode.h:103
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > constraint_function
Definition: scalar_ode.h:103
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > time_deriv_function
Definition: scalar_ode.h:103
void GRINS::Physics::init_ics ( libMesh::FEMSystem *  system,
libMesh::CompositeFunction< libMesh::Number > &  all_ics 
)
inherited

Definition at line 133 of file physics.C.

References GRINS::Physics::_ic_handler, and GRINS::ICHandlingBase::init_ic_data().

135  {
136  if( _ic_handler )
137  {
138  _ic_handler->init_ic_data( *system, all_ics );
139  }
140 
141  return;
142  }
GRINS::ICHandlingBase * _ic_handler
Definition: physics.h:258
virtual void init_ic_data(const libMesh::FEMSystem &system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
Override this method to initialize any system-dependent data.
void GRINS::ScalarODE::init_variables ( libMesh::FEMSystem *  system)
virtual

Initialization of variables.

Add scalar variable(s) to system.

Implements GRINS::Physics.

Definition at line 55 of file scalar_ode.C.

References _order, _scalar_ode_var, and _scalar_ode_var_name.

56  {
57  this->_scalar_ode_var = system->add_variable(_scalar_ode_var_name,
58  libMesh::Order(this->_order),
59  libMesh::SCALAR);
60  }
std::string _scalar_ode_var_name
Definition: scalar_ode.h:116
libMesh::Number _order
Definition: scalar_ode.h:109
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114
bool GRINS::Physics::is_steady ( ) const
inherited

Returns whether or not this physics is being solved with a steady solver.

Definition at line 103 of file physics.C.

References GRINS::Physics::_is_steady.

Referenced by GRINS::Physics::set_is_steady().

104  {
105  return _is_steady;
106  }
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
void GRINS::Physics::mass_residual ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited
void GRINS::ScalarODE::nonlocal_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Constraint part(s) of physics for scalar variables.

Reimplemented from GRINS::Physics.

Definition at line 216 of file scalar_ode.C.

References _epsilon, and _scalar_ode_var.

219  {
220  libMesh::DenseSubMatrix<libMesh::Number> &Kss =
221  context.get_elem_jacobian(_scalar_ode_var, _scalar_ode_var); // R_{s},{s}
222 
223  libMesh::DenseSubVector<libMesh::Number> &Fs =
224  context.get_elem_residual(_scalar_ode_var); // R_{s}
225 
226  const libMesh::Number constraint =
227  (*constraint_function)(context, libMesh::Point(0),
228  context.get_time());
229 
230  Fs(0) += constraint;
231 
232  if (compute_jacobian)
233  {
234  // FIXME: we should replace this hacky FDM with a hook to the
235  // AD fparser stuff
236  libMesh::DenseSubVector<libMesh::Number> &Us =
237  const_cast<libMesh::DenseSubVector<libMesh::Number>&>
238  (context.get_elem_solution(_scalar_ode_var)); // U_{s}
239 
240  const libMesh::Number s = Us(0);
241  Us(0) = s + this->_epsilon;
242  libMesh::Number constraint_jacobian =
243  (*constraint_function)(context, libMesh::Point(0),
244  context.get_time());
245 
246  Us(0) = s - this->_epsilon;
247  constraint_jacobian -=
248  (*constraint_function)(context, libMesh::Point(0),
249  context.get_time());
250 
251  Us(0) = s;
252  constraint_jacobian /= (2*this->_epsilon);
253 
254  Kss(0,0) += constraint_jacobian *
255  context.get_elem_solution_derivative();
256  }
257 
258  return;
259  }
libMesh::Number _epsilon
Definition: scalar_ode.h:112
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114
void GRINS::ScalarODE::nonlocal_mass_residual ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Mass matrix part(s) for scalar variables.

Reimplemented from GRINS::Physics.

Definition at line 170 of file scalar_ode.C.

References _epsilon, and _scalar_ode_var.

173  {
174  libMesh::DenseSubMatrix<libMesh::Number> &Kss =
175  context.get_elem_jacobian(_scalar_ode_var, _scalar_ode_var); // R_{s},{s}
176 
177  libMesh::DenseSubVector<libMesh::Number> &Fs =
178  context.get_elem_residual(_scalar_ode_var); // R_{s}
179 
180  const libMesh::Number mass_res =
181  (*mass_residual_function)(context, libMesh::Point(0),
182  context.get_time());
183 
184  Fs(0) -= mass_res;
185 
186  if (compute_jacobian)
187  {
188  // FIXME: we should replace this hacky FDM with a hook to the
189  // AD fparser stuff
190  libMesh::DenseSubVector<libMesh::Number> &Us =
191  const_cast<libMesh::DenseSubVector<libMesh::Number>&>
192  (context.get_elem_solution_rate(_scalar_ode_var)); // U_{s}
193 
194  const libMesh::Number s = Us(0);
195  Us(0) = s + this->_epsilon;
196  libMesh::Number mass_residual_jacobian =
197  (*mass_residual_function)(context, libMesh::Point(0),
198  context.get_time());
199 
200  Us(0) = s - this->_epsilon;
201  mass_residual_jacobian -=
202  (*mass_residual_function)(context, libMesh::Point(0),
203  context.get_time());
204 
205  Us(0) = s;
206  mass_residual_jacobian /= (2*this->_epsilon);
207 
208  Kss(0,0) -= mass_residual_jacobian *
209  context.get_elem_solution_rate_derivative();
210  }
211 
212  return;
213  }
libMesh::Number _epsilon
Definition: scalar_ode.h:112
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114
void GRINS::ScalarODE::nonlocal_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtual

Time dependent part(s) of physics for scalar variables.

Reimplemented from GRINS::Physics.

Definition at line 124 of file scalar_ode.C.

References _epsilon, and _scalar_ode_var.

127  {
128  libMesh::DenseSubMatrix<libMesh::Number> &Kss =
129  context.get_elem_jacobian(_scalar_ode_var, _scalar_ode_var); // R_{s},{s}
130 
131  libMesh::DenseSubVector<libMesh::Number> &Fs =
132  context.get_elem_residual(_scalar_ode_var); // R_{s}
133 
134  const libMesh::Number time_deriv =
135  (*time_deriv_function)(context, libMesh::Point(0),
136  context.get_time());
137 
138  Fs(0) += time_deriv;
139 
140  if (compute_jacobian)
141  {
142  // FIXME: we should replace this hacky FDM with a hook to the
143  // AD fparser stuff
144  libMesh::DenseSubVector<libMesh::Number> &Us =
145  const_cast<libMesh::DenseSubVector<libMesh::Number>&>
146  (context.get_elem_solution(_scalar_ode_var)); // U_{s}
147 
148  const libMesh::Number s = Us(0);
149  Us(0) = s + this->_epsilon;
150  libMesh::Number time_deriv_jacobian =
151  (*time_deriv_function)(context, libMesh::Point(0),
152  context.get_time());
153 
154  Us(0) = s - this->_epsilon;
155  time_deriv_jacobian -=
156  (*time_deriv_function)(context, libMesh::Point(0),
157  context.get_time());
158 
159  Us(0) = s;
160  time_deriv_jacobian /= (2*this->_epsilon);
161 
162  Kss(0,0) += time_deriv_jacobian *
163  context.get_elem_solution_derivative();
164  }
165 
166  return;
167  }
libMesh::Number _epsilon
Definition: scalar_ode.h:112
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114
void GRINS::ScalarODE::read_input_options ( const GetPot &  input)
virtual

Read options from GetPot input file.

Reimplemented from GRINS::Physics.

Definition at line 84 of file scalar_ode.C.

References _epsilon, _order, _scalar_ode_var_name, constraint_function_string, mass_residual_function_string, GRINS::scalar_ode, GRINS::scalar_ode_var_name_default, and time_deriv_function_string.

Referenced by ScalarODE().

85  {
87  input("Physics/"+scalar_ode+"/time_deriv",
88  std::string("0"));
89 
90  if (this->time_deriv_function_string == "0")
91  std::cout << "Warning! Zero time_deriv function specified!" << std::endl;
92 
94  input("Physics/"+scalar_ode+"/mass_residual",
95  std::string("0"));
96 
97  if (this->mass_residual_function_string == "0")
98  std::cout << "Warning! Zero mass_residual function specified!" << std::endl;
99 
101  input("Physics/"+scalar_ode+"/constraint",
102  std::string("0"));
103 
104  if (this->constraint_function_string == "0")
105  std::cout << "Warning! Zero constraint function specified!" << std::endl;
106 
107  this->_epsilon = input("Physics/"+scalar_ode+"/epsilon", 1e-6);
108 
109  this->_order = input("Physics/"+scalar_ode+"/order", 1);
110 
111  _scalar_ode_var_name = input("Physics/VariableNames/scalar_ode",
113  }
std::string _scalar_ode_var_name
Definition: scalar_ode.h:116
libMesh::Number _order
Definition: scalar_ode.h:109
const std::string scalar_ode_var_name_default
arbitrary scalar ODE variable name
std::string mass_residual_function_string
Definition: scalar_ode.h:96
std::string time_deriv_function_string
Definition: scalar_ode.h:96
std::string constraint_function_string
Definition: scalar_ode.h:96
libMesh::Number _epsilon
Definition: scalar_ode.h:112
const PhysicsName scalar_ode
void GRINS::ParameterUser::register_parameter ( const std::string &  param_name,
libMesh::ParameterMultiPointer< libMesh::Number > &  param_pointer 
) const
virtualinherited

Each subclass will register its copy of an independent.

Reimplemented in GRINS::AxisymmetricHeatTransfer< Conductivity >, GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::IncompressibleNavierStokesBase< Viscosity >, GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >, GRINS::HeatConduction< Conductivity >, GRINS::HeatTransferBase< Conductivity >, and GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >.

Definition at line 50 of file parameter_user.C.

Referenced by GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::register_parameter(), GRINS::HeatTransferBase< Conductivity >::register_parameter(), GRINS::HeatConduction< Conductivity >::register_parameter(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::register_parameter(), GRINS::IncompressibleNavierStokesBase< Viscosity >::register_parameter(), GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >::register_parameter(), and GRINS::AxisymmetricHeatTransfer< Conductivity >::register_parameter().

53  {
54  std::map<std::string, libMesh::Number*>::const_iterator it =
55  _my_parameters.find(param_name);
56 
57  if (it != _my_parameters.end())
58  {
59  std::cout << _my_name << " uses parameter " << param_name
60  << std::endl;
61  param_pointer.push_back(it->second);
62  }
63  }
std::map< std::string, libMesh::Number * > _my_parameters
void GRINS::Physics::register_postprocessing_vars ( const GetPot &  input,
PostProcessedQuantities< libMesh::Real > &  postprocessing 
)
virtualinherited

Register name of postprocessed quantity with PostProcessedQuantities.

Each Physics class will need to cache an unsigned int corresponding to each postprocessed quantity. This will be used in computing the values and putting them in the CachedVariables object.

Reimplemented in GRINS::ParsedVelocitySource< Viscosity >, GRINS::VelocityPenalty< Viscosity >, GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::HeatTransfer< Conductivity >, GRINS::ElasticCable< StressStrainLaw >, GRINS::ElasticMembrane< StressStrainLaw >, and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 161 of file physics.C.

163  {
164  return;
165  }
VariableIndex GRINS::ScalarODE::scalar_ode_var ( ) const
inline

Definition at line 90 of file scalar_ode.h.

References _scalar_ode_var.

Referenced by set_time_evolving_vars().

90 { return _scalar_ode_var; }
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114
void GRINS::Physics::set_is_steady ( bool  is_steady)
inherited

Sets whether this physics is to be solved with a steady solver or not.

Since the member variable is static, only needs to be called on a single physics.

Definition at line 97 of file physics.C.

References GRINS::Physics::_is_steady, and GRINS::Physics::is_steady().

98  {
100  return;
101  }
bool is_steady() const
Returns whether or not this physics is being solved with a steady solver.
Definition: physics.C:103
static bool _is_steady
Caches whether or not the solver that's being used is steady or not.
Definition: physics.h:266
void GRINS::ParameterUser::set_parameter ( libMesh::Number &  param_variable,
const GetPot &  input,
const std::string &  param_name,
libMesh::Number  param_default 
)
virtualinherited

Each subclass can simultaneously read a parameter value from.

Definition at line 35 of file parameter_user.C.

References GRINS::ParameterUser::_my_name, and GRINS::ParameterUser::_my_parameters.

Referenced by GRINS::AveragedFanAdjointStabilization< Viscosity >::AveragedFanAdjointStabilization(), GRINS::AveragedTurbineAdjointStabilization< Viscosity >::AveragedTurbineAdjointStabilization(), GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::BoussinesqBuoyancyAdjointStabilization(), GRINS::BoussinesqBuoyancyBase::BoussinesqBuoyancyBase(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::BoussinesqBuoyancySPGSMStabilization(), GRINS::ConstantConductivity::ConstantConductivity(), GRINS::ConstantPrandtlConductivity::ConstantPrandtlConductivity(), GRINS::ConstantSourceFunction::ConstantSourceFunction(), GRINS::ConstantSourceTerm::ConstantSourceTerm(), GRINS::ConstantSpecificHeat::ConstantSpecificHeat(), GRINS::ConstantViscosity::ConstantViscosity(), GRINS::ElasticCable< StressStrainLaw >::ElasticCable(), GRINS::ElasticCableConstantGravity::ElasticCableConstantGravity(), GRINS::ElasticMembrane< StressStrainLaw >::ElasticMembrane(), GRINS::ElasticMembraneConstantPressure::ElasticMembraneConstantPressure(), GRINS::HeatConduction< Conductivity >::HeatConduction(), GRINS::HeatTransferBase< Conductivity >::HeatTransferBase(), GRINS::IncompressibleNavierStokesBase< Viscosity >::IncompressibleNavierStokesBase(), GRINS::AverageNusseltNumber::init(), GRINS::MooneyRivlin::MooneyRivlin(), GRINS::ReactingLowMachNavierStokesBase< Mixture, Evaluator >::ReactingLowMachNavierStokesBase(), GRINS::HookesLaw1D::read_input_options(), GRINS::HookesLaw::read_input_options(), GRINS::AxisymmetricBoussinesqBuoyancy::read_input_options(), and GRINS::VelocityDragAdjointStabilization< Viscosity >::VelocityDragAdjointStabilization().

39  {
40  param_variable = input(param_name, param_default);
41 
42  libmesh_assert_msg(!_my_parameters.count(param_name),
43  "ERROR: " << _my_name << " double-registered parameter " <<
44  param_name);
45 
46  _my_parameters[param_name] = &param_variable;
47  }
std::map< std::string, libMesh::Number * > _my_parameters
void GRINS::ScalarODE::set_time_evolving_vars ( libMesh::FEMSystem *  system)
virtual

Sets scalar variable(s) to be time-evolving.

Reimplemented from GRINS::Physics.

Definition at line 62 of file scalar_ode.C.

References constraint_function, constraint_function_string, mass_residual_function, mass_residual_function_string, scalar_ode_var(), time_deriv_function, and time_deriv_function_string.

63  {
64  system->time_evolving(this->scalar_ode_var());
65 
66  // FIXME: this doesn't fit here at all, but it's the only time
67  // we've clearly got a System to grab hold of with all it's
68  // variables initialized.
69 
70  this->time_deriv_function.reset
71  (new libMesh::ParsedFEMFunction<libMesh::Number>
72  (*system, this->time_deriv_function_string));
73 
74  this->mass_residual_function.reset
75  (new libMesh::ParsedFEMFunction<libMesh::Number>
76  (*system, this->mass_residual_function_string));
77 
78  this->constraint_function.reset
79  (new libMesh::ParsedFEMFunction<libMesh::Number>
80  (*system, this->constraint_function_string));
81  }
std::string mass_residual_function_string
Definition: scalar_ode.h:96
std::string time_deriv_function_string
Definition: scalar_ode.h:96
std::string constraint_function_string
Definition: scalar_ode.h:96
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > mass_residual_function
Definition: scalar_ode.h:103
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > constraint_function
Definition: scalar_ode.h:103
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > time_deriv_function
Definition: scalar_ode.h:103
VariableIndex scalar_ode_var() const
Definition: scalar_ode.h:90
void GRINS::Physics::side_constraint ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Constraint part(s) of physics for boundaries of elements on the domain boundary.

Reimplemented in GRINS::IncompressibleNavierStokes< Viscosity >, GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >, and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >.

Definition at line 243 of file physics.C.

Referenced by GRINS::MultiphysicsSystem::side_constraint().

246  {
247  return;
248  }
void GRINS::Physics::side_time_derivative ( bool  compute_jacobian,
AssemblyContext context,
CachedValues cache 
)
virtualinherited

Member Data Documentation

GRINS::BCHandlingBase* GRINS::Physics::_bc_handler
protectedinherited
std::set<libMesh::subdomain_id_type> GRINS::Physics::_enabled_subdomains
protectedinherited

Subdomains on which the current Physics class is enabled.

Definition at line 261 of file physics.h.

Referenced by GRINS::Physics::enabled_on_elem(), and GRINS::Physics::read_input_options().

libMesh::Number GRINS::ScalarODE::_epsilon
private
GRINS::ICHandlingBase* GRINS::Physics::_ic_handler
protectedinherited
bool GRINS::Physics::_is_axisymmetric
protectedinherited
bool GRINS::Physics::_is_steady = false
staticprotectedinherited

Caches whether or not the solver that's being used is steady or not.

This is need, for example, in flow stabilization as the tau terms change depending on whether the solver is steady or unsteady.

Definition at line 266 of file physics.h.

Referenced by GRINS::Physics::is_steady(), and GRINS::Physics::set_is_steady().

libMesh::Number GRINS::ScalarODE::_order
private

Definition at line 109 of file scalar_ode.h.

Referenced by init_variables(), and read_input_options().

const PhysicsName GRINS::Physics::_physics_name
protectedinherited

Name of the physics object. Used for reading physics specific inputs.

We use a reference because the physics names are const global objects in GRINS namespace

No, we use a copy, because otherwise as soon as the memory in std::set<std::string> requested_physics gets overwritten we get in trouble.

Definition at line 254 of file physics.h.

Referenced by GRINS::SourceTermBase::parse_var_info(), and GRINS::Physics::read_input_options().

VariableIndex GRINS::ScalarODE::_scalar_ode_var
private
std::string GRINS::ScalarODE::_scalar_ode_var_name
private

Definition at line 116 of file scalar_ode.h.

Referenced by init_variables(), and read_input_options().

libMesh::AutoPtr<libMesh::FEMFunctionBase<libMesh::Number> > GRINS::ScalarODE::constraint_function
private

Definition at line 103 of file scalar_ode.h.

Referenced by init_context(), and set_time_evolving_vars().

std::string GRINS::ScalarODE::constraint_function_string
private

Definition at line 96 of file scalar_ode.h.

Referenced by read_input_options(), and set_time_evolving_vars().

libMesh::AutoPtr<libMesh::FEMFunctionBase<libMesh::Number> > GRINS::ScalarODE::mass_residual_function
private

Definition at line 103 of file scalar_ode.h.

Referenced by init_context(), and set_time_evolving_vars().

std::string GRINS::ScalarODE::mass_residual_function_string
private

Definition at line 96 of file scalar_ode.h.

Referenced by read_input_options(), and set_time_evolving_vars().

libMesh::AutoPtr<libMesh::FEMFunctionBase<libMesh::Number> > GRINS::ScalarODE::time_deriv_function
private

Definition at line 103 of file scalar_ode.h.

Referenced by init_context(), and set_time_evolving_vars().

std::string GRINS::ScalarODE::time_deriv_function_string
private

Definition at line 96 of file scalar_ode.h.

Referenced by read_input_options(), and set_time_evolving_vars().


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

Generated on Mon Jun 22 2015 21:32:24 for GRINS-0.6.0 by  doxygen 1.8.9.1