31CSimulationAbaqus::CSimulationAbaqus(
void)
33, m_bIncludePlates(false)
34, m_dInitialPlateGap(0)
35, m_bWholeSurfaces(false)
47 TGLOG(
"Replacing spaces in filename with underscore for ABAQUS compatibility");
56 TGERROR(
"Unable to create ABAQUS input file: No domain specified");
63 TGERROR(
"Unable to create ABAQUS input file: Failed to create volume mesh for yarns ");
68 map<string, vector<ELEMENT_FACE> > SurfaceDefinitions;
70 if ( !bRegenerateMesh )
76 vector<POINT_INFO> YarnElementInfo;
77 vector< vector<POINT_INFO> > YarnElementTypesInfo;
83 TGLOG(
"Adjusting mesh");
89 if ( bRegenerateMesh )
91 TGLOG(
"Regenerating mesh using adjusted points");
97 TGERROR(
"Unable to create ABAQUS input file: Failed to create volume mesh for yarns ");
101 SurfaceDefinitions.clear();
109 vector<POINT_INFO> ElementsInfo;
110 TGLOG(
"Getting point information");
113 for ( i = 0; i < iNumYarns; ++i )
119 YarnElementInfo.clear();
122 YarnElementTypesInfo.push_back( YarnElementInfo );
126 YarnElementTypesInfo[j].insert( YarnElementTypesInfo[j].end(), YarnElementInfo.begin(), YarnElementInfo.end() );
130 vector< vector<POINT_INFO> >::iterator itYarnElementTypesInfo;
131 for ( itYarnElementTypesInfo = YarnElementTypesInfo.begin(); itYarnElementTypesInfo != YarnElementTypesInfo.end(); ++itYarnElementTypesInfo )
133 ElementsInfo.insert( ElementsInfo.end(), itYarnElementTypesInfo->begin(), itYarnElementTypesInfo->end() );
136 vector<SECTION_VF_DATA> VolFractionData;
138 for(i=0; i<iNumYarns; ++i)
142 if ( bAdjustMesh && !bRegenerateMesh )
144 TGLOG(
"Recalculating volume fractions for adjusted mesh");
161 if ( bAdjustMesh && !bRegenerateMesh)
163 vector<SECTION_VF_DATA> MidVFData;
168 TGLOG(
"Saving to ABAQUS");
172 ofstream Output(Filename.c_str(), ios::app);
175 TGLOG(
"Creating materials");
177 TGLOG(
"Creating surfaces");
181 TGLOG(
"Creating compression plates");
185 vector<int> YarnCenterNodes;
187 for (i=0; i<iNumYarns; ++i)
192 YarnCenterNodes.push_back(iNodeIndex);
196 TGLOG(
"Creating periodic boundaries");
198 vector<CLinearTransformation>::iterator itDeformation;
201 TGLOG(
"Creating step");
204 TGLOG(
"Creating contacts");
210 TGLOG(
"Completed ABAQUS input file");
219 for (
int i=0; i<iNumYarns; ++i)
221 TGLOG(
"Creating yarn " << i <<
" surface definitions");
224 vector<ELEMENT_FACE> Faces;
226 SurfaceDefinitions[
"YarnSurf" +
stringify(i)] = Faces;
230 vector<ELEMENT_FACE> UpperFaces, LowerFaces;
232 SurfaceDefinitions[
"Yarn" +
stringify(i) +
"Lower"] = LowerFaces;
233 SurfaceDefinitions[
"Yarn" +
stringify(i) +
"Upper"] = UpperFaces;
242 CMesh SurfaceMesh = VolumeMesh;
248 set<int> BoundaryNodes;
249 vector<XYZ>::const_iterator itRepeat;
250 for (itRepeat=Repeats.begin(); itRepeat!=Repeats.end(); ++itRepeat)
252 vector<pair<int, int> > NodePairs;
254 vector<pair<int, int> >::iterator itNodePair;
255 for (itNodePair = NodePairs.begin(); itNodePair != NodePairs.end(); ++itNodePair)
257 BoundaryNodes.insert(itNodePair->first);
258 BoundaryNodes.insert(itNodePair->second);
263 int i, iType, iBoundaryNodes;
264 list<int>::iterator itIndex;
272 list<int> &Indices = SurfaceMesh.
GetIndices(Type);
273 for (itIndex = Indices.begin(); itIndex != Indices.end(); )
275 vector<int> ElemIndices;
279 iBoundaryNodes += (int)BoundaryNodes.count(*itIndex);
280 ElemIndices.push_back(*itIndex);
284 if (iBoundaryNodes != (
int)ElemIndices.size())
294 UpperFaces.push_back(Face);
298 LowerFaces.push_back(Face);
312 CMesh SurfaceMesh = VolumeMesh;
320 set<int> BoundaryNodes;
321 vector<XYZ>::const_iterator itRepeat;
322 for (itRepeat=Repeats.begin(); itRepeat!=Repeats.end(); ++itRepeat)
324 vector<pair<int, int> > NodePairs;
326 vector<pair<int, int> >::iterator itNodePair;
327 for (itNodePair = NodePairs.begin(); itNodePair != NodePairs.end(); ++itNodePair)
329 BoundaryNodes.insert(itNodePair->first);
330 BoundaryNodes.insert(itNodePair->second);
335 int i, iType, iBoundaryNodes;
336 list<int>::iterator itIndex;
344 list<int> &Indices = SurfaceMesh.
GetIndices(Type);
345 for (itIndex = Indices.begin(); itIndex != Indices.end(); )
347 vector<int> ElemIndices;
351 iBoundaryNodes += (int)BoundaryNodes.count(*itIndex);
352 ElemIndices.push_back(*itIndex);
356 if (iBoundaryNodes != (
int)ElemIndices.size())
359 Faces.push_back(Face);
373 list<int>::iterator itIndex;
374 int i, iElementIndex, iType;
380 list<int> &Indices = VolumeMesh.
GetIndices(Type);
381 for (itIndex = Indices.begin(), iElementIndex=0; itIndex != Indices.end(); ++iElementIndex)
383 vector<int> VolIndices;
386 VolIndices.push_back(*(itIndex++));
389 if (CommonIndices.size() == SurfIndices.size())
412 if (NodeIndices.count(0) && NodeIndices.count(1) && NodeIndices.count(2) && NodeIndices.count(3))
414 if (NodeIndices.count(4) && NodeIndices.count(5) && NodeIndices.count(6) && NodeIndices.count(7))
416 if (NodeIndices.count(0) && NodeIndices.count(1) && NodeIndices.count(4) && NodeIndices.count(5))
418 if (NodeIndices.count(1) && NodeIndices.count(2) && NodeIndices.count(5) && NodeIndices.count(6))
420 if (NodeIndices.count(2) && NodeIndices.count(3) && NodeIndices.count(6) && NodeIndices.count(7))
422 if (NodeIndices.count(3) && NodeIndices.count(0) && NodeIndices.count(7) && NodeIndices.count(4))
428 if (NodeIndices.count(0) && NodeIndices.count(1) && NodeIndices.count(2))
430 if (NodeIndices.count(3) && NodeIndices.count(4) && NodeIndices.count(5))
432 if (NodeIndices.count(0) && NodeIndices.count(1) && NodeIndices.count(3) && NodeIndices.count(4))
434 if (NodeIndices.count(1) && NodeIndices.count(2) && NodeIndices.count(4) && NodeIndices.count(5))
436 if (NodeIndices.count(2) && NodeIndices.count(0) && NodeIndices.count(5) && NodeIndices.count(3))
447 vector<int>::const_iterator itSurf;
448 vector<int>::const_iterator itVol;
450 for (itSurf = SurfIndices.begin(); itSurf != SurfIndices.end(); ++itSurf)
452 for (itVol = VolIndices.begin(), i=0; itVol != VolIndices.end(); ++itVol, ++i)
454 if (*itSurf == *itVol)
474 int iElemIndexOffset = 0;
479 for (i=0; i<iNumYarns; ++i)
482 iElemIndexOffset +=
m_YarnMeshes[i].GetNumElements(Type);
486 int iNodeIndexOffset = 0;
487 for (i=0; i<iNumYarns; ++i)
511 string ElementDataFilename = Filename;
512 ElementDataFilename.replace(ElementDataFilename.end()-4, ElementDataFilename.end(),
".eld");
513 Output <<
"*****************" << endl;
514 Output <<
"*** MATERIALS ***" << endl;
515 Output <<
"*****************" << endl;
521 for (itMaterial = Materials.begin(); itMaterial != Materials.end(); ++itMaterial)
523 Output <<
"*Material, Name=" << itMaterial->first << endl;
524 if ( itMaterial->second.first->GetConstants().size() == 2 )
525 Output << itMaterial->second.first->GetAbaqusCommands();
527 Output << itMaterial->second.first->GetAbaqusCommands(
"ENGINEERING CONSTANTS" );
528 Output <<
"*Damping, alpha= 3.75e+6" << endl;
529 Output <<
"*Density" << endl;
530 Output <<
"1.37e-09," << endl;
531 Output <<
"*DepVar" << endl;
532 Output <<
"5" << endl;
536 for (i = 0; i < iNumYarns; ++i)
538 if (MaterialAssignements.count(i))
539 MatName = MaterialAssignements[i];
541 MatName = Materials.begin()->first;
542 Output <<
"*Solid Section, ElSet=Yarn" << i <<
", Material=" << MatName <<
", Orientation=TexGenOrientations, controls=HourglassEnhanced" << endl;
543 Output <<
"1.0," << endl;
546 Output <<
"*Section Controls, Name=HourglassEnhanced, Hourglass=Enhanced, SECOND ORDER ACCURACY=YES" << endl;
547 Output <<
"** Note: Additional element data are stored as a depvars:" << endl;
549 Output <<
"*Initial Conditions, Type=Solution, Input=" <<
StripPath(ElementDataFilename) << endl;
555 Output <<
"***************************" << endl;
556 Output <<
"*** SURFACE DEFINITIONS ***" << endl;
557 Output <<
"***************************" << endl;
558 vector<ELEMENT_FACE>::iterator itFace;
560 map<string, vector<ELEMENT_FACE> >::iterator itSurfDef;
562 for (itSurfDef = SurfaceDefinitions.begin(); itSurfDef != SurfaceDefinitions.end(); ++itSurfDef)
564 Output <<
"*Surface, Name=" << itSurfDef->first <<
", Type=Element" << endl;
565 for (itFace = itSurfDef->second.begin(); itFace != itSurfDef->second.end(); ++itFace)
575 Output <<
"***************************" << endl;
576 Output <<
"*** CONTACT DEFINITIONS ***" << endl;
577 Output <<
"***************************" << endl;
587 Output <<
"*** WARNING: Contacts are only created for upper and lower surfaces." << endl;
588 Output <<
"*** Any contacts between binder yarns and sides of warp and weft" << endl;
589 Output <<
"*** yarns must be specified manually" << endl;
594 Output <<
"*** WARNING: TexGen was unable to create contact definitions automatically" << endl;
595 Output <<
"*** because the textile is not of type CTextileWeave" << endl;
601 Output <<
"*Surface Interaction, Name=Plate" << endl;
625 set<pair<int, int> > Contacts;
631 const vector<PATTERN2D> &Cell = Weave.
GetCell(i, j);
632 for (k=1; k<(int)Cell.size(); ++k)
645 set<pair<int, int> > Contacts;
651 const vector<PATTERN3D> &Cell = Weave.
GetCell(i, j);
652 for (k=1; k<(int)Cell.size(); ++k)
664 set<pair<int, int> >::iterator itContact;
665 for (itContact = Contacts.begin(); itContact != Contacts.end(); ++itContact)
669 "YarnSurf" +
stringify(itContact->second) ,
"Yarn");
672 "Yarn" +
stringify(itContact->second) +
"Lower",
"Yarn");
678 Output <<
"**************************" << endl;
679 Output <<
"*** COMPRESSION PLATES ***" << endl;
680 Output <<
"**************************" << endl;
682 vector<CMesh>::iterator itMesh;
683 pair<XYZ, XYZ> YarnAABB;
684 pair<XYZ, XYZ> TextileAABB;
690 TextileAABB = YarnAABB;
694 TextileAABB.first =
Min(TextileAABB.first, YarnAABB.first);
695 TextileAABB.second =
Max(TextileAABB.second, YarnAABB.second);
698 double dWidth = TextileAABB.second.x-TextileAABB.first.x;
699 double dMinX = TextileAABB.first.x - dWidth;
700 double dMaxX = TextileAABB.second.x + dWidth;
702 int i, iDummyNodeNum;
713 GeneratorDir =
XYZ(0, -1, 0);
718 Name =
"BottomPlate";
720 GeneratorDir =
XYZ(0, 1, 0);
724 Output <<
"*Node" << endl;
725 Output << iDummyNodeNum <<
", 0, 0, " << dZ << endl;
726 Output <<
"*NSet, NSet=" << Name << endl;
727 Output << iDummyNodeNum << endl;
728 Output <<
"*Surface, Type=Cylinder, Name=" << Name << endl;
729 Output <<
"0, 0, 0, 1, 0, 0" << endl;
730 Output << GeneratorDir << endl;
731 Output <<
"Start, " << dMinX <<
", " << dLocalY << endl;
732 Output <<
"Line, " << dMaxX <<
", " << dLocalY << endl;
733 Output <<
"*Rigid Body, Analytical Surface=" << Name <<
", Ref Node=" << Name << endl;
739 pair<XYZ, XYZ> AABB = Mesh.
GetAABB();
741 XYZ Center = 0.5*(AABB.first + AABB.second);
749 Output <<
"************************************" << endl;
750 Output <<
"*** PERIODIC BOUNDARY CONDITIONS ***" << endl;
751 Output <<
"************************************" << endl;
753 vector<pair<int, int> > NodePairs;
757 vector<XYZ> DomainSize;
758 DomainSize.push_back(
XYZ(DomainAABB.second.x - DomainAABB.first.x, 0,0));
759 DomainSize.push_back(
XYZ(0, DomainAABB.second.y - DomainAABB.first.y, 0));
760 DomainSize.push_back(
XYZ(0, 0, DomainAABB.second.z - DomainAABB.first.z));
762 for ( i = 0; i < (int)DomainSize.size(); ++i )
766 if ( NodePairs.size() > 0 )
770 Output <<
"*Node" << endl;
771 Output << iDummyNodeNum <<
", 0, 0, 0" << endl;
772 Output <<
"*NSet, NSet=Dummy" << i << endl;
773 Output << iDummyNodeNum << endl;
776 Output <<
"*Equation\n3\n";
777 Output <<
"Bound" << i <<
"A, " << j+1 <<
", 1.0, Bound" << i <<
"B, " << j+1 <<
", -1.0, Dummy" << i <<
", " << j+1 <<
", 1.0" << endl;
784 Output <<
"*** Nodes containing domain AABB ***" << endl;
785 Output <<
"*Node" << endl;
786 Output << ++
m_iTotalNumNodes <<
", " << Domain.first.x <<
", " << Domain.first.y <<
", " << Domain.first.z << endl;
787 Output << ++
m_iTotalNumNodes <<
", " << Domain.second.x <<
", " << Domain.second.y <<
", " << Domain.second.z << endl;
788 Output <<
"*NSet, NSet=Domain" << endl;
794 Output <<
"************" << endl;
795 Output <<
"*** INTERACTION PROPERTIES ***" << endl;
796 Output <<
"************" << endl;
797 Output <<
"*Surface Interaction, name=YARN" << endl;
798 Output <<
"*Friction" << endl;
799 Output <<
"0.112," << endl;
800 Output <<
"*Surface Behavior, pressure-overclosure=HARD" << endl;
802 Output <<
"************" << endl;
803 Output <<
"*** STEP ***" << endl;
804 Output <<
"************" << endl;
805 Output <<
"*Step, NLGeom=Yes" << endl;
806 Output <<
"*Dynamic, Explicit" << endl;
807 Output <<
",2.5e-5" << endl;
808 Output <<
"*Bulk Viscosity" << endl;
809 Output <<
"0.06, 1.2" << endl;
816 Output <<
"*Output, History, Variable=PRESELECT" << endl;
817 Output <<
"*Output, Field, Variable=PRESELECT" << endl;
818 Output <<
"*Element Output" << endl;
819 Output <<
"SDV" << endl;
823 Output <<
"*Boundary" << endl;
824 Output <<
"*Amplitude, name=Amp-1" << endl;
825 Output <<
"0., 0., 2.5e-05, 1." << endl;
826 Output <<
"*Boundary, amplitude=Amp-1" << endl;
827 Output <<
"*** Constrain the nodes closest to the geometrical center of each yarns" << endl;
829 XYZ Position, Displacement;
830 vector<int>::const_iterator itCenterNode;
832 for (itCenterNode = YarnCenterNodes.begin(); itCenterNode != YarnCenterNodes.end(); ++itCenterNode)
835 Displacement = Deformation * Position - Position;
838 Output << (*itCenterNode)+1 <<
", " << j+1 <<
", " << j+1 <<
", " << Displacement[j] << endl;
843 Output <<
"*** Constrain the plates" << endl;
848 Output <<
"TopPlate" <<
", " << j+1 <<
", " << j+1 <<
", " << TopDisp[j] << endl;
849 Output <<
"BottomPlate" <<
", " << j+1 <<
", " << j+1 <<
", " << BottomDisp[j] << endl;
851 Output <<
"TopPlate" <<
", 4, 6, 0" << endl;
852 Output <<
"BottomPlate" <<
", 4, 6, 0" << endl;
855 Output <<
"*** Apply the repeat vector constraints" << endl;
856 for (i=0; i<(int)Repeats.size(); ++i)
858 Relative = Deformation * Repeats[i] - Repeats[i];
861 Output <<
"Dummy" << i <<
", " << j+1 <<
", " << j+1 <<
", " << Relative[j] << endl;
864 Output <<
"*End Step" << endl;
868 Output <<
"*Contact Pair, Interaction=" << InteractionName << endl;
869 Output << Name1 <<
", " << Name2 << endl;
873 vector<pair<int, int> >::const_iterator itPair;
876 for (itPair = NodePairs.begin(); itPair != NodePairs.end(); ++itPair)
878 GroupA.push_back(itPair->first);
879 GroupB.push_back(itPair->second);
890 Output <<
"*NSet, NSet=" << Name;
893 Output <<
"*ElSet, ElSet=" << Name;
898 Output <<
", Unsorted";
904 vector<int>::iterator itIndex;
905 for (itIndex = Indices.begin(); itIndex != Indices.end(); ++itIndex)
941 vector<int>::iterator itSection;
944 for ( itSection = Section.begin(); itSection != Section.end(); ++itSection )
946 Points.push_back( Mesh.
GetNode( *itSection ) );
949 int iNumNodes = (int)Points.size()-1;
950 Points.push_back( Points[1] );
952 double an, ax, ay, az;
953 XYZ Normal =
CrossProduct( (Points[0] - Points[1]), (Points[2] - Points[1]) );
970 if (ax > az) coord = 1;
972 else if (ay > az) coord = 2;
975 for (i=1, j=2, k=0; i<=iNumNodes; i++, j++, k++)
978 area += (Points[i].y * (Points[j].z - Points[k].z));
981 area += (Points[i].x * (Points[j].z - Points[k].z));
984 area += (Points[i].x * (Points[j].y - Points[k].y));
1007 double dVolumeFraction;
1012 if (dFibreArea == 0)
1018 dVolumeFraction = -1;
1020 return dVolumeFraction;
1025 vector<SECTION_VF_DATA>::iterator itData;
1028 for ( itData = VFData.begin(); itData != VFData.end(); ++itData )
1030 if ( itData == VFData.begin())
1032 PrevData = *(itData);
1038 Data.
iMax = itData->iMax;
1040 VFMidData.push_back( Data );
1041 PrevData = *(itData);
1048 list<int>::const_iterator itIndex;
1049 vector<SECTION_VF_DATA>::iterator itData;
1050 int i, ElementIndex = 0;
1054 if ( iNumNodes != -1 )
1058 vector<int> Indices;
1060 for ( j = 0; j < iNumNodes; ++j )
1062 Indices.push_back( *(itIndex++) );
1065 for ( itData = MidVFData.begin(); itData != MidVFData.end(); ++itData )
1068 vector<int>::iterator itIndices;
1069 for ( itIndices = Indices.begin(); itIndices != Indices.end(); ++itIndices )
1072 if ( *itIndices < itData->iMin || *itIndices > itData->iMax )
1076 if ( iNum == iNumNodes )
1078 ElementsInfo[ElementIndex++].dVolumeFraction = itData->dVolumeFraction;
1091 list<int>::iterator itInt;
1092 for ( itInt = PolygonIndices.begin(); itInt != PolygonIndices.end(); )
1095 vector<int> Section;
1097 int StartIndex = *(itInt);
1099 VolFData.
iMin = VolFData.
iMax = StartIndex;
1103 if ( *(itInt) < VolFData.
iMin )
1104 VolFData.
iMin = *(itInt);
1105 if ( *(itInt) > VolFData.
iMax )
1106 VolFData.
iMax = *(itInt);
1107 Section.push_back( *(itInt++) );
1108 }
while ( *(itInt)!= StartIndex );
1110 if ( *(itInt) < VolFData.
iMin )
1111 VolFData.
iMin = *(itInt);
1112 if ( *(itInt) > VolFData.
iMax )
1113 VolFData.
iMax = *(itInt);
1114 Section.push_back( *(itInt++) );
1120 VolFractionData.push_back( VolFData );
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
Class used to adjust small interferences in the fibre volume mesh.
void AdjustSectionMeshes(CTextile &Textile, vector< CMesh > &YarnMeshes)
Adjust yarns to interpolate between section meshes and change these to reflect intersection adjustmen...
bool AdjustMesh(CTextile &Textile, vector< CMesh > &YarnMeshes, double Tolerance)
Top level function to adjust nodes on all yarns.
Abstract base class representing the domain in which a textile cell may lie.
const CMesh & GetMesh() const
Get the mesh representing the domain as a surface mesh.
virtual double GetVolumeFraction(const vector< XY > &Section, double dFibreArea, XY Location, int YarnIndex=-1) const =0
Get the volume fraction for a given location.
Defines the nodes and elements of a surface or volume mesh.
int GetNumNodes() const
Return the number of nodes.
void InsertMesh(const CMesh &Mesh, XYZ Offset=XYZ(0, 0, 0))
Add the contents of Mesh to this mesh.
vector< pair< int, int > > GetNodePairs(XYZ Vector, const double Tolerance=1e-6) const
Return a list of node pairs (A, B) where A == B + Vector.
bool SaveToABAQUS(string Filename, const vector< POINT_INFO > *pElementInfo=NULL, bool bCreateStep=true, bool bCreateMaterial=true, int iElementType=0)
Save the mesh to ABAQUS input file format with information such as yarn tangents.
const XYZ & GetNode(int iIndex) const
Get the node with given ID.
int RemoveUnreferencedNodes()
Remove nodes that are not referenced by any elements.
static int GetNumNodes(ELEMENT_TYPE Type)
Get the number of nodes a particular element type contains.
int GetClosestNode(XYZ Position) const
Get the index of the node closest to the given position space.
void RemoveElementType(ELEMENT_TYPE Type)
Remove elements of given type.
const list< int > & GetIndices(ELEMENT_TYPE ElemType) const
Get the element indices of a given element type.
ELEMENT_TYPE
Each element type is represented by a unique integer value.
pair< XYZ, XYZ > GetAABB(double dGrowDistance=0) const
Get an axis aligned bounding box for the mesh.
void Clear()
Empty mesh nodes and indices.
void ConvertToSurfaceMesh()
Convert a volume mesh into a surface mesh (interior surfaces are elliminated)
Object container to help handle memory management issues.
double GetFibreArea(string Units="m^2") const
Get the area occupied by fibres given fibre diameter and number of fibres.
string GetGeometryScale() const
Represents a surface interaction as a string of ABAQUS keywords.
void CreateStep(ostream &Output)
Create a step.
void CreateContact(ostream &Output, string Name1, string Name2, string InteractionName)
Create a contact pair from two surface definitions.
double m_dInitialPlateGap
void CreateCompressionPlates(ostream &Output)
Create two rigid body analytical planes: one above and one below.
virtual ~CSimulationAbaqus(void)
void CreateMaterials(ostream &Output, string Filename)
Create the materials for the yarns.
void GetYarnSurfaces(int iYarn, const vector< XYZ > &Repeats, vector< ELEMENT_FACE > &UpperFaces, vector< ELEMENT_FACE > &LowerFaces)
Get a list of faces which make up the surfaces of a yarn.
set< int > GetCommonIndices(const vector< int > &SurfIndices, const vector< int > &VolIndices)
Find the common indices between a surface element and a volume element.
void CreatePeriodicBoundaries(ostream &Output, const CDomain &Domain)
Create a step with given deformation.
int GetGlobalNodeIndex(int iYarn, int iIndex)
Get the global element index of a given face.
void GetYarnSurface(int iYarn, const vector< XYZ > &Repeats, vector< ELEMENT_FACE > &Faces)
Get a list of faces which make up the surface of a yarn.
map< YarnNumber, int > m_NodeIndexOffsets
CTextileMaterials m_Materials
void SetStaticStepParameters(double dInitTimeInc=0, double dTimePeriod=0, double dMinTimeInc=0, double dMaxTimeInc=0)
int GetGlobalElementIndex(int iYarn, CMesh::ELEMENT_TYPE ElemType, int iIndex)
int GetFaceIndex(CMesh::ELEMENT_TYPE ElemType, const set< int > &NodeIndices)
void OutputContacts(ostream &Output, set< pair< int, int > > &Contacts)
Output the contact definitions.
void CreateMidPointVolumeFractions(vector< SECTION_VF_DATA > &VFData, vector< SECTION_VF_DATA > &VFMidData)
Create an array of volume fractions at the mid points between sections.
void GetElementVolumeFractions(vector< POINT_INFO > &ElementsInfo, vector< SECTION_VF_DATA > &MidVFData)
Save the volume fraction for a given element - taken to be at the centre of the element.
void CreateBoundary(ostream &Output, CLinearTransformation Deformation, const vector< int > &YarnCenterNodes, const vector< XYZ > &Repeats)
Create output request and boundary conditions with given deformation.
int GetCenterNode(const CMesh &Mesh)
Get the central node index of a given mesh.
void CreateContacts(ostream &Output, const CTextile &Textile)
Create the contact definitions.
string m_StaticStepParameters
void CreateSurfaces(ostream &Output, map< string, vector< ELEMENT_FACE > > &SurfaceDefinitions)
Create ABAQUS surface definitions.
void GetSectionVolumeFractions(CTextile &Textile, vector< SECTION_VF_DATA > &VolFractionData, int iYarn)
Get volume fraction of section saved in POLYGON mesh section.
double GetSectionVolumeFraction(double Area, CTextile &Textile, int Yarn)
Get the volume fraction based on a given area.
bool CreateAbaqusInputFile(CTextile &Textile, string Filename, bool bRegenerateMesh, int iElementType=0, bool bAdjustMesh=false, double Tolerance=0.0000001)
void CreateSurfaceDefinitions(int iNumYarns, const vector< XYZ > &Repeats, map< string, vector< ELEMENT_FACE > > &SurfaceDefinitions)
ELEMENT_FACE FindFaceIndex(int iYarn, const vector< int > &SurfIndices)
Given a surface element, find the volume element it belongs to along with its face index.
void CreateSet(ostream &Output, SET_TYPE Type, string Name, vector< int > &Indices, bool bUnSorted=false)
Output an element or node set from a list of indices.
void SetYarnSurfaceInteraction(string AbaqusCommands)
Assign a surface interaction to be used at contacts between yarns.
CObjectContainer< CSurfaceInteraction > m_PlateInteraction
CObjectContainer< CSurfaceInteraction > m_YarnInteraction
double GetSectionArea(vector< int > &Section, CMesh &Mesh)
Get the cross-sectional area of the yarn section.
map< YarnNumber, map< CMesh::ELEMENT_TYPE, int > > m_ElementIndexOffsets
void BuildIndexOffsets()
Populate m_IndexOffsets parameter.
vector< CMesh > m_YarnMeshes
void SetPlateSurfaceInteraction(string AbaqusCommands)
Assign a surface interaction to be used at contacts between yarns and compaction plates.
vector< CLinearTransformation > m_DeformationSteps
Represents a 3D woven textile.
int GetYarnIndex(int x, int y, int z) const
const vector< PATTERN3D > & GetCell(int x, int y) const
Represents a textile cell containing yarns.
const CDomain * GetDomain() const
void AddVolumeToMesh(vector< CMesh > &YarnMeshes, bool bTrimToDomain=false)
Create volume mesh for each yarn in this textile and add to a vector of meshes.
void GetPointInformation(const vector< XYZ > &Points, vector< POINT_INFO > &PointsInfo, double dTolerance=1e-9)
Get useful information of a list of points.
const CYarn * GetYarn(int iIndex) const
map< string, pair< CObjectContainer< CMaterial >, CObjectContainer< CMaterial > > > GetMaterials()
map< int, string > GetMaterialAssignements()
void SetupMaterials(CTextile &Textile)
Set up a material for each unique set of material constants.
Represents a woven textile.
int GetYarnIndex(int x, int y, int z) const
const vector< PATTERN2D > & GetCell(int x, int y) const
Represents a yarn consisting of master nodes, section and interpolation function.
const CFibreDistribution * GetFibreDistribution() const
const vector< XYZ > & GetRepeats() const
Namespace containing a series of customised math operations not found in the standard c++ library.
std::string StripPath(std::string Filename)
Strip the path from the filename (e.g. "c:\folder\file.ext -> file.ext")
std::string ReplaceFilenameSpaces(std::string Filename)
Replaces spaces in filename with underscore.
void WriteElementsHeader(std::ostream &Output)
Write elements header for ABAQUS .eld files.
void WriteValues(std::ostream &Output, T &Values, int iMaxPerLine)
double Max(XYZ &Vector)
Get maximum element of vector and return it.
double GetLength(const XYZ &Point1, const XYZ &Point2)
Get the length between two points.
std::string stringify(const T &x, int iPrecision=12, bool bScientific=true)
Function to convert a value (e.g. int, double, etc...) to a string.
XYZ Min(const XYZ &P1, const XYZ &P2)
Given two points, return a new point who's coordinates are the smaller of the two.
void AddExtensionIfMissing(std::string &Filename, std::string Extension)
Adds an extension to the filename if it is missing otherwise do nothing (e.g. picture -> picture....
XYZ CrossProduct(const XYZ &left, const XYZ &right)
Get the cross product of two vectors.
CMesh::ELEMENT_TYPE ElementType
Struct for representing points in 3D space.