KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Cube27Node.m
Go to the documentation of this file.
1 namespace fem{
2 namespace geometry{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
61  public:
62 
63 
64  Cube27Node(nodes,elems) {
65  if nargin < 2
66  this = fem.geometry.RegularHex27Grid;
67  return;
68  elseif size(unique(nodes" , "rows^t),1) ~= size(nodes,2);
69  error(" Please provide unique points! ");
70  end
71  this.Nodes= nodes;
72  this.Elements= elems;
73  this.DofsPerElement= 27;
74  /* EdgeIndices = [1 3 7 9 19 21 25 27]; */
75 
76  /* % Compute edges */
77  e = int16.empty(0,2);
78  for i=1:size(elems,1)
79  hlp = elems(i,[1 2 4 5 7 8 2 3 5 6 8 9 1 4 2 5 3 6 4 7 5 8 6 9 ... /* bottom */
80 
81  1 10 2 11 3 12 10 19 11 20 12 21 10 11 11 12 19 20 20 21 ... /* front */
82 
83  12 15 15 18 21 24 24 27 6 15 15 24 9 18 18 27 ... /* right side */
84 
85  4 13 13 22 7 16 16 25 10 13 13 16 19 22 22 25 ... /* left side */
86 
87  8 17 17 26 16 17 17 18 25 26 26 27 ... /* back side */
88 
89  20 23 23 26 22 23 23 24 ... /* top */
90 
91  ]); /* inner 5 14 13 14 11 14 14 15 14 17 14 23 */
92 
93  e(end+1:end+48,:) = reshape(hlp" ,2,[]) ";
94  end
95  e = unique(e," rows "," stable ");
96  this.Edges= e;
97 
98  /* % Set Face indices */
99  this.MasterFaces= [1:3:25
100  3:3:27
101  1:3 10:12 19:21
102  7:9 16:18 25:27
103  1:9
104  19:27];
105  /* Face node indices for patch objects */
106  this.PatchFacesIdx= [1 4 13 10; 4 7 16 13; 13 16 25 22; 10 13 22 19;
107  3 6 15 12; 6 9 18 15; 12 15 24 21; 15 18 27 24;
108  1 2 11 10; 2 3 12 11; 10 11 20 19; 11 12 21 20;
109  7 8 17 16; 8 9 18 17; 16 17 26 25; 17 18 27 26;
110  1 2 5 4; 4 5 8 7; 2 3 6 5; 5 6 9 8;
111  19 20 23 22; 20 21 24 23; 22 23 26 25; 23 24 27 26];
112  this.PatchesPerFace= 4;
113  this.Faces= this.computeFaces;
114 
115  this.ReverseAxesIndices= [3 2 1 6 5 4 9 8 7 12 11 10 15 14 13 18 17 16 21 20 19 24 23 22 27 26 25
116  7:9 4:6 1:3 16:18 13:15 10:12 25:27 22:24 19:21
117  19:27 10:18 1:9];
118 
119  this.OrientationCheckIndices(:,:,1) = [1:3; 4:6; 7:9; 10:12; 13:15; 16:18; 19:21; 22:24; 25:27];
120  this.OrientationCheckIndices(:,:,2) = [1 4 7; 2 5 8; 3 6 9; 10 13 16; 11 14 17;12 15 18; 19 22 25; 20 23 26; 21 24 27];
121  this.OrientationCheckIndices(:,:,3) = [1 10 19; 2 11 20; 3 12 21; 4 13 22; 5 14 23; 6 15 24; 7 16 25; 8 17 26; 9 18 27];
122  this.checkOrientation;
123  }
124 
125 
126  function cube8 = toCube8Node() {
127  elems8 = this.Elements(:,[1 3 7 9 19 21 25 27]);
128  usednodes = unique(elems8(:)," stable ");
129  invidx(usednodes) = 1:length(usednodes);
130  elems8 = invidx(elems8);
131  cube8 = fem.geometry.Cube8Node(this.Nodes(:,usednodes),elems8);
132  }
141  function cube20 = toCube20Node() {
142  elems20 = this.Elements(:,[1:4 6:10 12 16 18:22 24:27]);
143  usednodes = unique(elems20(:)," stable ");
144  invidx(usednodes) = 1:length(usednodes);
145  elems20 = invidx(elems20);
146  cube20 = fem.geometry.Cube20Node(this.Nodes(:,usednodes),elems20);
147  }
148 
149 
150  function swapYZ() {
151  n = this.Nodes;
152  n([2 3],:) = n([3 2],:);
153  this.Nodes= n;
154  this.Elements= this.Elements(:,[1:3 10:12 19:21 4:6 13:15 22:24 7:9 16:18 25:27]);
155  /* Update faces indices */
156  this.Faces= this.computeFaces;
157  }
158 
159 
160 
161 };
162 }
163 }
164 
Elements
m x p index vector for all p nodes of m elements
Definition: BaseGeometry.m:41
Hexahedral geometry with 27 position nodes on each basic hexahedron/cube.
Definition: Cube27Node.m:19
Nodes
n x 3 position vector of nodes
Definition: BaseGeometry.m:30
PatchFacesIdx
The indices of the nodes suitable for creating a patch surface object.
Definition: BaseGeometry.m:69
Cube27Node(nodes, elems)
Definition: Cube27Node.m:64
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
function cube8 = toCube8Node()
Creates a 8 node cube geometry from this 20 node cube geometry by simply leaving out the on-edge node...
Definition: Cube27Node.m:126
Edges
2 x k index vector for edges between two points
Definition: BaseGeometry.m:52
function cube20 = toCube20Node()
Definition: Cube27Node.m:141
function faces = computeFaces()
Computes the outward faces of this fem.geometry.
Definition: BaseGeometry.m:378
Faces
A 2 x N_F vector containing the element number in the first row and the face number on that element i...
Definition: BaseGeometry.m:83