www.mooseframework.org
Transform.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "Transform.h"
16 #include "MooseMesh.h"
17 
18 #include "libmesh/mesh_modification.h"
19 
20 template <>
23 {
24  MooseEnum transforms("TRANSLATE=1 ROTATE=2 SCALE=3");
25 
27  params.addClassDescription("Applies a linear transform to the entire mesh.");
29  "transform", transforms, "The type of transformation to perform (TRANSLATE, ROTATE, SCALE)");
31  "vector_value",
32  "The value to use for the transformation. When using TRANSLATE or SCALE, the "
33  "xyz coordinates are applied in each direction respectively. When using "
34  "ROTATE, the values are interpreted as the Euler angles phi, theta and psi "
35  "given in degrees.");
36 
37  return params;
38 }
39 
41  : MeshModifier(parameters),
42  _transform(getParam<MooseEnum>("transform")),
43  _vector_value(getParam<RealVectorValue>("vector_value"))
44 {
45 }
46 
47 void
49 {
50  switch (_transform)
51  {
52  case 1:
53  MeshTools::Modification::translate(
55  break;
56  case 2:
57  MeshTools::Modification::rotate(
59  break;
60  case 3:
61  MeshTools::Modification::scale(
63  break;
64  }
65 }
VectorValue< Real > RealVectorValue
Definition: Assembly.h:40
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
MooseMesh * _mesh_ptr
Pointer to the mesh.
Definition: MeshModifier.h:74
MooseEnum _transform
Definition: Transform.h:36
void modify() override
Pure virtual modify function MUST be overridden by children classes.
Definition: Transform.C:48
RealVectorValue _vector_value
Definition: Transform.h:37
Transform(const InputParameters &parameters)
Definition: Transform.C:40
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
InputParameters validParams< Transform >()
Definition: Transform.C:22
InputParameters validParams< MeshModifier >()
Definition: MeshModifier.C:20