36 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerial.h" 37 #include "../sm/Materials/InterfaceMaterials/structuralinterfacematerialstatus.h" 38 #include "../sm/Elements/structuralelement.h" 39 #include "../sm/CrossSections/structuralcrosssection.h" 85 mIncludeBulkJump(true),
86 mIncludeBulkCorr(true)
96 const double tol2 = 1.0e-18;
98 bool partitionSucceeded =
false;
118 bool firstIntersection =
true;
120 std :: vector< std :: vector< FloatArray > >pointPartitions;
123 std :: vector< int >enrichingEIs;
128 for (
size_t p = 0; p < enrichingEIs.size(); p++ ) {
130 int eiIndex = enrichingEIs [ p ];
133 std :: vector< int >touchingEiIndices;
136 if ( firstIntersection ) {
139 double startXi, endXi;
140 bool intersection =
false;
143 if ( intersection ) {
144 firstIntersection =
false;
147 for (
int i = 0; i < int ( pointPartitions.size() ); i++ ) {
155 if ( crack == NULL ) {
156 OOFEM_ERROR(
"Cohesive zones are only available for cracks.")
160 std :: vector< FloatArray >crackPolygon;
165 size_t numSeg = crackPolygon.size() - 1;
167 for (
size_t segIndex = 0; segIndex < numSeg; segIndex++ ) {
186 crackTang.
beDifferenceOf(crackPolygon [ segIndex + 1 ], crackPolygon [ segIndex ]);
195 crackTang = {0.0, 1.0};
200 -crackTang.
at(2), crackTang.
at(1)
204 crackPolygon [ segIndex ], crackPolygon [ segIndex + 1 ]);
208 crackPolygon [ segIndex ], crackPolygon [ segIndex + 1 ]);
212 double gw = gp->giveWeight();
213 double segLength = crackPolygon [ segIndex ].distance(crackPolygon [ segIndex + 1 ]);
214 gw *= 0.5 * segLength;
235 if( periodicityNormal(0) < 0.0 && periodicityNormal(1) < 0.0 ) {
237 periodicityNormal = {periodicityNormal(1), -periodicityNormal(0)};
259 double gw = gp->giveWeight();
260 double segLength = crackPolygon [ segIndex ].distance(crackPolygon [ segIndex + 1 ]);
261 gw *= 0.5 * segLength;
281 if( periodicityNormal(0) < 0.0 && periodicityNormal(1) < 0.0 ) {
283 periodicityNormal = {periodicityNormal(1), -periodicityNormal(0)};
303 partitionSucceeded =
true;
308 std :: vector< Triangle >allTriCopy;
309 for (
size_t triIndex = 0; triIndex <
mSubTri.size(); triIndex++ ) {
311 std :: vector< std :: vector< FloatArray > >pointPartitionsTri;
312 double startXi, endXi;
313 bool intersection =
false;
316 if ( intersection ) {
318 for (
int i = 0; i < int ( pointPartitionsTri.size() ); i++ ) {
327 if ( crack == NULL ) {
328 OOFEM_ERROR(
"Cohesive zones are only available for cracks.")
332 std :: vector< FloatArray >crackPolygon;
335 int numSeg = crackPolygon.size() - 1;
337 for (
int segIndex = 0; segIndex < numSeg; segIndex++ ) {
352 crackTang.
beDifferenceOf(crackPolygon [ segIndex + 1 ], crackPolygon [ segIndex ]);
361 crackTang = {0.0, 1.0};
366 -crackTang.
at(2), crackTang.
at(1)
370 crackPolygon [ segIndex ], crackPolygon [ segIndex + 1 ]);
374 crackPolygon [ segIndex ], crackPolygon [ segIndex + 1 ]);
378 double gw = gp->giveWeight();
379 double segLength = crackPolygon [ segIndex ].distance(crackPolygon [ segIndex + 1 ]);
380 gw *= 0.5 * segLength;
401 if( periodicityNormal(0) < 0.0 && periodicityNormal(1) < 0.0 ) {
403 periodicityNormal = {periodicityNormal(1), -periodicityNormal(0)};
424 double gw = gp->giveWeight();
425 double segLength = crackPolygon [ segIndex ].distance(crackPolygon [ segIndex + 1 ]);
426 gw *= 0.5 * segLength;
448 if( periodicityNormal(0) < 0.0 && periodicityNormal(1) < 0.0 ) {
450 periodicityNormal = {periodicityNormal(1), -periodicityNormal(0)};
471 allTriCopy.push_back(
mSubTri [ triIndex ]);
482 for(
int i = 0; i < numRefs; i++) {
484 std :: vector< Triangle > triRef;
503 std :: stringstream str3;
505 str3 <<
"TriEl" << elIndex <<
".vtk";
506 std :: string name3 = str3.str();
516 if ( partitionSucceeded ) {
517 std :: vector< std :: unique_ptr< IntegrationRule > >intRule;
527 std :: vector< FloatArray >czGPCoord;
531 czGPCoord.push_back( gp->giveGlobalCoordinates() );
548 std :: stringstream str;
550 str <<
"CZGaussPointsTime" << time <<
"El" << elIndex <<
".vtk";
551 std :: string name = str.str();
559 bool map_state_variables =
true;
560 if(map_state_variables) {
565 for(
int i = 0; i < num_ir_new; i++ ) {
576 ms_new =
dynamic_cast<MaterialStatus*
>( gp_new->giveMaterialStatus() );
582 double closest_dist = 0.0;
590 if(mapper_interface) {
595 OOFEM_ERROR(
"Failed casting to MaterialStatusMapperInterface.")
611 for(
int i = 0; i < num_ir_new; i++ ) {
622 double closest_dist_cz = 0.0;
628 bool non_std_cz =
false;
634 double closest_dist_bulk = 0.0;
636 if( closest_dist_bulk < closest_dist_cz ) {
637 printf(
"Bulk is closest. Dist: %e\n", closest_dist_bulk);
638 ms_old = ms_old_bulk;
647 if(mapper_interface) {
651 OOFEM_ERROR(
"Failed casting to MaterialStatusMapperInterface.")
669 for(
int i = 0; i < num_ir_new; i++ ) {
680 double closest_dist_cz = 0.0;
686 bool non_std_cz =
false;
692 double closest_dist_bulk = 0.0;
694 if( closest_dist_bulk < closest_dist_cz ) {
695 printf(
"Bulk is closest. Dist: %e\n", closest_dist_bulk);
696 ms_old = ms_old_bulk;
705 if(mapper_interface) {
709 OOFEM_ERROR(
"Failed casting to MaterialStatusMapperInterface.")
729 if ( partitionSucceeded ) {
739 return partitionSucceeded;
748 for(
size_t i = 0; i < iRules.size(); i++) {
751 const FloatArray &x = gp->giveGlobalCoordinates();
755 closest_ms =
dynamic_cast<MaterialStatus*
>( gp->giveMaterialStatus() );
761 oClosestDist = sqrt(min_dist2);
779 double angle = atan2( t(1), t(0) );
781 if( angle < 0.25*
M_PI ){
784 double l_s = l_box*(cos(angle));
790 double l_s = l_box*(sin(angle));
804 for (
size_t i = 0; i < materialModifyingEnrItemIndices.size(); i++ ) {
810 if ( structCS != NULL ) {
847 for (
size_t i = 0; i < materialModifyingEnrItemIndices.size(); i++ ) {
853 if ( structCSInclusion != NULL ) {
862 OOFEM_ERROR(
"failed to fetch StructuralCrossSection");
885 for (
size_t segIndex = 0; segIndex < numSeg; segIndex++ ) {
922 double dA = thickness * gp->giveWeight();
923 answer.
add(dA, NTimesT);
938 OOFEM_ERROR(
"Failed to cast StructuralFE2Material*.")
943 for (
size_t segIndex = 0; segIndex < numSeg; segIndex++ ) {
944 for(
int gpInd = 0; gpInd <
mpCZIntegrationRules[ segIndex ]->giveNumberOfIntegrationPoints(); gpInd++) {
961 OOFEM_ERROR(
"The material status is not of an allowed type.")
986 FloatArray smearedJumpStrain = {jump2D(0)*crackNormal(0)/l_s, jump2D(1)*crackNormal(1)/l_s, 0.0, 0.0, 0.0, (1.0/l_s)*( jump2D(0)*crackNormal(1) + jump2D(1)*crackNormal(0) )};
989 smearedBulkStrain.
zero();
1000 double eps = 1.0e-6;
1003 xPert.
add(eps, crackNormal);
1011 xPert.
add(-eps, crackNormal);
1018 BAvg.
add(1.0, BMinus);
1023 if( smearedBulkStrain.
giveSize() == 4 ) {
1024 smearedBulkStrain = {smearedBulkStrain(0), smearedBulkStrain(1), smearedBulkStrain(2), 0.0, 0.0, smearedBulkStrain(3)};
1027 FloatArray smearedJumpStrainTemp = smearedJumpStrain;
1029 smearedJumpStrain.
add(smearedBulkStrain);
1046 FloatArray trac = {stressVec(0)*crackNormal(0)+stressVec(5)*crackNormal(1), stressVec(5)*crackNormal(0)+stressVec(1)*crackNormal(1)};
1058 answer.
add(dA, NTimesT);
1068 FloatArray stressV4 = {stressVec(0)-stressVecBulk(0), stressVec(1)-stressVecBulk(1), stressVec(2)-stressVecBulk(2), stressVec(5)-stressVecBulk(5)};
1071 answer.
add(1.0*dA*l_s, BTimesT);
1089 iJump.
at(1), iJump.
at(2), 0.0
1094 iCrackNormal.
at(1), iCrackNormal.
at(2), 0.0
1108 FloatArray TLoc, jump3DLoc, TLocRenumbered(3);
1112 jump3DLoc.
at(3), jump3DLoc.
at(1), jump3DLoc.
at(2)
1120 OOFEM_ERROR(
"Failed to cast StructuralInterfaceMaterial*.")
1124 TLocRenumbered.
at(2), TLocRenumbered.
at(3), TLocRenumbered.
at(1)
1149 OOFEM_ERROR(
"Failed to cast StructuralInterfaceMaterial*.")
1153 for (
size_t segIndex = 0; segIndex < numSeg; segIndex++ ) {
1167 0.0, jump2D.
at(1), jump2D.
at(2)
1191 K3D.
at(1, 1) = K3DRenumbered.
at(2, 2);
1192 K3D.
at(1, 2) = K3DRenumbered.
at(2, 3);
1193 K3D.
at(1, 3) = K3DRenumbered.
at(2, 1);
1195 K3D.
at(2, 1) = K3DRenumbered.
at(3, 2);
1196 K3D.
at(2, 2) = K3DRenumbered.
at(3, 3);
1197 K3D.
at(2, 3) = K3DRenumbered.
at(3, 1);
1199 K3D.
at(3, 1) = K3DRenumbered.
at(1, 2);
1200 K3D.
at(3, 2) = K3DRenumbered.
at(1, 3);
1201 K3D.
at(3, 3) = K3DRenumbered.
at(1, 1);
1213 crackNormal.
at(1), crackNormal.at(2), 0.0
1232 K2D.
at(1, 1) = K3DGlob.
at(1, 1);
1233 K2D.
at(1, 2) = K3DGlob.
at(1, 2);
1234 K2D.
at(2, 1) = K3DGlob.
at(2, 1);
1235 K2D.
at(2, 2) = K3DGlob.
at(2, 2);
1239 double eps = 1.0e-9;
1257 jump2DPert = jump2D;
1258 jump2DPert.
at(1) += eps;
1261 K2D.
at(1, 1) = ( TPert.
at(1) - T.
at(1) ) / eps;
1262 K2D.
at(2, 1) = ( TPert.
at(2) - T.
at(2) ) / eps;
1264 jump2DPert = jump2D;
1265 jump2DPert.
at(2) += eps;
1268 K2D.
at(1, 2) = ( TPert.
at(1) - T.
at(1) ) / eps;
1269 K2D.
at(2, 2) = ( TPert.
at(2) - T.
at(2) ) / eps;
1280 double dA = thickness * gp->giveWeight();
1281 answer.
add(dA, tmp2);
1297 OOFEM_ERROR(
"Failed to cast StructuralFE2Material*.")
1300 for (
size_t segIndex = 0; segIndex < numSeg; segIndex++ ) {
1302 for(
int gpInd = 0; gpInd <
mpCZIntegrationRules[ segIndex ]->giveNumberOfIntegrationPoints(); gpInd++) {
1322 OOFEM_ERROR(
"The material status is not of an allowed type.")
1354 Ka(0,0) = (0.5/l_s)*( C(0,0)*n(0)*n(0) + a2*C(0,5)*n(0)*n(1) + a1*C(5,0)*n(1)*n(0) + a3*C(5,5)*n(1)*n(1) ) +
1355 (0.5/l_s)*( C(0,0)*n(0)*n(0) + a2*C(0,5)*n(0)*n(1) + a1*C(5,0)*n(1)*n(0) + a3*C(5,5)*n(1)*n(1) );
1357 Ka(0,1) = (0.5/l_s)*( a2*C(0,5)*n(0)*n(0) + C(0,1)*n(0)*n(1) + a3*C(5,5)*n(1)*n(0) + a1*C(5,1)*n(1)*n(1) ) +
1358 (0.5/l_s)*( a2*C(0,5)*n(0)*n(0) + C(0,1)*n(0)*n(1) + a3*C(5,5)*n(1)*n(0) + a1*C(5,1)*n(1)*n(1) );
1361 Ka(1,0) = (0.5/l_s)*( a1*C(5,0)*n(0)*n(0) + a3*C(5,5)*n(0)*n(1) + C(1,0)*n(1)*n(0) + a2*C(1,5)*n(1)*n(1) ) +
1362 (0.5/l_s)*( a1*C(5,0)*n(0)*n(0) + a3*C(5,5)*n(0)*n(1) + C(1,0)*n(1)*n(0) + a2*C(1,5)*n(1)*n(1) );
1365 Ka(1,1) = (0.5/l_s)*( a3*C(5,5)*n(0)*n(0) + a1*C(5,1)*n(0)*n(1) + a2*C(1,5)*n(1)*n(0) + C(1,1)*n(1)*n(1) ) +
1366 (0.5/l_s)*( a3*C(5,5)*n(0)*n(0) + a1*C(5,1)*n(0)*n(1) + a2*C(1,5)*n(1)*n(0) + C(1,1)*n(1)*n(1) );
1376 answer.
add(dA, tmp2);
1390 double eps = 1.0e-6;
1408 BAvg.
add(1.0, BMinus);
1414 Kb(0,0) = C(0,0)*n(0) + C(5,0)*n(1);
1415 Kb(0,1) = C(0,1)*n(0) + C(5,1)*n(1);
1416 Kb(0,3) = C(0,5)*n(0) + C(5,5)*n(1);
1418 Kb(1,0) = C(5,0)*n(0) + C(1,0)*n(1);
1419 Kb(1,1) = C(5,1)*n(0) + C(1,1)*n(1);
1420 Kb(1,3) = C(5,5)*n(0) + C(1,5)*n(1);
1424 answer.
add(dA, tmp2);
1433 answer.
add(1.0*dA, tmp);
1459 answer.
add(1.0*dA*l_s, tmp2);
1462 C4Bulk(0,0) = CBulk(0,0);
1463 C4Bulk(0,1) = CBulk(0,1);
1464 C4Bulk(0,2) = CBulk(0,2);
1465 C4Bulk(0,3) = CBulk(0,5);
1467 C4Bulk(1,0) = CBulk(1,0);
1468 C4Bulk(1,1) = CBulk(1,1);
1469 C4Bulk(1,2) = CBulk(1,2);
1470 C4Bulk(1,3) = CBulk(1,5);
1472 C4Bulk(2,0) = CBulk(2,0);
1473 C4Bulk(2,1) = CBulk(2,1);
1474 C4Bulk(2,2) = CBulk(2,2);
1475 C4Bulk(2,3) = CBulk(2,5);
1477 C4Bulk(3,0) = CBulk(5,0);
1478 C4Bulk(3,1) = CBulk(5,1);
1479 C4Bulk(3,2) = CBulk(5,2);
1480 C4Bulk(3,3) = CBulk(5,5);
1484 answer.
add(-1.0*dA*l_s, tmp2);
1496 printf(
"Entering XfemElementInterface :: computeCohesiveTangentAt().\n");
1503 if ( structEl == NULL ) {
1512 answer.
resize(ndofs, ndofs);
1526 if ( ipDensity != NULL ) {
1528 density = * ipDensity;
1532 mass += density * dV;
1537 for (
int i = 1; i <= ndofs; i++ ) {
1538 for (
int j = i; j <= ndofs; j++ ) {
1541 if ( mask.
at(k) == 0 ) {
1545 summ += n.
at(k, i) * n.
at(k, j);
1548 answer.
at(i, j) += summ * density * dV;
1556 const double tol = 1.0e-9;
1557 const double regularizationCoeff = 1.0e-6;
1559 for (
int i = 0; i < numRows; i++ ) {
1560 if ( fabs( answer(i, i) ) < tol ) {
1561 answer(i, i) += regularizationCoeff;
1581 int planeStrainFlag = -1;
1583 if ( planeStrainFlag == 1 ) {
1610 OOFEM_ERROR(
"Failed to fetch pointer for mpCZMat.");
1661 if ( matMode == _3dMat || matMode == _PlaneStrain ) {
1662 answer.
at(1) += 1.0;
1663 answer.
at(2) += 1.0;
1664 answer.
at(3) += 1.0;
1665 }
else if ( matMode == _PlaneStress ) {
1666 answer.
at(1) += 1.0;
1667 answer.
at(2) += 1.0;
1668 }
else if ( matMode == _1dMat ) {
1669 answer.
at(1) += 1.0;
1680 for (
int candidateIndex : iCandidateIndices ) {
1681 if ( candidateIndex != iEnrItemIndex ) {
1691 if ( efStart != NULL ) {
1696 oTouchingEnrItemIndices.push_back(candidateIndex);
1702 if ( efEnd != NULL ) {
1707 oTouchingEnrItemIndices.push_back(candidateIndex);
1716 const int numCells =
mSubTri.size();
1717 vtkPieces [ 0 ].setNumberOfCells(numCells);
1719 int numTotalNodes = numCells * 3;
1720 vtkPieces [ 0 ].setNumberOfNodes(numTotalNodes);
1723 std :: vector< FloatArray >nodeCoords;
1724 int nodesPassed = 1;
1726 for (
int i = 1; i <= 3; i++ ) {
1729 vtkPieces [ 0 ].setNodeCoords(nodesPassed, x);
1737 for (
size_t i = 1; i <= mSubTri.size(); i++ ) {
1739 nodesPassed, nodesPassed + 1, nodesPassed + 2
1742 vtkPieces [ 0 ].setConnectivity(i, nodes);
1744 vtkPieces [ 0 ].setOffset(i, offset);
1747 vtkPieces [ 0 ].setCellType(i, 5);
1753 vtkPieces [ 0 ].setNumberOfPrimaryVarsToExport(primaryVarsToExport.
giveSize(), numTotalNodes);
1755 for (
int fieldNum = 1; fieldNum <= primaryVarsToExport.
giveSize(); fieldNum++ ) {
1761 for (
auto &tri: mSubTri ) {
1763 triCenter.
add( tri.giveVertex(2) );
1764 triCenter.
add( tri.giveVertex(3) );
1765 triCenter.
times(1.0 / 3.0);
1767 double meanEdgeLength = 0.0;
1768 meanEdgeLength += ( 1.0 / 3.0 ) * tri.giveVertex(1).distance( tri.giveVertex(2) );
1769 meanEdgeLength += ( 1.0 / 3.0 ) * tri.giveVertex(2).distance( tri.giveVertex(3) );
1770 meanEdgeLength += ( 1.0 / 3.0 ) * tri.giveVertex(3).distance( tri.giveVertex(1) );
1774 for (
int i = 1; i <= 3; i++ ) {
1775 if ( type == DisplacementVector ) {
1790 double pertLength = relPertLength;
1793 for (
int j = 0; j < numTries; j++ ) {
1797 pertVec.
times(pertLength);
1821 bool joinNodes =
false;
1823 for (
int eiIndex = 1; eiIndex <= numEI; eiIndex++ ) {
1826 double levelSetTang = 0.0, levelSetNormal = 0.0, levelSetInNode = 0.0;
1828 bool evaluationSucceeded =
true;
1829 for (
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++ ) {
1834 evaluationSucceeded =
false;
1836 levelSetTang += N.
at(elNodeInd) * levelSetInNode;
1839 evaluationSucceeded =
false;
1841 levelSetNormal += N.
at(elNodeInd) * levelSetInNode;
1844 double tangSignDist = levelSetTang, arcPos = 0.0;
1847 if ( geoEI != NULL ) {
1853 if(!evaluationSucceeded) {
1862 if ( ( tangSignDist < ( 1.0e-3 ) * meanEdgeLength || fabs(levelSetNormal) > ( 1.0e-2 ) * meanEdgeLength ) &&
false ) {
1884 uTemp [ 0 ], uTemp [ 1 ], 0.0
1890 vtkPieces [ 0 ].setPrimaryVarInNode(fieldNum, nodesPassed, valuearray);
1893 printf(
"fieldNum: %d\n", fieldNum);
1903 vtkPieces [ 0 ].setNumberOfInternalVarsToExport(0, numTotalNodes);
1906 vtkPieces [ 0 ].setNumberOfCellVarsToExport(cellVarsToExport.
giveSize(), numCells);
1907 for (
int i = 1; i <= cellVarsToExport.
giveSize(); i++ ) {
1910 for (
size_t triInd = 1; triInd <= mSubTri.size(); triInd++ ) {
1927 averageVoigt.
at(1) = average.
at(1);
1928 averageVoigt.
at(5) = average.
at(2);
1929 averageVoigt.
at(9) = average.
at(3);
1930 averageVoigt.
at(6) = averageVoigt.
at(8) = average.
at(4);
1931 averageVoigt.
at(3) = averageVoigt.
at(7) = average.
at(5);
1932 averageVoigt.
at(2) = averageVoigt.
at(4) = average.
at(6);
1937 averageVoigt.
at(1) = average.
at(1);
1941 vtkPieces [ 0 ].setCellVar(i, triInd, averageVoigt);
1960 for (
int enrItIndex = 1; enrItIndex <= nEnrIt; enrItIndex++ ) {
1962 for (
int nodeInd = 1; nodeInd <= numTotalNodes; nodeInd++ ) {
1963 const FloatArray &x = nodeCoords [ nodeInd - 1 ];
1972 if ( xfemstype == XFEMST_LevelSetPhi ) {
1973 double levelSet = 0.0, levelSetInNode = 0.0;
1975 for (
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++ ) {
1980 levelSet += N.
at(elNodeInd) * levelSetInNode;
1987 vtkPieces [ 0 ].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
1988 }
else if ( xfemstype == XFEMST_LevelSetGamma ) {
1989 double levelSet = 0.0, levelSetInNode = 0.0;
1991 for (
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++ ) {
1996 levelSet += N.
at(elNodeInd) * levelSetInNode;
2003 vtkPieces [ 0 ].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
2004 }
else if ( xfemstype == XFEMST_NodeEnrMarker ) {
2005 double nodeEnrMarker = 0.0, nodeEnrMarkerInNode = 0.0;
2007 for (
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++ ) {
2011 nodeEnrMarker += N.
at(elNodeInd) * nodeEnrMarkerInNode;
2019 vtkPieces [ 0 ].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
2036 FloatArray globCoord = ip->giveGlobalCoordinates();
2041 gptot += ip->giveWeight();
2042 answer.
add(ip->giveWeight(), temp);
2046 answer.
times(1. / gptot);
CrossSection * giveCrossSection()
virtual void XfemElementInterface_prepareNodesForDelaunay(std::vector< std::vector< FloatArray > > &oPointPartitions, double &oCrackStartXi, double &oCrackEndXi, int iEnrItemIndex, bool &oIntersection)
Returns an array of array of points. Each array of points defines the points of a subregion of the el...
std::vector< Triangle > mSubTri
virtual void giveStiffnessMatrix_PlaneStrain(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
static double giveRelLengthTolTight()
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual bool isActivated(TimeStep *tStep)
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
std::vector< std::unique_ptr< IntegrationRule > > & giveIntegrationRulesArray()
const std::vector< int > & giveMaterialModifyingEnrItemIndices() const
virtual void computeCohesiveTangentAt(FloatMatrix &answer, TimeStep *tStep)
Abstract class representing entity, which is included in the FE model using one (or more) global func...
virtual void XfemElementInterface_computeDeformationGradientVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
bool evalNodeEnrMarkerInNode(double &oNodeEnrMarker, int iNodeInd) const
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
virtual void giveRealStress_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
int giveNumGpPerTri() const
void giveSubtriangulationCompositeExportData(std::vector< VTKPiece > &vtkPieces, IntArray &primaryVarsToExport, IntArray &internalVarsToExport, IntArray cellVarsToExport, TimeStep *tStep)
VTK Interface.
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Computes vector product (or cross product) of vectors given as parameters, , and stores the result in...
EnrichmentFront * giveEnrichmentFrontStart()
virtual void give3dStiffnessMatrix_dTdj(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
void giveSubPolygon(std::vector< FloatArray > &oPoints, const double &iXiStart, const double &iXiEnd) const
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
virtual void copyStateVariables(const MaterialStatus &iStatus)=0
static void refineTriangle(std::vector< Triangle > &oRefinedTri, const Triangle &iTri)
Split a triangle in four.
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
virtual IntegrationRule * giveIntegrationRule(int i)
int giveGlobalNumber() const
virtual void XfemElementInterface_computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity=NULL)
int giveNumTriRefs() const
Number of Gauss points per sub-triangle in cut elements.
virtual bool hasCohesiveZone() const
Abstract base class for "structural" finite elements with geometrical nonlinearities.
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
virtual void createMaterialStatus(GaussPoint &iGP)=0
Provides Xfem interface for an element.
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
std::unique_ptr< FloatArray > initialDisplacements
Initial displacement vector, describes the initial nodal displacements when element has been casted...
double & at(int i)
Coefficient access function.
int giveGlobalNumber() const
void setIntegrationRules(std::vector< std::unique_ptr< IntegrationRule > > irlist)
Sets integration rules.
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
void clear()
Clears receiver (zero size).
void giveElementEnrichmentItemIndices(std::vector< int > &oElemEnrInd, int iElementIndex) const
virtual void computeTangentialSignDist(double &oDist, const FloatArray &iPoint, double &oMinDistArcPos) const =0
virtual FloatArray * giveCoordinates()
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
std::vector< std::unique_ptr< IntegrationRule > > mIntRule_tmp
double giveTargetTime()
Returns target time.
Abstract base class for all finite elements.
virtual void initializeCZMaterial()
Base class for dof managers.
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
void recomputeTractionMesh()
MaterialMode
Type representing material mode of integration point.
XfemStructureManager: XFEM manager with extra functionality specific for the sm module.
void giveIntersectionsTouchingCrack(std::vector< int > &oTouchingEnrItemIndices, const std::vector< int > &iCandidateIndices, int iEnrItemIndex, XfemManager &iXMan)
Identify enrichment items with an intersection enrichment front that touches a given enrichment item...
std::vector< std::unique_ptr< IntegrationRule > > mpCZIntegrationRules_tmp
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
void AppendCohesiveZoneGaussPoint(GaussPoint *ipGP)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveCZInputRecord(DynamicInputRecord &input)
#define _IFT_XfemElementInterface_PlaneStrain
XfemManager * giveXfemManager()
virtual int giveNumberOfDofManagers() const
virtual IRResultType initializeCZFrom(InputRecord *ir)
virtual FEInterpolation * giveInterpolation() const
Abstract base class representing integration rule.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual void computeCohesiveTangent(FloatMatrix &answer, TimeStep *tStep)
Base abstract class representing cross section in finite element mesh.
bool giveVtkDebug() const
Class representing a general abstraction for finite element interpolation class.
PrescribedGradientHomogenization * giveBC()
int giveNumberOfEnrichmentItems() const
const char * __MaterialModeToString(MaterialMode _value)
Abstract base class for all "structural" finite elements.
void computeIPAverageInTriangle(FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep, const Triangle &iTri)
Help functions for VTK export.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
double computeEffectiveSveSize(StructuralFE2MaterialStatus *iFe2Ms)
virtual void giveFirstPKTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, const FloatMatrix &F, TimeStep *tStep)
bool giveUseNonStdCz() const
Material * giveMaterial(int n)
Service for accessing particular domain material model.
void setNewlyInserted(bool iNewlyInserted)
bool pointIsInTriangle(const FloatArray &iP) const
Checks if the projection of the the point iP onto the triangle plane is inside the triangle...
double computeSquaredNorm() const
Computes the square of the norm.
const FloatArray & giveNormal() const
virtual double giveWeight()
Returns integration weight of receiver.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
UnknownType
Type representing particular unknown (its physical meaning).
virtual void giveRealStress_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)=0
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
void times(double f)
Multiplies receiver by factor f.
bool evalLevelSetNormalInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
void XfemElementInterface_createEnrNmatrixAt(FloatMatrix &oAnswer, const FloatArray &iLocCoord, Element &iEl, bool iSetDiscontContribToZero)
Creates enriched N-matrix.
Wrapper around element definition to provide FEICellGeometry interface.
#define _IFT_XfemElementInterface_NumIntPointsCZ
virtual void giveStiffnessMatrix_PlaneStress(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)=0
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
This class implements a structural interface material status information.
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
double distance_square(const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
Imposes a prescribed gradient weakly on the boundary with an independent traction discretization...
std::vector< std::vector< int > > mCZTouchingEnrItemIndices
Indices of enrichment items that give cohesive zone contributions to a given GP, even though the GP i...
const FloatArray & giveGlobalCoordinates()
std::vector< std::unique_ptr< IntegrationRule > > mpCZIntegrationRules
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
void ComputeBOrBHMatrix(FloatMatrix &oAnswer, GaussPoint &iGP, Element &iEl, bool iComputeBH, const FloatArray &iNaturalGpCoord)
Help function for computation of B and BH.
Abstract base class representing a material status information.
std::vector< std::unique_ptr< IntegrationRule > > mpCZExtraIntegrationRules
bool evalLevelSetTangInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
Class representing vector of real numbers.
std::vector< int > mCZEnrItemIndices
Index of enrichment items associated with cohesive zones.
Implementation of matrix containing floating point numbers.
This class manages the xfem part.
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.
static void computeIPAverage(FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep)
Computes a cell average of an InternalStateType varible based on the weights in the integrationpoints...
#define _IFT_XfemElementInterface_CohesiveZoneMaterial
IntArray vtkExportFields
List with the fields that should be exported to VTK.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
MaterialStatus * giveClosestGP_MatStat(double &oClosestDist, std::vector< std::unique_ptr< IntegrationRule > > &iRules, const FloatArray &iCoord)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual ~XfemStructuralElementInterface()
bool isElementEnriched(const Element *elem)
virtual double domainSize(Domain *d, int set)
void add(const FloatMatrix &a)
Adds matrix to the receiver.
BasicGeometry * giveGeometry()
bool mUsePlaneStrain
Flag that tells if plane stress or plane strain is assumed.
void zero()
Zeroes all coefficients of receiver.
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void setColumn(const FloatArray &src, int c)
Sets the values of the matrix in specified column.
void times(double s)
Multiplies receiver with scalar.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
EnrichmentItem * giveEnrichmentItem(int n)
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
bool tipIsTouchingEI(const TipInfo &iTipInfo)
Abstract base class for all "structural" constitutive models.
virtual void XfemElementInterface_partitionElement(std::vector< Triangle > &oTriangles, const std::vector< FloatArray > &iPoints)
Partitions the element into patches by a triangulation.
XfemStructuralElementInterface(Element *e)
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
int giveElementPlaceInArray(int iGlobalElNum) const
Returns the array index of the element with global number iGlobalElNum, so that it can be fetched by ...
virtual bool XfemElementInterface_updateIntegrationRule()
Updates integration rule based on the triangulation.
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 void computeGlobalCohesiveTractionVector(FloatArray &oT, const FloatArray &iJump, const FloatArray &iCrackNormal, const FloatMatrix &iNMatrix, GaussPoint &iGP, TimeStep *tStep)
Multiscale constitutive model for subscale structural problems.
virtual void computeBHmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes a matrix which, multiplied by the column matrix of nodal displacements, gives the displaceme...
const TipInfo & giveTipInfo() const
void push_back(const double &iVal)
Add one element.
void beUnitMatrix()
Sets receiver to unity matrix.
Abstract base class representing the "problem" under consideration.
virtual bool isMaterialModified(GaussPoint &iGP, Element &iEl, CrossSection *&opCS) const
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
int giveSize() const
Returns the size of receiver.
Abstract base class for all structural cross section models.
void computeNCohesive(FloatMatrix &oN, GaussPoint &iGP, int iEnrItemIndex, const std::vector< int > &iTouchingEnrItemIndices)
Compute N-matrix for cohesive zone.
Abstract base class for all "structural" interface models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
virtual void computeCohesiveForces(FloatArray &answer, TimeStep *tStep)
double normalize()
Normalizes receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
virtual bool hasAnalyticalTangentStiffness() const =0
Tells if the model has implemented analytical tangent stiffness.
void computeDisplacementJump(GaussPoint &iGP, FloatArray &oJump, const FloatArray &iSolVec, const FloatMatrix &iNMatrix)
void letNormalBe(FloatArray iN)
const FloatArray & giveNormal() const
Returns const reference to normal vector.
Class representing integration point in finite element program.
Class representing solution step.
void letNormalBe(FloatArray iN)
Assigns normal vector.
virtual void XfemElementInterface_computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *, TimeStep *tStep)
EnrichmentFront * giveEnrichmentFrontEnd()
void add(const FloatArray &src)
Adds array src to receiver.
EnrichmentItem with geometry described by BasicGeometry.
PatchIntegrationRule provides integration over a triangle patch.
void setPeriodicityNormal(const FloatArray &iPeriodicityNormal)
virtual void giveMassMtrxIntegrationgMask(IntArray &answer)
Returns mask indicating, which unknowns (their type and ordering is the same as element unknown vecto...
std::vector< std::unique_ptr< IntegrationRule > > mpCZExtraIntegrationRules_tmp
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.
virtual Material * giveMaterial(IntegrationPoint *ip)=0
Returns the material associated with the GP.
virtual void XfemElementInterface_computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.