TexGen
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
TexGen::CVoxelMesh Class Referenceabstract

Class used to generate voxel mesh for output to ABAQUS. More...

#include <VoxelMesh.h>

Inheritance diagram for TexGen::CVoxelMesh:
Inheritance graph
[legend]

Public Member Functions

 CVoxelMesh (string Type="CPeriodicBoundaries")
 
virtual ~CVoxelMesh (void)
 
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)
 
void AddElementInfo (vector< POINT_INFO > &RowInfo)
 Add a row of element information. More...
 
void OutputOrientationsAndElementSets (string Filename)
 Outputs yarn orientations and element sets to .ori and .eld files. More...
 
CTextileMaterialsGetMaterials ()
 

Protected Member Functions

virtual bool CalculateVoxelSizes (CTextile &Textile)=0
 Calculate voxel size based on number of voxels on each axis and domain size. More...
 
void SaveVoxelMeshToVTK (string Filename, CTextile &Textile)
 Add nodes for whole domain. More...
 
void SaveToAbaqus (string Filename, CTextile &Textile, bool bOutputMatrix, bool bOutputYarn, int iBoundaryConditions, int iElementType)
 
void SaveToSCIRun (string Filename, CTextile &Textile)
 Save voxel mesh in SCIRun .pts and .hex format without boundary conditions. More...
 
virtual void OutputNodes (ostream &Output, CTextile &Textile, int Filetype=INP_EXPORT)=0
 Outputs nodes to .inp file and gets element information. More...
 
virtual int OutputHexElements (ostream &Output, bool bOutputMatrix, bool bOutputYarn, int Filetype=INP_EXPORT)
 Output hex elements to .inp file. More...
 
void OutputOrientationsAndElementSets (string Filename, ostream &Output)
 Outputs yarn orientations and element sets to .ori and .eld files. More...
 
void OutputMatrixElementSet (string Filename, ostream &Output, int iNumHexElements, bool bMatrixOnly)
 Outputs all elements when only outputting matrix. More...
 
void OutputAllNodesSet (string Filename, ostream &Output)
 Output node set containing all nodes. More...
 
virtual void OutputPeriodicBoundaries (ostream &Output, CTextile &Textile, int iBoundaryConditions, bool bMatrixOnly)
 Output periodic boundary conditions to .inp file. More...
 

Protected Attributes

CTextileMaterials m_Materials
 
CMesh m_Mesh
 Find intersections of yarn surfaces with grid of lines from node points in each axis. More...
 
int m_XVoxels
 Number of voxels along x,y and z axes. More...
 
int m_YVoxels
 
int m_ZVoxels
 
pair< XYZ, XYZm_DomainAABB
 Domain limits. More...
 
vector< POINT_INFOm_ElementsInfo
 Element information as calculated by GetPointInformation. More...
 
CPeriodicBoundariesm_PeriodicBoundaries
 

Private Member Functions

 CVoxelMesh (const CVoxelMesh &CopyMe)
 
CVoxelMeshoperator= (const CVoxelMesh &CopyMe)
 

Detailed Description

Class used to generate voxel mesh for output to ABAQUS.

Definition at line 34 of file VoxelMesh.h.

Constructor & Destructor Documentation

◆ CVoxelMesh() [1/2]

CVoxelMesh::CVoxelMesh ( string  Type = "CPeriodicBoundaries")

Definition at line 32 of file VoxelMesh.cpp.

References m_PeriodicBoundaries.

◆ ~CVoxelMesh()

CVoxelMesh::~CVoxelMesh ( void  )
virtual

Definition at line 46 of file VoxelMesh.cpp.

References m_PeriodicBoundaries.

◆ CVoxelMesh() [2/2]

TexGen::CVoxelMesh::CVoxelMesh ( const CVoxelMesh CopyMe)
private

Member Function Documentation

◆ AddElementInfo()

void CVoxelMesh::AddElementInfo ( vector< POINT_INFO > &  RowInfo)

Add a row of element information.

Definition at line 704 of file VoxelMesh.cpp.

References m_ElementsInfo.

◆ CalculateVoxelSizes()

virtual bool TexGen::CVoxelMesh::CalculateVoxelSizes ( CTextile Textile)
protectedpure virtual

