TexGen
AdjustMeshInterference.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2010 Louise Brown
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 "Mesh.h"
23#include "SimulationAbaqus.h"
24
25
26namespace TexGen
27{
28 using namespace std;
29
30 class CTextile;
31 class CMesh;
32
35 {
36 public:
38 virtual ~CMeshIntersectionData(void);
39
40 void SetIndex( int index ){m_Index = index;}
41 void SetDepth( double Depth ){m_Depth = Depth;}
42 void SetPoint( XYZ Point ){m_Point = Point;}
43 void SetYarn( int Yarn ){m_Yarn = Yarn;}
44 void SetBoundaryPairIndex( int index ){m_BoundaryPairIndex = index;}
45 void SetStartPoint( XYZ Point){m_StartPoint = Point;}
46 void SetInterpIndex( int index ){m_InterpIndex = index;}
47
48 int GetYarn() { return m_Yarn; }
49 const vector<ELEMENT_INDICES> &GetElements() const { return m_Elements; }
50 double GetDepth() { return m_Depth; }
51 XYZ GetPoint() { return m_Point; }
52 XYZ GetInterpPoint() { return m_InterpPoint; }
53 int GetIndex() { return m_Index; }
54 XYZ GetDisplacement() { return m_StartPoint - m_Point; }
55 int GetInterpIndex() { return m_InterpIndex; }
56
58 bool FindInterpolationNode( CMesh &YarnMesh );
59
61 void FindElements( vector<int> &IndexArray, CMesh::ELEMENT_TYPE ElementType );
62
64 bool MoveNode( CMesh &YarnMesh );
65
67 void AdjustInterpolationNode( CMesh &YarnMesh );
68
70 void FindPolygonPoints( list<int> &Polygons );
71
72 protected:
73
74 double m_Depth;
78 int m_Yarn;
82 bool m_Wedge;
83 vector<ELEMENT_INDICES> m_Elements;
84 int m_PolygonPoints[3];
85 };
86
88
92 {
93 public:
95 virtual ~CAdjustMeshInterference(void);
96
98
102 void AdjustTextileMesh(CTextile &Textile, double Tolerance = 0.0000001);
103
105
110 bool AdjustMesh( CTextile &Textile, vector<CMesh> &YarnMeshes, double Tolerance );
111 vector<XYZ> GetNodeDisplacements( int i ){ return m_NodeDisplacements[i]; }
112
114 void AdjustSectionMeshes(CTextile &Textile, vector<CMesh> &YarnMeshes );
115
116 protected:
117
119 bool CheckInitialIntersections( CTextile &Textile, vector<CMesh> &YarnMeshes );
120
122 bool AdjustInitialIntersections( vector<CMesh> &YarnMeshes );
123
125 void AddIntersectElementsToMesh( const vector<ELEMENT_INDICES> &Elements, int iYarn, CMesh &YarnMesh );
126
128 bool AdjustIntersections( vector<CMesh> &YarnMeshes );
129
130 void SetNodeDisplacements( int iNumYarns, vector<CMesh> &YarnMeshes );
131
133 void AdjustInterpolationNodes( vector<CMesh> &YarnMeshes );
134
136 int FindMeshPolygonSection( vector<XYZ> &SlaveNodePoints, CMesh &TempMesh, vector<int> &PolygonIndices, vector<XYZ> &Translations, int &OffsetIndex, int &iTrans );
137
138 int CompareSections( vector< vector<XYZ> > &TranslatedSections, vector<XYZ> &PolygonPoints, int &iTrans );
139
140 vector<CMeshIntersectionData> m_Intersections;
141 vector<CMesh> m_IntersectionMeshes;
143 vector< vector<XYZ> > m_NodeDisplacements;
144 vector<CMesh> m_TempYarnMeshes;
145 };
146
147
148}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
Class used to adjust small interferences in the fibre volume mesh.
vector< vector< XYZ > > m_NodeDisplacements
vector< CMeshIntersectionData > m_Intersections
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
Class which holds the information related to each intersection point, used for adjusting the mesh.
const vector< ELEMENT_INDICES > & GetElements() const
vector< ELEMENT_INDICES > m_Elements
Represents a textile cell containing yarns.
Definition: Textile.h:39
Namespace containing a series of customised math operations not found in the standard c++ library.
Struct for representing points in 3D space.
Definition: mymath.h:56