#include <MooseAppCoordTransform.h>
Public Types | |
enum | Direction : unsigned int { X = 0, Y, Z, INVALID } |
A class scope enumeration for conveniently denoting X, Y, and Z axis directions. More... | |
typedef std::tuple< short int, Real, short int, std::array< Real, 3 >, int, unsigned int, unsigned int, short int, short int, short int > | MinimalData |
A typedef for conveniency that describes the minimal data necessary to broadcast and build a MooseAppCoordTransform . More... | |
Public Member Functions | |
MooseAppCoordTransform () | |
Default constructor. More... | |
MooseAppCoordTransform (const MooseAppCoordTransform &other) | |
MooseAppCoordTransform (MooseAppCoordTransform &&other)=default | |
MooseAppCoordTransform (const MinimalData &minimal_data) | |
Construct a coordinate transformation object from the minimal set of data required. More... | |
MooseAppCoordTransform (const MooseMesh &mesh) | |
Construct this object from the provided mesh and its input parameters. More... | |
~MooseAppCoordTransform ()=default | |
MooseAppCoordTransform & | operator= (const MooseAppCoordTransform &other) |
MooseAppCoordTransform & | operator= (MooseAppCoordTransform &&other)=default |
MinimalData | minimalDataDescription () const |
Moose::CoordinateSystemType | coordinateSystem () const |
void | setTranslationVector (const libMesh::Point &translation) |
Set how much our domain should be translated in order to match a reference frame. More... | |
void | setUpDirection (Direction up_direction) |
Will setup a rotation transformation. More... | |
void | setRotation (Real alpha, Real beta, Real gamma) |
Setup an extrinsic rotation defined in the following way: More... | |
void | setLengthUnit (const MooseUnits &length_unit) |
Set the scaling transformation. More... | |
const MooseUnits & | lengthUnit () const |
void | setCoordinateSystem (Moose::CoordinateSystemType system_type, Direction rz_symmetry_axis=INVALID) |
Set our coordinate system. More... | |
void | setCoordinateSystem (const MooseMesh &mesh) |
Set our coordinate system based on the MooseMesh coordinate system data. More... | |
void | computeRS () |
Compute the RS and (RS)^{-1} matrices. More... | |
void | transformMesh (MooseMesh &mesh, const libMesh::Point &translation) |
Transforms the entire mesh with the coordinate transform This can be done to output in position, or to avoid transforming on every data point. More... | |
bool | hasScalingOrRotationTransformation () const |
Returns true if the app has scaling and/or rotation transformation. More... | |
Static Public Member Functions | |
static InputParameters | validParams () |
Describes the parameters this object can take to setup transformations. More... | |
Private Member Functions | |
Direction | processZAxis (Direction z_axis) |
If the coordinate system type is RZ, then we return the provided argument. More... | |
Private Attributes | |
std::unique_ptr< libMesh::RealTensorValue > | _scale |
Represents a forward scaling transformation from our units to reference frame units of meters. More... | |
std::unique_ptr< libMesh::RealTensorValue > | _rotate |
Represents a forward rotation transformation from our domain to the reference frame domain. More... | |
std::unique_ptr< libMesh::RealTensorValue > | _rs |
Represents the product of rotation and scaling transformations. More... | |
std::unique_ptr< libMesh::RealTensorValue > | _rs_inverse |
Represents the inverse of the product of rotation and scaling transformations. More... | |
Moose::CoordinateSystemType | _coord_type |
Our coordinate system. More... | |
Direction | _r_axis |
If we are RZ or RSPHERICAL, the Cartesian axis corresponding to the radial coordinate. More... | |
Direction | _z_axis |
If we are RZ, the Cartesian axis corresponding to the axial/axis-of-symmetry coordinate. More... | |
bool | _has_different_coord_sys |
Whether we have different coordinate systems within our single domain. More... | |
bool | _using_general_rz_coord_axes |
Whether general axisymmetric coordinate axes are being used. More... | |
MooseUnits | _length_unit |
How much distance one mesh length unit represents, e.g. 1 cm, 1 nm, 1 ft, 5 inches. More... | |
std::array< Real, 3 > | _euler_angles |
The Euler angles describing rotation. More... | |
bool | _mesh_transformed |
Whether the mesh has been translated and rotated. More... | |
Friends | |
class | MultiAppCoordTransform |
Definition at line 24 of file MooseAppCoordTransform.h.
typedef std::tuple<short int, Real, short int, std::array<Real, 3>, int, unsigned int, unsigned int, short int, short int, short int> MooseAppCoordTransform::MinimalData |
A typedef for conveniency that describes the minimal data necessary to broadcast and build a MooseAppCoordTransform
.
The data is such: 0: whether a scaling matrix exists 1: a value describing the scaling 2: whether a rotation matrix exists 3: the Euler angles describing the rotation 4: the coordinate system type 5: the r-axis direction 6: the z-axis direction 7: whether there are multiple coordinate system types on the mesh 8: whether general axisymmetric coordinate axes are being used 9: whether the mesh has been transformed using the transform
Definition at line 62 of file MooseAppCoordTransform.h.
enum MooseAppCoordTransform::Direction : unsigned int |
A class scope enumeration for conveniently denoting X, Y, and Z axis directions.
Enumerator | |
---|---|
X | |
Y | |
Z | |
INVALID |
Definition at line 30 of file MooseAppCoordTransform.h.
MooseAppCoordTransform::MooseAppCoordTransform | ( | ) |
Default constructor.
If no other methods are called to set rotation, translation, or scaling, then when operator()
is called the result will be the passed-in point, e.g. no transformation will occur
Definition at line 305 of file MooseAppCoordTransform.C.
MooseAppCoordTransform::MooseAppCoordTransform | ( | const MooseAppCoordTransform & | other | ) |
Definition at line 317 of file MooseAppCoordTransform.C.
|
default |
MooseAppCoordTransform::MooseAppCoordTransform | ( | const MinimalData & | minimal_data | ) |
Construct a coordinate transformation object from the minimal set of data required.
Definition at line 334 of file MooseAppCoordTransform.C.
MooseAppCoordTransform::MooseAppCoordTransform | ( | const MooseMesh & | mesh | ) |
Construct this object from the provided mesh and its input parameters.
See the validParams
implementation for valid parameters
Definition at line 259 of file MooseAppCoordTransform.C.
|
default |
void MooseAppCoordTransform::computeRS | ( | ) |
Compute the RS and (RS)^{-1} matrices.
Definition at line 395 of file MooseAppCoordTransform.C.
Referenced by MooseAppCoordTransform(), and operator=().
|
inline |
Definition at line 107 of file MooseAppCoordTransform.h.
bool MooseAppCoordTransform::hasScalingOrRotationTransformation | ( | ) | const |
Returns true if the app has scaling and/or rotation transformation.
Definition at line 443 of file MooseAppCoordTransform.C.
Referenced by FEProblemBase::checkProblemIntegrity(), MultiAppCoordTransform::hasNonTranslationTransformation(), MultiAppCoordTransform::setDestinationCoordTransform(), and transformMesh().
|
inline |
Definition at line 158 of file MooseAppCoordTransform.h.
MooseAppCoordTransform::MinimalData MooseAppCoordTransform::minimalDataDescription | ( | ) | const |
Definition at line 353 of file MooseAppCoordTransform.C.
MooseAppCoordTransform & MooseAppCoordTransform::operator= | ( | const MooseAppCoordTransform & | other | ) |
Definition at line 369 of file MooseAppCoordTransform.C.
|
default |
|
private |
If the coordinate system type is RZ, then we return the provided argument.
Otherwise we return INVALID
Definition at line 20 of file MooseAppCoordTransform.C.
void MooseAppCoordTransform::setCoordinateSystem | ( | Moose::CoordinateSystemType | system_type, |
Direction | rz_symmetry_axis = INVALID |
||
) |
Set our coordinate system.
system_type | the coordinate system type |
rz_symmetry_axis | the axial coordinate, e.g. the axis of symmetry |
Definition at line 143 of file MooseAppCoordTransform.C.
Referenced by MooseAppCoordTransform().
Set our coordinate system based on the MooseMesh coordinate system data.
Definition at line 162 of file MooseAppCoordTransform.C.
void MooseAppCoordTransform::setLengthUnit | ( | const MooseUnits & | length_unit | ) |
Set the scaling transformation.
length_unit | How much distance one mesh length unit represents, e.g. 1 cm, 1 nm, 1 ft, 5 inches. We will save off the value provided to this in the _length_unit data member as well as set the scaling transform |
Definition at line 133 of file MooseAppCoordTransform.C.
Referenced by MooseAppCoordTransform().
Setup an extrinsic rotation defined in the following way:
alpha
degrees about the z-axisbeta
degrees about the x-axisgamma
degrees about the z-axis Definitions of the resulting matrix are found in the last row of the Proper Euler angles column of https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix. These rotation angles should describe how points in our domain should be rotated in order to arrive back in the reference frame. For instance, in 2D your mesh may appear 90 degrees rotated (around the z-axis) with respect to the reference frame. In such a case, the angle set you should provide to this function is {-90, 0, 0}, e.g. provide forward transformation angles that will map points from your domain to the reference domainIf our coordinate system is RZ, then only certain values of alpha, beta, and gamma will be accepted such that the radial and axial coordinates are rotated onto Cartesian axes and the resulting radial coordinate is non-negative
Definition at line 91 of file MooseAppCoordTransform.C.
Referenced by MooseAppCoordTransform().
void MooseAppCoordTransform::setTranslationVector | ( | const libMesh::Point & | translation | ) |
Set how much our domain should be translated in order to match a reference frame.
In practice we choose the parent application to be the reference frame with respect to translation, e.g. the parent application origin is the reference frame origin, and we set the translation vectors of child applications to the multiapp positions parameter. Similarly to the setRotation
with angles API, this represents a forward transformation from our domain to the reference domain
Will setup a rotation transformation.
The rotation transformation will be a single 90-degree rotation defined such that a point on the axis specified by up_direction
is rotated onto the Y-axis, which is our canonical/reference-frame up-direction
up_direction | What direction corresponds to "up" (e.g. the opposite direction of gravity) in our moose mesh |
Definition at line 26 of file MooseAppCoordTransform.C.
Referenced by MooseAppCoordTransform().
void MooseAppCoordTransform::transformMesh | ( | MooseMesh & | mesh, |
const libMesh::Point & | translation | ||
) |
Transforms the entire mesh with the coordinate transform This can be done to output in position, or to avoid transforming on every data point.
mesh | the mesh to modify, usually the child app mesh |
translation | the translation to apply to the mesh, often the app position |
Definition at line 416 of file MooseAppCoordTransform.C.
|
static |
Describes the parameters this object can take to setup transformations.
These include parameters related to coordinate system type, rotation, and scaling
One entry of coord system per block, the size of _blocks and _coord_sys has to match, except:
Definition at line 189 of file MooseAppCoordTransform.C.
Referenced by FEProblemBase::checkProblemIntegrity(), and MooseMesh::validParams().
|
friend |
Definition at line 238 of file MooseAppCoordTransform.h.
|
private |
Our coordinate system.
Definition at line 212 of file MooseAppCoordTransform.h.
Referenced by coordinateSystem(), MultiAppCoordTransform::coordinateSystem(), MultiAppCoordTransform::hasCoordinateSystemTypeChange(), MultiAppCoordTransform::mapBack(), minimalDataDescription(), MultiAppCoordTransform::operator()(), operator=(), MultiAppCoordTransform::setDestinationCoordTransform(), and transformMesh().
|
private |
The Euler angles describing rotation.
Definition at line 232 of file MooseAppCoordTransform.h.
Referenced by minimalDataDescription(), MooseAppCoordTransform(), operator=(), and transformMesh().
|
private |
Whether we have different coordinate systems within our single domain.
If we do, this will be problematic if we need to collapse from our space into an RZ or RSPHERICAL space because we are only ever provided with a point argument and not a subdomain ID argument. Consequently we will not know in what coordinate system our point lies and will not know how to perform the dimension collapse, and so we will error
Definition at line 223 of file MooseAppCoordTransform.h.
Referenced by minimalDataDescription(), operator=(), and MultiAppCoordTransform::setDestinationCoordTransform().
|
private |
How much distance one mesh length unit represents, e.g. 1 cm, 1 nm, 1 ft, 5 inches.
Definition at line 229 of file MooseAppCoordTransform.h.
Referenced by lengthUnit(), and operator=().
|
private |
Whether the mesh has been translated and rotated.
In this case, applying the transform every time is no longer necessary
Definition at line 236 of file MooseAppCoordTransform.h.
Referenced by MultiAppCoordTransform::mapBack(), minimalDataDescription(), MultiAppCoordTransform::operator()(), operator=(), and transformMesh().
|
private |
If we are RZ or RSPHERICAL, the Cartesian axis corresponding to the radial coordinate.
Definition at line 214 of file MooseAppCoordTransform.h.
Referenced by minimalDataDescription(), MultiAppCoordTransform::operator()(), and operator=().
|
private |
Represents a forward rotation transformation from our domain to the reference frame domain.
Definition at line 203 of file MooseAppCoordTransform.h.
Referenced by computeRS(), minimalDataDescription(), MooseAppCoordTransform(), operator=(), and transformMesh().
|
private |
Represents the product of rotation and scaling transformations.
Definition at line 206 of file MooseAppCoordTransform.h.
Referenced by computeRS(), hasScalingOrRotationTransformation(), and MultiAppCoordTransform::operator()().
|
private |
Represents the inverse of the product of rotation and scaling transformations.
Definition at line 209 of file MooseAppCoordTransform.h.
Referenced by computeRS(), and MultiAppCoordTransform::mapBack().
|
private |
Represents a forward scaling transformation from our units to reference frame units of meters.
This matrix will be diagonal
Definition at line 200 of file MooseAppCoordTransform.h.
Referenced by computeRS(), minimalDataDescription(), MooseAppCoordTransform(), operator=(), and transformMesh().
|
private |
Whether general axisymmetric coordinate axes are being used.
Definition at line 226 of file MooseAppCoordTransform.h.
Referenced by minimalDataDescription(), operator=(), MultiAppCoordTransform::setDestinationCoordTransform(), and transformMesh().
|
private |
If we are RZ, the Cartesian axis corresponding to the axial/axis-of-symmetry coordinate.
Definition at line 216 of file MooseAppCoordTransform.h.
Referenced by minimalDataDescription(), MultiAppCoordTransform::operator()(), and operator=().