41 #include <lifev/core/array/MatrixEpetra.hpp> 42 #include <lifev/core/LifeV.hpp> 43 #include <lifev/core/fem/FESpace.hpp> 44 #include <lifev/core/fem/BCManageNormal.hpp> 67 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
70 VectorType& rightHandSide,
75 DataType
const& diagonalizeCoef,
76 DataType
const& time = 0 );
94 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
98 VectorType& rightHandSide,
103 const DataType diagonalizeCoef,
104 const DataType& time,
121 template <
typename MatrixType,
typename MeshType,
typename DataType>
124 const MeshType& mesh,
128 const DataType& diagonalizeCoef,
129 const DataType& time = 0 );
146 template <
typename VectorType,
typename MeshType,
typename DataType>
149 const MeshType& mesh,
153 const DataType& time,
154 const DataType& diagonalizeCoef );
168 template <
typename VectorType,
typename MeshType,
typename DataType>
171 const MeshType& mesh,
175 const DataType& diagonalizeCoef,
176 const DataType& time );
191 template <
typename VectorType,
typename DataType,
typename Mesh,
typename MapEpetra>
194 FESpace<Mesh, MapEpetra>& feSpace,
196 const DataType& time,
197 const DataType& diagonalizeCoef );
210 template <
typename VectorType,
typename DataType,
typename Mesh,
typename MapEpetra>
214 const VectorType& sol,
215 FESpace<Mesh, MapEpetra>& feSpace,
217 const DataType& time,
218 const DataType& diagonalizeCoef );
230 template <
typename VectorType,
typename DataType,
typename Mesh,
typename MapEpetra>
233 FESpace<Mesh, MapEpetra>& feSpace,
235 const DataType& diagonalizeCoef,
236 const DataType& time );
259 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
262 VectorType& rightHandSide,
265 const BCBase& boundaryCond,
267 const DataType& diagonalizeCoef,
268 const DataType& time,
287 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
290 VectorType& rightHandSide,
293 const BCBase& boundaryCond,
295 const DataType& diagonalizeCoef,
296 const DataType& time,
297 const VectorType& feVec ,
311 template <
typename MatrixType,
typename DataType>
315 const BCBase& boundaryCond,
316 const DataType& diagonalizeCoef,
332 template <
typename VectorType,
typename DataType>
336 const BCBase& boundaryCond,
337 const DataType& time,
338 const DataType& diagonalizeCoef,
350 template <
typename VectorType,
typename DataType>
354 const BCBase& boundaryCond,
355 const DataType& diagonalizeCoef,
356 const DataType& time,
370 template <
typename VectorType,
typename DataType>
375 const DataType& diagonalizeCoef,
376 const DataType& time);
392 template <
typename VectorType,
typename DataType>
396 const VectorType& sol,
398 const BCBase& boundaryCond,
399 const DataType& time,
400 const DataType& diagonalizeCoef,
412 template <
typename MatrixType,
typename DataType>
417 const DataType diagonalizeCoef);
437 template <
typename VectorType,
typename MeshType,
typename DataType>
440 const MeshType& mesh,
441 const DOF& dof,
const 444 const DataType& time,
462 template <
typename VectorType,
typename MeshType,
typename DataType>
465 VectorType& rightHandSide,
466 const MeshType& mesh,
468 const BCBase& boundaryCond,
470 const DataType& time,
471 const VectorType& feVec,
493 template <
typename MatrixType,
typename VectorType,
typename DataType,
typename MeshType>
496 VectorType& rightHandSide,
497 const MeshType& mesh,
499 const BCBase& boundaryCond,
501 const DataType& time,
516 template <
typename MatrixType,
typename DataType,
typename MeshType>
519 const MeshType& mesh,
521 const BCBase& boundaryCond,
523 const DataType& time,
543 template <
typename VectorType,
typename DataType,
typename MeshType>
546 VectorType& rightHandSide,
547 const VectorType& solution,
548 const MeshType& mesh,
550 const BCBase& boundaryCond,
552 const DataType& time,
571 template <
typename VectorType,
typename DataType,
typename MeshType>
574 VectorType& rightHandSide,
575 const VectorType& solution,
576 const MeshType& mesh,
578 const BCBase& boundaryCond,
580 const DataType& time,
595 template <
typename VectorType,
typename DataType,
typename MeshType>
598 const MeshType& mesh,
600 const BCBase& boundaryCond,
602 const DataType& time,
624 template <
typename MatrixType,
630 VectorType& rightHandSide,
631 const MeshType& mesh,
633 const BCBase& boundaryCond,
635 const DataType& time,
650 template <
typename VectorType,
typename DataType >
653 VectorType& rightHandSide,
654 const BCBase& boundaryCond,
655 const DataType& time,
670 template <
typename MatrixType,
675 const MeshType& mesh,
677 const BCBase& boundaryCond,
696 template <
typename VectorType,
701 VectorType& rightHandSide,
702 const VectorType& solution,
703 const MeshType& mesh,
705 const BCBase& boundaryCond,
727 template <
typename MatrixType,
typename VectorType,
typename DataType,
typename MeshType>
730 VectorType& rightHandSide,
731 const MeshType& mesh,
733 const BCBase& boundaryCond,
737 template <
typename VectorType,
typename DataType,
typename MeshType>
740 const MeshType& mesh,
742 const BCBase& boundaryCond,
746 template <
typename MatrixType,
typename DataType,
typename MeshType>
749 const MeshType& mesh,
751 const BCBase& boundaryCond,
767 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
770 VectorType& rightHandSide,
771 MeshType
const& mesh,
775 DataType
const& diagonalizeCoef,
776 DataType
const& time )
779 bool globalassemble =
false;
784 for (
ID i = 0; i < bcHandler
.size(); ++i )
792 bcManageNormal.init (bcHandler
[ i ], time);
796 globalassemble =
true;
799 bcNaturalManage ( rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
802 bcRobinManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
803 globalassemble =
true;
806 bcFluxManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() + bcHandler
[i].offset() );
807 globalassemble =
true;
810 bcResistanceManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
811 globalassemble =
true;
814 ERROR_MSG (
"This BC type is not yet implemented" );
820 matrix.globalAssemble();
824 bcManageNormal.build (mesh, dof, currentBdFE, matrix.map(), bcHandler
.offset() );
825 bcManageNormal.exportToParaview (
"normalAndTangents");
828 bcManageNormal.bcShiftToNormalTangentialCoordSystem (matrix, rightHandSide);
831 for (
ID i = 0; i < bcHandler
.size(); ++i )
838 bcEssentialManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, diagonalizeCoef, time, bcHandler
.offset() );
846 ERROR_MSG (
"This BC type is not yet implemented" );
851 bcManageNormal.bcShiftToCartesianCoordSystem (matrix, rightHandSide);
854 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
858 VectorType& rightHandSide,
859 const MeshType& mesh,
863 const DataType diagonalizeCoef,
864 const DataType& time,
868 bool globalassemble =
false;
870 for (
ID i = 0; i < bcHandler
.size(); ++i )
877 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
881 globalassemble =
true;
886 bcNaturalManageUDep (mu, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, feVec, bcHandler
.offset() );
891 bcNaturalManage ( rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
898 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
902 bcRobinManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
906 ERROR_MSG (
"This BC type is not yet implemented" );
913 matrix.GlobalAssemble();
918 for (
ID i = 0; i < bcHandler
.size(); ++i )
928 bcEssentialManageUDep (matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, diagonalizeCoef, time, feVec, bcHandler
.offset() );
932 bcEssentialManage ( matrix, rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, diagonalizeCoef, time, bcHandler
.offset() );
940 ERROR_MSG (
"This BC type is not yet implemented" );
945 template <
typename MatrixType,
typename MeshType,
typename DataType>
948 const MeshType& mesh,
952 const DataType& diagonalizeCoef,
953 const DataType& time )
956 bool globalassemble =
false;
958 for (
ID i = 0; i < bcHandler
.size(); ++i )
966 globalassemble =
true;
969 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
975 bcRobinManageMatrix ( matrix, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
976 globalassemble =
true;
979 bcFluxManageMatrix ( matrix, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() + bcHandler
[i].offset() );
980 globalassemble =
true;
983 bcResistanceManageMatrix ( matrix, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
984 globalassemble =
true;
987 ERROR_MSG (
"This BC type is not yet implemented" );
992 matrix.globalAssemble();
996 for (
ID i = 0; i < bcHandler
.size(); ++i )
1004 bcEssentialManageMatrix ( matrix, dof, bcHandler
[ i ], diagonalizeCoef, bcHandler
.offset() );
1016 ERROR_MSG (
"This BC type is not yet implemented" );
1021 template <
typename VectorType,
typename MeshType,
typename DataType>
1024 const MeshType& mesh,
1028 const DataType& time,
1029 const DataType& diagonalizeCoef )
1031 bcManageRhs ( rightHandSide,
1040 template <
typename VectorType,
typename MeshType,
typename DataType>
1043 const MeshType& mesh,
1047 const DataType& diagonalizeCoef,
1048 const DataType& time )
1052 for (
ID i = 0; i < bcHandler
.size(); ++i )
1062 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
1064 bcEssentialManageRhs ( rightHandSide, dof, bcHandler
[ i ], diagonalizeCoef, time, bcHandler
.offset() );
1067 bcNaturalManage ( rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1070 bcRobinManageVector ( rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1076 bcResistanceManageVector ( rightHandSide, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1079 ERROR_MSG (
"This BC type is not yet implemented" );
1086 template <
typename VectorType,
typename MeshType,
typename DataType>
1090 const VectorType& sol,
1091 const MeshType& mesh,
1095 const DataType& time,
1096 const DataType& diagonalizeCoef )
1098 VectorType rhsRepeated (rhs.map(),
Repeated);
1101 for (
ID i = 0; i < bcHandler
.size(); ++i )
1111 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
1113 bcEssentialManageResidual ( res, rhs, sol, dof, bcHandler
[ i ], time, diagonalizeCoef, bcHandler
.offset() );
1116 bcNaturalManage ( rhs, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1119 bcRobinManageResidual ( res, rhs, sol, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1122 bcResistanceManageResidual ( res, rhs, sol, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() );
1125 bcFluxManageResidual ( res, rhs, sol, mesh, dof, bcHandler
[ i ], currentBdFE, time, bcHandler
.offset() + bcHandler
[i].offset() );
1128 ERROR_MSG (
"This BC type is not yet implemented" );
1138 template <
typename VectorType,
typename DataType,
typename Mesh,
typename MapEpetra>
1141 FESpace<Mesh, MapEpetra>& feSpace,
1143 const DataType& time,
1144 const DataType& diagonalizeCoef )
1146 bcManageRhs ( rightHandSide,
1153 template <
typename VectorType,
typename DataType,
typename Mesh,
typename MapEpetra>
1156 FESpace<Mesh, MapEpetra>& feSpace,
1158 const DataType& diagonalizeCoef,
1159 const DataType& time )
1162 for (
ID i = 0; i < bcHandler
.size(); ++i )
1172 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
1174 bcEssentialManageRhs ( rightHandSide, feSpace.dof(), bcHandler
[ i ], diagonalizeCoef, time, bcHandler
.offset() );
1177 bcNaturalManage ( rightHandSide, *feSpace.mesh(), feSpace.dof(), bcHandler
[ i ], feSpace.feBd(), time, bcHandler
.offset() );
1180 bcRobinManageVector ( rightHandSide, *feSpace.mesh(), feSpace.dof(), bcHandler
[ i ], feSpace.feBd(), time, bcHandler
.offset() );
1186 ERROR_MSG (
"This BC type is not yet implemented" );
1196 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
1199 VectorType& rightHandSide,
1202 const BCBase& boundaryCond,
1204 const DataType& diagonalizeCoef,
1205 const DataType& time,
1218 std::vector<ID> idDofVec (0);
1219 std::vector<Real> datumVec (0);
1221 idDofVec.reserve (boundaryCond.list_size() *nComp);
1222 datumVec.reserve (boundaryCond.list_size() *nComp);
1235 for (
ID j = 0; j < nComp; ++j )
1239 datumVec.push_back (boundaryCond ( boundaryCond[ i ] ->id(), boundaryCond.component ( j ) ) );
1240 idDofVec.push_back (idDof);
1258 for (
ID j = 0; j < nComp; ++j )
1263 datumVec.push_back (boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) );
1264 idDofVec.push_back (idDof);
1274 idDofVec.push_back (offset + boundaryCond.offset() );
1275 datumVec.push_back ( 0. );
1279 matrix.diagonalize ( idDofVec, diagonalizeCoef, rightHandSide, datumVec);
1284 template <
typename MatrixType,
typename VectorType,
typename MeshType,
typename DataType>
1287 VectorType& rightHandSide,
1290 const BCBase& boundaryCond,
1292 const DataType& diagonalizeCoef,
1293 const DataType& time,
1294 const VectorType& feVec ,
1311 ERROR_MSG (
"This type of BCVector does not exists on bc depentent on solution" );
1317 std::vector<ID> idDofVec (0);
1318 std::vector<Real> datumVec (0);
1320 idDofVec.reserve (boundaryCond.list_size() *nComp);
1321 datumVec.reserve (boundaryCond.list_size() *nComp);
1333 for (
ID j = 0; j < nComp; ++j )
1338 Real datum = boundaryCond ( time, x, y, z, boundaryCond
.component ( j
) , feVec[idDof]);
1340 datumVec.push_back (datum);
1341 idDofVec.push_back (idDof);
1350 idDofVec.push_back (offset + boundaryCond.offset() );
1354 matrix.diagonalize ( idDofVec, diagonalizeCoef, rightHandSide, datumVec);
1359 template <
typename MatrixType,
typename DataType>
1363 const BCBase& boundaryCond,
1364 const DataType& diagonalizeCoef,
1376 std::vector<ID> idDofVec (0);
1377 idDofVec.reserve (boundaryCond.list_size() *nComp);
1383 for (
ID j = 0; j < nComp; ++j )
1387 idDofVec.push_back (idDof);
1395 idDofVec.push_back (offset + boundaryCond.offset() );
1399 matrix.diagonalize ( idDofVec, diagonalizeCoef, offset);
1403 template <
typename VectorType,
typename DataType>
1407 const BCBase& boundaryCond,
1408 const DataType& time,
1409 const DataType& diagonalizeCoef,
1412 bcEssentialManageRhs ( rightHandSide,
1421 template <
typename VectorType,
typename DataType>
1426 const DataType& diagonalizeCoef,
1427 const DataType& time)
1430 for (
ID i = 0; i < bcHandler
.size(); ++i )
1441 ERROR_MSG (
"This BC mode is not yet implemented for this setting" );
1443 bcEssentialManageRhs ( rightHandSide, dof, bcHandler
[ i ], diagonalizeCoef, time, bcHandler
.offset() );
1451 ERROR_MSG (
"This BC type is not yet implemented" );
1457 template <
typename VectorType,
typename DataType>
1461 const BCBase& boundaryCond,
1462 const DataType& diagonalizeCoef,
1463 const DataType& time,
1475 std::vector<
int> idDofVec (0);
1476 idDofVec.reserve (boundaryCond.list_size() *nComp);
1477 std::vector<Real> datumVec (0);
1478 datumVec.reserve (boundaryCond.list_size() *nComp);
1488 for (
ID j = 0; j < nComp; ++j )
1494 idDofVec.push_back ( idDof );
1495 datumVec.push_back ( diagonalizeCoef * boundaryCond ( boundaryCond[ i ] ->id(), boundaryCond.component ( j ) ) );
1513 for (
ID j = 0; j < nComp; ++j )
1519 idDofVec.push_back (idDof);
1520 datumVec.push_back ( diagonalizeCoef * boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) );
1525 rightHandSide.setCoefficients ( idDofVec, datumVec);
1529 template <
typename VectorType,
typename DataType>
1533 const VectorType& sol,
1535 const BCBase& boundaryCond,
1536 const DataType& time,
1537 const DataType& diagonalizeCoef,
1541 if (sol.mapType() ==
Unique)
1543 std::cout <<
"pass me a repeated solution" << std::endl;
1544 VectorType repeatedSolution (sol,
Repeated);
1545 bcEssentialManageResidual ( res,
1565 std::vector<
int> idDofVec (0);
1566 idDofVec.reserve (boundaryCond.list_size() *nComp);
1567 std::vector<Real> datumVec (0);
1568 datumVec.reserve (boundaryCond.list_size() *nComp);
1569 std::vector<Real> rhsVec (0);
1570 rhsVec.reserve (boundaryCond.list_size() *nComp);
1579 for (
ID j = 0; j < nComp; ++j )
1583 idDofVec.push_back ( idDof );
1584 datumVec.push_back ( diagonalizeCoef * sol (idDof) );
1585 rhsVec.push_back (diagonalizeCoef * boundaryCond ( boundaryCond[ i ] ->id(), boundaryCond.component ( j ) ) );
1602 for (
ID j = 0; j < nComp; ++j )
1608 idDofVec.push_back (idDof);
1609 datumVec.push_back ( diagonalizeCoef * sol (idDof) );
1610 rhsVec.push_back (diagonalizeCoef * boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) );
1615 res.setCoefficients ( idDofVec, datumVec);
1616 rhs.setCoefficients ( idDofVec, rhsVec);
1623 template <
typename VectorType,
typename MeshType,
typename DataType>
1626 const MeshType& mesh,
1627 const DOF& dof,
const 1630 const DataType& time,
1635 UInt nDofF = currentBdFE.nbFEDof();
1644 ID ibF, idDof, icDof, gDof;
1654 VectorType bUnique (rightHandSide.map(),
Unique);
1656 std::vector<
int> idDofVec (0);
1657 idDofVec.reserve (boundaryCond.list_size() *nComp);
1658 std::vector<Real> datumVec (0);
1659 datumVec.reserve (boundaryCond.list_size() *nComp);
1666 for (
ID j = 0; j < nComp; ++j )
1671 idDof = id + boundaryCond
.component ( j
) * totalDof + offset;
1673 idDofVec.push_back ( idDof);
1676 datumVec.push_back ( boundaryCond ( id , boundaryCond.component ( j ) ) );
1680 bUnique.setCoefficients (idDofVec, datumVec);
1681 bUnique.globalAssemble (Insert);
1683 ASSERT ( rightHandSide.mapType() == Unique ,
"rightHandSide must have unique map, otherwise data will be multiply added on cpu interfaces." );
1684 rightHandSide += bUnique;
1691 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
1706 for (
ID l = 0; l < nDofF; ++l )
1712 for (
UInt ic = 0; ic < nComp; ++ic )
1714 icDof = gDof + ic * totalDof + offset;
1717 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
1721 for ( ID m = 0; m < nDofF; ++m )
1723 sum += boundaryCond ( pId->boundaryLocalToGlobalMap ( m ) , 0 ) * currentBdFE.phi ( m, iq );
1726 rhsRepeated[ icDof ] += sum * currentBdFE.phi ( l, iq ) * currentBdFE.normal ( ic, iq )
1727 * currentBdFE.wRootDetMetric ( iq );
1733 rhsRepeated.globalAssemble();
1734 ASSERT ( rightHandSide.mapType() == Unique ,
"here rightHandSide should passed as repeated, otherwise not sure of what happens at the cpu interfaces ." );
1735 rightHandSide += rhsRepeated;
1740 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
1755 for (
ID idofF = 0; idofF < nDofF; ++idofF )
1761 for (
ID ic = 0; ic < nComp; ++ic )
1764 icDof = gDof + boundaryCond
.component ( ic
) * totalDof + offset;
1767 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
1771 for ( ID m = 0; m < nDofF; ++m )
1773 sum += boundaryCond ( pId->boundaryLocalToGlobalMap ( m ) , boundaryCond.component ( ic ) ) * currentBdFE.phi ( m, iq );
1777 rhsRepeated[ icDof ] += sum * currentBdFE.phi ( idofF, iq ) *
1778 currentBdFE.wRootDetMetric ( iq );
1783 rhsRepeated.globalAssemble();
1784 ASSERT ( rightHandSide.mapType() == Unique ,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
1785 rightHandSide += rhsRepeated;
1789 ERROR_MSG (
"This type of BCVector does not exist" );
1798 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
1810 for (
ID idofF = 0; idofF < nDofF; ++idofF )
1812 for (
ID j = 0; j < nComp; ++j )
1817 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
1820 x = currentBdFE.quadPt (iq, 0);
1821 y = currentBdFE.quadPt (iq, 1);
1822 z = currentBdFE.quadPt (iq, 2);
1824 switch (boundaryCond.mode() )
1827 rhsRepeated[ idDof ] += currentBdFE.phi ( idofF, iq ) * boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) *
1828 currentBdFE.wRootDetMetric ( iq );
1831 rhsRepeated[ idDof ] += currentBdFE.phi ( idofF, iq ) * boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) *
1832 currentBdFE.wRootDetMetric ( iq );
1835 rhsRepeated[ idDof ] += boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) *
1836 currentBdFE.phi ( idofF, iq ) *
1837 currentBdFE.wRootDetMetric ( iq ) * currentBdFE.normal ( j, iq );
1840 ERROR_MSG (
"This BC mode is not (yet) implemented" );
1847 rhsRepeated.globalAssemble();
1848 ASSERT ( rightHandSide.mapType() == Unique ,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
1849 rightHandSide += rhsRepeated;
1853 template <
typename VectorType,
typename MeshType,
typename DataType>
1856 VectorType& rightHandSide,
1857 const MeshType& mesh,
1859 const BCBase& boundaryCond,
1861 const DataType& time,
1862 const VectorType& feVec,
1867 UInt nDofF = currentBdFE.nbFEDof();
1881 ERROR_MSG (
"This type of BCVector does not exists on bc depentent on solution\n" );
1888 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
1892 ERROR_MSG (
"For now bcNaturalManageUDep cannot handle non scalar solutions\n");
1908 std::vector<Real> locU (nDofF);
1910 for (
ID idofLocU = 0; idofLocU < nDofF; idofLocU++)
1913 locU[idofLocU] = feVec[idGDofU];
1918 for (
ID idofF = 0; idofF < nDofF; ++idofF )
1921 for (
ID j = 0; j < nComp; ++j )
1928 for (UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
1931 x = currentBdFE.quadPt (l, 0);
1932 y = currentBdFE.quadPt (l, 1);
1933 z = currentBdFE.quadPt (l, 2);
1936 for (ID idofLocU = 0; idofLocU < nDofF; idofLocU++)
1938 uPt += locU[idofLocU] * currentBdFE.phi ( idofLocU , l );
1942 rhsRepeated[ idDof ] += currentBdFE.phi ( idofF, l ) * boundaryCond ( time, x, y, z, boundaryCond.component ( j ), uPt ) *
1943 mu (time, x, y, z, uPt) * currentBdFE.wRootDetMetric ( l );
1949 rhsRepeated.globalAssemble();
1950 ASSERT ( rightHandSide.mapType() == Unique ,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
1951 rightHandSide += rhsRepeated;
1959 template <
typename MatrixType,
typename VectorType,
typename DataType,
typename MeshType>
1962 VectorType& rightHandSide,
1963 const MeshType& mesh,
1965 const BCBase& boundaryCond,
1967 const DataType& time,
1970 bcRobinManageMatrix ( matrix, mesh, dof, boundaryCond, currentBdFE, time, offset );
1971 bcRobinManageVector ( rightHandSide, mesh, dof, boundaryCond, currentBdFE, time, offset );
1975 template <
typename MatrixType,
typename DataType,
typename MeshType>
1978 const MeshType& mesh,
1980 const BCBase& boundaryCond,
1982 const DataType& time,
1986 if ( matrix.matrixPtr()->Filled() )
1988 matrix.openCrsMatrix();
1992 UInt nDofF = currentBdFE.nbFEDof();
2003 ID ibF, idDof, jdDof, kdDof;
2026 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2029 for (
ID j = 0; j < nComp; ++j )
2038 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2041 for ( UInt n = 0; n < nDofF; ++n )
2043 kdDof = pId->boundaryLocalToGlobalMap ( n );
2044 if (boundaryCond.isRobinCoeffAVector() )
2046 mcoef += boundaryCond.robinCoeffVector ( kdDof, boundaryCond.component ( j ) ) * currentBdFE.phi ( n, l );
2050 mcoef += boundaryCond.robinCoeff() * currentBdFE.phi ( n, l );
2055 sum += mcoef * currentBdFE.phi ( idofF, l ) * currentBdFE.phi ( idofF, l ) * currentBdFE.wRootDetMetric ( l );
2059 matrix.addToCoefficient ( idDof, idDof, sum );
2063 for (
ID k = idofF + 1 ; k < nDofF ; ++k )
2067 for (
ID j = 0; j < nComp; ++j )
2073 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2076 for ( UInt n = 0; n < nDofF; ++n)
2078 kdDof = pId->boundaryLocalToGlobalMap ( n );
2079 if (boundaryCond.isRobinCoeffAVector() )
2081 mcoef += boundaryCond.robinCoeffVector ( kdDof, boundaryCond.component ( j ) ) * currentBdFE.phi ( n, l );
2086 mcoef += boundaryCond.robinCoeff() * currentBdFE.phi ( n, l );
2091 sum += mcoef * currentBdFE.phi ( idofF, l ) * currentBdFE.phi ( k, l ) *
2092 currentBdFE.wRootDetMetric ( l );
2100 matrix.addToCoefficient ( idDof, jdDof, sum );
2101 matrix.addToCoefficient ( jdDof, idDof, sum );
2130 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2133 for (
ID j = 0; j < nComp; ++j )
2141 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2144 x = currentBdFE.quadPt (l, 0);
2145 y = currentBdFE.quadPt (l, 1);
2146 z = currentBdFE.quadPt (l, 2);
2149 sum += pBcF->coef ( time, x, y, z, boundaryCond.component (j) ) * currentBdFE.phi ( idofF, l ) * currentBdFE.phi ( idofF, l ) *
2150 currentBdFE.wRootDetMetric ( l );
2155 matrix.addToCoefficient ( idDof, idDof, sum );
2159 for (
ID k = idofF + 1 ; k < nDofF ; ++k )
2163 for (
ID j = 0; j < nComp; ++j )
2168 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2172 x = currentBdFE.quadPt (l, 0);
2173 y = currentBdFE.quadPt (l, 1);
2174 z = currentBdFE.quadPt (l, 2);
2177 sum += pBcF->coef ( time, x, y, z, boundaryCond.component ( j ) ) * currentBdFE.phi ( idofF, l ) * currentBdFE.phi ( k, l ) *
2178 currentBdFE.wRootDetMetric ( l );
2186 matrix.addToCoefficient ( idDof, jdDof, sum );
2187 matrix.addToCoefficient ( jdDof, idDof, sum );
2195 template <
typename VectorType,
typename DataType,
typename MeshType>
2198 const MeshType& mesh,
2200 const BCBase& boundaryCond,
2202 const DataType& time,
2207 UInt nDofF = currentBdFE.nbFEDof();
2216 ID ibF, idDof, kdDof;
2222 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
2241 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2244 for (
ID j = 0; j < nComp; ++j )
2250 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2253 for ( UInt n = 0; n < nDofF; ++n )
2255 kdDof = pId->boundaryLocalToGlobalMap ( n );
2257 if ( boundaryCond.isBetaCoeffAVector() )
2258 mbcb += boundaryCond.betaCoeffVector ( kdDof, boundaryCond.component ( j ) )
2259 * boundaryCond ( kdDof, boundaryCond.component ( j ) ) * currentBdFE.phi ( n, l );
2262 mbcb += boundaryCond.betaCoeff() * boundaryCond ( kdDof, boundaryCond.component ( j ) ) * currentBdFE.phi ( n, l );
2267 rhsRepeated[ idDof ] += currentBdFE.phi ( idofF, l ) * mbcb * currentBdFE.wRootDetMetric ( l );
2272 rhsRepeated.globalAssemble();
2273 ASSERT ( rightHandSide.mapType() == Unique,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
2274 rightHandSide += rhsRepeated;
2281 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
2299 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2302 for (
ID j = 0; j < nComp; ++j )
2309 for ( UInt l = 0; l < currentBdFE.nbQuadPt(); ++l )
2312 x = currentBdFE.quadPt (l, 0);
2313 y = currentBdFE.quadPt (l, 1);
2314 z = currentBdFE.quadPt (l, 2);
2317 rhsRepeated[ idDof ] += currentBdFE.phi ( idofF, l ) * boundaryCond ( time, x, y, z, boundaryCond.component ( j ) ) *
2318 currentBdFE.wRootDetMetric ( l );
2323 rhsRepeated.globalAssemble();
2324 ASSERT ( rightHandSide.mapType() == Unique,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
2325 rightHandSide += rhsRepeated;
2332 template <
typename VectorType,
typename DataType,
typename MeshType>
2334 VectorType& rightHandSide,
2335 const VectorType& solution,
2336 const MeshType& mesh,
2338 const BCBase& boundaryCond,
2340 const DataType& time,
2344 if (solution.mapType() ==
Repeated)
2346 std::cout <<
"pass me a non-repeated solution" << std::endl;
2347 VectorType uniqueSolution (solution, Unique, Zero);
2348 bcRobinManageResidual ( residual,
2361 bcRobinManage ( matrix, rightHandSide, mesh, dof, boundaryCond, currentBdFE, time, offset );
2362 matrix.globalAssemble();
2363 residual += matrix * solution;
2367 template <
typename VectorType,
typename DataType,
typename MeshType>
2369 VectorType& rightHandSide,
2370 const VectorType& solution,
2371 const MeshType& mesh,
2373 const BCBase& boundaryCond,
2375 const DataType& time,
2379 if (solution.mapType() ==
Repeated)
2381 std::cout <<
"pass me a non-repeated solution" << std::endl;
2382 VectorType uniqueSolution (solution, Unique, Zero);
2383 bcResistanceManageResidual ( residual,
2396 bcResistanceManage ( matrix, rightHandSide, mesh, dof, boundaryCond, currentBdFE, time, offset );
2397 matrix.globalAssemble();
2398 residual += matrix * solution;
2411 template <
typename MatrixType,
2412 typename VectorType,
2417 VectorType& rightHandSide,
2418 const MeshType& mesh,
2420 const BCBase& boundaryCond,
2422 const DataType& time,
2426 bcFluxManageVector (rightHandSide, boundaryCond, time, offset);
2427 bcFluxManageMatrix (matrix, mesh, dof, boundaryCond, currentBdFE, time, offset);
2431 template <
typename VectorType,
2435 VectorType& rightHandSide,
2436 const BCBase& boundaryCond,
2437 const DataType& time,
2441 rightHandSide.setCoefficient (offset, boundaryCond (time, 0., 0., 0., 0) );
2445 template <
typename MatrixType,
2450 const MeshType& mesh,
2452 const BCBase& boundaryCond,
2457 if ( matrix.matrixPtr()->Filled() )
2459 matrix.openCrsMatrix();
2463 UInt nDofF = currentBdFE.nbFEDof();
2474 ID ibF, idDof, jdDof;
2487 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2489 for (
UInt ic = 0; ic < nComp; ++ic)
2494 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
2496 sum += currentBdFE.phi ( idofF, iq ) *
2497 currentBdFE.normal (ic , iq) *
2498 currentBdFE.wRootDetMetric (iq);
2503 matrix.addToCoefficient ( idDof , jdDof , sum );
2504 matrix.addToCoefficient ( jdDof , idDof , sum );
2511 template <
typename VectorType,
2516 VectorType& rightHandSide,
2517 const VectorType& solution,
2518 const MeshType& mesh,
2520 const BCBase& boundaryCond,
2522 const DataType& time,
2525 if (solution.mapType() ==
Repeated)
2527 std::cout <<
"pass me a non-repeated solution" << std::endl;
2528 VectorType uniqueSolution (solution, Unique, Zero);
2529 bcFluxManageResidual ( residual,
2541 bcFluxManage (matrix, rightHandSide, mesh, dof, boundaryCond, currentBdFE, time, offset );
2542 matrix.globalAssemble();
2543 residual += matrix * solution;
2548 template <
typename MatrixType,
typename VectorType,
typename DataType,
typename MeshType>
2551 VectorType& rightHandSide,
2552 const MeshType& mesh,
2554 const BCBase& boundaryCond,
2556 const DataType& time,
2559 bcResistanceManageMatrix ( matrix, mesh, dof, boundaryCond, currentBdFE, time, offset );
2560 bcResistanceManageVector ( rightHandSide, mesh, dof, boundaryCond, currentBdFE, time, offset );
2563 template <
typename VectorType,
typename DataType,
typename MeshType>
2566 const MeshType& mesh,
2568 const BCBase& boundaryCond,
2574 UInt nDofF = currentBdFE.nbFEDof();
2582 std::set<ID> resistanceDofs;
2585 ID ibF, idDof, kdDof;
2589 VectorType rhsRepeated (rightHandSide.map(),
Repeated);
2605 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2607 resistanceDofs.insert ( pId->boundaryLocalToGlobalMap ( idofF ) );
2610 for (
ID j = 0; j < nComp; ++j )
2615 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
2620 for ( ID n = 0; n < nDofF; ++n)
2622 kdDof = pId->boundaryLocalToGlobalMap ( n );
2623 mbcb += boundaryCond ( kdDof, boundaryCond.component ( j ) ) * currentBdFE.phi ( n, iq ) ;
2626 rhsRepeated[ idDof ] += mbcb * currentBdFE.phi ( idofF, iq ) * currentBdFE.normal ( j , iq ) *
2627 currentBdFE.wRootDetMetric ( iq );
2633 rhsRepeated.globalAssemble();
2634 ASSERT ( rightHandSide.mapType() == Unique,
"here rightHandSide should passed as unique, otherwise not sure of what happens at the cpu interfaces ." );
2635 rightHandSide += rhsRepeated;
2639 ERROR_MSG (
"This BC type is not yet implemented" );
2643 template <
typename MatrixType,
typename DataType,
typename MeshType>
2646 const MeshType& mesh,
2648 const BCBase& boundaryCond,
2654 if ( matrix.matrixPtr()->Filled() )
2656 matrix.openCrsMatrix();
2660 UInt nDofF = currentBdFE.nbFEDof();
2668 std::set<ID> resistanceDofs;
2671 ID ibF, idDof, jdDof;
2691 for (
ID idofF = 0; idofF < nDofF; ++idofF )
2693 resistanceDofs.insert ( pId->boundaryLocalToGlobalMap ( idofF ) );
2696 for (
ID j = 0; j < nComp; ++j )
2703 for ( UInt iq = 0; iq < currentBdFE.nbQuadPt(); ++iq )
2705 vv[idDof] += currentBdFE.phi ( idofF, iq ) * currentBdFE.normal ( j , iq ) * currentBdFE.wRootDetMetric ( iq );
2720 Int numMyResistanceDofs ( resistanceDofs.size() );
2723 Int numGlobalResistanceDofs (0);
2724 vv.map().comm().SumAll (&numMyResistanceDofs, &numGlobalResistanceDofs, 1);
2728 std::vector<Int> myResistanceDofs ( numGlobalResistanceDofs, -1 );
2731 std::vector<Int> globalResistanceDofs ( numGlobalResistanceDofs * vv.map().comm().NumProc(), 0 );
2735 for ( std::set<ID>::iterator iDofIt = resistanceDofs.begin();
2736 iDofIt != resistanceDofs.end(); ++iDofIt, ++iCount )
2738 myResistanceDofs[iCount] = *iDofIt;
2742 vv.map().comm().GatherAll (&myResistanceDofs[0], &globalResistanceDofs[0], numGlobalResistanceDofs);
2745 std::set<ID> globalResistanceDofSet;
2746 for ( Int iDof = 0; iDof < numGlobalResistanceDofs * vv.map().comm().NumProc(); ++iDof )
2748 if ( globalResistanceDofs[iDof] > -1 )
2750 globalResistanceDofSet.insert ( globalResistanceDofs[iDof] );
2757 if ( ! vv.map().comm().MyPID() )
2759 for ( std::set<ID>::iterator iDofIt = globalResistanceDofSet.begin();
2760 iDofIt != globalResistanceDofSet.end(); ++iDofIt )
2762 for ( UInt iComp = 0; iComp < nComp; ++iComp )
2764 idDof = *iDofIt + boundaryCond.component ( iComp ) * totalDof + offset;
2765 for ( std::set<ID>::iterator jDofIt = globalResistanceDofSet.begin();
2766 jDofIt != globalResistanceDofSet.end(); ++jDofIt )
2768 for ( UInt jComp = 0; jComp < nComp; ++jComp )
2770 jdDof = *jDofIt + boundaryCond.component ( jComp ) * totalDof + offset;
2772 matrix.addToCoefficient ( idDof, jdDof, boundaryCond.resistanceCoeff() *
2773 vvReduced[idDof] * vvReduced[jdDof] );
2782 ERROR_MSG (
"This BC type is not yet implemented" );
void bcEssentialManageUDep(MatrixType &matrix, VectorType &rightHandSide, const MeshType &, const DOF &dof, const BCBase &boundaryCond, const CurrentFEManifold &, const DataType &diagonalizeCoef, const DataType &time, const VectorType &feVec, UInt offset=0)
Prescribe Essential boundary conditions. Case in which the user defined function depends on the FE ve...
const flag_Type UPDATE_NORMALS(UPDATE_ONLY_NORMALS|UPDATE_ONLY_TANGENTS|UPDATE_ONLY_CELL_NODES)
VectorEpetra - The Epetra Vector format Wrapper.
const BCBase & operator[](const ID &) const
Extract a BC in the list, const.
void bcRobinManageVector(VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Robin boundary condition only on the rightHandSide.
bcType_Type type() const
Returns the boundary condition type.
void bcFluxManage(MatrixType &matrix, VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Flux boundary condition only on the matrix.
void bcManageVector(VectorType &rightHandSide, FESpace< Mesh, MapEpetra > &feSpace, const BCHandler &bcHandler, const DataType &time, const DataType &diagonalizeCoef)
Prescribe boundary conditions. Case in which only the right hand side is modified.
void bcRobinManageResidual(VectorType &residual, VectorType &rightHandSide, const VectorType &solution, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Robin boundary conditions. Case in which only the residual is available.
const Real & y() const
Recovering the node's y-coordinate.
void bcResistanceManageMatrix(MatrixType &matrix, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &, UInt offset)
const Real & z() const
Recovering the node's z-coordinate.
A class for a finite element on a manifold.
void importFromHDF5(std::string const &fileName, std::string const &matrixName="matrix")
Read a matrix from a HDF5 (.h5) file.
void bcManage(Real(*mu)(Real time, Real x, Real y, Real z, Real u), MatrixType &matrix, VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCHandler &bcHandler, CurrentFEManifold ¤tBdFE, const DataType diagonalizeCoef, const DataType &time, VectorType &feVec)
Prescribe boundary conditions. Case in which the user defined function depends on the FE vector feVec...
void bcEssentialManage(MatrixType &matrix, VectorType &rightHandSide, const MeshType &, const DOF &dof, const BCBase &boundaryCond, const CurrentFEManifold &, const DataType &diagonalizeCoef, const DataType &time, UInt offset)
Prescribe Essential boundary conditions. Case in which the user defined function depends on the FE ve...
void bcEssentialManageMatrix(MatrixType &matrix, const DOF &dof, const BCBase &boundaryCond, const DataType &diagonalizeCoef, UInt offset)
Prescribe Essential boundary conditions diagonalizing the matrix.
void bcManageMatrix(MatrixType &matrix, const MeshType &mesh, const DOF &dof, const BCHandler &bcHandler, CurrentFEManifold ¤tBdFE, const DataType &diagonalizeCoef, const DataType &time=0)
Prescribe boundary conditions. Case in which only the matrix is modified.
void bcEssentialManageRhs(VectorType &rightHandSide, const DOF &dof, const BCHandler &bcHandler, const DataType &diagonalizeCoef, const DataType &time)
Prescribe all the Essential boundary conditions on the right hand side and forgetting about the other...
BCHandler - class for handling boundary conditions.
const vector_Type & rhsVector() const
Return the underlying data structure for the RHS vector.
int32_type Int
Generic integer data.
void bcRobinManage(MatrixType &matrix, VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Robin boundary condition.
void bcManageResidual(VectorType &res, VectorType &rhs, const VectorType &sol, const MeshType &mesh, const DOF &dof, const BCHandler &bcHandler, CurrentFEManifold ¤tBdFE, const DataType &time, const DataType &diagonalizeCoef)
bool isDataAVector() const
Returns True if a FE BCVector has been provided to the class, False otherwise.
VectorEpetra(const MapEpetra &map, const MapEpetraType &mapType=Unique, const combineMode_Type combineMode=Add)
Constructor - Using Maps.
void bcNaturalManage(VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Natural boundary condition.
void updateInverseJacobian(const UInt &iQuadPt)
BCFunctionRobin - class that holds the function used for prescribing Robin boundary conditions...
BCManageNormal - class for handling normal essential boundary conditions.
void bcFluxManageVector(VectorType &rightHandSide, const BCBase &boundaryCond, const DataType &time, UInt offset)
Prescribe Flux boundary condition only on the right hand side.
void bcEssentialManageVector(VectorType &rightHandSide, const DOF &dof, const BCBase &boundaryCond, const DataType &time, const DataType &diagonalizeCoef, UInt offset)
Prescribe Essential boundary conditions on the right hand side.
Int globalAssemble()
Assemble the vector.
UInt numberOfComponents() const
Returns the number of components involved in this boundary condition.
void bcResistanceManage(MatrixType &matrix, VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &, UInt offset)
Prescribe Resistance boundary condition.
bcMode_Type mode() const
Returns the boundary condition mode.
void bcRobinManageMatrix(MatrixType &matrix, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Prescribe Robin boundary condition only on the matrix.
const int & offset() const
Returns the offset associated to this boundary condition.
const MapEpetra & map() const
Return the MapEpetra of the vector.
void bcManageMtimeUDep(MatrixType &matrix, const DOF &dof, const BCHandler &bcHandler, const DataType diagonalizeCoef)
! Prescribe Essential boundary conditions.
BCVectorInterface - class that holds the FE vectors used for prescribing boundary conditions on Inter...
void bcManageRhs(VectorType &rightHandSide, FESpace< Mesh, MapEpetra > &feSpace, const BCHandler &bcHandler, const DataType &diagonalizeCoef, const DataType &time)
Prescribe boundary conditions. Case in which only the right hand side is modified.
void bcManageVector(VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCHandler &bcHandler, CurrentFEManifold ¤tBdFE, const DataType &time, const DataType &diagonalizeCoef)
Prescribe boundary conditions. Case in which only the right hand side is modified.
void bcResistanceManageVector(VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &, UInt offset)
const UInt & numTotalDof() const
The total number of Dof.
bool isUDep() const
Returns True if the BCBase is based on a BCFunctionUDepBase function, False otherwise.
ID boundaryLocalToGlobalMap(const ID &i) const
Return the global DOF corresponding tho the i-th local DOF in the face.
void bcManage(MatrixType &matrix, VectorType &rightHandSide, MeshType const &mesh, DOF const &dof, BCHandler const &bcHandler, CurrentFEManifold ¤tBdFE, DataType const &diagonalizeCoef, DataType const &time=0)
Prescribe boundary conditions.
double Real
Generic real data.
void bcResistanceManageResidual(VectorType &residual, VectorType &rightHandSide, const VectorType &solution, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, UInt offset)
Paolo Tricerri/////////////////////.
VectorEpetra(const VectorEpetra &vector, const Int &reduceToProc)
Copy constructor.
const flag_Type UPDATE_W_ROOT_DET_METRIC(UPDATE_ONLY_W_ROOT_DET_METRIC|UPDATE_METRIC|UPDATE_ONLY_DET_METRIC)
const BCIdentifierBase * operator[](const ID &i) const
Returns a pointer to the (i)-th element of the list of identifiers.
const ID & id() const
Returns the ID of the BCIdentifier.
const flag_Type UPDATE_QUAD_NODES(UPDATE_ONLY_CELL_NODES|UPDATE_ONLY_QUAD_NODES)
BCIdentifierEssential - BCIdentifier for implementing Essential Boundary Conditions.
const Real & x() const
Recovering the node's x-coordinate.
UInt type() const
Return the type of conditions (see BCVector class description)
#define LIFEV_DEPRECATED(func)
void bcManageRhs(VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCHandler &bcHandler, CurrentFEManifold ¤tBdFE, const DataType &diagonalizeCoef, const DataType &time)
Prescribe boundary conditions. Case in which only the right hand side is modified.
ID component(const ID i) const
Returns the index of the component of the solution associated to the iComponent-th component prescrib...
VectorEpetra & operator*=(const data_type &scalar)
Multiplication operator.
void bcEssentialManageResidual(VectorType &res, VectorType &rhs, const VectorType &sol, const DOF &dof, const BCBase &boundaryCond, const DataType &time, const DataType &diagonalizeCoef, UInt offset)
Prescribe essential boundary conditions. Case in which only the residual is available.
const BCFunctionBase * pointerToFunctor() const
Returns a pointer to the BCFunctionBase object.
void bcNaturalManageUDep(Real(*mu)(Real time, Real x, Real y, Real z, Real u), VectorType &rightHandSide, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &time, const VectorType &feVec, UInt offset)
Prescribe Natural boundary condition. Case in which the user defined function depends on the FE vecto...
BCIdentifierNatural - Idenifier for Natural and Robin Boundary Condiions.
UInt size() const
Number of the stored boundary conditions.
void bcFluxManageResidual(VectorType &residual, VectorType &rightHandSide, const VectorType &solution, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &, UInt offset)
Prescribe Flux boundary conditions. Case in which only the residual is available. ...
UInt list_size() const
Returns the size of the identifiers list.
std::vector< std::shared_ptr< BCIdentifierBase > > M_idVector
container for id's when the list is finalized
void bcManageResidual(VectorType &res, VectorType &rhs, const VectorType &sol, FESpace< Mesh, MapEpetra > &feSpace, const BCHandler &bcHandler, const DataType &time, const DataType &diagonalizeCoef)
Prescribe boundary conditions. Case in which only the residual is available.
void bcFluxManageMatrix(MatrixType &matrix, const MeshType &mesh, const DOF &dof, const BCBase &boundaryCond, CurrentFEManifold ¤tBdFE, const DataType &, UInt offset)
Prescribe Flux boundary condition only on the matrix.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
const BCVectorBase * pointerToBCVector() const
Returns a pointer to the BCVector object.
void bcEssentialManageRhs(VectorType &rightHandSide, const DOF &dof, const BCBase &boundaryCond, const DataType &diagonalizeCoef, const DataType &time, UInt offset)
Prescribe Essential boundary conditions on the right hand side.