151TrPlaneStrain :: HuertaErrorEstimatorI_setupRefinedElementProblem(
RefinedElement *refinedElement,
int level,
int nodeId,
153 HuertaErrorEstimatorInterface :: SetupMode sMode,
TimeStep *tStep,
154 int &localNodeId,
int &localElemId,
int &localBcId,
156 HuertaErrorEstimator :: AnalysisMode aMode)
158 int nodes = 3, sides = 3;
159 FloatArray corner [ 3 ], midSide [ 3 ], midNode, cor [ 3 ];
160 double x = 0.0, y = 0.0;
162 static int sideNode [ 3 ] [ 2 ] = { { 1, 2 }, { 2, 3 }, { 3, 1 } };
164 if ( sMode == HuertaErrorEstimatorInterface :: NodeMode ||
165 ( sMode == HuertaErrorEstimatorInterface :: BCMode && aMode == HuertaErrorEstimator :: HEE_linear ) ) {
166 for (
int inode = 0; inode < nodes; inode++ ) {
167 corner [ inode ] = this->
giveNode(inode + 1)->giveCoordinates();
168 if ( corner [ inode ].giveSize() != 3 ) {
170 cor [ inode ].
at(1) = corner [ inode ].
at(1);
171 cor [ inode ].
at(2) = corner [ inode ].
at(2);
172 cor [ inode ].
at(3) = 0.0;
174 corner [ inode ] = cor [ inode ];
177 x += corner [ inode ].
at(1);
178 y += corner [ inode ].
at(2);
181 for (
int iside = 0; iside < sides; iside++ ) {
182 midSide [ iside ].
resize(3);
184 int nd1 = sideNode [ iside ] [ 0 ] - 1;
185 int nd2 = sideNode [ iside ] [ 1 ] - 1;
187 midSide [ iside ].
at(1) = ( corner [ nd1 ].
at(1) + corner [ nd2 ].at(1) ) / 2.0;
188 midSide [ iside ].
at(2) = ( corner [ nd1 ].
at(2) + corner [ nd2 ].at(2) ) / 2.0;
189 midSide [ iside ].
at(3) = 0.0;
194 midNode.
at(1) = x / nodes;
195 midNode.
at(2) = y / nodes;
200 sMode, tStep, nodes, corner, midSide, midNode,
201 localNodeId, localElemId, localBcId,
202 controlNode, controlDof, aMode,
"Quad1PlaneStrain");
221 if ( !
gc.testElementGraphicActivity(
this) ) {
226 EASValsSetColor(
gc.getElementColor() );
227 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
228 EASValsSetEdgeFlag(
true);
230 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveCoordinate(1);
231 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveCoordinate(2);
233 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveCoordinate(1);
234 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveCoordinate(2);
236 p [ 2 ].x = ( FPNum ) this->
giveNode(3)->giveCoordinate(1);
237 p [ 2 ].y = ( FPNum ) this->
giveNode(3)->giveCoordinate(2);
240 go = CreateTriangle3D(p);
241 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
242 EGAttachObject(go, ( EObjectP )
this);
243 EMAddGraphicsToModel(ESIModel(), go);
251 double defScale =
gc.getDefScale();
253 if ( !
gc.testElementGraphicActivity(
this) ) {
258 EASValsSetColor(
gc.getDeformedElementColor() );
259 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
260 EASValsSetEdgeFlag(
true);
262 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
263 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
265 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
266 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
268 p [ 2 ].x = ( FPNum ) this->
giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
269 p [ 2 ].y = ( FPNum ) this->
giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
272 go = CreateTriangle3D(p);
273 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
274 EMAddGraphicsToModel(ESIModel(), go);
280 int i, indx, result = 0;
284 double s [ 3 ], defScale;
286 if ( !
gc.testElementGraphicActivity(
this) ) {
306 indx =
gc.giveIntVarIndx();
308 s [ 0 ] = v1.
at(indx);
309 s [ 1 ] = v2.
at(indx);
310 s [ 2 ] = v3.
at(indx);
315 for ( i = 0; i < 3; i++ ) {
316 if (
gc.getInternalVarsDefGeoFlag() ) {
318 defScale =
gc.getDefScale();
319 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
320 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
323 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
324 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
330 gc.updateFringeTableMinMax(s, 3);
331 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
332 EGWithMaskChangeAttributes(LAYER_MASK, tr);
333 EMAddGraphicsToModel(ESIModel(), tr);
335 double landScale =
gc.getLandScale();
337 for ( i = 0; i < 3; i++ ) {
338 if (
gc.getInternalVarsDefGeoFlag() ) {
340 defScale =
gc.getDefScale();
341 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
342 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
343 p [ i ].z = s [ i ] * landScale;
345 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
346 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
347 p [ i ].z = s [ i ] * landScale;
352 EASValsSetColor(
gc.getDeformedElementColor() );
354 EASValsSetFillStyle(FILL_SOLID);
355 tr = CreateTriangle3D(p);
356 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
358 gc.updateFringeTableMinMax(s, 3);
359 EASValsSetFillStyle(FILL_SOLID);
360 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
361 EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
364 EMAddGraphicsToModel(ESIModel(), tr);
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)
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