Calculate voxel size based on number of voxels on each axis and domain size.

Implemented in TexGen::COctreeVoxelMesh, TexGen::CPrismVoxelMesh, TexGen::CRectangularVoxelMesh, TexGen::CRotatedVoxelMesh, TexGen::CShearedVoxelMesh, and TexGen::CStaggeredVoxelMesh.

Referenced by SaveVoxelMesh().

◆ GetMaterials()

CTextileMaterials & TexGen::CVoxelMesh::GetMaterials ( )
inline

Definition at line 57 of file VoxelMesh.h.

◆ operator=()

CVoxelMesh & TexGen::CVoxelMesh::operator= ( const CVoxelMesh CopyMe)
private

◆ OutputAllNodesSet()

void CVoxelMesh::OutputAllNodesSet ( string  Filename,
ostream &  Output 
)
protected

Output node set containing all nodes.

Definition at line 584 of file VoxelMesh.cpp.

References m_XVoxels, m_YVoxels, and m_ZVoxels.

Referenced by SaveToAbaqus().

◆ OutputHexElements()

int CVoxelMesh::OutputHexElements ( ostream &  Output,
bool  bOutputMatrix,
bool  bOutputYarn,
int  Filetype = INP_EXPORT 
)
protectedvirtual

Output hex elements to .inp file.

\ return Maximum element index

Reimplemented in TexGen::CPrismVoxelMesh, and TexGen::COctreeVoxelMesh.

Definition at line 399 of file VoxelMesh.cpp.

References TexGen::CMesh::AddElement(), TexGen::CMesh::HEX, TexGen::INP_EXPORT, m_ElementsInfo, m_Mesh, m_XVoxels, m_YVoxels, m_ZVoxels, and TexGen::SCIRUN_EXPORT.

Referenced by SaveToAbaqus(), SaveToSCIRun(), and SaveVoxelMeshToVTK().

◆ OutputMatrixElementSet()

void CVoxelMesh::OutputMatrixElementSet ( string  Filename,
ostream &  Output,
int  iNumHexElements,
bool  bMatrixOnly 
)
protected

Outputs all elements when only outputting matrix.

Definition at line 567 of file VoxelMesh.cpp.

Referenced by SaveToAbaqus().

◆ OutputNodes()

virtual void TexGen::CVoxelMesh::OutputNodes ( ostream &  Output,
CTextile Textile,
int  Filetype = INP_EXPORT 
)
protectedpure virtual

◆ OutputOrientationsAndElementSets() [1/2]

void CVoxelMesh::OutputOrientationsAndElementSets ( string  Filename)

Outputs yarn orientations and element sets to .ori and .eld files.

Definition at line 470 of file VoxelMesh.cpp.

References TexGen::AddExtensionIfMissing(), and OutputOrientationsAndElementSets().

Referenced by OutputOrientationsAndElementSets(), and SaveToAbaqus().

◆ OutputOrientationsAndElementSets() [2/2]

void CVoxelMesh::OutputOrientationsAndElementSets ( string  Filename,
ostream &  Output 
)
protected

Outputs yarn orientations and element sets to .ori and .eld files.

Definition at line 478 of file VoxelMesh.cpp.

References TexGen::CrossProduct(), m_ElementsInfo, TexGen::Normalise(), TexGen::StripPath(), TGERROR, TGLOG, TexGen::WriteElementsHeader(), TexGen::WriteOrientationsHeader(), and TexGen::WriteValues().

◆ OutputPeriodicBoundaries()

void CVoxelMesh::OutputPeriodicBoundaries ( ostream &  Output,
CTextile Textile,
int  iBoundaryConditions,
bool  bMatrixOnly 
)
protectedvirtual

◆ SaveToAbaqus()

void CVoxelMesh::SaveToAbaqus ( string  Filename,
CTextile Textile,
bool  bOutputMatrix,
bool  bOutputYarn,
int  iBoundaryConditions,
int  iElementType 
)
protected

◆ SaveToSCIRun()

void CVoxelMesh::SaveToSCIRun ( string  Filename,
CTextile Textile 
)
protected

Save voxel mesh in SCIRun .pts and .hex format without boundary conditions.

