35 #include "../sm/Quasicontinuum/quasicontinuum.h" 36 #include "../sm/EngineeringModels/qclinearstatic.h" 43 #include "../sm/CrossSections/simplecrosssection.h" 44 #include "../sm/Materials/isolinearelasticmaterial.h" 45 #include "../sm/Materials/anisolinearelasticmaterial.h" 47 #include "../sm/Materials/qcmaterialextensioninterface.h" 67 if ( dim == 2 || dim == 3 ) {
70 OOFEM_ERROR(
"Invalid number of dimensions. Only 2d and 3d domains are supported in QC simulation. \n");
80 if ( generateInterpolationElements == 0 ) {
85 }
else if ( ( generateInterpolationElements == 1 ) || ( generateInterpolationElements == 2 ) ) {
91 noNewEl = newMeshNodes->size();
93 for (
int i = 1; i <= noNewEl; i++ ) {
97 OOFEM_ERROR(
"Invalid input field \"GenInterpElem\". Value: %d is not supported", generateInterpolationElements);
136 const char *elemType;
141 elemType =
"TrPlaneStress2d";
144 elemType =
"LTRSpace";
153 for (
int i = 1; i <= ninterpelem; i++ ) {
154 elemNumber = nelem + i;
212 for (
int i = 1; i <= ninterpelem; i++ ) {
239 if ( ( n1 == 1 ) && ( n2 == 1 ) ) {
245 }
else if ( ( n1 == 2 ) && ( n2 == 2 ) ) {
250 }
else if ( ( n1 == 1 ) && ( n2 == 2 ) ) {
257 if ( !nodesOfMasterElem.
contains(mn) ) {
266 }
else if ( ( n1 == 2 ) && ( n2 == 1 ) ) {
273 if ( !nodesOfMasterElem.
contains(mn) ) {
284 OOFEM_WARNING(
"Element %d with non-qcNode can not be homogenized", i);
314 OOFEM_ERROR(
"Quasicontinuum can be applied only in QClinearStatic engngm");
325 double homogenizedE, homogenizedNu;
335 if ( homMtrxType == 1 ) {
342 }
else if ( homMtrxType == 2 ) {
350 Diso->
at(1, 1), Diso->
at(1, 2), 0, 0, 0, Diso->
at(1, 6), \
351 Diso->at(2, 2), 0, 0, 0, Diso->
at(2, 6), 33, 0, 0, 0, 44, \
352 0, 0, 55, 0, Diso->
at(6, 6)
356 Diso->
at(1, 1), Diso->
at(1, 2), Diso->
at(1, 3), Diso->
at(1, 4), Diso->
at(1, 5), Diso->
at(1, 6), \
357 Diso->at(2, 2), Diso->
at(2, 3), Diso->
at(2, 4), Diso->
at(2, 5), Diso->
at(2, 6), \
358 Diso->at(3, 3), Diso->
at(3, 4), Diso->
at(3, 5), Diso->
at(3, 6), \
359 Diso->at(4, 4), Diso->
at(4, 5), Diso->
at(4, 6), \
360 Diso->at(5, 5), Diso->
at(5, 6), Diso->
at(6, 6)
363 OOFEM_ERROR(
"Invalid number of dimensions. Only 2d and 3d domains are supported in QC simulation. \n");
380 for (
int i = 1; i <= ninterpelem; i++ ) {
399 bool stiffnesAssigned =
false;
404 std :: vector< FloatMatrix * >individualStiffnessMatrices;
405 std :: vector< FloatMatrix * >individualStiffnessTensors;
406 individualStiffnessMatrices.resize(noIntEl);
407 individualStiffnessTensors.resize(noIntEl);
408 for (
int i = 0; i <= noIntEl - 1; i++ ) {
409 individualStiffnessTensors [ i ] =
new FloatMatrix(9, 9);
410 individualStiffnessTensors [ i ]->zero();
411 individualStiffnessMatrices [ i ] =
new FloatMatrix(6, 6);
412 individualStiffnessMatrices [ i ]->zero();
416 individualS0.
resize(noIntEl);
431 if ( ( n1 == 1 ) && ( n2 == 1 ) ) {
437 }
else if ( ( n1 == 2 ) && ( n2 == 2 ) ) {
452 stiffnesAssigned =
false;
453 stiffnesAssigned =
stiffnessAssignment(individualStiffnessTensors, individualS0, d, e, qn1, qn2);
455 if ( !stiffnesAssigned ) {
464 }
else if ( ( n1 == 1 ) && ( n2 == 2 ) ) {
471 if ( !nodesOfMasterElem.
contains(mn) ) {
483 }
else if ( ( n1 == 2 ) && ( n2 == 1 ) ) {
490 if ( !nodesOfMasterElem.
contains(mn) ) {
504 OOFEM_WARNING(
"Element %d with non-qcNode can not be homogenized", i);
513 double volumeofEl, th;
514 for (
int i = 1; i <= noIntEl; i++ ) {
519 volumeofEl = volumeofEl / th;
521 individualStiffnessMatrices [ i - 1 ]->times(1 / volumeofEl);
547 OOFEM_ERROR(
"Quasicontinuum can be applied only in QClinearStatic engngm");
556 int nmat = originalNumberOfMaterials;
561 if ( homMtrxType == 1 ) {
562 double homogenizedE, homogenizedNu;
563 for (
int i = 1; i <= noIntEl; i++ ) {
577 }
else if ( homMtrxType == 2 ) {
579 for (
int i = 1; i <= noIntEl; i++ ) {
580 Da = * individualStiffnessMatrices [ i - 1 ];
588 Da.
at(1, 1), Da.
at(1, 2), 0, 0, 0, Da.
at(1, 6), \
589 Da.at(2, 2), 0, 0, 0, Da.
at(2, 6), 33, 0, 0, 0, 44, \
590 0, 0, 55, 0, Da.
at(6, 6)
594 Da.
at(1, 1), Da.
at(1, 2), Da.
at(1, 3), Da.
at(1, 4), Da.
at(1, 5), Da.
at(1, 6), \
595 Da.at(2, 2), Da.
at(2, 3), Da.
at(2, 4), Da.
at(2, 5), Da.
at(2, 6), \
596 Da.at(3, 3), Da.
at(3, 4), Da.
at(3, 5), Da.
at(3, 6), \
597 Da.at(4, 4), Da.
at(4, 5), Da.
at(4, 6), \
598 Da.at(5, 5), Da.
at(5, 6), Da.
at(6, 6)
601 OOFEM_ERROR(
"Invalid number of dimensions. Only 2d and 3d domains are supported in QC simulation. \n");
617 int matNum = originalNumberOfMaterials;
619 for (
int i = 1; i <= noIntEl; i++ ) {
628 for (
unsigned int i = 0; i <= individualStiffnessTensors.size() - 1; i++ ) {
629 delete individualStiffnessTensors [ i ];
630 delete individualStiffnessMatrices [ i ];
646 double a = Diso->
at(1, 1);
647 double b = Diso->
at(1, 2);
648 double d = Diso->
at(2, 2);
649 double f = Diso->
at(6, 6);
651 if ( 33 * a + 2 * b + 33 * d + 4 * f == 0 ) {
652 homogenizedE = 1.0e-20;
655 homogenizedE = 4 * ( a + 2 * b + d ) * ( 4 * a - 8 * b + 4 * d + f ) / ( 33 * a + 2 * b + 33 * d + 4 * f );
656 homogenizedNu = ( a + 66 * b + d - 4 * f ) / ( 33 * a + 2 * b + 33 * d + 4 * f );
675 double a = Diso->
at(1, 1) + Diso->
at(2, 2) + Diso->
at(3, 3);
676 double b = Diso->
at(4, 4) + Diso->
at(5, 5) + Diso->
at(6, 6);
678 if ( 5 * a + 13 * b == 0 ) {
679 homogenizedE = 1.0e-20;
682 homogenizedE = ( a + 2 * b ) * ( a + 11 * b ) / ( 15 * a + 39 * b );
683 homogenizedNu = ( 2 * a + b ) / ( 5 * a + 13 * b );
686 OOFEM_ERROR(
"Invalid number of dimensions. Only 2d and 3d domains are supported in QC simulation. \n");
704 OOFEM_ERROR(
"Material doesn't implement the required QC interface!");
714 OOFEM_ERROR(
"Invalid CrossSection of link %d. simpleCS is only supported CS of links in QC simulation. \n", e->
giveGlobalNumber() );
723 double TrussLength = sqrt( ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) + ( z2 - z1 ) * ( z2 - z1 ) );
725 n [ 0 ] = ( x2 - x1 ) / TrussLength;
726 n [ 1 ] = ( y2 - y1 ) / TrussLength;
727 n [ 2 ] = ( z2 - z1 ) / TrussLength;
730 for ( i = 1; i <= 3; i++ ) {
731 for ( j = 1; j <= 3; j++ ) {
732 for ( k = 1; k <= 3; k++ ) {
733 for ( l = 1; l <= 3; l++ ) {
734 D1.
at(3 * ( i - 1 ) + k, 3 * ( j - 1 ) + l) = TrussLength * Etruss * n [ i - 1 ] * n [ j - 1 ] * n [ k - 1 ] * n [ l - 1 ];
741 if ( !std :: isinf(Ry) ) {
742 S0 += TrussLength * area * Ry / 3;
760 StiffnessTensor->
resize(9, 9);
761 StiffnessTensor->
zero();
767 double TrussLength, x1, x2, y1, y2, z1, z2;
770 for ( t = 1; t <= noe; t++ ) {
781 OOFEM_ERROR(
"Material doesn't implement the required QC interface!");
800 TrussLength = sqrt( ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) + ( z2 - z1 ) * ( z2 - z1 ) );
801 n [ 0 ] = ( x2 - x1 ) / TrussLength;
802 n [ 1 ] = ( y2 - y1 ) / TrussLength;
803 n [ 2 ] = ( z2 - z1 ) / TrussLength;
805 for ( i = 1; i <= 3; i++ ) {
806 for ( j = 1; j <= 3; j++ ) {
807 for ( k = 1; k <= 3; k++ ) {
808 for ( l = 1; l <= 3; l++ ) {
809 D1.
at(3 * ( i - 1 ) + k, 3 * ( j - 1 ) + l) = TrussLength * Etruss * n [ i - 1 ] * n [ j - 1 ] * n [ k - 1 ] * n [ l - 1 ];
815 StiffnessTensor->
add(D1);
817 if ( !std :: isinf(Ry) ) {
818 S0 += TrussLength * area * Ry / 3;
823 StiffnessTensor->
times(1 / volumeOfInterpolationMesh);
824 S0 = S0 / volumeOfInterpolationMesh;
834 FloatMatrix stfTensorOf1Link(9, 9), contribution(9, 9);
859 if ( end1 == end2 ) {
864 individualStiffnessTensors [ indx - 1 ]->add(stfTensorOf1Link);
865 individualS0 [ indx - 1 ] += s0Of1Link;
877 int noIntersected = lengths.
giveSize();
878 if ( noIntersected == 0 ) {
885 lengths.
times(1 / totalLength);
886 double sumLength = 0.0;
887 for (
int i = 1; i <= noIntersected; i++ ) {
888 sumLength += lengths [ i - 1 ];
890 if ( sumLength > 1.0001 ) {
892 }
else if ( sumLength < 0.9999 ) {
899 for ( i = 1; i <= noIntersected; i++ ) {
900 nel = intersected [ i - 1 ];
902 contribution = stfTensorOf1Link;
903 contribution.
times( lengths.
at(i) );
904 individualStiffnessTensors [ indx - 1 ]->add(contribution);
905 individualS0 [ indx - 1 ] += lengths.
at(i) * s0Of1Link;
920 }
else if ( dim == 3 ) {
937 double TotalLength = sqrt( ( X2->
at(1) - X1->
at(1) ) * ( X2->
at(1) - X1->
at(1) ) + ( X2->
at(2) - X1->
at(2) ) * ( X2->
at(2) - X1->
at(2) ) );
950 int numberOfIntersected = 0;
953 FloatArray intersectCoordsX, intersectCoordsY;
954 double iLen, sumLength = 0.0;
955 register int nn, ii, i;
966 switch ( numberOfIntersected ) {
972 vector.
at(1) = intersectCoordsX.
at(1) - X1->
at(1);
973 vector.
at(2) = intersectCoordsY.
at(1) - X1->
at(2);
975 if ( iLen / TotalLength >= 1.e-6 ) {
986 iLens.
resize(numberOfIntersected);
987 for (
int nn = 1; nn <= numberOfIntersected; nn++ ) {
988 vector.
at(1) = intersectCoordsX.
at(nn) - X1->
at(1);
989 vector.
at(2) = intersectCoordsY.
at(nn) - X1->
at(2);
993 if ( iLen / TotalLength >= 1.e-6 ) {
1005 bool breakFor =
false;
1006 IntArray neighboursList, alreadyTestedElemList;
1007 alreadyTestedElemList.
clear();
1012 int nextElement = end1;
1016 for ( ii = 1; ii <= nome; ii++ ) {
1024 for ( k = 1; k <= intersected.
giveSize(); k++ ) {
1027 neighboursList.
erase(index);
1032 for ( k = 1; k <= alreadyTestedElemList.
giveSize(); k++ ) {
1035 neighboursList.
erase(index);
1040 if ( neighboursList.
giveSize() == 0 ) {
1045 for ( k = 1; k <= neighboursList.
giveSize(); k++ ) {
1046 iel = neighboursList.
at(k);
1054 switch ( numberOfIntersected ) {
1059 if ( iel == end2 ) {
1060 vector.
at(1) = intersectCoordsX.
at(1) - X2->
at(1);
1061 vector.
at(2) = intersectCoordsY.
at(1) - X2->
at(2);
1063 if ( iLen / TotalLength >= 1.e-6 ) {
1077 if ( iel == end2 ) {
1079 iLens.
resize(numberOfIntersected);
1080 for (
int nn = 1; nn <= numberOfIntersected; nn++ ) {
1081 vector.
at(1) = intersectCoordsX.
at(nn) - X2->
at(1);
1082 vector.
at(2) = intersectCoordsY.
at(nn) - X2->
at(2);
1086 if ( iLen / TotalLength >= 1.e-6 ) {
1100 for ( nn = 1; nn < numberOfIntersected; nn++ ) {
1101 for ( ii = nn + 1; ii <= numberOfIntersected; ii++ ) {
1103 vector.
at(1) = intersectCoordsX.
at(nn) - intersectCoordsX.
at(ii);
1104 vector.
at(2) = intersectCoordsY.
at(nn) - intersectCoordsY.
at(ii);
1109 if ( iLen / TotalLength >= 1.e-6 ) {
1130 for ( i = 1; i <= lengths.
giveSize(); i++ ) {
1131 sumLength += lengths.
at(i);
1133 if ( ( fabs(sumLength / TotalLength - 1) ) <= ( 0.0001 ) ) {
1138 if ( nextElement == 0 ) {
1153 intersected.
clear();
1160 double TotalLength = sqrt( ( X2->
at(1) - X1->
at(1) ) * ( X2->
at(1) - X1->
at(1) ) + ( X2->
at(2) - X1->
at(2) ) * ( X2->
at(2) - X1->
at(2) ) + ( X2->
at(3) - X1->
at(3) ) * ( X2->
at(3) - X1->
at(3) ) );
1166 if ( end2 < end1 ) {
1173 int numberOfIntersected = 0;
1176 FloatArray intersectCoordsX, intersectCoordsY, intersectCoordsZ;
1177 double iLen, sumLength = 0.0;
1178 register int nn, ii, i;
1193 switch ( numberOfIntersected ) {
1199 vector.
at(1) = intersectCoordsX.
at(1) - X1->
at(1);
1200 vector.
at(2) = intersectCoordsY.
at(1) - X1->
at(2);
1201 vector.
at(3) = intersectCoordsZ.
at(1) - X1->
at(3);
1203 if ( iLen / TotalLength >= 1.e-6 ) {
1214 iLens.
resize(numberOfIntersected);
1215 for (
int nn = 1; nn <= numberOfIntersected; nn++ ) {
1216 vector.
at(1) = intersectCoordsX.
at(nn) - X1->
at(1);
1217 vector.
at(2) = intersectCoordsY.
at(nn) - X1->
at(2);
1218 vector.
at(3) = intersectCoordsZ.
at(nn) - X1->
at(3);
1222 if ( iLen / TotalLength >= 1.e-6 ) {
1236 bool breakFor =
false;
1237 IntArray neighboursList, alreadyTestedElemList;
1238 alreadyTestedElemList.
clear();
1243 int nextElement = end1;
1247 for ( ii = 1; ii <= nome; ii++ ) {
1255 for ( k = 1; k <= intersected.
giveSize(); k++ ) {
1258 neighboursList.
erase(index);
1263 for ( k = 1; k <= alreadyTestedElemList.
giveSize(); k++ ) {
1266 neighboursList.
erase(index);
1271 if ( neighboursList.
giveSize() == 0 ) {
1276 for ( k = 1; k <= neighboursList.
giveSize(); k++ ) {
1277 iel = neighboursList.
at(k);
1287 switch ( numberOfIntersected ) {
1292 if ( iel == end2 ) {
1293 vector.
at(1) = intersectCoordsX.
at(1) - X2->
at(1);
1294 vector.
at(2) = intersectCoordsY.
at(1) - X2->
at(2);
1295 vector.
at(3) = intersectCoordsZ.
at(1) - X2->
at(3);
1297 if ( iLen / TotalLength >= 1.e-6 ) {
1311 if ( iel == end2 ) {
1313 iLens.
resize(numberOfIntersected);
1314 for (
int nn = 1; nn <= numberOfIntersected; nn++ ) {
1315 vector.
at(1) = intersectCoordsX.
at(nn) - X2->
at(1);
1316 vector.
at(2) = intersectCoordsY.
at(nn) - X2->
at(2);
1317 vector.
at(3) = intersectCoordsZ.
at(nn) - X2->
at(3);
1321 if ( iLen / TotalLength >= 1.e-6 ) {
1335 for ( nn = 1; nn <= numberOfIntersected; nn++ ) {
1336 for ( ii = nn + 1; ii <= numberOfIntersected; ii++ ) {
1338 vector.
at(1) = intersectCoordsX.
at(nn) - intersectCoordsX.
at(ii);
1339 vector.
at(2) = intersectCoordsY.
at(nn) - intersectCoordsY.
at(ii);
1340 vector.
at(3) = intersectCoordsZ.
at(nn) - intersectCoordsZ.
at(ii);
1345 if ( iLen / TotalLength >= 1.e-6 ) {
1366 for ( i = 1; i <= lengths.
giveSize(); i++ ) {
1367 sumLength += lengths.
at(i);
1369 if ( ( fabs(sumLength / TotalLength - 1) ) <= ( 0.0001 ) ) {
1374 if ( nextElement == 0 ) {
1386 register int i, j, k, l;
1388 int elNum1, elNum2, noVertices1, noVertices2;
1396 for ( j = 1; j <= nome; j++ ) {
1403 vertices1.
resize(noVertices1);
1404 for ( k = 1; k <= noVertices1; k++ ) {
1407 for ( i = 1; i <= nome; i++ ) {
1415 for ( l = 1; l <= noVertices2; l++ ) {
1432 intersectCoords.
clear();
1435 double L = sqrt( ( X2->
at(1) - X1->
at(1) ) * ( X2->
at(1) - X1->
at(1) ) + ( X2->
at(2) - X1->
at(2) ) * ( X2->
at(2) - X1->
at(2) ) + ( X2->
at(3) - X1->
at(3) ) * ( X2->
at(3) - X1->
at(3) ) );
1436 double Ur1 = ( X2->
at(1) - X1->
at(1) ) / L;
1437 double Ur2 = ( X2->
at(2) - X1->
at(2) ) / L;
1438 double Ur3 = ( X2->
at(3) - X1->
at(3) ) / L;
1440 double Vr1 = Ur2 * X1->
at(3) - Ur3 *X1->
at(2);
1441 double Vr2 = Ur3 * X1->
at(1) - Ur1 *X1->
at(3);
1442 double Vr3 = Ur1 * X1->
at(2) - Ur2 *X1->
at(1);
1448 for (
int i = 1; i <= 3; i++ ) {
1449 U1.at(i) = B->
at(i) - A->
at(i);
1450 U2.at(i) = C->
at(i) - B->
at(i);
1451 U3.
at(i) = A->
at(i) - C->
at(i);
1457 V1.at(1) = U1.at(2) * A->
at(3) - U1.at(3) * A->
at(2);
1458 V1.at(2) = U1.at(3) * A->
at(1) - U1.at(1) * A->
at(3);
1459 V1.at(3) = U1.at(1) * A->
at(2) - U1.at(2) * A->
at(1);
1461 V2.at(1) = U2.at(2) * B->
at(3) - U2.at(3) * B->
at(2);
1462 V2.at(2) = U2.at(3) * B->
at(1) - U2.at(1) * B->
at(3);
1463 V2.at(3) = U2.at(1) * B->
at(2) - U2.at(2) * B->
at(1);
1465 V3.
at(1) = U3.
at(2) * C->
at(3) - U3.
at(3) * C->
at(2);
1466 V3.
at(2) = U3.
at(3) * C->
at(1) - U3.
at(1) * C->
at(3);
1467 V3.
at(3) = U3.
at(1) * C->
at(2) - U3.
at(2) * C->
at(1);
1471 double S1 = Ur1 * V1.at(1) + Ur2 *V1.at(2) + Ur3 *V1.at(3) + U1.at(1) * Vr1 + U1.at(2) * Vr2 + U1.at(3) * Vr3;
1472 double S2 = Ur1 * V2.at(1) + Ur2 *V2.at(2) + Ur3 *V2.at(3) + U2.at(1) * Vr1 + U2.at(2) * Vr2 + U2.at(3) * Vr3;
1473 double S3 = Ur1 * V3.
at(1) + Ur2 *V3.
at(2) + Ur3 *V3.
at(3) + U3.
at(1) * Vr1 + U3.
at(2) * Vr2 + U3.
at(3) * Vr3;
1477 if ( fabs(S1) <= TOL ) {
1480 if ( fabs(S2) <= TOL ) {
1483 if ( fabs(S3) <= TOL ) {
1488 if ( ( S1 == 0 ) && ( S2 == 0 ) && ( S3 == 0 ) ) {
1492 intersectCoords.
clear();
1498 if ( ( ( S1 >= 0 ) && ( S2 >= 0 ) && ( S3 >= 0 ) ) || ( ( S1 <= 0 ) && ( S2 <= 0 ) && ( S3 <= 0 ) ) ) {
1500 double S = S1 + S2 + S3;
1507 double x = u1 * C->
at(1) + u2 *A->
at(1) + u3 *B->
at(1);
1508 double y = u1 * C->
at(2) + u2 *A->
at(2) + u3 *B->
at(2);
1509 double z = u1 * C->
at(3) + u2 *A->
at(3) + u3 *B->
at(3);
1516 if ( ( X2->
at(1) - X1->
at(1) ) != 0 ) {
1517 t = ( x - X1->
at(1) ) / ( X2->
at(1) - X1->
at(1) );
1519 if ( ( X2->
at(2) - X1->
at(2) ) != 0 ) {
1520 t = ( y - X1->
at(2) ) / ( X2->
at(2) - X1->
at(2) );
1522 t = ( z - X1->
at(3) ) / ( X2->
at(3) - X1->
at(3) );
1527 double EPS = 1.0e-12;
1528 if ( ( 0 < t + EPS ) && ( t - EPS < 1 ) ) {
1529 intersectCoords.
resize(3);
1530 intersectCoords.
at(1) = x;
1531 intersectCoords.
at(2) = y;
1532 intersectCoords.
at(3) = z;
1535 intersectCoords.
clear();
1539 intersectCoords.
clear();
1552 int numberOfIntersections = 0;
1553 intersectCoordsX.
clear();
1554 intersectCoordsY.
clear();
1555 intersectCoordsZ.
clear();
1561 numberOfIntersections += 1;
1562 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1563 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1564 intersectCoordsZ.
push_back( intersectCoords.
at(3) );
1570 numberOfIntersections += 1;
1571 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1572 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1573 intersectCoordsZ.
push_back( intersectCoords.
at(3) );
1579 numberOfIntersections += 1;
1580 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1581 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1582 intersectCoordsZ.
push_back( intersectCoords.
at(3) );
1588 numberOfIntersections += 1;
1589 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1590 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1591 intersectCoordsZ.
push_back( intersectCoords.
at(3) );
1594 return numberOfIntersections;
1603 int numberOfIntersections = 0;
1604 intersectCoordsX.
clear();
1605 intersectCoordsY.
clear();
1611 numberOfIntersections += 1;
1612 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1613 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1619 numberOfIntersections += 1;
1620 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1621 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1627 numberOfIntersections += 1;
1628 intersectCoordsX.
push_back( intersectCoords.
at(1) );
1629 intersectCoordsY.
push_back( intersectCoords.
at(2) );
1632 return numberOfIntersections;
1640 double a1x = A1->
at(1);
1641 double a1y = A1->
at(2);
1642 double a2x = A2->
at(1);
1643 double a2y = A2->
at(2);
1644 double b1x = B1->
at(1);
1645 double b1y = B1->
at(2);
1646 double b2x = B2->
at(1);
1647 double b2y = B2->
at(2);
1650 double f1 = std :: numeric_limits< float > :: infinity();
1651 double f2 = std :: numeric_limits< float > :: infinity();
1653 f1 = -( a2y - a1y ) / ( a1x - a2x );
1656 f2 = -( b2y - b1y ) / ( b1x - b2x );
1659 double g1 = a1y - f1 * a1x;
1660 double g2 = b1y - f2 * b1x;
1664 intersectCoords.
clear();
1673 }
else if ( b1x == b2x ) {
1677 x = ( g2 - g1 ) / ( f1 - f2 );
1682 double x1, x2, x3, x4;
1697 double y1, y2, y3, y4;
1715 if ( ( x1 <= x + EPS ) && ( x <= x2 +
EPS ) && ( x3 <= x + EPS ) && ( x <= x4 +
EPS ) && ( y1 <= y + EPS ) && ( y <= y2 +
EPS ) && ( y3 <= y + EPS ) && ( y <= y4 +
EPS ) ) {
1716 intersectCoords.
resize(2);
1717 intersectCoords.
at(1) = x;
1718 intersectCoords.
at(2) = y;
1721 intersectCoords.
clear();
1732 IntArray indicesI, indicesJ, indicesK, indicesL;
1745 int ii, jj, i, j, k, l;
1747 for ( ii = 1; ii <= 6; ii++ ) {
1748 for ( jj = 1; jj <= 6; jj++ ) {
1749 i = indicesI.
at(ii);
1750 j = indicesJ.
at(ii);
1752 k = indicesK.
at(jj);
1753 l = indicesL.
at(jj);
1755 matrix->
at(ii, jj) = tensor->
at(3 * ( i - 1 ) + k, 3 * ( j - 1 ) + l);
bool contains(int value) const
CrossSection * giveCrossSection()
void applyApproach3(Domain *d, int homMtrxType)
void computeStiffnessTensorOf1Link(FloatMatrix &D1, double &S0, Element *e, Domain *d)
Material * createMaterial(const char *name, int num, Domain *domain)
Creates new instance of material corresponding to given keyword.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
IntArray interpolationElementNumbers
std::vector< IntArray > interpolationMeshNodes
void setCrossSection(int i, CrossSection *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
bool computeIntersectionsOfLinkWith2DTringleElements(IntArray &intersected, FloatArray &lengths, Domain *d, Element *e, qcNode *qn1, qcNode *qn2)
bool computeIntersectionsOfLinkWith3DTetrahedraElements(IntArray &intersected, FloatArray &lengths, Domain *d, Element *e, qcNode *qn1, qcNode *qn2)
void erase(int pos)
Erase the element at given position (1-based index) Receiver will shrink accordingly, the values at positions (pos+1,...,size) will be moved to positions (pos,...,size-1)
void transformStiffnessTensorToMatrix(FloatMatrix *matrix, FloatMatrix *tensor)
void applyApproach1(Domain *d)
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
virtual ~Quasicontinuum()
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
int giveGlobalNumber() const
void setActivatedNodeList(IntArray nodeList, Domain *d)
int intersectionTestSegmentTriangle2D(FloatArray &intersectCoordsX, FloatArray &intersectCoordsY, FloatArray *A, FloatArray *B, FloatArray *C, FloatArray *U1, FloatArray *U2)
void clear()
Clears receiver (zero size).
virtual FloatArray * giveCoordinates()
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of cross section property.
Abstract base class for all finite elements.
virtual int giveMasterElementNumber()
void createInterpolationElements(Domain *d)
CrossSection * createCrossSection(const char *name, int num, Domain *domain)
Creates new instance of cross section corresponding to given keyword.
#define _IFT_SimpleCrossSection_width
virtual double giveQcPlasticParamneter()=0
void resizeElements(int _newSize)
Resizes the internal data structure to accommodate space for _newSize elements.
int giveNumberOfElements() const
Returns number of elements in domain.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
void computeIntersectionsOfLinkWithInterpElements(IntArray &intersected, FloatArray &lengths, Domain *d, Element *e, qcNode *qn1, qcNode *qn2)
virtual int giveNumberOfDofManagers() const
virtual double giveQcElasticParamneter()=0
void setupInterpolationMesh(Domain *d, int generateInterpolationElements, int interpolationElementsMaterialNumber, std::vector< IntArray > *newMeshNodes)
bool stiffnessAssignment(std::vector< FloatMatrix * > &individualStiffnessTensors, FloatArray &individialS0, Domain *d, Element *e, qcNode *qn1, qcNode *qn2)
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
Base abstract class representing cross section in finite element mesh.
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
This class implements linear static engineering problem.
void setMaterial(int i, Material *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
#define _IFT_IsotropicLinearElasticMaterial_talpha
#define _IFT_IsotropicLinearElasticMaterial_n
const IntArray & giveDofManArray() const
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Element * giveElement(int n)
Service for accessing particular domain fe element.
bool intersectionTestSegmentTrianglePlucker3D(FloatArray &intersectCoords, FloatArray *A, FloatArray *B, FloatArray *C, FloatArray *X1, FloatArray *X2)
void homogenizationOfStiffMatrix(double &homogenizedE, double &homogenizedNu, FloatMatrix *Diso)
void clear()
Clears the array (zero size).
void setActivatedElementList(IntArray elemList)
#define _IFT_Material_density
void times(double f)
Multiplies receiver by factor f.
#define _IFT_Element_nodes
Class implementing hanging node connected to other nodes (masters) using interpolation.
int giveNumberOfCrossSectionModels() const
Returns number of cross section models in domain.
int giveNumberOfMaterialModels() const
Returns number of material models in domain.
virtual void setCrossSection(int csIndx)
Sets the cross section model of receiver.
#define _IFT_IsotropicLinearElasticMaterial_e
void setNoDimensions(Domain *d)
Abstract base class for all material models.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
const IntArray & giveElementsWithMaterialNum(int iMaterialNum) const
Returns array with indices of elements that have a given material number.
Material interface for gradient material models.
int giveIndexMaxElem(void)
Returns index (between 1 and Size) of maximum element in the array.
void createGlobalStiffnesMatrix(FloatMatrix *Diso, double &S0, Domain *d, int homMtrxType, double volumeOfInterpolationMesh)
void applyApproach2(Domain *d, int homMtrxType, double volumeOfInterpolationMesh)
Class representing vector of real numbers.
void resizeMaterials(int _newSize)
Resizes the internal data structure to accommodate space for _newSize materials.
Implementation of matrix containing floating point numbers.
Class implementing "simple" cross section model in finite element problem.
#define _IFT_AnisotropicLinearElasticMaterial_talpha
void initializeConnectivityTableForInterpolationElements(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 addCrosssectionToInterpolationElements(Domain *d)
void add(const FloatMatrix &a)
Adds matrix to the receiver.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
virtual int giveQcNodeType()
void setMaterial(int matIndx)
Sets the material of receiver.
void setGlobalNumber(int num)
Sets receiver globally unique number.
void setElement(int i, Element *obj)
Sets i-th component. The component will be further managed and maintained by domain object...
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
int intersectionTestSegmentTetrahedra3D(FloatArray &intersectCoordsX, FloatArray &intersectCoordsY, FloatArray &intersectCoordsZ, FloatArray *A, FloatArray *B, FloatArray *C, FloatArray *D, FloatArray *X1, FloatArray *X2)
virtual FloatArray * giveCoordinates()
void zero()
Zeroes all coefficient of receiver.
void push_back(const double &iVal)
Add one element.
std::vector< IntArray * > connectivityTable
void resizeCrossSectionModels(int _newSize)
Resizes the internal data structure to accommodate space for _newSize cross section models...
#define _IFT_SimpleCrossSection_thick
bool intersectionTestSegmentSegment2D(FloatArray &intersectCoords, FloatArray *A1, FloatArray *A2, FloatArray *B1, FloatArray *B2)
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
#define _IFT_AnisotropicLinearElasticMaterial_stiff
Element * createElement(const char *name, int num, Domain *domain)
Creates new instance of element corresponding to given keyword.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
IntArray interpolationElementIndices
#define OOFEM_WARNING(...)
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
virtual Material * giveMaterial()
void resize(int s)
Resizes receiver towards requested size.