https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Private Member Functions | List of all members
DiscreteLineSegmentInterface Class Reference

Defines a discretized line segment in 3D space. More...

#include <DiscreteLineSegmentInterface.h>

Inheritance diagram for DiscreteLineSegmentInterface:
[legend]

Public Member Functions

 DiscreteLineSegmentInterface (const MooseObject *moose_object)
 
virtual Point getPosition () const
 
Point getStartPoint () const
 
Point getEndPoint () const
 
virtual RealVectorValue getDirection () const
 
virtual Real getRotation () const
 
virtual Real getNumElems () const
 
virtual Real getLength () const
 
Real getMinimumElemSize () const
 Gets the minimum element size. More...
 
Real computeAxialCoordinate (const Point &p) const
 
Real computeRadialCoordinate (const Point &p) const
 
unsigned int getAxialSectionIndex (const Point &p) const
 
unsigned int getAxialElementIndex (const Point &p_center) const
 
Point computeRealPointFromReferencePoint (const Point &p) const
 Computes point in 3-D space from a point in reference space. More...
 
Point computeReferencePointFromRealPoint (const Point &p) const
 Computes point in reference space from a point in 3-D space. More...
 
MooseEnum getAlignmentAxis () const
 Gets an axis MooseEnum for the axis the component is aligned with. More...
 
std::vector< RealgetElementBoundaryCoordinates () const
 Gets the element boundary coordinates for the aligned axis. More...
 

Static Public Member Functions

static InputParameters validParams ()
 
static RealTensorValue computeDirectionTransformationTensor (const RealVectorValue &dir)
 Computes the direction transformation tensor. More...
 
static RealTensorValue computeXRotationTransformationTensor (const Real &rotation)
 Computes the rotation transformation tensor. More...
 
static Point computeRealPointFromReferencePoint (const Point &p, const RealVectorValue &position, const RealTensorValue &R, const RealTensorValue &Rx)
 Computes point in 3-D space from a point in reference space. More...
 
static Point computeReferencePointFromRealPoint (const Point &p, const RealVectorValue &position, const RealTensorValue &R_inv, const RealTensorValue &Rx_inv)
 Computes point in reference space from a point in 3-D space. More...
 
static MooseEnum getAlignmentAxis (const RealVectorValue &dir)
 Gets an axis MooseEnum for the axis the component is aligned with. More...
 
static std::vector< RealgetElementBoundaryCoordinates (const RealVectorValue &position, const RealVectorValue &orientation, const Real &rotation, const std::vector< Real > &lengths, const std::vector< unsigned int > &n_elems)
 Gets the element boundary coordinates for the aligned axis. More...
 

Public Attributes

Real _dx_min
 Minimum element size. More...
 

Protected Attributes

const Point & _position
 Start position of axis in 3-D space. More...
 
const RealVectorValue_dir_unnormalized
 Unnormalized direction of axis from start position to end position. More...
 
const RealVectorValue _dir
 Normalized direction of axis from start position to end position. More...
 
const Real_rotation
 Angle of rotation about the x-axis. More...
 
std::vector< Real_lengths
 Length of each axial section. More...
 
Real _length
 Total axial length. More...
 
const Point _end_point
 End point of line segment. More...
 
std::vector< unsigned int_n_elems
 Number of elements in each axial section. More...
 
unsigned int _n_elem
 Total number of axial elements. More...
 
const unsigned int _n_sections
 Number of axial sections. More...
 
std::vector< Real_section_end
 Axial coordinate of the end of each axial section using the line 'position' as the origin. More...
 
std::vector< Real_x_centers
 Center axial coordinate of each axial element. More...
 
const RealTensorValue _R
 Direction transformation tensor. More...
 
const RealTensorValue _Rx
 Rotational transformation tensor about x-axis. More...
 
const RealTensorValue _R_inv
 Inverse direction transformation tensor. More...
 
const RealTensorValue _Rx_inv
 Inverse rotational transformation tensor about x-axis. More...
 
