GRINS-0.6.0
Public Member Functions | List of all members
GRINS::StabilizationHelper Class Reference

#include <stab_helper.h>

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

Public Member Functions

 StabilizationHelper (const std::string &helper_name)
 
 ~StabilizationHelper ()
 
libMesh::RealGradient compute_g (libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
 
libMesh::RealTensor compute_G (libMesh::FEBase *fe, AssemblyContext &c, unsigned int qp) const
 
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...
 

Detailed Description

Definition at line 42 of file stab_helper.h.

Constructor & Destructor Documentation

GRINS::StabilizationHelper::StabilizationHelper ( const std::string &  helper_name)

Definition at line 36 of file stab_helper.C.

36  :
37  ParameterUser(helper_name)
38  {
39  return;
40  }
ParameterUser(const std::string &user_name)
GRINS::StabilizationHelper::~StabilizationHelper ( )

Definition at line 42 of file stab_helper.C.

43  {
44  return;
45  }

Member Function Documentation

libMesh::RealGradient GRINS::StabilizationHelper::compute_g ( libMesh::FEBase *  fe,
AssemblyContext c,
unsigned int  qp 
) const
Todo:
Should we inline this?

Definition at line 47 of file stab_helper.C.

50  {
51  libMesh::RealGradient g( fe->get_dxidx()[qp] + fe->get_detadx()[qp],
52  fe->get_dxidy()[qp] + fe->get_detady()[qp] );
53 
54  if( c.get_dim() == 3 )
55  {
56  g(0) += fe->get_dzetadx()[qp];
57  g(1) += fe->get_dzetady()[qp];
58  g(2) = fe->get_dxidz()[qp] + fe->get_detadz()[qp] + fe->get_dzetadz()[qp];
59  }
60 
61  return g;
62  }
libMesh::RealTensor GRINS::StabilizationHelper::compute_G ( libMesh::FEBase *  fe,
AssemblyContext c,
unsigned int  qp 
) const
Todo:
Should we inline this?

Definition at line 64 of file stab_helper.C.

67  {
68  libMesh::Real dxidx = fe->get_dxidx()[qp];
69  libMesh::Real dxidy = fe->get_dxidy()[qp];
70 
71  libMesh::Real detadx = fe->get_detadx()[qp];
72  libMesh::Real detady = fe->get_detady()[qp];
73 
74  libMesh::RealTensor G( dxidx*dxidx + detadx*detadx,
75  dxidx*dxidy + detadx*detady,
76  0.0,
77  dxidy*dxidx + detady*detadx,
78  dxidy*dxidy + detady*detady,
79  0.0 );
80 
81  if( c.get_dim() == 3 )
82  {
83  libMesh::Real dxidz = fe->get_dxidz()[qp];
84 
85  libMesh::Real detadz = fe->get_detadz()[qp];
86 
87  libMesh::Real dzetadx = fe->get_dzetadx()[qp];
88  libMesh::Real dzetady = fe->get_dzetady()[qp];
89  libMesh::Real dzetadz = fe->get_dzetadz()[qp];
90 
91  G(0,0) += dzetadx*dzetadx;
92  G(0,1) += dzetadx*dzetady;
93  G(0,2) = dxidx*dxidz + detadx*detadz + dzetadx*dzetadz;
94  G(1,0) += dzetady*dzetadx;
95  G(1,1) += dzetady*dzetady;
96  G(1,2) = dxidy*dxidz + detady*detadz + dzetady*dzetadz;
97  G(2,0) = dxidz*dxidx + detadz*detadx + dzetadz*dzetadx;
98  G(2,1) = dxidz*dxidy + detadz*detady + dzetadz*dzetady;
99  G(2,2) = dxidz*dxidz + detadz*detadz + dzetadz*dzetadz;
100  }
101 
102  return G;
103  }
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::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

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