32 typedef SSIZE_T ssize_t;
38#include <p4est_to_p8est.h>
40#include <p4est_bits.h>
41#include <p4est_ghost.h>
42#include <p4est_lnodes.h>
44#include <p8est_bits.h>
45#include <p8est_ghost.h>
46#include <p8est_lnodes.h>
47#include <p8est_connectivity.h>
93 void SaveVoxelMesh(
CTextile &Textile,
string OutputFilename,
int XVoxNum,
int YVoxNum,
int ZVoxNum,
int min_level,
int refine_level,
bool smoothing,
int smoothIter,
double smooth1,
double smooth2,
bool surfaceOuput);
105 Point(
int nodeNum,
double x,
double y,
double z) : nodeNum(nodeNum), x(x), y(y), z(z) {}
118 int CreateP4ESTRefinement(
int min_level,
int refine_level);
121 bool CalculateVoxelSizes(
CTextile &Textile);
126 int OutputHexElements(ostream &Output,
bool bOutputMatrix,
bool bOutputYarn,
int Filetype =
INP_EXPORT );
128 void OutputPeriodicBoundaries(ostream &Output,
CTextile& Textile,
int iBoundaryConditions,
bool bMatrixOnly);
130 void ConvertOctreeToNodes();
132 void ConvertHexToTets();
134 int storeHangingNode(
int *all_lni,
int *hanging_corner,
int node_i,
int hanging_count,
double v[3]);
136 void smoothing(
const std::map<
int, vector<int> > &NodeSurf,
const vector<int> &AllSurf);
137 void fillMaterialInfo();
138 int isBoundary(
double p[3]);
140 int checkIndex(
int currentElement, vector<int> nodes);
141 pair<int, vector<int> > GetFaceIndices2(
CMesh::ELEMENT_TYPE ElemType,
const set<int> &NodeIndices,
int currentElement);
143 void storePointInfo(
int refineLevel);
144 static int getPointsInfo(vector<XYZ> myPoints,
int refineLevel);
147 static int refine_fn_uni(p4est_t * p4est, p4est_topidx_t which_tree, p4est_quadrant_t * quadrant);
148 static int refine_fn_periodic(p4est_t * p4est, p4est_topidx_t which_tree, p4est_quadrant_t * quadrant);
149 static int refine_fn_post(p4est_t * p4est, p4est_topidx_t which_tree, p4est_quadrant_t * quadrant);
150 static int refine_fn(p4est_t * p4est, p4est_topidx_t which_tree, p4est_quadrant_t * quadrant);
152 static void FindLocMinMax(
int& XMin,
int& XMax,
int& YMin,
int& YMax,
XYZ&
Min,
XYZ&
Max );
154 void extractSurfaceNodeSets(std::map<
int, vector<int> > &NodeSurf, std::vector<int> &AllSurf);
155 void OutputSurfaces(
const std::map<
int, vector<int> > &NodeSurf,
const std::vector<int> &AllSurf);
156 int writeTempFile(
string filename, pair<XYZ, XYZ> myDomain) ;
ELEMENT_TYPE
Each element type is represented by a unique integer value.
Class used to generate octree-refine voxel mesh for output to ABAQUS.
vector< std::vector< int > > m_AllElements
static vector< vector< int > > FaceZ_max
static vector< vector< int > > FaceX_max
map< int, vector< int > > m_NeighbourNodes
vector< vector< int > > m_TetElements
static vector< XYZ > cornerPoints
static vector< char > materialInfo
static vector< vector< int > > FaceX_min
map< int, vector< pair< int, int > > > m_SurfaceElementFaces
static vector< XYZ > CentrePoints
vector< Point > m_boundaryPoints
static vector< vector< int > > FaceY_min
map< int, vector< int > > m_SurfaceNodes
vector< std::vector< int > > m_OddHexes
map< int, vector< int > > m_NodeConstraints
static pair< XYZ, XYZ > g_DomainAABB
map< int, vector< int > > m_NodesEncounter
static vector< vector< int > > FaceY_max
map< string, int > m_NodeConstraintsReverse
p4est_connectivity_t * conn
static vector< vector< int > > FaceZ_min
map< int, vector< int > > m_ElementMarkup
Represents a textile cell containing yarns.
Class used to generate voxel mesh for output to ABAQUS.
Namespace containing a series of customised math operations not found in the standard c++ library.
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.
Point(int nodeNum, double x, double y, double z)
bool operator<(const Point &o) const
Struct for representing points in 3D space.