45 #include "../sm/Materials/structuralms.h" 65 int useRadialBasisFunc = 0;
67 if ( useRadialBasisFunc == 1 ) {
68 mUseRadialBasisFunc =
true;
102 std :: vector< double >angles;
103 while ( angle <= ( 90.0 -
mAngleInc ) ) {
104 angles.push_back(angle *
M_PI / 180.0);
115 std :: vector< FloatArray >circPoints;
117 for (
size_t i = 0; i < angles.size(); i++ ) {
120 tangent.
add(cos(angles [ i ]), t);
121 tangent.
add(sin(angles [ i ]), n);
126 circPoints.push_back(x);
131 std :: vector< double >sigTTArray, sigRTArray;
134 for (
size_t pointIndex = 0; pointIndex < circPoints.size(); pointIndex++ ) {
147 const double l = 1.0 * x1.
distance(x2);
151 const double searchRadius = 3.0 * l;
159 double sumWiVi = 0.0;
160 for (
int elIndex: elIndices ) {
187 bool inFrontOfCrack =
true;
189 inFrontOfCrack =
false;
192 double r = circPoints [ pointIndex ].distance(globalCoord);
194 if ( r < l && inFrontOfCrack ) {
195 double w = ( ( l - r ) / ( pow(2.0 *
M_PI, 1.5) * pow(l, 3) ) ) * exp( -0.5 * pow(r, 2) / pow(l, 2) );
214 sumQiWiVi.
add(w * V, stressVecGP);
223 if ( fabs(sumWiVi) > 1.0e-12 ) {
224 stressVec.
beScaled(1.0 / sumWiVi, sumQiWiVi);
228 bool useCZGP =
false;
243 bool useCZGP =
false;
258 int shearPos = stressVec.
giveSize();
260 stress.
at(1, 1) = stressVec.
at(1);
261 stress.
at(1, 2) = stressVec.
at(shearPos);
262 stress.
at(2, 1) = stressVec.
at(shearPos);
263 stress.
at(2, 2) = stressVec.
at(2);
268 rot.
at(1, 1) = cos(angles [ pointIndex ]);
269 rot.
at(1, 2) = -sin(angles [ pointIndex ]);
270 rot.
at(2, 1) = sin(angles [ pointIndex ]);
271 rot.
at(2, 2) = cos(angles [ pointIndex ]);
288 const double sigThetaTheta = stressRot.
at(2, 2);
289 sigTTArray.push_back(sigThetaTheta);
291 const double sigRTheta = stressRot.
at(1, 2);
292 sigRTArray.push_back(sigRTheta);
299 const double stressTol = 1.0e-9;
300 double maxSigTT = 0.0, maxAngle = 0.0;
301 bool foundZeroLevel =
false;
302 for (
size_t segIndex = 0; segIndex < ( circPoints.size() - 1 ); segIndex++ ) {
304 if ( sigRTArray [ segIndex ] * sigRTArray [ segIndex + 1 ] < stressTol ) {
308 double theta = 0.5 * ( 1.0 - xi ) * angles [ segIndex ] + 0.5 * ( 1.0 + xi ) * angles [ segIndex + 1 ];
309 double sigThetaTheta = 0.5 * ( 1.0 - xi ) * sigTTArray [ segIndex ] + 0.5 * ( 1.0 + xi ) * sigTTArray [ segIndex + 1 ];
313 if ( sigThetaTheta > maxSigTT ) {
314 foundZeroLevel =
true;
315 maxSigTT = sigThetaTheta;
321 if ( !foundZeroLevel ) {
338 rot.
at(1, 1) = cos(maxAngle);
339 rot.
at(1, 2) = -sin(maxAngle);
340 rot.
at(2, 1) = sin(maxAngle);
341 rot.
at(2, 2) = cos(maxAngle);
#define _IFT_PLHoopStressCirc_HoopStressThreshold
Threshold for crack propagation.
The base class for all spatial localizers.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
FloatArray mPropagationDir
double & at(int i)
Coefficient access function.
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
This class implements a structural material status information.
virtual FloatArray * giveCoordinates()
Abstract base class for all finite elements.
Base class for dof managers.
Class implementing an array of integers.
XfemManager * giveXfemManager()
virtual void giveAllElementsWithIpWithinBox(elementContainerType &elemSet, const FloatArray &coords, const double radius)=0
Returns container (set) of all domain elements having integration point within given box...
virtual int giveNumberOfDofManagers() const
virtual FEInterpolation * giveInterpolation() const
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
bool giveVtkDebug() const
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
Class representing a general abstraction for finite element interpolation class.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
#define _IFT_PLHoopStressCirc_IncLength
Increment length per time step.
virtual bool propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
Element * giveElement(int n)
Service for accessing particular domain fe element.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Propagation law that propagates the crack in the direction that gives .
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual bool propagationIsAllowed() const
Wrapper around element definition to provide FEICellGeometry interface.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
REGISTER_PropagationLaw(PLDoNothing)
#define _IFT_PLHoopStressCirc_AngleInc
Angle between sampling points on the circle.
double at(int i, int j) const
Coefficient access function.
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)=0
Returns the element, containing given point and belonging to one of the region in region list...
virtual void giveInputRecord(DynamicInputRecord &input)
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
virtual const char * giveInputRecordName() const
IRResultType
Type defining the return values of InputRecord reading operations.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
void zero()
Zeroes all coefficients of receiver.
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void setColumn(const FloatArray &src, int c)
Sets the values of the matrix in specified column.
static double calcXiZeroLevel(const double &iQ1, const double &iQ2)
const TipInfo & giveTipInfo() const
double mPropagationLength
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
int giveSize() const
Returns the size of receiver.
virtual double giveCoordinate(int i)
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)=0
Returns the integration point in associated domain, which is closest to given point.
#define _IFT_PLHoopStressCirc_Radius
Radius of circle used for stress sampling points.
double normalize()
Normalizes receiver.
Class representing integration point in finite element program.
void add(const FloatArray &src)
Adds array src to receiver.
#define _IFT_PLHoopStressCirc_RadialBasisFunc
If radial basis functions should be used for stress interpolation.
double mHoopStressThreshold
void resize(int s)
Resizes receiver towards requested size.