31void CTextileMaterials::SetupMaterials(
CTextile &Textile )
41 for( i = -1; i < iNumYarns; ++i )
43 pair< vector<double>,vector<double> > YarnConstants;
62 YarnConstants.second.push_back( Yarn->
GetAlphaX(
"/K") );
63 YarnConstants.second.push_back( Yarn->
GetAlphaY(
"/K") );
64 YarnConstants.second.push_back( Yarn->
GetAlphaZ(
"/K") );
71 TGERROR(
"One or more material constant not set for matrix, assigning defaults" );
75 TGERROR(
"One or more material constant not set for yarn " << i <<
", assigning defaults" );
83 vector<double> &MatConstants = Material.first->GetConstants();
84 vector<double> &ThermConstants = Material.second->GetConstants();
86 if ( MatConstants.size() == YarnConstants.first.size() && ThermConstants.size() == YarnConstants.second.size() )
114 vector<int>::const_iterator itYarn;
115 for (itYarn = Yarns.begin(); itYarn != Yarns.end(); ++itYarn)
123 vector<double>::const_iterator itMatConstants, itThermConstants, itConstants;
125 for( itMatConstants = MatConstants.begin(), itConstants = Constants.first.begin(); itMatConstants != MatConstants.end(); ++itMatConstants, ++itConstants )
127 if ( *itMatConstants != *itConstants )
130 for( itThermConstants = ThermConstants.begin(), itConstants = Constants.second.begin(); itThermConstants != ThermConstants.end(); ++itThermConstants, ++itConstants )
132 if ( *itThermConstants != *itConstants )
141 materials.first =
CUMAT(Constants.first);
142 materials.second =
CUMAT(Constants.second);
149 vector<double>::iterator itConstants;
150 bool bSetDefault =
false;
153 int iNumConstants = Constants.first.size();
155 for( itConstants = Constants.first.begin(), i = 0; itConstants != Constants.first.end(); ++itConstants, ++i )
158 if ( *itConstants == 0.0 )
160 if ( iNumConstants == 2 )
176 for( itConstants = Constants.second.begin(), i = 0; itConstants != Constants.second.end(); ++itConstants, ++i )
178 if ( *itConstants == 0.0 )
189 Output <<
"*****************" << endl;
190 Output <<
"*** MATERIALS ***" << endl;
191 Output <<
"*****************" << endl;
196 Output <<
"*Material, Name=" << itMaterial->first << endl;
197 if ( itMaterial->second.first->GetConstants().size() == 2 )
198 Output << itMaterial->second.first->GetAbaqusCommands();
200 Output << itMaterial->second.first->GetAbaqusCommands(
"ENGINEERING CONSTANTS" );
202 if ( itMaterial->second.second->GetConstants().size() == 1 )
203 Output << itMaterial->second.second->GetThermAbaqusCommands(
"");
205 Output << itMaterial->second.second->GetThermAbaqusCommands(
"ORTHO" );
209 for (i = -1; i < iNumYarns; ++i)
217 Output <<
"*Solid Section, ElSet=Matrix, Material=" << MatName << endl;
218 Output <<
"1.0," << endl;
220 else if (!bMatrixOnly)
222 Output <<
"*Solid Section, ElSet=Yarn" << i <<
", Material=" << MatName <<
", Orientation=TexGenOrientations" << endl;
223 Output <<
"1.0," << endl;
230 ostringstream Output;
232 Output <<
"*Elastic" << endl;
234 Output <<
"*Elastic, type=" << Type << endl;
242 ostringstream Output;
244 Output <<
"*Expansion" << endl;
246 Output <<
"*Expansion, type=" << Type << endl;
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
Object container to help handle memory management issues.
double GetShearModulusYZ(string Units="MPa") const
double GetAlphaZ(string Units="/K") const
double GetAlphaY(string Units="/K") const
double GetYoungsModulusY(string Units="MPa") const
double GetPoissonsRatioY() const
double GetPoissonsRatioZ() const
double GetYoungsModulusX(string Units="MPa") const
double GetPoissonsRatioX() const
double GetAlphaX(string Units="/K") const
double GetShearModulusXZ(string Units="MPa") const
double GetYoungsModulusZ(string Units="MPa") const
double GetShearModulusXY(string Units="MPa") const
double GetMatrixPoissonsRatio() const
double GetMatrixYoungsModulus(string Units="MPa") const
double GetMatrixAlpha() const
Represents a textile cell containing yarns.
const CYarn * GetYarn(int iIndex) const
void OutputMaterials(ostream &Output, int iNumYarns, bool bMatrixOnly)
Output materials and assign to yarn element sets.
map< string, pair< CObjectContainer< CMaterial >, CObjectContainer< CMaterial > > > m_Materials
bool CheckYarnConstants(pair< vector< double >, vector< double > > &Constants)
Check if material constants have been assigned (ie != 0). Return false if all 0.0.
map< int, string > m_MaterialAssignements
Output materials and assign to yarn element sets.
bool CompareMaterialConstants(const vector< double > &MatConstants, const vector< double > &ThermConstants, const pair< vector< double >, vector< double > > &Constants)
Compare two sets of material constants. Return true if identical.
void AssignMaterial(string Material, int iYarn)
Assign the material to a given yarn.
void AddMaterial(string Name, const pair< vector< double >, vector< double > > &Constants)
Add a material with associated name, this should then be assigned to yarns individually.
Represents a UMAT material definition.
string GetThermAbaqusCommands(string Type="")
vector< double > m_Constants
string GetAbaqusCommands(string Type="")
Represents a yarn consisting of master nodes, section and interpolation function.
Namespace containing a series of customised math operations not found in the standard c++ library.
void WriteValues(std::ostream &Output, T &Values, int iMaxPerLine)
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.