libsurf
Programmer's Documentation

fsielement.h (r6227/r5385)
1 
2 /* Copyright (C) 2015 David Eller <david@larosterna.com>
3  *
4  * Commercial License Usage
5  * Licensees holding valid commercial licenses may use this file in accordance
6  * with the terms contained in their respective non-exclusive license agreement.
7  * For further information contact david@larosterna.com .
8  *
9  * GNU General Public License Usage
10  * Alternatively, this file may be used under the terms of the GNU General
11  * Public License version 3.0 as published by the Free Software Foundation and
12  * appearing in the file gpl.txt included in the packaging of this file.
13  */
14 
15 #ifndef SURF_FSIELEMENT_H
16 #define SURF_FSIELEMENT_H
17 
18 #include <genua/defines.h>
19 #include <genua/dvector.h>
20 #include <genua/point.h>
21 
22 class FsiMesh;
23 
30 {
31 public:
32 
33  enum {max_nodes = 16};
34 
36  FsiElement(const FsiMesh & m, uint gix);
37 
39  virtual ~FsiElement() {}
40 
42  uint nvertices() const {return nv;}
43 
45  const uint *vertices() const {return vi;}
46 
48  virtual Real shapeFunction(Real u, Real v, Real N[]) const = 0;
49 
51  void eval(const Vector & pf, Real u, Real v, Real wgt, Vct3 npf[]) const;
52 
54  void eval(const Vector & pf, Real u, Real v, Real wgt, Vct6 npf[]) const;
55 
57  void eval(const Matrix & mpf, Real u, Real v, Real wgt,
58  PointList<3> & psn, PointGrid<6> & enf) const;
59 
61  uint nearestFluidElement(Real u, Real v, Vct2 & fuv) const;
62 
64  void integrate(const Vector & pf, uint nip, const Real u[], const Real v[],
65  const Real wgt[], PointList<3,Real> & gnf) const;
66 
68  void tpIntegrate(const Vector & pf, uint nip, const Real u[], const Real wgt[],
69  PointList<3,Real> & gnf) const;
70 
72  void integrate(const Vector & pf, uint nip, const Real u[], const Real v[],
73  const Real wgt[], PointList<6,Real> & gnf) const;
74 
76  void tpIntegrate(const Vector & pf, uint nip, const Real u[], const Real wgt[],
77  PointList<6,Real> & gnf) const;
78 
80  void integrate(uint nip, const Real u[], const Real v[],
81  const Real wgt[], const Matrix & mpf,
82  PointGrid<6,Real> & gnf) const;
83 
84 protected:
85 
87  const FsiMesh & msh;
88 
90  Vct3 meanNormal;
91 
93  const uint *vi;
94 
96  uint nv, isec, lix;
97 };
98 
103 class FsiTri3 : public FsiElement
104 {
105 public:
106 
108  FsiTri3(const FsiMesh & m, uint gix);
109 
111  Real area() const {return 0.5*detJ;}
112 
114  Real shapeFunction(Real u, Real v, Real N[]) const {
115  N[0] = 1.0 - u - v;
116  N[1] = u;
117  N[2] = v;
118  return detJ;
119  }
120 
121 private:
122 
124  Real detJ;
125 };
126 
131 class FsiQuad4 : public FsiElement
132 {
133 public:
134 
136  FsiQuad4(const FsiMesh & m, uint gix);
137 
139  Real area() const {return detJ;}
140 
142  Real shapeFunction(Real u, Real v, Real N[]) const {
143 
144  // debug
145  u = 0.5*(u + 1.0);
146  v = 0.5*(v + 1.0);
147 
148  N[0] = (1.0 - u)*(1.0 - v);
149  N[1] = u*(1.0 - v);
150  N[2] = u*v;
151  N[3] = (1.0 - u)*v;
152  return detJ;
153  }
154 
155 private:
156 
158  Real detJ;
159 };
160 
161 #endif // FSIELEMENT_H
Vct3 meanNormal
mean element normal set by constructor
Definition: fsielement.h:90
Real detJ
precomputed element area
Definition: fsielement.h:158
Element wrapper for fluid-structure mapping.
Definition: fsielement.h:29
uint nv
element section and local index
Definition: fsielement.h:96
const uint * vi
pointer to element indices
Definition: fsielement.h:93
Real area() const
for validation
Definition: fsielement.h:139
Wrapper for 3-node triangles in FSI problems.
Definition: fsielement.h:103
void tpIntegrate(const Vector &pf, uint nip, const Real u[], const Real wgt[], PointList< 3, Real > &gnf) const
apply a tensor-product integration rule
Wrapper for 4-node quadrilaterals in FSI problems.
Definition: fsielement.h:131
uint nvertices() const
access vertices
Definition: fsielement.h:42
virtual Real shapeFunction(Real u, Real v, Real N[]) const =0
determine shape function value, return |J|
void eval(const Vector &pf, Real u, Real v, Real wgt, Vct3 npf[]) const
evaluate integrand at u, v with weight wgt
Definition: fsielement.cpp:40
Real shapeFunction(Real u, Real v, Real N[]) const
determine shape function value, return |J|
Definition: fsielement.h:142
const uint * vertices() const
access vertices
Definition: fsielement.h:45
uint nearestFluidElement(Real u, Real v, Vct2 &fuv) const
return fluid elements nearest to integration points
Definition: fsielement.cpp:27
FsiQuad4(const FsiMesh &m, uint gix)
precompute constant element properties
Definition: fsielement.cpp:216
Real detJ
precomputed element area
Definition: fsielement.h:124
Merged mesh for aeroelastic problems.
Definition: fsimesh.h:40
virtual ~FsiElement()
base class
Definition: fsielement.h:39
Real shapeFunction(Real u, Real v, Real N[]) const
determine shape function value, return |J|
Definition: fsielement.h:114
Real area() const
for validation
Definition: fsielement.h:111
FsiTri3(const FsiMesh &m, uint gix)
precompute constant element properties
Definition: fsielement.cpp:204
const FsiMesh & msh
reference to mesh object
Definition: fsielement.h:87
void integrate(const Vector &pf, uint nip, const Real u[], const Real v[], const Real wgt[], PointList< 3, Real > &gnf) const
integrate nodal force vector components
FsiElement(const FsiMesh &m, uint gix)
initialize
Definition: fsielement.cpp:20
Generated on Mon Jan 24 2022 03:03:16 for libsurf by   doxygen 1.8.5