32CStaggeredVoxelMesh::CStaggeredVoxelMesh(
string Type)
53 TGERROR(
"Number of voxels in x direction must be even for staggered boundary conditions");
58 TGERROR(
"Number of x voxels must satisfy N mod (1/offset) = 0 condition");
73 pair< vector<int>, vector<int> > Faces;
78 int xOffsetInd1 = (int)(numx * (1.0 -
m_Offset));
79 int xOffsetInd2 = (int)(numx *
m_Offset);
83 for (
int z = 1; z < numz-1; ++z )
85 for (
int x = 1; x < xOffsetInd1; ++x )
87 GroupA.push_back( 1 + x + z*numx*numy );
89 for (
int x = xOffsetInd1+1; x < numx-1; ++x )
91 GroupB.push_back( 1 + x + z*numx*numy );
98 for (
int z = 1; z < numz-1; ++z )
100 for (
int x = 1; x < xOffsetInd2; ++x )
102 GroupA.push_back( 1 + x + z*numx*numy + numx*(numy-1) );
104 for (
int x = xOffsetInd2+1; x < numx-1; ++x )
106 GroupB.push_back( 1 + x + z*numx*numy + numx*(numy-1) );
113 for (
int z = 1; z < numz-1; ++z )
115 for (
int y = 1; y < numy-1; ++y )
117 GroupA.push_back( y*numx + z*numx*numy + 1);
118 GroupB.push_back( numx-1 + y*numx + z*numx*numy +1 );
127 for (
int y = 1; y < numy-1; ++y )
129 for (
int x = 1; x < numx-1; ++x )
131 GroupA.push_back( x + y*numx + 1 );
132 GroupB.push_back( x + y*numx + (numz-1)*numx*numy + 1);
139 vector<int> Edges[18];
141 for (
int z = 1; z < numz-1; ++z )
143 Edges[17].push_back( z*numx*numy + 1 );
144 Edges[15].push_back( numx*(numy-1) + z*numx*numy +1 );
145 Edges[14].push_back( (z+1)*numx*numy );
146 Edges[16].push_back( numx + z*numx*numy );
149 for (
int y = 1; y < numy-1; ++y )
151 Edges[7].push_back( y*numx + (numz-1)*numx*numy + 1 );
152 Edges[6].push_back( (y+1)*numx +(numz-1)*numx*numy );
153 Edges[0].push_back( (y+1)*numx );
154 Edges[1].push_back( y*numx + 1 );
157 for (
int x = 1; x < xOffsetInd1; ++x )
159 Edges[9].push_back( x + (numz-1)*numx*numy + 1 );
160 Edges[3].push_back( x + 1 );
162 for (
int x = xOffsetInd1+1; x < numx-1; ++x )
164 Edges[11].push_back( x + (numz-1)*numx*numy + 1 );
165 Edges[5].push_back( x + 1 );
168 for (
int z = 1; z < numz-1; ++z)
170 Edges[12].push_back( 1 + xOffsetInd1 + z*numx*numy);
171 Edges[13].push_back( 1 + xOffsetInd2 + z*numx*numy + numx*(numy-1) );
174 for (
int x = 1; x < xOffsetInd2; ++x )
176 Edges[10].push_back( x + numx*(numy-1) + (numz-1)*numx*numy +1 );
177 Edges[4].push_back( x + numx*(numy-1) + 1 );
179 for (
int x = xOffsetInd2+1; x < numx-1; ++x )
181 Edges[8].push_back( x + numx*(numy-1) + (numz-1)*numx*numy +1 );
182 Edges[2].push_back( x + numx*(numy-1) + 1 );
185 for (
int i = 0; i < 18; ++i )
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
const CMesh & GetMesh() const
Get the mesh representing the domain as a surface mesh.
virtual void SetFaceD(vector< int > &D1, vector< int > &D2)
void SetFaceB(vector< int > &B1, vector< int > &B2)
void CreatePeriodicBoundaries(ostream &Output, int iDummyNodeNum, CTextile &Textile, int iBoundarConditions, bool bMatrixOnly)
virtual void SetOffset(double Offset)
void SetEdges(vector< int > &Edge)
virtual void SetDomainSize(const CMesh &Mesh)
void SetVertex(int Vertex)
void SetFaceA(vector< int > &A1, vector< int > &A2)
void SetFaceC(vector< int > &C1, vector< int > &C2)
Class used to generate voxel mesh for output to ABAQUS.
bool CalculateVoxelSizes(CTextile &Textile)
Calculate voxel size based on number of voxels on each axis and domain size.
void SetOffset(double Offset)
void OutputPeriodicBoundaries(ostream &Output, CTextile &Textile, int iBoundaryConditions, bool bMatrixOnly)
Output periodic boundary conditions to .inp file.
bool CalculateVoxelSizes(CTextile &Textile)
Calculate voxel size based on number of voxels on each axis and domain size.
virtual ~CStaggeredVoxelMesh(void)
Represents a textile cell containing yarns.
const CDomain * GetDomain() const
int m_XVoxels
Number of voxels along x,y and z axes.
CPeriodicBoundaries * m_PeriodicBoundaries
Namespace containing a series of customised math operations not found in the standard c++ library.