183LTRSpace :: HuertaErrorEstimatorI_setupRefinedElementProblem(
RefinedElement *refinedElement,
int level,
int nodeId,
185 HuertaErrorEstimatorInterface :: SetupMode sMode,
TimeStep *tStep,
186 int &localNodeId,
int &localElemId,
int &localBcId,
188 HuertaErrorEstimator :: AnalysisMode aMode)
190 double x = 0.0, y = 0.0, z = 0.0;
191 int nodes = 4, sides = 6, faces = 4;
193 static int sideNode [ 6 ] [ 2 ] = { { 1, 2 }, { 2, 3 }, { 3, 1 }, { 1, 4 }, { 2, 4 }, { 3, 4 } };
194 static int faceNode [ 4 ] [ 3 ] = { { 1, 2, 3 }, { 1, 2, 4 }, { 2, 3, 4 }, { 3, 1, 4 } };
200 int hexaSideNode [ 4 ] [ 3 ] = { { 1, 3, 4 }, { 2, 1, 5 }, { 3, 2, 6 }, { 4, 6, 5 } };
201 int hexaFaceNode [ 4 ] [ 3 ] = { { 1, 2, 4 }, { 1, 3, 2 }, { 1, 4, 3 }, { 4, 2, 3 } };
203 FloatArray corner [ 4 ], midSide [ 6 ], midFace [ 4 ], midNode;
204 if ( sMode == HuertaErrorEstimatorInterface :: NodeMode ||
205 ( sMode == HuertaErrorEstimatorInterface :: BCMode && aMode == HuertaErrorEstimator :: HEE_linear ) ) {
206 for (
int inode = 0; inode < nodes; inode++ ) {
207 corner [ inode ] = this->
giveNode(inode + 1)->giveCoordinates();
209 x += corner [ inode ].
at(1);
210 y += corner [ inode ].
at(2);
211 z += corner [ inode ].
at(3);
214 for (
int iside = 0; iside < sides; iside++ ) {
215 midSide [ iside ].
resize(3);
217 int nd1 = sideNode [ iside ] [ 0 ] - 1;
218 int nd2 = sideNode [ iside ] [ 1 ] - 1;
220 midSide [ iside ].
at(1) = ( corner [ nd1 ].
at(1) + corner [ nd2 ].at(1) ) / 2.0;
221 midSide [ iside ].
at(2) = ( corner [ nd1 ].
at(2) + corner [ nd2 ].at(2) ) / 2.0;
222 midSide [ iside ].
at(3) = ( corner [ nd1 ].
at(3) + corner [ nd2 ].at(3) ) / 2.0;
227 midNode.
at(1) = x / nodes;
228 midNode.
at(2) = y / nodes;
229 midNode.
at(3) = z / nodes;
231 for (
int iface = 0; iface < faces; iface++ ) {
233 for (
int inode = 0; inode < 3; inode++ ) {
234 int nd = faceNode [ iface ] [ inode ] - 1;
235 x += corner [ nd ].
at(1);
236 y += corner [ nd ].
at(2);
237 z += corner [ nd ].
at(3);
240 midFace [ iface ].
resize(3);
242 midFace [ iface ].
at(1) = x / 3;
243 midFace [ iface ].
at(2) = y / 3;
244 midFace [ iface ].
at(3) = z / 3;
249 sMode, tStep, nodes, corner, midSide, midFace, midNode,
250 localNodeId, localElemId, localBcId, hexaSideNode, hexaFaceNode,
251 controlNode, controlDof, aMode,
"LSpace");
267 if ( !
gc.testElementGraphicActivity(
this) ) {
272 EASValsSetColor(
gc.getElementColor() );
273 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
274 EASValsSetEdgeFlag(
true);
276 EASValsSetFillStyle(FILL_SOLID);
277#ifdef __MPI_PARALLEL_MODE
279 EASValsSetColor(
gc.getRemoteElementColor() );
280 EASValsSetEdgeColor(
gc.getRemoteElementEdgeColor() );
283 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveCoordinate(1);
284 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveCoordinate(2);
285 p [ 0 ].z = ( FPNum ) this->
giveNode(1)->giveCoordinate(3);
286 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveCoordinate(1);
287 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveCoordinate(2);
288 p [ 1 ].z = ( FPNum ) this->
giveNode(2)->giveCoordinate(3);
289 p [ 2 ].x = ( FPNum ) this->
giveNode(3)->giveCoordinate(1);
290 p [ 2 ].y = ( FPNum ) this->
giveNode(3)->giveCoordinate(2);
291 p [ 2 ].z = ( FPNum ) this->
giveNode(3)->giveCoordinate(3);
292 p [ 3 ].x = ( FPNum ) this->
giveNode(4)->giveCoordinate(1);
293 p [ 3 ].y = ( FPNum ) this->
giveNode(4)->giveCoordinate(2);
294 p [ 3 ].z = ( FPNum ) this->
giveNode(4)->giveCoordinate(3);
297 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
298 EGAttachObject(go, ( EObjectP )
this);
299 EMAddGraphicsToModel(ESIModel(), go);
307 double defScale =
gc.getDefScale();
309 if ( !
gc.testElementGraphicActivity(
this) ) {
314 EASValsSetColor(
gc.getDeformedElementColor() );
315 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
316 EASValsSetEdgeFlag(
true);
318 EASValsSetFillStyle(FILL_SOLID);
319 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
320 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
321 p [ 0 ].z = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
322 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
323 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
324 p [ 1 ].z = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);
325 p [ 2 ].x = ( FPNum ) this->
giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
326 p [ 2 ].y = ( FPNum ) this->
giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
327 p [ 2 ].z = ( FPNum ) this->
giveNode(3)->giveUpdatedCoordinate(3, tStep, defScale);
328 p [ 3 ].x = ( FPNum ) this->
giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
329 p [ 3 ].y = ( FPNum ) this->
giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
330 p [ 3 ].z = ( FPNum ) this->
giveNode(4)->giveUpdatedCoordinate(3, tStep, defScale);
333 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
334 EMAddGraphicsToModel(ESIModel(), go);
340 int i, indx, result = 0;
344 double s [ 4 ], defScale = 0.0;
346 if ( !
gc.testElementGraphicActivity(
this) ) {
351 for ( i = 1; i <= 4; i++ ) {
361 if (
giveIPValue(v [ 0 ], gp,
gc.giveIntVarType(), tStep) == 0 ) {
369 indx =
gc.giveIntVarIndx();
371 for ( i = 1; i <= 4; i++ ) {
372 s [ i - 1 ] = v [ i - 1 ].
at(indx);
375 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
376 EASValsSetEdgeFlag(
true);
379 for ( i = 0; i < 4; i++ ) {
380 if (
gc.getInternalVarsDefGeoFlag() ) {
382 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
383 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
384 p [ i ].z = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
386 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
387 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
388 p [ i ].z = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(3);
392 gc.updateFringeTableMinMax(s, 4);
393 tr = CreateTetraWD(p, s);
394 EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
395 EMAddGraphicsToModel(ESIModel(), tr);
405 double defScale =
gc.getDefScale();
408 if ( !
gc.testElementGraphicActivity(
this) ) {
412 if (
gc.giveIntVarType() == IST_CrackState ) {
414 double xc, yc, zc,
length;
424 if ( this->
giveIPValue(cf, gp, IST_CrackedFlag, tStep) == 0 ) {
428 if ( (
int ) cf.
at(1) == 0 ) {
436 for ( i = 0; i < 4; i++ ) {
437 if (
gc.getInternalVarsDefGeoFlag() ) {
439 xc += ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
440 yc += ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
441 zc += ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
443 xc += ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
444 yc += ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
445 zc += ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(3);
453 if ( this->
giveIPValue(crackDir, gp, IST_CrackDirs, tStep) ) {
454 this->
giveIPValue(crackStatuses, gp, IST_CrackStatuses, tStep);
457 for ( i = 1; i <= 3; i++ ) {
458 crackStatus = ( int ) crackStatuses.
at(i);
466 }
else if ( i == 2 ) {
474 q [ 0 ].x = ( FPNum ) xc + 0.5 * crackDir.
at(0 + j) *
length + 0.5 * crackDir.
at(0 + k) *
length;
475 q [ 0 ].y = ( FPNum ) yc + 0.5 * crackDir.
at(3 + j) *
length + 0.5 * crackDir.
at(3 + k) *
length;
476 q [ 0 ].z = ( FPNum ) zc + 0.5 * crackDir.
at(6 + j) *
length + 0.5 * crackDir.
at(6 + k) *
length;
477 q [ 1 ].x = ( FPNum ) xc + 0.5 * crackDir.
at(0 + j) *
length - 0.5 * crackDir.
at(0 + k) *
length;
478 q [ 1 ].y = ( FPNum ) yc + 0.5 * crackDir.
at(3 + j) *
length - 0.5 * crackDir.
at(3 + k) *
length;
479 q [ 1 ].z = ( FPNum ) zc + 0.5 * crackDir.
at(6 + j) *
length - 0.5 * crackDir.
at(6 + k) *
length;
480 q [ 2 ].x = ( FPNum ) xc - 0.5 * crackDir.
at(0 + j) *
length - 0.5 * crackDir.
at(0 + k) *
length;
481 q [ 2 ].y = ( FPNum ) yc - 0.5 * crackDir.
at(3 + j) *
length - 0.5 * crackDir.
at(3 + k) *
length;
482 q [ 2 ].z = ( FPNum ) zc - 0.5 * crackDir.
at(6 + j) *
length - 0.5 * crackDir.
at(6 + k) *
length;
483 q [ 3 ].x = ( FPNum ) xc - 0.5 * crackDir.
at(0 + j) *
length + 0.5 * crackDir.
at(0 + k) *
length;
484 q [ 3 ].y = ( FPNum ) yc - 0.5 * crackDir.
at(3 + j) *
length + 0.5 * crackDir.
at(3 + k) *
length;
485 q [ 3 ].z = ( FPNum ) zc - 0.5 * crackDir.
at(6 + j) *
length + 0.5 * crackDir.
at(6 + k) *
length;
490 EASValsSetColor(
gc.getActiveCrackColor() );
492 EASValsSetColor(
gc.getCrackPatternColor() );
496 tr = CreateQuad3D(q);
497 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, tr);
498 EMAddGraphicsToModel(ESIModel(), tr);
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)
#define OOFEG_CRACK_PATTERN_LAYER
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_VARPLOT_PATTERN_LAYER
#define OOFEG_DEFORMED_GEOMETRY_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER
#define OOFEG_CRACK_PATTERN_WIDTH