const std::string _moose_object_name_dlsi
 Name of the MOOSE object. More...
 

Static Private Member Functions

static RealVectorValue initializeDirectionVector (const RealVectorValue &dir_unnormalized)
 Computes a normalized direction vector or reports an error if the zero vector is provided. More...
 

Detailed Description

Defines a discretized line segment in 3D space.

Definition at line 22 of file DiscreteLineSegmentInterface.h.

Constructor & Destructor Documentation

◆ DiscreteLineSegmentInterface()

DiscreteLineSegmentInterface::DiscreteLineSegmentInterface ( const MooseObject moose_object)

Definition at line 33 of file DiscreteLineSegmentInterface.C.

34  : _position(moose_object->parameters().get<Point>("position")),
35  _dir_unnormalized(moose_object->parameters().get<RealVectorValue>("orientation")),
37  _rotation(moose_object->parameters().get<Real>("rotation")),
38  _lengths(moose_object->parameters().get<std::vector<Real>>("length")),
39  _length(std::accumulate(_lengths.begin(), _lengths.end(), 0.0)),
41  _n_elems(moose_object->parameters().get<std::vector<unsigned int>>("n_elems")),
42  _n_elem(std::accumulate(_n_elems.begin(), _n_elems.end(), 0)),
43  _n_sections(_lengths.size()),
48  _R_inv(_R.inverse()),
49  _Rx_inv(_Rx.inverse()),
50  _moose_object_name_dlsi(moose_object->name())
51 {
52  std::partial_sum(_lengths.begin(), _lengths.end(), _section_end.begin());
53 
54  if (_lengths.size() != _n_elems.size())
55  mooseError("The parameters 'length' and 'n_elems' must have the same number of entries.");
56 
57  // Compute the axial coordinates of the centers of each element
58  unsigned int k_section_begin = 0;
59  Real x_begin = 0.0;
60  _dx_min = std::numeric_limits<Real>::max();
61  for (unsigned int j = 0; j < _n_sections; j++)
62  {
63  const Real dx = _lengths[j] / _n_elems[j];
64  _dx_min = std::min(dx, _dx_min);
65  for (unsigned int i = 0; i < _n_elems[j]; i++)
66  {
67  const unsigned int k = k_section_begin + i;
68  _x_centers[k] = x_begin + 0.5 * dx;
69  x_begin += dx;
70  }
71  k_section_begin += _n_elems[j];
72  }
73 }
void mooseError(Args &&... args)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
const InputParameters & parameters() const
static RealTensorValue computeXRotationTransformationTensor(const Real &rotation)
Computes the rotation transformation tensor.
const RealTensorValue _Rx_inv
Inverse rotational transformation tensor about x-axis.
std::vector< Real > _lengths
Length of each axial section.
static RealTensorValue computeDirectionTransformationTensor(const RealVectorValue &dir)
Computes the direction transformation tensor.
const Point _end_point
End point of line segment.
const Real & _rotation
Angle of rotation about the x-axis.
const RealVectorValue & _dir_unnormalized
Unnormalized direction of axis from start position to end position.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
std::vector< Real > _section_end
Axial coordinate of the end of each axial section using the line &#39;position&#39; as the origin...
const std::string & name() const
unsigned int _n_elem
Total number of axial elements.
const unsigned int _n_sections
Number of axial sections.
const Point & _position
Start position of axis in 3-D space.
const RealTensorValue _R_inv
Inverse direction transformation tensor.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const RealTensorValue _Rx
Rotational transformation tensor about x-axis.
const RealTensorValue _R
Direction transformation tensor.
std::vector< unsigned int > _n_elems
Number of elements in each axial section.
const std::string _moose_object_name_dlsi
Name of the MOOSE object.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static RealVectorValue initializeDirectionVector(const RealVectorValue &dir_unnormalized)
Computes a normalized direction vector or reports an error if the zero vector is provided.
static const std::string k
Definition: NS.h:134
std::vector< Real > _x_centers
Center axial coordinate of each axial element.

