TexGen
VoxelMesh.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 "Materials.h"
24
25namespace TexGen
26{
27 using namespace std;
28
29 class CTextile;
30 class CPeriodicBoundaries;
31 class CMaterials;
32
35 {
36 public:
37 CVoxelMesh(string Type = "CPeriodicBoundaries");
38 virtual ~CVoxelMesh(void);
51 virtual void SaveVoxelMesh(CTextile &Textile, string OutputFilename, int XVoxNum, int YVoxNum, int ZVoxNum, bool bOutputMatrix, bool bOutputYarns, int iBoundaryConditions, int iElementType = 0, int FileType = INP_EXPORT);
53 void AddElementInfo(vector<POINT_INFO> &RowInfo);
55 void OutputOrientationsAndElementSets( string Filename );
56
57 CTextileMaterials& GetMaterials() { return m_Materials; }
58
59 protected:
61
62 private:
63 CVoxelMesh( const CVoxelMesh& CopyMe ); // Shouldn't need to copy - implement if need arises
64 CVoxelMesh& operator=( const CVoxelMesh& CopyMe );
65
66 protected:
67
69 virtual bool CalculateVoxelSizes(CTextile &Textile) = 0;
70
72 //void AddNodes();
74 //void AddElements();
76 void SaveVoxelMeshToVTK(string Filename, CTextile &Textile);
79 void SaveToAbaqus( string Filename, CTextile &Textile, bool bOutputMatrix, bool bOutputYarn, int iBoundaryConditions, int iElementType );
81 void SaveToSCIRun( string Filename, CTextile &Textile );
83 virtual void OutputNodes(ostream &Output, CTextile &Textile, int Filetype = INP_EXPORT) = 0;
84
86
89 virtual int OutputHexElements(ostream &Output, bool bOutputMatrix, bool bOutputYarn, int Filetype = INP_EXPORT );
90
91
93 void OutputOrientationsAndElementSets( string Filename, ostream &Output );
95 void OutputMatrixElementSet( string Filename, ostream &Output, int iNumHexElements, bool bMatrixOnly );
97 void OutputAllNodesSet( string Filename, ostream &Output );
99 virtual void OutputPeriodicBoundaries(ostream &Output, CTextile& Textile, int iBoundaryConditions, bool bMatrixOnly);
100
101 //void OutputSets( ostream& Output, vector<int>& GroupA, vector<int>& GroupB, int i, int iDummyNodeNum );
103 //void GetYarnGridIntersections( CTextile &Textile );
105 //void CalculateIntersections( CMesh &Mesh, vector<pair<XYZ,XYZ> > &Lines, int YarnIndex, vector<vector<pair<int, double> > > &Intersections);
106
107 //template <typename T>
109 //static void WriteValues(ostream &Output, T &Values, int iMaxPerLine);
110
113
118
119
121 pair<XYZ, XYZ> m_DomainAABB;
123 vector<POINT_INFO> m_ElementsInfo;
124
125 //CObjectContainer<CPeriodicBoundaries> m_PeriodicBoundaries;
127 };
128}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
Defines the nodes and elements of a surface or volume mesh.
Definition: Mesh.h:58
Class used to generate Abaqus output for periodic boundary conditions.
Represents a textile cell containing yarns.
Definition: Textile.h:39
Class used to generate voxel mesh for output to ABAQUS.
Definition: VoxelMesh.h:35
CVoxelMesh(const CVoxelMesh &CopyMe)
pair< XYZ, XYZ > m_DomainAABB
Domain limits.
Definition: VoxelMesh.h:121
int m_XVoxels
Number of voxels along x,y and z axes.
Definition: VoxelMesh.h:115
virtual void OutputNodes(ostream &Output, CTextile &Textile, int Filetype=INP_EXPORT)=0
Outputs nodes to .inp file and gets element information.
CTextileMaterials m_Materials
Definition: VoxelMesh.h:60
virtual bool CalculateVoxelSizes(CTextile &Textile)=0
Calculate voxel size based on number of voxels on each axis and domain size.
CPeriodicBoundaries * m_PeriodicBoundaries
Definition: VoxelMesh.h:126
vector< POINT_INFO > m_ElementsInfo
Element information as calculated by GetPointInformation.
Definition: VoxelMesh.h:123
CVoxelMesh & operator=(const CVoxelMesh &CopyMe)
CMesh m_Mesh
Find intersections of yarn surfaces with grid of lines from node points in each axis.
Definition: VoxelMesh.h:112
CTextileMaterials & GetMaterials()
Definition: VoxelMesh.h:57
Namespace containing a series of customised math operations not found in the standard c++ library.
@ INP_EXPORT
Definition: Misc.h:113