]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use internal rotation matrix for airfoil. 13006/head
authorMarc Fehling <mafehling.git@gmail.com>
Tue, 30 Nov 2021 01:34:25 +0000 (18:34 -0700)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 30 Nov 2021 01:34:25 +0000 (18:34 -0700)
source/grid/grid_generator.cc

index 7d961f01ba10f4b399dad661c29d45dc78deaf7c..1625a626b6d66a0e25ed638dfc9d7d23a1de65ab 100644 (file)
@@ -28,6 +28,8 @@
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
 
+#include <deal.II/physics/transformations.h>
+
 #include <array>
 #include <cmath>
 #include <limits>
@@ -954,14 +956,10 @@ namespace GridGenerator
           std::vector<bool> vertex_processed(tria.n_vertices(), false);
 
           // rotation matrix for clockwise rotation of block 1 by angle gamma
-          Tensor<2, 2, double> rotation_matrix_1, rotation_matrix_2;
-
-          rotation_matrix_1[0][0] = +std::cos(-gamma);
-          rotation_matrix_1[0][1] = -std::sin(-gamma);
-          rotation_matrix_1[1][0] = +std::sin(-gamma);
-          rotation_matrix_1[1][1] = +std::cos(-gamma);
-
-          rotation_matrix_2 = transpose(rotation_matrix_1);
+          const Tensor<2, 2, double> rotation_matrix_1 =
+            Physics::Transformations::Rotations::rotation_matrix_2d(-gamma);
+          const Tensor<2, 2, double> rotation_matrix_2 =
+            transpose(rotation_matrix_1);
 
           // horizontal offset in order to place coarse-grid node A in the
           // origin

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.