GRINS-0.6.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GRINS::HookesLaw1D Class Reference

Hooke's law specialized for one-dimensional problems. More...

#include <hookes_law_1d.h>

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

Public Member Functions

 HookesLaw1D (const GetPot &input)
 
virtual ~HookesLaw1D ()
 
void compute_stress (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
 
void compute_stress_and_elasticity (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
 
libMesh::Real compute_33_stress (const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)
 This is primarily a helper function for the plane stress cases. More...
 
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...
 

Private Member Functions

 HookesLaw1D ()
 
void read_input_options (const GetPot &input)
 Parse properties from input. More...
 
void compute_stress_imp (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
 
void compute_stress_and_elasticity_imp (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
 
libMesh::Real compute_33_stress_imp (const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)
 

Private Attributes

libMesh::Real _E
 Lam\'{e} constant. More...
 
libMesh::Real _nu
 Lam\'{e} constant. More...
 

Friends

class StressStrainLaw< HookesLaw1D >
 

Detailed Description

Hooke's law specialized for one-dimensional problems.

General form is not conducive to one-dimensional problems so this should be used in those cases.

Definition at line 43 of file hookes_law_1d.h.

Constructor & Destructor Documentation

GRINS::HookesLaw1D::HookesLaw1D ( const GetPot &  input)

Definition at line 37 of file hookes_law_1d.C.

References read_input_options().

39  ParameterUser("HookesLaw1D"),
40  _E(0.0),
41  _nu(0.0)
42  {
43  this->read_input_options(input);
44 
45  return;
46  }
libMesh::Real _E
Lam\'{e} constant.
Definition: hookes_law_1d.h:82
libMesh::Real _nu
Lam\'{e} constant.
Definition: hookes_law_1d.h:85
ParameterUser(const std::string &user_name)
friend class StressStrainLaw< HookesLaw1D >
Definition: hookes_law_1d.h:52
void read_input_options(const GetPot &input)
Parse properties from input.
Definition: hookes_law_1d.C:53
GRINS::HookesLaw1D::~HookesLaw1D ( )
virtual

Definition at line 48 of file hookes_law_1d.C.

49  {
50  return;
51  }
GRINS::HookesLaw1D::HookesLaw1D ( )
private

Member Function Documentation

libMesh::Real GRINS::StressStrainLaw< HookesLaw1D >::compute_33_stress ( const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov 
)
inherited

This is primarily a helper function for the plane stress cases.

libMesh::Real GRINS::HookesLaw1D::compute_33_stress_imp ( const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov 
)
private

Definition at line 119 of file hookes_law_1d.C.

123  {
124  libmesh_not_implemented();
125 
126  return 0.0;
127  }
void GRINS::StressStrainLaw< HookesLaw1D >::compute_stress ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress 
)
inherited
void GRINS::StressStrainLaw< HookesLaw1D >::compute_stress_and_elasticity ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress,
ElasticityTensor C 
)
inherited
void GRINS::HookesLaw1D::compute_stress_and_elasticity_imp ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress,
ElasticityTensor C 
)
private

Definition at line 104 of file hookes_law_1d.C.

References _E, and compute_stress_imp().

111  {
112  this->compute_stress_imp(dim,g_contra,g_cov,G_contra,G_cov,stress);
113 
114  C(0,0,0,0) = this->_E*g_contra(0,0)*g_contra(0,0);
115 
116  return;
117  }
libMesh::Real _E
Lam\'{e} constant.
Definition: hookes_law_1d.h:82
void compute_stress_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
Definition: hookes_law_1d.C:88
void GRINS::HookesLaw1D::compute_stress_imp ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress 
)
private

Definition at line 88 of file hookes_law_1d.C.

References _E.

Referenced by compute_stress_and_elasticity_imp().

94  {
95  stress.zero();
96 
97  libMesh::Real strain = 0.5*(G_cov(0,0) - g_cov(0,0));
98 
99  stress(0,0) = (this->_E)*g_contra(0,0)*g_contra(0,0)*strain;
100 
101  return;
102  }
libMesh::Real _E
Lam\'{e} constant.
Definition: hookes_law_1d.h:82
void GRINS::HookesLaw1D::read_input_options ( const GetPot &  input)
private

Parse properties from input.

Definition at line 53 of file hookes_law_1d.C.

References _E, _nu, and GRINS::ParameterUser::set_parameter().

Referenced by HookesLaw1D().

54  {
55  // We'd better have either Lam\'{e} constants or E and nu
56  if( ( !input.have_variable("Physics/HookesLaw/lambda") ||
57  !input.have_variable("Physics/HookesLaw/mu") ) &&
58  ( !input.have_variable("Physics/HookesLaw/E") ||
59  !input.have_variable("Physics/HookesLaw/nu") ) )
60  {
61  std::cerr << "Error: Must specify either Lame constants lambda and mu or" << std::endl
62  << " Young's modulus and Poisson's ratio." << std::endl;
63  libmesh_error();
64  }
65 
66  if( input.have_variable("Physics/HookesLaw/lambda") &&
67  input.have_variable("Physics/HookesLaw/mu") )
68  {
69  // FIXME - we'll need a special accessor to give parameter
70  // access to these
71  libMesh::Real lambda = input("Physics/HookesLaw/lambda", 0.0);
72  libMesh::Real mu = input("Physics/HookesLaw/mu", 0.0);
73  _E = mu*(3*lambda + 2*mu)/(lambda+mu);
74  _nu = lambda/(2*(lambda+mu));
75  }
76  else
77  {
78  if( input.have_variable("Physics/HookesLaw/E") )
79  this->set_parameter
80  (_E, input, "Physics/HookesLaw/E", 0.0);
81 
82  if( input.have_variable("Physics/HookesLaw/nu") )
83  this->set_parameter
84  (_nu, input, "Physics/HookesLaw/nu", 0.0);
85  }
86  }
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.
libMesh::Real _E
Lam\'{e} constant.
Definition: hookes_law_1d.h:82
libMesh::Real _nu
Lam\'{e} constant.
Definition: hookes_law_1d.h:85
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(), 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

Friends And Related Function Documentation

friend class StressStrainLaw< HookesLaw1D >
friend

Definition at line 52 of file hookes_law_1d.h.

Member Data Documentation

libMesh::Real GRINS::HookesLaw1D::_E
private

Lam\'{e} constant.

Definition at line 82 of file hookes_law_1d.h.

Referenced by compute_stress_and_elasticity_imp(), compute_stress_imp(), and read_input_options().

libMesh::Real GRINS::HookesLaw1D::_nu
private

Lam\'{e} constant.

Definition at line 85 of file hookes_law_1d.h.

Referenced by read_input_options().


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

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