https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseAppCoordTransform.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 "Units.h"
14#include "libmesh/point.h"
15#include "libmesh/tensor_value.h"
16#include <memory>
17#include <string>
18#include <array>
19#include <tuple>
20
21class InputParameters;
22class MooseMesh;
23
25{
26public:
30 enum Direction : unsigned int
31 {
32 X = 0,
36 };
37
52 typedef std::tuple<short int,
53 Real,
54 short int,
55 std::array<Real, 3>,
56 int,
57 unsigned int,
58 unsigned int,
59 short int,
60 short int,
61 short int>
63
70
71 MooseAppCoordTransform(const MooseAppCoordTransform & other); // we have unique pointers
73
77 MooseAppCoordTransform(const MinimalData & minimal_data);
78
84
86
88 operator=(const MooseAppCoordTransform & other); // we have unique pointers
90
96
103
108
116 void setTranslationVector(const libMesh::Point & translation);
117
125 void setUpDirection(Direction up_direction);
126
144 void setRotation(Real alpha, Real beta, Real gamma);
145
152 void setLengthUnit(const MooseUnits & length_unit);
153
158 const MooseUnits & lengthUnit() const { return _length_unit; }
159
166 Direction rz_symmetry_axis = INVALID);
167
171 void setCoordinateSystem(const MooseMesh & mesh);
172
176 void computeRS();
177
184 void transformMesh(MooseMesh & mesh, const libMesh::Point & translation);
185
190
191private:
197
200 std::unique_ptr<libMesh::RealTensorValue> _scale;
201
203 std::unique_ptr<libMesh::RealTensorValue> _rotate;
204
206 std::unique_ptr<libMesh::RealTensorValue> _rs;
207
209 std::unique_ptr<libMesh::RealTensorValue> _rs_inverse;
210
217
224
227
230
232 std::array<Real, 3> _euler_angles;
233
237
239};
240
246{
247public:
248 explicit MultiAppCoordTransform(const MooseAppCoordTransform & our_app_transform);
249
262 libMesh::Point operator()(const libMesh::Point & point) const;
263
272 libMesh::Point mapBack(const libMesh::Point & point) const;
273
281 void setTranslationVector(const libMesh::Point & translation);
282
292 void setDestinationCoordTransform(const MooseAppCoordTransform & destination_coord_transform);
293
298 bool isIdentity() const;
299
306
312
317
321 void skipCoordinateCollapsing(bool skip_coordinate_collapsing);
322
327
332
333private:
338
346
349
352};
void ErrorVector unsigned int
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
MooseUnits _length_unit
How much distance one mesh length unit represents, e.g. 1 cm, 1 nm, 1 ft, 5 inches.
std::array< Real, 3 > _euler_angles
The Euler angles describing rotation.
void setCoordinateSystem(Moose::CoordinateSystemType system_type, Direction rz_symmetry_axis=INVALID)
Set our coordinate system.
std::unique_ptr< libMesh::RealTensorValue > _rotate
Represents a forward rotation transformation from our domain to the reference frame domain.
MinimalData minimalDataDescription() const
bool _has_different_coord_sys
Whether we have different coordinate systems within our single domain.
bool hasScalingOrRotationTransformation() const
Returns true if the app has scaling and/or rotation transformation.
Direction processZAxis(Direction z_axis)
If the coordinate system type is RZ, then we return the provided argument.
std::unique_ptr< libMesh::RealTensorValue > _scale
Represents a forward scaling transformation from our units to reference frame units of meters.
MooseAppCoordTransform(MooseAppCoordTransform &&other)=default
Moose::CoordinateSystemType _coord_type
Our coordinate system.
MooseAppCoordTransform()
Default constructor.
void setUpDirection(Direction up_direction)
Will setup a rotation transformation.
Direction _r_axis
If we are RZ or RSPHERICAL, the Cartesian axis corresponding to the radial coordinate.
Moose::CoordinateSystemType coordinateSystem() const
std::unique_ptr< libMesh::RealTensorValue > _rs_inverse
Represents the inverse of the product of rotation and scaling transformations.
std::unique_ptr< libMesh::RealTensorValue > _rs
Represents the product of rotation and scaling transformations.
void computeRS()
Compute the RS and (RS)^{-1} matrices.
Direction
A class scope enumeration for conveniently denoting X, Y, and Z axis directions.
bool _using_general_rz_coord_axes
Whether general axisymmetric coordinate axes are being used.
Direction _z_axis
If we are RZ, the Cartesian axis corresponding to the axial/axis-of-symmetry coordinate.
static InputParameters validParams()
Describes the parameters this object can take to setup transformations.
MooseAppCoordTransform & operator=(const MooseAppCoordTransform &other)
void setTranslationVector(const libMesh::Point &translation)
Set how much our domain should be translated in order to match a reference frame.
void setRotation(Real alpha, Real beta, Real gamma)
Setup an \emph extrinsic rotation defined in the following way:
const MooseUnits & lengthUnit() const
void setLengthUnit(const MooseUnits &length_unit)
Set the scaling transformation.
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 MooseApp...
bool _mesh_transformed
Whether the mesh has been translated and rotated.
MooseAppCoordTransform & operator=(MooseAppCoordTransform &&other)=default
~MooseAppCoordTransform()=default
void transformMesh(MooseMesh &mesh, const libMesh::Point &translation)
Transforms the entire mesh with the coordinate transform This can be done to output in position,...
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Physical unit management class with runtime unit string parsing, unit checking, unit conversion,...
Definition Units.h:33
This class contains transformation information that only exists in a context in which there are multi...
libMesh::Point mapBack(const libMesh::Point &point) const
Inverse transform from the reference space to our space.
libMesh::Point operator()(const libMesh::Point &point) const
Transforms a point from our domain into the reference domain.
libMesh::Point _translation
Describes a forward translation transformation from our domain to the reference frame domain.
void setDestinationCoordTransform(const MooseAppCoordTransform &destination_coord_transform)
Set the destination coordinate system and destination radial and symmetry axes as appropriate for RZ ...
const MooseAppCoordTransform & ourAppTransform() const
const MooseAppCoordTransform & _our_app_transform
A reference to the MooseAppCoordTransform object that describes scaling, rotation,...
void setTranslationVector(const libMesh::Point &translation)
Set how much our domain should be translated in order to match a reference frame.
bool skipCoordinateCollapsing() const
whether coordinate collapsing operations should be skipped
const MooseAppCoordTransform * _destination_app_transform
A pointer to the MooseAppCoordTransform object that describes scaling, rotation, and coordinate syste...
bool _skip_coordinate_collapsing
whether coordinate collapsing operations should be skipped
Moose::CoordinateSystemType coordinateSystem() const
CoordinateSystemType
Definition MooseTypes.h:864