Line data Source code
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 : 14 : InputParameters 15 18858 : DirectionMaterial::validParams() 16 : { 17 18858 : InputParameters params = Material::validParams(); 18 18858 : params.set<MooseEnum>("constant_on") = 1; // constant on element 19 18858 : params.addClassDescription("Computes the direction of 1D elements"); 20 18858 : return params; 21 0 : } 22 : 23 14760 : DirectionMaterial::DirectionMaterial(const InputParameters & parameters) 24 14760 : : Material(parameters), _dir(declareProperty<RealVectorValue>("direction")) 25 : { 26 14760 : } 27 : 28 : void 29 20845932 : DirectionMaterial::computeQpProperties() 30 : { 31 20845932 : const Elem * el = _mesh.elemPtr(_current_elem->id()); 32 : RealVectorValue dir = el->node_ref(1) - el->node_ref(0); 33 20845932 : _dir[_qp] = dir.unit(); 34 20845932 : }