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
HexahedronTrilinear.m
Go to the documentation of this file.
1 namespace fem{
2 
3 
4 /* (Autoinserted by mtoc++)
5  * This source code has been filtered by the mtoc++ executable,
6  * which generates code that can be processed by the doxygen documentation tool.
7  *
8  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
9  * Except for the comments, the function bodies of your M-file functions are untouched.
10  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
11  * attached source files that are highly readable by humans.
12  *
13  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
14  * the correct locations in the source code browser.
15  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
16  */
17 
19  :public fem.BaseFEM {
27  public:
28 
30  if nargin < 1
31  geo = fem.geometry.Cube8Node;
32  end
33  this = this@fem.BaseFEM(geo);
34  /* this.EdgeIndices = 1:8; */
35  }
36 
37 
38  function Nx = N(colvec<double> x) {
39  Nx = [(1-x(1,:)).*(1-x(2,:)).*(1-x(3,:));... /* 1 */
40 
41  (1+x(1,:)).*(1-x(2,:)).*(1-x(3,:));...
42  (1-x(1,:)).*(1+x(2,:)).*(1-x(3,:));... /* 3 */
43 
44  (1+x(1,:)).*(1+x(2,:)).*(1-x(3,:));...
45  (1-x(1,:)).*(1-x(2,:)).*(1+x(3,:));... /* 5 */
46 
47  (1+x(1,:)).*(1-x(2,:)).*(1+x(3,:));...
48  (1-x(1,:)).*(1+x(2,:)).*(1+x(3,:));... /* 7 */
49 
50  (1+x(1,:)).*(1+x(2,:)).*(1+x(3,:));]/8;
51  }
52 
53 
54  function dNx = gradN(colvec<double> x) {
55  dNx = [-(1-x(2,:)).*(1-x(3,:)) -(1-x(1,:)).*(1-x(3,:)) -(1-x(1,:)).*(1-x(2,:));... /* 1 */
56 
57  (1-x(2,:)).*(1-x(3,:)) -(1+x(1,:)).*(1-x(3,:)) -(1+x(1,:)).*(1-x(2,:));...
58  -(1+x(2,:)).*(1-x(3,:)) (1-x(1,:)).*(1-x(3,:)) -(1-x(1,:)).*(1+x(2,:));... /* 3 */
59 
60  (1+x(2,:)).*(1-x(3,:)) (1+x(1,:)).*(1-x(3,:)) -(1+x(1,:)).*(1+x(2,:));...
61  -(1-x(2,:)).*(1+x(3,:)) -(1-x(1,:)).*(1+x(3,:)) (1-x(1,:)).*(1-x(2,:));... /* 5 */
62 
63  (1-x(2,:)).*(1+x(3,:)) -(1+x(1,:)).*(1+x(3,:)) (1+x(1,:)).*(1-x(2,:));...
64  -(1+x(2,:)).*(1+x(3,:)) (1-x(1,:)).*(1+x(3,:)) (1-x(1,:)).*(1+x(2,:));... /* 7 */
65 
66  (1+x(2,:)).*(1+x(3,:)) (1+x(1,:)).*(1+x(3,:)) (1+x(1,:)).*(1+x(2,:))]/8;
67  }
68 
69 
70  public: /* ( Static ) */
71 
72  static function res = test_TrilinearBasisFun() {
73  q = fem.HexahedronTrilinear;
74  res = fem.BaseFEM.test_BasisFun(q);
75 
76  /* test for correct basis function values on nodes */
77  [X,Y,Z] = ndgrid(-1:2:1,-1:2:1,-1:2:1);
78  p = [X(:) Y(:) Z(:)]^t;
79  res = res && isequal(q.N(p),eye(8));
80  }
81 
82 
83 
84 };
85 }
86 
87 
88 
FEMBASE Summary of this class goes here Detailed explanation goes here.
Definition: BaseFEM.m:18
function Nx = N(colvec< double > x)
static function res = test_TrilinearBasisFun()
#define X(i, j)
function dNx = gradN(colvec< double > x)
#define Y(i, j)
HexahedronTrilinear: Base class for linear ansatz functions on hexahedral geometry (8-Point elements)...