https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DiscreteLineSegmentInterface.h
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#pragma once
11
12#include "MooseTypes.h"
13#include "InputParameters.h"
14#include "libmesh/vector_value.h"
15#include "libmesh/tensor_value.h"
16
17class MooseObject;
18
23{
24public:
25 DiscreteLineSegmentInterface(const MooseObject * moose_object);
26
27 virtual Point getPosition() const { return getStartPoint(); }
28 Point getStartPoint() const { return _position; }
29 Point getEndPoint() const { return _end_point; }
30 virtual RealVectorValue getDirection() const { return _dir; }
31 virtual Real getRotation() const { return _rotation; }
32
33 virtual Real getNumElems() const { return _n_elem; }
34 virtual Real getLength() const { return _length; }
35
37 Real getMinimumElemSize() const { return _dx_min; }
38
39 /*
40 * Computes the axial coordinate for a given point in 3-D space.
41 *
42 * @param[in] p Point in 3-D space
43 */
44 Real computeAxialCoordinate(const Point & p) const;
45
46 /*
47 * Computes the radial coordinate from the line axis for a given point in 3-D space.
48 *
49 * @param[in] p Point in 3-D space
50 */
51 Real computeRadialCoordinate(const Point & p) const;
52
53 /*
54 * Gets the axial section index for a given point in 3-D space.
55 *
56 * @param[in] p Point in 3-D space
57 */
58 unsigned int getAxialSectionIndex(const Point & p) const;
59
60 /*
61 * Gets the axial element index for a given element center point in 3-D space.
62 *
63 * @param[in] p_center Element center point in 3-D space
64 */
65 unsigned int getAxialElementIndex(const Point & p_center) const;
66
72 Point computeRealPointFromReferencePoint(const Point & p) const;
73
79 Point computeReferencePointFromRealPoint(const Point & p) const;
80
88
92 std::vector<Real> getElementBoundaryCoordinates() const;
93
94protected:
96 const Point & _position;
98 const RealVectorValue & _dir_unnormalized;
100 const RealVectorValue _dir;
102 const Real & _rotation;
103
105 std::vector<Real> _lengths;
108
110 const Point _end_point;
111
113 std::vector<unsigned int> _n_elems;
115 unsigned int _n_elem;
116
118 const unsigned int _n_sections;
120 std::vector<Real> _section_end;
121
123 std::vector<Real> _x_centers;
124
126 const RealTensorValue _R;
128 const RealTensorValue _Rx;
129
131 const RealTensorValue _R_inv;
133 const RealTensorValue _Rx_inv;
134
136 const std::string _moose_object_name_dlsi;
137
138private:
144 static RealVectorValue initializeDirectionVector(const RealVectorValue & dir_unnormalized);
145
146public:
148
154 static RealTensorValue computeDirectionTransformationTensor(const RealVectorValue & dir);
155
161 static RealTensorValue computeXRotationTransformationTensor(const Real & rotation);
162
168 static Point computeRealPointFromReferencePoint(const Point & p,
169 const RealVectorValue & position,
170 const RealTensorValue & R,
171 const RealTensorValue & Rx);
172
178 static Point computeReferencePointFromRealPoint(const Point & p,
179 const RealVectorValue & position,
180 const RealTensorValue & R_inv,
181 const RealTensorValue & Rx_inv);
182
189 static MooseEnum getAlignmentAxis(const RealVectorValue & dir);
190
200 static std::vector<Real> getElementBoundaryCoordinates(const RealVectorValue & position,
201 const RealVectorValue & orientation,
202 const Real & rotation,
203 const std::vector<Real> & lengths,
204 const std::vector<unsigned int> & n_elems);
205
208};
const double R
const Real p
Defines a discretized line segment in 3D space.
const RealTensorValue _Rx_inv
Inverse rotational transformation tensor about x-axis.
unsigned int _n_elem
Total number of axial elements.
const RealVectorValue & _dir_unnormalized
Unnormalized direction of axis from start position to end position.
const unsigned int _n_sections
Number of axial sections.
std::vector< Real > _section_end
Axial coordinate of the end of each axial section using the line 'position' as the origin.
std::vector< Real > _x_centers
Center axial coordinate of each axial element.
std::vector< unsigned int > _n_elems
Number of elements in each axial section.
Real computeAxialCoordinate(const Point &p) const
const Real & _rotation
Angle of rotation about the x-axis.
Real getMinimumElemSize() const
Gets the minimum element size.
virtual RealVectorValue getDirection() const
unsigned int getAxialElementIndex(const Point &p_center) const
const Point & _position
Start position of axis in 3-D space.
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.
const RealTensorValue _R_inv
Inverse direction transformation tensor.
static RealTensorValue computeDirectionTransformationTensor(const RealVectorValue &dir)
Computes the direction transformation tensor.
Real computeRadialCoordinate(const Point &p) const
unsigned int getAxialSectionIndex(const Point &p) const
Point computeReferencePointFromRealPoint(const Point &p) const
Computes point in reference space from a point in 3-D space.
std::vector< Real > _lengths
Length of each axial section.
const RealTensorValue _R
Direction transformation tensor.
const std::string _moose_object_name_dlsi
Name of the MOOSE object.
std::vector< Real > getElementBoundaryCoordinates() const
Gets the element boundary coordinates for the aligned axis.
static RealTensorValue computeXRotationTransformationTensor(const Real &rotation)
Computes the rotation transformation tensor.
static RealVectorValue initializeDirectionVector(const RealVectorValue &dir_unnormalized)
Computes a normalized direction vector or reports an error if the zero vector is provided.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point _end_point
End point of line segment.
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.
const RealTensorValue _Rx
Rotational transformation tensor about x-axis.