35 #include "../sm/Elements/PlaneStress/trplanrot.h" 36 #include "../sm/CrossSections/structuralcrosssection.h" 37 #include "../sm/Materials/structuralms.h" 93 for (
int i = 1; i <= 3; i++ ) {
94 int j = i + 1 - i / 3 * 3;
95 int k = j + 1 - j / 3 * 3;
96 b.at(i) = y.
at(j) - y.
at(k);
97 c.
at(i) = x.at(k) - x.at(j);
109 FloatArray shapeFunct = { center.
at(1), center.at(2), 1.0 - center.at(1) - center.at(2) };
112 double detJ = 1.0 / ( 2.0 *
area );
114 for (
int i = 1; i <= 3; i++ ) {
115 answer.
at(1, 3 * i - 2) = b.at(i) * detJ;
116 answer.
at(1, 3 * i - 0) = nx.
at(i) * detJ;
118 answer.
at(2, 3 * i - 1) = c.
at(i) * detJ;
119 answer.
at(2, 3 * i - 0) = ny.at(i) * detJ;
123 answer.
at(3, 3 * i - 2) = c.
at(i) * detJ;
124 answer.
at(3, 3 * i - 1) = b.at(i) * detJ;
125 answer.
at(3, 3 * i - 0) = ( nxRed.
at(i) + nyRed.
at(i) ) * detJ;
128 answer.
at(4, 3 * i - 2) = -1. * c.
at(i) * 1.0 / 4.0 /
area;
129 answer.
at(4, 3 * i - 1) = b.at(i) * 1.0 / 4.0 /
area;
130 answer.
at(4, 3 * i - 0) = ( -4. * area * shapeFunct.
at(i) + nxRed.
at(i) - nyRed.
at(i) ) * 1.0 / 4.0 / area;
144 for (
int i = 1; i <= 3; i++ ) {
145 int j = i + 1 - i / 3 * 3;
146 int k = j + 1 - j / 3 * 3;
147 b.at(i) = y.
at(j) - y.
at(k);
148 c.
at(i) = x.at(k) - x.at(j);
164 if ( ( size < 0 ) || ( size > 4 ) ) {
177 if ( ( li <= 1 ) && ( ui >= 1 ) ) {
178 for (
int i = 1; i <= 3; i++ ) {
179 answer.
at(1, 3 * i - 2) = b.at(i) * 1. / ( 2. *
area );
180 answer.
at(1, 3 * i - 0) = nx.
at(i) * 1. / ( 2. *
area );
186 if ( ( li <= 2 ) && ( ui >= 2 ) ) {
187 for (
int i = 1; i <= 3; i++ ) {
188 answer.
at(2, 3 * i - 1) = c.
at(i) * 1. / ( 2. *
area );
189 answer.
at(2, 3 * i - 0) = ny.at(i) * 1. / ( 2. *
area );
196 if ( ( li <= 3 ) && ( ui >= 3 ) ) {
203 for (
int i = 1; i <= 3; i++ ) {
204 answer.
at(3, 3 * i - 2) = c.
at(i) * 1. / ( 2. *
area );
205 answer.
at(3, 3 * i - 1) = b.at(i) * 1. / ( 2. *
area );
206 answer.
at(3, 3 * i - 0) = ( nx.
at(i) + ny.at(i) ) * 1. / ( 2. * area );
212 if ( ( li <= 4 ) && ( ui >= 4 ) ) {
221 shapeFunct.
at(1) = center.
at(1);
222 shapeFunct.
at(2) = center.
at(2);
223 shapeFunct.
at(3) = 1.0 - shapeFunct.
at(1) - shapeFunct.
at(2);
225 for (
int i = 1; i <= 3; i++ ) {
226 answer.
at(ind, 3 * i - 2) = -1. * c.
at(i) * 1.0 / 4.0 /
area;
227 answer.
at(ind, 3 * i - 1) = b.at(i) * 1.0 / 4.0 /
area;
228 answer.
at(ind, 3 * i - 0) = ( -4. * area * shapeFunct.
at(i) + nx.
at(i) - ny.
at(i) ) * 1.0 / 4.0 / area;
252 for (
int i = 1; i <= 3; i++ ) {
253 int j = i + 1 - i / 3 * 3;
254 int k = j + 1 - j / 3 * 3;
255 b.at(i) = y.
at(j) - y.
at(k);
256 c.at(i) = x.at(k) - x.at(j);
257 d.
at(i) = sqrt( b.at(i) * b.at(i) + c.at(i) * c.at(i) );
264 double l1, l2, l3, f11, f12, f13, f21, f22, f23;
266 l1 = iLocCoord.
at(1);
267 l2 = iLocCoord.
at(2);
270 f11 = d.
at(2) / 2. *l1 *l3 *sin( angles.at(2) ) - d.
at(3) / 2. *l2 *l1 *sin( angles.at(3) );
271 f12 = d.
at(3) / 2. *l2 *l1 *sin( angles.at(3) ) - d.
at(1) / 2. *l3 *l2 *sin( angles.at(1) );
272 f13 = d.
at(1) / 2. *l3 *l2 *sin( angles.at(1) ) - d.
at(2) / 2. *l1 *l3 *sin( angles.at(2) );
274 f21 = d.
at(3) / 2. *l2 *l1 *cos( angles.at(3) ) - d.
at(2) / 2. *l1 *l3 *cos( angles.at(2) );
275 f22 = d.
at(1) / 2. *l3 *l2 *cos( angles.at(1) ) - d.
at(3) / 2. *l2 *l1 *cos( angles.at(3) );
276 f23 = d.
at(2) / 2. *l1 *l3 *cos( angles.at(2) ) - d.
at(1) / 2. *l3 *l2 *cos( angles.at(1) );
282 answer.
at(1, 1) = l1;
283 answer.
at(1, 3) = f11;
284 answer.
at(1, 4) = l2;
285 answer.
at(1, 6) = f12;
286 answer.
at(1, 7) = l3;
287 answer.
at(1, 9) = f13;
289 answer.
at(2, 2) = l1;
290 answer.
at(2, 3) = f21;
291 answer.
at(2, 5) = l2;
292 answer.
at(2, 6) = f22;
293 answer.
at(2, 8) = l3;
294 answer.
at(2, 9) = f23;
296 answer.
at(3, 3) = l1;
297 answer.
at(3, 6) = l2;
298 answer.
at(3, 9) = l3;
316 double x1, x2, x3, y1, y2, y3;
325 return (
area = fabs( 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 ) ) );
338 x.
at(1) = nc1->
at(1);
339 x.
at(2) = nc2->
at(1);
340 x.
at(3) = nc3->
at(1);
342 y.
at(1) = nc1->
at(2);
343 y.
at(2) = nc2->
at(2);
344 y.
at(3) = nc3->
at(2);
365 for (
int i = 0; i < 3; i++ ) {
366 int j = i + 1 - i / 2 * 3;
367 int k = j + 1 - j / 2 * 3;
368 if ( x(k) == x(j) ) {
370 angles.
at(i + 1) =
M_PI / 2.;
372 angles.
at(i + 1) =
M_PI * 3. / 2.;
377 if ( y(k) >= y(j) ) {
378 angles.
at(i + 1) = atan( ( y(k) - y(j) ) / ( x(k) - x(j) ) );
380 angles.
at(i + 1) = 2. *
M_PI - atan( ( y(j) - y(k) ) / ( x(k) - x(j) ) );
385 if ( y(k) >= y(j) ) {
386 angles.
at(i + 1) =
M_PI - atan( ( y(k) - y(j) ) / ( x(j) - x(k) ) );
388 angles.
at(i + 1) =
M_PI + atan( ( y(j) - y(k) ) / ( x(j) - x(k) ) );
407 for (
int i = 1; i <= 3; i++ ) {
408 int j = i + 1 - i / 3 * 3;
409 int k = j + 1 - j / 3 * 3;
410 b.at(i) = y.
at(j) - y.
at(k);
411 c.at(i) = x.at(k) - x.at(j);
412 d.
at(i) = sqrt( b.at(i) * b.at(i) + c.at(i) * c.at(i) );
420 shapeFunct.
at(1) = lCoords.
at(1);
421 shapeFunct.
at(2) = lCoords.
at(2);
422 shapeFunct.
at(3) = 1.0 - shapeFunct.
at(1) - shapeFunct.
at(2);
427 for (
int i = 1; i <= 3; i++ ) {
428 int j = i + 1 - i / 3 * 3;
429 int k = j + 1 - j / 3 * 3;
430 nx.
at(i) = ( d.
at(j) / 2. * ( b.at(k) * shapeFunct.
at(i) + shapeFunct.
at(k) * b.at(i) ) * sin( angles.at(j) ) -
431 d.
at(k) / 2. * ( b.at(i) * shapeFunct.
at(j) + shapeFunct.
at(i) * b.at(j) ) * sin( angles.at(k) ) );
448 for (
int i = 1; i <= 3; i++ ) {
449 int j = i + 1 - i / 3 * 3;
450 int k = j + 1 - j / 3 * 3;
451 b.at(i) = y.
at(j) - y.
at(k);
452 c.at(i) = x.at(k) - x.at(j);
453 d.
at(i) = sqrt( b.at(i) * b.at(i) + c.at(i) * c.at(i) );
461 shapeFunct.
at(1) = lCoords.
at(1);
462 shapeFunct.
at(2) = lCoords.
at(2);
463 shapeFunct.
at(3) = 1.0 - shapeFunct.
at(1) - shapeFunct.
at(2);
468 for (
int i = 1; i <= 3; i++ ) {
469 int j = i + 1 - i / 3 * 3;
470 int k = j + 1 - j / 3 * 3;
471 nx.
at(i) = ( d.
at(j) / 2. * ( b.at(k) * shapeFunct.
at(i) + shapeFunct.
at(k) * b.at(i) ) * cos( angles.at(j) ) -
472 d.
at(k) / 2. * ( b.at(i) * shapeFunct.
at(j) + shapeFunct.
at(i) * b.at(j) ) * cos( angles.at(k) ) ) * ( -1.0 );
489 for (
int i = 1; i <= 3; i++ ) {
490 int j = i + 1 - i / 3 * 3;
491 int k = j + 1 - j / 3 * 3;
492 b.at(i) = y.
at(j) - y.
at(k);
493 c.at(i) = x.at(k) - x.at(j);
494 d.
at(i) = sqrt( b.at(i) * b.at(i) + c.at(i) * c.at(i) );
502 shapeFunct.
at(1) = lCoords.
at(1);
503 shapeFunct.
at(2) = lCoords.
at(2);
504 shapeFunct.
at(3) = 1.0 - shapeFunct.
at(1) - shapeFunct.
at(2);
509 for (
int i = 1; i <= 3; i++ ) {
510 int j = i + 1 - i / 3 * 3;
511 int k = j + 1 - j / 3 * 3;
512 ny.
at(i) = ( d.
at(j) / 2. * ( c.at(k) * shapeFunct.
at(i) + shapeFunct.
at(k) * c.at(i) ) * sin( angles.at(j) ) -
513 d.
at(k) / 2. * ( c.at(i) * shapeFunct.
at(j) + shapeFunct.
at(i) * c.at(j) ) * sin( angles.at(k) ) );
530 for (
int i = 1; i <= 3; i++ ) {
531 int j = i + 1 - i / 3 * 3;
532 int k = j + 1 - j / 3 * 3;
533 b.at(i) = y.
at(j) - y.
at(k);
534 c.at(i) = x.at(k) - x.at(j);
535 d.
at(i) = sqrt( b.at(i) * b.at(i) + c.at(i) * c.at(i) );
543 shapeFunct.
at(1) = lCoords.
at(1);
544 shapeFunct.
at(2) = lCoords.
at(2);
545 shapeFunct.
at(3) = 1.0 - shapeFunct.
at(1) - shapeFunct.
at(2);
550 for (
int i = 1; i <= 3; i++ ) {
551 int j = i + 1 - i / 3 * 3;
552 int k = j + 1 - j / 3 * 3;
553 ny.
at(i) = ( d.
at(j) / 2. * ( c.at(k) * shapeFunct.
at(i) + shapeFunct.
at(k) * c.at(i) ) * cos( angles.at(j) ) -
554 d.
at(k) / 2. * ( c.at(i) * shapeFunct.
at(j) + shapeFunct.
at(i) * c.at(j) ) * cos( angles.at(k) ) ) * ( -1.0 );
584 OOFEM_ERROR(
"numberOfRotGaussPoints size mismatch - must be equal to one");
610 answer = {D_u, D_v, R_w};
622 double dens, dV, load;
642 load = force.
at(1) * dens * dV / 3.0;
647 load = force.
at(2) * dens * dV / 3.0;
676 if ( type == IST_StressTensor ) {
678 answer = {help.
at(1), help.
at(2), 0., 0., 0., help.
at(3)};
680 }
else if ( type == IST_StrainTensor ) {
682 answer = {help.
at(1), help.
at(2), 0., 0., 0., help.
at(3)};
CrossSection * giveCrossSection()
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual void giveGeneralizedStress_MembraneRot(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual void giveDofManDofIDMask(int inode, IntArray &) const
Returns dofmanager dof mask for node.
virtual double giveArea()
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int=1, int=ALL_STRAINS)
Computes the geometrical matrix of receiver in given integration point.
This class implements a structural material status information.
void clear()
Clears receiver (zero size).
FloatArray GiveDerivativeUX(const FloatArray &lCoords)
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *forLoad, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
virtual void giveNodeCoordinates(FloatArray &x, FloatArray &y)
Class implementing an array of integers.
MatResponseMode
Describes the character of characteristic material matrix.
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
virtual void giveMembraneRotStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Method for computing membrane stiffness matrix with added drilling stiffness.
FloatArray GiveDerivativeVY(const FloatArray &lCoords)
FloatArray GiveDerivativeVX(const FloatArray &lCoords)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
virtual void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
Computes the stress vector of receiver at given integration point, at time step tStep.
double at(int i, int j) const
Coefficient access function.
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
int numberOfGaussPoints
Number of integration points as specified by nip.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
int numberOfRotGaussPoints
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual double give(CrossSectionProperty a, GaussPoint *gp)
Returns the value of cross section property at given point.
GaussPoint * getIntegrationPoint(int n)
Access particular integration point of receiver.
double giveCharacteristicLengthForPlaneElements(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction if the direction is in the XY plane, otherwise gives the mean size defined as the square root of the element area.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
This class implements an triangular three-node plane-stress elasticity finite element.
void zero()
Zeroes all coefficients of receiver.
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
virtual FloatArray * giveCoordinates()
void zero()
Zeroes all coefficient of receiver.
#define _IFT_TrPlaneStrRot_niprot
Load is base abstract class for all loads.
virtual bool computeGtoLRotationMatrix(FloatMatrix &answer)
Returns transformation matrix from global c.s.
int giveSize() const
Returns the size of receiver.
Abstract base class for all structural cross section models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual bcValType giveBCValType() const
Returns receiver load type.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
TrPlaneStrRot(int, Domain *)
FloatArray GiveDerivativeUY(const FloatArray &lCoords)
virtual double giveCharacteristicLength(const FloatArray &normalToCrackPlane)
Returns the size of element in the given direction, in some cases adjusted (e.g.
Class representing integration point in finite element program.
Class representing solution step.
int numberOfDofMans
Number of dofmanagers.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
virtual int SetUpPointsOnTriangle(int nPoints, MaterialMode mode)
Sets up receiver's integration points on triangular (area coords) integration domain.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.