www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TrussMaterial Class Referenceabstract

#include <TrussMaterial.h>

Inheritance diagram for TrussMaterial:
[legend]

Public Member Functions

 TrussMaterial (const InputParameters &parameters)
 

Protected Member Functions

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

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
 

Detailed Description

Definition at line 21 of file TrussMaterial.h.

Constructor & Destructor Documentation

◆ TrussMaterial()

TrussMaterial::TrussMaterial ( const InputParameters &  parameters)

Definition at line 36 of file TrussMaterial.C.

37  : Material(parameters),
38  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
39  _youngs_modulus(coupledValue("youngs_modulus")),
40  _total_stretch(declareProperty<Real>(_base_name + "total_stretch")),
41  _elastic_stretch(declareProperty<Real>(_base_name + "elastic_stretch")),
42  _axial_stress(declareProperty<Real>(_base_name + "axial_stress")),
43  _e_over_l(declareProperty<Real>(_base_name + "e_over_l"))
44 {
45  const std::vector<VariableName> & nl_vnames(getParam<std::vector<VariableName>>("displacements"));
46  _ndisp = nl_vnames.size();
47 
48  // fetch nonlinear variables
49  for (unsigned int i = 0; i < _ndisp; ++i)
50  _disp_var.push_back(&_fe_problem.getStandardVariable(_tid, nl_vnames[i]));
51 }
std::vector< MooseVariable * > _disp_var
Definition: TrussMaterial.h:33
MaterialProperty< Real > & _total_stretch
Definition: TrussMaterial.h:40
const VariableValue & _youngs_modulus
Definition: TrussMaterial.h:38
unsigned int _ndisp
Definition: TrussMaterial.h:37
MaterialProperty< Real > & _elastic_stretch
Definition: TrussMaterial.h:41
MaterialProperty< Real > & _e_over_l
Definition: TrussMaterial.h:43
const std::string _base_name
Definition: TrussMaterial.h:35
MaterialProperty< Real > & _axial_stress
Definition: TrussMaterial.h:42

Member Function Documentation

◆ computeProperties()

void TrussMaterial::computeProperties ( )
protectedvirtual

Definition at line 62 of file TrussMaterial.C.

63 {
64  // check for consistency of the number of element nodes
65  mooseAssert(_current_elem->n_nodes() == 2, "Truss element needs to have exactly two nodes.");
66 
67  // fetch the two end nodes for _current_elem
68  std::vector<const Node *> node;
69  for (unsigned int i = 0; i < 2; ++i)
70  node.push_back(_current_elem->node_ptr(i));
71 
72  // calculate original length of a truss element
73  RealGradient dxyz;
74  for (unsigned int i = 0; i < _ndisp; ++i)
75  dxyz(i) = (*node[1])(i) - (*node[0])(i);
76  _origin_length = dxyz.norm();
77 
78  // fetch the solution for the two end nodes
79  NonlinearSystemBase & nonlinear_sys = _fe_problem.getNonlinearSystemBase();
80  const NumericVector<Number> & sol = *nonlinear_sys.currentSolution();
81 
82  std::vector<Real> disp0, disp1;
83  for (unsigned int i = 0; i < _ndisp; ++i)
84  {
85  disp0.push_back(sol(node[0]->dof_number(nonlinear_sys.number(), _disp_var[i]->number(), 0)));
86  disp1.push_back(sol(node[1]->dof_number(nonlinear_sys.number(), _disp_var[i]->number(), 0)));
87  }
88 
89  // calculate current length of a truss element
90  for (unsigned int i = 0; i < _ndisp; ++i)
91  dxyz(i) += disp1[i] - disp0[i];
92  _current_length = dxyz.norm();
93 
94  for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
95  {
97 
100  }
101 }
VectorValue< Real > RealGradient
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()

virtual void TrussMaterial::computeQpStrain ( )
protectedpure virtual

Implemented in LinearElasticTruss.

Referenced by computeProperties().

◆ computeQpStress()

virtual void TrussMaterial::computeQpStress ( )
protectedpure virtual

Implemented in LinearElasticTruss.

Referenced by computeProperties().

◆ initQpStatefulProperties()

void TrussMaterial::initQpStatefulProperties ( )
protectedvirtual

Definition at line 54 of file TrussMaterial.C.

55 {
56  _axial_stress[_qp] = 0.0;
57  _total_stretch[_qp] = 0.0;
58  _elastic_stretch[_qp] = 0.0;
59 }
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
protected

◆ _base_name

const std::string TrussMaterial::_base_name
protected

Definition at line 35 of file TrussMaterial.h.

◆ _current_length

Real TrussMaterial::_current_length
protected

Definition at line 46 of file TrussMaterial.h.

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

◆ _disp_var

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

Definition at line 33 of file TrussMaterial.h.

Referenced by computeProperties(), and TrussMaterial().

◆ _e_over_l

MaterialProperty<Real>& TrussMaterial::_e_over_l
protected

Definition at line 43 of file TrussMaterial.h.

Referenced by computeProperties().

◆ _elastic_stretch

MaterialProperty<Real>& TrussMaterial::_elastic_stretch
protected

◆ _ndisp

unsigned int TrussMaterial::_ndisp
protected

Definition at line 37 of file TrussMaterial.h.

Referenced by computeProperties(), and TrussMaterial().

◆ _origin_length

Real TrussMaterial::_origin_length
protected

Definition at line 45 of file TrussMaterial.h.

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

◆ _total_stretch

MaterialProperty<Real>& TrussMaterial::_total_stretch
protected

◆ _youngs_modulus

const VariableValue& TrussMaterial::_youngs_modulus
protected

Definition at line 38 of file TrussMaterial.h.

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


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