56void PLHoopStressCirc :: initializeFrom(
InputRecord &ir)
63 int useRadialBasisFunc = 0;
65 if ( useRadialBasisFunc == 1 ) {
66 mUseRadialBasisFunc =
true;
98 std :: vector< double >angles;
100 angles.push_back(angle *
M_PI / 180.0);
111 std :: vector< FloatArray >circPoints;
113 for (
size_t i = 0; i < angles.size(); i++ ) {
116 tangent.
add(cos(angles [ i ]), t);
117 tangent.
add(sin(angles [ i ]), n);
122 circPoints.push_back(x);
127 std :: vector< double >sigTTArray, sigRTArray;
130 for (
size_t pointIndex = 0; pointIndex < circPoints.size(); pointIndex++ ) {
143 const double l = 1.0 *
distance(x1, x2);
147 const double searchRadius = 3.0 * l;
155 double sumWiVi = 0.0;
156 for (
int elIndex: elIndices ) {
183 bool inFrontOfCrack =
true;
185 inFrontOfCrack =
false;
188 double r =
distance(circPoints [ pointIndex ], globalCoord);
190 if ( r < l && inFrontOfCrack ) {
191 double w = ( ( l - r ) / ( pow(2.0 *
M_PI, 1.5) * pow(l, 3) ) ) * exp( -0.5 * pow(r, 2) / pow(l, 2) );
210 sumQiWiVi.
add(w * V, stressVecGP);
219 if ( fabs(sumWiVi) > 1.0e-12 ) {
220 stressVec.
beScaled(1.0 / sumWiVi, sumQiWiVi);
224 bool useCZGP =
false;
239 bool useCZGP =
false;
254 int shearPos = stressVec.
giveSize();
256 stress.
at(1, 1) = stressVec.
at(1);
257 stress.
at(1, 2) = stressVec.
at(shearPos);
258 stress.
at(2, 1) = stressVec.
at(shearPos);
259 stress.
at(2, 2) = stressVec.
at(2);
264 rot.
at(1, 1) = cos(angles [ pointIndex ]);
265 rot.
at(1, 2) = -sin(angles [ pointIndex ]);
266 rot.
at(2, 1) = sin(angles [ pointIndex ]);
267 rot.
at(2, 2) = cos(angles [ pointIndex ]);
284 const double sigThetaTheta = stressRot.
at(2, 2);
285 sigTTArray.push_back(sigThetaTheta);
287 const double sigRTheta = stressRot.
at(1, 2);
288 sigRTArray.push_back(sigRTheta);
295 const double stressTol = 1.0e-9;
296 double maxSigTT = 0.0, maxAngle = 0.0;
297 bool foundZeroLevel =
false;
298 for (
size_t segIndex = 0; segIndex < ( circPoints.size() - 1 ); segIndex++ ) {
300 if ( sigRTArray [ segIndex ] * sigRTArray [ segIndex + 1 ] < stressTol ) {
302 double xi = EnrichmentItem :: calcXiZeroLevel(sigRTArray [ segIndex ], sigRTArray [ segIndex + 1 ]);
304 double theta = 0.5 * ( 1.0 - xi ) * angles [ segIndex ] + 0.5 * ( 1.0 + xi ) * angles [ segIndex + 1 ];
305 double sigThetaTheta = 0.5 * ( 1.0 - xi ) * sigTTArray [ segIndex ] + 0.5 * ( 1.0 + xi ) * sigTTArray [ segIndex + 1 ];
309 if ( sigThetaTheta > maxSigTT ) {
310 foundZeroLevel =
true;
311 maxSigTT = sigThetaTheta;
317 if ( !foundZeroLevel ) {
322 XFEMDebugTools :: WriteArrayToMatlab(
"sigTTvsAngle.m", angles, sigTTArray);
323 XFEMDebugTools :: WriteArrayToMatlab(
"sigRTvsAngle.m", angles, sigRTArray);
325 XFEMDebugTools :: WriteArrayToGnuplot(
"sigTTvsAngle.dat", angles, sigTTArray);
326 XFEMDebugTools :: WriteArrayToGnuplot(
"sigRTvsAngle.dat", angles, sigRTArray);
334 rot.
at(1, 1) = cos(maxAngle);
335 rot.
at(1, 2) = -sin(maxAngle);
336 rot.
at(2, 1) = sin(maxAngle);
337 rot.
at(2, 2) = cos(maxAngle);
#define REGISTER_PropagationLaw(class)
double giveCoordinate(int i) const
const FloatArray & giveCoordinates() const
SpatialLocalizer * giveSpatialLocalizer()
Element * giveElement(int n)
XfemManager * giveXfemManager()
virtual FEInterpolation * giveInterpolation() const
virtual int giveNumberOfDofManagers() const
DofManager * giveDofManager(int i) const
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
virtual double computeVolumeAround(GaussPoint *gp)
const TipInfo & giveTipInfo() const
virtual bool propagationIsAllowed() const
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
double dotProduct(const FloatArray &x) const
Index giveSize() const
Returns the size of receiver.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
void zero()
Zeroes all coefficients of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beScaled(double s, const FloatArray &b)
void add(const FloatArray &src)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void setColumn(const FloatArray &src, int c)
double at(std::size_t i, std::size_t j) const
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
double mHoopStressThreshold
const char * giveInputRecordName() const override
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)=0
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=nullptr)=0
virtual void giveAllElementsWithIpWithinBox(elementContainerType &elemSet, const FloatArray &coords, const double radius)=0
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
bool giveVtkDebug() const
double distance(const FloatArray &x, const FloatArray &y)
#define _IFT_PLHoopStressCirc_AngleInc
Angle between sampling points on the circle.
#define _IFT_PLHoopStressCirc_RadialBasisFunc
If radial basis functions should be used for stress interpolation.
#define _IFT_PLHoopStressCirc_Radius
Radius of circle used for stress sampling points.
#define _IFT_PLHoopStressCirc_IncLength
Increment length per time step.
#define _IFT_PLHoopStressCirc_HoopStressThreshold
Threshold for crack propagation.
double mPropagationLength
FloatArray mPropagationDir