63FEI2dTrLin TR1_2D_PFEM :: velocityInterpolation(1, 2);
64FEI2dTrLin TR1_2D_PFEM :: pressureInterpolation(1, 2);
66IntArray TR1_2D_PFEM :: edge_ordering [ 3 ] = {
70IntArray TR1_2D_PFEM :: velocityDofMask = {
73IntArray TR1_2D_PFEM :: pressureDofMask = {
78TR1_2D_PFEM :: TR1_2D_PFEM(
int n,
Domain *aDomain,
int particle1,
int particle2,
int particle3,
int mat,
int cs) :
84 aBodyLoadArry.
at(1) = 3;
93TR1_2D_PFEM :: ~TR1_2D_PFEM()
98TR1_2D_PFEM :: computeNumberOfDofs()
104TR1_2D_PFEM :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
113TR1_2D_PFEM :: giveElementDofIDMask(
IntArray &answer)
const
122 PFEMElement :: initializeFrom(ir, priority);
128TR1_2D_PFEM :: computeGaussPoints()
150 for (
auto &gp : *iRule ) {
153 double dA = detJ * gp->giveWeight();
155 for (
int j = 0; j < 3; j++ ) {
156 answer(2 * j) +=
N(j) * rho * gVector(0) * dA;
157 answer(2 * j + 1) +=
N(j) * rho * gVector(1) * dA;
175 int numberOfEdgeIPs = ( int ) ceil( ( boundaryLoad->
giveApproxOrder() + 1. ) / 2. ) * 2;
184 for (
auto &gp : iRule ) {
185 const FloatArray &lcoords = gp->giveNaturalCoordinates();
198 for (
int j = 0; j < 3; j++ ) {
199 f(2 * j) +=
N(j) * t(0) * dS;
200 f(2 * j + 1) +=
N(j) * t(1) * dS;
217 double mm = rho * this->
area / 3.0;
218 for (
int i = 1; i <= 6; i++ ) {
229 double mm = rho * this->
area / 3.0;
230 for (
int i = 1; i <= 6; i++ ) {
231 answer.
at(i, i) = mm;
252 eps.
at(1) = (
b [ 0 ] * u.
at(1) +
b [ 1 ] * u.
at(3) +
b [ 2 ] * u.
at(5) );
253 eps.
at(2) = (
c [ 0 ] * u.
at(2) +
c [ 1 ] * u.
at(4) +
c [ 2 ] * u.
at(6) );
254 eps.
at(3) = (
b [ 0 ] * u.
at(2) +
b [ 1 ] * u.
at(4) +
b [ 2 ] * u.
at(6) +
c [ 0 ] * u.
at(1) +
c [ 1 ] * u.
at(3) +
c [ 2 ] * u.
at(5) );
269 for (
int i = 0; i < 3; i++ ) {
270 answer.
at( ( i ) * 2 + 1 ) =
area * ( stress.
at(1) *
b [ i ] + stress.
at(3) *
c [ i ] );
271 answer.
at( ( i + 1 ) * 2 ) =
area * ( stress.
at(3) *
b [ i ] + stress.
at(2) *
c [ i ] );
276TR1_2D_PFEM :: checkConsistency()
278 Node *node1, *node2, *node3;
279 double x1, x2, x3, y1, y2, y3;
294 this->
area = 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 );
296 b [ 0 ] = ( y2 - y3 ) / ( 2. *
area );
297 c [ 0 ] = ( x3 - x2 ) / ( 2. *
area );
298 b [ 1 ] = ( y3 - y1 ) / ( 2. *
area );
299 c [ 1 ] = ( x1 - x3 ) / ( 2. *
area );
300 b [ 2 ] = ( y1 - y2 ) / ( 2. *
area );
301 c [ 2 ] = ( x2 - x1 ) / ( 2. *
area );
303 return PFEMElement2d :: checkConsistency();
307TR1_2D_PFEM :: computeCriticalTimeStep(
TimeStep *tStep)
309 double deltaT =
domain->giveEngngModel()->giveSolutionStepWhenIcApply()->giveTimeIncrement();
329 double x1, x2, x3, y1, y2, y3;
367 double factor = s21.
dotProduct(s23) / s23.dotProduct(s23);
368 foot1.
add(factor, s23);
374 foot2.
add(factor, s31);
379 factor = s13.
dotProduct(s12) / s12.dotProduct(s12);
380 foot3.
add(factor, s12);
385 double dt1(deltaT), dt2(deltaT), dt3(deltaT);
387 double u1_proj = u1.dotProduct(altitude1) / altitude1.
computeNorm();
388 if ( u1_proj > 1.e-6 ) {
392 double u2_proj = u2.dotProduct(altitude2) / altitude2.
computeNorm();
393 if ( u2_proj > 1.e-6 ) {
398 if ( u3_proj > 1.e-6 ) {
402 double dt_min =
min( dt1,
min(dt2, dt3) );
410 PFEMElement2d :: saveContext(stream, mode);
416 PFEMElement2d :: restoreContext(stream, mode);
434 if ( type == IST_VOFFraction ) {
440 if ( type == IST_Density ) {
445 return PFEMElement :: giveInternalStateAtNode(answer, type, mode, node, atTime);
455 if ( !
gc.testElementGraphicActivity(
this) ) {
460 EASValsSetColor(
gc.getElementColor() );
461 EASValsSetEdgeColor(
gc.getElementEdgeColor() );
462 EASValsSetEdgeFlag(TRUE);
464 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveCoordinate(1);
465 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveCoordinate(2);
467 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveCoordinate(1);
468 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveCoordinate(2);
470 p [ 2 ].x = ( FPNum ) this->
giveNode(3)->giveCoordinate(1);
471 p [ 2 ].y = ( FPNum ) this->
giveNode(3)->giveCoordinate(2);
474 go = CreateTriangle3D(p);
475 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
476 EGAttachObject(go, ( EObjectP )
this);
477 EMAddGraphicsToModel(ESIModel(), go);
482 int i, indx, result = 0;
512 s [ 0 ] = v1.
at(indx);
513 s [ 1 ] = v2.
at(indx);
514 s [ 2 ] = v3.
at(indx);
519 for ( i = 0; i < 3; i++ ) {
520 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
521 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
527 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
528 EGWithMaskChangeAttributes(LAYER_MASK, tr);
529 EMAddGraphicsToModel(ESIModel(), tr);
533 for ( i = 0; i < 3; i++ ) {
534 p [ i ].x = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(1);
535 p [ i ].y = ( FPNum ) this->
giveNode(i + 1)->giveCoordinate(2);
536 p [ i ].z = s [ i ] * landScale;
542 EASValsSetFillStyle(FILL_SOLID);
543 tr = CreateTriangle3D(p);
544 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
547 EASValsSetFillStyle(FILL_SOLID);
548 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
549 EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
552 EMAddGraphicsToModel(ESIModel(), tr);
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
double giveCoordinate(int i) const
Node * giveNode(int i) const
void setBodyLoads(const IntArray &bodyLoads)
virtual void setCrossSection(int csIndx)
void setDofManagers(const IntArray &dmans)
int numberOfDofMans
Number of dofmanagers.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
void postInitialize() override
Performs post initialization steps.
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
int material
Number of associated material.
CrossSection * giveCrossSection()
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Domain * giveDomain() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double & at(std::size_t i)
double computeNorm() const
void assemble(const FloatArray &fe, const IntArray &loc)
double dotProduct(const FloatArray &x) const
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void add(const FloatArray &src)
void subtract(const FloatArray &src)
void resize(Index rows, Index cols)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
virtual std::pair< FloatArrayF< 3 >, double > computeDeviatoricStress2D(const FloatArrayF< 3 > &eps, double pressure, GaussPoint *gp, TimeStep *tStep) const
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
double giveWeight()
Returns integration weight of receiver.
virtual bcType giveType() const
void zero()
Sets all component to zero.
int setUpIntegrationPoints(integrationDomain intdomain, int nPoints, MaterialMode matMode)
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual FormulationType giveFormulationType()
PFEMElement2d(int n, Domain *d)
Constructor.
void computeDeviatoricStress(FloatArray &answer, GaussPoint *gp, TimeStep *tStep) override
Computes deviatoric stress vector in given integration point and solution step from given total strai...
static FEI2dTrLin pressureInterpolation
Interpolation for pressure unknowns.
void computeGaussPoints() override
void giveDofManDofIDMask(int inode, IntArray &answer) const override
static FEI2dTrLin velocityInterpolation
Interpolation for velocity unknowns.
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *atTime) override
static IntArray edge_ordering[3]
int testElementGraphicActivity(Element *)
EPixel getDeformedElementColor()
void updateFringeTableMinMax(double *s, int size)
InternalStateType giveIntVarType()
InternalStateMode giveIntVarMode()
ScalarAlgorithmType getScalarAlgo()
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
InternalStateMode
Determines the mode of internal variable.
@ TransmissionBC
Neumann type (prescribed flux).
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_VARPLOT_PATTERN_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER