TexGen
SimulationAbaqus.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 "Simulation.h"
23#include "Materials.h"
24
25namespace TexGen
26{
27 using namespace std;
28
29 class CTextileWeave;
30 class CTextile3DWeave;
31 class CDomain;
32 class CMaterial;
33
35 {
37 vector<int> Index;
38 };
39
42 {
43 public:
45 virtual ~CSimulationAbaqus(void);
46
47 bool CreateAbaqusInputFile(CTextile &Textile, string Filename, bool bRegenerateMesh, int iElementType = 0, bool bAdjustMesh = false, double Tolerance = 0.0000001 );
48
49 void SetIncludePlates(bool bInclude) { m_bIncludePlates = bInclude; }
50 bool GetIncludePlates() { return m_bIncludePlates; }
51
52 void SetInitialPlateGap(double dPlateGap) { m_dInitialPlateGap = dPlateGap; }
53 double GetInitialPlateGap() { return m_dInitialPlateGap; }
54
55 void SetWholeSurfaces(bool bWholeSurface ) { m_bWholeSurfaces = bWholeSurface; }
56 bool GetWholeSurfaces() { return m_bWholeSurfaces; }
57
59
64 void SetYarnSurfaceInteraction(string AbaqusCommands);
66
71 void SetPlateSurfaceInteraction(string AbaqusCommands);
72
73 void SetStaticStepParameters(double dInitTimeInc = 0, double dTimePeriod = 0, double dMinTimeInc = 0, double dMaxTimeInc = 0);
74
75 protected:
77 {
80 };
81
83 {
86 SURFACE_ALL
87 };
88
90 {
91 int iYarn;
95 };
96
97 /*struct ELEMENT_INDICES
98 {
99 CMesh::ELEMENT_TYPE ElementType;
100 vector<int> Index;
101 };*/
102
104 {
105 double Depth;
108 int Yarn;
109 int Index;
110 vector<ELEMENT_INDICES> Elements;
111 };
112
114 {
115 int iMin;
116 int iMax;
118 };
119
120
121
124 {
125 public:
126 virtual CSurfaceInteraction* Copy() const = 0;
127 virtual string GetAbaqusCommands() = 0;
128 };
129
132 {
133 public:
135 CKeywordInteraction(string AbaqusCommands):m_AbaqusCommands(AbaqusCommands){}
136 CSurfaceInteraction* Copy() const { return new CKeywordInteraction(*this); }
137 string GetAbaqusCommands() { return m_AbaqusCommands; }
138 void SetAbaqusCommands(string AbaqusCommands) { m_AbaqusCommands = AbaqusCommands; }
139 protected:
141 };
142
144 void CreateMaterials(ostream &Output, string Filename);
145
146
148 void CreateContact(ostream &Output, string Name1, string Name2, string InteractionName);
149
151
161 void CreateSet(ostream &Output, SET_TYPE Type, string Name, vector<int> &Indices, bool bUnSorted = false);
163
169 void CreateSet(ostream &Output, string Name, const vector<pair<int, int> > &NodePairs);
170
172
177 void CreateSurfaces(ostream &Output, map<string, vector<ELEMENT_FACE> > &SurfaceDefinitions);
178
179 void CreateSurfaceDefinitions( int iNumYarns, const vector<XYZ> &Repeats, map<string, vector<ELEMENT_FACE> > &SurfaceDefinitions);
180
182
187 void CreateContacts(ostream &Output, const CTextile &Textile);
188
190 void CreateContacts(ostream &Output, const CTextileWeave &Weave);
191
193 void OutputContacts( ostream &Output, set<pair<int, int> > &Contacts );
194
196 void CreateContacts(ostream &Output, const CTextile3DWeave &Weave);
197
199 void CreateCompressionPlates(ostream &Output);
200
202 void CreatePeriodicBoundaries(ostream &Output, const CDomain &Domain);
203
205 void CreateStep(ostream &Output);
206
208 void CreateBoundary(ostream &Output, CLinearTransformation Deformation, const vector<int> &YarnCenterNodes, const vector<XYZ> &Repeats);
209
212
215 int GetFaceIndex(CMesh::ELEMENT_TYPE ElemType, const set<int> &NodeIndices);
216
218
223 void GetYarnSurfaces(int iYarn, const vector<XYZ> &Repeats, vector<ELEMENT_FACE> &UpperFaces, vector<ELEMENT_FACE> &LowerFaces );
224
226
231 void GetYarnSurface(int iYarn, const vector<XYZ> &Repeats, vector<ELEMENT_FACE> &Faces );
232
234
239 ELEMENT_FACE FindFaceIndex(int iYarn, const vector<int> &SurfIndices);
240
242
247 set<int> GetCommonIndices(const vector<int> &SurfIndices, const vector<int> &VolIndices);
248
250 int GetCenterNode(const CMesh &Mesh);
251
253 void BuildIndexOffsets();
254
257 int GetGlobalElementIndex(int iYarn, CMesh::ELEMENT_TYPE ElemType, int iIndex);
258
260 int GetGlobalElementIndex(ELEMENT_FACE Face);
261
263 int GetGlobalNodeIndex(int iYarn, int iIndex);
264
266 double GetSectionArea( vector<int> &Section, CMesh &Mesh );
267
269 double GetSectionVolumeFraction( double Area, CTextile &Textile, int Yarn );
270
272 void CreateMidPointVolumeFractions( vector<SECTION_VF_DATA> &VFData, vector<SECTION_VF_DATA> &VFMidData );
273
275 void GetElementVolumeFractions( vector<POINT_INFO> &ElementsInfo, vector<SECTION_VF_DATA> &MidVFData );
276
278 void GetSectionVolumeFractions(CTextile &Textile, vector<SECTION_VF_DATA> &VolFractionData, int iYarn );
279
280
281
282 vector<CMesh> m_YarnMeshes;
284 typedef int YarnNumber;
285 map<YarnNumber, map<CMesh::ELEMENT_TYPE, int> > m_ElementIndexOffsets;
286 map<YarnNumber, int> m_NodeIndexOffsets;
287 int m_iTotalNumNodes; // This is including any dummy nodes created for whatever purposes
293
295
299 };
300}; // namespace TexGen
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#define CLASS_DECLSPEC
Definition: Misc.h:35
int GetFaceIndex(CMesh::ELEMENT_TYPE ElemType, const set< int > &NodeIndices)
set< int > GetCommonIndices(const vector< int > &SurfIndices, const vector< int > &VolIndices)
Abstract base class representing the domain in which a textile cell may lie.
Definition: Domain.h:34
Represents a linear transformation as a 3x3 matrix.
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
ELEMENT_TYPE
Each element type is represented by a unique integer value.
Definition: Mesh.h:66
Object container to help handle memory management issues.
Represents a surface interaction as a string of ABAQUS keywords.
Abstract base class to represent a surface interaction.
virtual CSurfaceInteraction * Copy() const =0
Class used to generate an abaqus input deck for textile mechanics simulations.
map< YarnNumber, int > m_NodeIndexOffsets
CTextileMaterials m_Materials
void SetIncludePlates(bool bInclude)
CObjectContainer< CSurfaceInteraction > m_PlateInteraction
CObjectContainer< CSurfaceInteraction > m_YarnInteraction
void SetWholeSurfaces(bool bWholeSurface)
void SetInitialPlateGap(double dPlateGap)
map< YarnNumber, map< CMesh::ELEMENT_TYPE, int > > m_ElementIndexOffsets
Represents a textile cell containing yarns.
Definition: Simulation.h:30
Represents a 3D woven textile.
Represents a textile cell containing yarns.
Definition: Textile.h:39
Represents a woven textile.
Definition: TextileWeave.h:41
Namespace containing a series of customised math operations not found in the standard c++ library.
CMesh::ELEMENT_TYPE ElementType
Struct for representing points in 3D space.
Definition: mymath.h:56