Definition at line 358 of file VoxelMesh.cpp.

References OutputHexElements(), OutputNodes(), TexGen::RemoveExtension(), TexGen::SCIRUN_EXPORT, TGERROR, and TGLOG.

◆ SaveVoxelMesh()

void CVoxelMesh::SaveVoxelMesh ( CTextile Textile,
string  OutputFilename,
int  XVoxNum,
int  YVoxNum,
int  ZVoxNum,
bool  bOutputMatrix,
bool  bOutputYarns,
int  iBoundaryConditions,
int  iElementType = 0,
int  FileType = INP_EXPORT 
)
virtual

Save the voxel mesh as an Abaqus input file with periodic boundary conditions

Parameters
CTextileTextile - textile to be exported as refined voxel mesh
stringOutputFilename - filename to save to
intXVoxNum - number of voxels in x direction
intYVoxNum - number of voxels in y direction
intZVoxNum - number of voxels in z direction
bOutputMatrixTrue to output the matrix area of the mesh
bOutputYarnsTrue to output the yarn areas
iBoundaryConditionsas in enum PERIODIC_BOUNDARY_CONDITIONS
iElementType0 for C3D8R, 1 for C3D8
intFiletype as in enum EXPORT_TYPE

Definition at line 51 of file VoxelMesh.cpp.

References CalculateVoxelSizes(), TexGen::CTimer::check(), TexGen::CTextile::GetDomain(), TexGen::INP_EXPORT, m_ElementsInfo, m_XVoxels, m_YVoxels, m_ZVoxels, TexGen::ReplaceFilenameSpaces(), SaveToAbaqus(), SaveVoxelMeshToVTK(), TexGen::CTimer::start(), TexGen::CTimer::stop(), TGERROR, and TGLOG.

Referenced by TexGen::COctreeVoxelMesh::SaveVoxelMesh().

◆ SaveVoxelMeshToVTK()

void CVoxelMesh::SaveVoxelMeshToVTK ( string  Filename,
CTextile Textile 
)
protected

Add nodes for whole domain.

Add hex elements Save voxel mesh in VTK format without boundary conditions

Definition at line 246 of file VoxelMesh.cpp.

References TexGen::AddExtensionIfMissing(), TexGen::CMeshDataBase::ELEMENT, TexGen::CMeshData< T >::m_Data, m_ElementsInfo, m_Mesh, OutputHexElements(), OutputNodes(), TexGen::CMesh::SaveToVTK(), and TexGen::VTU_EXPORT.

Referenced by SaveVoxelMesh().

Member Data Documentation

◆ m_DomainAABB

pair<XYZ, XYZ> TexGen::CVoxelMesh::m_DomainAABB
protected

◆ m_ElementsInfo

vector<POINT_INFO> TexGen::CVoxelMesh::m_ElementsInfo
protected

◆ m_Materials

CTextileMaterials TexGen::CVoxelMesh::m_Materials
protected

Definition at line 60 of file VoxelMesh.h.

Referenced by SaveToAbaqus().

◆ m_Mesh

CMesh TexGen::CVoxelMesh::m_Mesh
protected

Find intersections of yarn surfaces with grid of lines from node points in each axis.

Calculate intersections for one orientation of grid lines Output data with iMaxPerLine elements per line Mesh stored when saving to VTK

Definition at line 112 of file VoxelMesh.h.

Referenced by TexGen::CPrismVoxelMesh::OutputHexElements(), OutputHexElements(), TexGen::CPrismVoxelMesh::OutputNodes(), TexGen::CRectangularVoxelMesh::OutputNodes(), TexGen::CRotatedVoxelMesh::OutputNodes(), TexGen::CShearedVoxelMesh::OutputNodes(), and SaveVoxelMeshToVTK().

◆ m_PeriodicBoundaries

CPeriodicBoundaries* TexGen::CVoxelMesh::m_PeriodicBoundaries
protected

◆ m_XVoxels

int TexGen::CVoxelMesh::m_XVoxels
protected

◆ m_YVoxels

int TexGen::CVoxelMesh::m_YVoxels
protected

◆ m_ZVoxels

int TexGen::CVoxelMesh::m_ZVoxels
protected

The documentation for this class was generated from the following files: