https://mooseframework.inl.gov
DirectionMaterial.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "DirectionMaterial.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", DirectionMaterial);
13 
16 {
18  params.set<MooseEnum>("constant_on") = 1; // constant on element
19  params.addClassDescription("Computes the direction of 1D elements");
20  return params;
21 }
22 
24  : Material(parameters), _dir(declareProperty<RealVectorValue>("direction"))
25 {
26 }
27 
28 void
30 {
31  const Elem * el = _mesh.elemPtr(_current_elem->id());
32  RealVectorValue dir = el->node_ref(1) - el->node_ref(0);
33  _dir[_qp] = dir.unit();
34 }
DirectionMaterial(const InputParameters &parameters)
virtual Elem * elemPtr(const dof_id_type i)
virtual void computeQpProperties()
T & set(const std::string &name, bool quiet_mode=false)
registerMooseObject("ThermalHydraulicsApp", DirectionMaterial)
Computes the directional vector of 1D elements in 3D space.
unsigned int _qp
static InputParameters validParams()
TypeVector< Real > unit() const
MooseMesh & _mesh
static InputParameters validParams()
MaterialProperty< RealVectorValue > & _dir
The direction of the geometry (1D elements in 3D space)
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem