35 #include "../sm/Elements/PlaneStress/planstrss.h" 36 #include "../sm/Materials/structuralms.h" 93 for (
int i = 1; i <= 4; i++ ) {
94 answer.
at(1, 2 * i - 1) = dnx.
at(i, 1);
95 answer.
at(2, 2 * i - 0) = dnx.
at(i, 2);
98 #ifdef PlaneStress2d_reducedShearIntegration 102 for (
int i = 1; i <= 4; i++ ) {
103 answer.
at(3, 2 * i - 1) = dnx.
at(i, 2);
104 answer.
at(3, 2 * i - 0) = dnx.
at(i, 1);
122 for (
int i = 1; i <= 4; i++ ) {
123 answer.
at(1, 2 * i - 1) = dnx.
at(i, 1);
124 answer.
at(2, 2 * i - 0) = dnx.
at(i, 2);
127 #ifdef PlaneStress2d_reducedShearIntegration 131 for (
int i = 1; i <= 4; i++ ) {
132 answer.
at(3, 2 * i - 1) = dnx.
at(i, 2);
133 answer.
at(4, 2 * i - 0) = dnx.
at(i, 1);
190 normalToCrackPlane = averageNormal;
202 double cx = 0., cy = 0.;
203 for (
int i = 1; i <= 4; i++ ) {
213 for (
int i = 1; i <= 4; i++ ) {
226 for (
int i = 1; i <= 4; i++ ) {
227 gradPhi.
at(1) += phi.
at(i) * dnx.
at(i, 1);
228 gradPhi.
at(2) += phi.
at(i) * dnx.
at(i, 2);
234 normalToCrackPlane = averageNormal;
237 for (
int i = 1; i <= 2; i++ ) {
238 dPhidN += gradPhi.
at(i) * normalToCrackPlane.
at(i);
241 if ( dPhidN == 0. ) {
245 return 1. / fabs(dPhidN);
275 int &localNodeId,
int &localElemId,
int &localBcId,
279 int inode, nodes = 4, iside, sides = 4, nd1, nd2;
280 FloatArray *corner [ 4 ], midSide [ 4 ], midNode, cor [ 4 ];
281 double x = 0.0, y = 0.0;
283 static int sideNode [ 4 ] [ 2 ] = { { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 1 } };
287 for ( inode = 0; inode < nodes; inode++ ) {
289 if ( corner [ inode ]->giveSize() != 3 ) {
291 cor [ inode ].
at(1) = corner [ inode ]->
at(1);
292 cor [ inode ].
at(2) = corner [ inode ]->
at(2);
293 cor [ inode ].
at(3) = 0.0;
295 corner [ inode ] = & ( cor [ inode ] );
298 x += corner [ inode ]->
at(1);
299 y += corner [ inode ]->
at(2);
302 for ( iside = 0; iside < sides; iside++ ) {
303 midSide [ iside ].
resize(3);
305 nd1 = sideNode [ iside ] [ 0 ] - 1;
306 nd2 = sideNode [ iside ] [ 1 ] - 1;
308 midSide [ iside ].
at(1) = ( corner [ nd1 ]->
at(1) + corner [ nd2 ]->
at(1) ) / 2.0;
309 midSide [ iside ].
at(2) = ( corner [ nd1 ]->
at(2) + corner [ nd2 ]->
at(2) ) / 2.0;
310 midSide [ iside ].
at(3) = 0.0;
315 midNode.
at(1) = x / nodes;
316 midNode.
at(2) = y / nodes;
321 sMode, tStep, nodes, corner, midSide, midNode,
322 localNodeId, localElemId, localBcId,
323 controlNode, controlDof, aMode,
"PlaneStress2d");
333 #define TR_LENGHT_REDUCT 0.3333 347 EASValsSetEdgeFlag(
true);
349 EASValsSetFillStyle(FILL_HOLLOW);
363 go = CreateQuad3D(p);
364 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
365 EGAttachObject(go, ( EObjectP )
this);
366 EMAddGraphicsToModel(ESIModel(), go);
383 EASValsSetEdgeFlag(
true);
385 EASValsSetFillStyle(FILL_HOLLOW);
399 go = CreateQuad3D(p);
400 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
401 EMAddGraphicsToModel(ESIModel(), go);
408 int i, indx, result = 0;
412 double s [ 4 ], defScale;
420 for ( i = 1; i <= 4; i++ ) {
430 for ( i = 1; i <= 4; i++ ) {
431 s [ i - 1 ] = v [ i - 1 ].
at(indx);
435 for ( i = 0; i < 4; i++ ) {
451 tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
452 EGWithMaskChangeAttributes(LAYER_MASK, tr);
453 EMAddGraphicsToModel(ESIModel(), tr);
481 for ( i = 0; i < 4; i++ ) {
487 p [ i ].z = s [ i ] * landScale;
491 p [ i ].z = s [ i ] * landScale;
495 if ( fabs(s [ i ]) < 1.0e-6 ) {
503 tr = CreateQuad3D(p);
504 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
507 tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
508 EGWithMaskChangeAttributes(LAYER_MASK, tr);
511 EMAddGraphicsToModel(ESIModel(), tr);
521 for ( i = 0; i < 4; i++ ) {
535 for ( i = 0; i < 3; i++ ) {
536 pp [ i + 4 ].x = 0.5 * ( pp [ i ].x + pp [ i + 1 ].x );
537 pp [ i + 4 ].y = 0.5 * ( pp [ i ].y + pp [ i + 1 ].y );
538 pp [ i + 4 ].z = 0.5 * ( pp [ i ].z + pp [ i + 1 ].z );
541 pp [ 7 ].x = 0.5 * ( pp [ 3 ].x + pp [ 0 ].x );
542 pp [ 7 ].y = 0.5 * ( pp [ 3 ].y + pp [ 0 ].y );
543 pp [ 7 ].z = 0.5 * ( pp [ 3 ].z + pp [ 0 ].z );
545 pp [ 8 ].x = 0.25 * ( pp [ 0 ].x + pp [ 1 ].x + pp [ 2 ].x + pp [ 3 ].x );
546 pp [ 8 ].y = 0.25 * ( pp [ 0 ].y + pp [ 1 ].y + pp [ 2 ].y + pp [ 3 ].y );
547 pp [ 8 ].z = 0.25 * ( pp [ 0 ].z + pp [ 1 ].z + pp [ 2 ].z + pp [ 3 ].z );
550 const FloatArray& gpCoords = gp->giveNaturalCoordinates();
551 if ( ( gpCoords.
at(1) > 0. ) && ( gpCoords.
at(2) > 0. ) ) {
556 }
else if ( ( gpCoords.
at(1) < 0. ) && ( gpCoords.
at(2) > 0. ) ) {
561 }
else if ( ( gpCoords.
at(1) < 0. ) && ( gpCoords.
at(2) < 0. ) ) {
579 for ( i = 1; i <= 4; i++ ) {
580 s [ i - 1 ] = v [ 0 ].
at(indx);
583 for ( i = 0; i < 4; i++ ) {
584 p [ i ].x = pp [ ind.
at(i + 1) ].x;
585 p [ i ].y = pp [ ind.
at(i + 1) ].y;
586 p [ i ].z = pp [ ind.
at(i + 1) ].z;
590 tr = CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
591 EGWithMaskChangeAttributes(LAYER_MASK, tr);
592 EMAddGraphicsToModel(ESIModel(), tr);
616 double ax, ay, bx, by,
norm, xc, yc, length;
622 if ( this->
giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {
626 if ( (
int ) cf.
at(1) == 0 ) {
630 if ( this->
giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {
631 this->
giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);
632 for ( i = 1; i <= 3; i++ ) {
633 crackStatus = ( int ) crackStatuses.
at(i);
640 ay = crackDir.
at(3 + i);
641 if ( fabs(ax) > 1.e-6 ) {
644 norm = sqrt(bx * bx + by * by);
654 double ksi, eta, n1, n2, n3, n4;
655 ksi = gp->giveNaturalCoordinate(1);
656 eta = gp->giveNaturalCoordinate(2);
658 n1 = ( 1. + ksi ) * ( 1. + eta ) * 0.25;
659 n2 = ( 1. - ksi ) * ( 1. + eta ) * 0.25;
660 n3 = ( 1. - ksi ) * ( 1. - eta ) * 0.25;
661 n4 = ( 1. + ksi ) * ( 1. - eta ) * 0.25;
677 xc = gpglobalcoords.
at(1);
678 yc = gpglobalcoords.
at(2);
680 l [ 0 ].x = ( FPNum ) xc + bx * length;
681 l [ 0 ].y = ( FPNum ) yc + by * length;
683 l [ 1 ].x = ( FPNum ) xc - bx * length;
684 l [ 1 ].y = ( FPNum ) yc - by * length;
694 tr = CreateLine3D(l);
695 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
696 EMAddGraphicsToModel(ESIModel(), tr);
710 for (
int i = 1; i < 5; i++ ) {
721 for (
int i = 1; i < 5; i++ ) {
virtual FEICellGeometry * giveCellGeometryWrapper()
Returns the Cell Geometry Wrapper.
CrossSection * giveCrossSection()
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
The element interface required by ZZNodalRecoveryModel.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
ScalarAlgorithmType getScalarAlgo()
double computeMeanSize()
Computes the size of the element defined as its length.
void computeMaxPrincipalDir(FloatArray &answer) const
Computes the principal direction of the receiver associated with the maximum principal value...
The element interface required by ZZNodalRecoveryModel.
const FloatArray & giveSubPatchCoordinates()
Returns local sub-patch coordinates of the receiver.
AnalysisMode
Mode of analysis.
double & at(int i)
Coefficient access function.
virtual int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
#define OOFEG_RAW_GEOMETRY_LAYER
This class implements a structural material status information.
EPixel getElementEdgeColor()
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
Specialization of a floating point array for representing a strain state.
virtual double giveCoordinate(int i)
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual double giveCharacteristicLength(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction, in some cases adjusted (e.g.
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
#define OOFEG_DEFORMED_GEOMETRY_LAYER
int getInternalVarsDefGeoFlag()
EPixel getDeformedElementColor()
Class representing a general abstraction for finite element interpolation class.
InternalStateType giveIntVarType()
#define OOFEG_CRACK_PATTERN_LAYER
EPixel getActiveCrackColor()
The element interface corresponding to HuertaErrorEstimator.
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
#define OOFEG_RAW_GEOMETRY_WIDTH
UnknownType
Type representing particular unknown (its physical meaning).
#define OOFEG_CRACK_PATTERN_WIDTH
SetupMode
Mode for problem setup.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
PlaneStress2d(int n, Domain *d)
EPixel getCrackPatternColor()
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
virtual double giveLengthInDir(const FloatArray &normalToCrackPlane)
Default implementation returns length of element projection into specified direction.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
static FEI2dQuadLin interpolation
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
int numberOfGaussPoints
Number of integration points as specified by nip.
InternalStateMode giveIntVarMode()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing vector of real numbers.
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void setupRefinedElementProblem2D(Element *element, RefinedElement *refinedElement, int level, int nodeId, IntArray &localNodeIdArray, IntArray &globalNodeIdArray, HuertaErrorEstimatorInterface::SetupMode mode, TimeStep *tStep, int nodes, FloatArray **corner, FloatArray *midSide, FloatArray &midNode, int &localNodeId, int &localElemId, int &localBcId, IntArray &controlNode, IntArray &controlDof, HuertaErrorEstimator::AnalysisMode aMode, const char *quadtype)
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
double norm(const FloatArray &x)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
void zero()
Zeroes all coefficients of receiver.
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
The spatial localizer element interface associated to spatial localizer.
virtual FEInterpolation * giveInterpolation() const
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
virtual void computeBHmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes a matrix which, multiplied by the column matrix of nodal displacements, gives the displaceme...
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
virtual FloatArray * giveCoordinates()
void zero()
Zeroes all coefficient of receiver.
InterfaceType
Enumerative type, used to identify interface type.
void updateFringeTableMinMax(double *s, int size)
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
virtual void HuertaErrorEstimatorI_setupRefinedElementProblem(RefinedElement *refinedElement, int level, int nodeId, IntArray &localNodeIdArray, IntArray &globalNodeIdArray, HuertaErrorEstimatorInterface::SetupMode sMode, TimeStep *tStep, int &localNodeId, int &localElemId, int &localBcId, IntArray &controlNode, IntArray &controlDof, HuertaErrorEstimator::AnalysisMode aMode)
Node * giveNode(int i) const
Returns reference to the i-th node of element.
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
#define OOFEG_VARPLOT_PATTERN_LAYER
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
Class representing solution step.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
int numberOfDofMans
Number of dofmanagers.
void add(const FloatArray &src)
Adds array src to receiver.
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
virtual void HuertaErrorEstimatorI_computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer)
void resize(int s)
Resizes receiver towards requested size.
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int=1, int=ALL_STRAINS)
Computes the geometrical matrix of receiver in given integration point.
virtual double giveCharacteristicSize(GaussPoint *gp, FloatArray &normalToCrackPlane, ElementCharSizeMethod method)
Returns characteristic element size for a given integration point and given direction.