81Lattice3d :: ~Lattice3d()
99 answer.
at(1, 1) = -1.;
100 answer.
at(1, 2) = 0.;
101 answer.
at(1, 3) = 0.;
102 answer.
at(1, 4) = 0.;
103 answer.
at(1, 5) = -this->
eccT;
104 answer.
at(1, 6) = this->
eccS;
106 answer.
at(1, 7) = 1.;
107 answer.
at(1, 8) = 0.;
108 answer.
at(1, 9) = 0.;
109 answer.
at(1, 10) = 0.;
110 answer.
at(1, 11) = this->
eccT;
111 answer.
at(1, 12) = -this->
eccS;
115 answer.
at(2, 1) = 0.;
116 answer.
at(2, 2) = -1.;
117 answer.
at(2, 3) = 0.;
118 answer.
at(2, 4) = this->
eccT;
120 answer.
at(2, 6) = -this->
length / 2.;
122 answer.
at(2, 7) = 0.;
123 answer.
at(2, 8) = 1.;
124 answer.
at(2, 9) = 0.;
125 answer.
at(2, 10) = -this->
eccT;
126 answer.
at(2, 11) = 0;
127 answer.
at(2, 12) = -this->
length / 2.;
131 answer.
at(3, 1) = 0.;
132 answer.
at(3, 2) = 0.;
133 answer.
at(3, 3) = -1.;
134 answer.
at(3, 4) = -this->
eccS;
135 answer.
at(3, 5) = this->
length / 2.;
136 answer.
at(3, 6) = 0.;
138 answer.
at(3, 7) = 0.;
139 answer.
at(3, 8) = 0.;
140 answer.
at(3, 9) = 1.;
141 answer.
at(3, 10) = this->
eccS;
142 answer.
at(3, 11) = this->
length / 2.;
143 answer.
at(3, 12) = 0.;
147 answer.
at(4, 1) = 0.;
149 answer.
at(4, 3) = 0.;
150 answer.
at(4, 4) = -sqrt(
Ip / this->
area);
151 answer.
at(4, 5) = 0.;
152 answer.
at(4, 6) = 0.;
154 answer.
at(4, 7) = 0.;
155 answer.
at(4, 8) = 0.;
156 answer.
at(4, 9) = 0.;
157 answer.
at(4, 10) = sqrt(
Ip / this->
area);
158 answer.
at(4, 11) = 0.;
159 answer.
at(4, 12) = 0.;
163 answer.
at(5, 1) = 0.;
164 answer.
at(5, 2) = 0.;
165 answer.
at(5, 3) = 0.;
166 answer.
at(5, 4) = 0.;
167 answer.
at(5, 5) = -sqrt(
I1 / this->
area);
168 answer.
at(5, 6) = 0.;
170 answer.
at(5, 7) = 0.;
171 answer.
at(5, 8) = 0.;
172 answer.
at(5, 9) = 0.;
173 answer.
at(5, 10) = 0.;
174 answer.
at(5, 11) = sqrt(
I1 / this->
area);
175 answer.
at(5, 12) = 0.;
179 answer.
at(6, 1) = 0.;
180 answer.
at(6, 2) = 0.;
181 answer.
at(6, 3) = 0.;
182 answer.
at(6, 4) = 0.;
183 answer.
at(6, 5) = 0.;
184 answer.
at(6, 6) = -sqrt(
I2 / this->
area);
186 answer.
at(6, 7) = 0.;
187 answer.
at(6, 8) = 0.;
188 answer.
at(6, 9) = 0.;
189 answer.
at(6, 10) = 0.;
190 answer.
at(6, 11) = 0.;
191 answer.
at(6, 12) = sqrt(
I2 / this->
area);
210Lattice3d :: giveLength()
221Lattice3d :: giveCrackFlag()
233Lattice3d :: giveCrackWidth()
237 double crackWidth = 0;
274Lattice3d :: computeStiffnessMatrix(
FloatMatrix &answer, MatResponseMode rMode,
287 for (
int i = 1; i <= 6; i++ ) {
288 d.
at(i, i) *= volume;
298void Lattice3d :: computeGaussPoints()
308double Lattice3d :: giveArea() {
327 for ( i = 1; i <= 3; i++ ) {
328 for ( j = 1; j <= 3; j++ ) {
329 answer.
at(i, j) = lcs.
at(i, j);
330 answer.
at(i + 3, j + 3) = lcs.
at(i, j);
331 answer.
at(i + 6, j + 6) = lcs.
at(i, j);
332 answer.
at(i + 9, j + 9) = lcs.
at(i, j);
341Lattice3d :: giveNormalStress()
345 double normalStress = 0;
376Lattice3d :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
379 D_u, D_v, D_w, R_u, R_v, R_w
387 LatticeStructuralElement :: initializeFrom(ir, priority);
397Lattice3d :: postInitialize()
399 this->LatticeStructuralElement :: postInitialize();
418Lattice3d :: computeGeometryProperties()
427 for (
int i = 0; i < 3; i++ ) {
437 for (
int i = 0; i < 3; i++ ) {
438 this->
normal.at(i + 1) = coordsB.
at(i + 1) - coordsA.at(i + 1);
445 for (
int i = 0; i < 3; i++ ) {
446 this->
midPoint.at(i + 1) = 0.5 * ( coordsB.
at(i + 1) + coordsA.at(i + 1) );
449 for (
int i = 0; i < 3; i++ ) {
471 answer.
at(1, 1) = answer.
at(2, 2) = answer.
at(3, 3) = halfMass;
472 answer.
at(7, 7) = answer.
at(8, 8) = answer.
at(9, 9) = halfMass;
478Lattice3d :: computeCrossSectionProperties() {
480 printf(
"Too small number of polygon vertices\n");
487 if ( this->
normal.at(1) == 0 ) {
489 s.at(2) = this->
normal.at(3);
490 s.at(3) = -this->
normal.at(2);
491 }
else if ( this->
normal.at(2) == 0 ) {
492 s.at(1) = this->
normal.at(3);
494 s.at(3) = -this->
normal.at(1);
496 s.at(1) = this->
normal.at(2);
497 s.at(2) = -this->
normal.at(1);
509 for (
int i = 1; i <= 3; i++ ) {
511 lcs.
at(2, i) = s.at(i);
512 lcs.
at(3, i) = t.
at(i);
520 for (
int n = 0; n < 3; n++ ) {
525 for (
int n = 0; n < 3; n++ ) {
526 lpc(3 * k + n) = test(n);
534 this->
area += lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2);
536 this->
area += lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2);
543 if ( this->
area < 0 ) {
547 for (
int m = 0; m < 3; m++ ) {
556 for (
int n = 0; n < 3; n++ ) {
561 for (
int n = 0; n < 3; n++ ) {
562 lpc(3 * k + n) = test(n);
575 centroid.at(2) += ( lpc(3 * k + 1) + lpc(3 * ( k + 1 ) + 1) ) * ( lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2) );
576 centroid.at(3) += ( lpc(3 * k + 2) + lpc(3 * ( k + 1 ) + 2) ) * ( lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2) );
578 centroid.at(2) += ( lpc(3 * k + 1) + lpc(1) ) * ( lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2) );
579 centroid.at(3) += ( lpc(3 * k + 2) + lpc(2) ) * ( lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2) );
589 for (
int l = 0; l < 3; l++ ) {
603 a = lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2);
605 Ixx += ( ( pow(lpc(3 * k + 2), 2.) + lpc(3 * k + 2) * lpc(3 * ( k + 1 ) + 2) + pow(lpc(3 * ( k + 1 ) + 2), 2.) ) * a ) / 12.;
607 Iyy += ( ( pow(lpc(3 * k + 1), 2.) + lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 1) + pow(lpc(3 * ( k + 1 ) + 1), 2.) ) * a ) / 12.;
609 Ixy += ( ( lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) + 2. * lpc(3 * k + 1) * lpc(3 * k + 2) +
610 2 * lpc(3 * ( k + 1 ) + 1) * lpc(3 * ( k + 1 ) + 2) + lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2) ) * a ) / 24.;
612 a = lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2);
614 Ixx += ( ( pow(lpc(3 * k + 2), 2.) + lpc(3 * k + 2) * lpc(2) + pow(lpc(2), 2.) ) * a ) / 12.;
616 Iyy += ( ( pow(lpc(3 * k + 1), 2.) + lpc(3 * k + 1) * lpc(1) + pow(lpc(1), 2.) ) * a ) / 12.;
618 Ixy += ( ( lpc(3 * k + 1) * lpc(2) + 2. * lpc(3 * k + 1) * lpc(3 * k + 2) +
619 2 * lpc(1) * lpc(2) + lpc(1) * lpc(3 * k + 2) ) * a ) / 24.;
624 double angleChange = 0.;
625 double sum = fabs(Ixx + Iyy);
626 double pi = 3.14159265;
627 if ( ( fabs(Ixx - Iyy) /
sum > 1.e-6 ) && fabs(Ixy) /
sum > 1.e-6 ) {
628 angleChange = 0.5 * atan(-2 * Ixy / ( Ixx - Iyy ) );
629 }
else if ( ( fabs(Ixx - Iyy) /
sum < 1.e-6 ) && fabs(Ixy) /
sum > 1.e-6 ) {
630 angleChange = pi / 4.;
634 angleChange = angleChange + pi / 2.;
639 this->
I1 = ( Ixx + Iyy ) / 2. + sqrt(pow( ( Ixx - Iyy ) / 2., 2. ) + pow(Ixy, 2.) );
640 this->
I2 = ( Ixx + Iyy ) / 2. - sqrt(pow( ( Ixx - Iyy ) / 2., 2. ) + pow(Ixy, 2.) );
647 rotationChange.
zero();
649 rotationChange.
at(1, 1) = 1.;
650 rotationChange.
at(2, 2) = cos(angleChange);
651 rotationChange.
at(2, 3) = -sin(angleChange);
653 rotationChange.
at(3, 2) = sin(angleChange);
654 rotationChange.
at(3, 3) = cos(angleChange);
660 for (
int n = 0; n < 3; n++ ) {
665 for (
int n = 0; n < 3; n++ ) {
666 lpc(3 * k + n) = test(n);
674 centroid.at(2) += ( lpc(3 * k + 1) + lpc(3 * ( k + 1 ) + 1) ) * ( lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2) );
675 centroid.at(3) += ( lpc(3 * k + 2) + lpc(3 * ( k + 1 ) + 2) ) * ( lpc(3 * k + 1) * lpc(3 * ( k + 1 ) + 2) - lpc(3 * ( k + 1 ) + 1) * lpc(3 * k + 2) );
677 centroid.at(2) += ( lpc(3 * k + 1) + lpc(1) ) * ( lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2) );
678 centroid.at(3) += ( lpc(3 * k + 2) + lpc(2) ) * ( lpc(3 * k + 1) * lpc(2) - lpc(1) * lpc(3 * k + 2) );
705 LatticeStructuralElement :: saveContext(stream, mode);
728 LatticeStructuralElement :: restoreContext(stream, mode);
737 if ( !stream.
read(this->couplingFlag) ) {
778 if ( !
gc.testElementGraphicActivity(
this) ) {
783 EASValsSetColor(
gc.getElementColor() );
786 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveCoordinate(1);
787 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveCoordinate(2);
788 p [ 0 ].z = ( FPNum ) this->
giveNode(1)->giveCoordinate(3);
789 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveCoordinate(1);
790 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveCoordinate(2);
791 p [ 1 ].z = ( FPNum ) this->
giveNode(2)->giveCoordinate(3);
793 go = CreateLine3D(p);
794 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
795 EGAttachObject(go, ( EObjectP )
this);
796 EMAddGraphicsToModel(ESIModel(), go);
809 if ( !
gc.testElementGraphicActivity(
this) ) {
827 pTemp [ 0 ] = p [ i ];
828 pTemp [ 1 ] = p [ i + 1 ];
830 pTemp [ 0 ] = p [ i ];
831 pTemp [ 1 ] = p [ 0 ];
834 go = CreateLine3D(pTemp);
835 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
836 EGAttachObject(go, ( EObjectP )
this);
837 EMAddGraphicsToModel(ESIModel(), go);
847 if ( !
gc.testElementGraphicActivity(
this) ) {
851 double defScale =
gc.getDefScale();
856 EASValsSetColor(
gc.getDeformedElementColor() );
859 p [ 0 ].x = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
860 p [ 0 ].y = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
861 p [ 0 ].z = ( FPNum ) this->
giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
863 p [ 1 ].x = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
864 p [ 1 ].y = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
865 p [ 1 ].z = ( FPNum ) this->
giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);
867 go = CreateLine3D(p);
868 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
869 EMAddGraphicsToModel(ESIModel(), go);
#define REGISTER_Element(class)
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
double giveCoordinate(int i) const
Node * giveNode(int i) const
virtual Material * giveMaterial()
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
int numberOfDofMans
Number of dofmanagers.
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
CrossSection * giveCrossSection()
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
Domain * giveDomain() const
int number
Component number.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
void resize(Index rows, Index cols)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void beTranspositionOf(const FloatMatrix &src)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
void drawRawCrossSections(oofegGraphicContext &, TimeStep *tStep)
static ParamKey IPK_Lattice3d_mlength
void drawDeformedGeometry(oofegGraphicContext &, TimeStep *tStep, UnknownType) override
static ParamKey IPK_Lattice3d_pressures
void computeBmatrixAt(GaussPoint *, FloatMatrix &, int=1, int=ALL_STRAINS) override
static ParamKey IPK_Lattice3d_couplingnumber
double computeVolumeAround(GaussPoint *) override
static ParamKey IPK_Lattice3d_polycoords
void drawRawGeometry(oofegGraphicContext &, TimeStep *tStep) override
virtual void computeCrossSectionProperties()
FloatMatrix localCoordinateSystem
void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override
int giveLocalCoordinateSystem(FloatMatrix &answer) override
virtual void computeGeometryProperties()
FloatArray globalCentroid
static ParamKey IPK_Lattice3d_couplingflag
int numberOfPolygonVertices
const FloatArrayF< 6 > & giveOldPlasticLatticeStrain() const
Returns plastic lattice strain.
virtual double giveCrackWidth() const
virtual int giveCrackFlag() const
const FloatArrayF< 6 > & givePlasticLatticeStrain() const
Returns plastic lattice strain.
double giveNormalLatticeStress() const
Gives the last equilibrated normal stress.
LatticeStructuralElement(int n, Domain *d)
@ OGC_eigenVectorGeometry
double sum(const FloatArray &x)
@ CIO_IOERR
General IO error.
#define OOFEG_RAW_CROSSSECTION_LAYER
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_DEFORMED_GEOMETRY_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)