YaDICs  V04.14.a
Yet another Digital Image Correlation software: platform dedicated to 2/3D Fluid and Solid kinematics field measurements.
 All Classes Files Functions Variables Pages
CshapeFunction_FEM_Q4.h
Go to the documentation of this file.
1 /**********************************************************************
2  * Copyright (C) 2012, The YaDICs Project Developers.
3  * See the COPYRIGHT file at the top-level directory of this distribution ./COPYRIGHT.
4  * See ./COPYING file for copying and redistribution conditions.
5  *
6  * This file is part of YaDICs.
7  * YaDICs is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * YaDICs is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with YaDICs. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Information about how to use the software are provided at http://yadic.univ-lille1.fr/
21  **********************************************************************/
22 
23 
24 #ifndef CSHAPEFUNCTION_FEM_Q4
25 #define CSHAPEFUNCTION_FEM_Q4
26 
34 #include "CshapeFunction_FEM.h"
35 
38 template<typename T,typename Timg>
40 {
41 
42  public:
43 
45  {//constructor
46 
47  this->class_name = "Shape function : Finite Element Method 4 nodes";
48 
49  }
50 
51  virtual void init(CParameterNetCDF &fp)
52  {
53  this->m_dof = 8;
54  }
55 
56  virtual void exec(const CImg<Timg> &box, const std::vector<T> &x, CImgList<T> &N)
57  {// assign CImgList<T> N[dimensions][modes] for required Q4P1 modes at coordonate (x,y,z)
58 
59  float ratio = box.height()*box.width();
60 
61  cimglist_for(N, dim)
62  {// trigonometric orientation for nodes
63  N(dim,0) = (box.width()-x[0])*(box.height()-x[1])/ratio;//node 0
64  N(dim,1) = x[0]*(box.height()-x[1])/ratio;//node 1
65  N(dim,3) = x[0]*x[1]/ratio;//node 2
66  N(dim,2) = (box.width()-x[0])*x[1]/ratio;//node 3
67  }
68 
69  }
70 
71 };
72 
73 #endif
This class implements Q4P1 shape functions available for 2D cases.
Definition: CshapeFunction_FEM_Q4.h:39
This is the mother class of FEM shape function objets (virtual pure).
Definition: CshapeFunction_FEM.h:40