21 params.addClassDescription(
"Implements a boundary condition that enforces rotational"
22 "displacement around an axis on a boundary");
24 params.addRequiredParam<
int>(
"component",
"The component for the rotational displacement");
25 params.set<
bool>(
"use_displaced_mesh") =
true;
26 params.set<
bool>(
"preset") =
true;
33 MooseEnum units(
"degrees radians");
34 params.addRequiredParam<FunctionName>(
"function",
35 "The function providing the angle of rotation.");
36 params.addRequiredParam<MooseEnum>(
"angle_units",
38 "The units of the angle of rotation. Choices are:" +
40 params.addRequiredParam<RealVectorValue>(
"axis_origin",
"Origin of the axis of rotation");
41 params.addRequiredParam<RealVectorValue>(
"axis_direction",
"Direction of the axis of rotation");
45 : DirichletBCBase(parameters),
46 _component(getParam<int>(
"component")),
47 _func(getFunction(
"function")),
48 _angle_units(getParam<MooseEnum>(
"angle_units")),
49 _axis_origin(getParam<RealVectorValue>(
"axis_origin")),
50 _axis_direction(getParam<RealVectorValue>(
"axis_direction"))
52 if (_component < 0 || _component > 2)
53 mooseError(
"Invalid component given for ",
name(),
": ",
_component,
".");
56 mooseError(
"Please specify a non-zero direction vector for the axis_direction in ",
name());
69 Point p(*_current_node);
71 Real angle(
_func.value(_t, *_current_node));
73 angle = angle * libMesh::pi / 180.0;
75 ColumnMajorMatrix p_old(4, 1);
89 ColumnMajorMatrix rotate_about_z(4, 4);
90 rotate_about_z(0, 0) = cos(angle);
91 rotate_about_z(0, 1) = -sin(angle);
92 rotate_about_z(0, 2) = 0;
93 rotate_about_z(0, 3) = 0;
94 rotate_about_z(1, 0) = sin(angle);
95 rotate_about_z(1, 1) = cos(angle);
96 rotate_about_z(1, 2) = 0;
97 rotate_about_z(1, 3) = 0;
98 rotate_about_z(2, 0) = 0;
99 rotate_about_z(2, 1) = 0;
100 rotate_about_z(2, 2) = 1;
101 rotate_about_z(2, 3) = 0;
102 rotate_about_z(3, 0) = 0;
103 rotate_about_z(3, 1) = 0;
104 rotate_about_z(3, 2) = 0;
105 rotate_about_z(3, 3) = 1;
107 ColumnMajorMatrix transform =
109 return transform * p0;
127 ColumnMajorMatrix transl(4, 4);
145 ColumnMajorMatrix rotate_about_x(4, 4);
146 rotate_about_x(0, 0) = 1;
147 rotate_about_x(0, 1) = 0;
148 rotate_about_x(0, 2) = 0;
149 rotate_about_x(0, 3) = 0;
150 rotate_about_x(1, 0) = 0;
153 rotate_about_x(1, 3) = 0;
154 rotate_about_x(2, 0) = 0;
157 rotate_about_x(2, 3) = 0;
158 rotate_about_x(3, 0) = 0;
159 rotate_about_x(3, 1) = 0;
160 rotate_about_x(3, 2) = 0;
161 rotate_about_x(3, 3) = 1;
163 ColumnMajorMatrix rotate_about_y(4, 4);
164 rotate_about_y(0, 0) = v / length;
165 rotate_about_y(0, 1) = 0;
167 rotate_about_y(0, 3) = 0;
168 rotate_about_y(1, 0) = 0;
169 rotate_about_y(1, 1) = 1;
170 rotate_about_y(1, 2) = 0;
171 rotate_about_y(1, 3) = 0;
173 rotate_about_y(2, 1) = 0;
174 rotate_about_y(2, 2) = v / length;
175 rotate_about_y(2, 3) = 0;
176 rotate_about_y(3, 0) = 0;
177 rotate_about_y(3, 1) = 0;
178 rotate_about_y(3, 2) = 0;
179 rotate_about_y(3, 3) = 1;
181 ColumnMajorMatrix transl_inv(4, 4);
182 transl.inverse(transl_inv);
183 ColumnMajorMatrix rotx_inv(4, 4);
184 rotate_about_x.inverse(rotx_inv);
185 ColumnMajorMatrix roty_inv(4, 4);
186 rotate_about_y.inverse(roty_inv);