Member Function Documentation

◆ computeAxialCoordinate()

Real DiscreteLineSegmentInterface::computeAxialCoordinate ( const Point &  p) const

Definition at line 110 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue(), getAxialElementIndex(), and getAxialSectionIndex().

111 {
112  const Real ax_coord = _dir * (p - _position);
113  if (MooseUtils::absoluteFuzzyLessThan(ax_coord, 0.0) ||
114  MooseUtils::absoluteFuzzyGreaterThan(ax_coord, _length))
116  ": The point ",
117  p,
118  " has an invalid axial coordinate (",
119  ax_coord,
120  "). Valid axial coordinates are in the range (0,",
121  _length,
122  ").");
123  else
124  return ax_coord;
125 }
void mooseError(Args &&... args)
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point & _position
Start position of axis in 3-D space.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p
const std::string _moose_object_name_dlsi
Name of the MOOSE object.

◆ computeDirectionTransformationTensor()

RealTensorValue DiscreteLineSegmentInterface::computeDirectionTransformationTensor ( const RealVectorValue dir)
static

Computes the direction transformation tensor.

Parameters
[in]dirDirection vector

Definition at line 85 of file DiscreteLineSegmentInterface.C.

Referenced by getElementBoundaryCoordinates().

86 {
87  if (MooseUtils::absoluteFuzzyEqual(dir.norm(), 0.0))
88  mooseError("The direction vector must not be the zero vector.");
89 
90  const auto dir_normalized = dir / dir.norm();
91  const Real theta = acos(dir_normalized(2));
92  const Real aphi = atan2(dir_normalized(1), dir_normalized(0));
93  return RealTensorValue(
94  RealVectorValue(cos(aphi) * sin(theta), -sin(aphi), -cos(aphi) * cos(theta)),
95  RealVectorValue(sin(aphi) * sin(theta), cos(aphi), -sin(aphi) * cos(theta)),
96  RealVectorValue(cos(theta), 0.0, sin(theta)));
97 }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
auto norm() const
void mooseError(Args &&... args)
TensorValue< Real > RealTensorValue
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeRadialCoordinate()

Real DiscreteLineSegmentInterface::computeRadialCoordinate ( const Point &  p) const

Definition at line 128 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

129 {
130  const RealVectorValue v = (p - _position);
131  return v.cross(_dir).norm();
132 }
const double v
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point & _position
Start position of axis in 3-D space.
const Real p

◆ computeRealPointFromReferencePoint() [1/2]

Point DiscreteLineSegmentInterface::computeRealPointFromReferencePoint ( const Point &  p) const

Computes point in 3-D space from a point in reference space.

Parameters
[in]pPoint in reference space

Definition at line 166 of file DiscreteLineSegmentInterface.C.

Referenced by getElementBoundaryCoordinates(), and GeneratedMeshComponent::setupMesh().

167 {
169 }
const Point & _position
Start position of axis in 3-D space.
const RealTensorValue _Rx
Rotational transformation tensor about x-axis.
const RealTensorValue _R
Direction transformation tensor.
const Real p
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.

◆ computeRealPointFromReferencePoint() [2/2]

Point DiscreteLineSegmentInterface::computeRealPointFromReferencePoint ( const Point &  p,
const RealVectorValue position,
const RealTensorValue R,
const RealTensorValue Rx 
)
static

Computes point in 3-D space from a point in reference space.

Parameters
[in]pPoint in reference space

Definition at line 157 of file DiscreteLineSegmentInterface.C.

161 {
162  return R * (Rx * p) + position;
163 }
const double R
const Real p

◆ computeReferencePointFromRealPoint() [1/2]

Point DiscreteLineSegmentInterface::computeReferencePointFromRealPoint ( const Point &  p) const

Computes point in reference space from a point in 3-D space.

