https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12registerMooseObject("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
28void
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}
registerMooseObject("ThermalHydraulicsApp", DirectionMaterial)
Computes the directional vector of 1D elements in 3D space.
static InputParameters validParams()
virtual void computeQpProperties()
DirectionMaterial(const InputParameters &parameters)
MaterialProperty< RealVectorValue > & _dir
The direction of the geometry (1D elements in 3D space)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
unsigned int _qp
MooseMesh & _mesh
static InputParameters validParams()
const Elem *const & _current_elem
virtual Elem * elemPtr(const dof_id_type i)