TexGen
Elements.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2006 Martin Sherburn
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19
20#pragma once
21
22#include "Matrix.h"
23
24namespace TexGen
25{
27
33 {
34 public:
35 CElement(const CMatrix &P = CMatrix(), int iOrder = 3);
36 virtual ~CElement(void) {}
37
38 void SetNodeCoordinates(const CMatrix &P);
39 void SetIntegrationOrder(int iOrder);
40
41 void GetKeMatrix(CMatrix& KeMatrix);
42
43 void SetFibreDirection(XYZ FibreDirection) { m_FibreDirection = FibreDirection; }
44 XYZ GetFibreDirection() { return m_FibreDirection; }
45
46 protected:
49 {
51 double dWeight;
52 };
53
55 void GetBMatrix(CMatrix& BMatrix, CMatrix& Position);
57 virtual void GetAMatrix(CMatrix& AMatrix) = 0;
59 virtual void GetXMatrix(CMatrix& XMatrix, CMatrix& Position) = 0;
61 virtual void GetDMatrix(CMatrix& DMatrix) = 0;
63
66 virtual void GetIntegrationPoints(vector<INTEGRATION_POINT> &IntegrationPoints) = 0;
67
68 CMatrix m_P; // These are the nodal coordinates
71 };
72
74
80 {
81 public:
82 CElementTri(const CMatrix &P, int iOrder);
83 double GetArea();
84
85 protected:
86 void GetIntegrationPoints(vector<INTEGRATION_POINT> &IntegrationPoints);
87 };
88
90
99 {
100 public:
101 CElementTriBending(const CMatrix &P = CMatrix(), int iOrder = 3);
102
103 void SetLongitudinalBendingModulus(double E1) { m_E1 = E1; }
104 double GetLongitudinalBendingModulus() { return m_E1; }
105
106 void SetTransverseBendingModulus(double E2) { m_E2 = E2; }
107 double GetTransverseBendingModulus() { return m_E2; }
108
109 protected:
110 void GetAMatrix(CMatrix& AMatrix);
111 void GetXMatrix(CMatrix& XMatrix, CMatrix& Position);
112 void GetDMatrix(CMatrix& DMatrix);
113
115 CMatrix GetvMatrix(CMatrix& Position);
117 CMatrix GetTheta_xMatrix(CMatrix& Position);
119 CMatrix GetTheta_yMatrix(CMatrix& Position);
121 CMatrix GetEpsilon_xMatrix(CMatrix& Position);
123 CMatrix GetEpsilon_yMatrix(CMatrix& Position);
125 CMatrix GetEpsilon_xyMatrix(CMatrix& Position);
126
127 double m_E1;
128 double m_E2;
129 };
130
132
141 {
142 public:
143 CElementTriTension(const CMatrix &P = CMatrix(), int iOrder = 3);
144
145 void SetTensileStress(double E) { m_E = E; }
146 double GetTensileStress() { return m_E; }
147
148 protected:
149 void GetAMatrix(CMatrix& AMatrix);
150 void GetXMatrix(CMatrix& XMatrix, CMatrix& Position);
151 void GetDMatrix(CMatrix& DMatrix);
152
154 CMatrix GetvMatrix(CMatrix& Position);
156 CMatrix GetEpsilon_xMatrix(CMatrix& Position);
158 CMatrix GetEpsilon_yMatrix(CMatrix& Position);
159
160 double m_E;
161 };
162
163}; // namespace TexGen
164
165
166
167
168
169
170
171
172
#define CLASS_DECLSPEC
Definition: Misc.h:35
Base class for representing finite elements.
Definition: Elements.h:33
int m_iIntegrationOrder
Definition: Elements.h:69
void SetFibreDirection(XYZ FibreDirection)
Definition: Elements.h:43
virtual void GetDMatrix(CMatrix &DMatrix)=0
This is the material properties matrix (typically involving E and v)
virtual void GetAMatrix(CMatrix &AMatrix)=0
This is the coordinate matrix given nodal coordinates P.
CMatrix m_P
Definition: Elements.h:68
virtual void GetXMatrix(CMatrix &XMatrix, CMatrix &Position)=0
This is the matrix which defines strain in terms of the coefficients.
XYZ m_FibreDirection
Definition: Elements.h:70
virtual void GetIntegrationPoints(vector< INTEGRATION_POINT > &IntegrationPoints)=0
Defines a series of integration points.
virtual ~CElement(void)
Definition: Elements.h:36
XYZ GetFibreDirection()
Definition: Elements.h:44
Triangular element which represents yarn bending.
Definition: Elements.h:99
void SetLongitudinalBendingModulus(double E1)
Definition: Elements.h:103
void SetTransverseBendingModulus(double E2)
Definition: Elements.h:106
double GetLongitudinalBendingModulus()
Definition: Elements.h:104
double GetTransverseBendingModulus()
Definition: Elements.h:107
Base class for representing triangular elements.
Definition: Elements.h:80
Triangular element which represents fibre tension.
Definition: Elements.h:141
void SetTensileStress(double E)
Definition: Elements.h:145
Class to represent a matrix and perform various operations on it.
Definition: Matrix.h:33
Namespace containing a series of customised math operations not found in the standard c++ library.
double GetArea(XYZ Points[], int iNumPoints)
Definition: mymath.h:1245
Struct for representing an integration point.
Definition: Elements.h:49
Struct for representing points in 3D space.
Definition: mymath.h:56