128 double cx = 0., cy = 0.;
129 for (
int i = 1; i <= 3; i++ ) {
141 for (
int i = 1; i <= 3; i++ ) {
142 if ( ( ( x.at(i) - cx ) * normalToCrackPlane.
at(1) + ( y.
at(i) - cy ) * normalToCrackPlane.
at(2) ) > 0. ) {
151 dnx.
at(1, 1) = y.
at(2) - y.
at(3);
152 dnx.
at(2, 1) = y.
at(3) - y.
at(1);
153 dnx.
at(3, 1) = y.
at(1) - y.
at(2);
154 dnx.
at(1, 2) = x.at(3) - x.at(2);
155 dnx.
at(2, 2) = x.at(1) - x.at(3);
156 dnx.
at(3, 2) = x.at(2) - x.at(1);
162 for (
int i = 1; i <= 3; i++ ) {
163 gradPhi.
at(1) += phi.
at(i) * dnx.
at(i, 1);
164 gradPhi.
at(2) += phi.
at(i) * dnx.
at(i, 2);
169 for (
int i = 1; i <= 2; i++ ) {
170 dPhidN += gradPhi.
at(i) * normalToCrackPlane.
at(i);
173 if ( dPhidN == 0. ) {
177 return 1. / fabs(dPhidN);
199 int &localNodeId,
int &localElemId,
int &localBcId,
203 int inode, nodes = 3, iside, sides = 3, nd1, nd2;
204 FloatArray *corner [ 3 ], midSide [ 3 ], midNode, cor [ 3 ];
205 double x = 0.0, y = 0.0;
207 static int sideNode [ 3 ] [ 2 ] = { { 1, 2 }, { 2, 3 }, { 3, 1 } };
211 for ( inode = 0; inode < nodes; inode++ ) {
213 if ( corner [ inode ]->giveSize() != 3 ) {
215 cor [ inode ].
at(1) = corner [ inode ]->
at(1);
216 cor [ inode ].
at(2) = corner [ inode ]->
at(2);
217 cor [ inode ].
at(3) = 0.0;
219 corner [ inode ] = & ( cor [ inode ] );
222 x += corner [ inode ]->
at(1);
223 y += corner [ inode ]->
at(2);
226 for ( iside = 0; iside < sides; iside++ ) {
227 midSide [ iside ].
resize(3);
229 nd1 = sideNode [ iside ] [ 0 ] - 1;
230 nd2 = sideNode [ iside ] [ 1 ] - 1;
232 midSide [ iside ].
at(1) = ( corner [ nd1 ]->
at(1) + corner [ nd2 ]->
at(1) ) / 2.0;
233 midSide [ iside ].
at(2) = ( corner [ nd1 ]->
at(2) + corner [ nd2 ]->
at(2) ) / 2.0;
234 midSide [ iside ].
at(3) = 0.0;
239 midNode.
at(1) = x / nodes;
240 midNode.
at(2) = y / nodes;
245 sMode, tStep, nodes, corner, midSide, midNode,
246 localNodeId, localElemId, localBcId,
247 controlNode, controlDof, aMode,
"PlaneStress2d");
257 #define TR_LENGHT_REDUCT 0.3333 271 EASValsSetEdgeFlag(
true);
283 go = CreateTriangle3D(p);
284 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
285 EGAttachObject(go, ( EObjectP )
this);
286 EMAddGraphicsToModel(ESIModel(), go);
303 EASValsSetEdgeFlag(
true);
315 go = CreateTriangle3D(p);
316 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
317 EMAddGraphicsToModel(ESIModel(), go);
322 int i, indx, result = 0;
326 double s [ 3 ], defScale;
350 s [ 0 ] = v1.
at(indx);
351 s [ 1 ] = v2.
at(indx);
352 s [ 2 ] = v3.
at(indx);
357 for ( i = 0; i < 3; i++ ) {
373 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
374 EGWithMaskChangeAttributes(LAYER_MASK, tr);
375 EMAddGraphicsToModel(ESIModel(), tr);
379 for ( i = 0; i < 3; i++ ) {
385 p [ i ].z = s [ i ] * landScale;
389 p [ i ].z = s [ i ] * landScale;
396 EASValsSetFillStyle(FILL_SOLID);
397 tr = CreateTriangle3D(p);
398 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
401 EASValsSetFillStyle(FILL_SOLID);
402 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
403 EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
406 EMAddGraphicsToModel(ESIModel(), tr);
425 double ax, ay, bx, by,
norm, xc, yc, length;
429 if ( this->
giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {
433 if ( (
int ) cf.
at(1) == 0 ) {
437 if ( this->
giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {
438 this->
giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);
439 for (
int i = 1; i <= 3; i++ ) {
440 crackStatus = ( int ) crackStatuses.
at(i);
447 ay = crackDir.
at(3 + i);
448 if ( fabs(ax) > 1.e-6 ) {
451 norm = sqrt(bx * bx + by * by);
462 for (
int j = 1; j <= 3; j++ ) {
476 l [ 0 ].x = ( FPNum ) xc + bx * length;
477 l [ 0 ].y = ( FPNum ) yc + by * length;
479 l [ 1 ].x = ( FPNum ) xc - bx * length;
480 l [ 1 ].y = ( FPNum ) yc - by * length;
490 tr = CreateLine3D(l);
491 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
492 EMAddGraphicsToModel(ESIModel(), tr);
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The element interface required by NodalAvergagingRecoveryModel.
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 SPRPatchType SPRNodalRecoveryMI_givePatchType()
ScalarAlgorithmType getScalarAlgo()
virtual FEInterpolation * giveInterpolation() const
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
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
EPixel getElementEdgeColor()
virtual void HuertaErrorEstimatorI_computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer)
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
virtual double giveCoordinate(int i)
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)
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.
#define OOFEG_DEFORMED_GEOMETRY_LAYER
int getInternalVarsDefGeoFlag()
EPixel getDeformedElementColor()
Class representing a general abstraction for finite element interpolation class.
TrPlaneStress2d(int n, Domain *d)
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
InternalStateType giveIntVarType()
#define OOFEG_CRACK_PATTERN_LAYER
virtual double giveArea(const FEICellGeometry &cellgeo) const
Computes the exact area.
EPixel getActiveCrackColor()
virtual double giveCharacteristicSize(GaussPoint *gp, FloatArray &normalToCrackPlane, ElementCharSizeMethod method)
Returns characteristic element size for a given integration point and given direction.
virtual double giveArea()
The element interface corresponding to ZZErrorEstimator.
The element interface corresponding to HuertaErrorEstimator.
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
#define OOFEG_RAW_GEOMETRY_WIDTH
UnknownType
Type representing particular unknown (its physical meaning).
void times(double f)
Multiplies receiver by factor f.
#define OOFEG_CRACK_PATTERN_WIDTH
SetupMode
Mode for problem setup.
Wrapper around element definition to provide FEICellGeometry interface.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
Computes the element value in given node.
EPixel getCrackPatternColor()
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
int numberOfGaussPoints
Number of integration points as specified by nip.
InternalStateMode giveIntVarMode()
virtual Interface * giveInterface(InterfaceType)
Interface requesting service.
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
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)
double norm(const FloatArray &x)
void zero()
Zeroes all coefficients of receiver.
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
The spatial localizer element interface associated to spatial localizer.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
virtual FloatArray * giveCoordinates()
InterfaceType
Enumerative type, used to identify interface type.
void updateFringeTableMinMax(double *s, int size)
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
the oofem namespace is to define a context or scope in which all oofem names are defined.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
#define OOFEG_VARPLOT_PATTERN_LAYER
Class representing integration point in finite element program.
Class representing solution step.
int numberOfDofMans
Number of dofmanagers.
void resize(int s)
Resizes receiver towards requested size.