Parameters
[in]pPoint in 3-D space

Definition at line 181 of file DiscreteLineSegmentInterface.C.

182 {
184 }
const RealTensorValue _Rx_inv
Inverse rotational transformation tensor about x-axis.
const Point & _position
Start position of axis in 3-D space.
Point computeReferencePointFromRealPoint(const Point &p) const
Computes point in reference space from a point in 3-D space.
const RealTensorValue _R_inv
Inverse direction transformation tensor.
const Real p

◆ computeReferencePointFromRealPoint() [2/2]

Point DiscreteLineSegmentInterface::computeReferencePointFromRealPoint ( const Point &  p,
const RealVectorValue position,
const RealTensorValue R_inv,
const RealTensorValue Rx_inv 
)
static

Computes point in reference space from a point in 3-D space.

Parameters
[in]pPoint in 3-D space

Definition at line 172 of file DiscreteLineSegmentInterface.C.

176 {
177  return Rx_inv * R_inv * (p - position);
178 }
const Real p

◆ computeXRotationTransformationTensor()

RealTensorValue DiscreteLineSegmentInterface::computeXRotationTransformationTensor ( const Real rotation)
static

Computes the rotation transformation tensor.

Parameters
[in]rotationRotation about the x-axis, in degrees

Definition at line 100 of file DiscreteLineSegmentInterface.C.

Referenced by getElementBoundaryCoordinates().

101 {
102  const Real rotation_rad = M_PI * rotation / 180.;
103  const RealVectorValue Rx_x(1., 0., 0.);
104  const RealVectorValue Rx_y(0., cos(rotation_rad), -sin(rotation_rad));
105  const RealVectorValue Rx_z(0., sin(rotation_rad), cos(rotation_rad));
106  return RealTensorValue(Rx_x, Rx_y, Rx_z);
107 }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
TensorValue< Real > RealTensorValue
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ getAlignmentAxis() [1/2]

MooseEnum DiscreteLineSegmentInterface::getAlignmentAxis ( ) const

Gets an axis MooseEnum for the axis the component is aligned with.

If the axis does not align with the x, y, or z axis, then an invalid MooseEnum is returned.

Definition at line 201 of file DiscreteLineSegmentInterface.C.

Referenced by CoupledHeatTransferAction::addUserObjects(), CoupledHeatTransferAction::CoupledHeatTransferAction(), and getElementBoundaryCoordinates().

202 {
203  return getAlignmentAxis(_dir);
204 }
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.

◆ getAlignmentAxis() [2/2]

MooseEnum DiscreteLineSegmentInterface::getAlignmentAxis ( const RealVectorValue dir)
static

Gets an axis MooseEnum for the axis the component is aligned with.

If the axis does not align with the x, y, or z axis, then an invalid MooseEnum is returned.

Definition at line 187 of file DiscreteLineSegmentInterface.C.

