35 #include "../sm/Elements/Beams/libeam3dnl2.h" 36 #include "../sm/CrossSections/structuralcrosssection.h" 37 #include "../sm/Materials/structuralms.h" 77 answer.
at(1, 1) = answer.
at(2, 2) = answer.
at(3, 3) = 0.;
78 answer.
at(1, 2) = -vec.
at(3);
79 answer.
at(1, 3) = vec.
at(2);
80 answer.
at(2, 1) = vec.
at(3);
81 answer.
at(2, 3) = -vec.
at(1);
82 answer.
at(3, 1) = -vec.
at(2);
83 answer.
at(3, 2) = vec.
at(1);
101 answer.
at(1, 1) = answer.
at(2, 2) = answer.
at(3, 3) = 1.;
103 if ( psiSize <= 1.e-40 ) {
109 S.times(sin(psiSize) / psiSize);
110 SS.
times( ( 1. - cos(psiSize) ) / ( psiSize * psiSize ) );
124 double centreSpinSize;
130 centreSpin.at(1) = 0.5 * ( u.
at(4) + u.
at(10) );
131 centreSpin.at(2) = 0.5 * ( u.
at(5) + u.
at(11) );
132 centreSpin.at(3) = 0.5 * ( u.
at(6) + u.
at(12) );
134 centreSpinSize = centreSpin.computeNorm();
135 if ( centreSpinSize > 1.e-30 ) {
136 centreSpin.normalize();
137 q2.
at(1) = sin(centreSpinSize / 2.) * centreSpin.at(1);
138 q2.
at(2) = sin(centreSpinSize / 2.) * centreSpin.at(2);
139 q2.
at(3) = sin(centreSpinSize / 2.) * centreSpin.at(3);
140 q2.
at(4) = cos(centreSpinSize / 2.);
162 answer.
at(1, 1) = q.
at(4) * q.
at(4) + q.
at(1) * q.
at(1) - 0.5;
163 answer.
at(1, 2) = q.
at(1) * q.
at(2) - q.
at(3) * q.
at(4);
164 answer.
at(1, 3) = q.
at(1) * q.
at(3) + q.
at(2) * q.
at(4);
166 answer.
at(2, 1) = q.
at(2) * q.
at(1) + q.
at(3) * q.
at(4);
167 answer.
at(2, 2) = q.
at(4) * q.
at(4) + q.
at(2) * q.
at(2) - 0.5;
168 answer.
at(2, 3) = q.
at(2) * q.
at(3) - q.
at(1) * q.
at(4);
170 answer.
at(3, 1) = q.
at(3) * q.
at(1) - q.
at(2) * q.
at(4);
171 answer.
at(3, 2) = q.
at(3) * q.
at(2) + q.
at(1) * q.
at(4);
172 answer.
at(3, 3) = q.
at(4) * q.
at(4) + q.
at(3) * q.
at(3) - 0.5;
188 trR = R.
at(1, 1) + R.
at(2, 2) + R.
at(3, 3);
191 for ( i = 1; i <= 3; i++ ) {
192 if ( R.
at(i, i) > a ) {
200 answer.
at(4) = 0.5 * sqrt(1. + a);
201 answer.
at(1) = ( R.
at(3, 2) - R.
at(2, 3) ) / ( 4. * answer.
at(4) );
202 answer.
at(2) = ( R.
at(1, 3) - R.
at(3, 1) ) / ( 4. * answer.
at(4) );
203 answer.
at(3) = ( R.
at(2, 1) - R.
at(1, 2) ) / ( 4. * answer.
at(4) );
210 }
else if ( ii == 2 ) {
218 answer.
at(ii) = sqrt( 0.5 * a + 0.25 * ( 1. - trR ) );
219 answer.
at(4) = 0.25 * ( R.
at(kk, jj) - R.
at(jj, kk) ) / answer.
at(ii);
220 answer.
at(jj) = 0.25 * ( R.
at(jj, ii) + R.
at(ii, jj) ) / answer.
at(ii);
221 answer.
at(kk) = 0.25 * ( R.
at(kk, ii) + R.
at(ii, kk) ) / answer.
at(ii);
239 eps.beTProductOf(tempTc, xd);
240 eps.times(1. / this->
l0);
247 answer.
at(1) = eps.at(1);
248 answer.
at(2) = eps.at(2);
249 answer.
at(3) = eps.at(3);
250 answer.
at(4) = curv.
at(1);
251 answer.
at(5) = curv.
at(2);
252 answer.
at(6) = curv.
at(3);
268 for (
int i = 1; i < 4; i++ ) {
269 answer.
at(i, i) = -1.0;
270 answer.
at(i + 6, i) = 1.0;
271 answer.
at(i + 3, i + 3) = -1.0;
272 answer.
at(i + 9, i + 3) = 1.0;
274 for (
int j = 1; j < 4; j++ ) {
275 answer.
at(i + 3, j) = answer.
at(i + 9, j) = 0.5 * s.
at(j, i);
293 if ( useUpdatedGpRecord == 1 ) {
300 for (
int i = 1; i <= 3; i++ ) {
302 for (
int j = 1; j <= 3; j++ ) {
303 s1 += tempTc.
at(i, j) * stress.
at(j);
304 s2 += tempTc.
at(i, j) * stress.
at(j + 3);
338 FloatMatrix d, x, xt(12, 6), dxt, sn, sm, sxd, y, tempTc;
350 for (
int i = 1; i <= 12; i++ ) {
351 for (
int j = 1; j <= 3; j++ ) {
352 for (
int k = 1; k <= 3; k++ ) {
354 xt.at(i, j) += x.
at(i, k) * tempTc.
at(k, j);
355 xt.at(i, j + 3) += x.
at(i, k + 3) * tempTc.
at(k, j);
370 for (
int i = 1; i <= 3; i++ ) {
372 for (
int j = 1; j <= 3; j++ ) {
373 s1 += tempTc.
at(i, j) * stress.
at(j);
374 s2 += tempTc.
at(i, j) * stress.
at(j + 3);
384 for (
int i = 1; i <= 3; i++ ) {
385 for (
int j = 1; j <= 3; j++ ) {
386 answer.
at(i, j + 3) += sn.
at(i, j);
387 answer.
at(i, j + 9) += sn.
at(i, j);
388 answer.
at(i + 3, j + 3) += sm.
at(i, j);
389 answer.
at(i + 3, j + 9) += sm.
at(i, j);
391 answer.
at(i + 6, j + 3) -= sn.
at(i, j);
392 answer.
at(i + 6, j + 9) -= sn.
at(i, j);
393 answer.
at(i + 9, j + 3) -= sm.
at(i, j);
394 answer.
at(i + 9, j + 9) -= sm.
at(i, j);
405 for (
int i = 1; i <= 3; i++ ) {
406 for (
int j = 1; j <= 3; j++ ) {
407 answer.
at(i + 3, j) -= sn.
at(i, j);
408 answer.
at(i + 3, j + 3) += y.
at(i, j);
409 answer.
at(i + 3, j + 6) += sn.
at(i, j);
410 answer.
at(i + 3, j + 9) += y.
at(i, j);
412 answer.
at(i + 9, j) -= sn.
at(i, j);
413 answer.
at(i + 9, j + 3) += y.
at(i, j);
414 answer.
at(i + 9, j + 6) += sn.
at(i, j);
415 answer.
at(i + 9, j + 9) += y.
at(i, j);
497 l0 = sqrt(dx * dx + dy * dy + dz * dz);
514 answer.
at(1, 1) = answer.
at(2, 2) = answer.
at(3, 3) = halfMass;
515 answer.
at(7, 7) = answer.
at(8, 8) = answer.
at(9, 9) = halfMass;
526 ksi = iLocCoord.
at(1);
527 n1 = ( 1. - ksi ) * 0.5;
528 n2 = ( 1. + ksi ) * 0.5;
534 answer.
at(1, 1) = n1;
535 answer.
at(1, 7) = n2;
537 answer.
at(2, 2) = n1;
538 answer.
at(2, 8) = n2;
540 answer.
at(3, 3) = n1;
541 answer.
at(3, 9) = n2;
543 answer.
at(4, 4) = n1;
544 answer.
at(4, 10) = n2;
546 answer.
at(5, 5) = n1;
547 answer.
at(5, 11) = n2;
549 answer.
at(6, 6) = n1;
550 answer.
at(6, 12) = n2;
567 answer = {D_u, D_v, D_w, R_u, R_v, R_w};
576 n1 = ( 1. - ksi ) * 0.5;
577 n2 = ( 1. + ksi ) * 0.5;
600 for (
int i = 1; i <= 12; i++ ) {
627 Node *nodeA, *nodeB, *refNode;
635 for (
int i = 1; i <= 3; i++ ) {
640 lz.beVectorProductOf(lx, help);
642 ly.beVectorProductOf(lz, lx);
645 for (
int i = 1; i <= 3; i++ ) {
646 answer.
at(1, i) = lx.at(i);
647 answer.
at(2, i) = ly.at(i);
648 answer.
at(3, i) = lz.at(i);
673 for (
int i = 1; i <= 3; i++ ) {
674 for (
int j = 1; j <= 3; j++ ) {
675 answer.
at(i, j) = lcs.
at(i, j);
676 answer.
at(3 + i, 3 + j) = lcs.
at(i, j);
779 double acSize, coeff;
783 ac.at(1) = 0.5 * ( ui.at(10) - ui.at(4) );
784 ac.at(2) = 0.5 * ( ui.at(11) - ui.at(5) );
785 ac.at(3) = 0.5 * ( ui.at(12) - ui.at(6) );
791 acSize = ac.computeSquaredNorm();
793 if ( acSize > 1.e-30 ) {
797 om.
times( 2. * tan(acSize / 2.) );
799 coeff = ( 1. - ( acSize / sin(acSize) ) );
800 for (
int i = 1; i <= 3; i++ ) {
801 for (
int j = 1; j <= 3; j++ ) {
802 h.
at(i, j) = coeff * ac.at(i) * ac.at(j);
806 for (
int i = 1; i <= 3; i++ ) {
807 h.
at(i, i) = 1. - h.
at(i, i);
811 acp.at(1) = ( ui.at(10) - ui.at(4) ) / this->
l0;
812 acp.at(2) = ( ui.at(11) - ui.at(5) ) / this->
l0;
813 acp.at(3) = ( ui.at(12) - ui.at(6) ) / this->
l0;
816 omp.
times(2. * tan(acSize / 2.) / acSize);
819 kapgn1.
times(1. / 2.);
834 answer.
at(1) += PrevEpsilon.
at(4);
835 answer.
at(2) += PrevEpsilon.
at(5);
836 answer.
at(3) += PrevEpsilon.
at(6);
901 go = CreateLine3D(p);
902 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
903 EGAttachObject(go, ( EObjectP )
this);
904 EMAddGraphicsToModel(ESIModel(), go);
919 const char *colors[] = {
920 "red",
"green",
"blue" 933 go = CreateLine3D(p);
934 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
935 EMAddGraphicsToModel(ESIModel(), go);
940 double coeff = this->
l0 / 3.;
948 for ( i = 1; i <= 3; i++ ) {
949 p [ 1 ].x = p [ 0 ].x + coeff *tc.
at(1, i);
950 p [ 1 ].y = p [ 0 ].y + coeff *tc.
at(2, i);
951 p [ 1 ].z = p [ 0 ].z + coeff *tc.
at(3, i);
953 EASValsSetColor( ColorGetPixelFromString(const_cast< char * >(colors [ i - 1 ]), & succ) );
955 go = CreateLine3D(p);
956 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
957 EMAddGraphicsToModel(ESIModel(), go);
CrossSection * giveCrossSection()
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
virtual void computeStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Compute strain vector of receiver evaluated at given integration point at given time step from elemen...
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
int referenceNode
Reference node.
void computeQuaternionFromRotMtrx(FloatArray &answer, FloatMatrix &R)
Computes the normalized quaternion from the given rotation matrix.
Abstract base class for "structural" finite elements with geometrical nonlinearities.
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.
virtual int computeLoadGToLRotationMtrx(FloatMatrix &answer)
Returns transformation matrix from global coordinate system to local element coordinate system for el...
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
double & at(int i)
Coefficient access function.
StateCounterType tempQCounter
Time stamp of temporary centre quaternion.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
#define OOFEG_RAW_GEOMETRY_LAYER
This class implements a structural material status information.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
virtual void initForNewStep()
Initializes receivers state to new time step.
virtual void giveGeneralizedStress_Beam3d(FloatArray &answer, GaussPoint *gp, const FloatArray &generalizedStrain, TimeStep *tStep)=0
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
FloatArray tempQ
Temporary quaternion at the center.
virtual double giveCoordinate(int i)
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
#define OOFEG_DEFORMED_GEOMETRY_LAYER
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Evaluates nodal representation of real internal forces.
virtual void computeLumpedMassMatrix(FloatMatrix &answer, TimeStep *tStep)
Computes lumped mass matrix of receiver.
void computeSMtrx(FloatMatrix &answer, FloatArray &vec)
Evaluates the S matrix from given vector vec.
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
EPixel getDeformedElementColor()
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
void updateTempQuaternion(TimeStep *tStep)
Updates the temporary triad at the centre to the state identified by given solution step...
virtual double computeLength()
Computes the length (zero for all but 1D geometries)
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
double computeSquaredNorm() const
Computes the square of the norm.
void computeRotMtrx(FloatMatrix &answer, FloatArray &psi)
Evaluates the rotation matrix for large rotations according to Rodrigues formula for given pseudovect...
#define OOFEG_RAW_GEOMETRY_WIDTH
virtual double giveWeight()
Returns integration weight of receiver.
UnknownType
Type representing particular unknown (its physical meaning).
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
void times(double f)
Multiplies receiver by factor f.
#define _IFT_LIBeam3dNL2_refnode
contextIOResultType restoreYourself(DataStream &stream)
FloatArray q
Quaternion at the center (last equilibrated).
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj)
Restores the receiver state previously written in stream.
void computeTempCurv(FloatArray &answer, TimeStep *tStep)
Compute the temporary curvature at the centre to the state identified by given solution step...
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes constitutive matrix of receiver.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
Computes volume related to integration point on local edge.
virtual void give3dBeamStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
Computes the stiffness matrix for 2d beams.
virtual int computeLoadLEToLRotationMatrix(FloatMatrix &answer, int iEdge, GaussPoint *gp)
Returns transformation matrix from local edge c.s to element local coordinate system of load vector c...
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
Class representing vector of real numbers.
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.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj)
Stores receiver state to output stream.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual int giveLocalCoordinateSystem(FloatMatrix &answer)
Returns local coordinate system of receiver Required by material models with ortho- and anisotrophy...
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual void giveEdgeDofMapping(IntArray &answer, int iEdge) const
Assembles edge dof mapping mask, which provides mapping between edge local DOFs and "global" element ...
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
void computeRotMtrxFromQuaternion(FloatMatrix &answer, FloatArray &q)
Computes rotation matrix from given quaternion.
LIBeam3dNL2(int n, Domain *d)
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
void computeXdVector(FloatArray &answer, TimeStep *tStep)
Computes x_21' vector for given solution state.
void add(const FloatMatrix &a)
Adds matrix to the receiver.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual void initForNewStep()
Initializes receivers state to new time step.
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
void times(double s)
Multiplies receiver with scalar.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void zero()
Zeroes all coefficient of receiver.
Domain * giveDomain() const
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void computeXMtrx(FloatMatrix &answer, TimeStep *tStep)
Computes X matrix at given solution state.
Load is base abstract class for all loads.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
int giveSize() const
Returns the size of receiver.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Class implementing node in finite element mesh.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver's strain vector.
Class representing integration point in finite element program.
Class representing solution step.
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.