30CPrismVoxelMesh::CPrismVoxelMesh(
string Type)
65 vector<XYZ> CentrePoints;
66 vector<POINT_INFO> RowInfo;
85 Output << iNodeIndex <<
", ";
86 Output << Point <<
"\n";
104 CentrePoints.push_back(Point);
114 CentrePoints.clear();
123 vector<XY> PrismPoints = Domain->
GetPoints();
130 Point.
y =
Min.
y + 0.5*ZSize;
133 Point.
x =
Min.
x + 0.5*XSize;
154 vector<POINT_INFO>::iterator itElementInfo =
m_ElementsInfo.begin();
155 int iElementNumber = 1;
157 vector<POINT_INFO> NewElementInfo;
170 if ((itElementInfo->iYarnIndex == -1 && bOutputMatrix)
171 || (itElementInfo->iYarnIndex >= 0 && bOutputYarn))
175 Output << iElementNumber <<
", ";
176 Output << (x + 1) + y*numx + z*numx*numy + 1 <<
", " << (x + 1) + (y + 1)*numx + z*numx*numy + 1 <<
", ";
177 Output << x + (y + 1)*numx + z*numx*numy + 1 <<
", " << x + y*numx + z*numx*numy + 1 <<
", ";
178 Output << (x + 1) + y*numx + (z + 1)*numx*numy + 1 <<
", " << (x + 1) + (y + 1)*numx + (z + 1)*numx*numy + 1 <<
", ";
179 Output << x + (y + 1)*numx + (z + 1)*numx*numy + 1 <<
", " << x + y*numx + (z + 1)*numx*numy + 1 <<
"\n";
183 Output << x + y*numx + z*numx*numy + 1 <<
", " << (x + 1) + y*numx + z*numx*numy + 1 <<
", ";
184 Output << x + y*numx + (z + 1)*numx*numy + 1 <<
", " << (x + 1) + y*numx + (z + 1)*numx*numy + 1 <<
", ";
185 Output << x + (y + 1)*numx + z*numx*numy + 1 <<
", " << (x + 1) + (y + 1)*numx + z*numx*numy + 1 <<
", ";
186 Output << x + (y + 1)*numx + (z + 1)*numx*numy + 1 <<
", " << (x + 1) + (y + 1)*numx + (z + 1)*numx*numy + 1 <<
"\n";
191 Indices.push_back(x + y*numx + z*numx*numy);
192 Indices.push_back((x + 1) + y*numx + z*numx*numy);
193 Indices.push_back((x + 1) + y*numx + (z + 1)*numx*numy);
194 Indices.push_back(x + y*numx + (z + 1)*numx*numy);
195 Indices.push_back(x + (y + 1)*numx + z*numx*numy);
196 Indices.push_back((x + 1) + (y + 1)*numx + z*numx*numy);
197 Indices.push_back((x + 1) + (y + 1)*numx + (z + 1)*numx*numy);
198 Indices.push_back(x + (y + 1)*numx + (z + 1)*numx*numy);
202 if (bOutputYarn && !bOutputMatrix)
204 NewElementInfo.push_back(*itElementInfo);
214 if (bOutputYarn && !bOutputMatrix)
219 return (iElementNumber - 1);
CDomainPrism * GetPrismDomain()
Domain implementation described using extrusion of a polygon outline.
const vector< XY > & GetPoints() const
void GetPolygonLimits(XYZ &StartPoint, XYZ *SizeVecs)
bool AddElement(ELEMENT_TYPE Type, const vector< int > &Indices)
Add an element to the mesh of given type with node number checking.
const int AddNode(XYZ Node)
Append a node to the list of nodes, the integer returns the index of the node
virtual ~CPrismVoxelMesh(void)
map< pair< int, int >, bool > m_ElementMap
Map of x,z elements within prism polygon.
void OutputNodes(ostream &Output, CTextile &Textile, int Filetype=INP_EXPORT)
Outputs nodes to .inp file and gets element information.
bool CalculateVoxelSizes(CTextile &Textile)
Calculate voxel size based on number of voxels on each axis and domain size.
XYZ m_StartPoint
Reference point for generating voxel grid (Point 0 of domain mesh)
int OutputHexElements(ostream &Output, bool bOutputMatrix, bool bOutputYarn, int Filetype)
Outputs hex elements for the elements in the element map.
void GetElementMap(CTextile &Textile)
Creates a map of elements which are within the prism outline.
XYZ m_RotatedVoxSize[3]
x, y, z lengths of rotated voxels
int m_NumElements
Number of elements in x-z slice which are output.
Represents a textile cell containing yarns.
const CDomain * GetDomain() const
void GetPointInformation(const vector< XYZ > &Points, vector< POINT_INFO > &PointsInfo, double dTolerance=1e-9)
Get useful information of a list of points.
Class used to generate voxel mesh for output to ABAQUS.
int m_XVoxels
Number of voxels along x,y and z axes.
vector< POINT_INFO > m_ElementsInfo
Element information as calculated by GetPointInformation.
CMesh m_Mesh
Find intersections of yarn surfaces with grid of lines from node points in each axis.
Namespace containing a series of customised math operations not found in the standard c++ library.
void GetMinMaxXY(const std::vector< XY > &Points, XY &Min, XY &Max)
bool PointInside(const XY &Point, const std::vector< XY > &Nodes)
double Max(XYZ &Vector)
Get maximum element of vector and return it.
XYZ Min(const XYZ &P1, const XYZ &P2)
Given two points, return a new point who's coordinates are the smaller of the two.
Struct for representing points in 2D space.
Struct for representing points in 3D space.