188 {
189  MooseEnum axis("x y z");
190  if (THM::areParallelVectors(dir, RealVectorValue(1, 0, 0)))
191  axis = "x";
192  else if (THM::areParallelVectors(dir, RealVectorValue(0, 1, 0)))
193  axis = "y";
194  else if (THM::areParallelVectors(dir, RealVectorValue(0, 0, 1)))
195  axis = "z";
196 
197  return axis;
198 }
static const std::string axis
Definition: NS.h:28
bool areParallelVectors(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are parallel within some absolute tolerance.
Definition: Numerics.C:26

◆ getAxialElementIndex()

unsigned int DiscreteLineSegmentInterface::getAxialElementIndex ( const Point &  p_center) const

Definition at line 146 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

147 {
148  const Real axial_coordinate = computeAxialCoordinate(p_center);
149  for (unsigned int i = 0; i < _n_elem; ++i)
150  if (MooseUtils::absoluteFuzzyEqual(axial_coordinate, _x_centers[i]))
151  return i;
152 
153  mooseError("No axial element index was found.");
154 }
void mooseError(Args &&... args)
Real computeAxialCoordinate(const Point &p) const
unsigned int _n_elem
Total number of axial elements.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _x_centers
Center axial coordinate of each axial element.

◆ getAxialSectionIndex()

unsigned int DiscreteLineSegmentInterface::getAxialSectionIndex ( const Point &  p) const

Definition at line 135 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

136 {
137  const Real axial_coordinate = computeAxialCoordinate(p);
138  for (unsigned int i = 0; i < _n_sections; ++i)
139  if (MooseUtils::absoluteFuzzyLessEqual(axial_coordinate, _section_end[i]))
140  return i;
141 
142  mooseError("No axial section index was found.");
143 }
void mooseError(Args &&... args)
Real computeAxialCoordinate(const Point &p) const
std::vector< Real > _section_end
Axial coordinate of the end of each axial section using the line &#39;position&#39; as the origin...
const unsigned int _n_sections
Number of axial sections.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real p

◆ getDirection()

virtual RealVectorValue DiscreteLineSegmentInterface::getDirection ( ) const
inlinevirtual

◆ getElementBoundaryCoordinates() [1/2]

std::vector< Real > DiscreteLineSegmentInterface::getElementBoundaryCoordinates ( ) const

Gets the element boundary coordinates for the aligned axis.

Definition at line 257 of file DiscreteLineSegmentInterface.C.

Referenced by CoupledHeatTransferAction::addUserObjects().

258 {
260 }
std::vector< Real > _lengths
Length of each axial section.
const Real & _rotation
Angle of rotation about the x-axis.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point & _position
Start position of axis in 3-D space.
std::vector< unsigned int > _n_elems
Number of elements in each axial section.
std::vector< Real > getElementBoundaryCoordinates() const
Gets the element boundary coordinates for the aligned axis.

◆ getElementBoundaryCoordinates() [2/2]

std::vector< Real > DiscreteLineSegmentInterface::getElementBoundaryCoordinates ( const RealVectorValue position,
const RealVectorValue orientation,
const Real rotation,
const std::vector< Real > &  lengths,
const std::vector< unsigned int > &  n_elems 
)
static

Gets the element boundary coordinates for the aligned axis.

Parameters
[in]positionStart position of axis in 3-D space
[in]orientationDirection of axis from start position to end position
[in]rotationAngle of rotation about the x-axis, in degrees
[in]lengthsLength of each axial section
[in]n_elemsNumber of elements in each axial section

Definition at line 207 of file DiscreteLineSegmentInterface.C.

213 {
214  const auto axis = getAlignmentAxis(orientation);
215 
216  unsigned int d;
217  if (axis == "x")
218  d = 0;
219  else if (axis == "y")
220  d = 1;
221  else if (axis == "z")
222  d = 2;
223  else
224  mooseError("Invalid axis.");
225 
226  const auto R = computeDirectionTransformationTensor(orientation);
227  const auto Rx = computeXRotationTransformationTensor(rotation);
228 
229  const unsigned int n_elems_total = std::accumulate(n_elems.begin(), n_elems.end(), 0);
230  const unsigned int n_sections = lengths.size();
231 
232  unsigned int i_section_start = 0;
233  Real section_start_ref_position = 0.0;
234  std::vector<Real> element_boundary_coordinates(n_elems_total + 1);
235  element_boundary_coordinates[0] =
236  computeRealPointFromReferencePoint(Point(0, 0, 0), position, R, Rx)(d);
237  for (unsigned int j = 0; j < n_sections; ++j)
238  {
239  const Real section_dx = lengths[j] / n_elems[j];
240  for (unsigned int k = 0; k < n_elems[j]; ++k)
241  {
242  const unsigned int i = i_section_start + k + 1;
243  const Real ref_position = section_start_ref_position + section_dx * k;
244  const Point ref_point = Point(ref_position, 0, 0);
245  element_boundary_coordinates[i] =
246  computeRealPointFromReferencePoint(ref_point, position, R, Rx)(d);
247  }
248 
249  section_start_ref_position += lengths[j];
250  i_section_start += n_elems[j];
251  }
252 
253  return element_boundary_coordinates;
254 }
void mooseError(Args &&... args)
static RealTensorValue computeXRotationTransformationTensor(const Real &rotation)
Computes the rotation transformation tensor.
static RealTensorValue computeDirectionTransformationTensor(const RealVectorValue &dir)
Computes the direction transformation tensor.
static const std::string axis
Definition: NS.h:28
const double R
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.
static const std::string k
Definition: NS.h:134

◆ getEndPoint()

Point DiscreteLineSegmentInterface::getEndPoint ( ) const
inline

Definition at line 29 of file DiscreteLineSegmentInterface.h.

Referenced by FlowChannel1Phase::addNormalized1PhaseResidualNorm().

29 { return _end_point; }
const Point _end_point
End point of line segment.

◆ getLength()

virtual Real DiscreteLineSegmentInterface::getLength ( ) const
inlinevirtual

Definition at line 34 of file DiscreteLineSegmentInterface.h.

Referenced by HeatTransferFromHeatStructure3D1Phase::init().

34 { return _length; }

◆ getMinimumElemSize()

Real DiscreteLineSegmentInterface::getMinimumElemSize ( ) const
inline

Gets the minimum element size.

Definition at line 37 of file DiscreteLineSegmentInterface.h.

Referenced by FlowChannel1Phase::addNormalized1PhaseResidualNorm().

37 { return _dx_min; }

◆ getNumElems()

virtual Real DiscreteLineSegmentInterface::getNumElems ( ) const
inlinevirtual

Definition at line 33 of file DiscreteLineSegmentInterface.h.

Referenced by HeatTransferFromHeatStructure3D1Phase::init().

33 { return _n_elem; }
unsigned int _n_elem
Total number of axial elements.

◆ getPosition()

virtual Point DiscreteLineSegmentInterface::getPosition ( ) const
inlinevirtual

◆ getRotation()

virtual Real DiscreteLineSegmentInterface::getRotation ( ) const
inlinevirtual

Definition at line 31 of file DiscreteLineSegmentInterface.h.

31 { return _rotation; }
const Real & _rotation
Angle of rotation about the x-axis.

◆ getStartPoint()

Point DiscreteLineSegmentInterface::getStartPoint ( ) const
inline

Definition at line 28 of file DiscreteLineSegmentInterface.h.

Referenced by FlowChannel1Phase::addNormalized1PhaseResidualNorm(), and getPosition().

28 { return _position; }
const Point & _position
Start position of axis in 3-D space.

◆ initializeDirectionVector()

RealVectorValue DiscreteLineSegmentInterface::initializeDirectionVector ( const RealVectorValue dir_unnormalized)
staticprivate

Computes a normalized direction vector or reports an error if the zero vector is provided.

Parameters
[in]dir_unnormalizedUnnormalized direction vector

Definition at line 76 of file DiscreteLineSegmentInterface.C.

77 {
78  if (!MooseUtils::absoluteFuzzyEqual(dir_unnormalized.norm(), 0.0))
79  return dir_unnormalized / dir_unnormalized.norm();
80  else
81  mooseError("The parameter 'orientation' must not be the zero vector.");
82 }
auto norm() const
void mooseError(Args &&... args)

◆ validParams()

InputParameters DiscreteLineSegmentInterface::validParams ( )
static

Definition at line 17 of file DiscreteLineSegmentInterface.C.

Referenced by GeneratedMeshComponent::validParams(), and DiscreteLineSegmentInterfaceTestAux::validParams().

18 {
20 
21  params.addRequiredParam<Point>("position", "Start position of axis in 3-D space [m]");
23  "orientation",
24  "Direction of axis from start position to end position (no need to normalize)");
25  params.addParam<Real>("rotation", 0.0, "Angle of rotation about the x-axis [degrees]");
26  params.addRequiredParam<std::vector<Real>>("length", "Length of each axial section [m]");
27  params.addRequiredParam<std::vector<unsigned int>>("n_elems",
28  "Number of elements in each axial section");
29 
30  return params;
31 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters emptyInputParameters()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _dir

const RealVectorValue DiscreteLineSegmentInterface::_dir
protected

Normalized direction of axis from start position to end position.

Definition at line 100 of file DiscreteLineSegmentInterface.h.

Referenced by Component1D::buildMesh(), computeAxialCoordinate(), computeRadialCoordinate(), getAlignmentAxis(), getDirection(), getElementBoundaryCoordinates(), and Component1D::sortBy().

◆ _dir_unnormalized

const RealVectorValue& DiscreteLineSegmentInterface::_dir_unnormalized
protected

Unnormalized direction of axis from start position to end position.

Definition at line 98 of file DiscreteLineSegmentInterface.h.

◆ _dx_min

Real DiscreteLineSegmentInterface::_dx_min

Minimum element size.

Definition at line 207 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface(), and getMinimumElemSize().

◆ _end_point

const Point DiscreteLineSegmentInterface::_end_point
protected

End point of line segment.

Definition at line 110 of file DiscreteLineSegmentInterface.h.

Referenced by getEndPoint().

◆ _length

Real DiscreteLineSegmentInterface::_length
protected

◆ _lengths

std::vector<Real> DiscreteLineSegmentInterface::_lengths
protected

◆ _moose_object_name_dlsi

const std::string DiscreteLineSegmentInterface::_moose_object_name_dlsi
protected

Name of the MOOSE object.

Definition at line 136 of file DiscreteLineSegmentInterface.h.

Referenced by computeAxialCoordinate().

◆ _n_elem

unsigned int DiscreteLineSegmentInterface::_n_elem
protected

◆ _n_elems

std::vector<unsigned int> DiscreteLineSegmentInterface::_n_elems
protected

◆ _n_sections

const unsigned int DiscreteLineSegmentInterface::_n_sections
protected

◆ _position

const Point& DiscreteLineSegmentInterface::_position
protected

◆ _R

const RealTensorValue DiscreteLineSegmentInterface::_R
protected

Direction transformation tensor.

Definition at line 126 of file DiscreteLineSegmentInterface.h.

Referenced by computeRealPointFromReferencePoint().

◆ _R_inv

const RealTensorValue DiscreteLineSegmentInterface::_R_inv
protected

Inverse direction transformation tensor.

Definition at line 131 of file DiscreteLineSegmentInterface.h.

Referenced by computeReferencePointFromRealPoint().

◆ _rotation

const Real& DiscreteLineSegmentInterface::_rotation
protected

Angle of rotation about the x-axis.

Definition at line 102 of file DiscreteLineSegmentInterface.h.

Referenced by getElementBoundaryCoordinates(), and getRotation().

◆ _Rx

const RealTensorValue DiscreteLineSegmentInterface::_Rx
protected

Rotational transformation tensor about x-axis.

Definition at line 128 of file DiscreteLineSegmentInterface.h.

Referenced by computeRealPointFromReferencePoint().

◆ _Rx_inv

const RealTensorValue DiscreteLineSegmentInterface::_Rx_inv
protected

Inverse rotational transformation tensor about x-axis.

Definition at line 133 of file DiscreteLineSegmentInterface.h.

Referenced by computeReferencePointFromRealPoint().

◆ _section_end

std::vector<Real> DiscreteLineSegmentInterface::_section_end
protected

Axial coordinate of the end of each axial section using the line 'position' as the origin.

Definition at line 120 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface(), and getAxialSectionIndex().

◆ _x_centers

std::vector<Real> DiscreteLineSegmentInterface::_x_centers
protected

Center axial coordinate of each axial element.

Definition at line 123 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface(), and getAxialElementIndex().


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