25CFibreDistribution1DQuad::CFibreDistribution1DQuad(
double dDropOff)
39 Element.SetDoubleAttribute(
"DropOff",
m_dDropOff);
45 for(
unsigned int i=0;i<Section.size();++i)
47 dMaxX = max(Section[i].x, dMaxX);
55 for(
unsigned int i=0;i<Section.size();++i)
57 double x_0 = Section[i].x, x_1 = Section[(i+1)%Section.size()].x;
58 double dx = abs(x_1 - x_0);
59 double avy = (abs(Section[(i+1)%Section.size()].y) + abs(Section[i].y))*0.5;
73 dScale = dFibreArea/dScale;
74 if(dScale>0.86||dScale<0)
76 if ( YarnIndex == -1 )
78 TGERROR(
"Warning: Volume fraction is not realistic " << dScale);
82 TGERROR(
"Warning: Volume fraction is not realistic: " << dScale <<
", Yarn: " << YarnIndex);
91 double xScaled = x / dMaxX;
92 return min + (max - min)*(1-xScaled*xScaled);
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
double Distribution(double max, double min, double x, double dMaxX) const
CFibreDistribution1DQuad(double dDropOff)
double ComputeMaxX(const vector< XY > &Section) const
double GetVolumeFraction(const vector< XY > &Section, double dFibreArea, XY Location, int YarnIndex=-1) const
Get the volume fraction for a given location.
double IntegrateDistribution(const vector< XY > &Section, double dMaxX) const
void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
Abstract base class that defines how the fibres are distributed within a yarn.
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType) const
Used for saving data to XML.
Namespace containing a series of customised math operations not found in the standard c++ library.
Struct for representing points in 2D space.