146 double x1 = 0.0, x2 = 0.0, x3 = 0.0, y = 0.0;
164 const FloatArray &coord = gp->giveNaturalCoordinates();
186 for (
int j = 1; j <= size; j++ ) {
243 for (
int j = 1; j <= size; j++ ) {
244 answer.
at(j) = b.
at(1, j) + x1 *b.
at(2, j) * x2 * b.
at(3, j) * x3 * b.
at(4, j);
253 int &localNodeId,
int &localElemId,
int &localBcId,
257 FloatArray *corner [ 8 ], midSide [ 12 ], midFace [ 6 ], midNode;
258 double x = 0.0, y = 0.0, z = 0.0;
259 int inode, nodes = 8, iside, sides = 12, iface, faces = 6, nd, nd1, nd2;
261 static int sideNode [ 12 ] [ 2 ] = { { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 1 },
262 { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 5 },
263 { 1, 5 }, { 2, 6 }, { 3, 7 }, { 4, 8 } };
264 static int faceNode [ 6 ] [ 4 ] = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 },
265 { 1, 2, 6, 5 }, { 2, 3, 7, 6 }, { 3, 4, 8, 7 }, { 4, 1, 5, 8 } };
271 static int hexaSideNode [ 8 ] [ 3 ] = { { 1, 4, 9 }, { 2, 1, 10 }, { 3, 2, 11 }, { 4, 3, 12 },
272 { 8, 5, 9 }, { 5, 6, 10 }, { 6, 7, 11 }, { 7, 8, 12 } };
273 static int hexaFaceNode [ 8 ] [ 3 ] = { { 1, 3, 6 }, { 1, 4, 3 }, { 1, 5, 4 }, { 1, 6, 5 },
274 { 2, 6, 3 }, { 2, 3, 4 }, { 2, 4, 5 }, { 2, 5, 6 } };
278 for ( inode = 0; inode < nodes; inode++ ) {
281 x += corner [ inode ]->
at(1);
282 y += corner [ inode ]->
at(2);
283 z += corner [ inode ]->
at(3);
286 for ( iside = 0; iside < sides; iside++ ) {
287 midSide [ iside ].
resize(3);
289 nd1 = sideNode [ iside ] [ 0 ] - 1;
290 nd2 = sideNode [ iside ] [ 1 ] - 1;
292 midSide [ iside ].
at(1) = ( corner [ nd1 ]->
at(1) + corner [ nd2 ]->
at(1) ) / 2.0;
293 midSide [ iside ].
at(2) = ( corner [ nd1 ]->
at(2) + corner [ nd2 ]->
at(2) ) / 2.0;
294 midSide [ iside ].
at(3) = ( corner [ nd1 ]->
at(3) + corner [ nd2 ]->
at(3) ) / 2.0;
299 midNode.
at(1) = x / nodes;
300 midNode.
at(2) = y / nodes;
301 midNode.
at(3) = z / nodes;
303 for ( iface = 0; iface < faces; iface++ ) {
305 for ( inode = 0; inode < 4; inode++ ) {
306 nd = faceNode [ iface ] [ inode ] - 1;
307 x += corner [ nd ]->
at(1);
308 y += corner [ nd ]->
at(2);
309 z += corner [ nd ]->
at(3);
312 midFace [ iface ].
resize(3);
314 midFace [ iface ].
at(1) = x / 4;
315 midFace [ iface ].
at(2) = y / 4;
316 midFace [ iface ].
at(3) = z / 4;
321 sMode, tStep, nodes, corner, midSide, midFace, midNode,
322 localNodeId, localElemId, localBcId, hexaSideNode, hexaFaceNode,
323 controlNode, controlDof, aMode,
"LSpace");
334 #define TR_LENGHT_REDUCT 0.3333 348 EASValsSetEdgeFlag(
true);
350 EASValsSetFillStyle(FILL_SOLID);
351 for (
int i = 0; i < 8; i++ ) {
357 go = CreateHexahedron(p);
358 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
359 EGAttachObject(go, ( EObjectP )
this);
360 EMAddGraphicsToModel(ESIModel(), go);
403 const char *colors[] = {
404 "red",
"green",
"blue" 409 for ( i = 1; i <= 4; i++ ) {
416 for ( i = 1; i <= 4; i++ ) {
431 if ( nn.dotProduct(nn, 3) < 1.e-6 ) {
436 for ( i = 1; i <= 3; i++ ) {
437 jm.
at(i, 3) = nn.at(i);
442 double test = fabs(fabs( nn.at(3) ) - 1.0);
443 if ( test < 1.e-5 ) {
444 h1.at(1) = jm.
at(1, 1) = 1.0;
445 h1.at(2) = jm.
at(2, 1) = 0.0;
447 h1.at(1) = jm.
at(1, 1) = jm.
at(2, 3);
448 h1.at(2) = jm.
at(2, 1) = -jm.
at(1, 3);
451 h1.at(3) = jm.
at(3, 1) = 0.0;
453 h2.beVectorProductOf(nn, h1);
454 for ( i = 1; i <= 3; i++ ) {
455 jm.
at(i, 2) = h2.at(i);
459 p [ 0 ].x = gc.
at(1);
460 p [ 0 ].y = gc.
at(2);
461 p [ 0 ].z = gc.
at(3);
462 for ( i = 1; i <= 3; i++ ) {
463 p [ 1 ].x = p [ 0 ].x + coeff *jm.
at(1, i);
464 p [ 1 ].y = p [ 0 ].y + coeff *jm.
at(2, i);
465 p [ 1 ].z = p [ 0 ].z + coeff *jm.
at(3, i);
467 EASValsSetColor( ColorGetPixelFromString(const_cast< char * >(colors [ i - 1 ]), & succ) );
469 go = CreateLine3D(p);
470 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
471 EMAddGraphicsToModel(ESIModel(), go);
490 EASValsSetEdgeFlag(
true);
492 EASValsSetFillStyle(FILL_SOLID);
493 for ( i = 0; i < 8; i++ ) {
499 go = CreateHexahedron(p);
500 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
501 EMAddGraphicsToModel(ESIModel(), go);
507 int i, indx, result = 0;
511 double s [ 8 ], defScale = 0.0;
518 for ( i = 1; i <= 8; i++ ) {
531 for ( i = 1; i <= 8; i++ ) {
532 s [ i - 1 ] = v [ i - 1 ].
at(indx);
536 EASValsSetEdgeFlag(
true);
539 for ( i = 0; i < 8; i++ ) {
554 tr = CreateHexahedronWD(p, s);
555 EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
556 EMAddGraphicsToModel(ESIModel(), tr);
579 if ( this->
giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {
583 if ( (
int ) cf.
at(1) == 0 ) {
591 if ( this->
giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {
592 this->
giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);
595 for ( i = 1; i <= 3; i++ ) {
596 crackStatus = ( int ) crackStatuses.
at(i);
604 }
else if ( i == 2 ) {
612 q [ 0 ].x = ( FPNum ) gpc.
at(1) + 0.5 * crackDir.
at(0 + j) * length + 0.5 * crackDir.
at(0 + k) * length;
613 q [ 0 ].y = ( FPNum ) gpc.
at(2) + 0.5 * crackDir.
at(3 + j) * length + 0.5 * crackDir.
at(3 + k) * length;
614 q [ 0 ].z = ( FPNum ) gpc.
at(3) + 0.5 * crackDir.
at(6 + j) * length + 0.5 * crackDir.
at(6 + k) * length;
615 q [ 1 ].x = ( FPNum ) gpc.
at(1) + 0.5 * crackDir.
at(0 + j) * length - 0.5 * crackDir.
at(0 + k) * length;
616 q [ 1 ].y = ( FPNum ) gpc.
at(2) + 0.5 * crackDir.
at(3 + j) * length - 0.5 * crackDir.
at(3 + k) * length;
617 q [ 1 ].z = ( FPNum ) gpc.
at(3) + 0.5 * crackDir.
at(6 + j) * length - 0.5 * crackDir.
at(6 + k) * length;
618 q [ 2 ].x = ( FPNum ) gpc.
at(1) - 0.5 * crackDir.
at(0 + j) * length - 0.5 * crackDir.
at(0 + k) * length;
619 q [ 2 ].y = ( FPNum ) gpc.
at(2) - 0.5 * crackDir.
at(3 + j) * length - 0.5 * crackDir.
at(3 + k) * length;
620 q [ 2 ].z = ( FPNum ) gpc.
at(3) - 0.5 * crackDir.
at(6 + j) * length - 0.5 * crackDir.
at(6 + k) * length;
621 q [ 3 ].x = ( FPNum ) gpc.
at(1) - 0.5 * crackDir.
at(0 + j) * length + 0.5 * crackDir.
at(0 + k) * length;
622 q [ 3 ].y = ( FPNum ) gpc.
at(2) - 0.5 * crackDir.
at(3 + j) * length + 0.5 * crackDir.
at(3 + k) * length;
623 q [ 3 ].z = ( FPNum ) gpc.
at(3) - 0.5 * crackDir.
at(6 + j) * length + 0.5 * crackDir.
at(6 + k) * length;
634 tr = CreateQuad3D(q);
635 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
636 EMAddGraphicsToModel(ESIModel(), tr);
684 for (
int i = 1; i <= 4; i++ ) {
690 for (
int i = 1; i <= 4; i++ ) {
691 int j = ( i ) % 4 + 1;
705 if ( nn.computeSquaredNorm() < 1.e-6 ) {
711 for (
int i = 1; i <= 3; i++ ) {
712 answer.
at(i, 3) = nn.at(i);
717 double test = fabs(fabs( nn.at(3) ) - 1.0);
718 if ( test < 1.e-5 ) {
719 h1.at(1) = answer.
at(1, 1) = 1.0;
720 h1.at(2) = answer.
at(2, 1) = 0.0;
722 h1.at(1) = answer.
at(1, 1) = answer.
at(2, 3);
723 h1.at(2) = answer.
at(2, 1) = -answer.
at(1, 3);
726 h1.at(3) = answer.
at(3, 1) = 0.0;
728 h2.beVectorProductOf(nn, h1);
729 for (
int i = 1; i <= 3; i++ ) {
730 answer.
at(i, 2) = h2.at(i);
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.
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
The element interface required by NodalAvergagingRecoveryModel.
IntArray dofManArray
Array containing dofmanager numbers.
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.
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
ScalarAlgorithmType getScalarAlgo()
Domain * domain
Link to domain object, useful for communicating with other FEM components.
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
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...
void computeSurfaceMapping(IntArray &surfNodes, IntArray &elemNodes, int isurf)
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
#define OOFEG_RAW_GEOMETRY_LAYER
EPixel getElementEdgeColor()
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
void setupRefinedElementProblem3D(Element *element, RefinedElement *refinedElement, int level, int nodeId, IntArray &localNodeIdArray, IntArray &globalNodeIdArray, HuertaErrorEstimatorInterface::SetupMode mode, TimeStep *tStep, int nodes, FloatArray **corner, FloatArray *midSide, FloatArray *midFace, FloatArray &midNode, int &localNodeId, int &localElemId, int &localBcId, int hexaSideNode[1][3], int hexaFaceNode[1][3], IntArray &controlNode, IntArray &controlDof, HuertaErrorEstimator::AnalysisMode aMode, const char *hexatype)
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
virtual int SetUpPointsOnSquare(int, MaterialMode mode)
Sets up receiver's integration points on unit square integration domain.
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.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
int & at(int i)
Coefficient access function.
#define OOFEG_DEFORMED_GEOMETRY_LAYER
Abstract base class representing integration rule.
int getInternalVarsDefGeoFlag()
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
EPixel getDeformedElementColor()
Class representing a general abstraction for finite element interpolation class.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
InternalStateType giveIntVarType()
#define OOFEG_CRACK_PATTERN_LAYER
EPixel getActiveCrackColor()
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
The element interface corresponding to HuertaErrorEstimator.
double computeSquaredNorm() const
Computes the square of the norm.
#define OOFEG_RAW_GEOMETRY_WIDTH
UnknownType
Type representing particular unknown (its physical meaning).
#define OOFEG_CRACK_PATTERN_WIDTH
SetupMode
Mode for problem setup.
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
Computes the element value in given node.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
EPixel getCrackPatternColor()
virtual int computeLoadLSToLRotationMatrix(FloatMatrix &answer, int iSurf, GaussPoint *gp)
Returns transformation matrix from local surface c.s to element local coordinate system of load vecto...
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)
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 void HuertaErrorEstimatorI_computeNmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
double cbrt(double x)
Returns the cubic root of x.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
Abstract service.
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
virtual FEInterpolation * giveInterpolation() const
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
void drawTriad(FloatArray &, int isurf)
void times(double s)
Multiplies receiver with scalar.
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...
static FEI3dHexaLin interpolation
virtual FloatArray * giveCoordinates()
void zero()
Zeroes all coefficient of receiver.
InterfaceType
Enumerative type, used to identify interface type.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
void updateFringeTableMinMax(double *s, int size)
int giveSize() const
Returns the size of receiver.
Node * giveNode(int n)
Service for accessing particular domain node.
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
the oofem namespace is to define a context or scope in which all oofem names are defined.
double normalize()
Normalizes receiver.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
virtual IntegrationRule * GetSurfaceIntegrationRule(int iSurf)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define OOFEG_VARPLOT_PATTERN_LAYER
Class representing integration point in finite element program.
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.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.