www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
LinearElasticTruss Class Reference

#include <LinearElasticTruss.h>

Inheritance diagram for LinearElasticTruss:
[legend]

Public Member Functions

 LinearElasticTruss (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpStrain ()
 
virtual void computeQpStress ()
 
virtual void initQpStatefulProperties ()
 
virtual void computeProperties ()
 

Protected Attributes

std::vector< MooseVariable * > _disp_var
 
const std::string _base_name
 
unsigned int _ndisp
 
const VariableValue & _youngs_modulus
 
MaterialProperty< Real > & _total_stretch
 
MaterialProperty< Real > & _elastic_stretch
 
MaterialProperty< Real > & _axial_stress
 
MaterialProperty< Real > & _e_over_l
 
Real _origin_length
 
Real _current_length
 

Private Attributes

const VariableValue & _T
 
Real _T0
 
Real _thermal_expansion_coeff
 

Detailed Description

Definition at line 20 of file LinearElasticTruss.h.

Constructor & Destructor Documentation

◆ LinearElasticTruss()

LinearElasticTruss::LinearElasticTruss ( const InputParameters &  parameters)

Definition at line 25 of file LinearElasticTruss.C.

26  : TrussMaterial(parameters),
27  _T(coupledValue("temperature")),
28  _T0(getParam<Real>("temperature_ref")),
29  _thermal_expansion_coeff(getParam<Real>("thermal_expansion_coeff"))
30 {
31 }
TrussMaterial(const InputParameters &parameters)
Definition: TrussMaterial.C:36
const VariableValue & _T

Member Function Documentation

◆ computeProperties()

void TrussMaterial::computeProperties ( )
protectedvirtualinherited

Definition at line 63 of file TrussMaterial.C.

64 {
65  // check for consistency of the number of element nodes
66  mooseAssert(_current_elem->n_nodes() == 2, "Truss element needs to have exactly two nodes.");
67 
68  // fetch the two end nodes for _current_elem
69  std::vector<Node *> node;
70  for (unsigned int i = 0; i < 2; ++i)
71  node.push_back(_current_elem->get_node(i));
72 
73  // calculate original length of a truss element
74  RealGradient dxyz;
75  for (unsigned int i = 0; i < _ndisp; ++i)
76  dxyz(i) = (*node[1])(i) - (*node[0])(i);
77  _origin_length = dxyz.norm();
78 
79  // fetch the solution for the two end nodes
80  NonlinearSystemBase & nonlinear_sys = _fe_problem.getNonlinearSystemBase();
81  const NumericVector<Number> & sol = *nonlinear_sys.currentSolution();
82 
83  std::vector<Real> disp0, disp1;
84  for (unsigned int i = 0; i < _ndisp; ++i)
85  {
86  disp0.push_back(sol(node[0]->dof_number(nonlinear_sys.number(), _disp_var[i]->number(), 0)));
87  disp1.push_back(sol(node[1]->dof_number(nonlinear_sys.number(), _disp_var[i]->number(), 0)));
88  }
89 
90  // calculate current length of a truss element
91  for (unsigned int i = 0; i < _ndisp; ++i)
92  dxyz(i) += disp1[i] - disp0[i];
93  _current_length = dxyz.norm();
94 
95  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
96  {
98 
100  computeQpStress();
101  }
102 }
Real _current_length
Definition: TrussMaterial.h:46
std::vector< MooseVariable * > _disp_var
Definition: TrussMaterial.h:33
const VariableValue & _youngs_modulus
Definition: TrussMaterial.h:38
unsigned int _ndisp
Definition: TrussMaterial.h:37
virtual void computeQpStrain()=0
MaterialProperty< Real > & _e_over_l
Definition: TrussMaterial.h:43
virtual void computeQpStress()=0

◆ computeQpStrain()

void LinearElasticTruss::computeQpStrain ( )
protectedvirtual

Implements TrussMaterial.

Definition at line 34 of file LinearElasticTruss.C.

35 {
38 }
Real _current_length
Definition: TrussMaterial.h:46
MaterialProperty< Real > & _total_stretch
Definition: TrussMaterial.h:40
MaterialProperty< Real > & _elastic_stretch
Definition: TrussMaterial.h:41
const VariableValue & _T

◆ computeQpStress()

void LinearElasticTruss::computeQpStress ( )
protectedvirtual

Implements TrussMaterial.

Definition at line 41 of file LinearElasticTruss.C.

42 {
44 }
const VariableValue & _youngs_modulus
Definition: TrussMaterial.h:38
MaterialProperty< Real > & _elastic_stretch
Definition: TrussMaterial.h:41
MaterialProperty< Real > & _axial_stress
Definition: TrussMaterial.h:42

◆ initQpStatefulProperties()

void TrussMaterial::initQpStatefulProperties ( )
protectedvirtualinherited

Definition at line 55 of file TrussMaterial.C.

56 {
57  _axial_stress[_qp] = 0.0;
58  _total_stretch[_qp] = 0.0;
59  _elastic_stretch[_qp] = 0.0;
60 }
MaterialProperty< Real > & _total_stretch
Definition: TrussMaterial.h:40
MaterialProperty< Real > & _elastic_stretch
Definition: TrussMaterial.h:41
MaterialProperty< Real > & _axial_stress
Definition: TrussMaterial.h:42

Member Data Documentation

◆ _axial_stress

MaterialProperty<Real>& TrussMaterial::_axial_stress
protectedinherited

Definition at line 42 of file TrussMaterial.h.

Referenced by computeQpStress(), and TrussMaterial::initQpStatefulProperties().

◆ _base_name

const std::string TrussMaterial::_base_name
protectedinherited

Definition at line 35 of file TrussMaterial.h.

◆ _current_length

Real TrussMaterial::_current_length
protectedinherited

Definition at line 46 of file TrussMaterial.h.

Referenced by TrussMaterial::computeProperties(), and computeQpStrain().

◆ _disp_var

std::vector<MooseVariable *> TrussMaterial::_disp_var
protectedinherited

◆ _e_over_l

MaterialProperty<Real>& TrussMaterial::_e_over_l
protectedinherited

Definition at line 43 of file TrussMaterial.h.

Referenced by TrussMaterial::computeProperties().

◆ _elastic_stretch

MaterialProperty<Real>& TrussMaterial::_elastic_stretch
protectedinherited

◆ _ndisp

unsigned int TrussMaterial::_ndisp
protectedinherited

◆ _origin_length

Real TrussMaterial::_origin_length
protectedinherited

Definition at line 45 of file TrussMaterial.h.

Referenced by TrussMaterial::computeProperties(), and computeQpStrain().

◆ _T

const VariableValue& LinearElasticTruss::_T
private

Definition at line 30 of file LinearElasticTruss.h.

Referenced by computeQpStrain().

◆ _T0

Real LinearElasticTruss::_T0
private

Definition at line 32 of file LinearElasticTruss.h.

Referenced by computeQpStrain().

◆ _thermal_expansion_coeff

Real LinearElasticTruss::_thermal_expansion_coeff
private

Definition at line 33 of file LinearElasticTruss.h.

Referenced by computeQpStrain().

◆ _total_stretch

MaterialProperty<Real>& TrussMaterial::_total_stretch
protectedinherited

Definition at line 40 of file TrussMaterial.h.

Referenced by computeQpStrain(), and TrussMaterial::initQpStatefulProperties().

◆ _youngs_modulus

const VariableValue& TrussMaterial::_youngs_modulus
protectedinherited

Definition at line 38 of file TrussMaterial.h.

Referenced by TrussMaterial::computeProperties(), and computeQpStress().


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