55 #include "../sm/Materials/structuralmaterial.h" 56 #include "../sm/EngineeringModels/staticstructural.h" 75 mFirstNode->giveLocationArray({Trac_u, Trac_v}, trac_loc_r, s);
89 int numPointsPerSeg = 1;
90 mIntRule->SetUpPointsOnLine(numPointsPerSeg, matMode);
99 mTractionDofIDs( {Trac_u, Trac_v} ),
134 for (
size_t i = 0; i <
mpTracElNew.size(); i++ ) {
191 OOFEM_ERROR(
"mNumTractionNodesAtIntersections > 1 is not allowed if mTractionInterpOrder == 0.")
197 int duplicateCorners = 0;
201 if ( duplicateCorners == 1 ) {
262 if ( type == ExternalForcesVector ) {
273 el->giveTractionLocationArray(rows, type, s);
278 }
else if ( type == InternalForcesVector ) {
282 for (
GaussPoint *gp: *(el->mIntRule.get()) ) {
286 IntArray disp_loc_array, trac_loc_array;
287 computeIntForceGPContrib(contrib_disp, disp_loc_array, contrib_trac, trac_loc_array, *el, *gp, dim, tStep, gp->giveGlobalCoordinates(), 1.0, mode, type, s);
288 answer.
assemble(contrib_disp, disp_loc_array);
289 answer.
assemble(contrib_trac, trac_loc_array);
294 disp_loc_array.
clear(); trac_loc_array.
clear();
297 computeIntForceGPContrib(contrib_disp, disp_loc_array, contrib_trac, trac_loc_array, *el, *gp, dim, tStep, xMinus, -1.0, mode, type, s);
298 answer.
assemble(contrib_disp, disp_loc_array);
299 answer.
assemble(contrib_trac, trac_loc_array);
317 fe_dispLock.
push_back(nodeUnknowns [ i ]);
322 answer.
assemble(fe_dispLock, dispLockRows);
337 const FloatArray &x = gp->giveGlobalCoordinates();
361 contrib_gp.
times(-detJ * gp->giveWeight()*loadLevel);
363 oContrib.
add(contrib_gp);
368 void PrescribedGradientBCWeak :: computeIntForceGPContrib(
FloatArray &oContrib_disp,
IntArray &oDisp_loc_array,
FloatArray &oContrib_trac,
IntArray &oTrac_loc_array,
TracSegArray &iEl,
GaussPoint &iGP,
int iDim,
TimeStep *tStep,
const FloatArray &iBndCoord,
const double &iScaleFac,
ValueModeType mode,
CharType type,
const UnknownNumberingScheme &s)
388 for (
int i = 1; i <= numDMan; i++ ) {
399 dispUnknowns.
append(nodeUnknowns);
416 std::vector<FloatArray> gpCoordArray;
418 if ( type == TangentStiffnessMatrix || type == SecantStiffnessMatrix || type == ElasticStiffnessMatrix ) {
422 for (
GaussPoint *gp: *(el->mIntRule.get()) ) {
424 gpCoordArray.push_back( gp->giveGlobalCoordinates() );
438 IntArray lockRows, lockCols, nodeRows, nodeCols;
445 answer.
assemble(lockRows, nodeCols, KeDispLock);
446 answer.
assemble(nodeRows, lockCols, KeDispLock);
451 answer.
assemble(lockRows, lockCols, KZero);
467 KeDispLock.
times(scale);
468 answer.
assemble(nodeRows, nodeCols, KeDispLock);
472 printf(
"Skipping assembly in PrescribedGradientBCWeak::assemble().\n");
492 double scaling = 1.0e0;
504 answer.
assemble(nodeRows, nodeCols, KeDispLock);
513 double scaling = 1.0e0;
544 answer.
assemble(nodeRows, nodeCols, KeDispLock);
575 answer.
assemble(trac_rows, disp_cols, contrib);
579 answer.
assemble(disp_cols, trac_rows, contribT);
591 tracUnknowns.clear();
604 answer.
assemble(trac_rows, disp_cols, contrib);
608 answer.
assemble(disp_cols, trac_rows, contribT);
614 for (
int i : trac_rows) {
637 el->mFirstNode->giveLocationArray(
giveTracDofIDs(), trac_loc_r, s);
646 for (
size_t tracElInd = 0; tracElInd < mpTractionElements.size(); tracElInd++ ) {
649 const TractionElement &tEl = * ( mpTractionElements [ tracElInd ] );
650 for (
int tracNodeInd : tEl.mTractionNodeInd ) {
651 Node *tNode = mpTractionNodes [ tracNodeInd ];
688 o_x_times_N.
resize(num_t_eq,3);
696 IntArray rows = {trac_el_ind*2-1,trac_el_ind*2};
698 for (
GaussPoint *gp: *(el->mIntRule.get()) ) {
711 const FloatArray &x = gp->giveGlobalCoordinates();
725 coord_mat.
at(1,1) = tmp.
at(1);
726 coord_mat.
at(2,2) = tmp.
at(2);
736 coord_mat.
at(1,3) = 0.5*tmp.
at(2);
737 coord_mat.
at(2,3) = 0.5*tmp.
at(1);
750 double detJ = 0.5 * el->giveLength();
751 contrib.
times( detJ * gp->giveWeight() );
757 o_x_times_N.
assemble(contrib, rows, cols);
776 o_x_times_N.
resize(3, num_t_eq);
784 IntArray cols = {trac_el_ind*2-1,trac_el_ind*2};
786 for (
GaussPoint *gp: *(el->mIntRule.get()) ) {
799 const FloatArray &x = gp->giveGlobalCoordinates();
813 coord_mat.
at(1,1) = tmp.
at(1);
814 coord_mat.
at(2,2) = tmp.
at(2);
822 coord_mat.
at(3,1) = 0.5*tmp.
at(2);
823 coord_mat.
at(3,2) = 0.5*tmp.
at(1);
836 double detJ = 0.5 * el->giveLength();
837 contrib.
times( detJ * gp->giveWeight() );
843 o_x_times_N.
assemble(contrib, rows, cols);
853 double Lx =
mUC[0] -
mLC[0];
854 double Ly =
mUC[1] - mLC[1];
855 double dSize = Lx*Ly;
863 for (
GaussPoint *gp: *(el->mIntRule.get()) ) {
873 const FloatArray &x = gp->giveGlobalCoordinates();
877 el->mFirstNode->giveUnknownVector(tracUnknowns,
giveTracDofIDs(), VM_Total, tStep);
889 double detJ = 0.5 * el->giveLength();
890 contrib.
times( detJ * gp->giveWeight() );
892 for (
int m = 0; m < dim; m++ ) {
893 for (
int n = 0; n < dim; n++ ) {
894 stressMatrix(m, n) += contrib(m, n);
904 stressMatrix(0, 0), stressMatrix(1, 1), 0.0, 0.0, 0.0, 0.5*(stressMatrix(0, 1) + stressMatrix(1, 0))
910 sigma.
times(1.0 / dSize);
919 static double tot_time = 0.0;
923 static double assemble_time = 0.0;
924 Timer assemble_timer;
941 std :: unique_ptr< SparseLinearSystemNM > solver(
943 bool symmetric_matrix =
false;
944 SparseMtrxType stype = solver->giveRecommendedMatrix(symmetric_matrix);
946 double Lx =
mUC[0] -
mLC[0];
947 double Ly =
mUC[1] - mLC[1];
948 double rve_size = Lx*Ly;
954 OOFEM_ERROR(
"Couldn't create sparse matrix of type %d\n", stype);
958 if ( rveStatStruct ) {
971 if ( Kmicro->giveNumberOfColumns() == 0 ) {
983 assemble_time += assemble_timer.
getUtime();
984 printf(
"Assembly time for RVE tangent: %e\n", assemble_time);
993 int neq = Kmicro->giveNumberOfRows();
996 for (
int i = 1; i <= neq; i++ ) {
1005 std :: unique_ptr< SparseMtrx >
S(Kmicro->giveSubMatrix(loc_u, loc_u));
1007 std :: unique_ptr< SparseMtrx > C(Kmicro->giveSubMatrix(loc_u, loc_t));
1009 C->toFloatMatrix(Cd);
1014 solver->solve(*
S, Cd, m);
1034 OOFEM_ERROR(
"Couldn't create sparse matrix of type %d\n", stype);
1040 for (
int i = 1; i <= num_eq_G; i++) {
1044 Gs->buildInternalStructure(rve, num_eq_G, num_eq_G, loc_G, loc_G);
1045 Gs->assemble(loc_G, loc_G, G);
1047 Gs->assembleBegin();
1054 solver->solve(*Gs, D, p);
1061 Ered.
times(1.0/rve_size);
1098 oTangent [ 1 ], -oTangent [ 0 ]
1112 const double nodeDistTol = 1.0e-15;
1143 bool split_at_holes =
true;
1145 const double l_s =
mUC[0] -
mLC[0];
1146 const double minPointDist = 1.0e-4*l_s;
1149 std::vector<FloatArray> holeCoordUnsorted, allCoordUnsorted;
1154 holeCoordUnsorted.push_back( {
mUC[0], mLC[1]} );
1155 allCoordUnsorted.push_back( {
mUC[0], mLC[1]} );
1157 holeCoordUnsorted.push_back( {
mUC[0],
mUC[1]} );
1158 allCoordUnsorted.push_back( {
mUC[0],
mUC[1]} );
1160 holeCoordUnsorted.push_back( {mLC[0],
mUC[1]} );
1161 allCoordUnsorted.push_back( {mLC[0],
mUC[1]} );
1179 int pointsPassed = 0;
1180 for (
const auto &x : allCoordUnsorted ) {
1183 holeCoordUnsorted.push_back(x);
1208 std :: vector< TracSegArray * > tracElNew0, tracElNew1;
1212 for (
size_t i = 1; i < holeCoordUnsorted.size(); i++) {
1218 const FloatArray xC = {0.5*(xS[0]+xE[0]), 0.5*(xS[1]+xE[1])};
1223 tracElNew1[0]->mInteriorSegments.push_back(
Line(xS, xE) );
1231 if ( split_at_holes ) {
1244 int totNodesCreated = 0;
1263 el->mFirstNode.reset(
new Node(numNodes + 1,
domain) );
1264 el->mFirstNode->setGlobalNumber(numNodes + 1);
1266 el->mFirstNode->appendDof(
new MasterDof(el->mFirstNode.get(), (
DofIDItem ) dofId) );
1269 el->mFirstNode->setCoordinates( el->mInteriorSegments[0].giveVertex(1) );
1281 el->mFirstNode.reset(
new Node(numNodes + 1,
domain) );
1282 el->mFirstNode->setGlobalNumber(numNodes + 1);
1284 el->mFirstNode->appendDof(
new MasterDof(el->mFirstNode.get(), (
DofIDItem ) dofId) );
1287 el->mFirstNode->setCoordinates( el->mInteriorSegments[0].giveVertex(1) );
1309 double maxDist = 1.0e10;
1330 mpTracElNew.reserve(tracElNew0.size() + tracElNew1.size());
1343 const FloatArray &xS = el->mInteriorSegments[0].giveVertex(1);
1344 const double arcPosXS = arcPosFunc.
calcArcPos(xS);
1346 const FloatArray &xE = el->mInteriorSegments.back().giveVertex(2);
1347 const double arcPosXE = arcPosFunc.
calcArcPos(xE);
1349 while (i < allCoordUnsorted.size()) {
1353 const double arcPosX = arcPosFunc.
calcArcPos(x);
1355 if ( arcPosX > (arcPosXS+minPointDist) && arcPosX < (arcPosXE-minPointDist) ) {
1356 el->mInteriorSegmentsPointsFine.push_back(x);
1359 if ( arcPosX > arcPosXE ) {
1373 for (
Line &line : el->mInteriorSegments ) {
1376 const double arcPosXS = arcPosFunc.
calcArcPos(xS);
1380 const double arcPosXE = arcPosFunc.
calcArcPos(xE);
1382 if ( el->mInteriorSegmentsPointsFine.size() == 0 ) {
1383 Line newLine(xS, xE);
1384 el->mInteriorSegmentsFine.push_back(newLine);
1386 while ( i < el->mInteriorSegmentsPointsFine.size() ) {
1388 const FloatArray &x = el->mInteriorSegmentsPointsFine[i];
1389 const double arcPosX = arcPosFunc.
calcArcPos(x);
1391 if ( arcPosX < arcPosXS ) {
1392 OOFEM_ERROR(
"Error in PrescribedGradientBCWeak :: createTractionMesh.")
1395 if ( arcPosX < arcPosXE ) {
1397 Line newLine(xS, x);
1398 el->mInteriorSegmentsFine.push_back(newLine);
1403 Line newLine(xS, xE);
1404 el->mInteriorSegmentsFine.push_back(newLine);
1409 if ( i == (el->mInteriorSegmentsPointsFine.size()-1) ) {
1411 Line newLine(xS, xE);
1412 el->mInteriorSegmentsFine.push_back(newLine);
1423 el->setupIntegrationRuleOnEl();
1427 std :: vector< FloatArray > discPoints;
1430 discPoints.push_back( el->mInteriorSegments[0].giveVertex(1) );
1431 discPoints.push_back( el->mInteriorSegments.back().giveVertex(2) );
1441 std :: vector< TracSegArray * > newArray;
1445 for (
Line line : el->mInteriorSegments ) {
1448 newArray.push_back(newEl);
1454 ioElArray = std::move(newArray);
1461 double maxDamage = 0.0, damageTol = 0.01;
1464 el->
giveIPValue(damage, gp, IST_DamageScalar, tStep);
1466 maxDamage =
std::max(maxDamage, damage(0));
1471 return maxDamage >= damageTol;
1514 NdispMat.
resize(dim, dim * numNodes);
1530 const double distTol = 1.0e-12;
1532 if ( iPos [ 0 ] >
mUC [ 0 ] - distTol ) {
1536 if ( iPos [ 1 ] >
mUC [ 1 ] - distTol ) {
1547 oPosMinus = iPosPlus;
1548 const double distTol = 1.0e-12;
1555 bool mappingPerformed =
false;
1557 if ( iPosPlus [ 0 ] >
mUC [ 0 ] - distTol ) {
1558 oPosMinus [ 0 ] =
mLC [ 0 ];
1559 mappingPerformed =
true;
1563 if ( iPosPlus [ 1 ] >
mUC [ 1 ] - distTol ) {
1564 oPosMinus [ 1 ] =
mLC [ 1 ];
1565 mappingPerformed =
true;
1569 if ( !mappingPerformed ) {
1582 const double distTol = 1.0e-12;
1589 double l_s =
mUC[0] -
mLC[0];
1592 double alpha = 0.0, a = 0.0;
1593 if( fabs(t(0)) > 1.0e-6 && fabs(t(1)) > 1.0e-6 ) {
1594 alpha = atan(t(1)/t(0));
1596 if ( alpha > 45.0*
M_PI/180.0 ) {
1607 if ( alpha > 45.0*
M_PI/180.0 ) {
1611 if ( iPosPlus [ 0 ] >
mUC [ 0 ] - distTol ) {
1613 oPosMinus = {0.0, iPosPlus[1]};
1617 if ( iPosPlus [ 1 ] >
mUC [ 1 ] - distTol ) {
1620 if ( iPosPlus[0] < a ) {
1621 oPosMinus = {l_s - a + iPosPlus[0], 0.0};
1624 oPosMinus = {iPosPlus[0] - a, 0.0};
1634 if ( iPosPlus [ 0 ] >
mUC [ 0 ] - distTol ) {
1636 if ( iPosPlus[1] < a ) {
1637 oPosMinus = {0.0, l_s - a + iPosPlus[1]};
1640 oPosMinus = {0.0, iPosPlus[1] - a};
1646 if ( iPosPlus [ 1 ] >
mUC [ 1 ] - distTol ) {
1649 oPosMinus = {iPosPlus[0], 0.0};
1667 const double l_box =
mUC(0) -
mLC(0);
1669 oPosPlus = iPosMinus;
1671 const double distTol = l_box*1.0e-10;
1678 double mappingPerformed =
false;
1680 if ( iPosMinus [ 0 ] <
mLC [ 0 ] + distTol ) {
1681 oPosPlus [ 0 ] =
mUC [ 0 ];
1682 mappingPerformed =
true;
1686 if ( iPosMinus [ 1 ] <
mLC [ 1 ] + distTol ) {
1687 oPosPlus [ 1 ] =
mUC [ 1 ];
1688 mappingPerformed =
true;
1692 if ( !mappingPerformed ) {
1701 const double distTol = 1.0e-12;
1708 double l_s =
mUC[0] -
mLC[0];
1711 double alpha = 0.0, a = 0.0;
1712 if ( fabs(t(0)) > 1.0e-6 && fabs(t(1)) > 1.0e-6 ) {
1713 alpha = atan(t(1)/t(0));
1715 if ( alpha > 45.0*
M_PI/180.0 ) {
1728 if ( alpha > 45.0*
M_PI/180.0 ) {
1732 if ( iPosMinus [ 0 ] < mLC [ 0 ] + distTol ) {
1734 oPosPlus = {l_s, iPosMinus[1]};
1738 if ( iPosMinus [ 1 ] < mLC [ 1 ] + distTol ) {
1741 if ( iPosMinus[0] < l_s - a) {
1742 oPosPlus = {iPosMinus[0] + a, l_s};
1746 oPosPlus = {iPosMinus[0] - (l_s - a), l_s};
1755 if ( iPosMinus [ 0 ] < mLC [ 0 ] + distTol ) {
1758 if ( iPosMinus[1] < l_s - a ) {
1759 oPosPlus = {l_s, iPosMinus[1] + a};
1762 oPosPlus = {l_s, iPosMinus[1] - (l_s - a) };
1767 if ( iPosMinus [ 1 ] < mLC [ 1 ] + distTol ) {
1770 oPosPlus = {iPosMinus[0], l_s};
1791 for (
int i = 1; i <= numNodes; i++ ) {
1795 for (
int j = 0; j < nsd; j++ ) {
1796 if ( coord [ j ] < lc [ j ] ) {
1797 lc [ j ] = coord [ j ];
1800 if ( coord [ j ] > uc [ j ] ) {
1801 uc [ j ] = coord [ j ];
1806 oLC = std::move(lc);
1807 oUC = std::move(uc);
1812 const double distTol = 1.0e-12;
1814 if ( iPos [ 0 ] >
mUC [ 0 ] - distTol ) {
1818 if ( iPos [ 1 ] >
mUC [ 1 ] - distTol ) {
1822 if ( iPos [ 0 ] <
mLC [ 0 ] + distTol ) {
1826 if ( iPos [ 1 ] <
mLC [ 1 ] + distTol ) {
1845 std::unordered_map<int,int> map_bnd_node_ind_to_num_occurences;
1846 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
1848 int elIndex = boundaries.
at(pos * 2 - 1);
1850 int boundary = boundaries.
at(pos * 2);
1858 auto res = map_bnd_node_ind_to_num_occurences.find(startNodeInd);
1859 if ( res != map_bnd_node_ind_to_num_occurences.end() ) {
1860 map_bnd_node_ind_to_num_occurences[startNodeInd]++;
1862 map_bnd_node_ind_to_num_occurences[startNodeInd] = 1;
1865 res = map_bnd_node_ind_to_num_occurences.find(endNodeInd);
1866 if ( res != map_bnd_node_ind_to_num_occurences.end() ) {
1867 map_bnd_node_ind_to_num_occurences[endNodeInd]++;
1869 map_bnd_node_ind_to_num_occurences[endNodeInd] = 1;
1875 for (
auto it = map_bnd_node_ind_to_num_occurences.begin(); it != map_bnd_node_ind_to_num_occurences.end(); ++it ) {
1877 bool mandatory_to_keep =
false;
1878 if ( it->second == 1 ) {
1879 mandatory_to_keep =
true;
1890 if ( mandatory_to_keep ) {
1891 oHoleCoordUnsorted.push_back(xPlus);
1894 oAllCoordUnsorted.push_back(xPlus);
1906 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
1908 int boundary = boundaries.
at(pos * 2);
1928 std :: vector< Line >segments;
1929 std :: vector< FloatArray >intersecPoints;
1932 for (
auto x : intersecPoints ) {
1935 oHoleCoordUnsorted.push_back(x);
1939 oHoleCoordUnsorted.push_back( std::move(xPlus) );
1955 const double l_s =
mUC[0] -
mLC[0];
1962 if ( fabs(n(1)) <= fabs(n(0)) ) {
1964 double a = 0.5*l_s*( 1.0 + n(1)/n(0) );
1969 oHoleCoordUnsorted.push_back(std::move(p1Plus));
1972 double c = l_s - 0.5*l_s*( 1.0 + t(1)/t(0) );
1975 oHoleCoordUnsorted.
push_back(std::move(p1));
1980 oHoleCoordUnsorted.push_back(std::move(p2Plus));
1988 if ( ioCoords.size() == 0 ) {
1992 const double tol2 = iAbsTol*iAbsTol;
1994 std::vector<FloatArray> tmp;
1995 tmp.push_back(ioCoords[0]);
1998 for (
size_t i = 1; i < ioCoords.size(); i++ ) {
1999 if ( ioCoords[i].distance_square(tmp[j]) > tol2 ) {
2000 tmp.push_back(ioCoords[i]);
2005 ioCoords = std::move(tmp);
2014 std :: vector< Line > tmp;
2017 const double tol2 = iAbsTol*iAbsTol;
2022 FloatArray xPlus = {0.5*(xS[0]+xE[0]), 0.5*(xS[1]+xE[1])};
bool contains(int value) const
The base class for all spatial localizers.
void findCrackBndIntersecCoord(std::vector< FloatArray > &oHoleCoordUnsorted)
bool mMeshIsPeriodic
true -> the traction lives only on gammaPlus, so that we get strong periodicity as a special case...
The representation of EngngModel default unknown numbering.
bool damageExceedsTolerance(Element *el)
const FloatArray & giveVertex(int n) const
std::vector< Line > mInteriorSegments
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
Assembles sparse matrix from contribution of local elements.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
virtual int giveNumberOfInternalDofManagers()
Gives the number of internal dof managers.
void findHoleCoord(std::vector< FloatArray > &oHoleCoordUnsorted, std::vector< FloatArray > &oAllCoordUnsorted)
virtual void assembleVector(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=NULL)
Assembles B.C.
virtual void giveInputRecord(DynamicInputRecord &input)
void giveTractionElCoord(size_t iElInd, FloatArray &oStartCoord, FloatArray &oEndCoord) const
int giveGlobalNumber() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Base class for all matrices stored in sparse format.
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
const IntArray mRegularDispDofIDs
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
const IntArray & giveBoundaryList()
Returns list of element boundaries within set.
FloatArray mUC
Upper corner of domain (assuming a rectangular RVE)
Class for homogenization of applied gradients.
Provides Xfem interface for an element.
std::unique_ptr< IntegrationRule > mIntRule
const IntArray mDispLockDofIDs
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Function * giveTimeFunction()
void setupIntegrationRuleOnEl()
int mTractionNodeSpacing
Use every (mTractionNodeSpacing) displacement nodes when constructing the traction element mesh...
void clear()
Clears receiver (zero size).
#define _IFT_PrescribedGradientBCWeak_TractionInterpOrder
Solves a static structural problem.
virtual FloatArray * giveCoordinates()
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
void findPeriodicityCoord(std::vector< FloatArray > &oHoleCoordUnsorted)
Implementation for assembling tangent matrices in standard monolithic FE-problems.
int giveSideIndex(const FloatArray &iPos) const
void beVectorForm(const FloatMatrix &aMatrix)
Reciever will be a vector with 9 components formed from a 3x3 matrix.
DiscontinuousSegmentIntegrationRule provides integration over a discontinuous boundary segment...
virtual void assembleExtraDisplock(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
double giveTargetTime()
Returns target time.
Abstract base class for all finite elements.
void giveTraction(size_t iElInd, FloatArray &oStartTraction, FloatArray &oEndTraction, ValueModeType mode, TimeStep *tStep)
Node * mpDisplacementLock
Lock displacements in one node if periodic.
Base class for dof managers.
int giveNumber()
Returns domain number.
void recomputeTractionMesh()
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
PrescribedGradientBCWeak(int n, Domain *d)
virtual void giveInputRecord(DynamicInputRecord &input)
MaterialMode
Type representing material mode of integration point.
int mTractionInterpOrder
Order of interpolation for traction (0->piecewise constant, 1->piecewise linear)
bool pointIsOnGammaPlus(const FloatArray &iPos) const
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
XfemManager * giveXfemManager()
void sort(IntArray &arry, operation op)
Sorts the receiver using quicksort algorithm.
virtual int giveNumberOfDofManagers() const
virtual FEInterpolation * giveInterpolation() const
#define _IFT_PrescribedGradientBCWeak_NumTractionNodeSpacing
void computeIntForceGPContrib(FloatArray &oContrib_disp, IntArray &oDisp_loc_array, FloatArray &oContrib_trac, IntArray &oTrac_loc_array, TracSegArray &iEl, GaussPoint &iGP, int iDim, TimeStep *tStep, const FloatArray &iBndCoord, const double &iScaleFac, ValueModeType mode, CharType type, const UnknownNumberingScheme &s)
int mMirrorFunction
Mirror function (i.e.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
void giveTractionElNormal(size_t iElInd, FloatArray &oNormal, FloatArray &oTangent) const
virtual void computeField(FloatArray &sigma, TimeStep *tStep)
Computes the homogenized, macroscopic, field (stress).
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
Class representing "master" degree of freedom.
void giveTractionLocationArray(IntArray &rows, CharType type, const UnknownNumberingScheme &s)
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
void giveMirroredPointOnGammaMinus(FloatArray &oPosMinus, const FloatArray &iPosPlus) const
std::unique_ptr< SparseMtrx > stiffnessMatrix
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void giveUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *tStep, bool padding=false)
Assembles the vector of unknowns in global c.s for given dofs of receiver.
void giveBoundaries(IntArray &oBoundaries)
const IntArray & giveTracDofIDs() const
Element * giveElement(int n)
Service for accessing particular domain fe element.
void removeClosePoints(std::vector< FloatArray > &ioCoords, const double &iAbsTol)
void createTractionMesh(bool iEnforceCornerPeriodicity, int iNumSides)
void clear()
Clears the array (zero size).
DofIDItem
Type representing particular dof type.
const IntArray & giveDispLockDofIDs() const
virtual void giveTractionLocationArray(IntArray &rows, const UnknownNumberingScheme &s)
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
virtual Node * giveNodeClosestToPoint(const FloatArray &coords, double maxDist)=0
Returns the node closest to the given coordinate.
virtual double giveWeight()
Returns integration weight of receiver.
double calcArcPos(const FloatArray &iPos) const
void resizeWithData(int, int)
Checks size of receiver towards requested bounds.
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
void times(double f)
Multiplies receiver by factor f.
Set of elements, boundaries, edges and/or nodes.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
double mTangDistPadding
Parameter for creation of traction mesh.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
void computeExtForceElContrib(FloatArray &oContrib, TracSegArray &iEl, int iDim, TimeStep *tStep)
#define _IFT_PrescribedGradientBCWeak_TangDistPadding
void XfemElementInterface_createEnrNmatrixAt(FloatMatrix &oAnswer, const FloatArray &iLocCoord, Element &iEl, bool iSetDiscontContribToZero)
Creates enriched N-matrix.
virtual void giveLocationArrays(std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
Gives a list of location arrays that will be assembled.
Wrapper around element definition to provide FEICellGeometry interface.
Set * giveSet(int n)
Service for accessing particular domain set.
FloatArray mPeriodicityNormal
Periodicity direction.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
#define _IFT_PrescribedGradientBCWeak_DuplicateCornerNodes
Abstract base class for all active boundary conditions.
double calcArcPos(const FloatArray &iPos) const
static int giveVoigtVectorMask(IntArray &answer, MaterialMode mmode)
Returns a mask of the vector indicies corresponding to components in a general (non-symmetric) second...
void compute_x_times_N_1(FloatMatrix &o_x_times_N)
void resizeWithValues(int s, int allocChunk=0)
Checks size of receiver towards requested bounds.
std::vector< Line > mInteriorSegmentsFine
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
void resize(int n)
Checks size of receiver towards requested bounds.
int mNumTractionNodesAtIntersections
If traction nodes should be inserted where cracks intersect the RVE boundary.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatMatrix mGradient
Prescribed gradient .
void partitionEdgeSegment(int iBndIndex, std::vector< Line > &oSegments, std::vector< FloatArray > &oIntersectionPoints, const double &iTangDistPadding=0.0)
Partition a boundary segment to account for cracks cutting the boundary.
virtual void scale(double s)
Scales the receiver according to given value.
int giveDofManPlaceInArray(int iGlobalDofManNum) const
Returns the array index of the dofman with global number iGlobalDofManNum, so that it can be fetched ...
const FloatArray & giveGlobalCoordinates()
void appendDof(Dof *dof)
Adds the given Dof into the receiver.
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
void giveMirroredPointOnGammaPlus(FloatArray &oPosPlus, const FloatArray &iPosMinus) const
#define _IFT_PrescribedGradientBCWeak_TracDofScaling
virtual void boundaryGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
Class representing vector of real numbers.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
#define _IFT_PrescribedGradientBCWeak_MirrorFunction
void assembleTangentGPContributionNew(FloatMatrix &oTangent, TracSegArray &iEl, GaussPoint &iGP, const double &iScaleFactor, const FloatArray &iBndCoord)
virtual int giveSpatialDimension()
Returns the element spatial dimension (1, 2, or 3).
Implementation of matrix containing floating point numbers.
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
virtual DofManager * giveInternalDofManager(int i)
Gives an internal dof manager from receiver.
virtual void giveDisplacementLocationArray(IntArray &rows, const UnknownNumberingScheme &s)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)=0
Returns the element closest to a given point.
virtual void printYourself() const
Print receiver on stdout.
std::unique_ptr< Node > mFirstNode
virtual void postInitialize()
Performs post initialization steps.
void append(const FloatArray &a)
Appends array to reciever.
FloatArray mLC
Lower corner of domain (assuming a rectangular RVE)
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0)
Assembles B.C.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
virtual ~PrescribedGradientBCWeak()
void computeDomainBoundingBox(Domain &iDomain, FloatArray &oLC, FloatArray &oUC)
Class implementing single timer, providing wall clock and user time capabilities. ...
void compute_x_times_N_2(FloatMatrix &o_x_times_N)
void beDyadicProductOf(const FloatArray &vec1, const FloatArray &vec2)
Assigns to the receiver the dyadic product .
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void giveTractionElArcPos(size_t iElInd, double &oXiStart, double &oXiEnd) const
void removeSegOverHoles(TracSegArray &ioTSeg, const double &iAbsTol)
void times(double s)
Multiplies receiver with scalar.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
ClassFactory & classFactory
virtual void computeTangent(FloatMatrix &E, TimeStep *tStep)
Computes the macroscopic tangent for homogenization problems through sensitivity analysis.
#define _IFT_PrescribedGradientBCWeak_NumTractionNodesAtIntersections
void zero()
Zeroes all coefficient of receiver.
Domain * giveDomain() const
virtual void assembleGPContrib(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, TracSegArray &iEl, GaussPoint &iGP, double k)
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void push_back(const double &iVal)
Add one element.
void beUnitMatrix()
Sets receiver to unity matrix.
const IntArray & giveRegularDispDofIDs() const
#define _IFT_PrescribedGradientBCWeak_PeriodicityNormal
Abstract base class representing the "problem" under consideration.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
virtual bool boundaryPointIsOnActiveBoundary(const FloatArray &iPos) const =0
void splitSegments(std::vector< TracSegArray * > &ioElArray)
virtual void giveBoundaryCoordVector(FloatArray &oX, const FloatArray &iPos) const =0
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
const IntArray & giveEnrichedDofIDs() const
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.
double mSpringPenaltyStiffness
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
void negated()
Switches the sign of every coefficient of receiver.
double normalize()
Normalizes receiver.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
std::vector< TracSegArray * > mpTracElNew
Elements for the independent traction discretization.
int giveNumberOfRows() const
Returns number of rows of receiver.
void giveLocationArray(const IntArray &dofIDArry, IntArray &locationArray, const UnknownNumberingScheme &s) const
Returns location array (array containing for each requested dof related equation number) for given nu...
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
double getUtime()
Returns total user time elapsed in seconds.
Class representing integration point in finite element program.
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
bool mDuplicateCornerNodes
0 -> Do not duplicate corner traction nodes 1 -> Duplicate corner traction nodes